From 52b222055908a3ae23c2a9185e53919fe56b54db Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 19 Oct 2018 14:24:02 -0400 Subject: [PATCH 001/594] cmd/asm: factor out line parsing from assembling Currently cmd/asm's Parser.line both consumes a line of assembly from the lexer and assembles it. This CL separates these two steps so that the line parser can be reused for purposes other than generating a Prog stream. For #27539. Updates #17544. Change-Id: I452c9a2112fbcc1c94bf909efc0d1fcc71014812 Reviewed-on: https://go-review.googlesource.com/c/147097 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/cmd/asm/internal/asm/line_test.go | 3 +- src/cmd/asm/internal/asm/parse.go | 65 ++++++++++++++++++--------- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/src/cmd/asm/internal/asm/line_test.go b/src/cmd/asm/internal/asm/line_test.go index b77337bcf2314..7462f24a1c6d8 100644 --- a/src/cmd/asm/internal/asm/line_test.go +++ b/src/cmd/asm/internal/asm/line_test.go @@ -38,8 +38,7 @@ func testBadInstParser(t *testing.T, goarch string, tests []badInstTest) { parser := NewParser(ctxt, arch, tokenizer) err := tryParse(t, func() { - parser.start(lex.Tokenize(test.input)) - parser.line() + parser.Parse() }) switch { diff --git a/src/cmd/asm/internal/asm/parse.go b/src/cmd/asm/internal/asm/parse.go index e77db9fba1419..3620e31320903 100644 --- a/src/cmd/asm/internal/asm/parse.go +++ b/src/cmd/asm/internal/asm/parse.go @@ -91,7 +91,23 @@ func (p *Parser) pos() src.XPos { } func (p *Parser) Parse() (*obj.Prog, bool) { - for p.line() { + scratch := make([][]lex.Token, 0, 3) + for { + word, cond, operands, ok := p.line(scratch) + if !ok { + break + } + scratch = operands + + if p.pseudo(word, operands) { + continue + } + i, present := p.arch.Instructions[word] + if present { + p.instruction(i, word, cond, operands) + continue + } + p.errorf("unrecognized instruction %q", word) } if p.errorCount > 0 { return nil, false @@ -100,8 +116,17 @@ func (p *Parser) Parse() (*obj.Prog, bool) { return p.firstProg, true } -// WORD [ arg {, arg} ] (';' | '\n') -func (p *Parser) line() bool { +// line consumes a single assembly line from p.lex of the form +// +// {label:} WORD[.cond] [ arg {, arg} ] (';' | '\n') +// +// It adds any labels to p.pendingLabels and returns the word, cond, +// operand list, and true. If there is an error or EOF, it returns +// ok=false. +// +// line may reuse the memory from scratch. +func (p *Parser) line(scratch [][]lex.Token) (word, cond string, operands [][]lex.Token, ok bool) { +next: // Skip newlines. var tok lex.ScanToken for { @@ -114,24 +139,29 @@ func (p *Parser) line() bool { case '\n', ';': continue case scanner.EOF: - return false + return "", "", nil, false } break } // First item must be an identifier. if tok != scanner.Ident { p.errorf("expected identifier, found %q", p.lex.Text()) - return false // Might as well stop now. + return "", "", nil, false // Might as well stop now. } - word := p.lex.Text() - var cond string - operands := make([][]lex.Token, 0, 3) + word, cond = p.lex.Text(), "" + operands = scratch[:0] // Zero or more comma-separated operands, one per loop. nesting := 0 colon := -1 for tok != '\n' && tok != ';' { // Process one operand. - items := make([]lex.Token, 0, 3) + var items []lex.Token + if cap(operands) > len(operands) { + // Reuse scratch items slice. + items = operands[:cap(operands)][len(operands)][:0] + } else { + items = make([]lex.Token, 0, 3) + } for { tok = p.lex.Next() if len(operands) == 0 && len(items) == 0 { @@ -148,12 +178,12 @@ func (p *Parser) line() bool { if tok == ':' { // Labels. p.pendingLabels = append(p.pendingLabels, word) - return true + goto next } } if tok == scanner.EOF { p.errorf("unexpected EOF") - return false + return "", "", nil, false } // Split operands on comma. Also, the old syntax on x86 for a "register pair" // was AX:DX, for which the new syntax is DX, AX. Note the reordering. @@ -162,7 +192,7 @@ func (p *Parser) line() bool { // Remember this location so we can swap the operands below. if colon >= 0 { p.errorf("invalid ':' in operand") - return true + return word, cond, operands, true } colon = len(operands) } @@ -188,16 +218,7 @@ func (p *Parser) line() bool { p.errorf("missing operand") } } - if p.pseudo(word, operands) { - return true - } - i, present := p.arch.Instructions[word] - if present { - p.instruction(i, word, cond, operands) - return true - } - p.errorf("unrecognized instruction %q", word) - return true + return word, cond, operands, true } func (p *Parser) instruction(op obj.As, word, cond string, operands [][]lex.Token) { From ba2e8a629b36e43cc27b23470b631a1dfee0900f Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 19 Oct 2018 16:24:59 -0400 Subject: [PATCH 002/594] cmd/asm: add mode to collect symbol ABIs This adds a -symabis flag that runs the assembler in a special mode that outputs symbol definition and reference ABIs rather than assembling the code. This uses a fast and somewhat lax parser because the go_asm.h definitions may not be available. For #27539. Change-Id: I248ba0ebab7cc75dcb2a90e82a82eb445da7e88e Reviewed-on: https://go-review.googlesource.com/c/147098 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: David Chase Reviewed-by: Cherry Zhang --- src/cmd/asm/internal/asm/operand_test.go | 43 +++++++++++++ src/cmd/asm/internal/asm/parse.go | 81 ++++++++++++++++++++++++ src/cmd/asm/internal/flags/flags.go | 1 + src/cmd/asm/main.go | 22 +++++-- 4 files changed, 140 insertions(+), 7 deletions(-) diff --git a/src/cmd/asm/internal/asm/operand_test.go b/src/cmd/asm/internal/asm/operand_test.go index 69393b6b2052a..2ba3fd73df83c 100644 --- a/src/cmd/asm/internal/asm/operand_test.go +++ b/src/cmd/asm/internal/asm/operand_test.go @@ -122,6 +122,49 @@ func TestS390XOperandParser(t *testing.T) { testOperandParser(t, parser, s390xOperandTests) } +func TestFuncAddress(t *testing.T) { + type subtest struct { + arch string + tests []operandTest + } + for _, sub := range []subtest{ + {"amd64", amd64OperandTests}, + {"386", x86OperandTests}, + {"arm", armOperandTests}, + {"arm64", arm64OperandTests}, + {"ppc64", ppc64OperandTests}, + {"mips", mipsOperandTests}, + {"mips64", mips64OperandTests}, + {"s390x", s390xOperandTests}, + } { + t.Run(sub.arch, func(t *testing.T) { + parser := newParser(sub.arch) + for _, test := range sub.tests { + parser.start(lex.Tokenize(test.input)) + name, ok := parser.funcAddress() + + isFuncSym := strings.HasSuffix(test.input, "(SB)") && + // Ignore static symbols. + !strings.Contains(test.input, "<>") && + // Ignore symbols with offsets. + !strings.Contains(test.input, "+") + + wantName := "" + if isFuncSym { + // Strip $|* and (SB). + wantName = test.output[:len(test.output)-4] + if strings.HasPrefix(wantName, "$") || strings.HasPrefix(wantName, "*") { + wantName = wantName[1:] + } + } + if ok != isFuncSym || name != wantName { + t.Errorf("fail at %s as function address: got %s, %v; expected %s, %v", test.input, name, ok, wantName, isFuncSym) + } + } + }) + } +} + type operandTest struct { input, output string } diff --git a/src/cmd/asm/internal/asm/parse.go b/src/cmd/asm/internal/asm/parse.go index 3620e31320903..346976ef48b67 100644 --- a/src/cmd/asm/internal/asm/parse.go +++ b/src/cmd/asm/internal/asm/parse.go @@ -116,6 +116,22 @@ func (p *Parser) Parse() (*obj.Prog, bool) { return p.firstProg, true } +// ParseSymABIs parses p's assembly code to find text symbol +// definitions and references and writes a symabis file to w. +func (p *Parser) ParseSymABIs(w io.Writer) bool { + operands := make([][]lex.Token, 0, 3) + for { + word, _, operands1, ok := p.line(operands) + if !ok { + break + } + operands = operands1 + + p.symDefRef(w, word, operands) + } + return p.errorCount == 0 +} + // line consumes a single assembly line from p.lex of the form // // {label:} WORD[.cond] [ arg {, arg} ] (';' | '\n') @@ -258,6 +274,42 @@ func (p *Parser) pseudo(word string, operands [][]lex.Token) bool { return true } +// symDefRef scans a line for potential text symbol definitions and +// references and writes symabis information to w. +// +// The symabis format is documented at +// cmd/compile/internal/gc.readSymABIs. +func (p *Parser) symDefRef(w io.Writer, word string, operands [][]lex.Token) { + switch word { + case "TEXT": + // Defines text symbol in operands[0]. + if len(operands) > 0 { + p.start(operands[0]) + if name, ok := p.funcAddress(); ok { + fmt.Fprintf(w, "def %s ABI0\n", name) + } + } + return + case "GLOBL", "PCDATA": + // No text definitions or symbol references. + case "DATA", "FUNCDATA": + // For DATA, operands[0] is defined symbol. + // For FUNCDATA, operands[0] is an immediate constant. + // Remaining operands may have references. + if len(operands) < 2 { + return + } + operands = operands[1:] + } + // Search for symbol references. + for _, op := range operands { + p.start(op) + if name, ok := p.funcAddress(); ok { + fmt.Fprintf(w, "ref %s ABI0\n", name) + } + } +} + func (p *Parser) start(operand []lex.Token) { p.input = operand p.inputPos = 0 @@ -746,6 +798,35 @@ func (p *Parser) setPseudoRegister(addr *obj.Addr, reg string, isStatic bool, pr } } +// funcAddress parses an external function address. This is a +// constrained form of the operand syntax that's always SB-based, +// non-static, and has no additional offsets: +// +// [$|*]sym(SB) +func (p *Parser) funcAddress() (string, bool) { + switch p.peek() { + case '$', '*': + // Skip prefix. + p.next() + } + + tok := p.next() + name := tok.String() + if tok.ScanToken != scanner.Ident || p.atStartOfRegister(name) { + return "", false + } + if p.next().ScanToken != '(' { + return "", false + } + if reg := p.next(); reg.ScanToken != scanner.Ident || reg.String() != "SB" { + return "", false + } + if p.next().ScanToken != ')' || p.peek() != scanner.EOF { + return "", false + } + return name, true +} + // registerIndirect parses the general form of a register indirection. // It is can be (R1), (R2*scale), (R1)(R2*scale), (R1)(R2.SXTX<<3) or (R1)(R2<<3) // where R1 may be a simple register or register pair R:R or (R, R) or (R+R). diff --git a/src/cmd/asm/internal/flags/flags.go b/src/cmd/asm/internal/flags/flags.go index 6acde29432675..752a1d45265d3 100644 --- a/src/cmd/asm/internal/flags/flags.go +++ b/src/cmd/asm/internal/flags/flags.go @@ -22,6 +22,7 @@ var ( Shared = flag.Bool("shared", false, "generate code that can be linked into a shared library") Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries") AllErrors = flag.Bool("e", false, "no limit on number of errors reported") + SymABIs = flag.Bool("symabis", false, "write symbol ABI information to output file, don't assemble") ) var ( diff --git a/src/cmd/asm/main.go b/src/cmd/asm/main.go index 04f56f96467f8..55ae94a6de5a6 100644 --- a/src/cmd/asm/main.go +++ b/src/cmd/asm/main.go @@ -53,8 +53,10 @@ func main() { defer bio.MustClose(out) buf := bufio.NewWriter(bio.MustWriter(out)) - fmt.Fprintf(buf, "go object %s %s %s\n", objabi.GOOS, objabi.GOARCH, objabi.Version) - fmt.Fprintf(buf, "!\n") + if !*flags.SymABIs { + fmt.Fprintf(buf, "go object %s %s %s\n", objabi.GOOS, objabi.GOARCH, objabi.Version) + fmt.Fprintf(buf, "!\n") + } var ok, diag bool var failedFile string @@ -65,16 +67,22 @@ func main() { diag = true log.Printf(format, args...) } - pList := new(obj.Plist) - pList.Firstpc, ok = parser.Parse() + if *flags.SymABIs { + ok = parser.ParseSymABIs(buf) + } else { + pList := new(obj.Plist) + pList.Firstpc, ok = parser.Parse() + // reports errors to parser.Errorf + if ok { + obj.Flushplist(ctxt, pList, nil, "") + } + } if !ok { failedFile = f break } - // reports errors to parser.Errorf - obj.Flushplist(ctxt, pList, nil, "") } - if ok { + if ok && !*flags.SymABIs { obj.WriteObjFile(ctxt, buf) } if !ok || diag { From 97e4010fd4b8094aa0b4498ad751e4c07ea8a1aa Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 22 Oct 2018 10:10:23 -0400 Subject: [PATCH 003/594] cmd/compile: accept and parse symabis This doesn't yet do anything with this information. For #27539. Change-Id: Ia12c905812aa1ed425eedd6ab2f55ec75d81c0ce Reviewed-on: https://go-review.googlesource.com/c/147099 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: David Chase Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/gc/main.go | 82 +++++++++++++++++++++++++++++ src/cmd/internal/obj/abi_string.go | 16 ++++++ src/cmd/internal/obj/link.go | 22 ++++++++ 3 files changed, 120 insertions(+) create mode 100644 src/cmd/internal/obj/abi_string.go diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 78142d3bf82bc..55d6d55e6dfc8 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -247,6 +247,9 @@ func Main(archInit func(*Arch)) { flag.Int64Var(&memprofilerate, "memprofilerate", 0, "set runtime.MemProfileRate to `rate`") var goversion string flag.StringVar(&goversion, "goversion", "", "required version of the runtime") + var symabisPath string + flag.StringVar(&symabisPath, "symabis", "", "read symbol ABIs from `file`") + flag.BoolVar(&allABIs, "allabis", false, "generate ABI wrappers for all symbols (for bootstrap)") flag.StringVar(&traceprofile, "traceprofile", "", "write an execution trace to `file`") flag.StringVar(&blockprofile, "blockprofile", "", "write block profile to `file`") flag.StringVar(&mutexprofile, "mutexprofile", "", "write mutex profile to `file`") @@ -285,6 +288,10 @@ func Main(archInit func(*Arch)) { checkLang() + if symabisPath != "" { + readSymABIs(symabisPath, myimportpath) + } + thearch.LinkArch.Init(Ctxt) if outfile == "" { @@ -810,6 +817,81 @@ func readImportCfg(file string) { } } +// symabiDefs and symabiRefs record the defined and referenced ABIs of +// symbols required by non-Go code. These are keyed by link symbol +// name, where the local package prefix is always `"".` +var symabiDefs, symabiRefs map[string]obj.ABI + +// allABIs indicates that all symbol definitions should have ABI +// wrappers. This is used during toolchain bootstrapping to avoid +// having to find cross-package references. +var allABIs bool + +// readSymABIs reads a symabis file that specifies definitions and +// references of text symbols by ABI. +// +// The symabis format is a set of lines, where each line is a sequence +// of whitespace-separated fields. The first field is a verb and is +// either "def" for defining a symbol ABI or "ref" for referencing a +// symbol using an ABI. For both "def" and "ref", the second field is +// the symbol name and the third field is the ABI name, as one of the +// named cmd/internal/obj.ABI constants. +func readSymABIs(file, myimportpath string) { + data, err := ioutil.ReadFile(file) + if err != nil { + log.Fatalf("-symabis: %v", err) + } + + symabiDefs = make(map[string]obj.ABI) + symabiRefs = make(map[string]obj.ABI) + + localPrefix := "" + if myimportpath != "" { + // Symbols in this package may be written either as + // "".X or with the package's import path already in + // the symbol. + localPrefix = objabi.PathToPrefix(myimportpath) + "." + } + + for lineNum, line := range strings.Split(string(data), "\n") { + lineNum++ // 1-based + line = strings.TrimSpace(line) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + + parts := strings.Fields(line) + switch parts[0] { + case "def", "ref": + // Parse line. + if len(parts) != 3 { + log.Fatalf(`%s:%d: invalid symabi: syntax is "%s sym abi"`, file, lineNum, parts[0]) + } + sym, abi := parts[1], parts[2] + if abi != "ABI0" { // Only supported external ABI right now + log.Fatalf(`%s:%d: invalid symabi: unknown abi "%s"`, file, lineNum, abi) + } + + // If the symbol is already prefixed with + // myimportpath, rewrite it to start with "" + // so it matches the compiler's internal + // symbol names. + if localPrefix != "" && strings.HasPrefix(sym, localPrefix) { + sym = `"".` + sym[len(localPrefix):] + } + + // Record for later. + if parts[0] == "def" { + symabiDefs[sym] = obj.ABI0 + } else { + symabiRefs[sym] = obj.ABI0 + } + default: + log.Fatalf(`%s:%d: invalid symabi type "%s"`, file, lineNum, parts[0]) + } + } +} + func saveerrors() { nsavederrors += nerrors nerrors = 0 diff --git a/src/cmd/internal/obj/abi_string.go b/src/cmd/internal/obj/abi_string.go new file mode 100644 index 0000000000000..a439da36a34ee --- /dev/null +++ b/src/cmd/internal/obj/abi_string.go @@ -0,0 +1,16 @@ +// Code generated by "stringer -type ABI"; DO NOT EDIT. + +package obj + +import "strconv" + +const _ABI_name = "ABI0ABIInternalABICount" + +var _ABI_index = [...]uint8{0, 4, 15, 23} + +func (i ABI) String() string { + if i >= ABI(len(_ABI_index)-1) { + return "ABI(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _ABI_name[_ABI_index[i]:_ABI_index[i+1]] +} diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index d924cbc21424b..d3721dd023466 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -409,6 +409,28 @@ type FuncInfo struct { StackObjects *LSym } +//go:generate stringer -type ABI + +// ABI is the calling convention of a text symbol. +type ABI uint8 + +const ( + // ABI0 is the stable stack-based ABI. It's important that the + // value of this is "0": we can't distinguish between + // references to data and ABI0 text symbols in assembly code, + // and hence this doesn't distinguish between symbols without + // an ABI and text symbols with ABI0. + ABI0 ABI = iota + + // ABIInternal is the internal ABI that may change between Go + // versions. All Go functions use the internal ABI and the + // compiler generates wrappers for calls to and from other + // ABIs. + ABIInternal + + ABICount +) + // Attribute is a set of symbol attributes. type Attribute int16 From 7f1dd3ae4df08a8619311c95f3e4c91b96132efd Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 1 Nov 2018 22:04:02 -0400 Subject: [PATCH 004/594] test: minor simplification to run.go This is a little clearer, and we're about to need the .s file list in one more place, so this will cut down on duplication. Change-Id: I4da8bf03a0469fb97565b0841c40d505657b574e Reviewed-on: https://go-review.googlesource.com/c/146998 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- test/run.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/test/run.go b/test/run.go index b6421d5e419c4..6a050b0049d7c 100644 --- a/test/run.go +++ b/test/run.go @@ -796,14 +796,14 @@ func (t *test) run() { t.err = dirErr break } - var gos []os.FileInfo - var asms []os.FileInfo + var gos []string + var asms []string for _, file := range files { switch filepath.Ext(file.Name()) { case ".go": - gos = append(gos, file) + gos = append(gos, filepath.Join(longdir, file.Name())) case ".s": - asms = append(asms, file) + asms = append(asms, filepath.Join(longdir, file.Name())) } } @@ -812,9 +812,7 @@ func (t *test) run() { if len(asms) > 0 { cmd = append(cmd, "-asmhdr", "go_asm.h") } - for _, file := range gos { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } + cmd = append(cmd, gos...) _, err := runcmd(cmd...) if err != nil { t.err = err @@ -823,9 +821,7 @@ func (t *test) run() { objs = append(objs, "go.o") if len(asms) > 0 { cmd = []string{goTool(), "tool", "asm", "-e", "-I", ".", "-o", "asm.o"} - for _, file := range asms { - cmd = append(cmd, filepath.Join(longdir, file.Name())) - } + cmd = append(cmd, asms...) _, err = runcmd(cmd...) if err != nil { t.err = err From 0f5dfbcfd789c2217f40dc59d1882149a8502960 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 22 Oct 2018 11:21:56 -0400 Subject: [PATCH 005/594] cmd/go, cmd/dist: plumb symabis from assembler to compiler For #27539. Change-Id: I0e27f142224e820205fb0e65ad03be7eba93da14 Reviewed-on: https://go-review.googlesource.com/c/146999 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/dist/build.go | 79 +++++++++++++++++++------------ src/cmd/go/internal/work/exec.go | 23 +++++++-- src/cmd/go/internal/work/gc.go | 41 ++++++++++++++-- src/cmd/go/internal/work/gccgo.go | 6 ++- test/run.go | 15 +++++- 5 files changed, 124 insertions(+), 40 deletions(-) diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 49f4a5e6a7d6a..08cdbf2694472 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -9,6 +9,7 @@ import ( "encoding/json" "flag" "fmt" + "io/ioutil" "log" "os" "os/exec" @@ -682,7 +683,7 @@ func runInstall(dir string, ch chan struct{}) { } // Is the target up-to-date? - var gofiles, missing []string + var gofiles, sfiles, missing []string stale := rebuildall files = filter(files, func(p string) bool { for _, suf := range depsuffix { @@ -698,6 +699,8 @@ func runInstall(dir string, ch chan struct{}) { } if strings.HasSuffix(p, ".go") { gofiles = append(gofiles, p) + } else if strings.HasSuffix(p, ".s") { + sfiles = append(sfiles, p) } if t.After(ttarg) { stale = true @@ -778,10 +781,42 @@ func runInstall(dir string, ch chan struct{}) { return } + asmArgs := []string{ + pathf("%s/asm", tooldir), + "-I", workdir, + "-I", pathf("%s/pkg/include", goroot), + "-D", "GOOS_" + goos, + "-D", "GOARCH_" + goarch, + "-D", "GOOS_GOARCH_" + goos + "_" + goarch, + } + if goarch == "mips" || goarch == "mipsle" { + // Define GOMIPS_value from gomips. + asmArgs = append(asmArgs, "-D", "GOMIPS_"+gomips) + } + if goarch == "mips64" || goarch == "mipsle64" { + // Define GOMIPS64_value from gomips64. + asmArgs = append(asmArgs, "-D", "GOMIPS64_"+gomips64) + } + goasmh := pathf("%s/go_asm.h", workdir) + + // Collect symabis from assembly code. + var symabis string + if len(sfiles) > 0 { + symabis = pathf("%s/symabis", workdir) + var wg sync.WaitGroup + asmabis := append(asmArgs[:len(asmArgs):len(asmArgs)], "-symabis", "-o", symabis) + asmabis = append(asmabis, sfiles...) + if err := ioutil.WriteFile(goasmh, nil, 0666); err != nil { + fatalf("cannot write empty go_asm.h: %s", err) + } + bgrun(&wg, path, asmabis...) + bgwait(&wg) + } + var archive string // The next loop will compile individual non-Go files. // Hand the Go files to the compiler en masse. - // For package runtime, this writes go_asm.h, which + // For packages containing assembly, this writes go_asm.h, which // the assembly files will need. pkg := dir if strings.HasPrefix(dir, "cmd/") && strings.Count(dir, "/") == 1 { @@ -794,18 +829,22 @@ func runInstall(dir string, ch chan struct{}) { } else { archive = b } + + // Compile Go code. compile := []string{pathf("%s/compile", tooldir), "-std", "-pack", "-o", b, "-p", pkg} if gogcflags != "" { compile = append(compile, strings.Fields(gogcflags)...) } if dir == "runtime" { - compile = append(compile, "-+", "-asmhdr", pathf("%s/go_asm.h", workdir)) + compile = append(compile, "-+") + } + if len(sfiles) > 0 { + compile = append(compile, "-asmhdr", goasmh) } - if dir == "internal/bytealg" { - // TODO: why don't we generate go_asm.h for all packages - // that have any assembly? - compile = append(compile, "-asmhdr", pathf("%s/go_asm.h", workdir)) + if symabis != "" { + compile = append(compile, "-symabis", symabis) } + compile = append(compile, gofiles...) var wg sync.WaitGroup // We use bgrun and immediately wait for it instead of calling run() synchronously. @@ -815,31 +854,9 @@ func runInstall(dir string, ch chan struct{}) { bgwait(&wg) // Compile the files. - for _, p := range files { - if !strings.HasSuffix(p, ".s") { - continue - } - - var compile []string + for _, p := range sfiles { // Assembly file for a Go package. - compile = []string{ - pathf("%s/asm", tooldir), - "-I", workdir, - "-I", pathf("%s/pkg/include", goroot), - "-D", "GOOS_" + goos, - "-D", "GOARCH_" + goarch, - "-D", "GOOS_GOARCH_" + goos + "_" + goarch, - } - - if goarch == "mips" || goarch == "mipsle" { - // Define GOMIPS_value from gomips. - compile = append(compile, "-D", "GOMIPS_"+gomips) - } - - if goarch == "mips64" || goarch == "mipsle64" { - // Define GOMIPS64_value from gomips64. - compile = append(compile, "-D", "GOMIPS64_"+gomips64) - } + compile := asmArgs[:len(asmArgs):len(asmArgs)] doclean := true b := pathf("%s/%s", workdir, filepath.Base(p)) diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 92e814ee6f265..a7f9058b58e87 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -601,6 +601,12 @@ func (b *Builder) build(a *Action) (err error) { return nil } + // Collect symbol ABI requirements from assembly. + symabis, err := BuildToolchain.symabis(b, a, sfiles) + if err != nil { + return err + } + // Prepare Go import config. // We start it off with a comment so it can't be empty, so icfg.Bytes() below is never nil. // It should never be empty anyway, but there have been bugs in the past that resulted @@ -632,7 +638,7 @@ func (b *Builder) build(a *Action) (err error) { // Compile Go. objpkg := objdir + "_pkg_.a" - ofile, out, err := BuildToolchain.gc(b, a, objpkg, icfg.Bytes(), len(sfiles) > 0, gofiles) + ofile, out, err := BuildToolchain.gc(b, a, objpkg, icfg.Bytes(), symabis, len(sfiles) > 0, gofiles) if len(out) > 0 { output := b.processOutput(out) if p.Module != nil && !allowedVersion(p.Module.GoVersion) { @@ -1967,13 +1973,18 @@ func mkAbs(dir, f string) string { type toolchain interface { // gc runs the compiler in a specific directory on a set of files // and returns the name of the generated output file. - gc(b *Builder, a *Action, archive string, importcfg []byte, asmhdr bool, gofiles []string) (ofile string, out []byte, err error) + // + // TODO: This argument list is long. Consider putting it in a struct. + gc(b *Builder, a *Action, archive string, importcfg []byte, symabis string, asmhdr bool, gofiles []string) (ofile string, out []byte, err error) // cc runs the toolchain's C compiler in a directory on a C file // to produce an output file. cc(b *Builder, a *Action, ofile, cfile string) error // asm runs the assembler in a specific directory on specific files // and returns a list of named output files. asm(b *Builder, a *Action, sfiles []string) ([]string, error) + // symabis scans the symbol ABIs from sfiles and returns the + // path to the output symbol ABIs file, or "" if none. + symabis(b *Builder, a *Action, sfiles []string) (string, error) // pack runs the archive packer in a specific directory to create // an archive from a set of object files. // typically it is run in the object directory. @@ -2004,7 +2015,7 @@ func (noToolchain) linker() string { return "" } -func (noToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, asmhdr bool, gofiles []string) (ofile string, out []byte, err error) { +func (noToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, symabis string, asmhdr bool, gofiles []string) (ofile string, out []byte, err error) { return "", nil, noCompiler() } @@ -2012,6 +2023,10 @@ func (noToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error) return nil, noCompiler() } +func (noToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) { + return "", noCompiler() +} + func (noToolchain) pack(b *Builder, a *Action, afile string, ofiles []string) error { return noCompiler() } @@ -2695,7 +2710,7 @@ func (b *Builder) swigDoIntSize(objdir string) (intsize string, err error) { p := load.GoFilesPackage(srcs) - if _, _, e := BuildToolchain.gc(b, &Action{Mode: "swigDoIntSize", Package: p, Objdir: objdir}, "", nil, false, srcs); e != nil { + if _, _, e := BuildToolchain.gc(b, &Action{Mode: "swigDoIntSize", Package: p, Objdir: objdir}, "", nil, "", false, srcs); e != nil { return "32", nil } return "64", nil diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index 5a0bd1c2cf108..fed4a0b8cf266 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -36,7 +36,7 @@ func (gcToolchain) linker() string { return base.Tool("link") } -func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, asmhdr bool, gofiles []string) (ofile string, output []byte, err error) { +func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, symabis string, asmhdr bool, gofiles []string) (ofile string, output []byte, err error) { p := a.Package objdir := a.Objdir if archive != "" { @@ -98,6 +98,9 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, a if strings.HasPrefix(runtimeVersion, "go1") && !strings.Contains(os.Args[0], "go_bootstrap") { gcargs = append(gcargs, "-goversion", runtimeVersion) } + if symabis != "" { + gcargs = append(gcargs, "-symabis", symabis) + } gcflags := str.StringList(forcedGcflags, p.Internal.Gcflags) if compilingRuntime { @@ -218,8 +221,7 @@ func trimDir(dir string) string { return dir } -func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error) { - p := a.Package +func asmArgs(a *Action, p *load.Package) []interface{} { // Add -I pkg/GOOS_GOARCH so #include "textflag.h" works in .s files. inc := filepath.Join(cfg.GOROOT, "pkg", "include") args := []interface{}{cfg.BuildToolexec, base.Tool("asm"), "-trimpath", trimDir(a.Objdir), "-I", a.Objdir, "-I", inc, "-D", "GOOS_" + cfg.Goos, "-D", "GOARCH_" + cfg.Goarch, forcedAsmflags, p.Internal.Asmflags} @@ -241,6 +243,13 @@ func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error) args = append(args, "-D", "GOMIPS64_"+cfg.GOMIPS64) } + return args +} + +func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error) { + p := a.Package + args := asmArgs(a, p) + var ofiles []string for _, sfile := range sfiles { ofile := a.Objdir + sfile[:len(sfile)-len(".s")] + ".o" @@ -253,6 +262,32 @@ func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error) return ofiles, nil } +func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) { + if len(sfiles) == 0 { + return "", nil + } + + p := a.Package + symabis := a.Objdir + "symabis" + args := asmArgs(a, p) + args = append(args, "-symabis", "-o", symabis) + for _, sfile := range sfiles { + args = append(args, mkAbs(p.Dir, sfile)) + } + + // Supply an empty go_asm.h as if the compiler had been run. + // -symabis parsing is lax enough that we don't need the + // actual definitions that would appear in go_asm.h. + if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil { + return "", err + } + + if err := b.run(a, p.Dir, p.ImportPath, nil, args...); err != nil { + return "", err + } + return symabis, nil +} + // toolVerify checks that the command line args writes the same output file // if run using newTool instead. // Unused now but kept around for future use. diff --git a/src/cmd/go/internal/work/gccgo.go b/src/cmd/go/internal/work/gccgo.go index b89d07ead0a38..784a4ae1b3fa5 100644 --- a/src/cmd/go/internal/work/gccgo.go +++ b/src/cmd/go/internal/work/gccgo.go @@ -51,7 +51,7 @@ func checkGccgoBin() { os.Exit(2) } -func (tools gccgoToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, asmhdr bool, gofiles []string) (ofile string, output []byte, err error) { +func (tools gccgoToolchain) gc(b *Builder, a *Action, archive string, importcfg []byte, symabis string, asmhdr bool, gofiles []string) (ofile string, output []byte, err error) { p := a.Package objdir := a.Objdir out := "_go_.o" @@ -172,6 +172,10 @@ func (tools gccgoToolchain) asm(b *Builder, a *Action, sfiles []string) ([]strin return ofiles, nil } +func (gccgoToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) { + return "", nil +} + func gccgoArchive(basedir, imp string) string { end := filepath.FromSlash(imp + ".a") afile := filepath.Join(basedir, end) diff --git a/test/run.go b/test/run.go index 6a050b0049d7c..a01fd6a9574ce 100644 --- a/test/run.go +++ b/test/run.go @@ -807,10 +807,23 @@ func (t *test) run() { } } + if len(asms) > 0 { + if err := ioutil.WriteFile(filepath.Join(longdir, "go_asm.h"), nil, 0666); err != nil { + t.err = fmt.Errorf("write empty go_asm.h: %s", err) + return + } + cmd := []string{goTool(), "tool", "asm", "-symabis", "-o", "symabis"} + cmd = append(cmd, asms...) + _, err = runcmd(cmd...) + if err != nil { + t.err = err + break + } + } var objs []string cmd := []string{goTool(), "tool", "compile", "-e", "-D", ".", "-I", ".", "-o", "go.o"} if len(asms) > 0 { - cmd = append(cmd, "-asmhdr", "go_asm.h") + cmd = append(cmd, "-asmhdr", "go_asm.h", "-symabis", "symabis") } cmd = append(cmd, gos...) _, err := runcmd(cmd...) From 07544c7e80a7559973930befca8c8744f43df3ce Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 2 Nov 2018 16:38:52 -0400 Subject: [PATCH 006/594] cmd/go, cmd/dist: collect known cross-package uses of runtime symbols This extends cmd/go's symabis support to collect known cross-package uses of runtime symbols from other "basically runtime" packages in std. This avoids having to declare a large number of ABI0 symbols in the runtime for a small number of known cross-package references. For cmd/dist, we use a simpler but less efficient approach and tell the compiler to generate ABI wrappers for everything. Change-Id: Ifaed94efdcff42e7345ab11b4d2fb880fb1a24e8 Reviewed-on: https://go-review.googlesource.com/c/147257 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/dist/build.go | 7 +++ src/cmd/go/internal/work/exec.go | 19 ++++++++ src/cmd/go/internal/work/gc.go | 80 ++++++++++++++++++++++++++------ 3 files changed, 91 insertions(+), 15 deletions(-) diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 08cdbf2694472..a94a43fd66459 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -844,6 +844,13 @@ func runInstall(dir string, ch chan struct{}) { if symabis != "" { compile = append(compile, "-symabis", symabis) } + if dir == "runtime" || dir == "runtime/internal/atomic" { + // These packages define symbols referenced by + // assembly in other packages. In cmd/go, we work out + // the exact details. For bootstrapping, just tell the + // compiler to generate ABI wrappers for everything. + compile = append(compile, "-allabis") + } compile = append(compile, gofiles...) var wg sync.WaitGroup diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index a7f9058b58e87..d31f96591b727 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -1618,6 +1618,25 @@ func (b *Builder) writeFile(file string, text []byte) error { return ioutil.WriteFile(file, text, 0666) } +// appendFile appends the text to file. +func (b *Builder) appendFile(file string, text []byte) error { + if cfg.BuildN || cfg.BuildX { + b.Showcmd("", "cat >>%s << 'EOF' # internal\n%sEOF", file, text) + } + if cfg.BuildN { + return nil + } + f, err := os.OpenFile(file, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666) + if err != nil { + return err + } + defer f.Close() + if _, err = f.Write(text); err != nil { + return err + } + return f.Close() +} + // Install the cgo export header file, if there is one. func (b *Builder) installHeader(a *Action) error { src := a.Objdir + "_cgo_install.h" diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index fed4a0b8cf266..89ef2da8cb59f 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -263,28 +263,78 @@ func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error) } func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) { - if len(sfiles) == 0 { - return "", nil + mkSymabis := func(p *load.Package, sfiles []string, path string) error { + args := asmArgs(a, p) + args = append(args, "-symabis", "-o", path) + for _, sfile := range sfiles { + if p.ImportPath == "runtime/cgo" && strings.HasPrefix(sfile, "gcc_") { + continue + } + args = append(args, mkAbs(p.Dir, sfile)) + } + + // Supply an empty go_asm.h as if the compiler had been run. + // -symabis parsing is lax enough that we don't need the + // actual definitions that would appear in go_asm.h. + if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil { + return err + } + + return b.run(a, p.Dir, p.ImportPath, nil, args...) } + var symabis string // Only set if we actually create the file p := a.Package - symabis := a.Objdir + "symabis" - args := asmArgs(a, p) - args = append(args, "-symabis", "-o", symabis) - for _, sfile := range sfiles { - args = append(args, mkAbs(p.Dir, sfile)) + if len(sfiles) != 0 { + symabis = a.Objdir + "symabis" + if err := mkSymabis(p, sfiles, symabis); err != nil { + return "", err + } } - // Supply an empty go_asm.h as if the compiler had been run. - // -symabis parsing is lax enough that we don't need the - // actual definitions that would appear in go_asm.h. - if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil { - return "", err - } + // Gather known cross-package references from assembly code. + var otherPkgs []string + if p.ImportPath == "runtime" { + // Assembly in syscall and runtime/cgo references + // symbols in runtime. + otherPkgs = []string{"syscall", "runtime/cgo"} + } else if p.ImportPath == "runtime/internal/atomic" { + // sync/atomic is an assembly wrapper around + // runtime/internal/atomic. + otherPkgs = []string{"sync/atomic"} + } + for _, p2name := range otherPkgs { + p2 := load.LoadPackage(p2name, &load.ImportStack{}) + if len(p2.SFiles) == 0 { + continue + } + + symabis2 := a.Objdir + "symabis2" + if err := mkSymabis(p2, p2.SFiles, symabis2); err != nil { + return "", err + } - if err := b.run(a, p.Dir, p.ImportPath, nil, args...); err != nil { - return "", err + // Filter out just the symbol refs and append them to + // the symabis file. + abis2, err := ioutil.ReadFile(symabis2) + if err != nil { + return "", err + } + var refs bytes.Buffer + for _, line := range strings.Split(string(abis2), "\n") { + fs := strings.Fields(line) + if len(fs) >= 2 && fs[0] == "ref" && !strings.HasPrefix(fs[1], `"".`) { + fmt.Fprintf(&refs, "%s\n", line) + } + } + if refs.Len() != 0 { + symabis = a.Objdir + "symabis" + if err := b.appendFile(symabis, refs.Bytes()); err != nil { + return "", err + } + } } + return symabis, nil } From c5718b6b261a66aa47312037f17281d3d810c98c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 26 Oct 2018 13:53:02 -0400 Subject: [PATCH 007/594] cmd/internal/obj, cmd/link: record ABIs and aliases in Go obj files This repurposes the "version" field of a symbol reference in the Go object file format to be an ABI field. Currently, this is just 0 or 1 depending on whether the symbol is static (the linker turns it into a different internal version number), so it's already only tenuously a symbol version. We change this to be -1 for static symbols and otherwise by the ABI number. This also adds a separate list of ABI alias symbols to be recorded in the object file. The ABI aliases must be a separate list and not just part of the symbol definitions because it's possible to have a symbol defined in one package and the alias "defined" in a different package. For example, this can happen if a symbol is defined in assembly in one package and stubbed in a different package. The stub triggers the generation of the ABI alias, but in a different package from the definition. For #27539. Change-Id: I015c9fe54690c027de6ef77e22b5585976a01587 Reviewed-on: https://go-review.googlesource.com/c/147157 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/internal/goobj/read.go | 29 ++++++++++++++++------ src/cmd/internal/obj/link.go | 31 +++++++++++++++++++++++- src/cmd/internal/obj/objfile.go | 19 ++++++++++++--- src/cmd/internal/objabi/doc.go | 8 +++--- src/cmd/link/internal/objfile/objfile.go | 20 +++++++++------ src/cmd/link/internal/sym/symbol.go | 15 +++++++++++- 6 files changed, 96 insertions(+), 26 deletions(-) diff --git a/src/cmd/internal/goobj/read.go b/src/cmd/internal/goobj/read.go index 2d618eefa557a..2081098ca8f80 100644 --- a/src/cmd/internal/goobj/read.go +++ b/src/cmd/internal/goobj/read.go @@ -288,18 +288,31 @@ func (r *objReader) readSymID() SymID { } func (r *objReader) readRef() { - name, vers := r.readString(), r.readInt() + name, abiOrStatic := r.readString(), r.readInt() // In a symbol name in an object file, "". denotes the // prefix for the package in which the object file has been found. // Expand it. name = strings.ReplaceAll(name, `"".`, r.pkgprefix) - // An individual object file only records version 0 (extern) or 1 (static). - // To make static symbols unique across all files being read, we - // replace version 1 with the version corresponding to the current - // file number. The number is incremented on each call to parseObject. - if vers != 0 { + // The ABI field records either the ABI or -1 for static symbols. + // + // To distinguish different static symbols with the same name, + // we use the symbol "version". Version 0 corresponds to + // global symbols, and each file has a unique version > 0 for + // all of its static symbols. The version is incremented on + // each call to parseObject. + // + // For global symbols, we currently ignore the ABI. + // + // TODO(austin): Record the ABI in SymID. Since this is a + // public API, we'll have to keep Version as 0 and record the + // ABI in a new field (which differs from how the linker does + // this, but that's okay). Show the ABI in things like + // objdump. + var vers int64 + if abiOrStatic == -1 { + // Static symbol vers = r.p.MaxVersion } r.p.SymRefs = append(r.p.SymRefs, SymID{name, vers}) @@ -487,7 +500,7 @@ func (r *objReader) parseObject(prefix []byte) error { // TODO: extract OS + build ID if/when we need it r.readFull(r.tmp[:8]) - if !bytes.Equal(r.tmp[:8], []byte("\x00\x00go19ld")) { + if !bytes.Equal(r.tmp[:8], []byte("\x00go112ld")) { return r.error(errCorruptObject) } @@ -602,7 +615,7 @@ func (r *objReader) parseObject(prefix []byte) error { } r.readFull(r.tmp[:7]) - if !bytes.Equal(r.tmp[:7], []byte("\xffgo19ld")) { + if !bytes.Equal(r.tmp[:7], []byte("go112ld")) { return r.error(errCorruptObject) } diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index d3721dd023466..2989831a0a63b 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -432,7 +432,7 @@ const ( ) // Attribute is a set of symbol attributes. -type Attribute int16 +type Attribute uint16 const ( AttrDuplicateOK Attribute = 1 << iota @@ -468,6 +468,13 @@ const ( // For function symbols; indicates that the specified function was the // target of an inline during compilation AttrWasInlined + + // attrABIBase is the value at which the ABI is encoded in + // Attribute. This must be last; all bits after this are + // assumed to be an ABI value. + // + // MUST BE LAST since all bits above this comprise the ABI. + attrABIBase ) func (a Attribute) DuplicateOK() bool { return a&AttrDuplicateOK != 0 } @@ -493,6 +500,12 @@ func (a *Attribute) Set(flag Attribute, value bool) { } } +func (a Attribute) ABI() ABI { return ABI(a / attrABIBase) } +func (a *Attribute) SetABI(abi ABI) { + const mask = 1 // Only one ABI bit for now. + *a = (*a &^ (mask * attrABIBase)) | Attribute(abi)*attrABIBase +} + var textAttrStrings = [...]struct { bit Attribute s string @@ -524,6 +537,12 @@ func (a Attribute) TextAttrString() string { a &^= x.bit } } + switch a.ABI() { + case ABI0: + case ABIInternal: + s += "ABIInternal|" + a.SetABI(0) // Clear ABI so we don't print below. + } if a != 0 { s += fmt.Sprintf("UnknownAttribute(%d)|", a) } @@ -606,6 +625,16 @@ type Link struct { // state for writing objects Text []*LSym Data []*LSym + + // ABIAliases are text symbols that should be aliased to all + // ABIs. These symbols may only be referenced and not defined + // by this object, since the need for an alias may appear in a + // different object than the definition. Hence, this + // information can't be carried in the symbol definition. + // + // TODO(austin): Replace this with ABI wrappers once the ABIs + // actually diverge. + ABIAliases []*LSym } func (ctxt *Link) Diag(format string, args ...interface{}) { diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 3c72f543ccb37..94334d8361b5e 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -82,7 +82,7 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) { w := newObjWriter(ctxt, b) // Magic header - w.wr.WriteString("\x00\x00go19ld") + w.wr.WriteString("\x00go112ld") // Version w.wr.WriteByte(1) @@ -102,6 +102,10 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) { w.writeRefs(s) w.addLengths(s) } + for _, s := range ctxt.ABIAliases { + w.writeRefs(s) + w.addLengths(s) + } // End symbol references w.wr.WriteByte(0xff) @@ -137,9 +141,12 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) { for _, s := range ctxt.Data { w.writeSym(s) } + for _, s := range ctxt.ABIAliases { + w.writeSym(s) + } // Magic footer - w.wr.WriteString("\xff\xffgo19ld") + w.wr.WriteString("\xffgo112ld") } // Symbols are prefixed so their content doesn't get confused with the magic footer. @@ -155,8 +162,12 @@ func (w *objWriter) writeRef(s *LSym, isPath bool) { } else { w.writeString(s.Name) } - // Write "version". - w.writeBool(s.Static()) + // Write ABI/static information. + abi := int64(s.ABI()) + if s.Static() { + abi = -1 + } + w.writeInt(abi) w.nRefs++ s.RefIdx = w.nRefs } diff --git a/src/cmd/internal/objabi/doc.go b/src/cmd/internal/objabi/doc.go index 7bd5ff63e562c..03dc9fb88bc76 100644 --- a/src/cmd/internal/objabi/doc.go +++ b/src/cmd/internal/objabi/doc.go @@ -22,7 +22,7 @@ // // The file format is: // -// - magic header: "\x00\x00go19ld" +// - magic header: "\x00go112ld" // - byte 1 - version number // - sequence of strings giving dependencies (imported packages) // - empty string (marks end of sequence) @@ -38,7 +38,7 @@ // - data, the content of the defined symbols // - sequence of defined symbols // - byte 0xff (marks end of sequence) -// - magic footer: "\xff\xffgo19ld" +// - magic footer: "\xffgo112ld" // // All integers are stored in a zigzag varint format. // See golang.org/s/go12symtab for a definition. @@ -46,7 +46,7 @@ // Data blocks and strings are both stored as an integer // followed by that many bytes. // -// A symbol reference is a string name followed by a version. +// A symbol reference is a string name followed by an ABI or -1 for static. // // A symbol points to other symbols using an index into the symbol // reference sequence. Index 0 corresponds to a nil symbol pointer. @@ -57,7 +57,7 @@ // // - byte 0xfe (sanity check for synchronization) // - type [byte] -// - name & version [symref index] +// - name & ABI [symref index] // - flags [int] // 1<<0 dupok // 1<<1 local diff --git a/src/cmd/link/internal/objfile/objfile.go b/src/cmd/link/internal/objfile/objfile.go index 3a8923b07333f..77c3a7f9148c4 100644 --- a/src/cmd/link/internal/objfile/objfile.go +++ b/src/cmd/link/internal/objfile/objfile.go @@ -13,6 +13,7 @@ import ( "bytes" "cmd/internal/bio" "cmd/internal/dwarf" + "cmd/internal/obj" "cmd/internal/objabi" "cmd/internal/sys" "cmd/link/internal/sym" @@ -23,8 +24,8 @@ import ( ) const ( - startmagic = "\x00\x00go19ld" - endmagic = "\xff\xffgo19ld" + startmagic = "\x00go112ld" + endmagic = "\xffgo112ld" ) var emptyPkg = []byte(`"".`) @@ -382,17 +383,20 @@ func (r *objReader) readRef() { log.Fatalf("readSym out of sync") } name := r.readSymName() - v := r.readInt() - if v != 0 && v != 1 { - log.Fatalf("invalid symbol version for %q: %d", name, v) - } - if v == 1 { + var v int + if abi := r.readInt(); abi == -1 { + // Static v = r.localSymVersion + } else if abiver := sym.ABIToVersion(obj.ABI(abi)); abiver != -1 { + // Note that data symbols are "ABI0", which maps to version 0. + v = abiver + } else { + log.Fatalf("invalid symbol ABI for %q: %d", name, abi) } s := r.syms.Lookup(name, v) r.refs = append(r.refs, s) - if s == nil || v != 0 { + if s == nil || v == r.localSymVersion { return } if s.Name[0] == '$' && len(s.Name) > 5 && s.Type == 0 && len(s.P) == 0 { diff --git a/src/cmd/link/internal/sym/symbol.go b/src/cmd/link/internal/sym/symbol.go index 4faa991463b08..5e5fca467da2e 100644 --- a/src/cmd/link/internal/sym/symbol.go +++ b/src/cmd/link/internal/sym/symbol.go @@ -5,6 +5,7 @@ package sym import ( + "cmd/internal/obj" "cmd/internal/objabi" "cmd/internal/sys" "debug/elf" @@ -52,9 +53,21 @@ type AuxSymbol struct { } const ( - SymVerStatic = 10 // Minimum version used by static (file-local) syms + SymVerABI0 = 0 + SymVerABIInternal = 1 + SymVerStatic = 10 // Minimum version used by static (file-local) syms ) +func ABIToVersion(abi obj.ABI) int { + switch abi { + case obj.ABI0: + return SymVerABI0 + case obj.ABIInternal: + return SymVerABIInternal + } + return -1 +} + func (s *Symbol) String() string { if s.Version == 0 { return s.Name From 16e6cd9a4dc499db164624a048f25e2f382ac016 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 1 Nov 2018 12:20:28 -0400 Subject: [PATCH 008/594] cmd/compile: mark function Syms In order to mark the obj.LSyms produced by the compiler with the correct ABI, we need to know which types.Syms refer to function symbols. This CL adds a flag to types.Syms to mark symbols for functions, and sets this flag everywhere we create a PFUNC-class node, and in the one place where we directly create function symbols without always wrapping them in a PFUNC node (methodSym). We'll use this information to construct obj.LSyms with correct ABI information. For #27539. Change-Id: Ie3ac8bf3da013e449e78f6ca85546a055f275463 Reviewed-on: https://go-review.googlesource.com/c/147158 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: David Chase Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/alg.go | 1 + src/cmd/compile/internal/gc/dcl.go | 9 ++++++++- src/cmd/compile/internal/gc/export.go | 3 +++ src/cmd/compile/internal/gc/iimport.go | 1 + src/cmd/compile/internal/gc/main.go | 5 +++++ src/cmd/compile/internal/gc/ssa.go | 1 + src/cmd/compile/internal/gc/subr.go | 1 + src/cmd/compile/internal/gc/typecheck.go | 1 + src/cmd/compile/internal/gc/walk.go | 1 + src/cmd/compile/internal/types/sym.go | 3 +++ 10 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/alg.go b/src/cmd/compile/internal/gc/alg.go index b112ff679723c..f52c15b1f5c3c 100644 --- a/src/cmd/compile/internal/gc/alg.go +++ b/src/cmd/compile/internal/gc/alg.go @@ -330,6 +330,7 @@ func hashfor(t *types.Type) *Node { n := newname(sym) n.SetClass(PFUNC) + n.Sym.SetFunc(true) n.Type = functype(nil, []*Node{ anonfield(types.NewPtr(t)), anonfield(types.Types[TUINTPTR]), diff --git a/src/cmd/compile/internal/gc/dcl.go b/src/cmd/compile/internal/gc/dcl.go index 645ba7558c1cd..d4d0708b1c876 100644 --- a/src/cmd/compile/internal/gc/dcl.go +++ b/src/cmd/compile/internal/gc/dcl.go @@ -125,6 +125,9 @@ func declare(n *Node, ctxt Class) { s.Def = asTypesNode(n) n.Name.Vargen = int32(gen) n.SetClass(ctxt) + if ctxt == PFUNC { + n.Sym.SetFunc(true) + } autoexport(n, ctxt) } @@ -801,8 +804,12 @@ func origSym(s *types.Sym) *types.Sym { // Method symbols can be used to distinguish the same method appearing // in different method sets. For example, T.M and (*T).M have distinct // method symbols. +// +// The returned symbol will be marked as a function. func methodSym(recv *types.Type, msym *types.Sym) *types.Sym { - return methodSymSuffix(recv, msym, "") + sym := methodSymSuffix(recv, msym, "") + sym.SetFunc(true) + return sym } // methodSymSuffix is like methodsym, but allows attaching a diff --git a/src/cmd/compile/internal/gc/export.go b/src/cmd/compile/internal/gc/export.go index 85916509cb9f2..4fe1f8b95f12d 100644 --- a/src/cmd/compile/internal/gc/export.go +++ b/src/cmd/compile/internal/gc/export.go @@ -140,6 +140,9 @@ func importobj(ipkg *types.Pkg, pos src.XPos, s *types.Sym, op Op, ctxt Class, t n.Op = op n.Pos = pos n.SetClass(ctxt) + if ctxt == PFUNC { + n.Sym.SetFunc(true) + } n.Type = t return n } diff --git a/src/cmd/compile/internal/gc/iimport.go b/src/cmd/compile/internal/gc/iimport.go index 8614c7a14f383..c9198499dd643 100644 --- a/src/cmd/compile/internal/gc/iimport.go +++ b/src/cmd/compile/internal/gc/iimport.go @@ -334,6 +334,7 @@ func (r *importReader) doDecl(n *Node) { m := newfuncnamel(mpos, methodSym(recv.Type, msym)) m.Type = mtyp m.SetClass(PFUNC) + // methodSym already marked m.Sym as a function. // (comment from parser.go) // inl.C's inlnode in on a dotmeth node expects to find the inlineable body as diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 55d6d55e6dfc8..087371c6f6c9c 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -649,6 +649,11 @@ func Main(archInit func(*Arch)) { Curfn = nil peekitabs() + // The "init" function is the only user-spellable symbol that + // we construct later. Mark it as a function now before + // anything can ask for its Linksym. + lookup("init").SetFunc(true) + // Phase 8: Compile top level functions. // Don't use range--walk can add functions to xtop. timings.Start("be", "compilefuncs") diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index b0ccd01752470..d43dc8e617596 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -3670,6 +3670,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value { n2 := newnamel(fn.Pos, fn.Sym) n2.Name.Curfn = s.curfn n2.SetClass(PFUNC) + n2.Sym.SetFunc(true) n2.Pos = fn.Pos n2.Type = types.Types[TUINT8] // dummy type for a static closure. Could use runtime.funcval if we had it. closure = s.expr(n2) diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index 97f7e4880d9c7..53bfcba3ffc7b 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -1619,6 +1619,7 @@ func hashmem(t *types.Type) *Node { n := newname(sym) n.SetClass(PFUNC) + n.Sym.SetFunc(true) n.Type = functype(nil, []*Node{ anonfield(types.NewPtr(t)), anonfield(types.Types[TUINTPTR]), diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index e6a8ed4bda149..371e0924e7155 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -2513,6 +2513,7 @@ func typecheckMethodExpr(n *Node) (res *Node) { n.Type = methodfunc(m.Type, n.Left.Type) n.Xoffset = 0 n.SetClass(PFUNC) + // methodSym already marked n.Sym as a function. return n } diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index 37d995b1bdf8c..5056212984ca8 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -3063,6 +3063,7 @@ func eqfor(t *types.Type) (n *Node, needsize bool) { sym := typesymprefix(".eq", t) n := newname(sym) n.SetClass(PFUNC) + n.Sym.SetFunc(true) n.Type = functype(nil, []*Node{ anonfield(types.NewPtr(t)), anonfield(types.NewPtr(t)), diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go index b7fd7ae9fbbbe..28583378d9dbe 100644 --- a/src/cmd/compile/internal/types/sym.go +++ b/src/cmd/compile/internal/types/sym.go @@ -42,6 +42,7 @@ const ( symSiggen // type symbol has been generated symAsm // on asmlist, for writing to -asmhdr symAlgGen // algorithm table has been generated + symFunc // function symbol; uses internal ABI ) func (sym *Sym) OnExportList() bool { return sym.flags&symOnExportList != 0 } @@ -49,12 +50,14 @@ func (sym *Sym) Uniq() bool { return sym.flags&symUniq != 0 } func (sym *Sym) Siggen() bool { return sym.flags&symSiggen != 0 } func (sym *Sym) Asm() bool { return sym.flags&symAsm != 0 } func (sym *Sym) AlgGen() bool { return sym.flags&symAlgGen != 0 } +func (sym *Sym) Func() bool { return sym.flags&symFunc != 0 } func (sym *Sym) SetOnExportList(b bool) { sym.flags.set(symOnExportList, b) } func (sym *Sym) SetUniq(b bool) { sym.flags.set(symUniq, b) } func (sym *Sym) SetSiggen(b bool) { sym.flags.set(symSiggen, b) } func (sym *Sym) SetAsm(b bool) { sym.flags.set(symAsm, b) } func (sym *Sym) SetAlgGen(b bool) { sym.flags.set(symAlgGen, b) } +func (sym *Sym) SetFunc(b bool) { sym.flags.set(symFunc, b) } func (sym *Sym) IsBlank() bool { return sym != nil && sym.Name == "_" From 1794ee682994ed2efbb9371060856cd7b146f405 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 31 Oct 2018 20:42:38 -0400 Subject: [PATCH 009/594] cmd/link: nice error message on ABI mismatch Currently, if a symbol is only defined under one ABI and referenced under another ABI, you simply get a "relocation target X not defined". This is confusing because it seems like the symbol is defined. This CL enhances the error message in this case to be "relocation target X not defined for (but is defined for )". For #27539. Change-Id: If857a1882c3fe9af5346797d5295ca1fe50ae565 Reviewed-on: https://go-review.googlesource.com/c/147159 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/link/internal/ld/link.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/cmd/link/internal/ld/link.go b/src/cmd/link/internal/ld/link.go index 48b92724b6fe0..f3f1bba773a25 100644 --- a/src/cmd/link/internal/ld/link.go +++ b/src/cmd/link/internal/ld/link.go @@ -32,6 +32,7 @@ package ld import ( "bufio" + "cmd/internal/obj" "cmd/internal/objabi" "cmd/internal/sys" "cmd/link/internal/sym" @@ -108,9 +109,27 @@ func (ctxt *Link) ErrorUnresolved(s *sym.Symbol, r *sym.Reloc) { k := unresolvedSymKey{from: s, to: r.Sym} if !ctxt.unresolvedSymSet[k] { ctxt.unresolvedSymSet[k] = true + + // Try to find symbol under another ABI. + var reqABI, haveABI obj.ABI + haveABI = ^obj.ABI(0) + for abi := obj.ABI(0); abi < obj.ABICount; abi++ { + v := sym.ABIToVersion(abi) + if v == -1 { + continue + } + if v == int(r.Sym.Version) { + reqABI = abi + } else if ctxt.Syms.ROLookup(r.Sym.Name, v) != nil { + haveABI = abi + } + } + // Give a special error message for main symbol (see #24809). if r.Sym.Name == "main.main" { Errorf(s, "function main is undeclared in the main package") + } else if haveABI != ^obj.ABI(0) { + Errorf(s, "relocation target %s not defined for %s (but is defined for %s)", r.Sym.Name, reqABI, haveABI) } else { Errorf(s, "relocation target %s not defined", r.Sym.Name) } From 685aca45dc8435df7b7e8059a42a8a98efdaf22c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 1 Nov 2018 12:30:23 -0400 Subject: [PATCH 010/594] cmd/compile, cmd/link: separate stable and internal ABIs This implements compiler and linker support for separating the function calling ABI into two ABIs: a stable and an internal ABI. At the moment, the two ABIs are identical, but we'll be able to evolve the internal ABI without breaking existing assembly code that depends on the stable ABI for calling to and from Go. The Go compiler generates internal ABI symbols for all Go functions. It uses the symabis information produced by the assembler to create ABI wrappers whenever it encounters a body-less Go function that's defined in assembly or a Go function that's referenced from assembly. Since the two ABIs are currently identical, for the moment this is implemented using "ABI alias" symbols, which are just forwarding references to the native ABI symbol for a function. This way there's no actual code involved in the ABI wrapper, which is good because we're not deriving any benefit from it right now. Once the ABIs diverge, we can eliminate ABI aliases. The linker represents these different ABIs internally as different versions of the same symbol. This way, the linker keeps us honest, since every symbol definition and reference also specifies its version. The linker is responsible for resolving ABI aliases. Fixes #27539. Change-Id: I197c52ec9f8fc435db8f7a4259029b20f6d65e95 Reviewed-on: https://go-review.googlesource.com/c/147160 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/compile/internal/gc/gen.go | 11 ++++ src/cmd/compile/internal/gc/gsubr.go | 63 ++++++++++++++++++++- src/cmd/compile/internal/gc/noder.go | 13 +++++ src/cmd/compile/internal/gc/pgen.go | 4 +- src/cmd/compile/internal/gc/reflect.go | 4 +- src/cmd/compile/internal/gc/ssa.go | 40 ++++++------- src/cmd/compile/internal/types/sym.go | 6 ++ src/cmd/internal/obj/arm/asm5.go | 1 + src/cmd/internal/obj/wasm/wasmobj.go | 2 + src/cmd/internal/obj/x86/asm6.go | 1 + src/cmd/internal/objabi/symkind.go | 7 +++ src/cmd/internal/objabi/symkind_string.go | 4 +- src/cmd/link/internal/ld/deadcode.go | 12 +++- src/cmd/link/internal/ld/go.go | 16 ++++++ src/cmd/link/internal/ld/lib.go | 32 ++++++++++- src/cmd/link/internal/ld/symtab.go | 2 +- src/cmd/link/internal/ppc64/asm.go | 2 +- src/cmd/link/internal/sym/symbols.go | 2 + src/cmd/link/internal/sym/symkind.go | 4 ++ src/cmd/link/internal/sym/symkind_string.go | 4 +- 20 files changed, 196 insertions(+), 34 deletions(-) diff --git a/src/cmd/compile/internal/gc/gen.go b/src/cmd/compile/internal/gc/gen.go index f9b4584cf6bcd..43d12925eb3b9 100644 --- a/src/cmd/compile/internal/gc/gen.go +++ b/src/cmd/compile/internal/gc/gen.go @@ -11,7 +11,18 @@ import ( "strconv" ) +// sysfunc looks up Go function name in package runtime. This function +// must follow the internal calling convention. func sysfunc(name string) *obj.LSym { + s := Runtimepkg.Lookup(name) + s.SetFunc(true) + return s.Linksym() +} + +// sysvar looks up a variable (or assembly function) name in package +// runtime. If this is a function, it may have a special calling +// convention. +func sysvar(name string) *obj.LSym { return Runtimepkg.Lookup(name).Linksym() } diff --git a/src/cmd/compile/internal/gc/gsubr.go b/src/cmd/compile/internal/gc/gsubr.go index 16602b9988233..01ac4cb929be7 100644 --- a/src/cmd/compile/internal/gc/gsubr.go +++ b/src/cmd/compile/internal/gc/gsubr.go @@ -187,7 +187,13 @@ func (pp *Progs) settext(fn *Node) { ptxt.From.Sym = fn.Func.lsym } -func (f *Func) initLSym() { +// initLSym defines f's obj.LSym and initializes it based on the +// properties of f. This includes setting the symbol flags and ABI and +// creating and initializing related DWARF symbols. +// +// initLSym must be called exactly once per function and must be +// called for both functions with bodies and functions without bodies. +func (f *Func) initLSym(hasBody bool) { if f.lsym != nil { Fatalf("Func.initLSym called twice") } @@ -197,6 +203,61 @@ func (f *Func) initLSym() { if f.Pragma&Systemstack != 0 { f.lsym.Set(obj.AttrCFunc, true) } + + var aliasABI obj.ABI + needABIAlias := false + if abi, ok := symabiDefs[f.lsym.Name]; ok && abi == obj.ABI0 { + // Symbol is defined as ABI0. Create an + // Internal -> ABI0 wrapper. + f.lsym.SetABI(obj.ABI0) + needABIAlias, aliasABI = true, obj.ABIInternal + } else { + // No ABI override. Check that the symbol is + // using the expected ABI. + want := obj.ABIInternal + if f.lsym.ABI() != want { + Fatalf("function symbol %s has the wrong ABI %v, expected %v", f.lsym, f.lsym.ABI(), want) + } + } + + if abi, ok := symabiRefs[f.lsym.Name]; ok && abi == obj.ABI0 { + // Symbol is referenced as ABI0. Create an + // ABI0 -> Internal wrapper if necessary. + if f.lsym.ABI() != obj.ABI0 { + needABIAlias, aliasABI = true, obj.ABI0 + } + } + + if !needABIAlias && allABIs { + // The compiler was asked to produce ABI + // wrappers for everything. + switch f.lsym.ABI() { + case obj.ABI0: + needABIAlias, aliasABI = true, obj.ABIInternal + case obj.ABIInternal: + needABIAlias, aliasABI = true, obj.ABI0 + } + } + + if needABIAlias { + // These LSyms have the same name as the + // native function, so we create them directly + // rather than looking them up. The uniqueness + // of f.lsym ensures uniqueness of asym. + asym := &obj.LSym{ + Name: f.lsym.Name, + Type: objabi.SABIALIAS, + R: []obj.Reloc{{Sym: f.lsym}}, // 0 size, so "informational" + } + asym.SetABI(aliasABI) + asym.Set(obj.AttrDuplicateOK, true) + Ctxt.ABIAliases = append(Ctxt.ABIAliases, asym) + } + } + + if !hasBody { + // For body-less functions, we only create the LSym. + return } var flag int diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go index f13d2cdbb5594..a2ed103c80c7a 100644 --- a/src/cmd/compile/internal/gc/noder.go +++ b/src/cmd/compile/internal/gc/noder.go @@ -15,6 +15,7 @@ import ( "cmd/compile/internal/syntax" "cmd/compile/internal/types" + "cmd/internal/obj" "cmd/internal/objabi" "cmd/internal/src" ) @@ -250,6 +251,18 @@ func (p *noder) node() { } } + // The linker expects an ABI0 wrapper for all cgo-exported + // functions. + for _, prag := range p.pragcgobuf { + switch prag[0] { + case "cgo_export_static", "cgo_export_dynamic": + if symabiRefs == nil { + symabiRefs = make(map[string]obj.ABI) + } + symabiRefs[prag[1]] = obj.ABI0 + } + } + pragcgobuf = append(pragcgobuf, p.pragcgobuf...) lineno = src.NoXPos clearImports() diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index 01dacb783bf86..d567cfe14989b 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -198,6 +198,8 @@ func funccompile(fn *Node) { dowidth(fn.Type) if fn.Nbody.Len() == 0 { + // Initialize ABI wrappers if necessary. + fn.Func.initLSym(false) emitptrargsmap(fn) return } @@ -231,7 +233,7 @@ func compile(fn *Node) { Curfn = nil // Set up the function's LSym early to avoid data races with the assemblers. - fn.Func.initLSym() + fn.Func.initLSym(true) // Make sure type syms are declared for all types that might // be types of stack objects. We need to do this here diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 50b741358f41e..130c83036c970 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -801,7 +801,7 @@ var ( func dcommontype(lsym *obj.LSym, t *types.Type) int { sizeofAlg := 2 * Widthptr if algarray == nil { - algarray = sysfunc("algarray") + algarray = sysvar("algarray") } dowidth(t) alg := algtype(t) @@ -1618,7 +1618,7 @@ func dalgsym(t *types.Type) *obj.LSym { if memhashvarlen == nil { memhashvarlen = sysfunc("memhash_varlen") - memequalvarlen = sysfunc("memequal_varlen") + memequalvarlen = sysvar("memequal_varlen") // asm func } // make hash closure diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index d43dc8e617596..883cf7936d3b0 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -68,9 +68,9 @@ func initssaconfig() { assertI2I2 = sysfunc("assertI2I2") deferproc = sysfunc("deferproc") Deferreturn = sysfunc("deferreturn") - Duffcopy = sysfunc("duffcopy") - Duffzero = sysfunc("duffzero") - gcWriteBarrier = sysfunc("gcWriteBarrier") + Duffcopy = sysvar("duffcopy") // asm func with special ABI + Duffzero = sysvar("duffzero") // asm func with special ABI + gcWriteBarrier = sysvar("gcWriteBarrier") // asm func with special ABI goschedguarded = sysfunc("goschedguarded") growslice = sysfunc("growslice") msanread = sysfunc("msanread") @@ -86,25 +86,25 @@ func initssaconfig() { racereadrange = sysfunc("racereadrange") racewrite = sysfunc("racewrite") racewriterange = sysfunc("racewriterange") - supportPopcnt = sysfunc("support_popcnt") - supportSSE41 = sysfunc("support_sse41") - arm64SupportAtomics = sysfunc("arm64_support_atomics") + supportPopcnt = sysvar("support_popcnt") // bool + supportSSE41 = sysvar("support_sse41") // bool + arm64SupportAtomics = sysvar("arm64_support_atomics") // bool typedmemclr = sysfunc("typedmemclr") typedmemmove = sysfunc("typedmemmove") - Udiv = sysfunc("udiv") - writeBarrier = sysfunc("writeBarrier") - - // GO386=387 runtime functions - ControlWord64trunc = sysfunc("controlWord64trunc") - ControlWord32 = sysfunc("controlWord32") - - // Wasm - WasmMove = sysfunc("wasmMove") - WasmZero = sysfunc("wasmZero") - WasmDiv = sysfunc("wasmDiv") - WasmTruncS = sysfunc("wasmTruncS") - WasmTruncU = sysfunc("wasmTruncU") - SigPanic = sysfunc("sigpanic") + Udiv = sysvar("udiv") // asm func with special ABI + writeBarrier = sysvar("writeBarrier") // struct { bool; ... } + + // GO386=387 runtime definitions + ControlWord64trunc = sysvar("controlWord64trunc") // uint16 + ControlWord32 = sysvar("controlWord32") // uint16 + + // Wasm (all asm funcs with special ABIs) + WasmMove = sysvar("wasmMove") + WasmZero = sysvar("wasmZero") + WasmDiv = sysvar("wasmDiv") + WasmTruncS = sysvar("wasmTruncS") + WasmTruncU = sysvar("wasmTruncU") + SigPanic = sysvar("sigpanic") } // buildssa builds an SSA function for fn. diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go index 28583378d9dbe..86f5022b5c84f 100644 --- a/src/cmd/compile/internal/types/sym.go +++ b/src/cmd/compile/internal/types/sym.go @@ -77,6 +77,12 @@ func (sym *Sym) Linksym() *obj.LSym { if sym == nil { return nil } + if sym.Func() { + // This is a function symbol. Mark it as "internal ABI". + return Ctxt.LookupInit(sym.LinksymName(), func(s *obj.LSym) { + s.SetABI(obj.ABIInternal) + }) + } return Ctxt.Lookup(sym.LinksymName()) } diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go index dd6d9265c4bf0..316937bde0892 100644 --- a/src/cmd/internal/obj/arm/asm5.go +++ b/src/cmd/internal/obj/arm/asm5.go @@ -1530,6 +1530,7 @@ func buildop(ctxt *obj.Link) { } deferreturn = ctxt.Lookup("runtime.deferreturn") + deferreturn.SetABI(obj.ABIInternal) symdiv = ctxt.Lookup("runtime._div") symdivu = ctxt.Lookup("runtime._divu") diff --git a/src/cmd/internal/obj/wasm/wasmobj.go b/src/cmd/internal/obj/wasm/wasmobj.go index f271101f4bbe9..a1b758836a5d1 100644 --- a/src/cmd/internal/obj/wasm/wasmobj.go +++ b/src/cmd/internal/obj/wasm/wasmobj.go @@ -126,7 +126,9 @@ func instinit(ctxt *obj.Link) { morestackNoCtxt = ctxt.Lookup("runtime.morestack_noctxt") gcWriteBarrier = ctxt.Lookup("runtime.gcWriteBarrier") sigpanic = ctxt.Lookup("runtime.sigpanic") + sigpanic.SetABI(obj.ABIInternal) deferreturn = ctxt.Lookup("runtime.deferreturn") + deferreturn.SetABI(obj.ABIInternal) jmpdefer = ctxt.Lookup(`"".jmpdefer`) } diff --git a/src/cmd/internal/obj/x86/asm6.go b/src/cmd/internal/obj/x86/asm6.go index a4507352f77e4..520f4be8f5653 100644 --- a/src/cmd/internal/obj/x86/asm6.go +++ b/src/cmd/internal/obj/x86/asm6.go @@ -2065,6 +2065,7 @@ func instinit(ctxt *obj.Link) { plan9privates = ctxt.Lookup("_privates") case objabi.Hnacl: deferreturn = ctxt.Lookup("runtime.deferreturn") + deferreturn.SetABI(obj.ABIInternal) } for i := range avxOptab { diff --git a/src/cmd/internal/objabi/symkind.go b/src/cmd/internal/objabi/symkind.go index b95a0d3c701fd..16b4c535ed85b 100644 --- a/src/cmd/internal/objabi/symkind.go +++ b/src/cmd/internal/objabi/symkind.go @@ -60,6 +60,13 @@ const ( SDWARFRANGE SDWARFLOC SDWARFMISC + // ABI alias. An ABI alias symbol is an empty symbol with a + // single relocation with 0 size that references the native + // function implementation symbol. + // + // TODO(austin): Remove this and all uses once the compiler + // generates real ABI wrappers rather than symbol aliases. + SABIALIAS // Update cmd/link/internal/sym/AbiSymKindToSymKind for new SymKind values. ) diff --git a/src/cmd/internal/objabi/symkind_string.go b/src/cmd/internal/objabi/symkind_string.go index 7152d6c006901..2b9a9080e8c0f 100644 --- a/src/cmd/internal/objabi/symkind_string.go +++ b/src/cmd/internal/objabi/symkind_string.go @@ -4,9 +4,9 @@ package objabi import "strconv" -const _SymKind_name = "SxxxSTEXTSRODATASNOPTRDATASDATASBSSSNOPTRBSSSTLSBSSSDWARFINFOSDWARFRANGESDWARFLOCSDWARFMISC" +const _SymKind_name = "SxxxSTEXTSRODATASNOPTRDATASDATASBSSSNOPTRBSSSTLSBSSSDWARFINFOSDWARFRANGESDWARFLOCSDWARFMISCSABIALIAS" -var _SymKind_index = [...]uint8{0, 4, 9, 16, 26, 31, 35, 44, 51, 61, 72, 81, 91} +var _SymKind_index = [...]uint8{0, 4, 9, 16, 26, 31, 35, 44, 51, 61, 72, 81, 91, 100} func (i SymKind) String() string { if i >= SymKind(len(_SymKind_index)-1) { diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index df989cc94486a..8f582174c549c 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -60,8 +60,8 @@ func deadcode(ctxt *Link) { d.init() d.flood() - callSym := ctxt.Syms.ROLookup("reflect.Value.Call", 0) - methSym := ctxt.Syms.ROLookup("reflect.Value.Method", 0) + callSym := ctxt.Syms.ROLookup("reflect.Value.Call", sym.SymVerABIInternal) + methSym := ctxt.Syms.ROLookup("reflect.Value.Method", sym.SymVerABIInternal) reflectSeen := false if ctxt.DynlinkingGo() { @@ -257,7 +257,10 @@ func (d *deadcodepass) init() { } for _, name := range names { + // Mark symbol as an data/ABI0 symbol. d.mark(d.ctxt.Syms.ROLookup(name, 0), nil) + // Also mark any Go functions (internal ABI). + d.mark(d.ctxt.Syms.ROLookup(name, sym.SymVerABIInternal), nil) } } @@ -308,6 +311,11 @@ func (d *deadcodepass) flood() { // reachable. continue } + if r.Sym.Type == sym.SABIALIAS { + // Patch this relocation through the + // ABI alias before marking. + r.Sym = resolveABIAlias(r.Sym) + } if r.Type != objabi.R_METHODOFF { d.mark(r.Sym, s) continue diff --git a/src/cmd/link/internal/ld/go.go b/src/cmd/link/internal/ld/go.go index d6c6b53a44c52..c942956cc47e3 100644 --- a/src/cmd/link/internal/ld/go.go +++ b/src/cmd/link/internal/ld/go.go @@ -25,6 +25,17 @@ func expandpkg(t0 string, pkg string) string { return strings.Replace(t0, `"".`, pkg+".", -1) } +func resolveABIAlias(s *sym.Symbol) *sym.Symbol { + if s.Type != sym.SABIALIAS { + return s + } + target := s.R[0].Sym + if target.Type == sym.SABIALIAS { + panic(fmt.Sprintf("ABI alias %s references another ABI alias %s", s, target)) + } + return target +} + // TODO: // generate debugging section in binary. // once the dust settles, try to move some code to @@ -191,6 +202,11 @@ func loadcgo(ctxt *Link, file string, pkg string, p string) { } local = expandpkg(local, pkg) + // The compiler arranges for an ABI0 wrapper + // to be available for all cgo-exported + // functions. Link.loadlib will resolve any + // ABI aliases we find here (since we may not + // yet know it's an alias). s := ctxt.Syms.Lookup(local, 0) switch ctxt.BuildMode { diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index aa472ee07f752..3038b7957444b 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -169,7 +169,7 @@ func (ctxt *Link) DynlinkingGo() bool { // CanUsePlugins returns whether a plugins can be used func (ctxt *Link) CanUsePlugins() bool { - return ctxt.Syms.ROLookup("plugin.Open", 0) != nil + return ctxt.Syms.ROLookup("plugin.Open", sym.SymVerABIInternal) != nil } // UseRelro returns whether to make use of "read only relocations" aka @@ -635,6 +635,19 @@ func (ctxt *Link) loadlib() { } ctxt.Textp = textp } + + // Resolve ABI aliases in the list of cgo-exported functions. + // This is necessary because we load the ABI0 symbol for all + // cgo exports. + for i, s := range dynexp { + if s.Type != sym.SABIALIAS { + continue + } + t := resolveABIAlias(s) + t.Attr |= s.Attr + t.SetExtname(s.Extname()) + dynexp[i] = t + } } // mangleTypeSym shortens the names of symbols that represent Go types @@ -651,7 +664,7 @@ func (ctxt *Link) loadlib() { // those programs loaded dynamically in multiple parts need these // symbols to have entries in the symbol table. func (ctxt *Link) mangleTypeSym() { - if ctxt.BuildMode != BuildModeShared && !ctxt.linkShared && ctxt.BuildMode != BuildModePlugin && ctxt.Syms.ROLookup("plugin.Open", 0) == nil { + if ctxt.BuildMode != BuildModeShared && !ctxt.linkShared && ctxt.BuildMode != BuildModePlugin && !ctxt.CanUsePlugins() { return } @@ -1801,6 +1814,21 @@ func ldshlibsyms(ctxt *Link, shlib string) { gcdataLocations[elfsym.Value+2*uint64(ctxt.Arch.PtrSize)+8+1*uint64(ctxt.Arch.PtrSize)] = lsym } } + // For function symbols, we don't know what ABI is + // available, so alias it under both ABIs. + // + // TODO(austin): This is almost certainly wrong once + // the ABIs are actually different. We might have to + // mangle Go function names in the .so to include the + // ABI. + if elf.ST_TYPE(elfsym.Info) == elf.STT_FUNC { + alias := ctxt.Syms.Lookup(elfsym.Name, sym.SymVerABIInternal) + if alias.Type != 0 { + continue + } + alias.Type = sym.SABIALIAS + alias.R = []sym.Reloc{{Sym: lsym}} + } } gcdataAddresses := make(map[*sym.Symbol]uint64) if ctxt.Arch.Family == sys.ARM64 { diff --git a/src/cmd/link/internal/ld/symtab.go b/src/cmd/link/internal/ld/symtab.go index 276a3a1cbbb87..7c296d766c44f 100644 --- a/src/cmd/link/internal/ld/symtab.go +++ b/src/cmd/link/internal/ld/symtab.go @@ -506,7 +506,7 @@ func (ctxt *Link) symtab() { abihashgostr.AddAddr(ctxt.Arch, hashsym) abihashgostr.AddUint(ctxt.Arch, uint64(hashsym.Size)) } - if ctxt.BuildMode == BuildModePlugin || ctxt.Syms.ROLookup("plugin.Open", 0) != nil { + if ctxt.BuildMode == BuildModePlugin || ctxt.CanUsePlugins() { for _, l := range ctxt.Library { s := ctxt.Syms.Lookup("go.link.pkghashbytes."+l.Pkg, 0) s.Attr |= sym.AttrReachable diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index c4a49c6a1e595..11a7aa2164311 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -133,7 +133,7 @@ func genplt(ctxt *ld.Link) { } func genaddmoduledata(ctxt *ld.Link) { - addmoduledata := ctxt.Syms.ROLookup("runtime.addmoduledata", 0) + addmoduledata := ctxt.Syms.ROLookup("runtime.addmoduledata", sym.SymVerABI0) if addmoduledata.Type == sym.STEXT && ctxt.BuildMode != ld.BuildModePlugin { return } diff --git a/src/cmd/link/internal/sym/symbols.go b/src/cmd/link/internal/sym/symbols.go index d7266c840b74c..f0fcf2361b178 100644 --- a/src/cmd/link/internal/sym/symbols.go +++ b/src/cmd/link/internal/sym/symbols.go @@ -43,6 +43,8 @@ func NewSymbols() *Symbols { hash := make([]map[string]*Symbol, SymVerStatic) // Preallocate about 2mb for hash of non static symbols hash[0] = make(map[string]*Symbol, 100000) + // And another 1mb for internal ABI text symbols. + hash[SymVerABIInternal] = make(map[string]*Symbol, 50000) return &Symbols{ hash: hash, Allsym: make([]*Symbol, 0, 100000), diff --git a/src/cmd/link/internal/sym/symkind.go b/src/cmd/link/internal/sym/symkind.go index b1756d6145e9e..6e1e1b58a1f71 100644 --- a/src/cmd/link/internal/sym/symkind.go +++ b/src/cmd/link/internal/sym/symkind.go @@ -109,6 +109,9 @@ const ( SDWARFRANGE SDWARFLOC SDWARFMISC // Not really a section; informs/affects other DWARF section generation + + // ABI aliases (these never appear in the output) + SABIALIAS ) // AbiSymKindToSymKind maps values read from object files (which are @@ -126,6 +129,7 @@ var AbiSymKindToSymKind = [...]SymKind{ SDWARFRANGE, SDWARFLOC, SDWARFMISC, + SABIALIAS, } // ReadOnly are the symbol kinds that form read-only sections. In some diff --git a/src/cmd/link/internal/sym/symkind_string.go b/src/cmd/link/internal/sym/symkind_string.go index 7428503b1c8a3..4da6c656f7bab 100644 --- a/src/cmd/link/internal/sym/symkind_string.go +++ b/src/cmd/link/internal/sym/symkind_string.go @@ -4,9 +4,9 @@ package sym import "strconv" -const _SymKind_name = "SxxxSTEXTSELFRXSECTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASFUNCTABSELFROSECTSMACHOPLTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSTYPELINKSITABLINKSSYMTABSPCLNTABSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASINITARRSDATASBSSSNOPTRBSSSTLSBSSSXCOFFTOCSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILEPATHSCONSTSDYNIMPORTSHOSTOBJSDWARFSECTSDWARFINFOSDWARFRANGESDWARFLOCSDWARFMISC" +const _SymKind_name = "SxxxSTEXTSELFRXSECTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASFUNCTABSELFROSECTSMACHOPLTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSTYPELINKSITABLINKSSYMTABSPCLNTABSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASINITARRSDATASBSSSNOPTRBSSSTLSBSSSXCOFFTOCSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILEPATHSCONSTSDYNIMPORTSHOSTOBJSDWARFSECTSDWARFINFOSDWARFRANGESDWARFLOCSDWARFMISCSABIALIAS" -var _SymKind_index = [...]uint16{0, 4, 9, 19, 24, 31, 40, 47, 54, 61, 69, 79, 88, 98, 110, 124, 136, 148, 160, 173, 182, 191, 198, 206, 214, 220, 229, 237, 244, 254, 262, 267, 271, 280, 287, 296, 301, 313, 325, 342, 359, 368, 374, 384, 392, 402, 412, 423, 432, 442} +var _SymKind_index = [...]uint16{0, 4, 9, 19, 24, 31, 40, 47, 54, 61, 69, 79, 88, 98, 110, 124, 136, 148, 160, 173, 182, 191, 198, 206, 214, 220, 229, 237, 244, 254, 262, 267, 271, 280, 287, 296, 301, 313, 325, 342, 359, 368, 374, 384, 392, 402, 412, 423, 432, 442, 451} func (i SymKind) String() string { if i >= SymKind(len(_SymKind_index)-1) { From 891f99eb43ad86814662549e4121e4e8c30e8b40 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 12 Nov 2018 16:37:12 -0500 Subject: [PATCH 011/594] cmd/compile: fix TestFormats This fixes the linux-amd64-longtest builder, which was broken by CL 147160. Updates #27539. Change-Id: If6e69581ef503bba2449ec9bacaa31f34f59beb1 Reviewed-on: https://go-review.googlesource.com/c/149157 Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/fmt_test.go | 1 + src/cmd/compile/internal/gc/gsubr.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/fmt_test.go b/src/cmd/compile/fmt_test.go index 05d13b58a565c..c5c050fa17c47 100644 --- a/src/cmd/compile/fmt_test.go +++ b/src/cmd/compile/fmt_test.go @@ -672,6 +672,7 @@ var knownFormats = map[string]string{ "cmd/compile/internal/types.EType %d": "", "cmd/compile/internal/types.EType %s": "", "cmd/compile/internal/types.EType %v": "", + "cmd/internal/obj.ABI %v": "", "error %v": "", "float64 %.2f": "", "float64 %.3f": "", diff --git a/src/cmd/compile/internal/gc/gsubr.go b/src/cmd/compile/internal/gc/gsubr.go index 01ac4cb929be7..5ad7b9a1b6fc5 100644 --- a/src/cmd/compile/internal/gc/gsubr.go +++ b/src/cmd/compile/internal/gc/gsubr.go @@ -216,7 +216,7 @@ func (f *Func) initLSym(hasBody bool) { // using the expected ABI. want := obj.ABIInternal if f.lsym.ABI() != want { - Fatalf("function symbol %s has the wrong ABI %v, expected %v", f.lsym, f.lsym.ABI(), want) + Fatalf("function symbol %s has the wrong ABI %v, expected %v", f.lsym.Name, f.lsym.ABI(), want) } } From b52db19b983d9b92c013184f7699bba2d0166c10 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 12 Nov 2018 16:31:47 -0500 Subject: [PATCH 012/594] cmd/compile: create "init" symbol earlier We create the "init" symbol and mark it as a function before compiling to SSA because SSA can initialize this symbol, but it turns out we do it slightly too late. peekitabs, at least, can also create the "init" LSym. Move this initialization to just after type-checking. Fixes the linux-amd64-ssacheck and the android-arm64-wiko-fever builders. Updates #27539. Change-Id: If145952c79d39f75c93b24e35e67fe026dd08329 Reviewed-on: https://go-review.googlesource.com/c/149137 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 087371c6f6c9c..e5d42bfd7da15 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -557,6 +557,11 @@ func Main(archInit func(*Arch)) { errorexit() } + // The "init" function is the only user-spellable symbol that + // we construct later. Mark it as a function now before + // anything can ask for its Linksym. + lookup("init").SetFunc(true) + // Phase 4: Decide how to capture closed variables. // This needs to run before escape analysis, // because variables captured by value do not escape. @@ -649,11 +654,6 @@ func Main(archInit func(*Arch)) { Curfn = nil peekitabs() - // The "init" function is the only user-spellable symbol that - // we construct later. Mark it as a function now before - // anything can ask for its Linksym. - lookup("init").SetFunc(true) - // Phase 8: Compile top level functions. // Don't use range--walk can add functions to xtop. timings.Start("be", "compilefuncs") From 5cf2b4c2d39e0490b235822f5ea7fa105280b9f2 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 12 Nov 2018 16:49:52 -0500 Subject: [PATCH 013/594] cmd/compile: fix race on initializing Sym symFunc flag SSA lowering can create PFUNC ONAME nodes when compiling method calls. Since we generally initialize the node's Sym to a func when we set its class to PFUNC, we did this here, too. Unfortunately, since SSA compilation is concurrent, this can cause a race if two function compilations try to initialize the same symbol. Luckily, we don't need to do this at all, since we're actually just wrapping an ONAME node around an existing Sym that's already marked as a function symbol. Fixes the linux-amd64-racecompile builder, which was broken by CL 147158. Updates #27539. Change-Id: I8ddfce6e66a08ce53998c5bfa6f5a423c1ffc1eb Reviewed-on: https://go-review.googlesource.com/c/149158 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/compile/internal/gc/ssa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 883cf7936d3b0..9da45258f5268 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -3670,7 +3670,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value { n2 := newnamel(fn.Pos, fn.Sym) n2.Name.Curfn = s.curfn n2.SetClass(PFUNC) - n2.Sym.SetFunc(true) + // n2.Sym already existed, so it's already marked as a function. n2.Pos = fn.Pos n2.Type = types.Types[TUINT8] // dummy type for a static closure. Could use runtime.funcval if we had it. closure = s.expr(n2) From 595bc63e8fb9636bb89c0cff3f879467d3c06988 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Mon, 12 Nov 2018 21:54:16 +0000 Subject: [PATCH 014/594] runtime/cgo: added missing includes for errno.h to the windows gcc stubs. This adds the includes for errno.h to the windows stubs for runtime/cgo so that "errno" is properly declared. Due to "errno" not being properly declared, the compiler is forced to assume it's an external which leaves it up to the linker. This is an issue in some implementations as errno might be a macro which results in an unresolved symbol error during linking. runtime/cgo/gcc_libinit_windows.c: added include runtime/cgo/gcc_windows_386.c: added include runtime/cgo/gcc_windows_amd64.c: added include Change-Id: I77167d02f7409462979135efc55cf50bbc6bd363 GitHub-Last-Rev: 90da06ee3cbec3f51c6d31185868bb70341ce9d3 GitHub-Pull-Request: golang/go#28747 Reviewed-on: https://go-review.googlesource.com/c/149118 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/cgo/gcc_libinit_windows.c | 1 + src/runtime/cgo/gcc_windows_386.c | 1 + src/runtime/cgo/gcc_windows_amd64.c | 1 + 3 files changed, 3 insertions(+) diff --git a/src/runtime/cgo/gcc_libinit_windows.c b/src/runtime/cgo/gcc_libinit_windows.c index b6f51b3e4dd66..248d59fd69574 100644 --- a/src/runtime/cgo/gcc_libinit_windows.c +++ b/src/runtime/cgo/gcc_libinit_windows.c @@ -9,6 +9,7 @@ #include #include +#include #include "libcgo.h" diff --git a/src/runtime/cgo/gcc_windows_386.c b/src/runtime/cgo/gcc_windows_386.c index f2ff710f60cdf..9184b91393ff5 100644 --- a/src/runtime/cgo/gcc_windows_386.c +++ b/src/runtime/cgo/gcc_windows_386.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "libcgo.h" static void threadentry(void*); diff --git a/src/runtime/cgo/gcc_windows_amd64.c b/src/runtime/cgo/gcc_windows_amd64.c index 511ab44fa9822..7192a24631543 100644 --- a/src/runtime/cgo/gcc_windows_amd64.c +++ b/src/runtime/cgo/gcc_windows_amd64.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "libcgo.h" static void threadentry(void*); From 70e3b1df4a5d5b91f6c0e7bd4f7879d6ae95fc12 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 12 Nov 2018 16:04:07 -0500 Subject: [PATCH 015/594] crypto/tls: don't modify Config.Certificates in BuildNameToCertificate The Config does not own the memory pointed to by the Certificate slice. Instead, opportunistically use Certificate.Leaf and let the application set it if it desires the performance gain. This is a partial rollback of CL 107627. See the linked issue for the full explanation. Fixes #28744 Change-Id: I33ce9e6712e3f87939d9d0932a06d24e48ba4567 Reviewed-on: https://go-review.googlesource.com/c/149098 Reviewed-by: Emmanuel Odeke Run-TryBot: Emmanuel Odeke TryBot-Result: Gobot Gobot --- src/crypto/tls/common.go | 8 ++++---- src/crypto/tls/tls_test.go | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go index 25e4a7d8860d8..3ba3aac86bb09 100644 --- a/src/crypto/tls/common.go +++ b/src/crypto/tls/common.go @@ -871,14 +871,14 @@ func (c *Config) BuildNameToCertificate() { c.NameToCertificate = make(map[string]*Certificate) for i := range c.Certificates { cert := &c.Certificates[i] - if cert.Leaf == nil { - x509Cert, err := x509.ParseCertificate(cert.Certificate[0]) + x509Cert := cert.Leaf + if x509Cert == nil { + var err error + x509Cert, err = x509.ParseCertificate(cert.Certificate[0]) if err != nil { continue } - cert.Leaf = x509Cert } - x509Cert := cert.Leaf if len(x509Cert.Subject.CommonName) > 0 { c.NameToCertificate[x509Cert.Subject.CommonName] = cert } diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go index e23068ce43573..00bb6e4ef3754 100644 --- a/src/crypto/tls/tls_test.go +++ b/src/crypto/tls/tls_test.go @@ -1087,3 +1087,25 @@ func TestEscapeRoute(t *testing.T) { t.Errorf("Client negotiated version %x, expected %x", cs.Version, VersionTLS12) } } + +// Issue 28744: Ensure that we don't modify memory +// that Config doesn't own such as Certificates. +func TestBuildNameToCertificate_doesntModifyCertificates(t *testing.T) { + c0 := Certificate{ + Certificate: [][]byte{testRSACertificate}, + PrivateKey: testRSAPrivateKey, + } + c1 := Certificate{ + Certificate: [][]byte{testSNICertificate}, + PrivateKey: testRSAPrivateKey, + } + config := testConfig.Clone() + config.Certificates = []Certificate{c0, c1} + + config.BuildNameToCertificate() + got := config.Certificates + want := []Certificate{c0, c1} + if !reflect.DeepEqual(got, want) { + t.Fatalf("Certificates were mutated by BuildNameToCertificate\nGot: %#v\nWant: %#v\n", got, want) + } +} From 5d39260079b5170e6b4263adb4022cc4b54153c4 Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Thu, 8 Nov 2018 22:08:35 -0800 Subject: [PATCH 016/594] net: preserve unexpired context values for LookupIPAddr To avoid any cancelation of the parent context from affecting lookupGroup operations, Resolver.LookupIPAddr previously used an entirely new context created from context.Background(). However, this meant that all the values in the parent context with which LookupIPAddr was invoked were dropped. This change provides a custom context implementation that only preserves values of the parent context by composing context.Background() and the parent context. It only falls back to the parent context to perform value lookups if the parent context has not yet expired. This context is never canceled, and has no deadlines. Fixes #28600 Change-Id: If2f570caa26c65bad638b7102c35c79d5e429fea Reviewed-on: https://go-review.googlesource.com/c/148698 Run-TryBot: Emmanuel Odeke Reviewed-by: Brad Fitzpatrick --- src/net/lookup.go | 32 ++++++++++++++++-- src/net/lookup_test.go | 75 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 2 deletions(-) diff --git a/src/net/lookup.go b/src/net/lookup.go index cb810dea267bd..e10889331e4f5 100644 --- a/src/net/lookup.go +++ b/src/net/lookup.go @@ -205,6 +205,33 @@ func (r *Resolver) LookupIPAddr(ctx context.Context, host string) ([]IPAddr, err return r.lookupIPAddr(ctx, "ip", host) } +// onlyValuesCtx is a context that uses an underlying context +// for value lookup if the underlying context hasn't yet expired. +type onlyValuesCtx struct { + context.Context + lookupValues context.Context +} + +var _ context.Context = (*onlyValuesCtx)(nil) + +// Value performs a lookup if the original context hasn't expired. +func (ovc *onlyValuesCtx) Value(key interface{}) interface{} { + select { + case <-ovc.lookupValues.Done(): + return nil + default: + return ovc.lookupValues.Value(key) + } +} + +// withUnexpiredValuesPreserved returns a context.Context that only uses lookupCtx +// for its values, otherwise it is never canceled and has no deadline. +// If the lookup context expires, any looked up values will return nil. +// See Issue 28600. +func withUnexpiredValuesPreserved(lookupCtx context.Context) context.Context { + return &onlyValuesCtx{Context: context.Background(), lookupValues: lookupCtx} +} + // lookupIPAddr looks up host using the local resolver and particular network. // It returns a slice of that host's IPv4 and IPv6 addresses. func (r *Resolver) lookupIPAddr(ctx context.Context, network, host string) ([]IPAddr, error) { @@ -231,8 +258,9 @@ func (r *Resolver) lookupIPAddr(ctx context.Context, network, host string) ([]IP // We don't want a cancelation of ctx to affect the // lookupGroup operation. Otherwise if our context gets // canceled it might cause an error to be returned to a lookup - // using a completely different context. - lookupGroupCtx, lookupGroupCancel := context.WithCancel(context.Background()) + // using a completely different context. However we need to preserve + // only the values in context. See Issue 28600. + lookupGroupCtx, lookupGroupCancel := context.WithCancel(withUnexpiredValuesPreserved(ctx)) dnsWaitGroup.Add(1) ch, called := r.getLookupGroup().DoChan(host, func() (interface{}, error) { diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go index aeeda8f7d0eb7..65daa76467dd9 100644 --- a/src/net/lookup_test.go +++ b/src/net/lookup_test.go @@ -1034,3 +1034,78 @@ func TestIPVersion(t *testing.T) { } } } + +// Issue 28600: The context that is used to lookup ips should always +// preserve the values from the context that was passed into LookupIPAddr. +func TestLookupIPAddrPreservesContextValues(t *testing.T) { + origTestHookLookupIP := testHookLookupIP + defer func() { testHookLookupIP = origTestHookLookupIP }() + + keyValues := []struct { + key, value interface{} + }{ + {"key-1", 12}, + {384, "value2"}, + {new(float64), 137}, + } + ctx := context.Background() + for _, kv := range keyValues { + ctx = context.WithValue(ctx, kv.key, kv.value) + } + + wantIPs := []IPAddr{ + {IP: IPv4(127, 0, 0, 1)}, + {IP: IPv6loopback}, + } + + checkCtxValues := func(ctx_ context.Context, fn func(context.Context, string, string) ([]IPAddr, error), network, host string) ([]IPAddr, error) { + for _, kv := range keyValues { + g, w := ctx_.Value(kv.key), kv.value + if !reflect.DeepEqual(g, w) { + t.Errorf("Value lookup:\n\tGot: %v\n\tWant: %v", g, w) + } + } + return wantIPs, nil + } + testHookLookupIP = checkCtxValues + + resolvers := []*Resolver{ + nil, + new(Resolver), + } + + for i, resolver := range resolvers { + gotIPs, err := resolver.LookupIPAddr(ctx, "golang.org") + if err != nil { + t.Errorf("Resolver #%d: unexpected error: %v", i, err) + } + if !reflect.DeepEqual(gotIPs, wantIPs) { + t.Errorf("#%d: mismatched IPAddr results\n\tGot: %v\n\tWant: %v", i, gotIPs, wantIPs) + } + } +} + +func TestWithUnexpiredValuesPreserved(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + + // Insert a value into it. + key, value := "key-1", 2 + ctx = context.WithValue(ctx, key, value) + + // Now use the "values preserving context" like + // we would for LookupIPAddr. See Issue 28600. + ctx = withUnexpiredValuesPreserved(ctx) + + // Lookup before expiry. + if g, w := ctx.Value(key), value; g != w { + t.Errorf("Lookup before expiry: Got %v Want %v", g, w) + } + + // Cancel the context. + cancel() + + // Lookup after expiry should return nil + if g := ctx.Value(key); g != nil { + t.Errorf("Lookup after expiry: Got %v want nil", g) + } +} From 7ebe35093dbac03f86f7471590a18bf4ddd4b29c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 12 Nov 2018 10:38:02 -0800 Subject: [PATCH 017/594] cmd/compile: correct check for valid -lang version Change-Id: Iad10d0a2dbc8e12e9f776c6cfb34070f584fd439 Reviewed-on: https://go-review.googlesource.com/c/149057 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Emmanuel Odeke --- src/cmd/compile/internal/gc/lang_test.go | 5 +++++ src/cmd/compile/internal/gc/main.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/lang_test.go b/src/cmd/compile/internal/gc/lang_test.go index b225f03a1de1f..72e7f07a21c00 100644 --- a/src/cmd/compile/internal/gc/lang_test.go +++ b/src/cmd/compile/internal/gc/lang_test.go @@ -41,6 +41,11 @@ func TestInvalidLang(t *testing.T) { t.Error("compilation with -lang=go9.99 succeeded unexpectedly") } + // This test will have to be adjusted if we ever reach 1.99 or 2.0. + if testLang(t, "go1.99", src, outfile) == nil { + t.Error("compilation with -lang=go1.99 succeeded unexpectedly") + } + if testLang(t, "go1.8", src, outfile) == nil { t.Error("compilation with -lang=go1.8 succeeded unexpectedly") } diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index e5d42bfd7da15..44c540492b092 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -1444,7 +1444,7 @@ func checkLang() { if err != nil { log.Fatalf("internal error parsing default lang %q: %v", def, err) } - if langWant.major > defVers.major || (langWant.major == defVers.major && langWant.major > defVers.minor) { + if langWant.major > defVers.major || (langWant.major == defVers.major && langWant.minor > defVers.minor) { log.Fatalf("invalid value %q for -lang: max known version is %q", flag_lang, def) } } From de578dcdd682182c69efc8f9328c9bba500192b0 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 12 Nov 2018 11:25:58 -0800 Subject: [PATCH 018/594] spec: be clearer about definition of string length Adjusted spec to explicitly define the string length as the number of bytes of the string; the prose now matches the prose for arrays. Made analogous change for slices. Fixes #28736. Change-Id: I47cab321c87de0a4c482f5466b819b2cc8993fd1 Reviewed-on: https://go-review.googlesource.com/c/149077 Reviewed-by: Rob Pike Reviewed-by: Matthew Dempsky --- doc/go_spec.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index cc2bada913901..098a92551a914 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -823,6 +823,7 @@

String types

A string type represents the set of string values. A string value is a (possibly empty) sequence of bytes. +The number of bytes is called the length of the string and is never negative. Strings are immutable: once created, it is impossible to change the contents of a string. The predeclared string type is string; @@ -830,7 +831,7 @@

String types

-The length of a string s (its size in bytes) can be discovered using +The length of a string s can be discovered using the built-in function len. The length is a compile-time constant if the string is a constant. A string's bytes can be accessed by integer indices @@ -846,8 +847,7 @@

Array types

An array is a numbered sequence of elements of a single type, called the element type. -The number of elements is called the length and is never -negative. +The number of elements is called the length of the array and is never negative.

@@ -883,6 +883,7 @@ 

Slice types

A slice is a descriptor for a contiguous segment of an underlying array and provides access to a numbered sequence of elements from that array. A slice type denotes the set of all slices of arrays of its element type. +The number of elements is called the length of the slice and is never negative. The value of an uninitialized slice is nil.

@@ -891,8 +892,7 @@

Slice types

-Like arrays, slices are indexable and have a length. The length of a -slice s can be discovered by the built-in function +The length of a slice s can be discovered by the built-in function len; unlike with arrays it may change during execution. The elements can be addressed by integer indices 0 through len(s)-1. The slice index of a From ee55f0856a3f1fed5d8c15af54c40e4799c2d32f Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 29 Oct 2018 23:21:40 +0000 Subject: [PATCH 019/594] net/http/httputil: make ReverseProxy automatically proxy WebSocket requests Fixes #26937 Change-Id: I6cdc1bad4cf476cd2ea1462b53444eccd8841e14 Reviewed-on: https://go-review.googlesource.com/c/146437 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Dmitri Shuralyov --- src/go/build/deps_test.go | 2 +- src/net/http/httputil/reverseproxy.go | 81 ++++++++++++++++++++ src/net/http/httputil/reverseproxy_test.go | 88 +++++++++++++++++++--- src/net/http/transport.go | 2 +- 4 files changed, 161 insertions(+), 12 deletions(-) diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index d632954d0c4b3..0ecf38c567df1 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -436,7 +436,7 @@ var pkgDeps = map[string][]string{ "L4", "NET", "OS", "crypto/tls", "flag", "net/http", "net/http/internal", "crypto/x509", "golang_org/x/net/http/httpguts", }, - "net/http/httputil": {"L4", "NET", "OS", "context", "net/http", "net/http/internal"}, + "net/http/httputil": {"L4", "NET", "OS", "context", "net/http", "net/http/internal", "golang_org/x/net/http/httpguts"}, "net/http/pprof": {"L4", "OS", "html/template", "net/http", "runtime/pprof", "runtime/trace"}, "net/rpc": {"L4", "NET", "encoding/gob", "html/template", "net/http"}, "net/rpc/jsonrpc": {"L4", "NET", "encoding/json", "net/rpc"}, diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index f82d820a43007..e9552a2256414 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -8,6 +8,7 @@ package httputil import ( "context" + "fmt" "io" "log" "net" @@ -16,6 +17,8 @@ import ( "strings" "sync" "time" + + "golang_org/x/net/http/httpguts" ) // ReverseProxy is an HTTP Handler that takes an incoming request and @@ -199,6 +202,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { p.Director(outreq) outreq.Close = false + reqUpType := upgradeType(outreq.Header) removeConnectionHeaders(outreq.Header) // Remove hop-by-hop headers to the backend. Especially @@ -221,6 +225,13 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { outreq.Header.Del(h) } + // After stripping all the hop-by-hop connection headers above, add back any + // necessary for protocol upgrades, such as for websockets. + if reqUpType != "" { + outreq.Header.Set("Connection", "Upgrade") + outreq.Header.Set("Upgrade", reqUpType) + } + if clientIP, _, err := net.SplitHostPort(req.RemoteAddr); err == nil { // If we aren't the first proxy retain prior // X-Forwarded-For information as a comma+space @@ -237,6 +248,12 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { return } + // Deal with 101 Switching Protocols responses: (WebSocket, h2c, etc) + if res.StatusCode == http.StatusSwitchingProtocols { + p.handleUpgradeResponse(rw, outreq, res) + return + } + removeConnectionHeaders(res.Header) for _, h := range hopHeaders { @@ -463,3 +480,67 @@ func (m *maxLatencyWriter) stop() { m.t.Stop() } } + +func upgradeType(h http.Header) string { + if !httpguts.HeaderValuesContainsToken(h["Connection"], "Upgrade") { + return "" + } + return strings.ToLower(h.Get("Upgrade")) +} + +func (p *ReverseProxy) handleUpgradeResponse(rw http.ResponseWriter, req *http.Request, res *http.Response) { + reqUpType := upgradeType(req.Header) + resUpType := upgradeType(res.Header) + if reqUpType != resUpType { + p.getErrorHandler()(rw, req, fmt.Errorf("backend tried to switch protocol %q when %q was requested", resUpType, reqUpType)) + return + } + hj, ok := rw.(http.Hijacker) + if !ok { + p.getErrorHandler()(rw, req, fmt.Errorf("can't switch protocols using non-Hijacker ResponseWriter type %T", rw)) + return + } + backConn, ok := res.Body.(io.ReadWriteCloser) + if !ok { + p.getErrorHandler()(rw, req, fmt.Errorf("internal error: 101 switching protocols response with non-writable body")) + return + } + defer backConn.Close() + conn, brw, err := hj.Hijack() + if err != nil { + p.getErrorHandler()(rw, req, fmt.Errorf("Hijack failed on protocol switch: %v", err)) + return + } + defer conn.Close() + res.Body = nil // so res.Write only writes the headers; we have res.Body in backConn above + if err := res.Write(brw); err != nil { + p.getErrorHandler()(rw, req, fmt.Errorf("response write: %v", err)) + return + } + if err := brw.Flush(); err != nil { + p.getErrorHandler()(rw, req, fmt.Errorf("response flush: %v", err)) + return + } + errc := make(chan error, 1) + spc := switchProtocolCopier{user: conn, backend: backConn} + go spc.copyToBackend(errc) + go spc.copyFromBackend(errc) + <-errc + return +} + +// switchProtocolCopier exists so goroutines proxying data back and +// forth have nice names in stacks. +type switchProtocolCopier struct { + user, backend io.ReadWriter +} + +func (c switchProtocolCopier) copyFromBackend(errc chan<- error) { + _, err := io.Copy(c.user, c.backend) + errc <- err +} + +func (c switchProtocolCopier) copyToBackend(errc chan<- error) { + _, err := io.Copy(c.backend, c.user) + errc <- err +} diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go index ddae11b168ce7..039273e7c581e 100644 --- a/src/net/http/httputil/reverseproxy_test.go +++ b/src/net/http/httputil/reverseproxy_test.go @@ -153,15 +153,20 @@ func TestReverseProxy(t *testing.T) { func TestReverseProxyStripHeadersPresentInConnection(t *testing.T) { const fakeConnectionToken = "X-Fake-Connection-Token" const backendResponse = "I am the backend" + + // someConnHeader is some arbitrary header to be declared as a hop-by-hop header + // in the Request's Connection header. + const someConnHeader = "X-Some-Conn-Header" + backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { if c := r.Header.Get(fakeConnectionToken); c != "" { t.Errorf("handler got header %q = %q; want empty", fakeConnectionToken, c) } - if c := r.Header.Get("Upgrade"); c != "" { - t.Errorf("handler got header %q = %q; want empty", "Upgrade", c) + if c := r.Header.Get(someConnHeader); c != "" { + t.Errorf("handler got header %q = %q; want empty", someConnHeader, c) } - w.Header().Set("Connection", "Upgrade, "+fakeConnectionToken) - w.Header().Set("Upgrade", "should be deleted") + w.Header().Set("Connection", someConnHeader+", "+fakeConnectionToken) + w.Header().Set(someConnHeader, "should be deleted") w.Header().Set(fakeConnectionToken, "should be deleted") io.WriteString(w, backendResponse) })) @@ -173,15 +178,15 @@ func TestReverseProxyStripHeadersPresentInConnection(t *testing.T) { proxyHandler := NewSingleHostReverseProxy(backendURL) frontend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { proxyHandler.ServeHTTP(w, r) - if c := r.Header.Get("Upgrade"); c != "original value" { - t.Errorf("handler modified header %q = %q; want %q", "Upgrade", c, "original value") + if c := r.Header.Get(someConnHeader); c != "original value" { + t.Errorf("handler modified header %q = %q; want %q", someConnHeader, c, "original value") } })) defer frontend.Close() getReq, _ := http.NewRequest("GET", frontend.URL, nil) - getReq.Header.Set("Connection", "Upgrade, "+fakeConnectionToken) - getReq.Header.Set("Upgrade", "original value") + getReq.Header.Set("Connection", someConnHeader+", "+fakeConnectionToken) + getReq.Header.Set(someConnHeader, "original value") getReq.Header.Set(fakeConnectionToken, "should be deleted") res, err := frontend.Client().Do(getReq) if err != nil { @@ -195,8 +200,8 @@ func TestReverseProxyStripHeadersPresentInConnection(t *testing.T) { if got, want := string(bodyBytes), backendResponse; got != want { t.Errorf("got body %q; want %q", got, want) } - if c := res.Header.Get("Upgrade"); c != "" { - t.Errorf("handler got header %q = %q; want empty", "Upgrade", c) + if c := res.Header.Get(someConnHeader); c != "" { + t.Errorf("handler got header %q = %q; want empty", someConnHeader, c) } if c := res.Header.Get(fakeConnectionToken); c != "" { t.Errorf("handler got header %q = %q; want empty", fakeConnectionToken, c) @@ -980,3 +985,66 @@ func TestSelectFlushInterval(t *testing.T) { }) } } + +func TestReverseProxyWebSocket(t *testing.T) { + backendServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if upgradeType(r.Header) != "websocket" { + t.Error("unexpected backend request") + http.Error(w, "unexpected request", 400) + return + } + c, _, err := w.(http.Hijacker).Hijack() + if err != nil { + t.Error(err) + return + } + defer c.Close() + io.WriteString(c, "HTTP/1.1 101 Switching Protocols\r\nConnection: upgrade\r\nUpgrade: WebSocket\r\n\r\n") + bs := bufio.NewScanner(c) + if !bs.Scan() { + t.Errorf("backend failed to read line from client: %v", bs.Err()) + return + } + fmt.Fprintf(c, "backend got %q\n", bs.Text()) + })) + defer backendServer.Close() + + backURL, _ := url.Parse(backendServer.URL) + rproxy := NewSingleHostReverseProxy(backURL) + rproxy.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests + + frontendProxy := httptest.NewServer(rproxy) + defer frontendProxy.Close() + + req, _ := http.NewRequest("GET", frontendProxy.URL, nil) + req.Header.Set("Connection", "Upgrade") + req.Header.Set("Upgrade", "websocket") + + c := frontendProxy.Client() + res, err := c.Do(req) + if err != nil { + t.Fatal(err) + } + if res.StatusCode != 101 { + t.Fatalf("status = %v; want 101", res.Status) + } + if upgradeType(res.Header) != "websocket" { + t.Fatalf("not websocket upgrade; got %#v", res.Header) + } + rwc, ok := res.Body.(io.ReadWriteCloser) + if !ok { + t.Fatalf("response body is of type %T; does not implement ReadWriteCloser", res.Body) + } + defer rwc.Close() + + io.WriteString(rwc, "Hello\n") + bs := bufio.NewScanner(rwc) + if !bs.Scan() { + t.Fatalf("Scan: %v", bs.Err()) + } + got := bs.Text() + want := `backend got "Hello"` + if got != want { + t.Errorf("got %#q, want %#q", got, want) + } +} diff --git a/src/net/http/transport.go b/src/net/http/transport.go index c459092cb8987..7ef414ba53a2f 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -1714,7 +1714,7 @@ func (pc *persistConn) readLoop() { alive = false } - if !hasBody { + if !hasBody || bodyWritable { pc.t.setReqCanceler(rc.req, nil) // Put the idle conn back into the pool before we send the response From de50ea3cd848f187766825402f8d6c8109536443 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 12 Nov 2018 11:36:12 -0500 Subject: [PATCH 020/594] bufio: put notes about len(p) together CL 145577 added the part about io.ReadFull to read len(p) but it should be next to the existing sentence about not reading len(p) bytes. Change-Id: Idfa037c59a3085d44d5da6129188473db0e96d23 Reviewed-on: https://go-review.googlesource.com/c/148903 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Alan Donovan --- src/bufio/bufio.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go index e498dfea1ed16..46df6192280b8 100644 --- a/src/bufio/bufio.go +++ b/src/bufio/bufio.go @@ -186,9 +186,8 @@ func (b *Reader) Discard(n int) (discarded int, err error) { // It returns the number of bytes read into p. // The bytes are taken from at most one Read on the underlying Reader, // hence n may be less than len(p). -// At EOF, the count will be zero and err will be io.EOF. -// // To read exactly len(p) bytes, use io.ReadFull(b, p). +// At EOF, the count will be zero and err will be io.EOF. func (b *Reader) Read(p []byte) (n int, err error) { n = len(p) if n == 0 { From a48a666bc89d355205550d43a9fdf1a9c507a123 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 12 Nov 2018 22:20:17 -0500 Subject: [PATCH 021/594] go/build: do not suggest runtime.Version in comment The form of runtime.Version is not guaranteed to be helpful. Do not suggest it. (The suggestion was added in CL 136215.) Change-Id: I3227d2e66b6ce860b7e62d7ba531c18fb173823c Reviewed-on: https://go-review.googlesource.com/c/149258 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/go/build/doc.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/go/build/doc.go b/src/go/build/doc.go index 682315cbd6a43..8e3858feea926 100644 --- a/src/go/build/doc.go +++ b/src/go/build/doc.go @@ -111,8 +111,7 @@ // - "go1.12", from Go version 1.12 onward // - any additional words listed in ctxt.BuildTags // -// There are no build tags for beta or minor releases. Programs that need the -// minor release number can call runtime.Version. +// There are no build tags for beta or minor releases. // // If a file's name, after stripping the extension and a possible _test suffix, // matches any of the following patterns: From 9d025bdafe8390011428b27fe944ee6acc8fa011 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 12 Nov 2018 12:42:47 -0500 Subject: [PATCH 022/594] container/heap: adjust wording in comments Followup to CL 129779 but also some other minor tweaks. Change-Id: Id71455d8a14f5e33f82c942c9e892da56c49d17c Reviewed-on: https://go-review.googlesource.com/c/149257 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/container/heap/heap.go | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/container/heap/heap.go b/src/container/heap/heap.go index 1ed0da8e6a653..2e09da8613aa3 100644 --- a/src/container/heap/heap.go +++ b/src/container/heap/heap.go @@ -38,7 +38,7 @@ type Interface interface { // Init establishes the heap invariants required by the other routines in this package. // Init is idempotent with respect to the heap invariants // and may be called whenever the heap invariants may have been invalidated. -// Its complexity is O(n) where n = h.Len(). +// The complexity is O(n) where n = h.Len(). func Init(h Interface) { // heapify n := h.Len() @@ -47,18 +47,16 @@ func Init(h Interface) { } } -// Push pushes the element x onto the heap. The complexity is -// O(log(n)) where n = h.Len(). -// +// Push pushes the element x onto the heap. +// The complexity is O(log n) where n = h.Len(). func Push(h Interface, x interface{}) { h.Push(x) up(h, h.Len()-1) } -// Pop removes the minimum element (according to Less) from the heap -// and returns it. The complexity is O(log(n)) where n = h.Len(). -// It is equivalent to Remove(h, 0). -// +// Pop removes and returns the minimum element (according to Less) from the heap. +// The complexity is O(log n) where n = h.Len(). +// Pop is equivalent to Remove(h, 0). func Pop(h Interface) interface{} { n := h.Len() - 1 h.Swap(0, n) @@ -66,9 +64,8 @@ func Pop(h Interface) interface{} { return h.Pop() } -// Remove removes the element at index i from the heap and returns -// the element. The complexity is O(log(n)) where n = h.Len(). -// +// Remove removes and returns the element at index i from the heap. +// The complexity is O(log n) where n = h.Len(). func Remove(h Interface, i int) interface{} { n := h.Len() - 1 if n != i { @@ -83,7 +80,7 @@ func Remove(h Interface, i int) interface{} { // Fix re-establishes the heap ordering after the element at index i has changed its value. // Changing the value of the element at index i and then calling Fix is equivalent to, // but less expensive than, calling Remove(h, i) followed by a Push of the new value. -// The complexity is O(log(n)) where n = h.Len(). +// The complexity is O(log n) where n = h.Len(). func Fix(h Interface, i int) { if !down(h, i, h.Len()) { up(h, i) From e51b19a993efa61b7d8f8d2828d9ee95ea82c98c Mon Sep 17 00:00:00 2001 From: Martin Garton Date: Tue, 13 Nov 2018 13:34:42 +0000 Subject: [PATCH 023/594] bufio: make Reader.Peek invalidate Unreads Since Reader.Peek potentially reads from the underlying io.Reader, discarding previous buffers, UnreadRune and UnreadByte cannot necessarily work. Change Peek to invalidate the unread buffers in all cases (as allowed according to the documentation) and thus prevent hiding bugs in the caller. (This change was previoiusly merged and then reverted due concern about being too close to a release) Fixes #18556 Change-Id: I9027d75aa834d4b27703f37711ba25de04d89f3c GitHub-Last-Rev: 917ef1e51131d734f92efc946a0ab5ca4ff69be6 GitHub-Pull-Request: golang/go#28768 Reviewed-on: https://go-review.googlesource.com/c/149297 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/bufio/bufio.go | 3 +++ src/bufio/bufio_test.go | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go index 46df6192280b8..ffb278ad9e2d0 100644 --- a/src/bufio/bufio.go +++ b/src/bufio/bufio.go @@ -128,6 +128,9 @@ func (b *Reader) Peek(n int) ([]byte, error) { return nil, ErrNegativeCount } + b.lastByte = -1 + b.lastRuneSize = -1 + for b.w-b.r < n && b.w-b.r < len(b.buf) && b.err == nil { b.fill() // b.w-b.r < len(b.buf) => buffer is not full } diff --git a/src/bufio/bufio_test.go b/src/bufio/bufio_test.go index 34d70312f7bc0..f7a0682e7033d 100644 --- a/src/bufio/bufio_test.go +++ b/src/bufio/bufio_test.go @@ -285,6 +285,24 @@ func TestUnreadRune(t *testing.T) { } } +func TestNoUnreadRuneAfterPeek(t *testing.T) { + br := NewReader(strings.NewReader("example")) + br.ReadRune() + br.Peek(1) + if err := br.UnreadRune(); err == nil { + t.Error("UnreadRune didn't fail after Peek") + } +} + +func TestNoUnreadByteAfterPeek(t *testing.T) { + br := NewReader(strings.NewReader("example")) + br.ReadByte() + br.Peek(1) + if err := br.UnreadByte(); err == nil { + t.Error("UnreadByte didn't fail after Peek") + } +} + func TestUnreadByte(t *testing.T) { segments := []string{"Hello, ", "world"} r := NewReader(&StringReader{data: segments}) From 8f7173dcdeb1a1c8af885bb2a267674b4f5fbfc4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 13 Nov 2018 15:15:02 +0000 Subject: [PATCH 024/594] cmd/go: revert "remove unnecessary else conditions" This reverts CL 144137. Reason for revert: The justification for the original commit was that golint said so, but golint is wrong. The code reads more clearly the original way. Change-Id: I960f286ed66fec67aabd953e7b69993f60b00bca Reviewed-on: https://go-review.googlesource.com/c/149339 Reviewed-by: Russ Cox --- src/cmd/go/internal/semver/semver.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/cmd/go/internal/semver/semver.go b/src/cmd/go/internal/semver/semver.go index d61c6b476a678..4af7118e55d2e 100644 --- a/src/cmd/go/internal/semver/semver.go +++ b/src/cmd/go/internal/semver/semver.go @@ -312,8 +312,9 @@ func compareInt(x, y string) int { } if x < y { return -1 + } else { + return +1 } - return +1 } func comparePrerelease(x, y string) int { @@ -352,8 +353,9 @@ func comparePrerelease(x, y string) int { if ix != iy { if ix { return -1 + } else { + return +1 } - return +1 } if ix { if len(dx) < len(dy) { @@ -365,14 +367,16 @@ func comparePrerelease(x, y string) int { } if dx < dy { return -1 + } else { + return +1 } - return +1 } } if x == "" { return -1 + } else { + return +1 } - return +1 } func nextIdent(x string) (dx, rest string) { From 43edf21eff83e95b32cc43453c3a8df816d85e88 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Tue, 6 Nov 2018 15:07:46 -0500 Subject: [PATCH 025/594] cmd/cgo: fix typo in gccgo name mangling recipe The code to implement new-style gccgo name mangling had a recipe that didn't quite match that of the compiler (incorrect handling for '.'). This showed up as a failure in the gotools cgo test if the directory containing the test run included a "." character. [This is a copy of https://golang.org/cl/147917]. Change-Id: Ia94728ecead879c8d223eb6cee6c102a8af1c86e Reviewed-on: https://go-review.googlesource.com/c/147937 Reviewed-by: Cherry Zhang --- src/cmd/cgo/out.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index c203873b13084..bc0b0b63877a3 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -1271,7 +1271,7 @@ func gccgoPkgpathToSymbolNew(ppath string) string { for _, c := range []byte(ppath) { switch { case 'A' <= c && c <= 'Z', 'a' <= c && c <= 'z', - '0' <= c && c <= '9', '_' == c: + '0' <= c && c <= '9', c == '_', c == '.': bsl = append(bsl, c) default: changed = true From b075dfba8066033e35cd62aaacf3c8a2593cfa57 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 13 Nov 2018 09:46:32 -0500 Subject: [PATCH 026/594] cmd/go/internal/modload: skip go.mod directories on all systems, not just Plan 9 I see no reason Plan 9 should be special cased. A directory named go.mod is not useful on any system. Followup to CL 129804. Change-Id: I9cc91b5934b17650bfdb07370aa73aeae445968c Reviewed-on: https://go-review.googlesource.com/c/149337 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/modload/init.go | 5 ++--- .../go/internal/modload/{init_plan9_test.go => init_test.go} | 0 2 files changed, 2 insertions(+), 3 deletions(-) rename src/cmd/go/internal/modload/{init_plan9_test.go => init_test.go} (100%) diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index da778b4fad413..7e8c223189395 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -25,7 +25,6 @@ import ( "path" "path/filepath" "regexp" - "runtime" "strconv" "strings" ) @@ -402,7 +401,7 @@ func FindModuleRoot(dir, limit string, legacyConfigOK bool) (root, file string) // Look for enclosing go.mod. for { - if fi, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil && !(runtime.GOOS == "plan9" && fi.IsDir()) { + if fi, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil && !fi.IsDir() { return dir, "go.mod" } if dir == limit { @@ -420,7 +419,7 @@ func FindModuleRoot(dir, limit string, legacyConfigOK bool) (root, file string) dir = dir1 for { for _, name := range altConfigs { - if fi, err := os.Stat(filepath.Join(dir, name)); err == nil && !(runtime.GOOS == "plan9" && fi.IsDir()) { + if fi, err := os.Stat(filepath.Join(dir, name)); err == nil && !fi.IsDir() { return dir, name } } diff --git a/src/cmd/go/internal/modload/init_plan9_test.go b/src/cmd/go/internal/modload/init_test.go similarity index 100% rename from src/cmd/go/internal/modload/init_plan9_test.go rename to src/cmd/go/internal/modload/init_test.go From e787b133284263e53154b8b2f8f6078e8f0c9850 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Mon, 12 Nov 2018 13:42:46 -0500 Subject: [PATCH 027/594] cmd/go: vet: pass non-.go files to vet tool The "gofiles" cache entry has been renamed "srcfiles", and it includes non-Go files (.s, .c, .cxx) that belong to the package. It does not include raw cgo files. Added regression test. Fixes #27665 Change-Id: I4884fe9b4f823f50705f8c2d357a04a8e567734f Reviewed-on: https://go-review.googlesource.com/c/148904 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/work/exec.go | 51 ++++++++++++++++++-------- src/cmd/go/testdata/script/vet_asm.txt | 15 ++++++++ src/cmd/vet/main.go | 8 +++- 3 files changed, 58 insertions(+), 16 deletions(-) create mode 100644 src/cmd/go/testdata/script/vet_asm.txt diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index d31f96591b727..d6f9021c35c09 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -377,7 +377,7 @@ func (b *Builder) build(a *Action) (err error) { if b.NeedExport { p.Export = a.built } - if need&needCompiledGoFiles != 0 && b.loadCachedGoFiles(a) { + if need&needCompiledGoFiles != 0 && b.loadCachedSrcFiles(a) { need &^= needCompiledGoFiles } // Otherwise, we need to write files to a.Objdir (needVet, needCgoHdr). @@ -575,7 +575,13 @@ func (b *Builder) build(a *Action) (err error) { b.cacheCgoHdr(a) } } - b.cacheGofiles(a, gofiles) + + var srcfiles []string // .go and non-.go + srcfiles = append(srcfiles, gofiles...) + srcfiles = append(srcfiles, sfiles...) + srcfiles = append(srcfiles, cfiles...) + srcfiles = append(srcfiles, cxxfiles...) + b.cacheSrcFiles(a, srcfiles) // Running cgo generated the cgo header. need &^= needCgoHdr @@ -587,11 +593,11 @@ func (b *Builder) build(a *Action) (err error) { // Prepare Go vet config if needed. if need&needVet != 0 { - buildVetConfig(a, gofiles) + buildVetConfig(a, srcfiles) need &^= needVet } if need&needCompiledGoFiles != 0 { - if !b.loadCachedGoFiles(a) { + if !b.loadCachedSrcFiles(a) { return fmt.Errorf("failed to cache compiled Go files") } need &^= needCompiledGoFiles @@ -794,13 +800,13 @@ func (b *Builder) loadCachedCgoHdr(a *Action) bool { return err == nil } -func (b *Builder) cacheGofiles(a *Action, gofiles []string) { +func (b *Builder) cacheSrcFiles(a *Action, srcfiles []string) { c := cache.Default() if c == nil { return } var buf bytes.Buffer - for _, file := range gofiles { + for _, file := range srcfiles { if !strings.HasPrefix(file, a.Objdir) { // not generated buf.WriteString("./") @@ -815,7 +821,7 @@ func (b *Builder) cacheGofiles(a *Action, gofiles []string) { return } } - c.PutBytes(cache.Subkey(a.actionID, "gofiles"), buf.Bytes()) + c.PutBytes(cache.Subkey(a.actionID, "srcfiles"), buf.Bytes()) } func (b *Builder) loadCachedVet(a *Action) bool { @@ -823,34 +829,34 @@ func (b *Builder) loadCachedVet(a *Action) bool { if c == nil { return false } - list, _, err := c.GetBytes(cache.Subkey(a.actionID, "gofiles")) + list, _, err := c.GetBytes(cache.Subkey(a.actionID, "srcfiles")) if err != nil { return false } - var gofiles []string + var srcfiles []string for _, name := range strings.Split(string(list), "\n") { if name == "" { // end of list continue } if strings.HasPrefix(name, "./") { - gofiles = append(gofiles, name[2:]) + srcfiles = append(srcfiles, name[2:]) continue } if err := b.loadCachedObjdirFile(a, c, name); err != nil { return false } - gofiles = append(gofiles, a.Objdir+name) + srcfiles = append(srcfiles, a.Objdir+name) } - buildVetConfig(a, gofiles) + buildVetConfig(a, srcfiles) return true } -func (b *Builder) loadCachedGoFiles(a *Action) bool { +func (b *Builder) loadCachedSrcFiles(a *Action) bool { c := cache.Default() if c == nil { return false } - list, _, err := c.GetBytes(cache.Subkey(a.actionID, "gofiles")) + list, _, err := c.GetBytes(cache.Subkey(a.actionID, "srcfiles")) if err != nil { return false } @@ -879,6 +885,7 @@ type vetConfig struct { Dir string // directory containing package ImportPath string // canonical import path ("package path") GoFiles []string // absolute paths to package source files + NonGoFiles []string // absolute paths to package non-Go files ImportMap map[string]string // map import path in source code to package path PackageFile map[string]string // map package path to .a file with export data @@ -890,7 +897,18 @@ type vetConfig struct { SucceedOnTypecheckFailure bool // awful hack; see #18395 and below } -func buildVetConfig(a *Action, gofiles []string) { +func buildVetConfig(a *Action, srcfiles []string) { + // Classify files based on .go extension. + // srcfiles does not include raw cgo files. + var gofiles, nongofiles []string + for _, name := range srcfiles { + if strings.HasSuffix(name, ".go") { + gofiles = append(gofiles, name) + } else { + nongofiles = append(nongofiles, name) + } + } + // Pass list of absolute paths to vet, // so that vet's error messages will use absolute paths, // so that we can reformat them relative to the directory @@ -899,6 +917,7 @@ func buildVetConfig(a *Action, gofiles []string) { Compiler: cfg.BuildToolchainName, Dir: a.Package.Dir, GoFiles: mkAbsFiles(a.Package.Dir, gofiles), + NonGoFiles: mkAbsFiles(a.Package.Dir, nongofiles), ImportPath: a.Package.ImportPath, ImportMap: make(map[string]string), PackageFile: make(map[string]string), @@ -995,6 +1014,8 @@ func (b *Builder) vet(a *Action) error { } } + // TODO(adonovan): delete this when we use the new vet printf checker. + // https://github.com/golang/go/issues/28756 if vcfg.ImportMap["fmt"] == "" { a1 := a.Deps[1] vcfg.ImportMap["fmt"] = "fmt" diff --git a/src/cmd/go/testdata/script/vet_asm.txt b/src/cmd/go/testdata/script/vet_asm.txt new file mode 100644 index 0000000000000..a066058c705b5 --- /dev/null +++ b/src/cmd/go/testdata/script/vet_asm.txt @@ -0,0 +1,15 @@ +# Issue 27665. Verify that "go vet" analyzes non-Go files. + +env GOARCH=amd64 +! go vet -asmdecl a +stderr 'f: invalid MOVW of x' + +-- a/a.go -- +package a + +func f(x int8) + +-- a/asm.s -- +TEXT ·f(SB),0,$0-1 + MOVW x+0(FP), AX + RET diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go index cf91e4d59679f..799f0bfb64329 100644 --- a/src/cmd/vet/main.go +++ b/src/cmd/vet/main.go @@ -365,6 +365,7 @@ type vetConfig struct { Dir string ImportPath string GoFiles []string + NonGoFiles []string ImportMap map[string]string PackageFile map[string]string Standard map[string]bool @@ -430,7 +431,12 @@ func doPackageCfg(cfgFile string) { stdImporter = &vcfg inittypes() mustTypecheck = true - doPackage(vcfg.GoFiles, nil) + + var allFiles []string + allFiles = append(allFiles, vcfg.GoFiles...) + allFiles = append(allFiles, vcfg.NonGoFiles...) + + doPackage(allFiles, nil) if vcfg.VetxOutput != "" { out := make([]vetxExport, 0, len(exporters)) for name, fn := range exporters { From 978cfa8e46d71992395d67382e96036596520cb6 Mon Sep 17 00:00:00 2001 From: "Fangming.Fang" Date: Wed, 20 Jun 2018 09:09:03 +0000 Subject: [PATCH 028/594] cmd,runtime: enable race detector on arm64 Changes include: 1. enable compiler option -race for arm64 2. add runtime/race_arm64.s to manage the calls from Go to the compiler-rt runtime 3. change racewalk.go to call racefuncenterfp instead of racefuncenter on arm64 to allow the caller pc to be obtained in the asm code before calling the tsan version 4. race_linux_arm64.syso comes from compiler-rt which just supports 48bit VA, compiler-rt is fetched from master branch which latest commit is 3aa2b775d08f903f804246af10b Fixes #25682 Change-Id: I04364c580b8157fd117deecae74a4656ba16e005 Reviewed-on: https://go-review.googlesource.com/c/138675 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/gc/racewalk.go | 4 +- src/cmd/go/internal/work/init.go | 2 +- src/cmd/internal/sys/supported.go | 2 +- src/cmd/link/internal/ld/config.go | 4 +- src/race.bash | 4 +- src/runtime/asm_arm64.s | 3 +- src/runtime/race/README | 1 + src/runtime/race/race.go | 2 +- src/runtime/race/race_linux_arm64.syso | Bin 0 -> 418080 bytes src/runtime/race_arm64.s | 445 ++++++++++++++++++++++++ 10 files changed, 457 insertions(+), 10 deletions(-) create mode 100644 src/runtime/race/race_linux_arm64.syso create mode 100644 src/runtime/race_arm64.s diff --git a/src/cmd/compile/internal/gc/racewalk.go b/src/cmd/compile/internal/gc/racewalk.go index 8a8b436a23ab2..6f251377c94ea 100644 --- a/src/cmd/compile/internal/gc/racewalk.go +++ b/src/cmd/compile/internal/gc/racewalk.go @@ -71,14 +71,14 @@ func instrument(fn *Node) { lno := lineno lineno = src.NoXPos - if thearch.LinkArch.Arch == sys.ArchPPC64LE { + if thearch.LinkArch.Arch.Family != sys.AMD64 { fn.Func.Enter.Prepend(mkcall("racefuncenterfp", nil, nil)) fn.Func.Exit.Append(mkcall("racefuncexit", nil, nil)) } else { // nodpc is the PC of the caller as extracted by // getcallerpc. We use -widthptr(FP) for x86. - // BUG: This only works for amd64. This will not + // This only works for amd64. This will not // work on arm or others that might support // race in the future. nodpc := nodfp.copy() diff --git a/src/cmd/go/internal/work/init.go b/src/cmd/go/internal/work/init.go index 3f6252ed84b7f..8d2fd10524b06 100644 --- a/src/cmd/go/internal/work/init.go +++ b/src/cmd/go/internal/work/init.go @@ -49,7 +49,7 @@ func instrumentInit() { } if cfg.BuildRace { if !sys.RaceDetectorSupported(cfg.Goos, cfg.Goarch) { - fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0]) + fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0]) os.Exit(2) } } diff --git a/src/cmd/internal/sys/supported.go b/src/cmd/internal/sys/supported.go index 22dec702a576d..a53da6ed2cbeb 100644 --- a/src/cmd/internal/sys/supported.go +++ b/src/cmd/internal/sys/supported.go @@ -9,7 +9,7 @@ package sys func RaceDetectorSupported(goos, goarch string) bool { switch goos { case "linux": - return goarch == "amd64" || goarch == "ppc64le" + return goarch == "amd64" || goarch == "ppc64le" || goarch == "arm64" case "darwin", "freebsd", "netbsd", "windows": return goarch == "amd64" default: diff --git a/src/cmd/link/internal/ld/config.go b/src/cmd/link/internal/ld/config.go index 77b03b67f9b82..2f6dd7a7e22d8 100644 --- a/src/cmd/link/internal/ld/config.go +++ b/src/cmd/link/internal/ld/config.go @@ -199,8 +199,8 @@ func mustLinkExternal(ctxt *Link) (res bool, reason string) { // When the race flag is set, the LLVM tsan relocatable file is linked // into the final binary, which means external linking is required because // internal linking does not support it. - if *flagRace && ctxt.Arch.InFamily(sys.PPC64) { - return true, "race on ppc64le" + if *flagRace && ctxt.Arch.InFamily(sys.PPC64, sys.ARM64) { + return true, "race on " + objabi.GOARCH } // Some build modes require work the internal linker cannot do (yet). diff --git a/src/race.bash b/src/race.bash index d673f503a9a73..e83c175df3b4c 100755 --- a/src/race.bash +++ b/src/race.bash @@ -9,7 +9,7 @@ set -e function usage { - echo 'race detector is only supported on linux/amd64, linux/ppc64le, freebsd/amd64, netbsd/amd64 and darwin/amd64' 1>&2 + echo 'race detector is only supported on linux/amd64, linux/ppc64le, linux/arm64, freebsd/amd64, netbsd/amd64 and darwin/amd64' 1>&2 exit 1 } @@ -21,7 +21,7 @@ case $(uname) in fi ;; "Linux") - if [ $(uname -m) != "x86_64" ] && [ $(uname -m) != "ppc64le" ]; then + if [ $(uname -m) != "x86_64" ] && [ $(uname -m) != "ppc64le" ] && [ $(uname -m) != "aarch64" ]; then usage fi ;; diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s index 2248cec132520..28d3077b9dea0 100644 --- a/src/runtime/asm_arm64.s +++ b/src/runtime/asm_arm64.s @@ -18,7 +18,8 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0 // create istack out of the given (operating system) stack. // _cgo_init may update stackguard. MOVD $runtime·g0(SB), g - MOVD RSP, R7 + BL runtime·save_g(SB) + MOVD RSP, R7 MOVD $(-64*1024)(R7), R0 MOVD R0, g_stackguard0(g) MOVD R0, g_stackguard1(g) diff --git a/src/runtime/race/README b/src/runtime/race/README index 1c66c636956a8..be53b4c37c9a2 100644 --- a/src/runtime/race/README +++ b/src/runtime/race/README @@ -10,3 +10,4 @@ race_linux_amd64.syso built with LLVM fe2c72c59aa7f4afa45e3f65a5d16a374b6cce26 a race_linux_ppc64le.syso built with LLVM fe2c72c59aa7f4afa45e3f65a5d16a374b6cce26 and Go 323c85862a7afbde66a3bba0776bf4ba6cd7c030. race_netbsd_amd64.syso built with LLVM fe2c72c59aa7f4afa45e3f65a5d16a374b6cce26 and Go 323c85862a7afbde66a3bba0776bf4ba6cd7c030. race_windows_amd64.syso built with LLVM ae08a22cc215448aa3ad5a6fb099f6df77e9fa01 and Go 323c85862a7afbde66a3bba0776bf4ba6cd7c030. +race_linux_arm64.syso built with LLVM 3aa2b775d08f903f804246af10b80a439c16b436 and Go ef2c48659880c7e8a989e6721a21f018790f7793. diff --git a/src/runtime/race/race.go b/src/runtime/race/race.go index 95e965411b76d..d298e805cfaec 100644 --- a/src/runtime/race/race.go +++ b/src/runtime/race/race.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build race,linux,amd64 race,freebsd,amd64 race,netbsd,amd64 race,darwin,amd64 race,windows,amd64 race,linux,ppc64le +// +build race,linux,amd64 race,freebsd,amd64 race,netbsd,amd64 race,darwin,amd64 race,windows,amd64 race,linux,ppc64le race,linux,arm64 package race diff --git a/src/runtime/race/race_linux_arm64.syso b/src/runtime/race/race_linux_arm64.syso new file mode 100644 index 0000000000000000000000000000000000000000..65bc1ececa5a7cef882b63a37ab3a53b46952aae GIT binary patch literal 418080 zcmdSCe|%Ndo$tN&-X}ju5Rrr*B4f@;LWR_}Dp*O!4m&4^np#^!`r~nWhm!+B-#55~bvMf7U)b zIi%>^=RVK;@$htns_T}zj$^`qj`@ihe+zSsNqjte?8Uc# z`Q~fpAzSvNysOR?>2y&#El;N(OQ(ODPOnU-A5W)$mQEL^Q$L+nq|GZmEdVMGE`1n@;P~ z=}qbMi|O>1bh(e3UL=3T1%FeWb7jT+ z_==W-V&mpVS|4w$H*Q`Q-|8vz%>R6}y53C5fBcH48oy*FQ_rm`HIe*dZ#7qM_`9bY zr_b|y9=hS7f_YAE{&jpmC+hdqo5^{37i^}UQnzsY3fSDMLH`PWp= zzoE3HddHRb7M$1k{l~37@X6Nhuz6|)NpZ5f9&{ox6`pzx|@4zQ`1WT^t=H*g;vNIVR{%!S!h95TWH@W$G zZ^(cp*O{DGMH{(}XW__lv+{F$ubLmiQ{`mko#&pHU*)(}m5!JHi<4WbAN=4C8}q=k z-XF|>smk&4b^=qCGr3Bz6uWMI-ZM+*v&vH;TF@^aLIfZ$jHHB3V0h@3$xp(ueJK{zNZ_1&3ibfKL)nLZXtEDs`digjE0A+2bJbN)p!Tx z;$I4I_f=pB+P3BM7gn`ZzwOS*fAPTMjWdDq@LxP!@L4k>zsAg93|<~%s=60=YTo)r zwcva4qd#xF!!69;am~F2&+6Td)ur5ws`bFOGry(!2S5qo_^WSP_!buaed8nV0Uzb_v+nGuev@`? zdgo`2bHQhOReQmUy#KpfSoQCooA>YD3{o$D-_IVce%f4^UvlN+jiS4MU+}jDf9qbD z|A>2G)k)wxN%@n&xA&c7^&Mtr{@~3|HEOQ6f2*as^1Dwop8Tsv3V!X)%zxIKS+&Cy z=It;SlFrC~`v=X{S3&bX-tu(gAo$+#g?kHxueTZRVfRAjWhQB1zHqw@+B#hIaKVrH zdpmfpH#75Cx1<-cw!Qpq(Qj4PUAe2V209b|H0OK4N1XK&r+gf^W;V4~3y&wiwY%{o z?`Psqc!sX%f8n1e?YzDDyYDrAj{XIg;H;s)aDJJWeBthMsRyb*x8sM6GeyJTZzuEj zV`%g*%nb0CRkaWNX>J9R=K3&wJi@aVI3B*O;)cWT%)UW?$8QU04Lnwf-cAC?++Y1| z_1ypUgT@`q%};>$c*4!VCKU^T%1iw|=!OOkQ z{na~uw!3jI?dknxXs*6Az|Rio>qTJM27kEsnr~G<`^e75XX$GP?>lb0w?KSTv{z@x zJv0A`w;rwj_1dn+E1a2j?CqZo#v5n6nj`m14^-Fv`sv0vD8m@Z!uLrIlPra}D?Qi|G@$ED((EQZ<B*D%+I2>>K3Kn{a)i# z>XiPpt-AFGKWL0!+*0t5PQ>#0N^=?I&$IJbx#`jBEZ|!|@WaOcU@k-0wwp^S<1$Cn z@{f>T|M`ILtuV!9t>7(X&dWdg{MV{?(SPKv?>By*ws$T4dcjxB^!&$x2l$Z3Zod0( z->iOyZ!OR6ZhVOK-+FOt!Q;r~7RDYo(^)IfG<5yfbsMTbl-Sw$m(DpBhI`51W-g~p zq)I%bcwtNRdf;&PbTuO1@~`{V*Q&qt`qPbqYd-Qw>u04YEnA6j6W<=eATIyKzV3tH@~ezn;Et0x#w8lO4djgFau@xRwO#^l{*t_Zvqq=zU|ii45IBzH46WJG$L}a**=IxNSw` zKS6#1_#E1-rGLSd5FYd%Nx$c&-*eONNs~gaUsazlsrsqOEeT+=<$=l8pOb!{6TB-= z<9V+%#BaZs+g)^nDKEO)bQPUvdfunJ#r=u3Pj?jc=;W5BKN$BdaMpc&omjiq(t*kikB-iy-FCt4 z8o#IXI{(hfbxRM$3(d49@YZi}Z#F)AZnEzK%s1=jK)mqoL#_0^Z%zGEN^e?Mb*R4d z4)T_yT756oy5^=~XuSv|g-Dhe(;r}!hCuG#5O4uoxtQDzqD z&K8p@0FNhKlNzDyEYGAO#uN&lO|Cf}^S-gAv#-q`ueYid&L&N>s8iA{S?0k_&44(!=@>%iyic@H6xnU znt2X9*0N?=NwsGBSu^mn5oZ=_CSuO3gqEFIrbqOhC)%dHXBg{JXfP``S>4(jI}pFd zzf-gv+c5XBEI-+|cg>2Y7N24b|Nibn%3nfXacDcX@!l=MyKpXCi+{me+uT;uCE7~D zn~KshLVTc-c1zdYbx3n~Eo)x=#pyRfAF+q#J{I;7+t|7#vmMb@44z!%$A<7HNf!61 zedU|qt~;dpiZ&#MLwbI{^0w?$(`H!zVR`X9)hVT&O8U8qXE*ZBox0?m7V%g5>-Rjn z7LRydnZDOY%)xB(oBX*$>*3`^$YPb-55I=4d(@9)W^8K57JLK;yi-dyhi%+9)oW8( z)wu>5eiPahel)k1J{gloK)KPA<=6o~b;AJhOP_@I-k^ zk*V`|F6Oy}=LbAHO}W=k8gSNm`{_5nT65Xd5RVg6XWjDs(A+`il)Hc1=;-CU z|1{7EY<}(^=fkT7)7ZQeokA}-!FBwp|5_CIWNBE z`W|@srdV{}7L7GNb?#$PV;=O^oJo(x)P;s=L(kGwbXG-=p}rsO-4gb5`rM*nU~V_3 zK6&VLPQ@5Kd(nSm}Ux(VA0)39B&N&AH-mi>K~)_oz* z31rM$Yn`s?j8SX59sQ`@H>v*ny{=~d9=OPWyJX*y0y84mB2z2Tv&_cM8?PRz8#Jkb z^(J+6z1yX_2_6GK@K%Vgd)>;DUXn1257*Jwk&FBhwONb)mB{l){9e;-e(P^ae87w} z8?)=JwUYDCrgbvY9_q&7IKtGh@2Ozz2;Q*$;@ht~6uWrcAwwB>OIw&9 zmT`bL3Vh@F0bel*zr1LU8Mj*~7pxC>O2U-?QTgPV<<+ji9*Mz&qREW%=>O>5J4KJn zjWe_X8kHU;+iAO{SLk$fbXVAZG_7v}ucc$PYuAM@+Aw3~l#l*(K>fu!O{y4v5=WjF zpYrx^&)_HE+44=(i)?4UPAvO*muR~kxhGjb7jVwkdkQ}WCmL@ZGRj+7B{3L2pOTOnLOP!&;r$=`&hG}8H zQR5z{{naCV&YL^lsIQr^%(;8d8x_lc|Asjg-)ts37lh@Ski#YL|KFkSn5bXgdPA}= zQr7uKF>SLC({?lKKMQz#&s;vKtg~-7!(d> z2XG<}+nP+)$|$KZliG3~iuWu}7Cm*1DH=}V&%Zi(;jrIZ^i(r4K1%!1w2vWgLLX}X z{?dy1LHlOJ_C=dvKWbn77?WrFxb}ae56w%AwYoTIRt+K>7XQGk5>5HWl=+UieDSe# z{=D)0Bs?s(=1-(F1WF(bL(G(A~0!19#oi6ltB zz_;5db35r8mE-B;{c+MKymI$9=xMi&^LMSkNNc>@T~}G|EtKx*kF*%K%mwa}485lX z9_`^TS&Z%v4Y0o4HqEEuseTN3DT+C{yUsTGo+eB6lu-@x!d!FT&^lfE>+R^v^ zl8zgpuggS}Ez`};h;LFQJmMSfC6({^^FH&=q(W13#B&bRPxd!8A$#gKwrr^{G&|LQ zQ^Xu+tmRS4lty^ZK^8FlBGk1|+e$+|!Wi2x0R~zrZQuNT5eRGg~ z)B`V3ZpW!5hu~MKC$N>CXAa7Y><_O^_RAz5|CU#-oS$V3gV4P`f!EP6gyc{eRuKUsMmd2<)d zw|SJCI$rL9oOHRu@p7+ar`ww~UhZ0(M|*R|%XMX?%SFe_O|p5ED;+O)3;rAn-@Ng1 z&%^&Md>4O?;hMG%*B#nN9qBwK zA)kiZ#@_A$)e+ww#1AuoE+k(5G88yNGTS4e)KC!Jgy?+Scz`<|dqVJ-a^ zBL`nfulJT$?%EWTE$D8a;cx1s9qC5z*M{X2=|0rHV9V@7-`xw7ed>>~4;4>0HSnk7 zA0jPkAM*h3Luc{;|6=N9@POVA@}9v1e7$GzfZj6RGkAcn_Y59j z%V+Qae?H$cctGzw-ZOZBulEcd(0dW@89cz(dj=2a{Q&P7Jiym`1`p_+`(MukI$7@% zdB8bm;Q@bn79Q|RyWY>_0UtUG5BTe|@POZiYdeDneDW+j;QMyHpUDHxISUW?%d_x+ zU)uG4CJ*?~S$M!-pM?i}|AI4lfarC}2LGKeA6J5L+|g4-tzL5xyZjFCwnN_u;a=d)UAhaFK2#;yE@Q& ze6&V!Xf2SZ?!57a5yJIp!cNm-vr# zIp!cN*ZaSeM>*yoEElzTD;Cu;2VuG7@6zR%gRorxZ`18D2Vpti=FuK=5SHs4N|$2} z!g9vuQI0tX%OzeiSjx=aX%WcUnZu>1{CWVk8xH#ziCk38P% zItP}srdA|O`6T$Lo0IJO3bHt{g1r#q9B|NoC70```ST@HS5!OYlFcsd)!+6f%Whhi zyX=eWrY^gA-K=Hxai{#IrB3<1e)IKw`>a!5f1^{r;xC-?zkh4= zk=i`%U(i-Tvai|2PNJ`R^6II-J{ucr274}fq#yRn*H0m3-(mf}8fA)u)Ry@Ge}8~7Wu(_r=EJ1yTdcnvZpOJ1o_!<%Ojgh z_S#Lfp>-*nEyDVi4%}g~ti6V9zL2$Ub^RD^hwbQlroATkw04%GyBgZuOFhA*_pKT0 zjQZBz6b^+u>Awzjfn%ZYC|{oJRqY=)-@1BHGwo>Jg{Q>m=uXXRCT>*zUFbpm3l|=+ zir1*$R^k|Bv(^>*i-^a#yx)u1{T+P|?N@B%o$`GQWF@Pmm#d#5bk9U~a!aOvBZOPL z!O&MPa4FBwUqwS=5q#ou@rbZo=ufe5yVZkEdD-%byeeiI$Z^ED2l+Q1KL-t8v zo5+`{xa!cK8sMg2Nb|HFK6`>S(vMy*A8M%2hkTOxJE*lg$av*{Ro$0v6>NprJ%8+X zb-`n>)`PO|)ozH_7U)>(LHORzT9^b*1b+#0u}?I6Yjlz3CiHV?FF9@kJIV4H;L%)! zbD(w;Ky?2tj z!ijJx9u(pT9%AEA>agj=&t%ipv7TC34+Ge5z08&BCEe+5!lUe|O#e0Tf%l-?A-BMm zZF-|@*HQU?#@^x1 z7^*0EboL4GA(?*%Yh<@Ob7+7Vwj$5Db%6QNJPNkW;4P7c+q^q^d6c}^0V> zJ)(W2q7CEw-XVV!-Zb_^i<@eyGQplSZPmKL9&gj>$z37uQ~&BSmX?K94)(HNi5{wU znx1yb!?Gd%GSQ~!%drN*A#328TwhWO8QjTKJfNLd5~8t z`!DLSF{f(J;8Rr@?eF({7j}m+1N3j@(j;J9oMn!8L9cnhTw>QuvM=rs!*gf-@KWrI zi`YZ!FwW3i?BWf)@3>^c7Rj*ZHr~JGC6hIjNG7*P$7@NpY-z$jT!H--j4|MafUZEi4U;)$gr zEzo>1d)jgMS1~kcQ|Qg6(2mAi%(pO30iD3kZOo<%QiyPz7eA8H6 zyB^Z{VYx8wg>`ZR`;x1khriJF#&jIa*t!&)G4K+-Cb6j2n5oeX!h_cNnPvY!c(>yZ z$0zs(oj|5r-iT}p*RaN;@2>ma-@|qs;={~3=YsHkY}{%5h3_H%4f_DUA-}S46~TkU zxv=Oj;_F}{NDvJ0&d`&Wdb%!nW36(3(*uMl`TQ97?{{na!JhYytm4|tJQEg@F zgs1b7k9Li^Ru4SNzDP&JTx-=X2>R#HY&Wo64w; zzGEj&Q`s}i8Czf9DkB?+*;5-8$vDzR$z2qS%D6y$~$|?SWYiZPB=5D)rTH=Nw-`2ToOsa1xn@;`>6q<))Z)Kg zGFkXn|MY9)3leU}jhc%PN3m-HJ}Q1JJ}TY3fVFG=Z`6~`@>YS9N+8RJ!L@9clk_e6 z3*+040jG4e0dE#|=}f+v7iDuw_YV6_LYw_p!*`~ls~`t!t!_}*JxE+zjJDW=`^6p; z_=XgdE1MWp zx$exI>!R_w-WtxewX*|zRr9D=Ex~wflGcW2*M{J9((B`_-=pK-bMwwzZztCN*p6$U z-lXanOC_{+C1!AZdgY3H3toxdD8dH`tpM*k64WE{d|}ILwRA{K;H}a zv1~iRBN;RBR^mq8$Iw3N>54Lvpl!<9yfO{egx#ajh{ zC0y*w{sk6B@znQ&QDt#qrA%_^NGCd1@npX%ihk8H1wS-0Xf@xh{WG|rJd@9!Shmah zv!kVXDe_SH^=t7Ch6nnSru>tTByCg5gS5 z#U=i(nAkhnQFbiM;k)OUg){tQ->gp)6I$=;OiJ|(xATozJa^H@vL=7?>b!!s)oObsLW!{q7|Jp|Ja`f_BH|479X*u<+;U8XX4}4 zFZ(^m{*?Gy=dZIT6(6Jh<;=}r<9E8zyC6Td03HkO*5;V==9N;9el!ouy$e?M=gB8I!{RTu)O20M zyyQ$Z#H|GLve=V9$SV_`I>3`~BOm49)q*9k!&N5JzoavqI@ft(*#XPfI6rj5zrHzo zxpcM5_FEybH?0K98i!YaNN7TrM6+jPYXpYPH~dI_DO&H=ugx zCp)#yciWdgEMLGEp(s~7mz z=3IPubuoL^#A?^VFK7op4YtW`mE{$zW3_93!U!RRvZv{u0^rCTv@3dRUV__@+&X7JNkHf$9y%rsZ zG-DqTdd(PzOPSN>{>d;hwC{<@=tJli(k%u?oi4Stg1?W>-^ z`$f;6DZMv1)4{y%I-OHFEE|k|+n>NbQ@zl>12^XDx&HfL9`^kmVilY9i0c_;fbl=i*n)zFLchGm$Sl`0eH8alazhP=XE3z3g z;R^LeY;F3*2g~|-bG!CngGm|H(k18A^J?v{?WF0S3i28$`M!j3*$f9 z=db?G8x_aa9*Pz{jWYg!vBn z@Z}!(Y$`h0w1xO}Sqp-na@O8_BHga^yRdDwvmrW;2aPHGwt;blf2*AIH0c+@Ln1Gb zJ&C-jV?MnnCX|07Z6^+5`(?JXKb=1j@5c(y9QOw1C$ruL=qDP?$r<@4mi=UWf4{`B zXO!6!DU)3%`d<&cHg?k5c*$x@$LJ`cV;4PQc)MfQL_fBk-qSd1|2lgrviTBq__v9t zEot?Kk8u7;bH43C{JrqG?NyRb1?(4QU#9U4o}1M*%K7H~!0r}wZ1Je4F-RUr&pDds zzr#K(O^IPP%s`#({~8N7+sJ*P&7^#uEq2CdoOK>WqQvZnbYe z2;W909@+hVeHzm;{L#N-%z{y}AoTA&06a$RP)792Je<|9r~Iha zRt>rneMlFH@gApcELlN(yjf+Ywv74N$I5@+?~yDYd;hfGBN;ySex2VVf9Tlz7tq}@ z->>m|xVu67QGJ3jgww^h>-#yWiWe*F*{~A-!Rq+0DthX>pJ-f8+{RYMH3>W;L)ioH zR)VJ*8poNk`1ArH2gu-OTnWH&Xm7{Qv)k?fM(ySlAEoS{-{vS9l8H zc&{|%k0qMdQ{Hj;Ripz%HZFfhJkPE#_@mZWl(;bI38Ee83i562tGiwC@r^NPK>oq~ z#rUVN_4GHm!q37QrrhG|H~|42%Z5ub#(vq~-!Q9u+U#JjvNw>aoYl3oYuB*$LbV3M zdI{E=@FAWx2v4p}ucKx+y^b<$^^CaWGS$y)X8`>J|A@_x(w^p3X>Z-aa>YBVJdfqG zA>K6aG30G@d({kN6`6FMjoq z)>=Dt2Jau|FIy)CcnQwB9kjef{i!Wd>_m&}cGk(I;;{*0L{F4>sX=&pXuE5ULtO2K z7b=dozcP}VZl<^GZntM25e3KXwCqweUfwyM*|g%x|~AGtedbu%Q=Lz-u!7 z%%vOryQH5Lm6}y5a}9G{0u8C0>^7BM9l=&3Z}nbtP~|339^Gu?F2>!-BR@&v9`o4K z%%SikT2WiVRqxxQ3xATH+fEl>Eai6E_aLrJ@hbn4{+_vRq({l815Mj~>)rrog=f+Q zYwsE23j%%e47xe7>__lh_LDEuK00S{X-~E_M7B{j^gDc$9eoP9A^Z9Q#q6zsrx9uE8VvyTbncF6Z4Cf1mXD`-=Q7 zXt8Y&8Fd7?m|bKz|2y*&_Z3xiWfuj$%6`}6quZ{$ju?f1nFL+YE_6~|&QoYMRKtI| zk~yZUpFV=W9rjg&HDSyKi(~QZwWmfG3g7*U1KC=HtlYDgxSE`f*~Dhu>a)%Vv3Z5l zW@KC_Bj6Eb@PU=`1%C-%az5?!kKSL6{9XAaVkiZ#or|@8Ph#&CZFW8=tG-TJ*k`U( zTsJz6#eX>VGwOi@=}W4cS+5^Be*5-l&7H&JeZBx43$OUeQo>VzPHva*r}otUD@Bv6 z@56ABfoguvQD6p4*IkvuO%Z^WN>JdGkSi9Zodq=Im4*y>zaYd{V@zVR|_+1U8$6n>U z8Z^^dSkd(gba8a1+x6+u(MJYeMMva&l>QU&z7uQzXV_Q!iM9W|>$U9Uv}44?g8PlH zulG`~qgTDYK9YK^ByavP`gr}jUYGjGo$GfEv`y(6K(9M?k<&E@4Du-)*?ex-%a2X9 zcFC(>6Ww6TUXc7addzR`SDGDDm2z*m)D}SiMtkqdo7!JSf(K_d@0IXkILRX2uw4t@i?l_(B+GL^ba*SOw`ee5;0XwB5cHSi(NEze9eF@^!yUCpgpJVZR+yl0$L324;3& zzUKB}ee10D%ilaTs<@_AYPZ6Bbjy3SU4eX7Uuv7w_J6iMJj&H&FM+4({ss3yl<_9e z^EFYl2Ntf&d!Pi_z90p}IwkZBKpME?IqV-o7ny*4*}Ad5^8+ieD&QZ*G2V(TslDB6| z#jl*lYS+}_+sLSAX11M-gMaDCv=!FRgtf!>devOqqNd zz2Gz4YghYvEMLW*vVJJR5C3qeFF6>cJTzzTDNxy3?#J4SKPt47>^t`+$X~#Bbilph z6QUnWr<-OYfN<>ZAeu z<2+G%=Rd>Owr=x#_Mlsemj$}x_&o_~_f2@A+75NAPRdUwe;0GE_5C4ev-z&o&}5kqTMUX0!*e*4lk(=)LTi$D0Z#v8`xX$(I73BGVVo$Mi~uX9+7;-7*= zHi`WHTWMSSpU~WS#ipPw*06ebb)8AY)3g!PEnN8mYj9%!8ee*z?ONtNJqv+?V9E;nkJVuiw-cBXV>$Rl(RxK?yz4F>{&~X zOic60n*gWf5y2SXPhBowI=t`i(J8jp0YdW@PL2Ue}M2O{~8W^!lM| z;Z;AOuGXMpDs;zL7#qH=7`}xsNOkFWq?5BTY9riN5sk#O2B392A8EYG)-v%leu1Na zx<$EePdInseoz>fVaG#1;aCN`{Qjan>3n+c2+uEM?9qmPG|hqbxPtwiVBh=p*`_CP z_{>-zl~*5X+s-|E@0m2Cel&Nt!=p24M)%w^2FnZIJQDCg`9*5s6~zXAfsLqkRX?!R znFHoAq@}mvL4oWjL?+2MBVLNlvB1vH&Yi{B0qD*B#C10_7fEE8+DZ~9IB=2d9UB8_ z@sMN=2H2Zxz9(n?YWf#{mrW#C(I7+m(NB02rt4zC$bTL z^``pVUSd?eA??8xtaBbye1XO%+^D?pm!z!bCmf^rXC}@>57LJeqmV@^9iH}6&5V5_ zAE8YP52=;AvJu2%pQF5JL+b;7SDE-ce7)Q9eDs5V=v2o7lWsykM@JX!+FUQW=pf`*07M3NrM@eH${F$E`fZm+zax9G%u9?y^bKR7l8B20T zreBjY;(R)1j3)$s@$vH_n%5J{emWMrpJYzOyO6JCvYiI*sX8Qo%83u$aY+7@kum*f zNy_*h_ej$Pv>r1rsIrBnO(BI~#tD9XGR;ft+>KNX+K+HkLY;^-}! zTOa)5yC_>vtp6Y35IWVKOY=tpJZ=HDBI6$K$DY`#y>j?Wr)x&8$PM%!%k$Fr76&%` zb9T*W53G|lb^htmofi=Qw|X!q1>KcNpFRccT|i8O+MWc>s$J>UYJ0I)IHdMhPcsJ> z(MR+Y{xteugH5mpUB~w>V81?YV_ase3u0;(r(t30H1HgqJ8>1+g@o1*Ap3Vxt!;I1-Sa5uQ+h+1FoxqYa91oe8$e4MxmS?v+o)Ijog{(FpmTH%HU;v z@0@FP`kXb;{kM|AhB3&W)XBXvrsnQL1K7>XZ<~CAG47aki3wLc|1Hd&{B$}i(a$+t z)eq~U4+V9RxvCr1!xuMHmr;*7!N+0BmV3_7werz%H*17@aq%on>!6R`$-3XiY}|{^ z^D=%Aoy9lY)hgR<8~5TW4et(}cyB0ks5?1(wh^Bdz~!#&_ju5INGsvouBOI{u9PfAYJN**D*RzMFPeb$2q@x2fS^{(OfUeFz) z(Cz}(0`iTuJX8t&s~-c6s~z?Lc4dxv{#nM{i4XAq&6r)ryqz)EaeuK3-C>k1EaqH? zV_i5BD^r7r`Tfb65KYFR+Tl)OD!zQ3KO2{^ zz*|Tx9eHk97Ul2boWlAwbBA9-J~cp7apX@6vZsYTEv=C_Wm-53(}GM=UBMITPl4Wq z&UTyMbNj9EOJanZX(LhPkH|0A{%wC#Xh#Z`Bf!y#9I3}$yZ87JzPD{@Z^y19^3zGQK?bxKlDTZ`hCkyR#^(o!L)(>p-0RD{rXtQ1AbmmIy zUwuesd#vwDbRv&?c|GRS15f*uMma0*DV}2d9?-MN5@*?a%VX`w#r~7;75~Zi+Klgl zS1@=<_y|1c2zQH1S1hfW!TR@BUd7-2tdSTzDZ;qKOUWOy_Zu+2lA7QS?Iw6dg0&rC ztl|~?*1&=7>3f8A4>ol0)EJ-0xL3HC_DkSf$e59q$9+_Ncp`ArvUWH}(BnYA+yg!> z-n;yUIClt6ghf1H8}i$o080{>1&81fEIWW@2eKxFrIPXJzT@rqq3TR<$MF~}_)*4S zp??cYq3Jne-e^~Cq5ro16YGz7#j$tU;S=X|55L)B=>;6tB3}&aSZmTy&p8$7B#Y5S z`ngAjJ@!A+F*Hw_d+8Y!|81N;G#~o551mu@hi!oG7lFeN)`@Uf`uVeF3yap{#P7Ou ztRmyPcmw=nSI9pmmJi|Dx;SXlP(C63H!VNktGv~ht{#WOLGH%jAIP$vt*l|m$C#;j z(qSxW>;2jp@LI;kW7|Qmqpcg%7X09H+t#qZDQxR(;||9mxMEou?J@rrF6O^BgO9!+ zJbQA+>laHt)24WX`V~EIr5y_&ZT|1zX&`sJy|Ar6@Vg29Imzlj;B!3zAD6ATwV?N3 z@&A89Hk$U+q#G9Xa<_qNh^fM70zdo1*zY5Z*+2M>%*I;P32XwrxBme?XE?i|_SLRK zyHUpR2l2V+9^DgoP_T#N3hzl#Y_p9cw)-qgQYW{$-2LU?%bkf0Ma+lQ%T0T09Xy7; znR{;}KFlj9n@8KieJ8S`$jn$7g^oM8t8NnOct-;LnS9;nQ?D`cJ%*0?3O*n4qSw&P zx4}O;8N+g9QItBYFMF2%J9j09N8wFL%2<4uY#R@#wslXp;KGM!=?7kqfA7pQ_7mqh zc12LO6CTkIog3dsf8AhdSyvT53g*6;yPQR%m0!4e zvB6X#{U9#lX?I3-u%iq{Y)H>_`%kU@0tBz`wThE!%g(H8@+KWe=ny$^2hiK zeQ#8o(hK6yPn4(j)j#epID4SGoC3SEIb8<&!5$6HcmAjA{2cUKXjAJb)FYVZY0_hw z@L_N##(Z?~5%lsN^zxos=wqSe^Pt0B3PGH@(nMUkk7A9j@7=D;`j1uIDZJLd?%yfA zhTq?7eOf*m8;9p?c&*6z9_lG3Dt`of`%?ot5-b{%U{or7Lu)+LCuH+h8m~>Z?kw({ z)>?AUjkkH{R<_Bekj-0zEwqNG!<{wMGL3zhf|f0^fs3#Uuf>L#iR^n zLxH#IN74P+w^{hF|JmyY@T&SL*+ zUSpK+=M2HXSKd znYJ4quw?Cu;n=!wKeoOhhD~V7`q9k?un%MtcEYzBfLm*~D8Zed^zj06Jdxv%l!K4e zCE`2S^zhNKapo9w_GI;)jP)NVE7*I1ea~584{VT|X>TvK!5+@7=z>n zHE{SKZSEj%v6DNLp#FAbStWLWd@`cnNCLj;_&tjq)6;2q&|i|=8y}4ff7F3?jqZkOpq*#qOItra&bO`t z{#)_CPCCyVoX4GZH%-2(O|Yu17vG1jw*FbrM%aG9-<>i3KJce!evha5zUb1qGWZti zs9N{vvCNh3P1@bH03NxR-w>JyPbpzfCz4z~T+hA^yz^isdpqmd+mYOdzt@EEYT6^U zycM1w`eM|sXz|op#u58W0E6av`3QSd&{4*j+`=U7s7>{s*>@?hg#B-Y7c5TN-*+f{ zFF7HaiG4okOYn%UMaz<3@@Xenm$HSMua6Te;~ZFhx^i>vT}8`Q-*flo80Ysz)1vL> zX`<_Nt32lRDLDQq*HR{v?YV}v)wsHZVz>YcO?ef+#jbpk($&M4{ZklR-On1{n-aQF7w~;(S29H(|D*I{69`S(CP~d7}E=V#isJf%}WdH@5R;K zTB0*OHQFE5{#rmc!Ct@hQE@&*W7J;Wz)bLamU08>GWxE)IKf+p+z`y|E_#NQAA#Ix zpXNZP0sOVV{}temjlsXi!v7gF{lVS9pG?EQ3;6e?;dg<**{yu?M;3n8{jJ5rhB+w& zu3o`^7P<<3e!Yz0{mN;a0sK#Q#r_E2+&7uVcRUSmEV|eJCd|S#zI%Zq#5cb&( z=dL-{Cw?WI*WC(_9>a5R2Y~vOd>i$ggU48-&@jL4q`M8Z_v8lgqU^~=8vKzTL)&hy z-_x4wr?O^|?q9vhobPu{I?o@;nS@XDzR6vQDl@`;k0X01`x^Q|?m5KudBHs1fltlh zY`A!h`n_H6%vFpziLuw*kIpQf;un7 zcJiW{=QoyZYVY>Co59i7({l=6!3P`Ihr|loIqfHQxE-3*oQf8|iodM=!a{p*nEZr{ zy>I8z!nO|Rvi@d#ih;kdUA{oUD<4}ppUPvNstx?Y$^BUQiDeb+3B}*|Zkq$Vf=PwETAR3##Cq6de{lgR9izmDjzm1_+RWA4$VX2krH=^9wTc+gW?(s)(u zfaRU|%fovaG_FMM^fqE3N5XTO%}XUe106ic-yvRgmLr(QzzpW~jFuUoyl2p#HmM7kmG=^v7k8O*2@R?8jt@>)~47{iP%t0UN{_**TeI}rf z@b9qyG;L^&BR_s>`LW_6G=Gwxb`E7Tu8r8=fildae4c~E(`sJ44Oex^S1Q>#hhYn_w&JTx=Qa}S(9TDf`DJ%32||3~xBZ&OT;U^8R%(!53E9tEa;Xl6RH zJKQIDmoc)Lu`6-z%(kz1)7$>Xhs}upYiOntnt>PV{FlY|2Lm2bu+DTjKEEx3KF|)F z+8;`iM$fVj^X^*x#%y3KY5e}=nQcDw^&0fEhq1BOZRxg`zr%UaU3cnFTXSEsKUoqx#Y%o%r`!H*R}kvhCjKI zbzCrHHg4XMoMv`bKoi6p9 z`w)BSyDHZ%K)2I+m#tqg^gMljGsmPj1CRe=&QJ@!fVi?~d*Y?^o<#4mxSGBab}=@cfyP(VZPr%yH?59n;M5 zUZpdLdDc0s+1$^AtkbUP-3fn+_0;cjhHV|ecf`Ed_K1}k%MbG&&&X5Rudy;`K_jBjww&_kz*{!lkJl1)A zj@dO`dI$Y#K0BdX=>|!6sg1dLzqpRtDe;jCd^PvscPpL~Nj>L#sb2gcb$M=^{Ce`| z$$uB)PL(X}J+fE#>{vWU;Jb6g6Q;QE?xn$fDsit|dYya%f(4#$$IaNSkJ+H>M)9ra zTkW*UKh_PA^YU4R@;J1osb4q|FXCAPM+4l5zpIQ=2U~2hF|W&St~%m}ybndA$t}Ja zKmRwez0Ccmfj=Mj7Z~`jbO-#Ec5ZXh{WQU!Xs;%L4^V5a9-f7~E;sn$^sSP$U-Tuj zO7TCn5q=-)OU|lV{+5qp>p8)CbSU4*GgaZIw%pnCQWE}*5|<3!ApD7J*F$s2<=11e5;chnB zv7+al#JvW3lUMdOI=+02g7+)HE&oP19_8H*{1a_Zhq;e|uaa*rwfm>hZ)T4OSMN3N zTmL4&srr92?O&Ne8-Z`r;T~w=GLRLMpsg5o41I5`58`uErMdB*SQ_8SY=7iO$P4kw zUikZZ{QShZUD}BbcT--xX9x0T3H0$eWxmZmVRCYIo58+pGG-<81C3;rg>>fdy=Ah~ zhTX(>*Y3+1H8TQ4{;w2j0c#x zf5+UA#Lt~z-{3IgrA&|FLUQ?zJRA8(_>ab1YjF{*ZQ0OU8He(D#?C#c{N4v^4x<-#R+I$q1V3hDZ6^HmBhHmC1#)_jfW*X()9XD(b8aYjME zOQU!$`IL1&f%wuwd|^F0pRk%e7k&?WmXULFW~Kr@fzb*h!x5%n^R&7fpE$l& z)@bbb`1+18mV0S$_Z;uI<|)h5IQ)_OX}5LV+{d0Zk+wYzrNi4dn68}MKia;jc}8qBz&dcO&j6 zh({``=r!lnp5hdrjU$~kv{(FEXQOABMS{mHsC;JwYv?fglwwHI^JsmG;>{JKqYG;( z>u?rY0veWpnO0ekacFSeg8w4E3yiQYo6@H+}Yi8<)P9 zC(#?>9hIf#2D>h}AMqC6mw%5t&9Tjv@8mnF_I=sAua5Vc8ALlR7sPuluAU?WkK6unTNOqD2x(anV;NJ$@I&C9d+6n#C=6xD{qHrh)o>fN= zyymz=J)O0d42bnIf1J7QXALwvE!fXy<5yg#O}Kg)UspYMo{46p>pP}JFk>fLy`S@x zfo>rF&R#$dIIOvy`(Z*|D8y%StX)I9XK&NqyUdH7Kxt+Fsr{#VvxiSGW9BzSDBy=K2FMs?+5KEme9&HyAL3` z2xLsK*C`pJcK@G_L3^;$UF=w(tpVsM9MeQOF5I^>?z7<^yp*X8J!5_?{ucf{>S>NN z)p1K8`w#= z#`t?VYfJYhkGkg8t-R|zRM8z~)qegi;=a5d-qprCq$&ffHM6*Pa8{At&%bpB^Auwp zHmDpi&&+e*wYmGZlpsIL9>{%c5W6rBTmD*Xp%^@B@fy}LJYM7E3GEl%wK(!o+S=_p zLtV(8PV|qcG3Clvy;|3dh!-`PSu0oK2U0#Z!3`09f5FX$wkoqy=7o|rll=5>f3Deu zu4nHIj^g8yu97q@vu)eJKe1i4gDgD{-RROi^v$?dUW+VH`D5@hecR^^Ur|cDSafo- zdO3LEKBThNsma-`^UMvC;fV%WXu!dH^@04qVL9z1!)pRqiv{Z<-S;scer`-8U-iRt zVCoYebACJHM0YA1{Ep5n1?Q2RtPD9m7DN5d)~1<=*NN{M+w<@zd_SQ)K4TsxmUlhx z6T++RT4!#pUc+4*Wu4SN+Z^p8pElq}!C96}pKL#V*p~Tb=VIpLm-F!l1$!3dy1Rlo zJ~#s(S<5A6;hpROy$LO?sqwkXAXz<|IbM#=lYm$2UYM6y+Xx-mpXGW-&ZN|~?&7OM zkCDCD08_ADEBKgrj@fWpHUUg!WU#xkC?zt_<>K7%n z!x`FX{ARPgA8!8i2eu?dn~q;z^aID1;WyRFehXif97c{;3!Vk|U0z{5MsG+x2uy=-k6!-h)Zr@(?H7XJ1)z7FUme*U%AkFCF33tMj-nLH6+_!~H%Q-}WM7MO*v zco&sD#~gfTn$G4D8wVbVmnuZRUHS4)I%f0x8n;$Jb1#WcGmc{LsWRfx1FXS1@X2~S zPwS8Pl23FPXXUNjL8CHZosUhZqw>gB%DO9u;Dy5Rl=L{a4be`z?xX?zCjFUf-b*3qdeKf~q%&Yo)gWqTreLk9fCVpfKzJ!ca zy}gg$_phq=+^MERqLE74o1LydNc|{tC0X;=(5dE8u%H;137$KFGsbuEz7HW&1gqwa z^T_slb;ftu)ymhIt%+-K;(O=b@;1@MM<`oN`^(inYn1bWWk1VkQ+F4rP4RuL5v`5& z{2kPH%I?YdTejC$+pb&o-}yU)`*&%$R*)C=^-G)Qmfb+!d-0#xrvv^I$d6?8TFQp~ z7V>w{mnpl1zbB4Q{QqmhyvC*HlyHGBHlAK1h_pPT5bjeAtu413gy?+e>= z%yWIlJi`;TABpz%EjE#%Yc4c3*>ms>(9Sc|pT|=~zWliEB^B?u;O6BkI%YqMZEzDl z0qxnvO;&d_8TbSgpT3QClI27WJOJ;&XLnGseHT%0AA4>)PE{UyWno}D*KfRU%S*&& z96MiURI|HZ#m9xNcKmhjx{RB=?oMd1iQf~xAAeljo@CnL_4g2pO$9Mip`QDYe*Rx;UouKa{@FD$Oq`3a`h|AO20n(#h?tu@O+ykxl zcbBvI-DPlvZ>%+W-6tF9Pdp=)o?qMVv?*Yp-uVd6ZAdr?I}_*p(|D&;3aKK0fs$t&dOr z@=c`mq|W2fkC?}!U%sETmGs-BJ4mB*ItuCa2B!&0i_MGL4fcv?E$u!MGM%+KO~P0AIxylj5vZd6-A6Pz~{LDg1n6 zdDkkBvwIPKFFh>B;rJS_ki4nmd6Seki@d_|yj#$lJm@~cZ>NWKp9e=?lstYvJX=w!@Ach?-KI(J@qh;V3ZnfA$gaK=gCj*Eh2B> zc-}40iuu3Ed-wRLuJhh|?U?~&AO?dF*G4lE_(IaOwedxXPuL?7e616MV*5BbWk$jd zj?yMJvCS>kNZ?C6J;xScr@>B$$IIUE@|%8q)?Zu)3XW8rm~kj}C78BWR`e ze+Hbu);2`56`x8SD>uqE)Nr{+v!(y)EQikfO~zIlk2XVVe!O>iDE16AVPg_sz4UzP z!=e!(cnjYnWYE~l!+xaWi~qMDx8ddd?wK%wd~6e2rRPM(lbZ0str2+lj7m+)kgx6Fu5i<#wUH)# zo0s)K;}1fs4?PnhSD-s^J+!_D-NKk~dLjAYl+Urjgm3CyYv2VT^23EKJr^xcTxjj4 z&|%`AE{x+745u}g+6%G01AFT<-Ui{e7_^W|O`)dxP_?AkKj?7qb?__a)}!Gm)N$ zJ;KIzOlRGrVJ|jPb5Pue&S{vxSUAuz-fYvHe#3n1T*1xA-(eT-Wc~R%%soz>2rI?X-e`fTUpHY zV!}+3nKz4A2F_~O{9`jHdlhBwp}Eee<+ft0we}2eKh716(0)vS-^if@J(qZKW*N>-X#Az%__|3;ehVH7x7s_# zm@89T;uR_GxY!S_Uk2{)2iLJfR}<%Jab4$*_k-)M-ht~WeS_;+z8%JJ7316ouE+Sc zJ~bcLGZ8cIFM$7c#)zEXB_;1T| z_9csqc>(*V!Q$a`+gA{WsP%3U9|sR5>-JnSEF;GwIW{ayPhPb+39UJWe}t*uS>oa2 z5DdDIp;*7+|4x(a21EZ@f91s;`p^2ml>49c|7-pWE`kU8-3S~&4j7P}+bDi2Uvx44 z-W>mSKEHHUcyt_H+1hV45B#B)4{A?64}NGK&R5ngdLEckZlHrTRR6-a5P1SBiH*WW zc<*8Q3{ie9G#C0e5dM;4pu}fNPwQV-+bs`yV^DkI;bHD7UF(=DBecC4SvbbpucJ+T zH3MolLc2BWHJwul{H*!#pG~{A?Nnj@Rm=NM|DF0RLq;IBa$e|D%r_Nkf=_N+Dj6J^ zalXqrT|UVoY}1^94}D5`qn*AN;H81zCHPiZ^_^Tt{$FGlm5=!4Td@(y-yuIoaW!_) zO7JRTWP{kY_CDZt&!|Y4lRWZhp_!Ioi zjJM`))|>Het~3MHj3e| zyB>eoT*)iq6X7+t6NhM?Tu0r5pLAbb*X+Dr`{OTn-yI>g(v0dOzOA}}Tmjta`c@15 zUg*mYF>oabOth}0*k_O#IkQxGSu`Qtk2n}`C%MLbDZVE0lEzx=>jp{mPVmP13`2aY zjOc*M<(`WQ=A}8Y7n(G`q#u8t|E}|*6tbtcUnF;k7PEnebI?GSkukW>h#a=aIu2u( zO-keZ3G%D@*KhIuUi9@IzR8X7BlcaMUwoK9W{@8@ych4*Ju9We)ArxQ`8Dcw!C&!x z>>c3!SYY)4GL`PDJ^~(X2$iH2d!lm7ZQV#;4e-rEkIh8y?2Txn;*~hN!~NGK*7u`2 zo3T;v!nUcpt?bu*zh2Yr=q{pV54?gurcS=aGWM+I;j#u*tVIC-AAxuBRR(a=S-=3U zE&jRg;ddoN?}9Vm2H0v}p(h^mVu?5h7-^gV4&94h)vkSNeYmc2h;iP4*h1C0pZLt> z*lV9!bw&T?v5^tJ)ZzZZbAz!&qO8N;c{nS1SNl|aHg`Sy+4GWn-zFwX>!o~G?}SI$ zwIv>V8)q)($_8)`I@-nH*UtCmALD%2z}@(Cu_si|4^Qjs0p8NXwpJ3e77q7yu?F+U zxo!LMTh%R4*EoZbDogS2) z-|&gwrif>jA6~YVO5Teu)IPaxQy5szL1*5qI7H$PM=^Gna>NnreFVD(b9sF~@7}1dccnH7WQ6kXVwORp3U1wFIp z)a9pUA9DY>@#HJ~dmZ2#XAvYz=>CEKBiu$$s3y)~TQRh1Bef9|%vGo2A|;`l+J*GCm#Pis+ZxRh!!Xwh!nCcZ+VyKkKV^De46A8>gFd z{L>Fxni{-U9AqxtXvlk?53?5kJ^e{;v+|7kKEC?zY<|b6Z0@yQKK2^s-NU&$!B1r( z`27|r&U}KN!)JIe`>Eh2pLCpe$5(sj_JZ*R{oD1r*BiU-k8?bN?_{4JNM9DLb*D~( zZ>^E#2gvAxU5aPT$P38k=?FNzld}drtQ~O-b`DzC1ai!B$|<%XS9W!Xr5}zb@Z{Fa zb;vzA@du)l+2g)^#~L}%nw{{F-!QLCl^1WJIvTrj2p$55B|quE)-88jwdjGt{FP@h zfPwQ>Z~m%xV19~oOQ}VhvELbJPEbB5yNg(#*yF?S3gU_y*;jFVKd}yTYdJc9J$}l2 za^wz;BgQ&aviGAAlWsKLnIoNtc4oteSfem@QsJso zgW9#@(EVN1|G^sPu};5!3j2oW#p%WqpZbX12ikYEwMa5p8EurWi9Ggwzl|;6!xG{( z6FKnFIAV;Utk4+F(4WTJGTrM_^ATMsPI$RFC9CSpuyQL)_k0IFBR(kHco1HjK*r60 zBM<2Jjfx{R1LDDnO355%K=m!pvH6vU^YkAlr;hfA@V~c8G+X;n=T^PEa|b4PJ`Fvy zXY1za8$QMU)ZWC_|Dz0X^hu+A*=6-Lz4yjX+l*g$FMFUDA59+ph1x$}tdPc)8(ZYn z^Xy&IsH?f^9GCoJnzQDw`?1u=7Uo<=E)QZ&7oj^9>py<}i@39?t_FV6e2Z*XC2hrb zEbmu8^9BdEWkU1!S(^iLmfGCl$2l<`?%jemC|1;-tMhU)Xgn%MACv67&rpu{z|j!% zqdhJ-jeyxuTvHJ9IfePjHl=w5{9+w*h=A8xhld$|n0d(udJnQiGkN7I*>l)5wrPJU z<~=4q0lFMHJ?3ey-WaEh$n(H6yFa`*YsJ))lSuZ9)ASFmw>pAkn-pU(=m1e-bt2Lk z@u_qI+cWi*zn>a5uCx0n|9P|1Y{u zdLufQ(V6*0N%9@kT=>xn?Gw*eFmk^LhHt|I^{sPQxp8-bb>Lsf(HBOnw{!>P^OoKq zn_NIQ1b?l&)}OUU*JbU2e}UwA1YG zlg!$+*G_?kXV$K}R&&@<Zh&xgYZK0k9LpVOQ?{$|=V2aoPczjNj$G$)I^2OcsU|4;eiTs%r#41e|gQ~`ZdA0Cf|*XGb>(E@B| zmfwgjDrb5K-Xfl(^9eQJdDN<$!*=G; z?9aKFId5c*0y?AT;xWpL;_(?DF3ewLf_MPUQ#{?y7db*aGT^0}pI{yEQ_5Ig+J#@9 zbr``%d&GC_T+hTuN6Hq#`U~%JVIMpf9TyD;23pJF7;%vH{Km-%_WTBSt#p?anMpCm z99dR-4f!W#G?>^}XIc3*reR6%U$!*vI}94sE%E07K=_1 zud*IH8>)zt-i+T3dm^$pcOYWdO~SuJMZ#|68zI zOVaT1$CcMCW~LKcGJl`u67=EZ+9;H_%$^1J^cvv{x+?Y;uYGh2(e#b#M}6p>`s=WE z{*gLhA-WLonU>ppnt-io_QWN>ZD8%1L#g!v-dr}`eM>YX4xNsUpWhn8CZK&MTd>aD zV5e!*U90SmpOn%@3-z<%&KII){=OINowDX9xq5p*pAHa@TZ1&!M+!#i8!dA51=I66@h!whh zSl1Pg^kic1Uhw>J2wp9*M=k9W+=*Ej_Df)kQr`Dm{LZ(3#J}v-m2Rayx(j?B1AcAB zueuD_O1G8kHjkMe(k> zH(If-vKf$%XYQAY$#jWPvE}_T2EU+7jEbJ!L7YnITKqh;5zO7fXDn;$&%J`V&!>!o z4?QTOI0uLK#BzYQz~=DC_i7`kU+%-Mnf>-Cc%-_6!XMF0PJJr!Q-PoIS*IzaG%Z9)B%WrgYiW*C>WTICMYl z6vCrk_W40#Tn>cCw7tf9w)plH(T?x)|F8W2yZHS#{Eo7Y<*e!Re4gX?J$xVL^9H}~ z=F>sBM<^#bV5Gfq+7La7kQXGj%d=?&`&fScfTldh-R3QwBi{$_R5$CtI}_b>x=vG{ zFSlA^JD(+HShm;%HdzXN;A+3 zF0b?dFI{MK#=pAe2LBy%8)5rZJ6a#{Ny)jHM?*G_sfP6te_RSbI8f@_ny`aQ z&kv*D%YJ(RUMjn7iqDW901RbQ&wnP}0lj8!?%iUY2AyTK@>+T}9pzp>3cd*b-nexB zT=(92GP1Sd|8g@qF`*;inaYU=g?Q#rM*q7*#>)SaxyyMLV(xmLWlW+y!Y#@DzgUmVrqVR6usM;OJu}FOw39nx?-B1CH)ANbi8&eM z(DHI3DUPjKd9;+%1ej|LPO?@r#+mJZF=0x219JJZ@VXV`(K6*;KBQm`AGpBGQ{JC< z(Cer0eSFob{si~Q)Q1+lWy}UEOIX__vNU{bpc%ZBJQw!)7Cr!cF3A4G8T8O+19u$W zN#2|(H=EWa;S$bXbDoJd-=HcR1H#=&zJE zxQnjBaBous`bLodDaCKfTKp$o0Xp1{KC8GsW7mH=dssBMze>6|dmmaDLub*s#4_O5 zLtJODe;VNPjQdz4@onmp^G-H57e41r(A#68wF%?puv8wK<>Srvm@&jN>)sA8PVw!} zxa~Vf6TgRCnIZ4h_Oa$x!yTrAg^T`{;eD38L*U-6_%d!SyW{@;vK3Ksb(;1Qlz+;{ zi?^X8^5_3&;YEqXiz!2R@y>q=UQFpzyYCw>fJp$i3f4sNt5LqA*m^pkHA8aL(3wIn zKY(B?SpAES8@m6Yr!=+q8##2<07ub$t-aPgu)p<#7l|VBW)X|2eJ9(M;5>Qt{r}

PeoLOwcfKuA&x8B$LVlh-@lENK;+LMz zQ`~0xCi_RcSNQ$5^`$Cyt+>tQSta|+MIOk2?=JF91|NrO^DqzF&N9T{MR}+C#6H=3 z?_$VAqA7aTo34Ua7q=b24!HL5aBFH($lh_S_dVc?OQHQ*P@;F z6ZLF&cI?P?QJ=nuPPEX*mKpBKW@MY#-@4ts)N8CU?Q0*2u;m%oN5yZ6p#{H0Ycd|5 zSsCM}{1zQle|(z!oGHYuc(zitKcs)cj}r7H+9Msb2m7dKPYbv%*`+>D!c+FX(Q;c*@CxMIuWJm0`?nbXf0vpb?rf5!TL{NAYcFUW$0Z24K+0{B~BFiY=p&Ex^%c z^v--7isJtW_P)KtJ}0MQkWW$Z7@Z#(=BFL}4%XzC{+f7ls>fHWk*9>uQ+&RvxQ5_f z1jW{CFAc4a&s)Pq*R|&7xs+~0x%SP*)Fp^9&Rd`M`6g1=OkB~3_2ItF4&UznQ~J@p zV?7_`8+|9h_iHS^PqX;`ZkN-v5`3>9&*evv=}N;h`o0P-oJpo5rmfGEr#6*XeE0kk zlIcE5j74g~wDi;1E>A)a62Ac7*Akl%9nN!k0y>vOH%fFtCz)Rj^2B`nce0!G;upxW zUOm;7^3R{RE(8=+ej@n60n#c$~RQ!`}`LYs;lj~->+541b{R{N)wH$S)5%6cB2 zd2utjI3}Jg{w>`|^S>P&Oz|!GH|xjGGz%WY&rHS+j0|@)Y5k;T&tzoq<=C1PhvDZk znN-F3{TfUEeZEEe*~wm`WI8mPS0wd1SPf{pgv zbn^E}w>g5IsQXB?|DFXl&-1ym)}A%rJ2mXKqh~BC;ogIniC6eq_|2=c58T+Dx!6on zeyqghHg;oPN9fI~9qv6av(2QIRor*5X2&yEAlpWlCHgnR13Iy{{yc21Oq7|XH6e4Q z#%T3SXi@+ROJl&lkXmExxkl&+@^&vl(nX8){f4G9iBPb z(zz_K$oTaRvp4ikV-cS=MTn7%#G#q(tU^ln%aSn??@HvJCj_N z9pHSL`$EX4QU?7Yc6zrLJ6&XBr?chW*rmtMbc>oa&Vy;U{V-!a^jFulcHrxW&b@ws z`6L*ta+D;-Nv|kwJABFL)3hp`!Ss6+6O!+$lVRq)jq1vjnnVc^yhsw4)?ZBG@MD;0yh#C4B# zV1K3@G)gqbKTAbBdKR<3E@HY<*j7#R-ZQoRUD~F~UgWbyu4#Vj5cx>s@RB3fnSq1f zGVQ-*TpCXwYw8lSd+=MradYg*b@*GL_lL++s{2cSpM8{N?1#!PXiYdDNcX)wruE2T z;%ui*xlHvl%q7d5`d+@SHN+fxr+)gfL*+NL-dtU>IK`dEM;2=y&bSz{yz{w_FLBTB zzoJ<7T2}K4{k11qGp$nw{3&Iv60FsKXRUJK7Y2SByFPO)9W}+` z0pc6nk&I8wA@7lCo6S4L2Q+IfqMrP%=fHH5{+G=%?ej17?)jrFYo9vTc2r;fw4mMr z@(ak<1f93`Fo%7rcf=~S*B0=1^X^G|mI}Q_XBxH6KF$n{RkEjxt|0ofrDym~t7d3m zuCH5kF8D9qN&f|dU<~>nra#ZePcEsyb=QlAOLnRSHrk)E_a$=Rgr2l*?R#J9UOLZR zkL{t)fp$&-e?>!@uhKI!bRSC)KOx%8yr9b?V|O$r=`SiLdyvW~wngL0e_p7r%H{L! z>;;|@8vJEu)9*E#BOSdy(CR@rp+^Be#h^>0YcJ=#2w@mVujZ%8C-3fjPa>P!xa-OG;C=YJ$*A`Nq_|X#VpPZ3DVWy@ZMXz=DBkz@m zM#_8a^#u1U#29x5`7Xh|3^UElbmF^z+WjtaUM$+NDe>MHyTPly%e%hBx0!VOHu8lm zB1g$2(>|rxvjNK1Bfjzr*#IXazl3E2e8$=UC3|-GHo%m%0nXBSisHcL_L)5U-{ddI z{^!|w)ZX#%thPdJrq0R!H_NyGP3cp+o}FjbdD;JDo6G{ISq5GSf9d%ky5e{~vw$5k zEwEeUAlIH)8)|x|D%2#K%nat2DvG2JOc>otz7)}5*}ijf(y!gL896K+5d7`e#mv?rU2_JC}e`re6r!#FuVF%`Nsd~a43 z+8fxX-enHi?#hbHO=cil8>*<8%=o7UddGqd*IK-s)z?Mb!K$^Kg8?sV!ONv57i`!Z zj`Tgoc?y>?L8k})mA&VJTl!tc?+Wldy9D`_@2KLOa^%ZErtF?C+i0GR6d<$FGwGG zlCoOUp`4tKpVL|MY7TiY*Zfpg<@8)1%~kW7%yTE~-TxEJLt|B$<;+L=jmE0^2&Zdl zL-@12l6moa!>3H^W*7T39^{MN2-qMtIoreQ#-1oc2qx@7j-;8jlTwp^-+7` zQEE^0pYJD=7KbGpc(SizvIIN*-~9P2u2DZho1*{XJ*q3(EM7BZJayqGIwRmLyZ@T` zzaf|BGS9g>Ufn1gsPaBXZHT0A9PX{Hbp;ps?%-_lULwGzDwyLOX& z;A<(6g zr*;w#ZOGrz0Bo+L?`GNg*^7#I2-AP#vcxqiQ;Ce7Kkg(jiqT$A_)7UYIbSn8CdDS` ze~dO1iy*$NwY2&uI;7qOXKK{0{CY9)hB6jkwsALY(4Oj~7+(O>|H=N&htGWSGR-E& zq~p!OYUOm+`)zznM)(=uL7XBuYundYg7#}hdp^eavg9>!=E*xNZ#%PH>^A1!FVMH8 z>$6R};v0p34aiX=Vhuk99<6b#PIvzz;_R*M){EiSK2@C|dKBEva!2D{7dk;c^Y;3O zyt)bYcF>2)2Yz13b`G>&_%1n4d$@#g%8sCUNH&4!Jvq&e-E7>Kx5xLfuhCtJ_YU?t zc^rWE)5V^>O>L-s!6lbAJj}Vn^R9E@`>4YmpXc3A$@{1?<9*cm;QOe9?0Vkwx%hq5 znfpHKeB^!9A?NS8%;!WN-aQQ7o#2yS_iF|4PO+KmYPerdcwB{kukVREpFR?2gS{Kz ztKP3`^y;b3RO*NiiO={n#qRYH<=3BQ`7P&J{>9<)CFe4p9p_oTYqbI-kw<{(_O@(-K!jsddiUPvfa|&bHRiKk`26JpMlF{I7GXBOT{CpN3TUv}*bYTIIpK z5UqM{OQF4ZhVos*<%em>8OpzQp5=3BgXZAT&NH;%bDr%VI?wV)&$Ilm&$Ikn=UEG+h2{>m{DI1=^?fhj?C*w+7ma;$MMYpDUwnxqP^fY3EYD@;u8gI?wVo z=UM)~GnWr&V(y#;kLMbP>zxg@w)`XKS^n{JFK^dwi&y@<)~;)~kE!Rfc0I%8(c|p? zJR@!#I?wV)&$B$apMw2xPPkWgp5-ggue@F7n&CRmp`XH-8fwSoZ5fnJj-tx zE_|B>@7fBAWqzv?{8fAl=dfBZblSDt72h38&=%Z*-H z;la7kTT6d#$*FTLGSs5;EPva1mcR2n%m2xFmaiEue>VC#LdUo-eEvGd1Mj2Gs`pXn zq4!az@zgqJ)ql2}TIa0#&o|#kown203H(Asu`Yh@tYJO&+t!aD9ajE>z`iJZqt5;8 zK&L%UZniAnva#Cu#m!#)r*xj&_@BWIkqY@W6tASR@@>|& zJ0@JwQ|`2TI+JHFmi*_nH*Dk1ZQFaN7#gpfzJnaQsYz}{3LE|A5>vq)wH2GoOhq%} zRUJOo#%qYFXeRz=JI|Ys#w$Abog#(^oAbT9vE!$%;x{pGMfiiHXJjGW63MYl8FNcfQ|4(eF;a@rp;IQ(r`STg^PK52re$M zER@^W@ZN-ri0isH_BR`6XnvYYY|Yro$$yNcqeW&wvAbHALhZ-54Yz-M@yj;8Ua<@s zhwxspY07yazdyNOc}~nTzJI=Le%%Z3nfS3d1@F_$jCKd+;Xh@3ea$lz$5rXwv1puQ zkNqD07S5lSjUhgT{ANAG2ap@Odc%d`bXOU9qllAf7#nI&;3L=~KNjcQGx(6$ckS9s zn)`1VYl=3hfA4ob;H}lOWgh(S!!ODZ*QL2!!|%a5#T|je#1J&x?p_wO@h)v7>z5R* zs1Fqp4>lA}<@&f&GmbO%QFE_+OH1&H`~zoedl^Gwg3k1rI*loTpP1PBMLJ*aEQr5C zZuL5s=j)im65?NzoIy=-U&w59-bdL(@h?Q50Us|)j5ExIT)GdMcHwmScw*HV z!|2&^V8Qv6QZu>k3*1wksbk#a@N}6|lyCW@d+{CX&TXAZ3hv^Tk6QFm{{G{OfA|70 zEEXIEKfCs#3-mWcLuqID-tHe-T-VtgFE4;-#{7Nw)!McGTF30M!RlWP(SzYOze+q* z41DqW^7hr~`p}pJbHTL=cr^gi=tRYCh3h(?Uy4al|AMz*SPm@XjQ;>|)p)cY4ge4N z#v26FBJOGhu1VsmmM}lT^iuFUN*}_34D~kS56p764*vML!htk%h%(+RF?$DCL;UIV zS<=?)$CM!-&Fv*FEK{X2;WpJ_+#7>753r_cSLX;d7vRR4KTYC0z zA^08VZg1wxdvcd@J`Or^>NzcMJ@euGP1;i)(O_R_tui6t25e^X?iBh#+)u-fT>25% zf4#i&#KGJAc%mZ@`myG^15WhX;t+UnSq}ZsSUD3+?AO$}bBZe41Dd)P8uBk=b>2JN z2hLWn*y#Eagv1oQ@8ID~gOxiw3nqq+UQ0G?sTn3tk&Lw)*eKV7{}#w*xrUcr7S zR90)(;;o^LZ4geV-~8u69P26Tf?qz_F}yCG%;3d}3l1rNO`&y#`2y?O**RRlQ2U)Z z?H76yi_t|EDqOm&NxAQy~CVitiSku{d;3t>)+#UcjCF2 z^Tzu3#ei$o+R$C$uv8!U$A0j|78R9 z>l;5ZevDm$VkBGB0WnDj=4Hw z+!yB%KfP0NjquRfCr9rlzk$uQSjyNALL1|ZeZDiw-qFgP*=?@^2f-)o!^JHCmj`^f zJZ<4pV&O6dxV!;efZ@Pa=B4xYf=f6DE_VT!=YY#jVlM-@3{p;Ti8D9x%ouai8MLw$ z75%zrQ2Xr&}2Gz=WI+xqRDx4=cHPmS^msAJEqd!YsOiZfy3OBxB9bV=6-LSnWr-tVeY^*;L)Ek?-Is#cb`|m7*-yFyJEBi-5?*Qy zN6N>v&L2fQ_k^O>1H|=d?5cZ&*k|Psy6OUN4(zvq!(Y3uwRgkyt^b!cPe;3w*2M zI607OI42o&5RX7FV&RqLp6$>rk6$r0OAG=svkN_s`w_4&_ZiKM|gcnykDQ8ASdm{5A@vYP&NfA7AubXi&d{tL~@E#zG2nqgL|ZQ}Ub9nQX7 zF@AA+`8yAF-w*#O#P{9_RiZ~R7w#7Be8`i<75}7lOn@H&u64p|J0s@GF607xP9R@L zL#{aD$?i}3dK$8M<6fN;(0KGrcoX&izeYRziTBrCew{ZLFYXDCnLCHQTD4|P_X0C& zTqVDkMBIBL%gSGo9Iy4x8fV;+Hz%}rL1R1N`CZ5wnN=6}mzCpRgMV@kbe;>ZnX~5R z?%5x<_i`N@Ouu=jK0ec-&BAx#Mn!l*Qv$kBQ5EJc zO_L6}Hm-NkOz@t|L(Uor492iU26lyWh~9LpJV)F1N=oDE4ZrglE5cL%pe!_(4btf?`T1<%H~ z9zJaR7~`&G%(awDMvyy3nJa6cQNknhAyeHUc`^roM7N9?K4-%3jccec{CPIaxe}*& zZ-b|=Ymi(KSXTQ=Hsaw_MR=j*Z}Y3d z61o%ZT=Jx8F%*vs?I6{XTKA&90T5SEG*S9)dy28wk`I1CxoNMpv6I{dFu|kQ!jCAhJ(wDP*(iL_hf{WA3dS#?yEXo_4TD1qZ`C`J5GB`)Nn` zI?cyd$H&*v?*m_ZXzNV)dQg3VuiwnU*K*cexVqFo!?%^ZsG=PW;A#w9NG?mh0zJ1h za38R-bg(jP&&LYCcJTSUM-MlC_Z;Bo`g{FMFl@#)^ZyqZTKW%t)&3AHD-W#dt^kgw z$TsY!`0b~Wdw7>T!@Gvly^}6^hu5Z0OSOlaa?hOwdR!1Urg$-Hdn8^=W488nbT)9< z@^8rmNn}UqF++{tsk*`LgGx_{zYS zp!VLWk01|EYa2w*93Tgbp8ckNG|#5C4RY>tfb*VuHpb_pS!7d#Y@b2TC`BKs!Iq$N zH7R7q>=W4IkiBQ4yC_H50%OR{81BnnVg{;^6@s%Y_ROK*j@nRLy*9UxcMeK6Hf&G7 z)7*R0*K>AeO557UO)Gu;PGbpZ+;{x_B|2M$K01foR_Jl3q&u(BRFd+9#RW$<1U?aoZP0VTcYrJ;D$ULdd_{R47hxb^|}sy z$gwmrwf9G~EgQ>a`Zx=kE{lhoJ^;*}m3O@Ye`?a5EaIV}J+oIX?QfvnmE${OwRN%w-0R(y zcCYxkG!poK8Yj8!TgLOv7?wn%eMRJtWL>yhjeG{^V4Nqb_Iy)Q+urWw>`SAyoo_rb zs8~(TldxX~!MW^W4|flgVn0QP%a(H{iZ;r?-zacSFy^R%hd-C-jsm})a^&Gl=#xG| z@U!LUgG;&dBzqzDesC*O!hN62`ylw?@(sUk&y<+<)P?S48jG|SY ztm{F+5}Yx>vyy&WRwQ51cd(w7;7lbrQwh!pUl>!`VO^8-;V>@zV(l)ry$m>GIG@sd zGH&@NvQ@Qyi}y(W%OVrI@XTgpkSt|0jI#%N(J`AKlp{0;j}@cVmjuRSR|UptrFzu@5^;9{7^qaSfsj^g`y=J7o9Xl5R>``7O6 zz0s`PMR|ugu^;>1xW%jlW&=HC@J;q$ioG_PISOu#?2$vjb93~PzAA942ilcE=Mp?? zSf?Izm9?Xh;m|u=_M`Tq2hYf!vK2M21pDtf`fg<3xxg?43}bJOX{w=*5O9oQ<6sY5 z6g?SwY>RK(`CH}{;F9Lbn1=8y`z!fBuwMhmu)ntT(5q&2;$UqL*tHE0t!;z9wvr#T zSBKZOc4%z{vj*m8o^!iJ|5}g8Hm|dP^0#_^RD0Js_!4Cv%IO0Ra_64+|4sf2r}V#> z_xJNZqyNkm+3c|xb98d%_!Zvg^UYY5$KMQd7X8e%0qE>qko(WO!^QLE24`fbQ}A4~ zcws+XY z#C;;@qB=9}>6{?h7j|M zc5VX4UY}y7JihaC_bmf|T+SKY?bxis+!L(zUH-wz=^kPPW#fKn;pBAv=ga%mc82|C zWr3V~N&O*tm5hY09mq(Y-`>kDBX|U{1@92s@E1NG$lXU%@!bTz{NsZW_(O@uAK*9HT8}>* zgyw%j^2>+FHIDzS+~*JQ>h2}bt;*=SO>Q2q=tW-2Ku7E06=mcPnuZN!6ue?7bXT(3 zeCln%@58!2DS2Wy^y+ikqpV3Tt(@rd+mI8oG=#m2{hOSt(6lOOh-3=s9+D+opQcs9 z??uma_OA@O#9Cp8AKfQDFPfk>GL%(2qJcsA7I?jd@k8da6Tcapmx8vPvhMhc|0C-z zzSRhw7N2w&qt53EpjnHuJFezOVYAu}xF2SECv$ioy7o2pBPZuho3zLl*Admkh*5&mp z1G)g5bLm23W2i}V!J&RGO;A4$IHa?)QQFs@i9t`zWATcH&zk{oV4l`1@o{XPym#)n zj$BO|_xn0{1yS7)ElE?Q$^P7E| zzYm%pf#wHmEBm?Dx7*VE*_P%vk9OsI*qGYn*_U(A0Bhe!p7!=n*xJ0evi^!mf@a<; z-=Rz1@PD-)GBR`R>bgsq>jW?t2e*PKjrSLgW&E5q>hX6N1DO}38j0<4t?+;_oXWAlcVs5DPKk>H0cKXVMmb9!_-*_p6)kc>knI) z(zy@MPq-VMatw5^)EQ&_VYQ6Ap1eQSPiXnKpF4kqJz$uG#5UVONI*e|$t(DPHtCn&i)$@uHTqwJj*qsSxKVBs*T zO))j<*X}+1f-Z0{zyW#B!r?e@aDl^Q;6R*Ko|97zv)xaKRr z;MKW)!O;8j3%)=+Q{uBz=Vl&7P9JaP$u6I%b=zkt->h=FGp|`UUz-+>EkkeAcrOMH z`rZP*q{5-}e&$^T@4Op7+kO+Wezt_~9~7Tc*%)w&iQQMdisNNAvTtZDCMJYPoFSb^?Vi%uk197Nu@E9Cjx7UMG%jZ|)ocNs7A`$@Gm zl;euBi4b>Oz|S(+S8A|HYD`INl===KOK2YK(Y~$l=;TB47y9#fFT8s#y2lda{$L*Z z)?5?=^<(-xOrM*p++!EZXLy}E@JRV1zRz%U+o7$aTT4gbGgM9)#;sgbs(+Yud<~vI z`T}nb#+Gph{-gdv`QwV2|B#Gn@8KhUjWGuK@ErDSwiG))IM&Sb48FL@@Va{P;DKA% z7tEgHp>xcG*X_v&vX{YAt!+Z{ls>wVww2qwfp7HWAH{+^C01Vk{tLoyl@0oa4i7|6 za}NvgO{{xrZ~Y&ddtLUCc&KE_O2eA6_RvZEGG2}j?VkV+!Ud1MdiQAx1_{PvV>xr+ zkn-W+00;132o5dqj~I8FN+zcdasfWJsK)l?*$E|^XLDfSplfRG8q0FqCh{{dkQ^Ww z03$0Kdwj!#fyS%yLEot}z(MmCEHrOVmYyQnPp|LWU44IaEhZm!IHWB~A>!P?+cdk?V()ed>Q@j*yG^zIlHUO3!Y zVf)Z?>UnUJE<1GyZi0Wv!=GaLuKnC8mLHUz=6Rf)(1W|o>&F*6HcyK6d9&B#lUIMG zU;6m5>#<4Q4-8_o(Tu;jCC}g7!hW%FNzhuwD@GoRe^h&ju}pFpZ_MI$aa#>EP;DCW zDMo24!GF<^o%nH&FOHK7qq3E;G-*EtxR>8!yBHHsP2n-Lv!; z$U7d~y}LpZmn&YV(ZXGKjXXNTt)RUpA1SflO%D?{zV1S|V(nPBqH(la(GYSg9{ZqM zaX9SH(~eX78ySE-O5Nf>#$%1=TH2P-zCZOo%HTf8N^m!I3%mdsNPtJEnOuw%(PFH}@u}W8u5ksZiUwan%}w@I)}uT=>{{?3gz`OYaJm7hF_cc&9q? zudTCmD*riqYp-Od2LHXrNO|J?hiy#10G3tw)s;7I7xGuniM4y{;Zw`N8O42u=|^&s z^4ultxIDdrC;We@f*_SXV_H!ql@c!xuo0C!bC_^o!-MiKHu05in^1@O#%-Gisj zBn0i{!pyGYOfSw@F{-*(gZ7Jqwt{v7_{TPR?VWC&4j!q#|-S}6U~*& z@lR{~q63Pt-iOYdoa^D2^y^)JcHKbvWV8KU^1$hCjP5@hGf@A;@AW4eE78%MJxeB} z`l^T@Pm)JT{|!0+qR9Ne-Rd;W6yC2`-QN?QA$g!({Rpp9;O9)nyNb`9#BtoYRXNCJ z*uAJRsN724Wsf^A8hlrZQAvLKskg-EGQ{!Ce&VLq-=xR1u3OXj%({~cy6ds&T#t<1 z!8oFyffpkG*G9tWSS`G67rH!o-9mouub?0Dtj+z9Pj58#)!eC}@z*n-TJp>$LyCX% z=97UA6q-+r9MD5^;$9uq$!%vV`zbMcL2Jwq?*&{sbJ}qVz$I~FaJ$N@4b`ci(9pMw zHo!5PN9re&R#ohur2A1leESK%n~?{m@_s+-vfa|%sdIafkG1}ig_0A7?Svy^LWlK0 z)j!6bi>+A2TFta;r8`Dq#8sZ}EQRU2$d(lLIBEh$T`J?ixp!EoNA=(-(sS5Db}tHtW3}up+KYj2m41A4bj(fGZZYqRohgLDN+D+6i>WT$xj}q|?v& zp0atQ&AtDIPZ^*5qATiGZ_wOz&rSt*P$kEDIK+3mo@6{>T^~!Q z$k%M5#D+=s8*l!oi1yTfkPFwY5%u*<{jl#Y%5Pt72kq7&-)XGVC|7Ex)s07fwtjnm zUcvkVSnZ=t>8c%kN3q#QPn#Fs+l$HrpM?(Qj_c>(j|)tcGx8w6HP+xB5OR@QIZbi$ zzI@Q8c+dp>+4c2xk8LJ;HTA$V)&d)83Yk-Sll%!P8{0+sYM|0=No`?JAA|`MIKyzOFQdS*UU5Fwq%93e=$ljytU0% zy2LKyV>Zm|1Z~d#%yk2yUfP^kWqnQMTHg)$C~SWVnj+SI8);j|T-HHdB7l3;Q^2g9z_#Mn;2=4m}!(Dj#oYo7N z3--v!i&EIkvuh)*UVqSa;I6sN2IhisF5Fe->~Nn7UVA#b;BJ6t7xY(qQT>Sy@yyEq z`Ol6o{*HG~obS^MVr7%`E4&Y69xLm7&69Q1escgTc#?zMljQy((;RM!*Dh!^vpH8g zmY7=X28VB2{Gxf+T|e({KHq)4DN4JPdShr7ca%DP zJ!M^+GG!f`zP`R;6LLb@ySvo%Z6vR%WSFNz)AtD1G!Dsz+7m7@*rs?@h2fmhUCg;O zY>vIV<>46`=Tu2cGb9)J$s&g+I04ef!ZJJ--{=X6HO{RYeNj_j!N6jT)@){@#kx#lg9y zpBb-S^YKS_+;MVn$1{F8;VtkR((3~KA^8`cT#)}hcC|;#HHQ72wj2z;x^*IS7W6Woci#6*r=08b;X>2(9#vL=XgBP| zo%|5lBwNqE#~xu=YKSm2-!4 z@kenF9&PwI(;4=oaHnh$5!Sns}DfqybkLAK>0e7%%22S^!7_4ptPJ&V9 zoxyFo_iG1ry!!a=_^rMMy2l|OK}$M_;qz^^-h3A}nHQ=m;J#Nj0}t_f@fL@D8~Zl< z_G0#}e0P`L(0U_2;TwOqV8dK&X$PLUskIV3c2i4WKav|p_c>2KvdJ||`b&`q4L)k< zdfz>)%~5EJ_4^6$$(1a5F~)nd4Tn*Vm)Qs)_aXZWrFuduj7A}#;cFlr*kvw z=pdJC%~|`{ikkj1=y)mijB;R7w#@szTX@EJB##|MCe(P;-i-P&jtI^q3Bew)@Gm1FduO?|Hcjw(=~YXRLAaRARY&SZFL7 zLjZrpjqAVmQieSi^X2WH+HjLg?wagOo~Lu3Z}pygxV50kNd>yxCpMUW8{C$mp5iz& zRpfzS&7>b+B>Vt=K~85&vt?`5SilL%4jIx3dpbQ_^1#PftI4 z+Xby(Ut|VkqssP%nnKFc>l$b)>+JK%p7-oJdvfY&<{Qkd|L21?-^Cf{*EqcHBj&d- znBOPt{EiUsb58R+yt+HEPiTIhAqMBEss8--jcNV*LgrV={J^geem#>KIlngM7mWW` z{9XkP#lttWdUVlS2M)rs4#j<4tix@KwRX;)U%p4a`p~St8#rH>8aL~->!340DddkS zb{#xfYk+Z{gx_;62Y%zpBQC!K+CFb`ar(;el=OdJd_n7{ITPp#7xUI<2Do{yd+$|n ztB3vfUFN2}8DBfR2KYOf+pNAy^zkb8LM^zr^yDXOF8&LUk95C)173)~9pL<5KAvs% z?-wYs>)_4ByIidLQRQ79JnddK-J*)qc-g ztDmzj$}vHV>(nbJPDwv?iy2tV{I8|%XKD91zvoRXPFJ&sr58Ly*?P(nYfj%DE%f43 ztUSBXrAz~Np$)yW_o8|4?&aN;#q?2W2JYjxeEnO;_rEOr@9a0fvVOAZ+`EAs`?B>( z&YfL!TeozK-=4VaoXmYTVEW5e0LXcU-#a9-H(Ju{b>Kh+ulk-CpPc?L|+0K z<}TtY^Pe~CIlB2bP4S5G8DdcHBE~4ce3bGJvVO8TW{LHPvPO#Udz+Y#pN5oAhg|si zaelPbOPpV`AM-&@mZsWS;k2_LoW5q+?0(7bNn-uKO#LKd%#KGcrQODm^P?rqp_4d{ z%9HnXca1aK%J?pahjm>TN-ww;c^26=MEltbR_u_CA<6x|E_lv-2W%`9?If{7mN7rI zm1K{rt;Q*Z+v*~=uVKuJ9Ua&vH;#7KCsxhtFZcD4!2j}1`d5rWt#RXIBM}^j>ix|M{$@(2ykIv(R+cN`$+Y%R=fqwwk zr7x)c7`g7X_Hkrz**zL~SBBoT795i-E;;L4=r~#FF7(yRy_ya0)xTV5US055<;W?g z{yOT{5?@|V{WNyL?5_vyShxI|`oFG!xzKpmBFFw|f%-S8K6iy^u3MNx!@z0k1FKgH z)UN~H@qhE`hmb$AzdB8Q);U3a!6os|VD%pdzx#L&-0J!NW!B;we9uNNEeFSS=SMB} zPpxYaOILjt(WLi?Faf_ zo&#-)K%1U3k+f)447#)&nj|{KT_kN!bMKw#m8DhCB=H2%sJnA$(|l-?%l>_pwg0A> zJVb-^+`#8vwX|vEa~J#mtKd?8J1Q^QBs*9xZTbzg>E%4yRBVbL-%LDO27iHQQwrKN zig>i;BWTl{{!Ydm|A5)vP5n;BDBHdGQk1c3k0qf^!p96WN4O~3)XW|m#U9%Uymv9C zF4n4(d8l3s^@F;iYiFw43$4W_JJ88oRX59BbV1!XIg8FzH_V>v0#`1Fp5)W5Ezp%^ z+gZrX3Lbdi`YzkJe`cWn9bIqh#DchC!zRUJDX{^z#;ZD>P2UDBKaJ5qp`37_u8 z(LV&6#9MmT1)3+A4=8H69<_wjBQ0wd#uguhWib%`hE$)zYEel>0m0UCg^V zJ{@{K`r0P#3(*tZZCdEvZfNYkoaUWqlyoFZhd!kI46n4-liyCZz;@zpHYxT7nj<^3 z8#aq%6a3ixPj%0VOt&_2`946>49%V9s>9yLvq@e!8b z*C-C-Bf7BvWfwX(1v+?+yS@_Iw&AVC>z9OyBN;>7Yg?#oJ91bebnAQu> zcdTRZE&+X!Je2~kio<3gge)eRO#ZJ%=$^r!g^%pXk9)b<{g>5%*7p&CwRhMfe|?5J^7_y^OGzc4CiN%N~0K z`k+2~J^;PtJ2b(Q_d=A}438^=ZmSJPu}hbr!($_v@=xK`EH?b zlDa5+M0ldJL|=fO)Dwg9=k!xgEYLsj?soV_CgkBkC-c6YJBB7>OS=uZ{vjXVT<#VM za78xM+d02889n7`%G^(xVErVg4ULoE5olWtw2g7swLmKkw6g|USjzto^IzkOf!6_z z8|k0jJ!Ds%%(`AhUw8WB(U^m0pXOQ6XC*SmUGx{C-<|Z)$$5d?K5yp#_j1Z_;r}Rq zj4H451-a$Fjok6qIpsrn|Hqv}d}&Gqt-8c~|%z=YJtM^}aD!-A5aui@EJ^-=1x! z2YRb^p6mD8A*)oucD5dbwjUbYrn7(IvFbCM0iO%)L7vAbXU7Gef6)IOgMQESe@A<% zdth+e3;ZAL^MM25$R3XmMEZ9B>tOZ2qc@M?-NnH4V0hG?*P=hzgg({x!vDjVsaNRT zGGtugWTAJvnOmB7TUe{7_&&b)dqZ(lipwlh3@$RPWaH(bNLoBu=hU8uc1|{CK(g{W z=;l+zM(#vL>_8_B&Z9g+yo=7FNLE~6s$SH26xoiKetu4WiaZV>asj2t_mhH_HjnFn zS^B$p2W_RLw>!wkkFpP>vx{e3h2H)=Wxo&Ye=SEYmdDca4`RQ3c2`s z@GAd#2Rvdjv?9uUbtdmY=9+&dZ>pL4_#ksdmZ{dgnJ18k9p<3v@F)& z!dT&8x2J@1gz% z#;Cb2KZi4j&FHSd+G@Tj@-1n7L*_6%)V!|st@(V+uBoNZHlFrXOOpdVzXuvF8-R3m z*#VOL*FD<7`z?9zWBgaFW?%;>WAEhJ0mLJ8t~ID%BY8Nd{Ve=T_eW>b;nrSwpLkt1 zP2SH-+=1J89>gC=z7jpq|DGqp)_>6RL{;l!InQ(3(A9i=m*TPI$FsUD;|AUXT6?W^5}F;Xbqnht zyx|N&LA=?5KI8nZeuwbHK@R3_ylvp>fartT77r3WdiH~oHu(x9Cx0J&5A^@j*$?vP zBm04D6SJxRD)o_l_H6d;2XXBC8fW+@`umakmkZ(eE@;#B1?o%QccA^MzYF_83-*J8 z^|2plee?U5Y~FI%t6zI~a9jNFY3hSdAEUnDl0pW*)c@UaNPNc(T+RO-tixaOUC2fd z*bf5PJeOX}esB@>3cZtT{(Gl+Cwae#cf!a2Fg?Z(5$xGB(qrgHEyW$yE!J5%(I(j@M2kCoTAXE^$w_AWaq4CnTPL;!`9FvBU}$l! zt~$rxx1-s&;;+55-wPgO8Nceaho*ZQ1WTL7ww5J=C@PGZj#^5F6fqUJVrZfq4~nwMFrX_ zWH-rgs}@=;y1g7(r59a8KB0h)%0?U5MgqIZB?V;Sz;06LU0^pU^e)$KQngU$cy|y> z)wx%8ldoelS%91>yRH08xv^C8FD-@6Y>t@!LmV9b4V`T>ZLgH|zfAmNlVs>oFJXK5 zD^GsL|1l&#Zwzd#cY{yw-q*d+_y357rJ!LBz8|*;8|)WM^+&PQOgp}KeR25K7w2O? z`E;pSTs(Q>rk`>K`&#<=UgfRbNyd?CGi|aJM~G>buGfGqLi*6=-SNJTKR_Nl&AaFo zyaOK!)k|H)JJz_+yG#Y|=r=aYY)?RE)qcwd(N#5X#;{ZR=1s`mjNu@1=p4SE$1ZS) zoRC_7(b=m1fqaDSx086Wd+zkck)^!_lqZLp^;4<6Ec7>Mvt^Oj=JQpB+w7^7{lhtm z{i=HD9q7aGlv;Ea!4sLfdh0ub+p%{XTi$4z?!k^c%ZKZ%$Y0-1b9T7q<31aXrt89V|1iZv;+*A2i3bzY@s(mDmAmvGs9|q1yqrmE%o% zc?mIJ$fv+~{hh#2cpXm25+<&2fj5>Ux>^-&BA;7)Rhz=spv|o7wfWp1@T@?aJs&aE^Uc(w z9q4~+D?NN&LVQC4oDw{Bzja~z*N=wmUjaNsheXRq^TEF8@q|w>PV9NIaVQ30zL|M6 zOWVO%4(7~nEBsBc*Iho@tj=06CrcZUfqDmr_F(59dV6rx?81Anl5uDcCi(7e9QL91 zJTcnWwHCH2X5t>;CLHbfZ{Gfh!b{>jYXFwo7sB}rcA#9G&(1T|U!~tdINwEoYA=N@ z5Q8T*eE!=0Pts2qdQ{IoP0eK9z-APmA>HL;9(-zn4>4cBXR3uyIsa=}|L4g6E1oQU zE`U$NJRgsI_-M^z=v~2@$Jy_K_qyLJyyjidCfg6+BjAIL)<`$RHv16c7ENi`&-oVm zpYJ$*W%`Z2OI&MRCpIA27UBDKb^OlVt3|&Ute!&s0B_6w+4Gmn-n!pJ>RSE@_)s^( zhd95w5A%Nqwx*z;p8xChqjwGbRzIca?;qy(yOa|=AIRDjd*tQ$4 z`*C)#`sSQ*bp3ebIO6=z9mkLN5MQ3t{ubg z`+l3lZ|qA=M^+^J1Gtgn*4kiYud8HD#CL4IM`BN&0>=}yDfwAAeSkI!(T-Z^ws`q` zV&rq>i03y^Hjo`! z|K7{{ll}X_?dv+QJtK>TcrUy1euI6S@ra&u{3~bBeh6LQeeQmFtdo2qetVX-zwWp9 zI-IZ_4TK`o9~jRv$;0qu>(svyAmu+sd_~=Ng~dyPo#c##d=W&qddAXxukyX@J}VEz}B zy}AdhpYz+v=NWbM8Do#w_1-;bX<`d|B3Soao*4f5VD-oSdF7AiTlnPS*jzN8QTRnQ zo=$9dg~qe%9|xo}#$5$X zc+~GNf82HO;@JQ8#(nTR-nd)7Q+V8A;B?^IgWE2}FL%$6y>Z9bLxsk@>m~4tb-B}r zSN{0Z*rT&MeSgGGZ~RIA7aTwE+WPl{+mvHf@%I0u{RVD)mbRDjJ&A7>S{H2fwv$v8{vEA5eMLrKM}I znzLS03(axsx4m-NG=3sKhCQ2J$ZvPx)svoGO?I<6<*(xJ=3MIc2dh6syVCdM<9MX} zHS6Pe?7M^2|4JXh^NaoG%dlr|;kk6VL*dbT9xeaDCdHgBgXh0V`}xl={ncRgKu-HX zJBP6)jA8xr%P+$QvGgwow@L2G@B4aiIsDS#wl>~Lhmc+-{p|2Jh!0{+2g2NY6efO| zGdnt4iS9z2zA4UsKHGmTd!KhsIc)PTonRexKJB&(&DEK~Z|tp#xUXjhcfOUG+3{9A zbnG$w8~vO^GLu(TWQe)PR<_7Y{%A!8*;Y2ZDs)xF9W5p9NcOub?09cL%a>!r`#Ltf zTJ)DW`0jIUZ}r&lQnWhdMW;>Gu16;9?@~sWsdoE8_rUbrLFBtFyqCRhEAq*H z6Rr!&*V=fcaGm0hWRD*j&%ck1S5i!2FdoH2eS!bqrF`f#=aynqymL!BJCq$4vARNb z+=A8zsH1r&{MfR%Z-A-$lLqBR`06Sdo#n@u~wzMW{ZMUbY9FswRl07cE`ig$R z?T=~ea|P^fFHlxK@nyWbg#9U+{6=)QrODSbrXQZ>-3tSQ)jv7SyGxPpGQ5*5PG@*! zcf)=*ltZb6-?Go?{K{{kwTflZxe>)M=?=&5Ll4U=jfIA=*LtyWNJk6yTr)I7xf_Z@ z=Bh-Qw-5JGCyULagYT%$`~J7no#z|YyA6BQyf^0RjkDdW*_%(=ea-n{^FedvbjB9t zW6$)wQdQAG&Y;8x?HQFnN}zuyK0@7zZ(fz8KgHX989jSmhj;#4G(q^a@z>Z{pb^0s zb%wOLl6(z36Mx8#9_A18;SYy_=_@{eXufoqKQz;a3xD7ar1cK`fxHLlp0T%ePlZRw zkAAzE+ExL7=z%|o?jC?nZuae3OLkZFrO*$A^ZC!+D9^#&rDp1g@+QV}XlGD9g+Ds* zvn$8tm*ES_aru(v3tg5k1aYScY+~}W%O)x#3uVkLzixcanftB6 z_7L!eyZ&GH-UU4F>b&zmGb7vL5-yf}ccU4}3E*_M{|z=El4m`V94@7si|r;Y>A#+l zOfWbJ0dotcXe66UP`9a&bXW+n_oBTQO6eY5e`c%~c&lUP z&~|*;%_g$1nS2{b&L`IC94GRw;e28=&K@BK?uXdP62@?jQ)lgi^LKgdgUT1)2ko%= z{6ptB4QrtHLoL{Bl(Ua_Ex(r@Yq>o>R>0O+IOB3+N^ANXT>q3qqXWBm2HQ6>l0CO8 zoGvd%4idW$*vo_VJurN1t8!}Sz1`=0H;$hwzR~u_ouv-;QgCJr`&h7d{Fs1e_mZ1O z`Gd7CG4`_BIWkh+_t_!SeV8?BgO0Q%P4}=pw`h8lpQTrOjWglOOOW6^c>dlQ(4pG? zl={Q@p4b}g?O4C98)t1fi?4S<9s}+5<@VfoOt8rjtM{)Vt7^}6;FE3zcZoY2sptCv z_;9PWgAgl+zTAc#WC%XoZitoRw`lZ#mwYZh30@_CaQQ_)a=#@vX)U#;{Q86 z`5}IX%cuG6;kTQrb+4kg%f6F@zSOa|Be8%t$Mc+f!xso|2_bH@^KOC%H)AcZEhsaQglf2#?X%@c3li@`3dvB99S;` z%i9@8oGjpNB9&-U1G0eVQYUb7Kc3k2l3TxWSnHfTa57kmwGf?(0xR|7KpxBDRNH*Yyl?`;qo8$tRy_E@GM|Q|VTO}7n*kii)M7Edb zXa7GJ9g9^he&&4gf5AtaLVA|vqr^eR*{6zAUmK)qqSbzS#@k6%OoJ64>h+ z&W?4hL7(!r?;-qzHf{zU*-PIG=bsp(mLSHg&BeR*;&T+dmJ2Jx>wIqj&oIUmyjrqm z7T@nI)-uTH!CleBn@VTOTK-s~@rNZJ#WO4RM9E3Q9?kIneXQ$N`gI}eCS7uVj+|P| zoAgKJT)z5e$p)N*ucCQq*+JLsc$)<(*$xhFXmtNOrLM=sLe1}#gx8pwO%l?MDi%D5zx=J|{xlV<a0b>>i$l z4$im}%xj9Vcg(~$^G>r{T39J3v10C z*~UD4Q!Z*w*E;2qSF)6OX6Ew!o$zv-?+m^xS!9~!&(r$93~l%_c^I?sU*CQ&?W^9G zsB;YdFPTOBTDb+ne0>f1UIZ&cUEhw%s+`K7svV7+n7t*6$M<6mawC|Y7-Q_E53P(X z?%EzEuUpji+vR9q#N5&L5PKp#?>Ewat!e%pW{Jl`>4REV(WWMNYufU8&Lv^DZaHx8 z6E8Y`GZmjK#JzqVoMC^jgIDDL_#a|J_dY>RHrr14c}t=4^Nsn^bAN^_;rM*+>>#cZ zx!ImkiqqeA@HvXSDq4hW2fv@!zm)S0iSvk?3i;1|N*^kXqp3a^gJN;kgn0c`z)XWH z(*5J|0}4KRT3o-&+HZsBi-u~SMxLM8_1JW1D)=oqtM~i(3mgq>!slXXs*Bw`fu=&c z)DGu9SM@^o6TmY67{qUWV~YOAXk);QLB7muLNdk~#4{wY>swwvi2WGYy@S{V7(;p6 zEzp2JaqCnLr;C1dpo3fb{bm3s!tY9OVuu4>Exam+W95|RTz~$D>kq!jN^qV=4!z6u z$NGiNG>3Hm{3@RL-|`n`nQP_ADL!Kyt3zda|2~N2{4~#m8)2NdglCoFI%V^fKSB21 zayjJ@Xy$PHX6t!^U&oR&Ab!jlDomp#-o8;B7NS=6CKz@ z?cV3p@693b{^_$bkISYK@Lk=t64)wpv=z2hDt=tDRU8~#PYn46aBsu=xVw}#E=6wL zf^1>pKiVq(YKXbH6do)-E8Z(!n{)B0MP3_gn#618R$p?_CGUYpy~peZ&u7*Ti$}_3{Dz^f2_mMbrkR6*?`VDaCWPKGMR9^?^vv`f~YyGh7@LIn>#}pnd zS_m#N9`P!jbCONRpNOi%IevIhT3OB`M&LCO=)7P)jgMG$bxyDn>;~+~I=55~L;R{2 zo-7#fW(y<1?@BOY(B&Vxbts2p`4v7D!5Kc}_!WGq5*+%v>K+Hj^CHH&O6M#5Z{;+Q zt?|Exo~6-y1DqfeTLN<3+=ll3dT6TkZXDe8$| z_3%!#OM12ESK?3NSK<%iSK?D)9b5cLbW!|DdUla#IbB;k%j(jOXDPOpGX>nU{?Yxt z(?9a)EOcsgYpY8urnVPdx(#>_J9?8~AB!#((8)br>g0Rd8JWk$Lrc11kpD4D-7wGc zx?(hDuFpV=ybhEHPo*oyh2PW>Kl>6g+#S#*>5Nyy*WQ;~(7yrRW#T{FdWYj_o<60B zUyi3=7;|`VCHmtAc;yDpNabj^*e|Cm#<|x$(4WLJ=Jku08RlN! zH_;#IOHt^#*AF+McZtVIZ&EqW%Ti~RbSCjF>5Dl&nW>7FLGWj32<# zNAOxcwq4VcCjXjrXs!SI(6`55sP2>0y8Xrcd_Gkss^@U`WId!P6W-?_uX+KnsmSLt+B*tf7_k4)yT^ZGCR{)zge zbYtoQ%Jg_phA4hT(|6ris(h{%GL5 zhx$_Be0HUMC;obgTTjm`#b3|jng89v8R``CSk7PPg~}8T1i683vHW$iJ}6(yFT-Dt zQ*SE%dIoJ*dKc!ed(6~%eP!>|UW!0hz-b%rA^mX}{c$*?KYD(=-06?Q@Z}u)ST^wE z4aVZNWd5miN6&{p1|KfKhvf^t7(cLdNAcl;pn5B}fwmaM8JjZJ#mv~(=Jez#qW=e2l(C zxHIj-TuuLa=YyBdsXINylMS?{QL+QJyGgp_@QJ$QQN~tDmkj!NGF?)3)gT_g^7YG0 zd_7*KM;>nwPcP|_S@?No?C8b%6kpH6*K^=y#PSz(-U|KndSrqA3je$wxgEYBJyLq3 z*Cn|xeS8zTqI90hF{}RXtzTAL=*TH94kDTT7 zNSzhk?eIuvX1rfyo|$+5GTHahBeTe9jm|IP;|b!(jyzp z9P4i?=X2%rP|oM1N8%H;eC~kbb1#q~r1@mOKIXqc~M*`v}kr{ZfV-g}$qT=dIJ z%-o_)bQS!KJpcXIu(#)86YYSn#h~4rysuWa74*vlpKI9L+S7a3^E=MWJU+L`*K{Y5 zi{BK_fc_a5ZzBEDEDYkhlIRj?Y;lR(10P`q-(p6z__Uv2#M!qM8Tv`=$Knp?g!p#^ zyJbqYOy~E@@m~B0S$;_dew5>W;E1K!HT|O%?3AL}t+W@RPs70VG+TbIlhJH1lZ&t9 zCfP$Px1(4awWIdJ_E2Nz;$%Eba(dv)l+IFshiNV2imxlvO~X7)bEf(7I_aa1-o>y_ z`E@HezR=63UpMg?>6bC=R;Mc0aENl)r+m2q2d{%q&u0`v9JW{f!10+|EAScVp|V$c zKGWm$Q1Kb*p<1IR^w3&t3lYZAsqEE$tNb*o*Yz%KGUc9AcFuRny=YTUAm zG$NZxE|Xp4hs=q=*6-~iS$t5>JG+QvG|6YrzjJn1;1{0L|Iy25cl`i4O?WZS$x@fP z_5ELIH;6=XGs6>0k#lC2Y%n$b8}VxgcxQTa zelCV@GQ+3G;e)Q9QTC+aAAD0hS+|d2OE(6-#W*>26|dCm?7GRbN_JgnbW!i@bavge zwd>aO-%h^SbQwQ>!P4_!59!>2c=IOK!t0<{ox;W&Zf_WysBlkmg!IN*Y?Hzz;Z6Y^ z)Z6gFPrUK&{0=O=a=?3j-^-h6k6H_I=XcKKl%z)`FBIUTed zw$BkG`9^wZ7>@GPbT~V2i?j1aoSnBE&PME@KXB_+4o7(srqV;p;j~oHLy>Dv&_mH3 z#{ZJ`yl&crowr;M)%>h;>lv20rqV;#V&|1jwvs+6zvNVUsPfb(#=TNKo#U?J9e9hK zcejn7I!cUUVAG9S9_;UniPk1}-%>@a>pZix7M_Q%ZBTr=hx=G{zT-jmzRq{l8Z+L^ z`Hp7jz(-w<7MmllPNY5a5m-byW7Uc3K?}5!7*;*guif$#3 zcMCd3J$!%|&ynr$m!{d7$0a)?<^?v$3^vFP#SIX5C0O-luFa%f0=Nw6WhG-P3`9AY@45N zHI0+}vqgLPH|<&b)yRn*oN+0}a4b2~J0<0}C?oy}H^?HN4#Vp+L*p2f<_bwN-4`N<+Yo^AX| z89bid?cfz$yo_Rx#P2+x+v48)-?Fc1Jo@eHXg*c%T;3UQ*v992KPLI;<;N87iGst5 z+gYu+9sD*O(aaNqbMsKZ>$LW12VZ%GW9&8ZnvZOfeH<8uSe%0HKdJ!lX>6+6O9R{+ z_Yiuf_C^P~_N09UZ&kk3R_;o!*Jt^@f){kWdGF)eN0FD%F{z(Hk9t3SQohT%e2V8* z(Jy%J$iwg;!P`SVgx=wMpQr>ghM#SAS-ody$JT>y^&YESuLZjO&t>%vU^7*{?L(Yf zCbp_ld*XG{+b!>@GKUWSI5=nJe_uyjb%y!z{v7|jn&*2$^*%@Zw8s7mc$8mnt&TQ|zPq5`XGA1%Ddw{Amha*9outH^`svgNCn5 zqaVVb?)%@&pVnFa)cmi@pVDV0cZ)~CpNeCHKi&8Ld;Y{dDwX(26rMBiR{0aM&1zy4 zufX4WDn7N*@hS0>ju$72yed(~t0L%K+GA1lu1a*i8Qzm{yoxhGyHbujg8zNpKLz~jF`j9h{&_Xel}F$I{+#$6 z{Od>=|JpMJ|GI)$AL&Vzc+^_Pq?|F8-rWcP+BQW!@vlMGeii!D8txm@Ie%~8Jc6#J zI2zptB%Mn-mEt~iH@S2y=~iLcw$@0u8knS8WzZG8Y}@8^E1i{0#Jp}58|k>deoW<_ zKt7rm;$6Fup`}~JL%LOb3f*e9)2;SkGkwO}OQC;~gR`8!mu^-5JnnR>^5GT}<{GRMKyB20*$^Shre& zZgp|H*_(5EhxDpD(5sS8uiA+oDZNU4=s~Yj+sfTgu3ODALEi5qv_)+zcS9xJYG+8d znxs$Jc-Oxx<}DK*6+-${C*Rx3^r=_Tr~aGU_o?b+A9u3ujow+c_nFXG($!`>7hC;P`TTc($WVk9rT!WOEUn@#S=PVMAHDucAlY@5)I=R_uw_ zmqb%k-~ZlK_FKBse4gdN&q{iebp8~&lfRc`lHNofY1s(X=JgJ)^roj-v#Io^a(H3A z=|QJAkw1CTo+-Qyy$L?HD^GpV-Ve|xa`qvaZY&$l+h_mVaD)~^oy`9szSD}0L3)zz1BdtAH;MP0Lu?JaC(JLR@Sou_ez6W7@@I}d zc)rrfv$nEwBk+|6%F0D4H(X}NTSvM3TsiRq@e|K)9&*q9Z!b6d-{L>AYn{MAcFdy=I(OTjH zwKwbGN0BM`k@O<@aKiO}S-r^fC9fClC0C}U4cPV4Q`z;M!MCR1Pp8t0zB>hfI+b4ZgI_U!`n6v4YrW|0>P4C8oUZsp zWH0Bvtxx9vX1!>UiFQ>To3@wpv34xK){B0v7kPh@=Rd#Ji~jZPalh7!PUJhk){CaL z$4M{BMdzFW-?^_6-}%2$FM{`+0q?o5$a{XR7ukD~i*~tR>qW&_rm(-r^QB+wMX~S6 zU-a$xkGIk&lDtob@Dsk+;{^nv%chcb&an_g;8=eb`@Ah_*Z`TYVkz zHu4u4%FQA^bWX@$q}cBP{6!|@FEaRxqQv3FiN{MCQ;fx%gL-w0oq^&9EzkM|qR zc77wy1Mm8R^BWD!4eWPA&Tm8vM4+QPUypJoD1K-;F-^o~jqJhKqc{b{9W~9V>^JhT z63!ObTo?F_%3*a96VY*Q;5X8lpA2Vyu_E>jzmS@a#vw(m0Q$Hf$cG%C;Nq&X4f0^v(86n@hKQG|zY*ES$zdE_xI?6rb>_fhs?r&== zD>s5I&-;y9ZJb_oME5)oJO7f8`}-v2yx&Okwg}kX&hnIN$N!f7?cJgGy5rdT4V*uy z!^e$JVUJV(gGkK9(Q$^$`-5)waPT#%5BIv?vd;}W|Ih*Imd7iU+vQqZyn^EDzTo^r z>7NAtA&<}AKSWG|ja4`SpYi`kT&zL?|4^3t@{wF+$33TC=hJ7?ZH zUJU$07yzP&Z%eX;g8?0;!z|0}N-!#^ayp0}&*E%Ogu zDZh{N5BW0HJbOA+=X1nAXxxg=s}w``2)-a>rYYkLelmrv?R;YI73VNje8P5M{;K#% z?k)0@r1;4h$=z>>pWp*}JNzU&1wV<4Z&ctX*(vx*9DmYV2ur+a;C~Z8Nxpr4viq0eC&_;;eu6KDxa{4I zr<~xwX@*}kl<}3XLi2qbg69`|c($XAU%ZEBUt#Zs{XxwOzzA>BZ46;^;y?KeRuesys=vIiJ)^p9i?_Z6|em>09r)fi6_f zS;p1$J;I!7-$aRVsOPgBXPY_etaE)y&fWAfh6s1}B#AN05?j_w-*qM0H8}R8^pZi0%p> z{s4UU^!O#dm($}vRb8@-5-D_ToC$Q;7*5Zn1)j(!W=9Km1!bZlIB5Yvcq_# z97vUD`dZqQOi_t$-$(n35vlkNx{V#W;ycAN$9bprMb{VA1aw__50tOrNSS>qOxJ7J zGwX?GPP1;eI(r0p?oNnjPC^fr+ec?bHxkdRygrKa6lx_! zDD;Ybv6(aDR*oy><_Y$yadEY}4@7tz(DhlxoH_=3hOevrm4>b>cSHub${(Rz5y^Lq zJuwfuz8<>1K02>IiY@H3r>}T)6FA=xi+(%7nbR89&yq2SuXEDFLZsL%R4~cfSuZ-^=6)> z>jg*G_i*0F<8f!m#uY_p5uV4P>pCkQIX9r|;k*L_I7t{lC!>zb-A#aC&abQhSdWgnWKYs5MiuEmj-a1zK z`F41K%6mHR;S9k8^jx&Q0eL~RemOixa{F3$j-?XK507V<7~LR;z`TBP2JD&_$|1nn z*q!yvi{yp0qx;+4S(XOoC5#8~13ND%XpeFTM1DH4D?@%DosrkPC?B`z?jriB_~8TY zJj+4ot?+BRqrd48{SCw40sUSD3{Ss3952VOb>~{@9Umx=-@Fq3w?R|?u>u_LuQ*5? zp6w61hh1lWSAx?(j`8Kd@%%tJ1QvvTC(uhO7p9e7Cun; zEyHJKaQQT|^Fq-dXi55&4f|(NKanxd&E`}0k{xY{bdz(WTlr$zrkm&D=MZ~IJ{-wC zS3-lT{xsQFAkXY3?w^-zvzBK@auu|>6`HAh;pWU(7cukW(MWJ_l=`sE)QnsQj;meK z3c*(UYFq89o&2$hr7BlFfi0Kz3%^B+>7He{jo z5%MW;hs7%e#@7^!aCej0_da9p5A>4-#awhcHxd%(YB!hR|4M{a3&uZw%-YGQ}8;FBa}x_d}$4G?A_JPyT8nR zXN$1Kf91~Pmdu&cy9_oX)^442l6-91V%@!~{ziGf@yuvfn|&W!mxtDalOL%A9_Jt^ zJImVREiK1?lfG+pb?aTRYV5>ImoYA@m$JroY~V}kxVb>j+M}k?L^r{!Gu(k=x`;on zj^0^TkN%Obu>0YeA0BU;O+KSz&30cr0=>+j`()4hu-g~p60DAOwazx5-(&Z|b)kK*mpP!Z%@=VO;ZgQOp8u5F5Bbo3pdHR>2K(V+_Ctg^ z3Ghhvq^R|enV#3du~z1zm+?0PPh-$rq`3!A-!)e{r}Fq&=ZxP*ZsjK!!~bdg&x5~_ z6`8@vitKCjv37LjlYPp?a*VO?+ueT|+;JtmzLc>l=e7ZdEsfm@D!vjJNZD zV20UgX*B!dO>8Z%LvxPCrU6emJd|^jHHSyf2mTAunvttxrhESbTedbm9qk@_8e0fC zA`;LQ%~`?TQB%r+2~LvFOgX+5_S5c)3z0EZPI!-guvq(~oo8F1`RdnMZoi~~mw%u7 z9O-%?8W~AbW|;gNb=+Y-#OEC*y7&$9W4H6JPdH2;TceSE2WV@U^KGgJ?^~?4<}WlW zxBg;csml0%`ggqFynwlZ{w*Hj{%N%ft^am!tc;cy^L*^JxUc%_-)Ofuqd5_5&57)5 z+V39zL4K zqx)o=(0aF;=sv-aE|`p&o$^lycMt{sM{|5)Y3ll0FR43hZtTV8n-eVP*f|dVB47k_ zv6TCjBHiiwr8b||nwd)*%jctj+}Zw>>EKsp@F-&)I!|_oU_A$*5nfIYXxQJ``BLAs zUTTAX!FKs{1G%Nf&EpaFo%X^Ee>zxYHV?v=M_wEy z_g7}q)?s9pp$6FvBha9L*4F}S75V#KC+FA_#<`yQ!W-SykoNt?Zeshrp_zL?0$IZK zwtfST-n?6CCC74|rmrt4qcb{wR*b z=Xe^RFDBj;;LL{toFQlGk_*XMX7Ow|(mlT_vm&qlLkm*iN!=oIW7RoV-_a|6{LbVh zbs2uoz4DH%<#jdvO_6}#i*6Cev2$CjW(4_Zm96{7=EfW{TV{0iB?m+|ZvTy$%N)G? zjBWEx#4I`8Q&}z3FNgV>Z2>4`{lUlUKX3aE`1z5B*2rRT;OE`Kc5@H=hX+z zjZKu5ey+7XicS};f@ah1L#D>=hvDf>W61K|+JB;ZZEH7-4MUp+M|YHI&+Bfx;CFJo zZtW$PY{K?cK;wBHE1s`8g7$UtOnf0`W!qW($y)AZg(j%YFYamV5{x))$9I^< zOf1=$;@+DrGtAcp&|98oPQv#An0J)+$@sb!aA5L%01dRU%*3o5n}T;AfQN4~<|^P1 z-UI)h9)EUgyO}=HifkcXF8TXP^tfT<0_u$%l#UCJSbuN>v{U(k16fvlBW~bLtlctW zUTLCE+VSs8Ch_mNMgA?CI>gvJ_;0rGOizaI1#B-GbDr;_Ra=+~*@PwAdOIxnxw_i; z?fJQvHL2I_W!fzI*aC+ye-bL&9MFkkPQQ*DH;G0SW#a?zP?Zr(!SiykZ_C&BGOd4p zfI0H-ygW>OPnUYshW>+n`?uVC?d@yiJ*@$ExF1&UGvG-Ed$`;4J#pmfC$6TCb)y@_&qr+syS^r^MCj-m6T(gpNVZHi7E zM~@m^`E*e}6#na8L&4efC&|9lpG3yIUUojbKZ!mhxUCj<;R)zvox)wGmkI7G%zc{o zUVqA;L~iT^rk5K}1Bbl+v=;qIv~4N6k8nQ6f6C!r4mv8llO7eJT(85srIYY(RuS*S z3$^DufZ=ti%=DzCxetC+y437`#TV?WfHNMq{F)DgpMK5Db*x{tE)~WjXddIQeMNea z_#5-F>SCUW?=3TPUg_ZXgUpNWP}lghp4xx8DzmeW_vqtYY1T3otwmllBg`%Gx3RQN zd#=R80^A_Ztm{Z@*1lcQIrsNcZZzOeJwIp8)Gt3jer~G3+Zg`?m)$*Sua&@jf=0Wrau|x zF+$(-0lZp&j#Rp=WRv6AF!CEscN$!@GF@H3pJ}@%KL>dvVs=TcDAa-Pe8#a;WTu&2 z$IfsT{6x}9&VRt1xGQr&FePq*R<4wSY;B^EH*_(ebHN(b z+4Hsft~rv`-of(=*Xt-S3`+gEM@WE>r+tCdDbn{7+E<@wUwg~8&wQ(W{XQT5GS&Q~ zfA8e`I&yXJUT{2&;d{4jZDxNlcFT*K9E>{lA@;)+qQ7=t_&vJvvEsasZ-|jwC$K?| zv#&HxyLYY)_Rf>!Cj26Cl?M6TpzmmnQoz%_?SdD>meVFVsg1ncJQt69eK^uB-m3Q# z?Wgrkv>9YgQ=4x=b~CjjdzpLD%fK!d$p2ceh~#1PPL;WjylKwqVQc%1g1vR~%WlMM9FpkuSg$Atrh zYkAIR9D0GRs<{5+8(Ppq{=T&S^j-aZ1V3*%jMdu}<~AaFX}wA5C31{e19FeX#S09Yr*-iht=p(C_Xb zmOhZNGT@kU%L{LG_m;&Q&FRKS_ucH%7m?kiTeSc2JIAWf(I+ORS$RNfoRQ4SJdXl% z2su}Bh~`TAKen%~)LC_7%S?1cHtku!*ux%*qmS6WQ9lnZ`1Mi@O5WNR#R?>a?P>m;^@T0680tfD0U-P zKAK;BiOQsflk``8RsYntjrcwa7Ya{IPml0}beGcU@m)yD5(_Pq8~v^vnwG(P@WAMQu6 zeGbN~=SPR5eJ}s%Z}&x5?*luo>MI~~w;fxxU*n5f9zCmn6Tho}v1$1M%jFmBV zi?^xl=*qvfWA!?~tfcAI_@oCQLySl9i9U7Q^wm{ceY_~^GXF&#i?v@>bEkAvvu}Mg zY$Gk%@5Gn3OV;H-tYh^$9qU14_0H2XyW`;UW9V3`Gv-jHKGJxfKOU}A6SvT zJvAo0u4C^c@Efg`k8*~dCcLRbT|)3x*Ydwuk!u2`?apLU*obVZD@jyPqO1rT92vdZF=5D%X`#T zKsWye91ZS%6klaC^{fA)p*hy4mw%H??za5Z*&DI_-l#k+TFWiGPw^k&9wxHy?}oqM z_@BTXe_xx*>iu8B8;$O2qKw+svpMWpY**cLqS@ExGUvw3v9=CRH~gn>qx3$w3r;X} zUs2==a<^hjj{FXvF|#zM=g%}ZvR9Cc<}OxyqT{UXiWL2@`r{9iyLVAe{7z$(oRkRL zj4huGY>b*G!T6VeR&BQT_quiW{EzpOo~K;jyuV-d72l~(2XAvA3u_EvyFh6@L<@w^ z1A>)GHip+AiM@6wdpgUzp0jGZB%9QpsdHYnBRR&Xxm#Z!$ei1-Z+C#ZPqEkY!|;rj z2zpIsMctjo?FZAn6u!5;)ih$GZB&0WM+N34$7dWFBJO0!z&=o#mm0<`xZ2Mt{-460 zoo64g9@Y+2KxVADb9q3cjxXyLoe-@`Fn{V})UJDAUlyIxS~TN(@_RSy^zxk_G=0yx z`D0zjon3ws&a2tpS&$+nut{*vLW#jzITykpDv=Qo($ z(s>_Yj^9UL@D&ZpMi+-Kq=46I<%2o&34Rhqwmm0i_t&4{Bl$XUIa9&=33hx>Kf-#h zw|xkI-wo^+u(xE`>pAR*L)dhZ*b%Gb3vYO4>kH`HL&SF`8*+R%BiC_P$xHa9UZ8&s z#1G}@-?Pk7mbrfELSy&9OBY(bt~lpu;+CF8t`&cK7F$jswg6pey2Y87Twe1$b*Gy1 z;RToVDOR9uzHBo+`E zV9kflGJR{Vzx2rg`0V$7F|kW=Ty?Q|BTdXVF*eWLF_V}y+5vxdH=o_!H|x#z{lb;U z;SH_ST^5@?(iE$Ea@XmmJGrrL>JmSY~}fy>u-B9L)^gY^s5ElldLj*n__17#u<{0XZNd3wWl`J-f8shM~qLf?_|t^ z9oz@%Xeu!_>cbVxll0mY<4#d7O}T4mOE98mCi@oARz0?bYp#FaliV(c0Jp{rZW zb7|sDERVaq#N)EnlV#G99Xq%KPiwgiT-t$b{(aWx^Q=jp&y?G{(4cYJ!H-~GNw7aQ z5yve&`aF2_cK7XENB51R`Fvs$@$ycjKWz7nBm=)l>HUc|;Rtp0K8TT+-X8~UGymoG zWIa=x9;VurA69D}UV{jCi1gCOfS)TyBA|VuE24dpm&Mz6GC!jEk|{Hxxypp-Tn921 zel1I{8RY$QfdNnDcMwy5+n#`@NKPp3I~R`vu38%R*%j=!mp2Z!|8t~o8?wv=%)fkF z_<9@LJNe%p@R(G6tb2fU)IN!V8|mZk=xe_<6pv?la3JGoz1y>AAF2kAchUE({V(yE z0oo|grua#%qZ#VI@4MzsymYEQ-$I{d!%{iXec7x%pXQmB&GgQ%t6!U{KSJ+tYwqV? zWhB>Y?g421xSuC}Lu)WfznkF!adf5TB=?Tg8{`!3kEG3~noZ+VcSZZQ5wDPPc$^BY zO#$0@&6&a4h=-Qero>0JF58KF=m^C`Wcc3eVj{i>?8k_OXg|K}(6;x+cYh06!P|xc z+dweiJAlz{&N-xbjidB0&wmR4gXf1G(mjqXvv^{44~rwEeptQZB>i~M^`lbTZr*$H zjQzk{U5Cu%b)O+~w7YJTxnwr)1uq+2-ranT_C7vtC)2dwb=n2$hxU&8Q8o6|%vd!x zgRwvczxg5q9xv~1J(qg9NO!OEskR@V(P!c5c{bYJ!SnXx)qU;9PqX{$yR1d~U1#*Q zw@$r}n@?(~ z+M+)Q-FoFpeDnF0$ORK~E-GBbzIQ(C96rRt#>@Ly7p)UEA=#}LSbM6Mdn}zmCmzBM zQebS-sRqhyOK;lz&?Wn$*Bksigy~%xnjWSx!5oxmjP|u;LO-XzPe<6#Z!#{8*PqMh z`w6;&)_-*6Us?TEezFKnC_Myi0}FFx+>Yr3&|5<$=!{ zmin*#H`N-7K3~UK1Ie6z4Y6N!zy37$D!DaZ=GIbj=)^`d{^OfW_jv3b;9n4TAo-7& zpjB_IQ(Q|B`%^{TRrr<!5nZ(@D4aiV=j-$aWUpXf5X>37c% zb6g<4RO>v^etMsL7kVz9F58*?e&e4FKKv)}|8IWnwba6IzLvZ3*lU~a%zbIovCH-= zhF~u^jr?WfywdoH+mOSfr)36rpqrR8<(CZLXe{c#J-bF58bid|rfYZ}=>3|@`OJOc zUOTQpKjq%V;(nhL_wbyh>1o0&>kijk z*0*D3ptJ0toa_dLGp1XbTsY&hzN8_R&e5-OdBp2zYMcL}+@jyL^fwd2*D%fLz}{5r zXpZD2l@I#v&r$|7SND6B_FJ$fiVqlf>!)~p->0zd=xL~b7mnBPu@ZWBs@P%0qkFx+ zqJ0D(iu#9M^Gn%Bz=sv1!?LSK7i+I>$0ovD;Exf#3;c=xQ+!MQmmHsQY$RrqjU;6Wp;vyju>xi|>>43&k^K-MV_)S4o!mW>HS`xNykrN99s7{HGjWH}J}cvxSMD z6__j0g0PN~aQc<{C%L9jVV+)Roc+4B8u?TYe$=}s--T_CUG?_%GJuW607 z)+xpn;hExowZ563CmS=2U%Xi3*88|@erJYgs@26x;}-r1PlOw_j5kA_ykdaeSUE2S zJvqB5zX>n=I5mEAim_UpICi$ZduQA6vkz(PKY@QlGm>#8>1$>~RGAP@8#`)u+Qh;`6;6sJMmk|55tQ{3f9#$?>1^>{RO-9&7nHB}-IV(=ofI zbM2abds4fT=yuUgFIiLPK(ww}Psy4Zi+H5wo9{)OkZfd#%hb6L;eyKD!Wv2D$nu#a z9^9{0L1!)NNX9$ra?@sWLm{bJWTyJ zuU~q}HpNdY*Uc+Y6MH-m3mgTz}CedS-25_(1hczeSJUE&o3AGf8f6 z_m@zn*69b<9^miyDDf|R;sJjpcA;~yJoalCTc>~T-wB?t@879z%w!($W#l&s;;UUO zF!ZWY|9l*g_H0V)8Pc6ZXTq{)u$CpcQ#!2VEUl;J!nZd@TSu99J^Rlm!AH@5`90Lv ze{|(!cMsd0Bs(8NruOo*WaupYTvjcb1D$a;_hxr4;Z1ZU`F2-9OCF@$M^9I*d2qKl zxMt~v&K$6p7H1W|2#z+1*0KiZSvGc~5S!lDNnDiT6z*dVZYI88{G_M;!L8e(3r2b# z_!6Jd5tQ;(nHks*u}$3vtc-;d?dl}%-M1y5Ne{My&tY>J0$(UAshV;z(Y&M3@d zeQWl~zmzaF)~>F2@b8|1{?tNDCh>GB0f&^R_p^jYowaID(XXP zGzJfib@@JQp?&;}77rC)F22OxSv+)k$!FDZR)|JVl6wO?Df46Ln)u38^V!QeL3D~0 z@~L?IJiwU4v5n~$1Dl0ts^(sP-UH|b^==Pzxc8dhnD!pFe9_O0f3BvTB>ySbXZBQycSDnWJo82LS8XIDd%%}GKNF2q zU)5*9_5JJEPpgKG z$63D|eup*4OobOjQ)68Zqo>saL%amswsdwq_8*n=u}Y#VhIlbA6J^;0wmp2piu-3Q zwTAWWq3^=s4nAcg=jcbZ&AI&ieAwvBLW_ ztV;o(eOkgX?_bauMpy2_wjnt*kP~NXo*ZszJc^Cm!}`eXY2z3_7R1@8uI5NMZ}ESk zV=$44S$q)wtIYz>`0SooNi5oo8FtTldA!i|0rmp4g?Jdj3hPx?*AHSWieuHjaqxOP zURk~CVO21;j8$K^si|w5EQe3gt@OP)*XL)1~Wjvp3iQWg#*f>AK zGeg-ZI1k<3w;G>V+|0SZ3ER+~Xte79w3B^!|8Q*9V#UC?aG0UX)*gySi}#Q*)h=qzkG z1EM9*?IbtICgx&4pLN)YhJnvHxUNl{D@|2L@0VY!1HD80E@5K#H*4=2>AV3w6|EAj zF_{6*u9@xw=y^3~uI#Ekb5&P<&+Uyp)wNyg$s^VCjn6!=p8p*7iTpb+w{fGb&?(6Q zg1x>zvsJJ=qLM8FdxPdb1x-Hu&Ka63i&x;*ZpGGoj&X+IK)3Yk_#|->M zhs9O@Uj3$AccJWgxL)LuppM{4wsZWeh(DqmI+rV$;K5?S6dujuxAvi8mb5S7yNe$N zmo!gJ(=&q~i)UAaV@c=6vxDEi>*6oXHQ#wnV;hUkwfr!G?NB*+b+#!V4Pr8awr1P5 zJUrF0Ww3`vB6kngG??yMas=qPY@|{AO`_q!?*LcYIn$HsB$jY{upcDHCKQWl?jEcK zhKVcIN^|+0*J}A*%jaRve1NkSuJqhUJTn*vw`;0-#_#oSa$S$R{&&)yhX>X3wC3UPQoiVx)SDL?X&hME{!4G2OHA!7nq> zk-9r0eI{eN*Rnp6Q3}XJ8c!VFlM2~hg82#LqFVaZLzxW!DRd|0G^(L5#A|m&i3t*o zx#jd(U9IHzk?wsf@l5N%hxTaQSbHb`$mg7!Ta`XNw>9w{^Q8#(FP&+{Ua+qxI_rMn z-b3vFc-;Js^g_cL`18K%zkZ7zWuSLYMQcZ{g#Kp9v(aI7@7jG&MI$57jKL^p99x%k zZe@&zTB^-++0LdnQpcM18)V9=vG)DL(5+|As{Y_G`!7QI1ka(vA6mxzXBIyE!TN>0 zA8g=1b>_C;X`sKWp%Fc^tGaUJxXLh|2N{>vW7}Pkz6z&33RL7%o)*Mxoz_o zwr-qxMObwX}sCOSfDfA3MsNP2TIzSQ$-pR{6F}=IICW6F+-R zG%;p={+etPjPHKoy<`sdWzhzrnAbPSO<8Fkgm+DE25TnzsB!rCOU=t7-YfQ4dWz(- z_2{10xN&`%oQgGuoHOyi+qwyPpvR3X2Vbf*t~BG?p>dVP;eMHYS;cq`FdpHE-fuTm z_p9H+m*%RKkM5)Yg)Yu0Ab+Zlg|244qrZViljXnIV$nRUlkB#-KRN~cqxdF{#HtoY z7()SBP>u;M$GsR?;`3R^tiDXp|BU-heAA8apT&P~$6m9T*y@i62JxOZDh^gYERP?) zO)oFj14H{)vEgmZ#~SAN0CK%(f?zPe{e>;T_(TUyAh+Q2P+!1hL3j=J~rRUL(XpPk)!P(E(o9+wQ+nl#qtaCR5%w;|E zGlU)~n)y)FT#(|K&NysCZ%(n71UD5e*<5JEXG>=QAJjt4pU;e1!b!<-P>jV@J__MPE3tQk2JJ|L`^y@yLh? z^exT??KbQKa2i+vZ|tR=ave1nI)kTk`N0{RKvylUdtk$|dq?Lc^}JDZnE#ZUpLob7 z)eG*0=jT*&qj}N%*m<&ci#h$8AI*)I|9Mv~*E@Sua9*{R_u^k#>z*j_%IH(#AKEM8 zX<85I_jcbv-~7I@ey#nbebd1l1@vZi{}8k~Yt=cpeh<0`eH0GbdhRpWi>62Nejd6f9yi2);6rh`0e+K!UzOtAB8)r1 zc;luKefG1BP2`r4d?OuB?bYyJZQC?fVY{>=g}g$*Wx zY=MmXN`%;+aEzDeXTs99$>#|~D?M!qJ_9-#zCfr_9O5orYeYYTT3kasgdCf{*ej<5e4*O7lO7PM^#_-HY!c?B5OWtmNC3Pk3@1 zonpNf5W6^+IJzL_>S5Yd`zIT}-iPEK%X%#DvUVoXf7&bRK{578$C-hTN_?~YoWA4|?>`@9FY5fL z_IZx)6YbN2c$d|IES=Ib&XuGb&y`G4!@i~OuSB?GBpfGI+P9@x7tt>5pCRi56K(&1 zwSga5Ijv8AFv%lVz%RC0S!7oK1=t8G$s$L9p;*m)`*i8Gjiw>lXwEQ8n`a>J;9InF z#U9ptG8a99ou^KkyiO7H&jR#HaTIzdc?4N)h4KOn@ZIv-inJ@p4RGXXWFX=Kv&0l? zpD8X-GH!WnU_dAEg|pYgv4Kq&CO=!?OrG?}Jh6e{xWF~U32q9-1|B4KAp=clrC%vx z14VDzum>d1B*%}=E)gfFF=%X_-ZWJQxu8U2ILETPxi$&zM7q{gHSHJuugCtw*Gz7FF=u)j+9AbM5_AKnBXw9nLDW{Q1Xj^~o6gzG+Dp!~g$|4TD}KHjmu z81ERhzOyQw(Q@&Qt;oSX-ti}V_wkPMogHPoig#Rsy)qvfd)|#*cJdDFKONZ5^3cyE z=-@LmtU(n!0Y1q7eCftHg-^SL3>8~r9OFU zW2=*O0(ueHdz~D!IYzlf;CnOl9Xw)x1#!S(9p_?mvCT0s_ctb4kT_nqf6`AdHYBMm>><~h)eXX*1i@MPh_+~Aw=z-ibBN3j*QM;DHyW`6vQ3&2^`y*)b3 z=0W!`7sIA1d#Y@rvZJfE7b8=bc=W~OyT zn2X`lWBV47Cq8~=lKetdBeL)IGB0`T$%`gh_QzD8=b{1X^HF%_SHRT781gp7lH*j?IAQPq#55 z@`t>%ZF-+_V(9%#+b-jK()za7gO4fJVZF|T@GkWUGk*1?`oyzMQU6nKvD^mA`8f#t zZPH&Y&4b$Z|GVf@ma|6ww~OQ0o#iaJ-nDJQ|H?0OJn@Q%Nw)!dMC;H#oT&(!+8;qm(61JKWXU(_N~x({F*koHC21%50zY94_FZ3^-~gz`K&`$3=8 zW2I*Y{R{3q-NYQpHhl!!=(Wsu6goSs|0e<;ck`Kw=c*d%fHzg~eHq_d@mrg!9OGk<>ahg%z6#ZttXZ>dEbhoZTRPgtE|iw_F<>kqw1ppKL5%&zBG@$vhGacQ);$d zE!-Y@qGXGRoZ!>`e$j3{{8j1i!ga-{&Ft=mK24SBR%GyfE6 zx5^=U8~l6%U(>g+1H_@n)TL~+YbYAzlbwK8UyOe6E!I+PAOkE;JKL1CA#s11+Vf-R zMMmDh`?<73jB58W&KS4H7LM!yKK#743H!>n*n*L7A-71TN;f1wy8&M*a`5=FD(+oD zzC+hvOpb`gM9zE!-`+~)BwdScgjdL}N4~|3KP=hQ<(;oaF3o{6S>{$UnsOVqAy-B5 zFWPe}j9qQshrZiNEY;PgnWak@=fI?OwZ06&w{fC{OYgCBmJZ2hd17HDqmirUD)47g z9_=W!+~-659N)csb`bxY@^I=Lisn3rT&kQwnlHuD#f=#+5MvWXMqQ1)p^5VHNlH#z zq|Rob>n@;HG%NoPM<}tpq}`U_L;^mpO40#u>FLtxY)-_Rw|Zou6?Iib(PhB zCK}|#@b*mE(G;sBnkIQsI%x{nt^6LshDkeiZ>7-D^j`0d%n9%ZSW5*{^B<926Z>q6 zdU5>HnKCx6hR#C^PmG1~{f~1-L-vF47|Q#e zaeZej52*Z5h5nlg{SU`J={f% zPV$R`$@PEnTB_Q7Da}3}-B60n5pIaL=VKXrb~(WuTAO4Dp7^=u)!Sgji?ycOOL`vm z3FX*JJe%axQJM02K=-kF=D>RcUZitZiuVrtdS=D3|GStB?I-Cb^7XvFGSWQ;z9`SU z=&!#QM0&Z}lC8FtJ*f5f&m;qhXK9W!j(9ZK2mV~3a1q^dRUWv|I~)51gAc|M;;Gn! z*+->zhM~=k^i6gU^)U_(=Y_+>M%nW`MPE#CUdzOgxrpBz`dGlLbv{5a)o&+1J9!4X zHRIQu2v4hBoVLn^$70-BBkgUy)7XP?W2*)(`KBkuI>~-k!#v7PCb&0$;sfKWl!KAF z0iA#*FsF)b>0tatxSyCd9*&vP9`kp%h!%`)#Ggq$=)mH_8By@5rav888^O;jp2p!! zz9rIF{Qfbs+kdCr<^v7Tkh5Eue(QT#th&&Q?wU0p7$2ptPt8Z35}ZKZ>QNn)RXMF= zMzol91nIC{5o18#BTLACpnAj!8|)J*tAFQjEY`O$kV{5aKH4W*BV3W+z~iCtQ+Om9 zQ@A7>pX7)aX-_oH#!250#7PU5&ePZnf{%If{tM&d?Vg1#UA&~z(f>-ogB z%+)%>7=rs1YREbH+2|GEyQk&$oTP;a7nOx_Qblg z&F|@!&rH8N?pXh%WK55T?e8>)(#SKrn*SZLFa9%&??Hd1+w9;hEcN8S>`%w$$)3<1 z&1Y69Hr(3!`HY^Ey=in~5Vxy2l+8_JPr7lp|HB;GEXKy!bxWaJ3oiT5?!hebj-Q*r zrykg-|C%%8vKnB0j}K-ia+wt{k+DH z`}pCYjPj0^(`P@{aDe&aj@c*`(N)hBD}A zwVmX@TMdoLiN+$U))C7loa6lp>3ebaDSllW4|GoHn9Ac7~tvX+;lC98@@Wd)!1 zT7g#>W^84-!hNp6a9+D~NKRfgV$h4=CJr^slXo2t6hfr}}m;9gj(29KB zz|-+%S$m|`K`)oFTV^JJ3Ajs?r%k>FDxr$*nY*~3^nY5ZsDVs6a8m0=GKJuOOXRmvaRaU z`OVUCe&*Px98#$AP&r zjGMnLd9~-wkDuO`pV&AEUmm#*JinE;cy8zM%@*#%`Wv%*!J26{r$gqPP`m~*+w0VW zcI;E01Lg{xiQM18x@jD;c?o_V`o`#$XFX*rC8dkr%%W)ycoz)sojy){@ zg#Vs*bVPMkPtWzg9lKeo!OHY2WDEB5>iIx<`S9;YfGN98%8s)%#sa$RkQ-x-v*n3) z1Y->N-|H5)0=>xV&aww;4y3=RZz*RxgYN=0`L}<5s?T4xo`>uE6Gc9a)3+vL#_c=gWJ5f?x$}d&^?SNWj(@_8J+AL{ zmY)7i-{qVUsl~s#{xg5H|FEg;YOYRlmV`5*+$+5a`9?f?eSfsS2Y;mK={DlD70=xo z{m7#$&6cfSrp!}3YmI*RQQdL1@|-POPm`P+oni0UZ9RU|{xmYp>b;kb81VmIuFc-?biC05;w{8|3oK;!PkHtnA$;mO}erj~9wMC?0b9c(7{{m5664}2ed80S2I za^%bAY>)^1eafbu{H?_IXNm8hL7cvH(PtMD)TcFTP)%+&ySMTfYPcv&Pm z(#rR>dp@&&DEFEDb&=@00{7p({Pi35w|?V>{Szj-?vwnMyl~K#uO1m92kiBfKS=r2 zk?M76eyjXi%GX6^tQ#4fD9fApca~21`rCQ`3U$?{>L>UeuK!i;?oy1WFF(ZZN$v65 zm!B}z>s}?tr*a{#pJ{e!&NN58uX7i(nj|Hc8<7%TI2W%@bqp|NmhE*NE*M_;PJi{KHbFwbkOLz4-v% zc~5?7|GU`(L$T<-XXD=_$8>b$5pd#F;GWOB^LY1CZ2G>J<9oMiELU(B+%jOPp5zt1 zYong-x?9T}{sHeQ)vIRT9Ry}CbpIeUvkh7;n*L36fgJd9+BEP)ccDXv>-IK{80c^> zwEH|W{oCQ^IX%ZNqI%)y-1WVx7amjo+?JlBE| zd6~Xk3yr;&wbT5+TvY{)J#VBQ8mo5G)K9Yav(;u??O7Vj8E6k%`D1IeY-9PP%_@dusfN5%TjIWOQ7?A7;9Oh$J z%Js?EKE+4&xH;;bWp-UgpT1H>pXj6dlz4NZ*r#6L+i}f4aa?=Yml_AT0e9uFV`a|_ z__g}2{tiKJzYYC8&(iN1>(c!GCiFYO|AdLG8-WIihx_vNW#xN$A1?nMe(Q`*+`=~_ zD*sJj$N8TyW}V6lc8>pL{Qk`{_(R~|r2g<*<<-VAGh^MW(7GQBKcQRS;{RoH+Q=g4 z_CyjM$KKamrl6Uc%X?XayrY8y#Pw*;YaHYv zKFizGI5mzIM>GBYYk(@~F;{)+z4i`i8L_bT+cdjAiE|YuK|Ofv;3{ z*8)CK1AocRM;^q-TB)2bqxX`hLX{KV~!lDGH0GsJNM|(g;D>)eO?;> z^fl{mzGh9l^_FYn*L^yE^V)0T>(igQhA%f=lV0Qr?36@r`sBzy5;6; zZV$m&L!nRJ(6-J$`t%K-zQ%vo=lbie{dD@1r6)I~+a|panwk85_02bY#y@HLB+%10 z7wfE`z00oq0BS z%KBtDzau+F3Yd)U5sU}8esop*HzS#E?*b~F&gJ{b89S!y#8$Vco z=j!T)JFBXnq26j&Pdwk#LF!l1B4*J&oKiPX1FuAU) zOtj)Qi4sh3z)1uNa4f92WJ|5C>Tao}ShiZ-Evutfqi)&C!<4G4PIs48uhgmPhjD@e z4$%z(1cX5h1_T5mAVUN<0rMJ^OaMUw5tqQ|@)}avSvJZmrKZY5U3ArPu*k4|nIyeqBHpS@gQhJ9Yo!E@C@^?-%7$;?{6ka#kABETJ&$|S8SeL-M1lA?6E`fCktV>{B0_zf3 zm%zFN)+MkmfprP2OJH3B>k?R(z`6w1C9p1mbqTCXU|j<15?GhOx&+oGur7gh39L(C zT>|S8SeL-M1lA?6E`fCktV>{B0_zf3m%zFN)+MkmfprP2OJH3B>k?R(!2cH{u$6@@ z$>l$L-k5pJYgfv9Hg~pf?s(N=&@L29Z{D-HTJ4Z-b6`In^ICo<@XJV|kNmFs#lSBF z?MBNlD3|i~&1J7#X|>nncd%!3`HhnLF~IgElL^{ozlGa>ik)^t7!4Y`%;ePm@#BZ) zGC{FkYAk0mOMbEG%}XIY-0UM)2{n)k>DTI|FtUGUN;ym)I;5ZD`|#(-@XSs<{D^$+ zJB}Mf@f<&L@W|0ek9f1w4<8u^>Gra}yuH&Z*2|5Wyx-o$WkcHozq+tJXcyax3BEay zf5As@Es~p-j`>a8tmIV!uia>P!4iJl{gTWcRCdpvjC^VeqsnB4EP1A`wasJ}iq$|a zMOyQXal6&gJCdf39Xon#w>Mp1E>_$V~KeW2}iB(cO+N$Vf zO>$3@u%2o8%auka@K)?a_qW_Gh4-yay^h78X#kRK@ZNBCSpIQ;3UTm})9b97N?{;LFF63=43wofZCyfO! zs663&o1f^A7d1z2$uh2)%)`~je6b4owjdBMnWXHOs>K#kNNFIZCpwn(!>%aE*UN4W zws<8-LN4Gcwxt}s`b~{b9y&U4kR^_!Q+3vxxP;5f657pMYE;V*q~~B(^|0L6rBubh zYqBw_Yo4$`rb~Xygt8yvJha=J(_6o0i}gwyB4~LN2c{+tdZrn>wIXG2)8=54m(@n! z>gmUpmtnTMTmOYd zr(TwVcj_&_)L5*eJY{d8T3pNqTYBv%dMLcdm!ZAIc?d#C0#$j)-LcKQ7(_3A@iwKE zoY+rXu`;Dbr&{*vjkZ^V!4PFNW+K|`X552@a?8I@bhbbaPv9%ePrZTfWzEB1Emb=~ zWm!96kAJcs+J$J|5@c0{fa5(fZ(_)>Jx~SMiniavC2Bo$B}M}ZEoxWuYmL^L*KVyz z67UA2~h!nS=8{X@7kQl4%05#}#fo;6Bdv)IDDZ^#O~m;Kg4wXw3>gIMZq?>_4g zS=1Zf@h`NtSQlZ<`!E(ztH4Jg%X)#_S`#V_m_8?I< z+u1R)g`oGq1Kz2L>ZyH|HhS=b5B7d2GflsYln)}|kYq(r=Xh;-=Mt3 z`8cTbf>+9`v3J?5j+fgW>{XK)B9Wy-!>~x&^XBlI>WLB}KYK3%>b{?l=4bgaa@H!P zLbXvWXI~>@n_t*U^(!=57>&_P)#9oTDN|&pj@Ql1DF5e`{%#SuhyvwWYHfQEw+M=N zAcICwK-Vega1umB?CKe!mr*`Slg+LIF!sm6e{gU+{zJo?!7G$t#v1hmFu0`LGp^sn z?Bs4(si4!80Uf>Ik;CI2Jc30ZddGge->ez>&o*ziOE@xS%B<~ELAgZuk!C~vr4EAv zX1jvzYLDu*)K|QY92lsoN5T z1EQxpO^;gb>UJ?91$^o1OE!BM!M*Z7j5p1;L?8tOi>aB=0;FNCh*qQMiT6?o}7!pdImJEh3c`iD!^$?BU zavdR?t)aJzrPdZcb)+$kA5yR9Wk0mp&>^0?f7ir8>NXehsTVr+Q*{)opq_--SvP1L zw-=&1kh*pOp-<3-2(sCEOm2FOmd(nz_kaxF1s@L1Hcz^3uSL7`R)cO&@9WpYJ4iSY zC|O_n4lF}T0@6U z)khF!opuvdZuxKSxSM9>;#SOco{ zsNTW-uYP^8y@b+;!*Iy2%lq*rWK%xUsm;TAo43iFbC=}((5n2K$vhxk>_N=a8m(Hf zjq-rhF?`S)%Jc?-nHHLGK^#^P!rj}PedEx!U60+j<)Q2oPgbj29{Psz*3Q<|ttZ~{ zTFh(k|2J-XtVi;u!8d_209;amX0vxM6_@?ON~MgVqk2_;pN8!FRj@nW1$E@=|< z5ON9gOfNKSg{H%(cSQ<^vV{nOLU;Uf<-mKmK$zD;2bqWdK4$Y-k$gJAeok~_Es@RY zj2@_V{4&NZDJHFqv`09X5ECW0tb`c;5(eRI4?4uyh0{)AyzR0Dy-W(d`_&9dwP$6% zKM7&Bk2K2Y%%c0p1K)XqGJazC6nA(yzhzs_yx(JR<6FyqS^Z&G2eIPMZGTbF(y6lK zCtbE{h;^K1OPrc3&f8Ea^$Y9IDJ`vzrzob?zgAo=fM0tFsiC&nY~FC4%8;Y+khauz zY_$tZjmD{h2x~}m8XX~oAW_#qqn*n73!jCy2q64c_${!2I(}uv+$t3nr}w@$H?VS` z2Uue*`t6pQI=Du`R_`_PgS{hMf7Gm5TtwUq{Ry+OoDCJ|QzMR%`p5;Hr*<10{kmLi z7o~f3>ty-sFdUmzNPaSp(YhRNuZA4@Zhd+a4)}i!OaoWjGMnkW?>U8>3$ec5Ly?{{ z!8k}a2odg2u1Znm1|#?dRoL}HTkV2QqauQZe`!6k55;r$7nX}PiuS|qJ8QW_>7;xS zv6&>pu1u}(BuXVH`o4(42m(-}gvM?xWbcFDv;~bm7LqeYNY_$5_YV1Y^~!XyglJJ2 z!B+G-Z?l)%(XE#%{w7$KayOQ8Sc414WGW*e2bu5}U7TeTGo#~-a*DkwKzWM`63lC_ zWrwzEAOPhpH9G|q865`tJTY?|-V>GGv{vL~`FAkHFTZ_tU}Ax_=aH z65+GeLwfwv3J;2^uQ#V(d7kvEw@x2Od726OXt_i6-wo1?OjUM!YK}bk0f_Dgm0G9T zF4lcSbrDF^?$?X32BIhkhUv6pt5=q=lsG16gOFEGM;bvGr@-#Lw3b-#UVqkZAnBiD zT*UJ%r&CJ2pkKVd8ygo-6cr+lKvOSljvpEhMeIpJWEy&t z7@b6;G{yzD7DFoBlWw>Z<#c+l@kRvjB!iIROX2Xiu%7)&@oSKY^Ft;7&V3T99P}oo z0r0mQ=mEGm$8K-2)mV{`p+p!#>f(t^Y0fz^!#J<)rowyJZyyTg1=;G!Faslxe%YP( zYNUdJ5|KYL9-Uy@+Xy?gGJ-!i3>5NRMX zvnJOiC&b767A6fE!VlW;g3@+zv2EA##CL~yS!E}BC6(TG!-+H zMja!519q&nQo#fVU(mxKgnDCJqZuGaU(+E324igWnw`!kBnsmd5qc_VR94(!)OW?d zcNy{4sz_+f&BlsIj!Yu7D;3NbfZE^x&=F!VTO!f@QsB0W+3GI{nfl=)D!hAJ@DrRu>mKRa^7&>!qbyv2_X*TWp2U zrU?ZkHkLMTML|@7uo8Jn7m%O}ZH<_do&$)!SAjEK8B^L;rz8z0J-z7GRWzy~447W& z8f%E2%CZY^ric19Fz%GvUMGMvCpEJb9DGHXldCzQ)@B&r@zs2KwdwN3np@S>LyILn z6NX#<6w9`txZt-TCx38p5b<{Dr8-xyLT1v%iX?PP6ec*8+87j=Gs>g0bBM_%jhp8EI;6Ns`%PC-ghf+k@dbM=^_YSJdBp`72Lw`D zfy6%;9oCV6xng~~SZx;&IaL(tW~;v6lywwcxTIRnYfw(imi#3iRqeJ^2@7s(UJauQ zbsnP!EN*GZ+k}@w&4Qu{VW0535D5E1E$GU*>9;D4az)mF)@+T|H5TH&5(1JnCCyBJ z45FTjBCsm!PGT23!4g)li{-|OOX*|zXw5r;k_~1S+T1g&Jmz0lJv+)U_HU1s;NuQ30Ws#hpj+}D>}(3#)@+20ZJvd}B9 z?8DqFnhg>+RoYvVqdpUuF|`_1tdB4GC{W8|0O4r;kz#cbN>v6wTmQmF0W9*%FruLX zQz19I0ZT-*G=a)##&2z-_AH@$$Qq%Hv0FtJmf?~#m?)400Cb6-B6Yn~`&|pJxWu|J z5<*pICkH)mrh$mREVpVL&HCsYhXx0CJ~rqvL!FuK8S;uXgn!zy&A}VaA9M}pasjU? zr~v*9)oPpD70QhcI3od?&=RXzw3SYmZmZX63d=}lJCO#eAIfp$a7u=AU|jYWituBZ zC0Z=+WpnwlMEN*wgtHL=ciXKB&BewFm@U}YrB(y$)M|J=na9As$d-ZWqY_eu7a-&N zAVLh=FrX(Aj7QMxXy&RM_@~k+2z_R< z0vW5B60g2Ook6joxTnN@kVeosBR48w8tAW35758M6~CbA3zDGc7f4MtgzUk=f!%O^ zgy2$!X5{KO9s zHVu(98D4FGLMN-cuBn4vr7q*Q%{E~j${pyPb}Z(HKW7#uDUbwy2pD2Zk*4@6j%m7=^#4Pi)k?* zLUM3_d<_MV!9@fcV6Oz+ZTH3;Hjy{SRg4tcq>v5v!$1eShFIlcad&utZUYGHOS>X} z4i2LLTrY1KyRtBXdR@m%-pJ6fUHPfYuUamRf~T8-{mjf1#mQ`7bV7T{riLy-YtTa> z{aUlVrnVVW*s-LhIq-`uNZ_8C@wo#W{lY~TQ96FmYFDE|6L~S)ZvD|C8Y^PJI`A|PVygjn#Z)#ci@Zd$As7(=vR zr``>tPz^F#u0oe%W)@Qk3^Z-n9Wl@gl~wB+IwVWQFww5t&I#B0%1WjnO|5ysl2HH< zZ8uMtPHMpdcItsIdg!)hL;Kb?iNeaJ8%z$drY|F%;?h*T%|IPE>sE5%0C!NRWmv;l zZhs5#Uy$Dd;*(Ww3UT7e#PU%ZsoK9FAM<^;FSLBvrx<^GC;XjV(avkTcDzcX)UHD8 zx}s%*ur~#LBjrLk+C$h*R*7V6P`yz>2i_?dHPvG6*3$5B+R$gPm9Y22Ron{V0;@Wt z3j2(%vB4Bzs}nSI6TWDp4>l|1O@p2caO&Ygkf8y36Lw8vIc}5IMSj5RB()n3p>Ew5 zl8<97-{m8@0wgd#hG>^7V%%3)4qtr;g1P4o&YnHhye+YF27cTy9|brCEgU zC1VVhyWsIlKo_GAVm)+e(1zkEYQ@YR_;qZB)rWBhx_UC7

EGNdg-#u~LbNup~fK zt#QhS5J0G%n}Zv?W}8yDY2u)F0PP63#%5|_0K>fYsLzVnMoZol3RT%CQEq5PW;G&y zGiN;Fe7K!*OJH9_8L+Weha*^P6j%yo=`m@O5DwN_wcJ=yl`XP1l(1hRbG6i^RuPjH z8Q3Mtgf=t>TdFoB77vQFt+BApgk<{BbI$ z8`DaA%@N!(15cYzS|UudGDl}Iq0$jXHPLp`DUqq8el>!I2#5l7GawNRB1_^e8m0Ms zYJn_k_A|@Z+#FQ3`*&C;#IRdhj3li^^_gJ$R3|XhV31f4QFQ&{5|*4LV245c-axiX z%TDTUW3m#uq=31)OyIEtFx1>uEB7k=Mva#=$BIqq(FM4R#OmkLMA&H}-Dziu%-Ml1 zi3LDMLZnnmFY|HPmx(~YqV<^m^}&wtfBV(x)~B*K-;oa8zdo|#{oj6t*gpDKiKV^z z*9SZK|Ls>N)INwo+_XM($Hr&=?N`Y4pUNV?Sm5+|MsgBYM+Is1U#`b0^wST z_QT7PaEuH~-BHgx>z)kI=l0}uUc<`j zOKnoYC|ce54BlW^tmO$>D5ede%njvwgZL@pwQl6LvH31iP2(1kn=MM#X4 zW4R+!-$44`A&dpc*5ZF+dS%`(0b9iO8rv{iks~G87!NBe3tQPEM~_XxuX$t&QL^6n zi;)&KJPRv4ClelVU@-Da{0dWf%;a^C1IA5VQq!uGFz`bpny>C2(-lLdmSREgs*RTH zjNrh!+rxsCY*l-*E}_OJ<=l`Ac_pC(z4=9fZVQry6OG$(aRw9lmJQvQ7|N*$T`2*I z1!rA0$PeZRM@_<21fEN4nBeOh@!M@nRc{`FU|}_ob#k5USt?nFV*DcV*2SMi8nVj} ztrL_m!LvY;)N{$N>KJ`U_Qt8yLJ>0vd>e{OXD_Q~6!egY$xWKTJ3Rkd9fgZJFm78Y zmZYsDGgW3;gp*}nkq1r^Xlz5<2IIOYfi!9_I*R@N2)ld7W@ou%tQlwrKqO_G=mbLh z*sfPPh4n`{;6VwZ#e-%M8$tEJ3{(?Q1{}j!s$kk52~k_XNHWlwh5T`PQx@mxz`K<4 zF)kdS{dFUi$VwgrW6FhA5QNJtxa^w!f2G_ijI)p%!T_Heg5QeetRU z3Pc<#Lv~4%XIZFp8;CB)IL%@%+V^deg)povVYnI~{s)F>a-YIFYYPFUy3G0YupUD&Qq))8(lbyIDb zVdAWd398+ekXE<=?2g@>u{z&f-$z5a^N^U0HUbL@B44-u5t?VDWPsU>9Y92{4D0~n zpm(?tv>`0i+O3Paj@+GgGMIyM;9QT4HX`bh`2T@K5OItV`KmZ^s1ku}*$-5QNx-_8 z%&k>3F_e`%HQB|B2t1NwRI6cN=pf{IfV!&LIW7>iqi3h^Qwbb@obA|*kPr&Kr~L&Zi6kFqN)P`)~5=} zT5@;x-mN!=qvj%3na0_OVe_=`drLpb*(a8jtvzJy_x5!QjV(DwfuRXuX~+q#2nx>* z1f{eXgS-)gQp6Uqx%(jvu+tSl&m#8{T}Q8xt|cojHXoHlMjDcm*lB4TCjp)3b(3I( zmz|>s#-Ja=V7d6Rn|sGgYqjjfvn@I=Mu4q>8i>ec$;)CZ*`>~+zs0#I=)JwVfSKre ztyo@0ETZ0)@-u@OnbAVYB@~SEONdlw?&>vJ063;!7IEpud(m?xZNZXq9a*EdF5aj7 z9;pNpPM>Xe$`wpx+iP;(5KHsBJr#F0H?(ymk0XbJgVydn{>#!eL2d;`|7=RU3M=F= zoVuW+Dq?M@rM9>=Y-G@IK>$caoE-@gp{?79^uWi`05Dot?Ord2Nf~H!Ylp{1FsyJb zh-#HP_-0W|X+-I3E}-E}trn#x;n4Bq)a3D*!rak=Q%80~B^rn|x3kP9N{ksR$Dc#po8A5-|Kd86~!~whO=me-x^#puLgyc z{wgZj^R5QHv(eE^- zrGrY(uQdkIdZ>%pKffk|j9@AG1^DhV6Un9JCA_2gHS4MQA&eNQVOI~36IAY2GK%Db zG^zPSbLq;lIgh2)=cr7Cza(G=ZXAZ@^pzWe)J|@7`R=mn+emS_A<^@xPaWO=xiX2= zM-n`b`e0cdJBgtLOD(7~%$wNWFQz4{gyW0{k}e#tU8=eI6)D;@}@oiNPJoYuLCr~t$u{kNN0L?4RS z!J}PP6&f`74`KD2beE8Pj676+_4oSf8OTAf9UrCUntbSD2E>692bEGkUF*rqNN+j6 z`(SA?Eq^}tM$TPDjbjW6=1wGK0U|VBy$vQZwot~bWC+#wYY)k5PJToV#BR2mfM{Pn0%=HRR%&T zyN=^>mLXcx*xXX%sj>poi^=F>3ZR%XAqm4v7CH)I{vtE+&_=e&u20}&=K^+?zy)wV zfoi9Oga8GN4z_K;{iF8)|17d4&en}&YXmJ|0dfR z#9HWrK3p1G_(|hq{&cBU7EkE>LK)|5SW9Zg1(!^MO- zu-&Hx4UMT@hWK;s7cLnNT|oS9p+%Q!xgaBpvv56ZLhVj>n0JpQCwL%mT2|P~@XI9M zE~8L>==Y0@;w-EbTXLg|Y-q#GkQZre3#}8YYlFhr>bbfr^S-2jAKukd#v654kSzR` zsK9dH$JcJgK?H28pY=8$CY+hmcpF;5&hg8w8R$^Dv(|zkQjzc`E-zby4MGD^<3AqZIK0TnrAcUVp$yYmn! zd~5@duC>d#6y27urzpdTL+7#?4DqKip~iyoB6f1fg(|kSKSZbb?$a%%hp;{QW~aXU zo%@z_XwmMeZ#g$mZEt(9d;fzS_mqMju^^(WXa91*#gl!rTI+u2$TeR~(9ttCm$yB* zS$p~^so_od@)i~4n^@lqhD*Pp~tt+kB`AXuL7vAGqhHVep>qn1;b$az6oYthr! za(1>p^66n8$g6k$7H@m!w=n_GBgC#-_vl1WUAhib$l1S0K8SJ`TwY2sE$boJ zbaogudPEJWwR^%oI|o1p5UUle9pX{4g%~$%sUE{HKi_nsRbtQO9DFb|I30}ZR!{gt zkZzC*0ixr*J`H*mbOn=lY%D{mBCo*@ofS||e*)RbtClmZ|3co;_b#D{BVp$zWm?`? z>t3l9b3nuQ(_vFk1^bna(afWh`lWZ!O&rwd;VZc{Za1AjH;%};r~`1ZaF^9Ik76kw zQJp&6o)+S3VF^gT=$)9;_qyhW&Mg-W@Rl%6amPeLhpX7M-pvJ%D8b1w!56UtZHt~{as15qi zV+I{+WG$ELk~pQZDC-@Am`8NG3(Bo7U`_@~yog>3qUrU0p6_v{J*0H*ed!b;W@4qo z`lvmiFyClHfqSpiPV<=gu|v~`r{@Z@bK?^S^}M-AIyR2rusQS^DxoKQ+wE4N-t0mm zr>q?9E#gHqv0M}&2mEk~T~7PCx@%>mEA`$!(0!?b3Dp7B3+rtlGbzF3!A&>2^%HAY zay{AMeY+Xz#hrVy%F{0D7m2(Yg4Fs&V|MyY)|T{(u3hOj6&fy{d;%9vK2d(mtE2Mr zYdik0BLUhgbnlVeIuYodA&^|xC!6h2$Yoo4WlX{j9p=#@_%0!iIMaj8kK%Fg3Ol?; z*XdqYm*Is{xF!?os=M29Egnji;9slY#Fbv8*FBP`+m|_>CHzd4D%OE80EMs2oIQT{ z@c6OUV;q(9qCsW`Td{?d_cxio%OEHhiQxJP^j94-;($q~hEuqjgzdVyyuDovPT_t} zU9`eZrEdSGD$npJ5668pBBmx1NaY=WFW%hTwz(;{{8voHy_!FyoJlHN1ls1&dLdJ6b2+iw$07u1Ti7f={ z6b<$s)yHHVr{L@>`ItR~R_aw4bJFyO{n|c%kt2HCUaImsG6>NP{9Qh37u3eS#(Qfv zyJJM|Z^7jg*jXrdVQAs;&;IoLBrzz!xq??O4QK|1%MvK|_Ru|$+B&)$8N-4o)NX`W(>_Ktc#TC}r!I-l>IOrx@75mCV=B6N4EXRKdfKTGdoCL7Y( zWwiChF2mE1w4w1Hv*yr!qNGXe!e$9{ON%Q7qOA?YEY%3QwJ*7u(XC~=^AIqFn1AT0 z8QrjLeOhl^fEi#9w-yYQs~2R!D={aoXc7CTOJz`J_UNeJASt5eQptPQ+M--tr`CqD z5Ocex&dL?Dmzjr;+MTl9z0TJ6P)6C>gbSF^&7^C2z1`3}Ie~X>=-Gq&XQhYYlid*I zk#Siy$TV}VA&M&(VQ4{M?{sgjzgz%jgwSW%uIn$$RUcI7!xl@c_!ws;A;#C5OIX_? zx_%fLTNbnGG$nXNXeQ7ngwuWUxWk8-NJuw}$;Mm85jl)XqNbkGqjGNk6LS~hLmtOyMe11TpIZKD>>vC2vI zV{_O=m)b^~*EScnF8Gv-0AYdZsD<1%&? zc5k+_5n^O$mtF~D_D1_zZ;u7MR^3gbyQd>&$Q1|raQCdNw2JOc2e>at_NDncj6@7< zHal)d{%2)dMSn`M&o&b*V8@MI6q{`=i<2sG@p_}{Y)a5m^jJcL*iK+pjhFO7VO=-O z*c>0aqIKvBs9XM?Jf$76`z%VA5Tp*3a*DaLxP+KIqHGBC;Yw)@OYE`fd$YtZLDRmV zG{^Mt2Tos#+RJ{ptZ}kF7sAavWM)gy_OgohQ7GfX9qePX{(l%gj)WSIG{*HjBnQJq zp^#N?gypw-{DnrrJSRNV!GDtrp1R$4zYSx$8BeCvMH`;o$=^i%W8<0*(_P}eqnqr{ zbb5<9gUA^j#I*))BT4A%xKg3rB6Qtm%S6hdYActTI5n`gl={ROLkmN~?%xPbE@s1o zlak?R(z`6w1C9p1mbqTCXU|j<15?GhOx&+oGur7gh39L(CT>|S8 zSeL-M1lA?6E`fCktV>{B0_zf3m%zFN)+Mkmf&ZUK;Ngi0+;Me$9^02X+YiZA!wqkA zaAa_3+m4Qcxwqza3=WM9%3e)^hw<4lOi$tByRM&1-;8# zz8HNHH~QB`XnXWY+~^N62qR zpTy<$KxUj&y$_>L;zqx(N62qRpTv!Rq7Qu%H+nl86Ha9Olep1Og-P|h(I;`E-`|Hm zi5vaHedv?8(d$A$#I=ckGEi9PGnC ziRZ{?FVkn4@*9b-5_cBr!}>m-Iq~HrmQP>TFFyxfx98A>^jnG5~0uO^=)E^h}i#}o7>ha_(FkM^NY z;(rcGDdz=N`KjA1=?DfY!G~t;_lXe4fz0bezwE1(CyC43fy^8G&?oT<^S#1XTbc5Q ziQgz1P-Z#*i1;P@Ghvx<%MD~6>yvL17s7!|p$~l$--P@{J{!Nwl3ZkYj1LPL;%4$m z;zsXIooF5f{Ds8j)5D!!y=uVP@!D4z|99C( z<|Of}dkt`w{o9Cp zx^(V~(I;`E?>MsVr_m>IqhIOLxi3ba#EpKMGf`566+Kp^G3NZjSSh4`fy zULt;l_{;ctp7?eCcIEj!;>bjwFXj6epyDbw;;$yYiTDulJBiE3K<4eCU-s47F^TV0 zJ|TRs(SN1^G@PJ#GPV)(BaH@hVQQsKTX`_`$903 z@|+>=_zx048^hl~{2cK+Z$GU$EEB(Qm;HA9e~kD=;`pi0ZxO#lJWKpG+zY+>B z<-8ulA0mE(xXbtJiDzDZS~)v;pCP`HxTF6tagVqw=U)=f5=Zyc=Wh7lQl6n0{X@jZ zVz?Zj6Z*X|K0i-- za>-w~9EazQzexvLNT%lqK3=!3tq5ALi^ z^z}gIE202@4P?Hu5B{n?xEqb5uLm+;6$SWfAoJCI@UQ8EdwuY``{0}U;9uJZzo!qr zxexxDKKQ+T@N6G^OCS8cKKT88@U4CDZGG^;KKS-N_)s4_m%y)}D{jj4;>@n+e_rvO zU3!Oq4Z7&2%vb_HrueQd?kv>PiudBcj?eEX{@MinE6~+9WqNU4$L9@-?@7@AxZ=Gy zt)u^};twV0_rhds%IrN|!1WCA~;_*4S_M#c9h z@QaE+oWTE7@dF9`WiV})v4S26y}r> zC+;lx3t{4=oX^Dg+)w;c41a|9&yo@k_){lm7k0_d>4nY_yNe?-Fa&yQcawf22_61E;$95@4dU4tex11V19|w7c?lX?>U)5I8)-&}pCNva zCCeNnelfT)j=9 z=(y{5bHKH~EL)P3O!>`9e~iB}nN@!KNk`A}yZ-g-#BUIHa{epg8R)w_4u1t)Ov!g6 z@eB4ka}@a9nO@w_BfdcTOQd)9>f4E5j`9B?;#Xq$ZxX*s-0Ab*5Wg1V|0=k=QqJo! zKGVc+5O+5DR3H4?h;Kl@k!P>|o5}nVap}kMIQ{t)aM9;Gx1Uq|y8er@z}1%WoFRRg z_z>~y#GQN|C4PgrtM9vrZ-8FQ1GUlT=ZSm7*_@gGN_;Fv|5CX4Ql6O@{R708i0>u; z2Js6q{CkLBBktt+4DlPp=g8+ziO;a$2Z+A_Qwu52IpR(~?YqoPA^-z*I-dnL#_tGie{0GVue%A0Ym2 z;%A7ziT(XU#ILa+_mKV{fs6h;8?%RZdzSB=ke@tb_K}(P3_n18gm{biY2qh{KTZ59 z@lV`lFMf^qMSRM07t8rqp7FnYx5C|sz^m|ESM)l-%%QzhQa8sOH0 zzLWS3PN`N&|C5gXJ_FjsKhy`mO8gq>yLz?B$~knuF>rF&O8gA*A@ZLk{tWRM;%_0o zfr{zm{A0xT5_fz)O1w#&)z174@pHuak$DxSxFXNX1f1Nah|g@Zf;`RgG>Bg(ev

2Z4iWzl@$%WfGsN#A{x;(0W99h(@vFo=(tnEh4dPDU zJoGooH_Hk+{1EXI#9h0zi7yd%<@{0NtHkeOzQ0BMEOCBhK1=*^jQ#;Ayp-oz;;wz) zO#B*gm+ub}zd`(V=KIUUVG{Kz6aO6XCF1uGe+BG_2GW0hAN(oe=Sc75 z_9K1pOT;gb9>vq=^L_BGuv1dbE3xtviC-mt7x{c|AN;q8Uysp$p%0#eU6Xt_>@dbo z&JE&s#_;bYzLEGwmghh9!T*~05a~~o{uSsTlJ7<0mxznq6ui0904L{D#81cYA0d90 zxGVpMh@Xq$pC*2uxYM^Uh27Nh5O?(&A%2M>oNKd5qAUiS@QWy z;%CPUaOHmy?6NBxN%iBUz@?n$V)XLI!P4mWkp4XBou9MNhhF}6yzsviqd!Od*;u~M z_Tlr(q`yXbC%6C7hyKq=e}nX{KYpPP{TE>zl5%EtnRFce*Am}Ad?ST-7V)&mBKTq7r z>UP*)DbK|i{~Ym4F+Q`zuM&6h#&;6G{yM9WE6?u|-*C`yCx;qQL^TZwhW5h2IKSBQA zOgwYg07w4}@eRaZP5M74o{iCe8SJ~rXDEi}iI2tbqr~^d@D}j{#9e!R7x9xvqUHRL zz|-V>neN@`&r^k#9ev53gbi?|NDSTy-vsY%n(0A+_mo-@v$$yO*8&u zmj4HcUw*fhr};wr{3!9}C+znI(tpPB`F_KnwvWuly_EBJ8gLKs9mKDHivjN;-XOko zzcGFn@w3Fw%o=ck_F4ZlSE+cbtI%8?;`yH(mR@8Abx_l zYxn<5{50_qGW${pO4{og;#K0}#|WN%%mAnVuO+^h_{T^e5Wn;54agGzLE>Y?UA;a+ z{50_)(!U6PjO2Tf_!#l+#IF&5miR&9mkS0wN&FXxA2?~i9mKB_KSBH{;v3;7Nxsh# zKSzAD4}OgJYS9Q?zTeab|5@TE%SOMK{69y%pFZD0+^gDeSI(bv{E0ic z{Uz~>#P1-V7sJ1ia$btj?;-AvqHG}jqr^AV3^+;rEx^StUEzLFNB^CqUm|^$^uI{_ zEb-fk|99f&h`aso4;{2}UalLVljl6~8^o!OnRCQXHjKVW{=ZB73UMdr&k)~0!uOH> z<%cZaXNbFgy|oWMLHs)Dmu@pgE#fBv`~5Wezm@n6;!Y0lC!T2=;VS9>g!n3Pw_Yax znY828juD3ApYB8dKS+Ox^sasHf*&LKW><{C0rJ^Lyh+^A zm;2z~LVT6W{!!xDZ#3Xtl+O*v=d|IMsh|&hot5YG+YNVqLYervZ!z5I^D6Q4 z#9cYx=jh*I^zXKh%F2+T^iLCCdfI?{i2n-lv&3C}zvL0i_dN0I1D0Tj_}TOJ z+v(LD@n?y@n(}!E@yw4H{YCr8e2n--;x0aR@1vIQnI9t|?fKgs{$9hKzWp-sOTLxXg+;pz9Ibg{-pi>B=Il9 zJVEg6PZ@B6d>$fx`hA8sN#7uTop_e?KSg}wPaEN0;(tc`#QP1OB%haIz9IRZC+_&{ zB7T_-;_~%@-^sM$j|S<-e#TJeCp_JU{)b7w^s`34m&|^R_yyul{x8EkN85!s%|~X8 z`04-C7`S#RI(p(K$^VClpZI_Qu3!8X@n?vSkp2ZAkbJKb=SOCS_=OJ|p-1{Bh+iiD zB=Mgoe&FW}_+{dsA->_~4RHPL)tDDazC*-U*^Y;aUwFpoPm<3X@eRLVz((TlAnp-& z`u0nX{uhn#Y0`hn@h9%&u<`4yJkJt$`Y_!Ge}eeTFGb7q-ahyzh%b@8%<}An2^KkA zA-+W1Cq70&ZXkY|_+H}gBL2sY4{@i%UwxAGB0fXoytNPh9l$qb@DCry|JM~SIXL6+|E0K} zz<10GpTz{e3S8vxU9wkWr1${w6U1G6{T}g4#P7M?5_|=UB7ClW#D4F!kIX^h*w2#d95nug%11{WdpC2dg{h|HdK>9ltjDME+B=KFuo5WpzuMxjM+}V@wC4Px` zn|ywi_}CvAa0l_;dp$CAu2ic7gcM|wV$^YbE*sG7c z)IMMSxbP1W^hXq5OW-ZwBDd`Sv{$F8pFcqS!rvS2%K4kbFA;b1;(s9S{iD%8aJzl( zJ!Sk)W{mMh%Kz=eS8p@?gpp@1_rbpy20_Ysh4fF6{{z59A8s%n;>x)|`V%iQ{!XvH z2l%GYJtTK9-=8J@b<$s@9R54;%P%(I$_p*Q*VL>$=k7Gz&Ep;=p8YcBOFr)>e(B2% zcn|x<7l<#t((oacXSz=Q#OH{AEAi_w{G-GVY&1R}A^ra(e&<&h?&`atVf;Pf8(5xW z#ItndUB2H&{50{~ja}x0#Ls+HG~YiVKJ(Sld_PP4B=Kih&aY@%c{YBH(J!%mj}t%r zwT8QVzlr#ndknupKJRn%n++eakIWU~&%DNf4W$1Z@k_*=eC~a-mFG%~{!!vrWAtw) zevSA^=KDe72k3y`$$Wp8_zB`0NPm0F@;$l505>k=i9bu+$)QC2+I>;_?;w7I>or-* z^W(%lI`Ypl-&ew9NdL;@4RHR?e&VachR=|Gjre5>ILmr{7xAkP8R65+_Xi!HNyA858OQ&vhF@g8z7nQfQyWH~w;z{yoH>`LN+L-0PFyxCIHvBi^ z^8woV6T~lFGklWuk~pu@f7+C;UnBlL;{S{Ixz8B=J;d*Q!uZ7TuOohm^w&xM z?ZhwsrSYNJ$owhsXNWsH^N+-zC4P>4Uh@r>ZycW?zWP_jzil6xCy8JGYXf*qSmq*d z*QR8xA0O_6|9&6*FUbGS&l>+r%=gtW>>}qYe`|n~!#MFvpNr!4KKS<&zxa1X|8DaC zF!2Nb!vI&`PdPp}48Mz&d&$xC`u-j1uabT*`M>%t>GWHHOT9M!y%GK+8}iXU_%}KH z3r7DW`G2$ze%D*6SG=R-Dbnu(es|^@yG?bH-)8#IcZhqpnc_b{`X48LlK5Th7r)X6 z{{-<>PAEUd@(iFTB8LMnGzJ&h@0!GKyx4Fj&-27Leu?3qAfJyBzy4CgpSF+8-x5Fj zG6N2g|3jxO-)C9ylcZlFzW0>|IJ@z!z|-{nY0_uuuwTg7^V@ys|1;^Yklyv*8^o^? zKfro@?c1!J-d9?An#5mA{Oqd?cYF>LKS%r{R-88t z^#XhGXT*m#8Sd))>Tj}gUM24QqSpaWliRUA_zCivx#u>`@I1@&7UI{5pCx{t`033? zPji|1Pkrz|C*Hi*=&zE`7k@MLFl)HWca-=w;%_4T8y)=?qeu7G=NpM%CJy&TpPwYY z_dcUPF<|(g5kI%h@TW-sB7Bj4F_t&{6Kvod@jG`K?)dK^eunrxti64mJnZ-ssDAor{rOZ96nZg^6>?jlj zI5aZfD6dV;9GNZbJUlsCn3y{;HFI#eCM3CBp#YLf8-Fvtb!a%Zzfv#HEy*9ZpJ>$E z{%U*Q+RL2_shQ<)hPlxmpM7h`D`ljM>|Oo%5Ya zwOlAQ>Om!F`}NY=lx7oQbtpeFyHsrX<(XEc-d>n!l>H-(eVv5`zcn>KQ>x4yEX}re z6$;D6LKR#Fg%RTJ3O)I7+r)q;z{c5pVDF%bNojZ~O%Z-(*g$jg)iWHhlk1le~8Xe!E(!O;u`x&0?!Pm>V4tqORmetUZnu>x=%Z z-!{SLjO}b2IZV}RwY9-Y&?+MBPRC>{nNxmvu2n4gElWFD@w?5DrlzA|;@Qd~^yEOX zUams!73rHfC~3DV7J|y62!S0d(hi4m`7oYx;S41GT%#!zF|p)!9%`%{@|XQy&mChQ zhBi!%6$%TTdZ|!INx9<~D!#u`1!o!^^dRX+wb_wEZKiV5#Ca>TbR)mDb2=EWR+jy# z%GAzNGcXPnG2-!(j!brH&6!rCgl0KhY@*%5rHfiwD9WkXwR*`UtNPGwz1(P6G>0nl zQNfM2{6#HQNSAtPBbqU{*7S{cR7>-_s*ROGRis+L@X;t0YLz;^LGx>Vy&cJKM+HL= z)H0$x!;6hV3x8{*QuD<;$h%k$Bk>$yb!?nUAs*I3h*d5$I_*MZp-?l!oI*R=qpcO! z3N63gY1Iq$PPLj+jNHg#q1|W~tA$#vD4i>XVICunG+Ciul-h`0F9hvY3hByr5hll4vvGnFnrG@0JVz7kdVyki^5NZfW=AGLGt5TkCtXAra$oVD$vJrH=UN+0n zwPs14W9=n>5<{M~VysnmOf+h>Mt#<~6~?V+K%(Ti9W5O@rF3oeJW_;`A96!$$jYWE z9mdtbZ-t0bnB{g&EcvBV`-|wcJvBPwwh;JLC{(d&?G{zk zT^JlO+>{$N*y`H+R6ZY^sx%9We!Hb;Ay^BfVUk72=S?JqvLBRMm8K|f09Q?F73&ST zT&Py??@E=~Tw!f(YFE8e(`FBZeRmWb4SKe{P->fLk5zDNwz1GY7GRjKRoYXlCEv%; zAJ&Rk5%R-qYREyP+iCewCN#!WONlqvuKGgJ6~S1oh^_1e%jBlFUeFrdJ< zfsdBfGlwANzOQpblao&Sb{wy-V5*Wb9|%+JI$p25x#Q1a0+RH|c1=$DZNG#rl^-(K za%O2QsGuXxnHjoilH8;Z``uWJrBNyGn4FBkiB|4q4r`=-?V-kEDDSnKq{t63?`RUu zdUSF!ir$3JE;Y%bBBmT6@hY%$au4Plrj|Hvx0VGGn6lq$f}Ka}$9%CB zw^Saf0s6E!SLqpy?ynXXIqBMmu*K+1u_eI^?Cgr0;ao06J1s*IiD&aN4RE8#m@`N> zH8uIk$>(bN=P}hb^E4rYr^)5k(_(-&w?34bV@hrpW-(RFEEeDvxmsalo1dwL;}2un z6EJTc9xs=t*5=hvkwx#_q+i9mu$){n%$I5nOmb4w?Xs6MjliNM2jh%KW@RW-Wk|dm z7Plc>)O@}-{Hgm`^2LD)EInE0$9hDQYw*r1rSW*~xZDPpq=^;Zr zp*rTmqw9!xg_4u_>7`SJ($cBIVyD=`AR9s!;3WwMR~g4bgF88$5lSp>ZQMM6X!Suv z3UfE3d@y^MK(sKI6IL2!g^RvW>{KzaY^v&n6hqBU zkjtUhOd3&CvBo4S+Z~6yG1?G^+-OfrwI@X@IntdSp#n12InO56THOvh!N!XBuNZy4 zKjSEaTwW(1M;bD22R68cdqY^+%wvE9r-QQgWfsHU^E`PM%YusqN z?l@droA+m%#g+O#DBNNTHlMNA2%$3@8Wx;5QRFTslctN2l}fv`l)^box+7c)wOdKnQjnQ7 z7*2`p%X}@wVAp;`_NMA>1n5%|h6r<`54RdCq3)kTA0i)9zN^l+PILxm3Z=InKsd*L z^VG3}vqNFuB0ri~|3D-Pwh}H&xZ9-B)f*Ug;w_e=L*F$uPH)hoB;)v~nGr?I`CDJ((lw&ZW z=DetyJ29rP>{|7RuyP}o4?Nv|^WtzxcS01>C)DPsR>rJBE`=g$NKza)d*SuUbYy`BjP_KOPU)w)~O#xJg`x+NO0<6Ep(_;-{126 zE{%AWF6NpRD~`O^Kur}PYt5&CIAmb~%nC~qdrmgrsEtH2+jAq4>#)fRV3o;lBmB#t zb9XWU-B?ahjmgQeMZaxsO>#XCbEn*pdp`{i7)Ht*g;Z9UUx*Phy#EjUh@FG-dHAWtteG%Z+MScV!7n8AhKJ4WhK#RfT(+M;IwYKG$;$LdiJr zgpovp<#r;-+QKqR0d{7-5mef1Npa;yyB!`&AtgjYp=p&A!+4dbG zf0Qy(&;T=;8H$L-+$E*d(PV07Nk>otWRHb33W>&Q<-lM!}dk9Zeg;Gklh;S?g%{nS{3whs!En z2HCOD4g+pDf+yEonF@ueZXx9u9O+PEneeCUNpb@d`kxFv@OYzLElHVTMw3LCU+YNb zOxduD+3B7tWF{)vbFXvJ_hHKsdj-ZR+MFza_-OrmQ<6THM*_yTZ#Ddz%fppl$S9+?G3;P$4l%MbPFIKzO?k7dBJ#6D(0g+ZOT?X zhC$o1g(}6A+in`atTobd@Ske@?1N2BmL3pUJew zast-fakCxl=8>onwsT3)9hH@yZHkxbZMnc8CVr2$Fb9}g^-C$%y3ZcG)H?K|O)dQh zR6o4)C4IV;+i8m|w?HYemiTs>bf$S3K0^CX!c#tRz#uPdMTyve0D=E9Hgqm^_ar5a zz^=nsMUgdnn+?AK8we3;TuvDQN2devX=Z(A*;2g25riP-gGLoQ8HLul1~JEC*mlb~ zZ$#D)+?-#hb2leP9^rtbb()(d*@+CaCqFm$F|p#U%6wYTKsL?DM(gFwBBCIb-V(+Kn}!VbxLSFKoHt^`Soja>-{k;n>@ z#YjyITp^2g%+cAZ?>F~1TC+aFD&-)hljKGm&0(xcR)nMzNUB6ZN5|)7zQ3F)%4g#B zj&bZ;l}K88>>(%qBGLsDjcNm%$gyF&*=ZxUN>FUKlcBbpG?zG5WeluM>{;6{YjP>G zf&54fTZbrNuxiP6uRtt_%ybdxovC#jAo4m<1FZc7Fg|GsJMoWkvDOHx={eMzic2z#5h@$+;EpnwnL(}wMr!|sIXHa zWcw?te)&j)iwHH@CzcdIUMPD+34%N#&nVHdUuI9$z1<@kK^2ZEGppWwsn)5pmXkAj(=L@Pa2>5zaV8*z3L82ZY$;V6h~g$iybDXZfiIhmQ(lJT zkDcB+QBHD5BT9ze#*Tu4W&NB@SUfy0mz`0G`rdTV40N(T8Q)vc$O3uqAC5PH*=D0iBea;A{<7)fJQD|J{W z6#wQurc-x>$&&T@6@rfv-Uho=X9-tpw|*aZE#Fkh>VVhw)2RKFyrwhGiW= zRNW5qBwJGh+!Jfq1fdSp^NU<-z%jf}j}@>8dADM2jar7f?zUSuZ!lU+E{f%zAfgi6 z3Gs4PD@ZH>q&LvKcr<1bvRBq`LJxyBo{r8jY$3ITB6L$8UDq9-@`& z6dTQ;%smJyu=_LneN;u<@$U8TrO1+9X6P(qQ@l0H`^ew47<`xga-I=Pa zB}F%Oq*!mv;VeX&{PJDNW6Z#ABlsF}Y(lJWqI}}PjJFn-g%6Iz&13JnG;Zo<GR|mP3qL8C*P*V17NIXmbn@pZHZnucBNQpH{tPCX3{KM zk0WFuWK!GS@|es%TDnqHSV-}ebMBptu?Y$0dW8_?64o+bUT3IYsoeO$!IYl!mFqE79SWzP?(G9In_IF*cT7_)0ZwXtY}upF|&57~&D%v|?|Nc`Y1wq>9k zspEDIPURvAxTLj^PB_f@NI3u4@UZKV*(0h?V39bao+#ihF(XIiT$>)HO3|#ICm+-` zye@oY^7}-B+1Rn-N_XCqcsq;$fGmiQADNw=!m+d_4oTw-4bJogy8jicwRMOzWtu*8 zTxQZ%%CuSE4p-l_LPhu6&%53B^q*XWdq`QRGYZMelr+32R7Yw@np0AXn3FcVK~3uI zNJr=37=)si(x?`)Oh_k}SGE&1nJlR*7IG@+G-zz3fbF0XKTdFvvjFNXsSc|{(DzJA zGBGyriw`fC2b3C%by=d&tt4q3dAL(QRd1}+ZChB18xz{Qk~eV)FK0%2``;th2JUTl zXG|`)fC+WAV9_A9RfIY}3`;4>R-CWuWN)s)z#udvZ89A>b|DSCBQfU1bR&{qcl%GO zj$x><2?~ZF?9SH>kNGjNmJ`)t(A%JfIZm;vc4%6iizLNxUfzt1&kX0Md#;5cbel%WRzpQmY&Ixv z7)}n$oeBv(i|>9bmdoML8sb*iQJXTgk-6+Go@WbfK0-tW5sGwE8eXl__*2yeU|Ca> z6g3m4?$R5_Hj@-J@2yPPa-NDUBK6_!I+k1?lD4ck;xtEAHbiy)6?G>e{bBPo4#1I9 zMU|!6iK3iJx#~y2x$FdL#t1wZ|iy6e2INfg$asgjsx9+Jo44a*YI&wYA6H z?8B)lnHfD6^=^?~OD0Ag&Iug>HIb?Rhu)B-#nJ^=nW-MJ8WFm#KRxWKie? zOOutBo8q{Q**%&uEMw?JJvLU6xdoq~QPLnfE~-()FWDMlD`TN{Cb_O`-!gfuKE}hX z07uHfE(H6JbIOr&y5o=2i!$BahvhJY)=|pX7W&BM^-)s?OEQJi$|(s#b<4BQ7`^Pn zzgaeB#BoIi?$bbt;NIefl6fgth-Ge9xCp|sZ!uE&@qjvIl)w2@i&Q(8Yek)aNI4>d zvu-3gTwHwwYSO_iN!&`E;>XJ-X%Ncda~d&o%0Z>}BZ^WEZTgB@8fhSUeWq5C@Z8b8^9x0VlT93EtOKzeU4Om_^Pwt6&*8WO10l;1Do!YKN9dw- zuDN*N!^K7&%mV|vWQ)13r^Rb3(I!(G**G4~h)G5AFoJy(cO7uI+g0ZN{`Iqt z2|gUZvn)fc(&rdT0Oyw%7lnnKLLIZBX%x}nA%y~Nl&r-c)KDdrM{ZU^Ak=S#3M;2_ z(f8Y-<5qgw5_<;Z_-3+`^>k6$VZ}ehEw+a;acte0lhFJyUfJ-gSS=Grl;UZV1ThZz z@NuYk>gdZ@$^`3N9#*w?>qSaiHA;FF%ToeqaK zf6}?q%u+Ivq@};<#XpE7r`*ORQ@?+OOE>zg+@&~X5t&D$5?HOrX$!ks4|7Cb+0Z`$ z#!kBy!D0=%dtOy1eqqE^8Y^sm>&yr3N*f!?V4x&C@<_4Tu|>j^rSyDg!$1Xl?DZzF zb^~1lWu3voN3z#OqhpnuML?pYwVRTLLK80kgf=_>NftF_@1SfdnO->J%KaYNWjqlN2ybV09GkX5n-^ZZCEX)0}`AS2=rb@y%2BZ@ZgsBY=P@Ma;iR2rIf zsoQ8bB%0DYcTU%z`)FSt)<;k0nopuT=jIwmXSvJA8MK|UPwoir(z3w~8WSbRL+LP= z3h$!pZl^qUFluVB;XCC@&eTPfT+Oc)aFPx8yjtKSZ1bWH?@ex9>0QKTW7e#OgLlZS zS2Djzjk={A^1yLIcc>&^n6cqJT_|AEt#cMKR4`Zgc6PO){}YE(H}ZA3>!gUg8|(fIl-WGCWSx>0A$fp8mM2Scp4m386gu^wxRACB0#fbnQo;N& zWo146e1u*cld=pymOO$G@n2)ZelCR`7a?Q6ncY=pK8eK1ZY{6e$V{WDiPZH?J#rk{ zfIkMuk4J%Jt83aol|#3~j!U_#)CJ)&;3UmmUhejh{(_q)N?4M{krTNAP$MF;f~UWd zwtN`-tMxL73S#}1fzACeQ*2h6ej)`HQ{?_7w{vv{<|9cH+EfLT=`YINp}8F>Aj_y( zU>#WuL&WPz(XHrKlahEJOa{#B#EgH)v2V4n`$=!5W*D{~GvT`4QiAOhkJx(=o!sOTmB7L1KV5(Zh zMU%HfX_im)@E&jJHG&iYxJdzGag3MUTuX9jRoV!!(Jw!I3+O=BI z9HI)F;wwAmiOG}&UY%=|T#rg7utP<3oRSG5)79tV9wqL>Ia<|NyA2QF76j)Wi7SO2 z^45lo;mWobF%7q(=DA^p{vWP3=8JI0C1FJRu$7Ej@cIyJ>u=yz9vSDJQ<3w-z3#`Q zlWrkzp)cN44td<(=DId{>&^YR4N^nd$#v-HUX-%`TzjdKlakQBA#7f$1aL6*5_w3i z&!(;<58OIujfRm47pIEBfR8paCOeGfGF53lZ0AlhiC7)8I|;Dm5litixYkVfH&w6; zWk&uQwy$%=Gzl)|oYBulpAXvnNj%p4a}Yuk}A7#0^6Du`)8z6HZd z%}$B;+Qv>hr#tJhtMeuIr~}zAnW=f-6ViQ>VFN+p2Ebd&PqvM^v;lVF%+A1k%h;Au z;#>Yh0SQ@;sYf8kRi4uuz%~>+v0}HrX=hDy7SeRbWaoyb+;GTS#Rc)nDQ$c}%jIn~ zox?@VoiBEFmO}=Y+*9m`Y!2(LxCAmDBt(&yMG*D>WHm+aV4kk;Tf^NVDFviwE0j@x zEfm;F*m7|hHG`?xlqP)CF|wky({{huv0h7>QaP!Llf;hh(z=pk(2p!D_g3EJpscOD z_makLiPF#`44U4}7@agH?|+iYS%grhh;H>mwV`hgp?j!oVi}zn%e7W9XYm&9ybg(@ zw|0THMJE#LoHop0dqr9*@h^|IOsj61I+PfD9_3FrAP9ov->G?pi7hC~^S?K_+AWl( zTPG>q^um;Ge0Qa@O^}rLP7beqN@4whYxkiHZq~NpRrDlXZd8;&Z~5<@FvIBNu7UgC zq`ePZtm|FfJ0>KeqM0NdohT|stVB^~pJ0L!m6H%dlq6#$W>ma~M3Rt%oM1u>T2xe8 zQBg<5h)Qp1rAn1+X^U4{sh3(*tW@V(wA7$tMMXtLrIuJ~@B5o)tv!pyyeGLjpU+A5 z{_ZvFx1Qhgynp7MnRlLK)i-9pd4)LA+&%t2=`TjylgBsI(r!1qkTm_S$v4DBLcC~^ z&r_i>c4wb^H>DVeXX8>O{95ef#P>5BA0v5k&4Y4wH>m8Q_Y?Ri&i$8#cdoIPvoG3a zFUjASC26rcx+8til(yP+-PJbs|LLkyTu!>zNmXa3mo0YHGH!cMGcI4IS%?q(aSHCv zt310g8|mJi(YkxnaOb0HuYc+L*Sz@y&}3t7sBF1q-!121JAPY%+2if)_;aIc+`8Z2 z^0|{cPH|g&#P0nM=4~k^ccs~Tt-OzXGaQ=NY96z<3qIi6uE$#o<;I(=*{kF12+}y@ z=!Yint&(^~`k2Sx;m+h?@^`)^xt}>?Yqs+FjRCZHMe>&HLsu;>4%us-Y*qjNwvbC> zmF)Y?G3$Dezu&+|v+MVj>=uRbBQWwYw8lP!bKZ~pd+^BqRfvX6bn8`)`PwEVnPV|RA%c`tm;6Yq@ABt6L!qc!|66T_rW zsqu%n(%BGB1sgqRnIQh9nfOj4c|B-4I~|DkFdOe8d~tlG=1GEmfPV2|xVUZT-_B_O zhiqi}TYM%io0{fu{ua+~(T=+>$sfKZ&juNHUyKRk3f0EG5dZ$SYee>u#D@FdVgz^3 zA#o#Mxy?Q|0aQr&o_vhiefZvyzC^*1-YxRvH`>pBG4J7p@@#ML_-o%hJC#l+K7bv= zgNI*5$bK#$KKLi2aNA)`X6fG zbpITs^{oH~va1XEPkF&z+q=X1Kug5u-0_mcPAJmbkBzra<4R`wYx4#q^8JB#HoufO zlii@CMFZ@0>!azG5ZLwL9#>oucnz8)trk^_t1)(@c~FkGd|KP%YeFH&HGdc--Bu$F zy@fh^TQfT#-MJcgXa9)z;Nsn?*hRK*$UfI~r|kp7!>FdagY+{V75$|W+s^L1IDJ9m zl~X2v_|@nZN4R)5C%tlcTfEN7K7#qi_&8?dc6uzXjlVbdec9`>_}$6$!Y92E)5^4YC8FW^j`&%` zyS6}0=k$v5NiJ^O>0*oDPIetBfEt{V|_gIdNg$@yk7N=#wQUz0L$zR zhwQ5X*)LYSpg((WG;ZqlhU|;?UzvUKr8$KUHP3(a{cAFxCwqSGzh%#R;~TO!^dEoS z1C^SQrIzVjQ7t>2@+D{1xie7w|Xv7P8^oJf=Zi%glpqkqSr zqDe7vvMXEnugg3-z;9<~2h`YAWpDg^@#}bx z@RwE|z5DaG>0cgy-8;G0OT+W%K8R{5T(aT2kBKrf_b;k9JY<;#kcWki{#gz(*akzdI-=dGtf8F`w2G$H@1KHbj*=Z49(%(5@ z;I2R3c)Pa)iMuJhGk$ctv01(|`-Efmf%C5}*w0Phdm7$9Y23H<)#?`ou=Qbi|e2Fx>)!oCpXvQ6FS{`N8D7{bqw=>F)6ETBv zzMUOR(v`Zb8GdaulilBM$8+QMoc7$iC*IAU^LqhL5br$!bIk7#vdfNJb~J9W5MR=4 zY=qe^ga?7_t;qDlYe)I14z<=bD9U505))7=jjwK^5J zyYwDB`o`><%$lH4=+7r`)C|h;dSTN zTe(Ncj-`)h*8{Vk2#Ub0+Mn$S(raMcb=a&P;5Ufk04?8k;>E&j|DSzsN51iL|107& zh!gktvQX=fS?OLp`(C{qi?R>rWi{{t=Gdj&*-F(fhU|2ru}HaWbkX!ZK+Yg+7svrC(KADU=! zB`?G{oo;;8HG9qd@Pn@R-|>CL+q09+w?FabuY8g_v1PBJ8n=DEzZ@Rm+ra$5{ySn{ zo!unl4cQwW9O?)1tp2z|+><}&(d?~*Y>)MZ*T(lR;?B2?>uaq)5R`papz&c(xxb?B z`(AkOy9jBA`++Zl><4esFDJ#PNAI7gKbpUOUhr7@R>A!z-S1`gf%ao=@BbJUeboW?u`+ni_}xx4)yY zqrI<;8~McTaZFc;$MJ_X{;%-D4=NO%ll{lX3HY-!)<&59|0(z*#?Qb9%;y~ZBTe7Y zkxX4*2LG5$|Iyihd{n?AXP59v@loFY;pv%?|2^3si!d4jkNnEVP0zX$#s}~ZljcMH zl@rjbW|I>Ft)SM=)NCtQ8XIX?a1KHh;G zUd`ciIeZ@6^KXN5e%aC;(Z_z0kE0y@agM&wnVuQz;YHbhe6)kddQiS3dfhM8M6Y}Y zJdPJb;@|N|sucVSgm;3+e)0>2cY#OFR|xMGuE)nRc;r`ozi`!8z#~sd{Hx-xqXr&6?;*_o zf5rF`{%y@T_r>er(a-Q9-!RS+o5tzCZT_ox!jAEE@ICXP{=hi(N9MB$pJUULUvwow ztmhf&+YNZEXXU-0ko3{#S<#P!$NoY2dJf;u;YT@qzqeU;E~~-E{`1nGqOS52@W`qB z7CgqQ``hBDB%c_s@?P-p`IPKGJ_dxpOZc$xuMs{iT=&B@;hJ+5oa=TQh1bEk4$1d( zd=AX#5I%?ILw@n8Nf6`x2FYLPYw~XtzAjw#JHo$N^rty|`qP^Js^1j;Zt*$J;RB!E z^wECq30MCk;Y;FwEnMq%e@4?^`J{05pUL4H!rv)%Z-jrF@b+@EuKFJc*Zv>p@EhUk z-}a!j|C(^sZwl8ub>XT%6R!I1M^jzy=WE6E_a1QW=gDi}u|B^}`f~^#+x7PdKLL;J zT6yXD&GCM>=)1tf=lg{Bf`^ate(~uR{eXVt5uYv5mtK(kAC9Yip#i$VAC3#WoTKm0 z(a+}a?Hr%o9DU~tQ%=v*4<74HxAz%vj_aZ`jcXR1>y~`M^jFX?nx4D{9{vBf($8Jt zKO?+tAmxvoKP$WwJaWD#B>1;3@EEW1UeQ06EF1sZCwk>Wq7R=FJZD7o$}6V7g1%~c z@(I(QK|f`B@)^@#KtE@C@&(i1K)+;q@)~%|%g<&1@v$oW7ldzu$GrTa@WUK_CO$`^ zzY_k-!f(Z=F1+KjQnIM~pN02=NB&k3Or!0^pTa1 zb>V*~d`r0cUxIti!soQkIRNfCD>?dk(QD3{@IRKEYr^m31P_l((O-jm{`SvpoxdO4 z^N;4}XGO31kHEd|agNWq`24x#zsk{2uoLYBX_+N?7rf}_B+fdWzeWIVq;pgBy z9u;sry#)8;TIXY}{Y&7kAIRZL;-lvSE5hIWL8(^!@2+qi*T##Rc~pNaT=n}eY3ko9 z{%gZcej|JfJmy`mkL`lTcCGwKeEvp!F2Q4N9|#|OY3sTb@Q3q)^S3eZhkXXG=lEO+ zf9g|Gt@z(t_s6^!K0j$5`h$1o@B#4XPgTbS9{o{10v_x9S43YC{uIeMA^hh>KL!4< zKgc-^?)ewQ=SF-^z++x?ot%QlxSl3?&cI__$}h!VU#Hv%{}ZWu3m*9&%Ua%@+FodT zS+oDj+rgu6>eB)4{V#%h|4ZVdeeM>Y=VUeb=ocU5<2ig@{G+FQ)N=ecb9_#6_)U&~ z-$<$yebAgk;L!)=W8l%xImx*pT=VaW|1)Gg?1{hfdXD}$M}GqzH8s!h%bVl+D5*OF z9^+D80grJ#BKlMD(LUUWkMgcBNOiqGeK~wY_?_!`IeZ)3=jBrL+W+Dgraa!C?i}7H z{1c@QW#P{iz5*WO)$Mmv_}6Fu_V6*9{>1IK9ske<9{ZoiGDcnk_wBR`Jo-=-|GpeP zlH)U)qp#-Z$8+>kIr`}w{alWIK1aWlqhHR^kG>)`*0<|Pa9=-j;C@_K0Qcj<4tUJ_ zd!_%!;uEh!i}<%w@lk#zKEE$Mm%`Qm7Tojqy)unA^62?|zi{;#7Ot;f#)a#4Gyxv$ zQCa^p;NG`caPQl?`1gy?A-J#ex^UgkoPhiKKNGI{!mFD7`7Ej13GV$I0FQCSeDPY_ z5O|DB`H1*mWdFv;q;Q>=8R6Rh_DXtY^x;L4vjaSGD(?f2dDn3b2-p2pRk+UY6gbBl zb>cAt&he7ZgNMiGNX{j2pT}kJczzY$;lCv-4OnI>D!U;mx#|bIP*;K zIj>IRVjl8#@EDi+^ntt2V2;mFj?bcS?c0X%VadNG{H4NognuW;lnrSYJaV>Wf9G}k zJ@Ah+UKgLw6aRDJpD+9ZJl2D*tI`*zezHG9$kYYSK9hHYN1t`PJ;L>MR-L$?DtyYuhrs)dm%#_XS(iS8#_2O;oIWGwzYhP3@m}yT)@XA*nF7t z%=FvHbYXh(OK|VcwQwC**O#RA%sgBt-NsK)w+GzURj+aC`^<;q8Upv6qd9!c{OL21 zqn{G4<6RZ5^SBPqKD0kI^<@*B<0aqD@i{Rc_Vd*E5d6=~pZas-)L)oS74y>e+LYJ( zSp?^}D$sX=b6oW4Hcov{j(?wU?emcNOrdTS-1nao;LOSOJZV1UQ{X<{8S|MypJ&a7 zd@jdl*?i{UQ!~B|zG9s7xC+ib(`U^%eb$ZBrw;DpJr%C~KNqg+yuI3bopcFTpB~}r zGYHOcael|ZeSWLpoZl1lZN_}a=fHiu^TPFW4hzEdysjqvBd`Xe1FPW7Q;L(>?6D5c zaglGBz6|}Q>B+aiJ^x+~KQjMb_#c};`3bo9`O16-;B#X>wXFtjNz`Z{e@TkjuPt>h~M_uJ};H*1=x(nc}OTGl|b!+BRgU^cj zkZ#$x!oNcNPsLx?$r(7uHTATV=mMPMBEJNWJnC}| z9^-wD>_2aW>pXUjr#hj3t?0+Vqc>k7d{Xp02MLF1;r-cj_*fCH`gP$yA^Jn%TK7cw zoaj%%W4@}w&%mQU%CAJP?=N4AUU~T|(nz8|UoL%^6|OnggzM)F3;##*;ry~cZQz_= z@*eQ0tNz2n_5GBpaMe!<*Y}TBg+DIiIux!xb>TlIeZBzQ}h?zYqPM>B$ek zqYt|OxfZVdZ=Xp0488WJ8$9~2`+;6?=08N9GC1>-_k%|t)MpSp>gxVvNVx7#M!;FO z{PaTOF$&JQqxkc z>sa_NWm)+ccwPEaf7I(#^H5~;2iH1>UJ8ZPYImkrM}BJ^}XO; zw`~3ksM~LxJ_F`Y{h)E`N5H-A7`Sg=liRIu#I>Kzkb3j&b_znm_e>#;LD^d)*uJ zpF!PQf4M{Ujp~KBj8+D^cgiypNjcYKW3czDR8g5Wd7?I@3L|F)Xbmy z730)zf_vRv@HpPh%kk(0oPD7Gsd4(BfwTYApBtzC2Hf+sy)DgS=D&@)!^Y_|V*b>R8mGPr?saQ9 z{wv1o$g^ht zSJHF7HZfoQ#@YV?aLyO?gT|>J0r&ZuG5>wkoi$FMIrFD}-Z=Hk;9j?8{tKwPVw^tf z=1={Gaq73gz3#U8ucGdbar*3ums>^L~argU0DU1kQP< ze%Ltmqu`!r5>8XwX-2jjEpuF#ETl-gptN&pR zzX12+&Na9nN6LS{S@+G-w;|y=?<3&hUzPEWf``BIDdBoO|3dury6ctjlK9^W*YmEC z`IJBEs{af)x6}3yOS)O(CGa_LZl~1G8>fB=+_%#e;W}SC!gc#S$l=F1{5*$W=kWHg zOXK$aMhV>4Ne{U9vmZRhtJ}q(@P91pX9PUz>V9Ti^gku@J0*I4CO49wi(dE79bccu z6?t^~9m?UO!nOYs;NG9P9Q|SrujTM{;d3(H1K~d+eX9%qQQ>Fcp7TcZIvfw;;dyY1N2{M?&d%vlv*YU0h*Ze!+kzKFP9Eo0!cbCHTcsKRU z&AP?Ri;rF5&k%kjT=nO|RbO3f`s@5I2-op03)k@;3)gj6`UkE32ZXDB0-XE*GWPS6 z#(CZ~1_&vk%Do~Jf(VH-TI z7b)M%;fLb$p3G+o>*2^abJoE*F6xhsQ-1;O;~M#v6gv1~_8%WJ;Ouja=O@PLKM&44 z)GrvPehJ+3Yzx=z?nwBYgTR+z+<~s-tn!CVLbf& zQXM%v!8z~b-QZDI-|sjCcmInVUih}Vb=y1A-`l}im%Ibq>z2%izXQ=_KIA<)K4tTn zK%Rc%?Ej$oQ$K8+`cZJ7uZsBV`WX`+bux#Xv&Of<=fp?#^Tw%P2KSt2!u5We zrEgF37VAwvZ{GzT>p^)1oco_M-l!|JMZ>^zsoXioc;v_a#;KnL z_dM(1k>#gkzD`7cXCA?0o$QJJ96Z*8@{aFHuBo zxqfawJXIJ0XMf1Yz$4E~B>$vvz5m9t`L};W@?SH5@=ftk|84LX*T0jxJK!-c<#lk5 zi~G-GSxNBJdqZ0|oK{ptJe)RFMle)bF3ehv%&m^F=yALZ9(_=L0nR*yXQX_W;LJmQ z1@3vSg=?PTO7io%L*T5tggy*|vo84vxYr#Ou5~NszX|^_^Cz#0kM?<7xcbkS|33U@ z&7XWueAItlxcV=c{~7!j&7XWpeAItgxcaXPpUc(+9|ywqyk#&>*0Tra>jLX!$T-hK zhQT?H)Q=daz6u`mtDnp>)d;WcJ_HE`v3XR8san?NqXHM#mj8lIC?m5rF zeZAd)`+8gaCxyl%e00672-owULvW630_)+(ICIv)IWFptjZ=RL?&CT$fBKvor_Y7? zQ-5ik`fG5ndm~)8yWW4=>|5=F(x2mhXNBwe`J(V;(eHsrKlOUoK6vy^`MLOfm-v)_ zIAsW*$Fe_mr@t2Z!NW)SU=AMvk3MMrDtN3by^cB#&h@a3^)Mm+ntxJw94e`w0+02n z{!8GIN3Xjc2|s)a2AlogMGkM`=72KN%QFQ(hctWpWYna4<7!yK8HlF z`KzMW^*IUd>vIa+*XKOAug?W=U!P0hJ}-yDHO~pS_p|V$&A!FFbN|q0oco7%aOR=D z!#MR_;E_{b?{tg*V_Dtq6r<21KFZ5E`u-gKP>y~$M_ z`q#nPf9j8oQ-22Tc}hQaci!u$+hv?SJ>aZMeV=ja2f)4VxcE1YBd9weKFY5|ANzr+ zXQkZN#`!ztH{zrETjSKX|9Ep=bpPA|&Uq=IZqYb>I>Ff=>PyC{?*{k&l)?S{VHn(x zUz0ifT>Ss3theER(`VZJsh=@U{T#U0 zofodhoo(Uzd7C;o=Y0Y5er%lU{1lx1q5jM`^_SqDv+#eVd5L+~>qVX5G4IMRz{5wc z7u|w0|2py)e&X)DGfx{h^Hbk$ocd01&p+@l?)vYd?x1n{41=>S^&`fq9|QNgljdJX z-6`YrnKpmwXN*(70Pb~nh3osvhr<6tw!2espWicZpWp87)X%7UDn5O}-z$7XxUPpP zIM+kr*~xd@ILA8y&UvAJ(m3_A;NG7(^Y2F8dE@k1GJooqjZ?n@?sZqqe+YHgjMHb` z{HfnCPW=wJ*WERLUXR@~AM$TAL&Eia%u#UPUdDv0ei1zKoJt>RIr;<9>-*Go z;qR60?n3yv@T(kN_*c#CTDQ{@IJeUU&WmyOxd)u{LVd4s>dW9hFC*r^j=H19=~FR( z>c@;zKLPG_Cxz>JI06s$6*6CSaQ0^(IggFA?g=>iL;b07>aV~(=fuChyS<#C?xgdl zC*2e{>ry}M9Qt{1uUj|&t7j+wW8=(!0?xYBpBktB3f${hQJ>%3Lfcv^VH2*T{9vP=k-TbLPHctIHxYxZf{}I%^ zG)|u@^QZpWIQ4~}O8xV??cl!NI>CMY^n%B{|ADNZQSrYs@4|mj*3Y`|UlyM&;dS9V z!dJ!T5Zu?{h3K{JwQ%)m-%b5-pCUNdVIA|*X`Fp7fpZ;F-({ToUT~k6via9gx8FE@ z2F#!OLF3eqf_vSH`4>@l%s73j=1={&aq1_*z3!Cxmr-}xIDKZ!pZZzj)Gva2-6iwi zM%`uO^r@LY^()4y-vIZzb#UMA&cJ=Uy9ST-`G>My+=%~w5MKB<&Fx)zQTQK;z6(73 z^?S#oqSx)ZCj5tFd)yQsJ>G4Db2}=c&pXE1w_R{B~9@d4&n&V>^oa>~FzU>)jANIkyPN+XHPW=hE&(}G)_w5SY`&0bs zX8-?G`p_j@zsKDp`~@=JQSj)2-mjx7`acu@Nzp%D_@d}F&n5W1ae@1|+V`5{(s?X` z$Gk+@{Wm3D2|W6*yhnWgQgZf#$9Q!;3<|#%{e<}Fxa#1{GlcWu6L97sKNbJK693}A zOXJ{ro56bPG|u%?0_S?8zRNiEec-;{s^(9hapUxvFn{VNjZ;4h?sad#V?F3~;KI+O zKE!%ZUIPywz0RWhS2175#@UAxaMq>%)HwB* z;NG|D|8sYpY@_bDar#Vxvo7^h#;KnL_qucLkGk{DaUEd6{h?oU4*e>)*WCb*b)x(K zUGP{Z%8$h7Z)E#A6aK%27xwS=v-FYa?`_7}pLTHelll(h)R(}0TwTKTxHACGb-Rf? zgU0DU49+~%j~J(Z4BYdS{(YhG2>w;se|+=_f7(+?v+ttj@X?=5n($HmOb)N*@O|MY zlBerGH2uFt_$D~}c7?ue8D}4Mz}YwIca2kj0PcM|H2*s49vP?4vH4SfVx0POaIbq| z{>*=AoIY3PPyMxV>I(F>G){dFxR1Bj{D)At&p3U` z=1+aUaq5S`z3zzl&!Fz8ar#uupZYQ5)K7wY-6`{5N8M@T^qDb#>Sv8pzXmN`0Gg>N~)F zTtncj%h#>L#_2O+{?v~er+ysV>rR;e0LD9MoIca$PyLK>>gT|{?t=MOQFqZeeU{9h z`eozPuYh~qRr8-i-8JL%SvP;`H;hxi4eoV!%>N48>8|;Z?}?9ozHwi;o>w1%`}y7( zxS#LcieBG;Y5Rq=o*WQ``}&1xgNT~xqqO($2j$6a9=Krz*Yz+b z{Pi;L^&EZ*&hegLKXB&!=_$uKILAx&d{z^|FJo)AC;Vg!oO7byl@@wnsEKx z+NN;5Kh-|CuajeNUndvh^BURi`hKaIU+=#+B3$pkR}-%Da*@NY!F^tCoTJaT;65*f zqm=U@hrS5z^D-)2=VeT|&da#)m&<%j3SSjI1@3*`7QL?jBjLX)J~zU(pOydAoEPQe z;NH&(=jhKQ_`|+oyO?qg{T#UWb4R%Lb5FST^A_CKXYrTQxV&$@;89n%i!ykOw=H{W zdwP0d5IpXir@SgYUnYH?68^aG`5e9i?m2hCV_bSX-50&`Bk}*z>^Xd#3fG*4UrCDS z!!zVKSOVv~^Y=Qtz&XFxG*4G z_lMOSJ}F%HlheX=T(jUlt{S+H>soyDd}iYRZJmEfxaQvwuJgME?sYFkuRb@zb-aaN zZRXMOmcV_yWpJ;%B0f6a!hdf1>wNVJ*PLU*b-SAru6?M1d!A#_tN)pB?Zbs|?ZYiN z_b2?mUfXdRS8PYIKOrxIbGy63{yb0?sC%0I$H%4c_X@ui{_mx3;n&hLeI1s;!~eOW9|q@q@%@w$aQ2OS zRD5)uRD|m~sha;B=4;aY$!El;Q}(yB!gaeS{dyX2jH~g+AsRO!T;C5}7G9Emt_s)R zyV($~`jP+AtgC!W_-n=gLiqcHFP}7hl<$DYdeiT}?}EqtDnA70Jno{;b#Trj`2~3N zO<&h{{nuum7t1;s7yj+S+kYeJS$7F_i{PwFUIM>YSGca99`Km+M`S(pf=7S!yk!VH z`lEbQ{6A8Bro{h2_8dNDa{QNa{8w`P*K_>$gzLCYz2c=Sj4jQHsJ$(-2IcM5O&?Pi`XS)Y^OK9B37*ScH6^}Oytxa#Y|RevE|k9Sw#F(!#wxCM{b zmCF0h(zs%M>Ul^RJjSJb2t52B%bwbu{TGjsv&R25?#rRP3Lf*T$BPN@@QL%%VtRUE z3Y@Qh$=5~yo=n?|?R3L9&(k)+xelq{GEV&-xUa)~;d)+F2ao)XJP3Mh{yZ-_5g$D- zIu)+RwF~f=mu{J`YvG?D{02PcOL^gU3XMmM>*GY<1|E9#?*Qkxrno;eUIQUQIX;IuK1ZT|p5!?d{wc!Ggnz2=b8z2|F2JJ?>VE~!c^tv|xi-E4 z-u8QGE;zr`cNnL>6Fl@d@y0aORNky3zYXqr_JnJm190Z4 zqwb;cEAV4*=Ar)7IQ8e?p65!q=D7i9p7xJT^L1;y4Br0xch@uZMdQ?$z&%foaLv;P z&O9TiTQ~#T=SH{S+^H;`;Aw?hrpSK`Vr&QSHL~b zxNyxg0UpOSJw8r>Gv@^IOdHKBbuzYOjKDO1PffVySp#RD3hJ&KuYqrZGY|FK#;M-{_dNT;HO~<^^K7DS z-T2LOQ{PU&nTPr_~tT=SH{nP&=h2aKRR)l|=_^*OT-?Tq#;C>xo1Dt)^MSnJp zm;YXxza4P)jru*~)E|KRJl2J4&SP*tUpfV6&LQMEGrkIb1)@W} zRJi6j2WOrd>RuQ>0lx-k9_nw6Q{Q&kdOa6~Yn~D~^IV~Bm+{i`l5a0K^H5(lPW=G5 z_h(qR<{1Hx{ebTGD&Wl7i#%21GvJfp%t`&Uaq4HlJ?Fe|&A9~5JWHs%Z2Ss*1)O=P zUo%eqI=JWA60Ui6!I`JIUgsUcHBSkgc`i`5%Xs-ylWz|=^HASsocc1j_h(SJ<{1HJo*~p7HNFi# z2F^Uxj~l0c0^IXV3)ehz;LNj+y7R`*z!$-phx%pX)Yrg0&zf+}vkA^TSE##Xyw;cI zYX_WpsNXYA{XV$oITEgUPQaOG6Ln9G-+-TkGY|Eb#;Lyo_dK`4HBbAWrg1Y*>C@8R zJB&|(cY-qy^=AnMnIQ129&oeGu^Gty=&kgEM z8!vu(>f0~tT=VpSvu+J_%f>4YQl0^D=AnMbIQ1joo@Y$B<{1ZPo(a^QFy8%W$}wBQ%2pI@hk9EaOR(U zJayFVHGTtL24^1X2aHoc2<~}CglnEr@YsLqypMr1XR$x^W!(4@_#`-UQa^2+`dM(# zxgcC~E`c-8Ch9I5uY<3EGY|D^#;M-`_dMIeHP0?M^PHgWp7HL_Ono~5XCCU0j8lIM z?s?9HYn}^m<{3cUOXF4WYjEbF{?<74ZGWD|;dzR}HBSkgd1g?z%XkgE2b_7R?=wz) zKe*=^60Uhhz?o+ibw`aCUy#N*2F^Uxj~l0c65R952-iGw;LOvFy7R{O!56`qhx%pX z)USYho^|1xXA_)xPEdEt_`pEw&ki{AP`_uK`U7y!Qx~pzPQjU{g1TqM=fE$(nTPr- zTV*CDbh%uYOi~ehHj;sP8sTeGj>H(m$d z1ZN)Vw~bT31MYeDg=?N8aOOEf-MaCS&rbb00cRfS&x})l4(@rbglnE#aORmn-NIj{ z`s7RC?cmHqebG4eo#39QTe#-w183cJ)GZsI8BF;Gz?p~oA>-5!gL|HeaLqFg&OA$~ zJ7K&IJ_XJ^)Xx~Feiq#GEC|;;%izp&fx0#0-Jg^CvkJ~U)UO+-egoX|Yzx;sd*IA7 zfV%s}7r+m}nTPtiaq5r3JL?!XoO!6P8K-^)-1Dpp*F0O`%yWXeJI2dHX})&BnTPs)MO>n9|QM16T&smG&u7tpzf^k6Yx23=AnMUIQ5I* zo~I^U^Q?h0&lT!!7$10Xny*c8=AnMuIQ2W=o@ZaU<~agqo(k$78{Y;$0cRfS&x})l z4(@rbglnE#aOOEg-L}6<{U9&CB>lY|oO!4(8mGP!-1Bq`*F3%8tlNvaea08S`@xxq z`a$E=4}*K2ig3*{4$eF^)SWP12cH6G9_nX|Q$Gvtc@~6go@H?6xj@~T@uA@~U#sBE zL;bpO>NmhW&$e*Qvj@&RRn*-#z7Bo}&OFrDjZ=RN?s?9HYo1GR=GjKwE8{odH{i@e zec^wk{*hDP2JU%^!ZlA9IPH2HQLuY&i2vo7^zW&&OgIB?shx!TQ)K7tXo>}3VXC9n+hER9G z_!9UsIP*}yVx0OlaL=FJnFvcDV*KxUOl2$pLx-L zk?0q}IghKD$0cyiBl)uU=zX7R!u38CE5c(<^RWufx@V}n2F|+V>*AwzH-u~5P4n-5 zd8)i^{^Wb$kx}nMawGolll%k!Gx_=a4uZ!z(fO@_bG+-wQw8UE$tS>Les#R-<}(7H z4dc9T$)@>Jzh#{IUGS)@_bJ*p|0&cxG#~O~@zH)3Zd2dbhb8#58E2k$aQ27#4&&69 zz&(E-xX;%xxX;%(ICCB%=Oj4ukk5eoeAR`&S=P_F`Okep>dU41liz@Q{p6B^H z!6T2>?H8`=dGK$NPptp{B{_${z3wo$*Imicujc5tz}e?b^kEyEeI~DiM^4=?ivK(1 z_nakg&p87g{dtRwcS*SV?+RD_k#N-?gL|G6aL;oI&OQ{-hih>5fxM%TLVF)N!Rb?h zPYIkpw@TjZn;S8Mp;XGb|vk&Cg;4xmE-;R%H=GXb%2KVvqi(c2;WezVs zBl-KdI>CKhJ>WjBK5!q`0Jx8U+U` zz4e*@6zZ0Z)2HA3sUI*-{V=%K9Wnm})EzZWpNjcYKW3cz32?7FY5q4nPcTlOY4fLk z#yIu!;9hsp{JH;MG9U7q_~`bsB3zFPYv8fY^*nP2Jl31?1M!)a^Wl1qzT=r`ea5)D z(;piPbX0iUYnYF5;h!zXsTtutqF>D6^&Ebc!;8;Krjhdr8COa8JA`)&*Ylid;d-21 z0{8v%8n|!QXF2-I9Q{n}0J2A9d8g#8gZuoRg8TgTb~gK<`GD!BV>fqTwt@%bECha(@A{JFm!!ts67IJfHx zc*K2AHg4+2j8i`j?)!lW;kw@Dg}+tieFZ$UpDX$6qA#VPH0I+%^q(jCUWg)(>WA7z`nwMo!XJ}7x8PCtLG~XXZP-bL&#>?kc<5g&KE2?PQ}=KE z_)FweJ}-J5S55TFPrxIOuAghs-~8pLKoq2uHNWkSBy=2{iZ|cxZ=Zepf{QeX?EL z3V*5S+deik$R07?YWid2?;YSVUgbTahh;o@EEV=pA`NU$vG!n*Yi5K&&w`& zup3$7cnzN90le74X>K z>UFJE@Yt^^AH_+A^S)0={?4o5QTHZE8aZZi^!wn^f4xps2aoM>r+&sb_4D9fcM&}1SNG4$!u9t!R>5PwRKG4<^%vk# z_cZ&Dk89!Y72bxOY3TKL#5%yeZdvrtmHo*uIOmbSi!lPu`63?`AN{?Iig0}$F=hU9 z&q*VjF@N%T@zLKATM(}M|7Gx)7wu;rjKe7;V67KOi0_?qzF6TSiNbvMDi?vD6q-97VJ!jAsHe8>-Td~VDq z)^Fp{oBqH&lQm3vO=eEzTPi^GY|D$#;NZCk34$5)NB4_)a^4)pR)N=-*24yVQ{ZID*TtF|5f32 z;q%}zU-~*_2|W6*d=)(UJSOX89h`kGydw2^!#MMAg0s)mZyBe47u?6YZ~jHpJupt6 zL-VKp$T;;U;9j@wQ?dqRkKnppl!gC5k~DNf!gYNP3%?QlsBrZk2WOwTJ|~Pb{}ed; zO#QTR>Sw`yybHpAMb^)f-^tY`Id3!*#>8R>UWG&e*o_J55axEbOg>k zy;whW^Cv$B_x;i-c+}PXQroAdN%ifk2=3cgH+b~zOJw`%1!qofFMY<@hcY<(Mt#3= z>W9F+ZzJZUx?(=?Z{x$fY7-t_&!C9C3Gvm}>fqUNyeQEIb)|+rWpYH_sb=V_Z^%d}_ z+addbN#U=S{_hI^MbRIKzaC#sME^J9b0%E<2RQ^JN=m zUkCSfb!`5-T+hb2K2Ob``ZMFyUxItx{?ABFiS?}44F=Q?E?@ znE_{i$mhl9#WG(j!gal^3IBZ2Z-cY$2&!TFUV?L6z0hA7r~U@q$8~G|1^5)oX`Qgo^l1lYUFtiGQ{M^h zbxXqI7{f=GaP3boc&uC9KMaBUeq&7Zy1h?`Uiln&ri-?oLB4#-w^$g z@QRH065Nj$gV@PNo?jK8itrDYx?|w(vm*Mc=+}h*u=sBX*YoO4@z?%eh+gyD3fK8< zdo&H+=dl~y=doY(Rq5M+=#>u(*PJurqw~HfdgV3n=)blB_1L4}|6YyYPF7tIM{L6%2 zgZsSP3fG+NpP2>|FUeT-1mgqk!SvK_b9Q}pp3$ovsctLuyuiHs* z&v^ml;H*o1 zr*Z1Lz`bs-a9vkr;jc-N8-WIL_=xb&6aA9#ACP(35ROZ&4gVwXm=|3SXQE#epDW?3 z!f$eTM;K?1=);$YzDxL=yMwj{a2i zIMg@h`&_u5S6m9$^NMTXA1(9V_Swxoe68@V96llZ<)Yur;RiYVEQeo$$8w($|10q5 zr}DyJ5^+DXfc;w=IQJ*y?cg7iJxxE?+5ztK)gyY{pY-PF2Su;*yDnU}(<9-tGTvk1 zI`608-k&pY@6Q!D`?HJwT!XVeOUe}_hZw-Rlguyx0lr%-j0Ju^iA{h2v`5IaLrQ{uKKkczA0RN zc7?0YfpFD#ytvuV;q=GG{$~Fg(F&HT))zBkdDFTbhDwQtK) ziO0OWUXE)UIeh6YNgw;4uJp%7-`2nfjBkR+JnHL<6Y!|3+x7ZelPULC-LGoc7dDLZ z{BskW`!VXbj8ne{9(nY9^-#F>r*k^x3BC6J_-%=MAI^k7CrKIuxB&P5@FqUNRp0eQ zdUDi#j?7D0xc03d+PHuB7gUiqSMo!>q1$Ws!ZBjMjF=Yhwp6l}y7&uNM`C>-m30xSr2X3;$%vxh7n%!|Vvx^XCKMsy`O4 z=aXl`^?dRiJmy#DG4L3d@(JBK6JmcIbNN|b{ynlJ?QpZ0{8t)mvQbly1{)v(_@_ae(tq2sHQDEg*+@7;-qUi(uA554kJ@W`qA=c&2m-sqqAI&-YHR;KbvnoDw;Nd?l`;(;{z9n4qY=aM&|Gwz& zIQYk8<#jzz3fJ{~D_pm`_W6{bIV;H7VVre~;LJ&Vr*Z1L!9C}p`Ol#4k#YLe&7b;X zS_kTkYg}zJlBjBM|J_a5+b$dS% zuHTco5dW(9--x~_{1!aws=jj}iK4Eq{}QHW>UY2+Pc=QYvCenJNB93{!gW7?F8=CsE&4~r|3>sW-rc1n z^7%akkNi5n$KbJ^OX7bfdL3`=TazgCnrBP6`dkRt^?5B^*U9L&HT`v+bT2o#>eqzp zI@tyf_GWqAaVY#v!q35dUEP33-?Yy&-;wf!Ui-5M9(v_9aNl1QzBBo_z8l=vRS$Uh z==aEa#iyDq8|$zldfi`52-p4IWRA}axUZ{u(d)We691CqSr)za=ScLrPU@o9{+GTh znR=cc@aU)JDTDhu9~8ajIjtrC(Cd2Z|L!K&_1XTtO|JSy;krIoz=OS2*5QWmDdBtI zF<$LM9X!UXd}Jl%3B8VM96a>Or@(!EZir7cSvJJ+0)NEx)5fWv2ai7M`SXEr-7b!WYtGFdY>rEL z&kr@ZZZG}+C~;rUBj5wsKWqQTzsYw1pT2+G%%eF6bNFZupAfFsOSgn; z-$wsQ>$=B3+`11J;NFL8aPLE9qv@}Gm=&&lIQnNzz4qZWhhOIK!jCk4v=5`gwGSPe zO}*Bw{aE6@9yY+e58L40hmId_`fDHhglivWwwij)GoQnkbNHHY?Zdfn?Ze_vw65F! zFI)Ga3*7tA3+{bb6s~>P5dI*QYV7~7{#ENdw>iAyU$@qG3D-VM3fDgL{A6pN&7Vr# z*TWvT_u&xS`_Qx7^w&NN3)em@{hOv<*TYH<-^k%R!nF^#!nF@;Ki#@+_s_KMLqE9p zVF=v&uqIsluqRym(7xX~PiGGA$>IINwGZ>cwGV?o+q&-ILF+!8fqNe=!MzV7KiBlv z<8M{C_F>`Yn|fUj%Q<{axQ=&AxcXcR*FLoULhHJvUuxZlGPw6)5ZwE)DqQ=pDO~$- za@0D{c@Do8u6=0xPpy4Mg=-(ig=^o6_11mp0rx(X!J`k)k@JKR;rhD1DqLR|PyK4^ z{IfZHQMmS@E?mcZdfeLo;@4V__ZHm8+y3iKA02PEa2;=1_@n8mjpM?}e`)$?|IdZ% zxHe9jdL7q}aP_(Tjiz4t^m`M3VfKH|Nq=nQSptvoD&G>let%&HoafK{KEggY&y&dy z#9w_nPE&}F$^LIv@(hD}o_*2l_a-id>-QiEzuDTqUATS^q8ps!;^z{3jPrAez2F=# z^?k;v?+1_Z>g$35^XKPGv^XG=aKqls=NoB+ffbgzx0B$ z&*WwB7?*xdZ$Yv|G5I^c>e zJ8+Jdyl|GnMSk61bqd#Ubqm*d831Qp?gs{qbNvi~GY|E{#;G3#kDR){s+j)>#ye)5 zKI7(3{e*Gqr@+1LwE1)YFk?RCv*L4Szajk2e#88^A6PKXoJ-*BC-uw5sb2y2ajlwv zFZUb9>9cA6)NdK5eh1v^9)SDyehlvC30L5LTrU1jTF<^6^@96$)DIr(_Oa{?q`Pqz zlHJ1)Jo>483_SAd`kxf8+tIx6i|jdkTnPUo;kUxozwN&zQPllC(YJ$pe>%XuKO;Fl zlR11^xbA0`g=@|g;ky4{2j~7_8~fpHaIRbOJ@NTEIiEiR_wincf8&07?F)@oUy8r- zYjE#R>336eBaiBP!K44*Ed8Gr{#C*kg}+ny7C8H`k3Q^yvk&A);&Z1D;GVx72hqr> z{V#&E?g{F4g0n7p2|PT$LHgeVesB8{uIKIj;J)1r3s?ODc;wgduH@+VMX&4gMEEC3 z{xjjaZZE*upELC58l3$hzY!ljPvFMs{V!po^>y0^?(;YzdOhxsiC+04c+~xd>_0vR zen0&s>OM_A*E9&u@eWneGlsx9Uh-k^$f-V~;89omP!WFTxF&oqMQapZ6|SFG-xRLr zA(uJ4{ST6<_j4IMa_TzS24^3paJ<_AXCKJ-#Ygw^$HFz|nQ&cix5B?!`p}Mp1oQB` zsKYpqr=8%;NqxyU_1)mn2R)DKH~(I&hXLb!Uun?%sUI>j+y@m`d>B9{1fI+ z{giR)XTZJgtoiq%?woP@%$q;;3&yEm0{6Ph=FjuAnsNH9nm_ex#;M-`_qvoCyC@+5cP!|2kR!y?>bg68V+S2!C9BHiYYTcMa~xsax>a zKj{9m9VcN?SN9LS;M^Xkuul5Gx!sWuh>z|cMult6G2yy@m;z^AZr9VsIqx&z%tQUG zaq8#6eVr_rKd&P#8mG^)`BPsrPW>vl*IhIJ5%hW8IDIzFpZYE1)bD_M-CgtN`rk7j z@_q5q?czYVZWo8<&+YffICCC@a~`QbF;4v%xR2}H{Cm;Q3*+>;Hh=1Gj8k9uaVIxjjfPM<^b zr~b$|^{3!ox9>9bGxnX@pGpp|g0nwM=+C%u)|~`rf5@kd(`N?UbIzInI_l0Fr~jh) zQ@>=K`Wm>`T^0Yv>#|1{8WXb){&88~l<$ChKM%nDJiHF>=Z$CJk>~4WJzwVNi+_^l zG3G^IKbF9w|H=n)_;3!N&fzoQkyF>ts&Ksyxt8OzC3-!MZ-WQ>R_Vi@=)X<)J~;cZ zRK#`!&iNw05+Chz$Dd{evq#kZjr7OH-;3ZeUd>Yyu0FlOZ^fq{oZHbE*7JaIuFpYm zZb#G)8K=Gi?(4Z~{>3k946871oIVrgPyM8E>Sw{d?gF^4{}pgw|2yLI9WuXl;ZGOd z`DdxQQFlpr3EcfFqF0|eaL&sd`ZI5w<6QvfyimVroca}T@6W3F51{Uvar&&AKlK~N zsow$jx_jndMcsYl^f@$t>W_?5e**4xFNEv%egp37q~j{hug~KEc=-Q@oS#>P>-t#` zuJgVD&Ur7tI&Bx5#yPGnaLzmR+s3Ki2lqal2(QVyJr({7Y3PkW=fb~R^tZx)P4sPl zp8gVbzen_4;NH(g(d%|p1809$u})TubG)nI><{&8#;M-|_x@~~|2FFG7^ly!`BT4V zocbehuUj|&8`M2EPM;I=r~cG9^%vk?_tN|iQTNI?eXh-)`WxfaxBW$PJ?Qy!yKvne zJHdT>EP-=9%wc;egLB@=2f=;4O@c=s^t$W3`PbmTV*cbC;`3kA5F6Xej_{|+`XBhq zW*_vtWf0tR&Wir)#eY@!iSSL~zbX5rBjMWT6L9bIHMr*~T{rX3N!>2+@c9Vgz2M=a zyia_-SNc;HzAip<;Lpxjd~SRd^RfWWc_*)l&r75ad&0F32jG!kuag{uM}Fnk;-lA3 zI{$kL&74zs9a;isPVye`SciK3WI*_AvTUrYVd1)d=D=f2Ixh?0%){69i{OuB`sgS5 z5_sg%*Za%D_4R%Yoc`@!+=y9NG0y$K8u%lqOTKQLK3m|vzuE!!`Pvn(@3ZWK`#c^9 zSN%D7)YbWI`>PCO5001f*be>(#zo!@ zBjPhB+t-}%M`XKL5dT;YLzu@UaE^<7S$y<;kTvs}gU^QfkRRvxTnN`bT!P0u>UYR)$Yn0EpZYx zs|6JtR$fc&btB8d)+TpB9RvtaThq~WT&gK%MiW%38PrClE)i6;q8Q@Nh#64~6e`#?M*9jl?WdsA z2K{N+lh2E%{QnShwF3TI(Afb0bMQ^@H$!I|{0p$ZFP_%LeD+{}3ike=#-%);18>{Q zzlrtf5Ks2s4*N3&_C4UN=NNSU8TX^O&yzXrmq~HYkNFgIxbJ3y&a`x9gO2&l0-YuB z52F6d;GDx%ai2>AI+yN<`&=?#gU&4Kunzvu!8gSp&uY(l-WTr*y!}t|CZ&G;YvkW6 zp7Kn%d@}#xIq_6y^7GKSiF^jdW87)+lqc^KW?)agEbhMhda)|*zMHR!r*-i@VGEqs zk^A60Kli{7UDy6J6V4va$LD0Dxbrb@5>NT?KA{<$=VuG}yYo=Bcx~dbzwO|x+iCGs zfAVhdcR_zpJmtytPKtZIuJe?**K0ll9oByyob_J>XZ>%1^Zs^CJmph+zw{lo@|4!a z<9hFkr#xxj{N;S{G5;>{R0rlcDDFD=_h>_b`}ZIt;?}qQSm3s=ioYj|%h!GD;Ot9- z-mFaataB?k^Dl$5&b{EYp9TM1UaDH5%YT-Clj4$37VvfPcn&n_Vix<=CZ6=U-ZSE^ zr{}E~_N>EsaIR|zoOKuzcYnQq$Hg7jyb2xe>j`k~>&c+stJgbIfqNci#2wf6Hv+f) zP4QGW&d*%X_wNno1Gmm%(6{|k;I>~Dk8xKD^j8CKR~^<0^w$Ho{f2mqdoSp_ZkvHS z|E-{J`|ZGOzat*w?t;HN-y*gB((o7gH_4v+<%D>=4xSc|`=S>*+!qyb&uvBZ91-{Y zm`^~5`(*~4`(+lK`(+jUYjOXuFCO!6uiZ72N->{K@l+q?(*w?Y&Ve(Z0q{fh5qEvO ze@DcfkNFsMxUa{-xv#51-}5sOxaVh5+;MF`6}atZ#N)i(6i@T>Iox+Gfb+V)EFSx^ z0#2PR@f4T!Z1}3Y*{-MOs!`nQGH(%&{cQ(le@}z6za!!?{~7TZ_a<~WS4-fGy8_O* zo8YX&j=1aK`PmhBKIVJS;au&5bFNBnI9zAXNkibClSXmJwS80Iwr>@Wb5)M|dVSO$ zb;Qp==P8^6z2HBG`K*Yiy7BkjW8x`)@@esSPF{!pMCRki9QbFD&w_Z0oA6*;{=+5l z6qkGzI*%g%4RGr374UuWIJeDecHCc`;+`w-qtoK9$F==X;I=ZT+om_w?|Uma`+gdnbK3{b-y@HJ^K+!r;MAW1=kHr@ zh{t-~0cYLrLWgzR6_52Pz4@RHtWPsI_r(ct=HDsqzIe`0i#x7)7j$|s|7XBC|J~rc z@9h^)^T~Ouh{w83K<7(1eBdQL%ydImu~2=K7-<}kN3-vxa(j(1|9CBNpSY-1~~h5 zQ`~WT^*VPhaMyW3-1*pkF>u@85|4dZ4*GsSWF>Ix+z$G-zZ1Ca*TrMpyFtHQ>)i<4 zI$J^C_S=Emen&jU-38})UV2-;FXB1SBp%O!Uh$;Q-!F`S^M0cWzJUAfNpN0&r^I92 z1@SoNOR(phZ-{%YDys9QxaY_GzIa*}=egml^ZF#td2RydJhy^#f1MC_J`eW0xbrdZ zfDX@rPH>(Br@`6ZZt+;RUT|K=`^DqAF#t~cs(7jo*E=ij^}5b;;$E-$B6L{)6>!%7 zHaP3Q3tr7~dhlpEeEz5PrAMQ<^D%D~PwV<(?pm`y4Soi^8~le6cL1Duo)=H?SkLRQ zr~WMLIp_1RXZ_d2y)M`JF6>$7EpXQPJ~;C)z5Q@KJ+}?wj%(g1p6bbYZUW~#H-mGY zTgB5n51`IvaMrU!Jk^=@XTWLSU%)4!&-!17J^7M&oc~+mu8;e&DxT`YzN~|@FB{&a2>D*M_+3={dhA?zrZg(Bb@Vfph-1!8!kpf9;^Z zx}?|Y)*|kF8vARw)GF?L%-f*Dzwh5698}zMnGjQw72YuTw1aA8!@fdeG=v!wcaOon7%*hxV^KI3HNgZg8%5K-}wX*7BAnaM^NpaV~ z`(;Yp>ouQ&4*N0(&b};wvo9;+j_Z1^2JU*^5qCbeUklv!cg17{8y0Yig;Xa`#W=^cpumy9_O%2Jk^17I3Vsid*05AyPoD1=x`3J;H<+G zIOp)DxZ`@R<^uOzEr>fG+b;%g`&;614wr+z-#1%I=-d8Y;I_Xn9^>u=eV=c;LC1U#Iz0FG!FleL{(3%#?xWv#Z3x_XHjBHDwr>gC z_HE*EUFD$PuItE&z^&5}^ljf6xb3^dW85>~JjZ&)U58oqw@*BtZ$sj7UsuFkAL~@b zQ$BqEc0xSGeKI>_$~tJKphG?b9q!**=%l}2Q&s+R&>>%h&ht30Zi9aWd>x#>|GFpc zx-BT~rnu{1z6Bk|-2vx0vj@)ivG>Je{mZR+(y7kuZ@YNv<3RT1M<+P%!@Ia`+Kmj zfWHb}1^+elaT5BRhXwK2$3=1XrS{5 z(e&NzRyJk6)YQ=b18 zb9e(f{2bj)=#bxqeL7di6!#wN$+yL0+&%HM-m&b%E2k-i1B$ z+!6QuEUBKmf&2CNzPRgb`;tBvX>R)_@l-dkd}D5u`pCLf!Fi5#l@IJ$hjZed zw`uRYz`cL_#XX0%9|+v`74f*=N5EPCF>vnR8S#{7?K-QCG$;Pfz?a2SU)r)SKi0%k zAIUewQ=T8je%uvLIer0rPuz7|SKamlcO6Q9Gq1nvX8VS~ZQmju>vkUeMdag)wDZ|k zJ`HNNx%C^xosaFC0=Ipec+BSncn|7)r-0uRkNay+JnpaN_a4lxwq~uBo#6VX!E3y` zfcF*fe(@N08uqVZT{pyC&*tyWC+nuT>uEj*9o~m8fOGzDfpcA};Qt%>+ySTkMgiXf zr_OzF>g*Tr#uEp9p-wY6by~q!Ft?rHwC@4`RoI^ce?y)^tpWYwaju5MV}Hk?qqm}K zI+Nh+`*rB^e)|UW$>+d%&Toi&e!4V2o8q1y^DXhT?>ImA!8t#>;;{}5-<%gK)}ci_ z>9Y=P;H*Qtc+%&3JE2d02Ap-Mh{rmNiN`vOi^n=lfU^!W;wevFH)p|_&%Ai55AB!0 zX@6Hd<)fpkHb1-KUROo$TkeT_UFHq%JJ?50VV+yS`F?vDoY(z+@M@NmAA{l#^3l9i z#2@4%UWLxn$Y%;%|0{r6h#TOXlR5D?Z|maDr>eLc;?BqX9`rf?+t6pfc45!Hw0ujx z80)+KW%1NU*1r>+^*;mt4C*r=?sfU~>3MO-H6Mgd4|ImW-w0j-=bVp=$NgRvcRq8f z^OU&rF`p5S{aO@H_1VQ-ErYY~w+nQ3#huTR^4Sx2KIZ$-XWvWhc~PvB@=cFMaqF13 zh^PEH&nJRT^FXfC9=Pv+P6vJ4cLi?yZt)a%7=7#kXCKdr$3FInKUlBwJTLxWz2bx7 zv5(W@DIflOgEztd6Rxv!1v+c6|4G$8Rqif0_r*PM{yuaIoOQS_p4Q9z{2lSMUh;-- z&5N7X_3OyL3H(QqXA3y<=>-2Q?0dx@jpU2wFJ&}t%=8Vt&7KXZ9(TZQ0M#LjCy3=F{S-{?wTf zPjmYb=+DBQ{hEh8`*mB~alJ3rVb6YTf*-(YxamO`p6i@5o{ZbP+ z@0Xgz<9xQkp6fj$?zmoWFYLMA0dTH&1f1&~2j}&!D*n(sh`T;j&x5%0G@llKXdcAl zJlp_h-ENAfxcq(AoOp^$z7*}>HCel|-2$IUUzxUYxAV}Gl#XMbmdzWX~5d-it) zoc+BGeyG3Vu0yZhkGdDQ*R>_?I@o?YaNF;Q$2#l=eSZ#cFL3LW9?ARYxVCQy-1bf4 zF>bTC*W0f3wghgSa?rQ^iNI~&As*v)g7f;`C7$xBT{m^TI|F_4e(`uea31`lIA;c- z|I^vIxvuM1MLf+R?+-`BU1!^m!JhgP;_*6r6MP_x;m5pqs?Wa%Uj+YoTz{9uQ=YtD z-x7BpH?^*1ap!No3Vr^4x;x-}-MR*@OH*wL_rO1hJU790OIx$w0-r=*w#C!BSf5?k ze=qF!#8aL5`mXe$+$h!aCt%+Io@(Joqj-u-omO$zv+?id9%XUY)4ZoZXTE^9oz9bs zaqo#c?u_DY2JZW%Epg{#`|ZGOzat*^W7ng3K90Ms`RNw7zIm^B(&6i-N&%k&pU0dm zfKz9^fNzRB&o0$xD{!y(zPR(Z{Z8Pv-xH7ZDLr;DSHFn-8^GVsxdKnWYxko`JkEIw z?4N^vEBGDoHt29}yI}uT*!O_H4f|pM{C|R#hx#I(^jZJY1@_ahe>eI#BVIcPz-OVu*S{;!;Xc{`e;0JN!I|ftxcgYq z{r|qW`)J;$B+`0+1^QFqoRc|m>)+9w%m?m%Es8s??Uw?#{fc)+|X{W|EnxYuR-nZRv7D<0Q1AN03X&&8l)z62fayG`(a zh4XVi==W+KN@wzVdcDrGQQYgYeN*7JZxN5{Y7P2+|D-MGn3ti$_f<}S^L*|D=YFY( zdtH7VJrcO{9~bv}ZC?%C_LJgqy;DKIU3H!g+&VXczU^lNxBZ-Wj5{wL&zS}BbiQdz z)ehn{ao4A!JlDlt2lIR4DK7WdeQ@rtU2yKN#_u@TzdWCtz`3v6#N)Z$E*{VA9_V}t z=hy%^{~p;OcoX)^w7Bb2KA&H|t_SY(YDV03v;B?0Z9gv_`?vtk`Yej4I`DmrCGk`T z@@44o@4KytdtLr}ZFj_-zxf(;c+RYYb3fh%AIeKs`|myR*vI?gv5%#{bucIFV=FlO zSO))n^u1Ty>+Mw^&js$j^ohF;w(k$z_Cw;aj}>tCaYQ`!aZEh+u?ijbaYEeda=)g< zoxk~Y=&+A7;OyfKaQ5-0cY=N^r+Xec21^SJD`(RGq3;kyBuK{lb zZw7A%Zv^iIe>K}ssvc`tPMI`JGh>)#jj$E4pMxaV*{+;MGxK5*NQ zh{w5|5Rd)64$jvXGvcxDH^g0^P31oad+N-KJAd0Ri>ExBQ2#aX2Atbl;CwxGADn&M z6HoawpT_Qd2%P__@^2P*p5`s$DNpXNGC1?^5RY{mgFSVs;M^~>;H<+UIO}i=ocY`n zPwTC{-hc0GZPYi#(|XBwp!4{;gp*#8&Q zXHh)GO%>cweV3p^ehWIkjP>4zJ>zb|{tf8k7C8HLU)*)*RULMqpWdG_--QnE^Y_4c z9=7PFGtNV&cgqg6!)B% zFF;>^tPR#J@IPc9#gjh!cnAE+Orcy;DV5g5(C4SyEv}~!CR1L1)P1k4o>?U;Iy9;kL#TW=em}~y&pHVA6Lb_AI)!zr@HaFye=N+ z=dO61pG|ScZT`M|61T)1*L+(%#@z`zGs=HAaNqCk1%2D^2X6bOvw4$JT)zL-Ebjc* z6}KgD>$Hk{UAAuv-1hC_F>VJq?|(YQQ~hsauDZli{mIXWCyl$9&voeYeT)um=A_T_ z{Iqz|C+`+d`E&mcio0%pUu8(#^)VlVj*imWpiF@?&lzz2v1Y%ZZyeX}Pc8=T_m`H$ zosaEr1#bHl@z}4`px>+amu?4cowcBE`}M$WzabvuZU%k7uecR-%(tPVtx&7meegG8 zu6BaH-zVG++93yxUME~_px2|Y!2KyZQ|CqeK~O3w~NQPUE*o} zdHw1aPxDVc1fBni{WV@-zXE%{PPq;KY8Jzfb@7MJTj=w8y(R9tRdwFp7k7Qkcf?a2 zc+NNW9-N1~9<_io&(j5b1f1&~7mw?zipT57l(^T`t98wYdtK(U;&EMz;2Y@IvUrSp z7xv8mp1AXwRX*F|&d2;dbXezIaGvw~;_)1AcsB1#oX@g&oX^wZsSdw}^>)FY=lMC< z^E@9B_j)VZk7MFqulWRYc%ILI^E{sg*AY_N0xRIZh5YY>|2}x@cOJ|wU+?#U^L6C_ zIO7h2{~+{-#ABW3!CB8G=&+va;<0Y`V9&bkfU|CU;LN{4uP59upZ|^Gj%(f|p5}zt zg=TPG7g~aTujZjOaG$qr;*M+ka^SY_5Ks9G<9gHy&i!&uJnoA@@z}2k=iVSuXxP=oOsHI?*sISr+mn#!PEOQ z&hv(N%yS-`c`ku7&vkLniQm_|C+@zRZ$YP;)?Gf34Oj_HzOYVI}085cOE+I z%c6M7hjYGMV7~%;-tX;$b04*SJTF#S7w4)|JkC`QIOpmdIP>opk98OjPwQen=fzV# ztj{>~xvwV+_>6dpo7Uy)#SQ3_&q9aSk(=PWj@$z0b$M0Xao2T!bz9tZHopTM#$5wv z-1VTpC;huY-+Ti)ynovikM-XVIzDGwK9SE!oQHOB&O;YC=b;;%ee4r=-TeM@zqspW zJ^&ro?L0W^HW>AF-5(0v*YS$@gSfIE3EcKo@l+pP_b0%4-Jb$~1J0{Xol(j5>Fmpo z?lxuA9H=|zP4WGGZ=K%rBe~Nj`@gqsvC7CgU*a} zrh|_8^#Yw6L1$JvH-nD(T!GF)(3z9YQqVEK1s%NvuaUp3zIRLC^W*;Zio4F{?r*HK z`)eKdSHB)ES;u@(`cbD6@^OE?U#w$3UZ67_bll$=aqF17zcC;8*XweBy|1lfzEF^l z`)i#+oiEEFAM=$0olSA;v`S|?=$PLx(Af<-?b6u~I_4$KX{rzBuy)Uo`NY>#t(eyei%(2iMc~O@Z6KES~zs>#XqqkE=rbRn^)3N;BJq*HhkKsW1HhnYv%jr@1dr zuw8k&@8;Z(eBIq6`=tL%*r(o)iT?=l8G=3UKd+0Y{An*-J2&10eXlp|U-D+?^YeZ! z;$H6^C0G{sdd*Kjhxg~MPg)o6V;%RaGM>KtaQzc|19({miN6ut`iVDyyZ(v43A_tB zZwBuMe+xMC)LX(eOY(lynf$EGf%w)tSKOWpa;(|&m} z`{PXhZK*NvCGqCK`@~xVpA#=yTDWat;)YU@OJUuz`MQP%r`yK zdN)!3(#dPDTpqvhV)i_KHGi)7PgjRWE}R@6u8x;Z4qX_(P&)bIwQHpsIQhc&eEig@ z7hbq_Vf51Yr5_x=daARh=jjV0BQIXK`02-_SXKM;*K@B|K z(^IoJ`ec+?U?z>K8O1EqPtgX_*aN@$g6h6$cN^+OD~OH82Q+hq2aTyOX||=^158?_0dC> zeWdfbm#>Wtj}8qF<+F6{+@)*dr%q+3RQ~<5J!db65+6;$XV%N3wQYH*bVpM7&?kpq z%5oXL`t+68t?_v6w9RF%Jvln`T;JKteV3m*mF>hs3B~P*yOTq9hiZ4Ki#vVv;>gQG z!#o}iJYOCix%BDbk?h)EV`<#epR&o%HhBMcg}bDOPhoGx*Kj;EgD;+aJzfQq`+B6( z(f4}%F1;?V%f()?xrIsjr2UX*w|2cPG(R*9kM#5$&9L6o9L@8QN9*m?bC*V6u0AA? z-T7P?$;PdAw5GfEQzyH^^p#FtymI;S@Mw19K6+(*_~b`E{`?27W!J+`mrlNP^~%d* z`AdQSr~m%1uP&9|QAeR$tWnQDl|BET?91;X`nky8uS4noN5}B@>oWTP@iF}Ux|aTX z$M7G_Y}14Of0BLgb^Ez!{gs;cVgElphQE8u_+LJTf3;5h^j^O6_H$AGlXd+6>=^#j zb^QPQ82&SL{Qu$@{i9Pv z!+*1me|lfkas6Brf4h!U|-EsX~6u-TWe|o>&ets_U_xp*gUwZ%D zets_UPromT^-u59+t1HM{@r!_OWFI4_VaU*f9iFN|5eBE@2lhghGX~-)bW4gG5iPX z_^01zc-?+3T7RXEe|jI?ets_UAFJd4PcmjdKNtB|>-c}`G2&0w@&CXv{HN>qzyBEi zGj;sG?HK;Eb^K2r!+)-h|Hm@sy8F4P{tI>d|LHOOm+JU`?il$m*YPhO!+*7ofBO8Z z*X`$Ww#k#}o6}~;PkXAK|H2XD|4f1Z z(h>dtM}hzH5&hFYS6MIr)g$`o+(f_v#{CAG%|JH24>#cw9i2mIL{-sam2f}OZpU)QfHy+Xd7Yh8FkLbTu;NL3$ z*zfrLJG0LT)~jDx{>?r(^c?-4E%5I=qW^e-f4BVivY+!2<6p^so_f?xqwLR1-;`g` zI>poV=Unz>e_wx=3gUMSa4%7PW;ZSO!fNTtPj0Z9jGAw`!oM~^>2S~UVpDMt^bpC;(to<^VJ>% zn^FAklpG#$9{*lJ{_8K~ivIklC1U-C3-a%-lmGLXi2c2;&lSY)9L(dV`x8FwZ}zhV z@dxU}PyY)|`#b*c6~rG@{5uY$XZsufc0v3x#otr?Q~%OGS#E#FZ+c7p`Dwq9ufHYq z&;E}8mdwB2{8YX0ZzNj{j2y@$Vcl{&Ye7rS^y8r;iZD_`hBdzwctc{u9dIPxkls|DhoM*th2Kt1?XM zzmR>|-|K%<22zXPtUk%SR6Sz+Bv`Ni+jZh!tP}qu1@Y&O82_n)_=Df}@cM`A#Q#SH z@$Vcl{!bLd->4J+r8@C93gYi5ev=!b=gj=j<97<;_oah9d$`Z3|Ch2a`I`OZ--|PR$g7}TYc|x{xJm>H4f3zTe^#c$0 z{|D;C|J8!{?^K+!SQA1ry0fX>o&=sn-70m`niJmo#};9_9&<3W{(vA$Fr{(e_8Rf!!PXHNF_{QREc$39ix zm&gAO2hy|i_VXXeKbV#No%|!WpLzQ1N*>81f37J1Kg#s^i2mvOaOtg?FDw3Fx@pfI d|2X?fpMQz#&n`c8(SB) + +// func runtime·RaceRead(addr uintptr) +TEXT runtime·RaceRead(SB), NOSPLIT, $0-8 + // This needs to be a tail call, because raceread reads caller pc. + JMP runtime·raceread(SB) + +// func runtime·racereadpc(void *addr, void *callpc, void *pc) +TEXT runtime·racereadpc(SB), NOSPLIT, $0-24 + MOVD addr+0(FP), R1 + MOVD callpc+8(FP), R2 + MOVD pc+16(FP), R3 + // void __tsan_read_pc(ThreadState *thr, void *addr, void *callpc, void *pc); + MOVD $__tsan_read_pc(SB), R9 + JMP racecalladdr<>(SB) + +// func runtime·racewrite(addr uintptr) +// Called from instrumented code. +TEXT runtime·racewrite(SB), NOSPLIT, $0-8 + MOVD addr+0(FP), R1 + MOVD LR, R2 + // void __tsan_write(ThreadState *thr, void *addr, void *pc); + MOVD $__tsan_write(SB), R9 + JMP racecalladdr<>(SB) + +// func runtime·RaceWrite(addr uintptr) +TEXT runtime·RaceWrite(SB), NOSPLIT, $0-8 + // This needs to be a tail call, because racewrite reads caller pc. + JMP runtime·racewrite(SB) + +// func runtime·racewritepc(void *addr, void *callpc, void *pc) +TEXT runtime·racewritepc(SB), NOSPLIT, $0-24 + MOVD addr+0(FP), R1 + MOVD callpc+8(FP), R2 + MOVD pc+16(FP), R3 + // void __tsan_write_pc(ThreadState *thr, void *addr, void *callpc, void *pc); + MOVD $__tsan_write_pc(SB), R9 + JMP racecalladdr<>(SB) + +// func runtime·racereadrange(addr, size uintptr) +// Called from instrumented code. +TEXT runtime·racereadrange(SB), NOSPLIT, $0-16 + MOVD addr+0(FP), R1 + MOVD size+8(FP), R2 + MOVD LR, R3 + // void __tsan_read_range(ThreadState *thr, void *addr, uintptr size, void *pc); + MOVD $__tsan_read_range(SB), R9 + JMP racecalladdr<>(SB) + +// func runtime·RaceReadRange(addr, size uintptr) +TEXT runtime·RaceReadRange(SB), NOSPLIT, $0-16 + // This needs to be a tail call, because racereadrange reads caller pc. + JMP runtime·racereadrange(SB) + +// func runtime·racereadrangepc1(void *addr, uintptr sz, void *pc) +TEXT runtime·racereadrangepc1(SB), NOSPLIT, $0-24 + MOVD addr+0(FP), R1 + MOVD size+8(FP), R2 + MOVD pc+16(FP), R3 + ADD $4, R3 // pc is function start, tsan wants return address. + // void __tsan_read_range(ThreadState *thr, void *addr, uintptr size, void *pc); + MOVD $__tsan_read_range(SB), R9 + JMP racecalladdr<>(SB) + +// func runtime·racewriterange(addr, size uintptr) +// Called from instrumented code. +TEXT runtime·racewriterange(SB), NOSPLIT, $0-16 + MOVD addr+0(FP), R1 + MOVD size+8(FP), R2 + MOVD LR, R3 + // void __tsan_write_range(ThreadState *thr, void *addr, uintptr size, void *pc); + MOVD $__tsan_write_range(SB), R9 + JMP racecalladdr<>(SB) + +// func runtime·RaceWriteRange(addr, size uintptr) +TEXT runtime·RaceWriteRange(SB), NOSPLIT, $0-16 + // This needs to be a tail call, because racewriterange reads caller pc. + JMP runtime·racewriterange(SB) + +// func runtime·racewriterangepc1(void *addr, uintptr sz, void *pc) +TEXT runtime·racewriterangepc1(SB), NOSPLIT, $0-24 + MOVD addr+0(FP), R1 + MOVD size+8(FP), R2 + MOVD pc+16(FP), R3 + ADD $4, R3 // pc is function start, tsan wants return address. + // void __tsan_write_range(ThreadState *thr, void *addr, uintptr size, void *pc); + MOVD $__tsan_write_range(SB), R9 + JMP racecalladdr<>(SB) + +// If addr (R1) is out of range, do nothing. +// Otherwise, setup goroutine context and invoke racecall. Other arguments already set. +TEXT racecalladdr<>(SB), NOSPLIT, $0-0 + load_g + MOVD g_racectx(g), R0 + // Check that addr is within [arenastart, arenaend) or within [racedatastart, racedataend). + MOVD runtime·racearenastart(SB), R10 + CMP R10, R1 + BLT data + MOVD runtime·racearenaend(SB), R10 + CMP R10, R1 + BLT call +data: + MOVD runtime·racedatastart(SB), R10 + CMP R10, R1 + BLT ret + MOVD runtime·racedataend(SB), R10 + CMP R10, R1 + BGT ret +call: + JMP racecall<>(SB) +ret: + RET + +// func runtime·racefuncenterfp(fp uintptr) +// Called from instrumented code. +// Like racefuncenter but doesn't passes an arg, uses the caller pc +// from the first slot on the stack +TEXT runtime·racefuncenterfp(SB), NOSPLIT, $0-0 + MOVD 0(RSP), R9 + JMP racefuncenter<>(SB) + +// func runtime·racefuncenter(pc uintptr) +// Called from instrumented code. +TEXT runtime·racefuncenter(SB), NOSPLIT, $0-8 + MOVD callpc+0(FP), R9 + JMP racefuncenter<>(SB) + +// Common code for racefuncenter/racefuncenterfp +// R9 = caller's return address +TEXT racefuncenter<>(SB), NOSPLIT, $0-0 + load_g + MOVD g_racectx(g), R0 // goroutine racectx + MOVD R9, R1 + // void __tsan_func_enter(ThreadState *thr, void *pc); + MOVD $__tsan_func_enter(SB), R9 + BL racecall<>(SB) + RET + +// func runtime·racefuncexit() +// Called from instrumented code. +TEXT runtime·racefuncexit(SB), NOSPLIT, $0-0 + load_g + MOVD g_racectx(g), R0 // race context + // void __tsan_func_exit(ThreadState *thr); + MOVD $__tsan_func_exit(SB), R9 + JMP racecall<>(SB) + +// Atomic operations for sync/atomic package. +// R3 = addr of arguments passed to this function, it can +// be fetched at 40(RSP) in racecallatomic after two times BL +// R0, R1, R2 set in racecallatomic + +// Load +TEXT sync∕atomic·LoadInt32(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic32_load(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·LoadInt64(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic64_load(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·LoadUint32(SB), NOSPLIT, $0 + JMP sync∕atomic·LoadInt32(SB) + +TEXT sync∕atomic·LoadUint64(SB), NOSPLIT, $0 + JMP sync∕atomic·LoadInt64(SB) + +TEXT sync∕atomic·LoadUintptr(SB), NOSPLIT, $0 + JMP sync∕atomic·LoadInt64(SB) + +TEXT sync∕atomic·LoadPointer(SB), NOSPLIT, $0 + JMP sync∕atomic·LoadInt64(SB) + +// Store +TEXT sync∕atomic·StoreInt32(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic32_store(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·StoreInt64(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic64_store(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·StoreUint32(SB), NOSPLIT, $0 + JMP sync∕atomic·StoreInt32(SB) + +TEXT sync∕atomic·StoreUint64(SB), NOSPLIT, $0 + JMP sync∕atomic·StoreInt64(SB) + +TEXT sync∕atomic·StoreUintptr(SB), NOSPLIT, $0 + JMP sync∕atomic·StoreInt64(SB) + +// Swap +TEXT sync∕atomic·SwapInt32(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic32_exchange(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·SwapInt64(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic64_exchange(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·SwapUint32(SB), NOSPLIT, $0 + JMP sync∕atomic·SwapInt32(SB) + +TEXT sync∕atomic·SwapUint64(SB), NOSPLIT, $0 + JMP sync∕atomic·SwapInt64(SB) + +TEXT sync∕atomic·SwapUintptr(SB), NOSPLIT, $0 + JMP sync∕atomic·SwapInt64(SB) + +// Add +TEXT sync∕atomic·AddInt32(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic32_fetch_add(SB), R9 + BL racecallatomic<>(SB) + MOVW add+8(FP), R0 // convert fetch_add to add_fetch + MOVW ret+16(FP), R1 + ADD R0, R1, R0 + MOVW R0, ret+16(FP) + RET + +TEXT sync∕atomic·AddInt64(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic64_fetch_add(SB), R9 + BL racecallatomic<>(SB) + MOVD add+8(FP), R0 // convert fetch_add to add_fetch + MOVD ret+16(FP), R1 + ADD R0, R1, R0 + MOVD R0, ret+16(FP) + RET + +TEXT sync∕atomic·AddUint32(SB), NOSPLIT, $0 + JMP sync∕atomic·AddInt32(SB) + +TEXT sync∕atomic·AddUint64(SB), NOSPLIT, $0 + JMP sync∕atomic·AddInt64(SB) + +TEXT sync∕atomic·AddUintptr(SB), NOSPLIT, $0 + JMP sync∕atomic·AddInt64(SB) + +// CompareAndSwap +TEXT sync∕atomic·CompareAndSwapInt32(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic32_compare_exchange(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·CompareAndSwapInt64(SB), NOSPLIT, $0 + MOVD $__tsan_go_atomic64_compare_exchange(SB), R9 + BL racecallatomic<>(SB) + RET + +TEXT sync∕atomic·CompareAndSwapUint32(SB), NOSPLIT, $0 + JMP sync∕atomic·CompareAndSwapInt32(SB) + +TEXT sync∕atomic·CompareAndSwapUint64(SB), NOSPLIT, $0 + JMP sync∕atomic·CompareAndSwapInt64(SB) + +TEXT sync∕atomic·CompareAndSwapUintptr(SB), NOSPLIT, $0 + JMP sync∕atomic·CompareAndSwapInt64(SB) + +// Generic atomic operation implementation. +// R9 = addr of target function +TEXT racecallatomic<>(SB), NOSPLIT, $0 + // Set up these registers + // R0 = *ThreadState + // R1 = caller pc + // R2 = pc + // R3 = addr of incoming arg list + + // Trigger SIGSEGV early. + MOVD 40(RSP), R3 // 1st arg is addr. after two times BL, get it at 40(RSP) + MOVD (R3), R13 // segv here if addr is bad + // Check that addr is within [arenastart, arenaend) or within [racedatastart, racedataend). + MOVD runtime·racearenastart(SB), R10 + CMP R10, R3 + BLT racecallatomic_data + MOVD runtime·racearenaend(SB), R10 + CMP R10, R3 + BLT racecallatomic_ok +racecallatomic_data: + MOVD runtime·racedatastart(SB), R10 + CMP R10, R3 + BLT racecallatomic_ignore + MOVD runtime·racedataend(SB), R10 + CMP R10, R3 + BGE racecallatomic_ignore +racecallatomic_ok: + // Addr is within the good range, call the atomic function. + load_g + MOVD g_racectx(g), R0 // goroutine context + MOVD 16(RSP), R1 // caller pc + MOVD R9, R2 // pc + ADD $40, RSP, R3 + JMP racecall<>(SB) // does not return +racecallatomic_ignore: + // Addr is outside the good range. + // Call __tsan_go_ignore_sync_begin to ignore synchronization during the atomic op. + // An attempt to synchronize on the address would cause crash. + MOVD R9, R20 // remember the original function + MOVD $__tsan_go_ignore_sync_begin(SB), R9 + load_g + MOVD g_racectx(g), R0 // goroutine context + BL racecall<>(SB) + MOVD R20, R9 // restore the original function + // Call the atomic function. + // racecall will call LLVM race code which might clobber R28 (g) + load_g + MOVD g_racectx(g), R0 // goroutine context + MOVD 16(RSP), R1 // caller pc + MOVD R9, R2 // pc + ADD $40, RSP, R3 // arguments + BL racecall<>(SB) + // Call __tsan_go_ignore_sync_end. + MOVD $__tsan_go_ignore_sync_end(SB), R9 + MOVD g_racectx(g), R0 // goroutine context + BL racecall<>(SB) + RET + +// func runtime·racecall(void(*f)(...), ...) +// Calls C function f from race runtime and passes up to 4 arguments to it. +// The arguments are never heap-object-preserving pointers, so we pretend there are no arguments. +TEXT runtime·racecall(SB), NOSPLIT, $0-0 + MOVD fn+0(FP), R9 + MOVD arg0+8(FP), R0 + MOVD arg1+16(FP), R1 + MOVD arg2+24(FP), R2 + MOVD arg3+32(FP), R3 + JMP racecall<>(SB) + +// Switches SP to g0 stack and calls (R9). Arguments already set. +TEXT racecall<>(SB), NOSPLIT, $0-0 + MOVD g_m(g), R10 + // Switch to g0 stack. + MOVD RSP, R19 // callee-saved, preserved across the CALL + MOVD m_g0(R10), R11 + CMP R11, g + BEQ call // already on g0 + MOVD (g_sched+gobuf_sp)(R11), R12 + MOVD R12, RSP +call: + BL R9 + MOVD R19, RSP + RET + +// C->Go callback thunk that allows to call runtime·racesymbolize from C code. +// Direct Go->C race call has only switched SP, finish g->g0 switch by setting correct g. +// The overall effect of Go->C->Go call chain is similar to that of mcall. +// R0 contains command code. R1 contains command-specific context. +// See racecallback for command codes. +TEXT runtime·racecallbackthunk(SB), NOSPLIT|NOFRAME, $0 + // Handle command raceGetProcCmd (0) here. + // First, code below assumes that we are on curg, while raceGetProcCmd + // can be executed on g0. Second, it is called frequently, so will + // benefit from this fast path. + CMP $0, R0 + BNE rest + MOVD g, R13 + load_g + MOVD g_m(g), R0 + MOVD m_p(R0), R0 + MOVD p_racectx(R0), R0 + MOVD R0, (R1) + MOVD R13, g + JMP (LR) +rest: + // Save callee-saved registers (Go code won't respect that). + // 8(RSP) and 16(RSP) are for args passed through racecallback + SUB $96, RSP + MOVD LR, 0(RSP) + STP (R19, R20), 24(RSP) + STP (R21, R22), 40(RSP) + STP (R23, R24), 56(RSP) + STP (R25, R26), 72(RSP) + MOVD R27, 88(RSP) + // Set g = g0. + // load_g will clobber R0, Save R0 + MOVD R0, R13 + load_g + // restore R0 + MOVD R13, R0 + MOVD g_m(g), R13 + MOVD m_g0(R13), g + + MOVD R0, 8(RSP) // func arg + MOVD R1, 16(RSP) // func arg + BL runtime·racecallback(SB) + + // All registers are smashed after Go code, reload. + MOVD g_m(g), R13 + MOVD m_curg(R13), g // g = m->curg + // Restore callee-saved registers. + MOVD 0(RSP), LR + LDP 24(RSP), (R19, R20) + LDP 40(RSP), (R21, R22) + LDP 56(RSP), (R23, R24) + LDP 72(RSP), (R25, R26) + MOVD 88(RSP), R27 + ADD $96, RSP + JMP (LR) + +// tls_g, g value for each thread in TLS +GLOBL runtime·tls_g+0(SB), TLSBSS+DUPOK, $8 From 45e9c5538b3956d98ef0337fc19ed8d45eb17090 Mon Sep 17 00:00:00 2001 From: Hana Kim Date: Tue, 23 Oct 2018 17:00:29 -0400 Subject: [PATCH 029/594] runtime/debug: add API to read module info in binary When module is enabled, the go tool embeds build information related to the module in the binary including the dependencies and the replace information (See src/cmd/go/internal/modload.PackageBuildInfo). The newly introduced ReadBuildInfo reads the information and makes it accessible programmatically. Update #26404 Change-Id: Ide37022d609b4a8fb6b5ce02afabb73f04fbb532 Reviewed-on: https://go-review.googlesource.com/c/144220 Run-TryBot: Hyang-Ah Hana Kim TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/testdata/script/mod_modinfo.txt | 40 ++++++++ src/runtime/debug/mod.go | 105 +++++++++++++++++++++ 2 files changed, 145 insertions(+) create mode 100644 src/cmd/go/testdata/script/mod_modinfo.txt create mode 100644 src/runtime/debug/mod.go diff --git a/src/cmd/go/testdata/script/mod_modinfo.txt b/src/cmd/go/testdata/script/mod_modinfo.txt new file mode 100644 index 0000000000000..f8ad18f1368a7 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_modinfo.txt @@ -0,0 +1,40 @@ +# Test to ensure runtime/debug.ReadBuildInfo parses +# the modinfo embedded in a binary by the go tool +# when module is enabled. +env GO111MODULE=on + +cd x +go mod edit -require=rsc.io/quote@v1.5.2 +go mod edit -replace=rsc.io/quote@v1.5.2=rsc.io/quote@v1.0.0 + +go run main.go + +stderr 'Hello, world.' +stderr 'mod\s+x\s+\(devel\)' +stderr 'dep\s+rsc.io/quote\s+v1.5.2\s+' +stderr '=>\s+rsc.io/quote\s+v1.0.0\s+h1:' + +-- x/go.mod -- +module x + +-- x/main.go -- +package main + +import "runtime/debug" +import "rsc.io/quote" + +func main() { + println(quote.Hello()) + + m, ok := debug.ReadBuildInfo() + if !ok { + panic("failed debug.ReadBuildInfo") + } + println("mod", m.Main.Path, m.Main.Version) + for _, d := range m.Deps { + println("dep", d.Path, d.Version, d.Sum) + if r := d.Replace; r != nil { + println("=>", r.Path, r.Version, r.Sum) + } + } +} diff --git a/src/runtime/debug/mod.go b/src/runtime/debug/mod.go new file mode 100644 index 0000000000000..2c5aa27b6ed03 --- /dev/null +++ b/src/runtime/debug/mod.go @@ -0,0 +1,105 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package debug + +import ( + "strings" +) + +// set using cmd/go/internal/modload.ModInfoProg +var modinfo string + +// ReadBuildInfo returns the build information embedded +// in the running binary. The information is available only +// in binaries built with module support. +func ReadBuildInfo() (info *BuildInfo, ok bool) { + return readBuildInfo(modinfo) +} + +// BuildInfo represents the build information read from +// the running binary. +type BuildInfo struct { + Path string // The main package path + Main Module // The main module information + Deps []*Module // Module dependencies +} + +// Module represents a module. +type Module struct { + Path string // module path + Version string // module version + Sum string // checksum + Replace *Module // replaced by this module +} + +func readBuildInfo(data string) (*BuildInfo, bool) { + if len(data) < 32 { + return nil, false + } + data = data[16 : len(data)-16] + + const ( + pathLine = "path\t" + modLine = "mod\t" + depLine = "dep\t" + repLine = "=>\t" + ) + + info := &BuildInfo{} + + var line string + // Reverse of cmd/go/internal/modload.PackageBuildInfo + for len(data) > 0 { + i := strings.IndexByte(data, '\n') + if i < 0 { + break + } + line, data = data[:i], data[i+1:] + switch { + case strings.HasPrefix(line, pathLine): + elem := line[len(pathLine):] + info.Path = elem + case strings.HasPrefix(line, modLine): + elem := strings.Split(line[len(modLine):], "\t") + if len(elem) != 3 { + return nil, false + } + info.Main = Module{ + Path: elem[0], + Version: elem[1], + Sum: elem[2], + } + case strings.HasPrefix(line, depLine): + elem := strings.Split(line[len(depLine):], "\t") + if len(elem) != 2 && len(elem) != 3 { + return nil, false + } + sum := "" + if len(elem) == 3 { + sum = elem[2] + } + info.Deps = append(info.Deps, &Module{ + Path: elem[0], + Version: elem[1], + Sum: sum, + }) + case strings.HasPrefix(line, repLine): + elem := strings.Split(line[len(repLine):], "\t") + if len(elem) != 3 { + return nil, false + } + last := len(info.Deps) - 1 + if last < 0 { + return nil, false + } + info.Deps[last].Replace = &Module{ + Path: elem[0], + Version: elem[1], + Sum: elem[2], + } + } + } + return info, true +} From 160ddf76e397557a4f05203e9c38ffd43365a65a Mon Sep 17 00:00:00 2001 From: Samuel Kelemen Date: Tue, 13 Nov 2018 17:59:23 +0000 Subject: [PATCH 030/594] cmd/internal/obj/arm64: fix spelling in arm64 doc ln5: "instrutions" => "instructions"; ln159: "immedate" => "immediate"; Change-Id: Ifb94a9c145d1911ed92f12883213245beee2bd67 GitHub-Last-Rev: 78627835e76c6d837a72badd5fc28ba27f0a6ff7 GitHub-Pull-Request: golang/go#28776 Reviewed-on: https://go-review.googlesource.com/c/149378 Reviewed-by: Brad Fitzpatrick --- src/cmd/internal/obj/arm64/doc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/internal/obj/arm64/doc.go b/src/cmd/internal/obj/arm64/doc.go index 7fb129989b110..73d8bb76ddd0a 100644 --- a/src/cmd/internal/obj/arm64/doc.go +++ b/src/cmd/internal/obj/arm64/doc.go @@ -35,7 +35,7 @@ ldrsh, sturh, strh => MOVH. 4. Go moves conditions into opcode suffix, like BLT. -5. Go adds a V prefix for most floating-point and SIMD instrutions except cryptographic extension +5. Go adds a V prefix for most floating-point and SIMD instructions, except cryptographic extension instructions and floating-point(scalar) instructions. Examples: @@ -156,7 +156,7 @@ FCSELD, FCSELS , , , # is written as $. -Optionally-shifted immedate. +Optionally-shifted immediate. Examples: ADD $(3151<<12), R14, R20 <=> add x20, x14, #0xc4f, lsl #12 From 62b850f1c50aa2532512085feb86cbe5d9c99581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 25 Aug 2018 11:33:12 +0100 Subject: [PATCH 031/594] cmd/vet: rewrite method check to use go/types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that vet can rely on go/types, there's no reason to do extra work to avoid using it. The rewrite lets us get rid of the field list flattening code, as well as the slight verbosity that comes with go/printer. While at it, make the testdata/method.go expected errors be more specific, to make sure that we're not breaking the warnings that are printed. Finally, update whitelist/all.txt, since the reported errors now include qualified types. Change-Id: I760a1b3b1f60e4a478c9dc43bd7f584a8459593e Reviewed-on: https://go-review.googlesource.com/c/148919 Run-TryBot: Daniel Martí Reviewed-by: Alan Donovan --- src/cmd/vet/all/whitelist/all.txt | 10 +++--- src/cmd/vet/method.go | 57 ++++++++----------------------- src/cmd/vet/testdata/method.go | 4 +-- 3 files changed, 21 insertions(+), 50 deletions(-) diff --git a/src/cmd/vet/all/whitelist/all.txt b/src/cmd/vet/all/whitelist/all.txt index 761f4ced4e46d..38caac3c3b356 100644 --- a/src/cmd/vet/all/whitelist/all.txt +++ b/src/cmd/vet/all/whitelist/all.txt @@ -57,11 +57,11 @@ runtime/pprof/pprof.go: method WriteTo(w io.Writer, debug int) error should have // vet doesn't know it because they are *in* the encoding/xml package. // It's not worth teaching vet about the distinction, so whitelist them. encoding/gob/encode.go: method WriteByte(c byte) should have signature WriteByte(byte) error -encoding/xml/marshal.go: method MarshalXML(e *Encoder, start StartElement) error should have signature MarshalXML(*xml.Encoder, xml.StartElement) error -encoding/xml/marshal_test.go: method MarshalXML(e *Encoder, start StartElement) error should have signature MarshalXML(*xml.Encoder, xml.StartElement) error -encoding/xml/read.go: method UnmarshalXML(d *Decoder, start StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error -encoding/xml/read_test.go: method UnmarshalXML(d *Decoder, start StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error -encoding/xml/xml_test.go: method UnmarshalXML(*Decoder, StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error +encoding/xml/marshal.go: method MarshalXML(e *xml.Encoder, start xml.StartElement) error should have signature MarshalXML(*xml.Encoder, xml.StartElement) error +encoding/xml/marshal_test.go: method MarshalXML(e *xml.Encoder, start xml.StartElement) error should have signature MarshalXML(*xml.Encoder, xml.StartElement) error +encoding/xml/read.go: method UnmarshalXML(d *xml.Decoder, start xml.StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error +encoding/xml/read_test.go: method UnmarshalXML(d *xml.Decoder, start xml.StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error +encoding/xml/xml_test.go: method UnmarshalXML(*xml.Decoder, xml.StartElement) error should have signature UnmarshalXML(*xml.Decoder, xml.StartElement) error // Long struct tags used to test reflect internals cmd/link/link_test.go: struct field tag "\n\tLondon. Michaelmas term lately over, and the Lord Chancellor sitting in Lincoln’s Inn Hall. Implacable November weather. As much mud in the streets as if the waters had but newly retired from the face of the earth, and it would not be wonderful to meet a Megalosaurus, forty feet long or so, waddling like an elephantine lizard up Holborn Hill. Smoke lowering down from chimney-pots, making a soft black drizzle, with flakes of soot in it as big as full-grown snowflakes—gone into mourning, one might imagine, for the death of the sun. Dogs, undistinguishable in mire. Horses, scarcely better; splashed to their very blinkers. Foot passengers, jostling one another’s umbrellas in a general infection of ill temper, and losing their foot-hold at street-corners, where tens of thousands of other foot passengers have been slipping and sliding since the day broke (if this day ever broke), adding new deposits to the crust upon crust of mud, sticking at those points tenaciously to the pavement, and accumulating at compound interest.\n\n\tFog everywhere. Fog up the river, where it flows among green aits and meadows; fog down the river, where it rolls defiled among the tiers of shipping and the waterside pollutions of a great (and dirty) city. Fog on the Essex marshes, fog on the Kentish heights. Fog creeping into the cabooses of collier-brigs; fog lying out on the yards and hovering in the rigging of great ships; fog drooping on the gunwales of barges and small boats. Fog in the eyes and throats of ancient Greenwich pensioners, wheezing by the firesides of their wards; fog in the stem and bowl of the afternoon pipe of the wrathful skipper, down in his close cabin; fog cruelly pinching the toes and fingers of his shivering little ‘prentice boy on deck. Chance people on the bridges peeping over the parapets into a nether sky of fog, with fog all round them, as if they were up in a balloon and hanging in the misty clouds.\n\n\tGas looming through the fog in divers places in the streets, much as the sun may, from the spongey fields, be seen to loom by husbandman and ploughboy. Most of the shops lighted two hours before their time—as the gas seems to know, for it has a haggard and unwilling look.\n\n\tThe raw afternoon is rawest, and the dense fog is densest, and the muddy streets are muddiest near that leaden-headed old obstruction, appropriate ornament for the threshold of a leaden-headed old corporation, Temple Bar. And hard by Temple Bar, in Lincoln’s Inn Hall, at the very heart of the fog, sits the Lord High Chancellor in his High Court of Chancery." not compatible with reflect.StructTag.Get: bad syntax for struct tag key diff --git a/src/cmd/vet/method.go b/src/cmd/vet/method.go index 5783278d2c29b..8b404e069782a 100644 --- a/src/cmd/vet/method.go +++ b/src/cmd/vet/method.go @@ -7,9 +7,8 @@ package main import ( - "fmt" "go/ast" - "go/printer" + "go/types" "strings" ) @@ -65,30 +64,26 @@ func checkCanonicalMethod(f *File, node ast.Node) { switch n := node.(type) { case *ast.FuncDecl: if n.Recv != nil { - canonicalMethod(f, n.Name, n.Type) + canonicalMethod(f, n.Name) } case *ast.InterfaceType: for _, field := range n.Methods.List { for _, id := range field.Names { - canonicalMethod(f, id, field.Type.(*ast.FuncType)) + canonicalMethod(f, id) } } } } -func canonicalMethod(f *File, id *ast.Ident, t *ast.FuncType) { +func canonicalMethod(f *File, id *ast.Ident) { // Expected input/output. expect, ok := canonicalMethods[id.Name] if !ok { return } - - // Actual input/output - args := typeFlatten(t.Params.List) - var results []ast.Expr - if t.Results != nil { - results = typeFlatten(t.Results.List) - } + sign := f.pkg.defs[id].Type().(*types.Signature) + args := sign.Params() + results := sign.Results() // Do the =s (if any) all match? if !f.matchParams(expect.args, args, "=") || !f.matchParams(expect.results, results, "=") { @@ -104,11 +99,7 @@ func canonicalMethod(f *File, id *ast.Ident, t *ast.FuncType) { expectFmt += " (" + argjoin(expect.results) + ")" } - f.b.Reset() - if err := printer.Fprint(&f.b, f.fset, t); err != nil { - fmt.Fprintf(&f.b, "<%s>", err) - } - actual := f.b.String() + actual := sign.String() actual = strings.TrimPrefix(actual, "func") actual = id.Name + actual @@ -127,45 +118,27 @@ func argjoin(x []string) string { return strings.Join(y, ", ") } -// Turn parameter list into slice of types -// (in the ast, types are Exprs). -// Have to handle f(int, bool) and f(x, y, z int) -// so not a simple 1-to-1 conversion. -func typeFlatten(l []*ast.Field) []ast.Expr { - var t []ast.Expr - for _, f := range l { - if len(f.Names) == 0 { - t = append(t, f.Type) - continue - } - for range f.Names { - t = append(t, f.Type) - } - } - return t -} - // Does each type in expect with the given prefix match the corresponding type in actual? -func (f *File) matchParams(expect []string, actual []ast.Expr, prefix string) bool { +func (f *File) matchParams(expect []string, actual *types.Tuple, prefix string) bool { for i, x := range expect { if !strings.HasPrefix(x, prefix) { continue } - if i >= len(actual) { + if i >= actual.Len() { return false } - if !f.matchParamType(x, actual[i]) { + if !f.matchParamType(x, actual.At(i).Type()) { return false } } - if prefix == "" && len(actual) > len(expect) { + if prefix == "" && actual.Len() > len(expect) { return false } return true } // Does this one type match? -func (f *File) matchParamType(expect string, actual ast.Expr) bool { +func (f *File) matchParamType(expect string, actual types.Type) bool { expect = strings.TrimPrefix(expect, "=") // Strip package name if we're in that package. if n := len(f.file.Name.Name); len(expect) > n && expect[:n] == f.file.Name.Name && expect[n] == '.' { @@ -173,7 +146,5 @@ func (f *File) matchParamType(expect string, actual ast.Expr) bool { } // Overkill but easy. - f.b.Reset() - printer.Fprint(&f.b, f.fset, actual) - return f.b.String() == expect + return actual.String() == expect } diff --git a/src/cmd/vet/testdata/method.go b/src/cmd/vet/testdata/method.go index 52b500df27280..978527d09089b 100644 --- a/src/cmd/vet/testdata/method.go +++ b/src/cmd/vet/testdata/method.go @@ -14,9 +14,9 @@ import ( type MethodTest int -func (t *MethodTest) Scan(x fmt.ScanState, c byte) { // ERROR "should have signature Scan" +func (t *MethodTest) Scan(x fmt.ScanState, c byte) { // ERROR "should have signature Scan\(fmt\.ScanState, rune\) error" } type MethodTestInterface interface { - ReadByte() byte // ERROR "should have signature ReadByte" + ReadByte() byte // ERROR "should have signature ReadByte\(\) \(byte, error\)" } From df2bb9817b2184256886d9d9458753b2273c202d Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 15 Oct 2018 17:24:21 -0700 Subject: [PATCH 032/594] runtime: during map delete, update entries after new last element When we delete an element, and it was the last element in the bucket, update the slots between the new last element and the old last element with the marker that says "no more elements beyond here". Change-Id: I8efeeddf4c9b9fc491c678f84220a5a5094c9c76 Reviewed-on: https://go-review.googlesource.com/c/142438 Reviewed-by: Matthew Dempsky --- src/runtime/export_test.go | 36 ++++++++++++++++++++++++++++++++++++ src/runtime/map.go | 34 +++++++++++++++++++++++++++++++++- src/runtime/map_fast32.go | 32 +++++++++++++++++++++++++++++++- src/runtime/map_fast64.go | 32 +++++++++++++++++++++++++++++++- src/runtime/map_faststr.go | 32 +++++++++++++++++++++++++++++++- src/runtime/map_test.go | 25 +++++++++++++++++++++++++ 6 files changed, 187 insertions(+), 4 deletions(-) diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index 56dd95e4697d7..ecb21935b9efe 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -477,3 +477,39 @@ func stackOverflow(x *byte) { var buf [256]byte stackOverflow(&buf[0]) } + +func MapTombstoneCheck(m map[int]int) { + // Make sure emptyOne and emptyRest are distributed correctly. + // We should have a series of filled and emptyOne cells, followed by + // a series of emptyRest cells. + h := *(**hmap)(unsafe.Pointer(&m)) + i := interface{}(m) + t := *(**maptype)(unsafe.Pointer(&i)) + + for x := 0; x < 1<= n && b.tophash[i] != emptyRest { + panic("late non-emptyRest") + } + if k == n-1 && b.tophash[i] == emptyOne { + panic("last non-emptyRest entry is emptyOne") + } + k++ + } + } + } +} diff --git a/src/runtime/map.go b/src/runtime/map.go index 617e88faa45a3..d835cc831aafa 100644 --- a/src/runtime/map.go +++ b/src/runtime/map.go @@ -711,6 +711,7 @@ func mapdelete(t *maptype, h *hmap, key unsafe.Pointer) { growWork(t, h, bucket) } b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize))) + bOrig := b top := tophash(hash) search: for ; b != nil; b = b.overflow(t) { @@ -744,7 +745,38 @@ search: memclrNoHeapPointers(v, t.elem.size) } b.tophash[i] = emptyOne - // TODO: set up emptyRest here. + // If the bucket now ends in a bunch of emptyOne states, + // change those to emptyRest states. + // It would be nice to make this a separate function, but + // for loops are not currently inlineable. + if i == bucketCnt-1 { + if b.overflow(t) != nil && b.overflow(t).tophash[0] != emptyRest { + goto notLast + } + } else { + if b.tophash[i+1] != emptyRest { + goto notLast + } + } + for { + b.tophash[i] = emptyRest + if i == 0 { + if b == bOrig { + break // beginning of initial bucket, we're done. + } + // Find previous bucket, continue at its last entry. + c := b + for b = bOrig; b.overflow(t) != c; b = b.overflow(t) { + } + i = bucketCnt - 1 + } else { + i-- + } + if b.tophash[i] != emptyOne { + break + } + } + notLast: h.count-- break search } diff --git a/src/runtime/map_fast32.go b/src/runtime/map_fast32.go index 063a5cbe3a6e0..20f55e17c6eac 100644 --- a/src/runtime/map_fast32.go +++ b/src/runtime/map_fast32.go @@ -291,6 +291,7 @@ func mapdelete_fast32(t *maptype, h *hmap, key uint32) { growWork_fast32(t, h, bucket) } b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize))) + bOrig := b search: for ; b != nil; b = b.overflow(t) { for i, k := uintptr(0), b.keys(); i < bucketCnt; i, k = i+1, add(k, 4) { @@ -308,7 +309,36 @@ search: memclrNoHeapPointers(v, t.elem.size) } b.tophash[i] = emptyOne - // TODO: emptyRest? + // If the bucket now ends in a bunch of emptyOne states, + // change those to emptyRest states. + if i == bucketCnt-1 { + if b.overflow(t) != nil && b.overflow(t).tophash[0] != emptyRest { + goto notLast + } + } else { + if b.tophash[i+1] != emptyRest { + goto notLast + } + } + for { + b.tophash[i] = emptyRest + if i == 0 { + if b == bOrig { + break // beginning of initial bucket, we're done. + } + // Find previous bucket, continue at its last entry. + c := b + for b = bOrig; b.overflow(t) != c; b = b.overflow(t) { + } + i = bucketCnt - 1 + } else { + i-- + } + if b.tophash[i] != emptyOne { + break + } + } + notLast: h.count-- break search } diff --git a/src/runtime/map_fast64.go b/src/runtime/map_fast64.go index 8270cf7b7d5b0..e00a7569f944f 100644 --- a/src/runtime/map_fast64.go +++ b/src/runtime/map_fast64.go @@ -291,6 +291,7 @@ func mapdelete_fast64(t *maptype, h *hmap, key uint64) { growWork_fast64(t, h, bucket) } b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize))) + bOrig := b search: for ; b != nil; b = b.overflow(t) { for i, k := uintptr(0), b.keys(); i < bucketCnt; i, k = i+1, add(k, 8) { @@ -308,7 +309,36 @@ search: memclrNoHeapPointers(v, t.elem.size) } b.tophash[i] = emptyOne - //TODO: emptyRest + // If the bucket now ends in a bunch of emptyOne states, + // change those to emptyRest states. + if i == bucketCnt-1 { + if b.overflow(t) != nil && b.overflow(t).tophash[0] != emptyRest { + goto notLast + } + } else { + if b.tophash[i+1] != emptyRest { + goto notLast + } + } + for { + b.tophash[i] = emptyRest + if i == 0 { + if b == bOrig { + break // beginning of initial bucket, we're done. + } + // Find previous bucket, continue at its last entry. + c := b + for b = bOrig; b.overflow(t) != c; b = b.overflow(t) { + } + i = bucketCnt - 1 + } else { + i-- + } + if b.tophash[i] != emptyOne { + break + } + } + notLast: h.count-- break search } diff --git a/src/runtime/map_faststr.go b/src/runtime/map_faststr.go index 8f505f90a609c..2eac2b5bb584e 100644 --- a/src/runtime/map_faststr.go +++ b/src/runtime/map_faststr.go @@ -317,6 +317,7 @@ func mapdelete_faststr(t *maptype, h *hmap, ky string) { growWork_faststr(t, h, bucket) } b := (*bmap)(add(h.buckets, bucket*uintptr(t.bucketsize))) + bOrig := b top := tophash(hash) search: for ; b != nil; b = b.overflow(t) { @@ -337,7 +338,36 @@ search: memclrNoHeapPointers(v, t.elem.size) } b.tophash[i] = emptyOne - // TODO: emptyRest + // If the bucket now ends in a bunch of emptyOne states, + // change those to emptyRest states. + if i == bucketCnt-1 { + if b.overflow(t) != nil && b.overflow(t).tophash[0] != emptyRest { + goto notLast + } + } else { + if b.tophash[i+1] != emptyRest { + goto notLast + } + } + for { + b.tophash[i] = emptyRest + if i == 0 { + if b == bOrig { + break // beginning of initial bucket, we're done. + } + // Find previous bucket, continue at its last entry. + c := b + for b = bOrig; b.overflow(t) != c; b = b.overflow(t) { + } + i = bucketCnt - 1 + } else { + i-- + } + if b.tophash[i] != emptyOne { + break + } + } + notLast: h.count-- break search } diff --git a/src/runtime/map_test.go b/src/runtime/map_test.go index 93b20668fa703..ee9468dd0e699 100644 --- a/src/runtime/map_test.go +++ b/src/runtime/map_test.go @@ -1131,3 +1131,28 @@ func TestIncrementAfterBulkClearKeyStringValueInt(t *testing.T) { t.Errorf("incremented 0 to %d", n2) } } + +func TestMapTombstones(t *testing.T) { + m := map[int]int{} + const N = 10000 + // Fill a map. + for i := 0; i < N; i++ { + m[i] = i + } + runtime.MapTombstoneCheck(m) + // Delete half of the entries. + for i := 0; i < N; i += 2 { + delete(m, i) + } + runtime.MapTombstoneCheck(m) + // Add new entries to fill in holes. + for i := N; i < 3*N/2; i++ { + m[i] = i + } + runtime.MapTombstoneCheck(m) + // Delete everything. + for i := 0; i < 3*N/2; i++ { + delete(m, i) + } + runtime.MapTombstoneCheck(m) +} From 0098f8aeaceb5feec7462ae64f8ce91a473360c1 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 12 Nov 2018 15:49:09 -0800 Subject: [PATCH 033/594] runtime: when using explicit argmap, also use arglen When we set an explicit argmap, we may want only a prefix of that argmap. Argmap is set when the function is reflect.makeFuncStub or reflect.methodValueCall. In this case, arglen specifies how much of the args section is actually live. (It could be either all the args + results, or just the args.) Fixes #28750 Change-Id: Idf060607f15a298ac591016994e58e22f7f92d83 Reviewed-on: https://go-review.googlesource.com/c/149217 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/stack.go | 7 ++++ test/fixedbugs/issue27695c.go | 65 +++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 test/fixedbugs/issue27695c.go diff --git a/src/runtime/stack.go b/src/runtime/stack.go index 65aa7dbd5993d..85902a6b68eea 100644 --- a/src/runtime/stack.go +++ b/src/runtime/stack.go @@ -1254,7 +1254,14 @@ func getStackMap(frame *stkframe, cache *pcvalueCache, debug bool) (locals, args // Arguments. if frame.arglen > 0 { if frame.argmap != nil { + // argmap is set when the function is reflect.makeFuncStub or reflect.methodValueCall. + // In this case, arglen specifies how much of the args section is actually live. + // (It could be either all the args + results, or just the args.) args = *frame.argmap + n := int32(frame.arglen / sys.PtrSize) + if n < args.n { + args.n = n // Don't use more of the arguments than arglen. + } } else { stackmap := (*stackmap)(funcdata(f, _FUNCDATA_ArgsPointerMaps)) if stackmap == nil || stackmap.n <= 0 { diff --git a/test/fixedbugs/issue27695c.go b/test/fixedbugs/issue27695c.go new file mode 100644 index 0000000000000..948191cc96686 --- /dev/null +++ b/test/fixedbugs/issue27695c.go @@ -0,0 +1,65 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure return values aren't scanned until they +// are initialized, when calling functions and methods +// via reflect. + +package main + +import ( + "io" + "reflect" + "runtime" + "unsafe" +) + +var badPtr uintptr + +var sink []byte + +func init() { + // Allocate large enough to use largeAlloc. + b := make([]byte, 1<<16-1) + sink = b // force heap allocation + // Any space between the object and the end of page is invalid to point to. + badPtr = uintptr(unsafe.Pointer(&b[len(b)-1])) + 1 +} + +func f(d func(error) error) error { + // Initialize callee args section with a bad pointer. + g(badPtr, badPtr, badPtr, badPtr) + + // Then call a function which returns a pointer. + // That return slot starts out holding a bad pointer. + return d(io.EOF) +} + +//go:noinline +func g(x, y, z, w uintptr) { +} + +type T struct { +} + +func (t *T) Foo(e error) error { + runtime.GC() + return e +} + +func main() { + // Functions + d := reflect.MakeFunc(reflect.TypeOf(func(e error) error { return e }), + func(args []reflect.Value) []reflect.Value { + runtime.GC() + return args + }).Interface().(func(error) error) + f(d) + + // Methods + x := reflect.ValueOf(&T{}).Method(0).Interface().(func(error) error) + f(x) +} From a3c70e28edf7f0202ab35b64c9d83644761cf033 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 13 Nov 2018 18:32:55 -0500 Subject: [PATCH 034/594] test: fix ABI mismatch in fixedbugs/issue19507 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because run.go doesn't pass the package being compiled to the compiler via the -p flag, it can't match up the main·f symbol from the assembler with the "func f" stub in Go, so it doesn't produce the correct assembly stub. Fix this by removing the package prefix from the assembly definition. Alternatively, we could make run.go pass -p to the compiler, but it's nicer to remove these package prefixes anyway. Should fix the linux-arm builder, which was broken by the introduction of function ABIs in CL 147160. Updates #27539. Change-Id: Id62b7701e1108a21a5ad48ffdb5dad4356c273a6 Reviewed-on: https://go-review.googlesource.com/c/149483 Run-TryBot: Austin Clements Reviewed-by: Keith Randall --- test/fixedbugs/issue19507.dir/div_arm.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/fixedbugs/issue19507.dir/div_arm.s b/test/fixedbugs/issue19507.dir/div_arm.s index f67c3bb66d7ee..0bc33e92ce297 100644 --- a/test/fixedbugs/issue19507.dir/div_arm.s +++ b/test/fixedbugs/issue19507.dir/div_arm.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -TEXT main·f(SB),0,$0-8 +TEXT ·f(SB),0,$0-8 MOVW x+0(FP), R1 MOVW x+4(FP), R2 DIVU R1, R2 From 69397422c0ac74f9f9ec8e2b3e6d0b0b7ab1b697 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 13 Nov 2018 15:36:02 -0800 Subject: [PATCH 035/594] cmd/compile: by default accept any language The bootstrap stage 1 compiler was defaulting to the language version used by the bootstrap compiler itself, typically 1.4. Normally this doesn't matter since the bootstrap code has to build with 1.4 anyhow, but it broke the boringcrypto branch which uses cgo during the bootstrap, as cgo now generates code that uses type aliases. Change-Id: I8a8312bb9ca4befaf65c00a8d71a78566075c2f7 Reviewed-on: https://go-review.googlesource.com/c/149459 Run-TryBot: Ian Lance Taylor Reviewed-by: Filippo Valsorda --- src/cmd/compile/internal/gc/main.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 44c540492b092..7e9dd4d5cd344 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -213,7 +213,7 @@ func Main(archInit func(*Arch)) { flag.StringVar(&flag_installsuffix, "installsuffix", "", "set pkg directory `suffix`") objabi.Flagcount("j", "debug runtime-initialized variables", &Debug['j']) objabi.Flagcount("l", "disable inlining", &Debug['l']) - flag.StringVar(&flag_lang, "lang", defaultLang(), "release to compile for") + flag.StringVar(&flag_lang, "lang", "", "release to compile for") flag.StringVar(&linkobj, "linkobj", "", "write linker-specific object to `file`") objabi.Flagcount("live", "debug liveness analysis", &debuglive) objabi.Flagcount("m", "print optimization decisions", &Debug['m']) @@ -1407,8 +1407,8 @@ func recordFlags(flags ...string) { // flag_lang is the language version we are compiling for, set by the -lang flag. var flag_lang string -// defaultLang returns the default value for the -lang flag. -func defaultLang() string { +// currentLang returns the current language version. +func currentLang() string { tags := build.Default.ReleaseTags return tags[len(tags)-1] } @@ -1423,23 +1423,32 @@ type lang struct { } // langWant is the desired language version set by the -lang flag. +// If the -lang flag is not set, this is the zero value, meaning that +// any language version is supported. var langWant lang // langSupported reports whether language version major.minor is supported. func langSupported(major, minor int) bool { + if langWant.major == 0 && langWant.minor == 0 { + return true + } return langWant.major > major || (langWant.major == major && langWant.minor >= minor) } // checkLang verifies that the -lang flag holds a valid value, and // exits if not. It initializes data used by langSupported. func checkLang() { + if flag_lang == "" { + return + } + var err error langWant, err = parseLang(flag_lang) if err != nil { log.Fatalf("invalid value %q for -lang: %v", flag_lang, err) } - if def := defaultLang(); flag_lang != def { + if def := currentLang(); flag_lang != def { defVers, err := parseLang(def) if err != nil { log.Fatalf("internal error parsing default lang %q: %v", def, err) From 6d620fc42ec2ae61cfedcd37d24afd8cb7654164 Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Tue, 13 Nov 2018 16:13:42 -0700 Subject: [PATCH 036/594] test: move empty header file in builddir, buildrundir to temp directory Move the empty header file created by "builddir", "buildrundir" directives to t.tempDir. The file was accidentally placed in the same directory as the source code and this was a vestige of CL 146999. Fixes #28781 Change-Id: I3d2ada5f9e8bf4ce4f015b9bd379b311592fe3ce Reviewed-on: https://go-review.googlesource.com/c/149458 Run-TryBot: Emmanuel Odeke TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- test/run.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/run.go b/test/run.go index a01fd6a9574ce..3a9e267940f25 100644 --- a/test/run.go +++ b/test/run.go @@ -808,7 +808,8 @@ func (t *test) run() { } if len(asms) > 0 { - if err := ioutil.WriteFile(filepath.Join(longdir, "go_asm.h"), nil, 0666); err != nil { + emptyHdrFile := filepath.Join(t.tempDir, "go_asm.h") + if err := ioutil.WriteFile(emptyHdrFile, nil, 0666); err != nil { t.err = fmt.Errorf("write empty go_asm.h: %s", err) return } From 0a72e8eefbdaa62bf782618d50851e4740408cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 14 Nov 2018 15:25:59 +0100 Subject: [PATCH 037/594] cmd/go: fix TestScript/vet_asm for OS without amd64 Add GOOS=linux to vet_asm script to avoid errors on OS not working on amd64 architecture. Change-Id: Ic3db43618008ae8e8bc08738c95c200dd4e916d7 Reviewed-on: https://go-review.googlesource.com/c/149577 Reviewed-by: Alan Donovan Run-TryBot: Alan Donovan TryBot-Result: Gobot Gobot --- src/cmd/go/testdata/script/vet_asm.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/testdata/script/vet_asm.txt b/src/cmd/go/testdata/script/vet_asm.txt index a066058c705b5..b7e1874b8cb0d 100644 --- a/src/cmd/go/testdata/script/vet_asm.txt +++ b/src/cmd/go/testdata/script/vet_asm.txt @@ -1,5 +1,6 @@ # Issue 27665. Verify that "go vet" analyzes non-Go files. +env GOOS=linux env GOARCH=amd64 ! go vet -asmdecl a stderr 'f: invalid MOVW of x' From c92e73b70253f5d88c473a7ad6c5b8d61b2debb7 Mon Sep 17 00:00:00 2001 From: Milan Knezevic Date: Fri, 9 Nov 2018 18:30:46 +0100 Subject: [PATCH 038/594] cmd/compile/internal/gc: OMUL should be evaluated when using soft-float When using soft-float, OMUL might be rewritten to function call so we should ensure it was evaluated first. Fixes #28688 Change-Id: I30b87501782fff62d35151f394a1c22b0d490c6c Reviewed-on: https://go-review.googlesource.com/c/148837 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/gc/subr.go | 2 +- test/fixedbugs/issue28688.go | 31 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/fixedbugs/issue28688.go diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index 53bfcba3ffc7b..127e5fdc77997 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -1006,7 +1006,7 @@ func calcHasCall(n *Node) bool { // When using soft-float, these ops might be rewritten to function calls // so we ensure they are evaluated first. - case OADD, OSUB, OMINUS: + case OADD, OSUB, OMINUS, OMUL: if thearch.SoftFloat && (isFloat[n.Type.Etype] || isComplex[n.Type.Etype]) { return true } diff --git a/test/fixedbugs/issue28688.go b/test/fixedbugs/issue28688.go new file mode 100644 index 0000000000000..0d2000e149872 --- /dev/null +++ b/test/fixedbugs/issue28688.go @@ -0,0 +1,31 @@ +// run -gcflags=-d=softfloat + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" +) + +// When using soft-float, OMUL might be rewritten to function +// call so we should ensure it was evaluated first. Stack frame +// setup for "test" function call should happen after call to runtime.fmul32 + +var x int32 = 1 + +func main() { + var y float32 = 1.0 + test(x, y*y) +} + +//go:noinline +func test(id int32, a float32) { + + if id != x { + fmt.Printf("got: %d, want: %d\n", id, x) + panic("FAIL") + } +} From 529ea7c0de1f9e582280c73031ae870f868e7908 Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Wed, 14 Nov 2018 19:34:48 +0000 Subject: [PATCH 039/594] cmd/go: don't panic when go run is passed ... under nonexistent dir Given a nonexistent directory above a wildcard: go run ./nonexistent/... Print this error instead of panicking: go run: no packages loaded from ./nonexistent/... Fixes #28696. Change-Id: Iaa3bc5c78b14ef858d931778e1bc55ca626c5571 GitHub-Last-Rev: bb1a80483ad26c8cf646cf0900d08cfe49aba535 GitHub-Pull-Request: golang/go#28703 Reviewed-on: https://go-review.googlesource.com/c/148821 Run-TryBot: Emmanuel Odeke TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills Reviewed-by: Emmanuel Odeke --- src/cmd/go/internal/run/run.go | 3 +++ src/cmd/go/testdata/script/run_wildcard.txt | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 src/cmd/go/testdata/script/run_wildcard.txt diff --git a/src/cmd/go/internal/run/run.go b/src/cmd/go/internal/run/run.go index 303e6842e7be3..feccf23b2782a 100644 --- a/src/cmd/go/internal/run/run.go +++ b/src/cmd/go/internal/run/run.go @@ -78,6 +78,9 @@ func runRun(cmd *base.Command, args []string) { p = load.GoFilesPackage(files) } else if len(args) > 0 && !strings.HasPrefix(args[0], "-") { pkgs := load.PackagesAndErrors(args[:1]) + if len(pkgs) == 0 { + base.Fatalf("go run: no packages loaded from %s", args[0]) + } if len(pkgs) > 1 { var names []string for _, p := range pkgs { diff --git a/src/cmd/go/testdata/script/run_wildcard.txt b/src/cmd/go/testdata/script/run_wildcard.txt new file mode 100644 index 0000000000000..cd401e00e6441 --- /dev/null +++ b/src/cmd/go/testdata/script/run_wildcard.txt @@ -0,0 +1,5 @@ +# Fix for https://github.com/golang/go/issues/28696: +# go run x/... should not panic when directory x doesn't exist. + +! go run nonexistent/... +stderr '^go run: no packages loaded from nonexistent/...$' From 75798e8ada7fcb286f633618ac2f55ad5240ed97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Tue, 6 Nov 2018 17:00:04 +0100 Subject: [PATCH 040/594] runtime: make processor capability variable naming platform specific MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current support_XXX variables are specific for the amd64 and 386 platforms. Prefix processor capability variables by architecture to have a consistent naming scheme and avoid reuse of the existing variables for new platforms. This also aligns naming of runtime variables closer with internal/cpu processor capability variable names. Change-Id: I3eabb29a03874678851376185d3a62e73c1aff1d Reviewed-on: https://go-review.googlesource.com/c/91435 Run-TryBot: Martin Möhrmann TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/builtin.go | 5 +++-- src/cmd/compile/internal/gc/builtin/runtime.go | 5 +++-- src/cmd/compile/internal/gc/go.go | 6 +++--- src/cmd/compile/internal/gc/ssa.go | 12 ++++++------ src/cmd/compile/internal/ssa/gen/AMD64Ops.go | 4 ++-- src/runtime/cpuflags.go | 9 +++++++++ src/runtime/proc.go | 6 +++--- src/runtime/runtime2.go | 6 ------ test/codegen/mathbits.go | 8 ++++---- 9 files changed, 33 insertions(+), 28 deletions(-) diff --git a/src/cmd/compile/internal/gc/builtin.go b/src/cmd/compile/internal/gc/builtin.go index 4e9f11c8b3205..04f4cbfd5852d 100644 --- a/src/cmd/compile/internal/gc/builtin.go +++ b/src/cmd/compile/internal/gc/builtin.go @@ -144,8 +144,9 @@ var runtimeDecls = [...]struct { {"racewriterange", funcTag, 113}, {"msanread", funcTag, 113}, {"msanwrite", funcTag, 113}, - {"support_popcnt", varTag, 11}, - {"support_sse41", varTag, 11}, + {"x86HasPOPCNT", varTag, 11}, + {"x86HasSSE41", varTag, 11}, + {"arm64HasATOMICS", varTag, 11}, } func runtimeTypes() []*types.Type { diff --git a/src/cmd/compile/internal/gc/builtin/runtime.go b/src/cmd/compile/internal/gc/builtin/runtime.go index 1eaf332e5020f..fc879badb2b7e 100644 --- a/src/cmd/compile/internal/gc/builtin/runtime.go +++ b/src/cmd/compile/internal/gc/builtin/runtime.go @@ -195,5 +195,6 @@ func msanread(addr, size uintptr) func msanwrite(addr, size uintptr) // architecture variants -var support_popcnt bool -var support_sse41 bool +var x86HasPOPCNT bool +var x86HasSSE41 bool +var arm64HasATOMICS bool diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go index 471746ed7dde2..cb76398629742 100644 --- a/src/cmd/compile/internal/gc/go.go +++ b/src/cmd/compile/internal/gc/go.go @@ -305,9 +305,9 @@ var ( racereadrange, racewrite, racewriterange, - supportPopcnt, - supportSSE41, - arm64SupportAtomics, + x86HasPOPCNT, + x86HasSSE41, + arm64HasATOMICS, typedmemclr, typedmemmove, Udiv, diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 9da45258f5268..1c64c6437d4b2 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -86,9 +86,9 @@ func initssaconfig() { racereadrange = sysfunc("racereadrange") racewrite = sysfunc("racewrite") racewriterange = sysfunc("racewriterange") - supportPopcnt = sysvar("support_popcnt") // bool - supportSSE41 = sysvar("support_sse41") // bool - arm64SupportAtomics = sysvar("arm64_support_atomics") // bool + x86HasPOPCNT = sysvar("x86HasPOPCNT") // bool + x86HasSSE41 = sysvar("x86HasSSE41") // bool + arm64HasATOMICS = sysvar("arm64HasATOMICS") // bool typedmemclr = sysfunc("typedmemclr") typedmemmove = sysfunc("typedmemmove") Udiv = sysvar("udiv") // asm func with special ABI @@ -3068,7 +3068,7 @@ func init() { makeXaddARM64 := func(op0 ssa.Op, op1 ssa.Op, ty types.EType) func(s *state, n *Node, args []*ssa.Value) *ssa.Value { return func(s *state, n *Node, args []*ssa.Value) *ssa.Value { // Target Atomic feature is identified by dynamic detection - addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), arm64SupportAtomics, s.sb) + addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), arm64HasATOMICS, s.sb) v := s.load(types.Types[TBOOL], addr) b := s.endBlock() b.Kind = ssa.BlockIf @@ -3208,7 +3208,7 @@ func init() { makeRoundAMD64 := func(op ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value { return func(s *state, n *Node, args []*ssa.Value) *ssa.Value { - addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), supportSSE41, s.sb) + addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), x86HasSSE41, s.sb) v := s.load(types.Types[TBOOL], addr) b := s.endBlock() b.Kind = ssa.BlockIf @@ -3416,7 +3416,7 @@ func init() { makeOnesCountAMD64 := func(op64 ssa.Op, op32 ssa.Op) func(s *state, n *Node, args []*ssa.Value) *ssa.Value { return func(s *state, n *Node, args []*ssa.Value) *ssa.Value { - addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), supportPopcnt, s.sb) + addr := s.entryNewValue1A(ssa.OpAddr, types.Types[TBOOL].PtrTo(), x86HasPOPCNT, s.sb) v := s.load(types.Types[TBOOL], addr) b := s.endBlock() b.Kind = ssa.BlockIf diff --git a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go index bd1339b43ab66..c2ed0ea1d9511 100644 --- a/src/cmd/compile/internal/ssa/gen/AMD64Ops.go +++ b/src/cmd/compile/internal/ssa/gen/AMD64Ops.go @@ -467,14 +467,14 @@ func init() { {name: "BSWAPL", argLength: 1, reg: gp11, asm: "BSWAPL", resultInArg0: true, clobberFlags: true}, // arg0 swap bytes // POPCNT instructions aren't guaranteed to be on the target platform (they are SSE4). - // Any use must be preceded by a successful check of runtime.support_popcnt. + // Any use must be preceded by a successful check of runtime.x86HasPOPCNT. {name: "POPCNTQ", argLength: 1, reg: gp11, asm: "POPCNTQ", clobberFlags: true}, // count number of set bits in arg0 {name: "POPCNTL", argLength: 1, reg: gp11, asm: "POPCNTL", clobberFlags: true}, // count number of set bits in arg0 {name: "SQRTSD", argLength: 1, reg: fp11, asm: "SQRTSD"}, // sqrt(arg0) // ROUNDSD instruction isn't guaranteed to be on the target platform (it is SSE4.1) - // Any use must be preceded by a successful check of runtime.support_sse41. + // Any use must be preceded by a successful check of runtime.x86HasSSE41. {name: "ROUNDSD", argLength: 1, reg: fp11, aux: "Int8", asm: "ROUNDSD"}, // rounds arg0 depending on auxint, 1 means math.Floor, 2 Ceil, 3 Trunc {name: "SBBQcarrymask", argLength: 1, reg: flagsgp, asm: "SBBQ"}, // (int64)(-1) if carry is set, 0 if carry is clear. diff --git a/src/runtime/cpuflags.go b/src/runtime/cpuflags.go index b65523766af5f..1565afb93a557 100644 --- a/src/runtime/cpuflags.go +++ b/src/runtime/cpuflags.go @@ -17,3 +17,12 @@ const ( offsetARMHasIDIVA = unsafe.Offsetof(cpu.ARM.HasIDIVA) ) + +var ( + // Set in runtime.cpuinit. + // TODO: deprecate these; use internal/cpu directly. + x86HasPOPCNT bool + x86HasSSE41 bool + + arm64HasATOMICS bool +) diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 837fa93bfac0c..41ac75d3dd992 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -509,10 +509,10 @@ func cpuinit() { // Support cpu feature variables are used in code generated by the compiler // to guard execution of instructions that can not be assumed to be always supported. - support_popcnt = cpu.X86.HasPOPCNT - support_sse41 = cpu.X86.HasSSE41 + x86HasPOPCNT = cpu.X86.HasPOPCNT + x86HasSSE41 = cpu.X86.HasSSE41 - arm64_support_atomics = cpu.ARM64.HasATOMICS + arm64HasATOMICS = cpu.ARM64.HasATOMICS } // The bootstrap sequence is: diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 66dd1b19c13b3..290a7bd3111a7 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -858,12 +858,6 @@ var ( isIntel bool lfenceBeforeRdtsc bool - // Set in runtime.cpuinit. - // TODO: deprecate these; use internal/cpu directly. - support_popcnt bool - support_sse41 bool - arm64_support_atomics bool - goarm uint8 // set by cmd/link on arm systems framepointer_enabled bool // set by cmd/link ) diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go index 977cbe6eb1317..85d5bdea331bf 100644 --- a/test/codegen/mathbits.go +++ b/test/codegen/mathbits.go @@ -101,7 +101,7 @@ func Len8(n uint8) int { // -------------------- // func OnesCount(n uint) int { - // amd64:"POPCNTQ",".*support_popcnt" + // amd64:"POPCNTQ",".*x86HasPOPCNT" // arm64:"VCNT","VUADDLV" // s390x:"POPCNT" // ppc64:"POPCNTD" @@ -110,7 +110,7 @@ func OnesCount(n uint) int { } func OnesCount64(n uint64) int { - // amd64:"POPCNTQ",".*support_popcnt" + // amd64:"POPCNTQ",".*x86HasPOPCNT" // arm64:"VCNT","VUADDLV" // s390x:"POPCNT" // ppc64:"POPCNTD" @@ -119,7 +119,7 @@ func OnesCount64(n uint64) int { } func OnesCount32(n uint32) int { - // amd64:"POPCNTL",".*support_popcnt" + // amd64:"POPCNTL",".*x86HasPOPCNT" // arm64:"VCNT","VUADDLV" // s390x:"POPCNT" // ppc64:"POPCNTW" @@ -128,7 +128,7 @@ func OnesCount32(n uint32) int { } func OnesCount16(n uint16) int { - // amd64:"POPCNTL",".*support_popcnt" + // amd64:"POPCNTL",".*x86HasPOPCNT" // arm64:"VCNT","VUADDLV" // s390x:"POPCNT" // ppc64:"POPCNTW" From f36e92dbfc343210f10b0ae9e39293fdb44b8396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Sun, 28 Oct 2018 17:28:04 +0100 Subject: [PATCH 041/594] fmt: avoid allocation when formatting byte slice arguments with verb s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fmtBytes is in the top 10 callers of runtime.slicebytetostring according to Google wide profiling data. Avoid the string conversion of the input byte slice in fmtBytes by calling a newly added specialized fmtS function for byte slices. Expand tests for verb s with widths to test strings and byte slice arguments. SprintfTruncateString 157ns ± 4% 156ns ± 3% ~ (p=0.122 n=20+20) SprintfTruncateBytes 188ns ± 2% 155ns ± 3% -18.00% (p=0.000 n=20+19) name old alloc/op new alloc/op delta SprintfTruncateString 16.0B ± 0% 16.0B ± 0% ~ (all equal) SprintfTruncateBytes 64.0B ± 0% 16.0B ± 0% -75.00% (p=0.000 n=20+20) name old allocs/op new allocs/op delta SprintfTruncateString 1.00 ± 0% 1.00 ± 0% ~ (all equal) SprintfTruncateBytes 2.00 ± 0% 1.00 ± 0% -50.00% (p=0.000 n=20+20) Change-Id: I461bf514d4232b39bd9c812f7faa4e5ef693a03b Reviewed-on: https://go-review.googlesource.com/c/145284 Run-TryBot: Martin Möhrmann TryBot-Result: Gobot Gobot Reviewed-by: Rob Pike --- src/fmt/fmt_test.go | 30 +++++++++++++++++++++++++----- src/fmt/format.go | 33 +++++++++++++++++++++++++++++---- src/fmt/print.go | 2 +- 3 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/fmt/fmt_test.go b/src/fmt/fmt_test.go index e97372225c9a8..1907268c748bb 100644 --- a/src/fmt/fmt_test.go +++ b/src/fmt/fmt_test.go @@ -298,20 +298,30 @@ var fmtTests = []struct { // width {"%5s", "abc", " abc"}, + {"%5s", []byte("abc"), " abc"}, {"%2s", "\u263a", " ☺"}, + {"%2s", []byte("\u263a"), " ☺"}, {"%-5s", "abc", "abc "}, - {"%-8q", "abc", `"abc" `}, + {"%-5s", []byte("abc"), "abc "}, {"%05s", "abc", "00abc"}, - {"%08q", "abc", `000"abc"`}, + {"%05s", []byte("abc"), "00abc"}, {"%5s", "abcdefghijklmnopqrstuvwxyz", "abcdefghijklmnopqrstuvwxyz"}, + {"%5s", []byte("abcdefghijklmnopqrstuvwxyz"), "abcdefghijklmnopqrstuvwxyz"}, {"%.5s", "abcdefghijklmnopqrstuvwxyz", "abcde"}, + {"%.5s", []byte("abcdefghijklmnopqrstuvwxyz"), "abcde"}, {"%.0s", "日本語日本語", ""}, + {"%.0s", []byte("日本語日本語"), ""}, {"%.5s", "日本語日本語", "日本語日本"}, - {"%.10s", "日本語日本語", "日本語日本語"}, {"%.5s", []byte("日本語日本語"), "日本語日本"}, + {"%.10s", "日本語日本語", "日本語日本語"}, + {"%.10s", []byte("日本語日本語"), "日本語日本語"}, + {"%08q", "abc", `000"abc"`}, + {"%08q", []byte("abc"), `000"abc"`}, + {"%-8q", "abc", `"abc" `}, + {"%-8q", []byte("abc"), `"abc" `}, {"%.5q", "abcdefghijklmnopqrstuvwxyz", `"abcde"`}, - {"%.5x", "abcdefghijklmnopqrstuvwxyz", "6162636465"}, {"%.5q", []byte("abcdefghijklmnopqrstuvwxyz"), `"abcde"`}, + {"%.5x", "abcdefghijklmnopqrstuvwxyz", "6162636465"}, {"%.5x", []byte("abcdefghijklmnopqrstuvwxyz"), "6162636465"}, {"%.3q", "日本語日本語", `"日本語"`}, {"%.3q", []byte("日本語日本語"), `"日本語"`}, @@ -320,6 +330,7 @@ var fmtTests = []struct { {"%.1x", "日本語", "e6"}, {"%.1X", []byte("日本語"), "E6"}, {"%10.1q", "日本語日本語", ` "日"`}, + {"%10.1q", []byte("日本語日本語"), ` "日"`}, {"%10v", nil, " "}, {"%-10v", nil, " "}, @@ -1211,7 +1222,16 @@ func BenchmarkSprintfString(b *testing.B) { func BenchmarkSprintfTruncateString(b *testing.B) { b.RunParallel(func(pb *testing.PB) { for pb.Next() { - Sprintf("%.3s", "日本語日本語日本語") + Sprintf("%.3s", "日本語日本語日本語日本語") + } + }) +} + +func BenchmarkSprintfTruncateBytes(b *testing.B) { + var bytes interface{} = []byte("日本語日本語日本語日本語") + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + Sprintf("%.3s", bytes) } }) } diff --git a/src/fmt/format.go b/src/fmt/format.go index 91103f2c07f18..d6da8aed1e3aa 100644 --- a/src/fmt/format.go +++ b/src/fmt/format.go @@ -308,8 +308,8 @@ func (f *fmt) fmtInteger(u uint64, base int, isSigned bool, digits string) { f.zero = oldZero } -// truncate truncates the string to the specified precision, if present. -func (f *fmt) truncate(s string) string { +// truncate truncates the string s to the specified precision, if present. +func (f *fmt) truncateString(s string) string { if f.precPresent { n := f.prec for i := range s { @@ -322,12 +322,37 @@ func (f *fmt) truncate(s string) string { return s } +// truncate truncates the byte slice b as a string of the specified precision, if present. +func (f *fmt) truncate(b []byte) []byte { + if f.precPresent { + n := f.prec + for i := 0; i < len(b); { + n-- + if n < 0 { + return b[:i] + } + wid := 1 + if b[i] >= utf8.RuneSelf { + _, wid = utf8.DecodeRune(b[i:]) + } + i += wid + } + } + return b +} + // fmtS formats a string. func (f *fmt) fmtS(s string) { - s = f.truncate(s) + s = f.truncateString(s) f.padString(s) } +// fmtBs formats the byte slice b as if it was formatted as string with fmtS. +func (f *fmt) fmtBs(b []byte) { + b = f.truncate(b) + f.pad(b) +} + // fmtSbx formats a string or byte slice as a hexadecimal encoding of its bytes. func (f *fmt) fmtSbx(s string, b []byte, digits string) { length := len(b) @@ -408,7 +433,7 @@ func (f *fmt) fmtBx(b []byte, digits string) { // If f.sharp is set a raw (backquoted) string may be returned instead // if the string does not contain any control characters other than tab. func (f *fmt) fmtQ(s string) { - s = f.truncate(s) + s = f.truncateString(s) if f.sharp && strconv.CanBackquote(s) { f.padString("`" + s + "`") return diff --git a/src/fmt/print.go b/src/fmt/print.go index 22dc52ccdcdd3..5df34a25e5320 100644 --- a/src/fmt/print.go +++ b/src/fmt/print.go @@ -488,7 +488,7 @@ func (p *pp) fmtBytes(v []byte, verb rune, typeString string) { p.buf.WriteByte(']') } case 's': - p.fmt.fmtS(string(v)) + p.fmt.fmtBs(v) case 'x': p.fmt.fmtBx(v, ldigits) case 'X': From a063a2284af69d25d4367ff3e7c6da53f37bad03 Mon Sep 17 00:00:00 2001 From: Ali Rizvi-Santiago Date: Wed, 14 Nov 2018 20:16:14 +0000 Subject: [PATCH 042/594] cmd/go: allow the user to specify ar via an environment variable This allows one to customize which ar to use by fetching its path from the environment. This way one can swap it out for a different implementation. Change-Id: I40d8cbd8a69e97b5254e66081d9bf0b726c10366 GitHub-Last-Rev: 4aa1d631eaca58be6c3a4be40f7404fa75a0db25 GitHub-Pull-Request: golang/go#28746 Reviewed-on: https://go-review.googlesource.com/c/149117 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/go/alldocs.go | 4 ++++ src/cmd/go/internal/help/helpdoc.go | 4 ++++ src/cmd/go/internal/work/gccgo.go | 18 +++++++++++++----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index f8c4d2ffa912f..e7412f9bc7c51 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1500,6 +1500,10 @@ // The command to use to compile C++ code. // PKG_CONFIG // Path to pkg-config tool. +// AR +// The command to use to manipulate library archives when +// building with the gccgo compiler. +// The default is 'ar'. // // Architecture-specific environment variables: // diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index e2c4e61615bcc..c8ea66a3273d2 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -546,6 +546,10 @@ Environment variables for use with cgo: The command to use to compile C++ code. PKG_CONFIG Path to pkg-config tool. + AR + The command to use to manipulate library archives when + building with the gccgo compiler. + The default is 'ar'. Architecture-specific environment variables: diff --git a/src/cmd/go/internal/work/gccgo.go b/src/cmd/go/internal/work/gccgo.go index 784a4ae1b3fa5..69a25bea62ff4 100644 --- a/src/cmd/go/internal/work/gccgo.go +++ b/src/cmd/go/internal/work/gccgo.go @@ -43,6 +43,14 @@ func (gccgoToolchain) linker() string { return GccgoBin } +func (gccgoToolchain) ar() string { + ar := os.Getenv("AR") + if ar == "" { + ar = "ar" + } + return ar +} + func checkGccgoBin() { if gccgoErr == nil { return @@ -183,7 +191,7 @@ func gccgoArchive(basedir, imp string) string { return filepath.Join(filepath.Dir(afile), "lib"+filepath.Base(afile)) } -func (gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []string) error { +func (tools gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []string) error { p := a.Package objdir := a.Objdir var absOfiles []string @@ -198,7 +206,7 @@ func (gccgoToolchain) pack(b *Builder, a *Action, afile string, ofiles []string) arArgs = []string{"-X64"} } - return b.run(a, p.Dir, p.ImportPath, nil, "ar", arArgs, "rc", mkAbs(objdir, afile), absOfiles) + return b.run(a, p.Dir, p.ImportPath, nil, tools.ar(), arArgs, "rc", mkAbs(objdir, afile), absOfiles) } func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string, allactions []*Action, buildmode, desc string) error { @@ -257,11 +265,11 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string return "", nil } } - err := b.run(root, root.Objdir, desc, nil, "ar", "x", newArchive, "_cgo_flags") + err := b.run(root, root.Objdir, desc, nil, tools.ar(), "x", newArchive, "_cgo_flags") if err != nil { return "", err } - err = b.run(root, ".", desc, nil, "ar", "d", newArchive, "_cgo_flags") + err = b.run(root, ".", desc, nil, tools.ar(), "d", newArchive, "_cgo_flags") if err != nil { return "", err } @@ -473,7 +481,7 @@ func (tools gccgoToolchain) link(b *Builder, root *Action, out, importcfg string switch buildmode { case "c-archive": - if err := b.run(root, ".", desc, nil, "ar", "rc", realOut, out); err != nil { + if err := b.run(root, ".", desc, nil, tools.ar(), "rc", realOut, out); err != nil { return err } } From 0c7762cd184649552309c82671bf81f89d215ff7 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 30 Oct 2018 13:30:09 -0700 Subject: [PATCH 043/594] cmd/compile: assume unsafe pointer arithmetic generates non-nil results I've never seen a case where unsafe arithmetic is used to generate a nil. (Something like var x uintptr; unsafe.Pointer(x - x).) We can assume that if someone is doing arithmetic with pointers, the result will be non-nil. Our unsafe rules already forbid this, although we should be more explicit. RELNOTE=It is invalid to convert a nil unsafe.Pointer to uintptr and back, with arithmetic. (This was already invalid, but this statement has been added for clarification.) Fixes #27180 Change-Id: I1880b7725a9fd99e4613799930fdad9aaa99e8f0 Reviewed-on: https://go-review.googlesource.com/c/146058 Reviewed-by: Austin Clements --- src/cmd/compile/internal/ssa/nilcheck.go | 3 ++- src/unsafe/unsafe.go | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/nilcheck.go b/src/cmd/compile/internal/ssa/nilcheck.go index f2e17c606b50e..fca4f0bfc4076 100644 --- a/src/cmd/compile/internal/ssa/nilcheck.go +++ b/src/cmd/compile/internal/ssa/nilcheck.go @@ -47,7 +47,8 @@ func nilcheckelim(f *Func) { // a value resulting from taking the address of a // value, or a value constructed from an offset of a // non-nil ptr (OpAddPtr) implies it is non-nil - if v.Op == OpAddr || v.Op == OpLocalAddr || v.Op == OpAddPtr || v.Op == OpOffPtr { + // We also assume unsafe pointer arithmetic generates non-nil pointers. See #27180. + if v.Op == OpAddr || v.Op == OpLocalAddr || v.Op == OpAddPtr || v.Op == OpOffPtr || v.Op == OpAdd32 || v.Op == OpAdd64 || v.Op == OpSub32 || v.Op == OpSub64 { nonNilValues[v.ID] = true } } diff --git a/src/unsafe/unsafe.go b/src/unsafe/unsafe.go index e16c4aeacbe6f..272761d9363a4 100644 --- a/src/unsafe/unsafe.go +++ b/src/unsafe/unsafe.go @@ -99,6 +99,12 @@ type ArbitraryType int // u := uintptr(p) // p = unsafe.Pointer(u + offset) // +// Note that the pointer must point into an allocated object, so it may not be nil. +// +// // INVALID: conversion of nil pointer +// u := unsafe.Pointer(nil) +// p := unsafe.Pointer(uintptr(u) + offset) +// // (4) Conversion of a Pointer to a uintptr when calling syscall.Syscall. // // The Syscall functions in package syscall pass their uintptr arguments directly From bfd9b94069e74b0c6516a045cbb83bf1024a1269 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 5 Nov 2018 16:26:45 +0000 Subject: [PATCH 044/594] net/http: make Transport respect {X-,}Idempotency-Key header Fixes #19943 Change-Id: I5e0fefe44791d7b3556095d726c2a753ec551ef2 Reviewed-on: https://go-review.googlesource.com/c/147457 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Dmitri Shuralyov --- src/net/http/export_test.go | 2 ++ src/net/http/header.go | 7 ++++ src/net/http/request.go | 8 ++++- src/net/http/requestwrite_test.go | 32 +++++++++++++++++++ src/net/http/server.go | 2 +- src/net/http/transport.go | 9 ++++++ src/net/http/transport_test.go | 53 +++++++++++++++++++++++++++++++ 7 files changed, 111 insertions(+), 2 deletions(-) diff --git a/src/net/http/export_test.go b/src/net/http/export_test.go index 716e8ecac70a9..b6965c239e95e 100644 --- a/src/net/http/export_test.go +++ b/src/net/http/export_test.go @@ -242,3 +242,5 @@ func ExportSetH2GoawayTimeout(d time.Duration) (restore func()) { http2goAwayTimeout = d return func() { http2goAwayTimeout = old } } + +func (r *Request) ExportIsReplayable() bool { return r.isReplayable() } diff --git a/src/net/http/header.go b/src/net/http/header.go index 611ee047050c7..6cf13e5c44126 100644 --- a/src/net/http/header.go +++ b/src/net/http/header.go @@ -52,6 +52,13 @@ func (h Header) get(key string) string { return "" } +// has reports whether h has the provided key defined, even if it's +// set to 0-length slice. +func (h Header) has(key string) bool { + _, ok := h[key] + return ok +} + // Del deletes the values associated with key. // The key is case insensitive; it is canonicalized by // textproto.CanonicalMIMEHeaderKey. diff --git a/src/net/http/request.go b/src/net/http/request.go index 0bcdeae0df1f5..5b7e6564ae504 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -579,7 +579,7 @@ func (r *Request) write(w io.Writer, usingProxy bool, extraHeaders Header, waitF // Use the defaultUserAgent unless the Header contains one, which // may be blank to not send the header. userAgent := defaultUserAgent - if _, ok := r.Header["User-Agent"]; ok { + if r.Header.has("User-Agent") { userAgent = r.Header.Get("User-Agent") } if userAgent != "" { @@ -1345,6 +1345,12 @@ func (r *Request) isReplayable() bool { case "GET", "HEAD", "OPTIONS", "TRACE": return true } + // The Idempotency-Key, while non-standard, is widely used to + // mean a POST or other request is idempotent. See + // https://golang.org/issue/19943#issuecomment-421092421 + if r.Header.has("Idempotency-Key") || r.Header.has("X-Idempotency-Key") { + return true + } } return false } diff --git a/src/net/http/requestwrite_test.go b/src/net/http/requestwrite_test.go index 246fb4e65d852..7dbf0d4e8a175 100644 --- a/src/net/http/requestwrite_test.go +++ b/src/net/http/requestwrite_test.go @@ -544,6 +544,38 @@ var reqWriteTests = []reqWriteTest{ "User-Agent: Go-http-client/1.1\r\n" + "\r\n", }, + + // Verify that a nil header value doesn't get written. + 23: { + Req: Request{ + Method: "GET", + URL: mustParseURL("/foo"), + Header: Header{ + "X-Foo": []string{"X-Bar"}, + "X-Idempotency-Key": nil, + }, + }, + + WantWrite: "GET /foo HTTP/1.1\r\n" + + "Host: \r\n" + + "User-Agent: Go-http-client/1.1\r\n" + + "X-Foo: X-Bar\r\n\r\n", + }, + 24: { + Req: Request{ + Method: "GET", + URL: mustParseURL("/foo"), + Header: Header{ + "X-Foo": []string{"X-Bar"}, + "X-Idempotency-Key": []string{}, + }, + }, + + WantWrite: "GET /foo HTTP/1.1\r\n" + + "Host: \r\n" + + "User-Agent: Go-http-client/1.1\r\n" + + "X-Foo: X-Bar\r\n\r\n", + }, } func TestRequestWrite(t *testing.T) { diff --git a/src/net/http/server.go b/src/net/http/server.go index a7e79c2d91376..cf03b09f84414 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -1390,7 +1390,7 @@ func (cw *chunkWriter) writeHeader(p []byte) { } } - if _, ok := header["Date"]; !ok { + if !header.has("Date") { setHeader.date = appendTime(cw.res.dateBuf[:0], time.Now()) } diff --git a/src/net/http/transport.go b/src/net/http/transport.go index 7ef414ba53a2f..aa76e4f537637 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -91,6 +91,15 @@ func init() { // considered a terminal status and returned by RoundTrip. To see the // ignored 1xx responses, use the httptrace trace package's // ClientTrace.Got1xxResponse. +// +// Transport only retries a request upon encountering a network error +// if the request is idempotent and either has no body or has its +// Request.GetBody defined. HTTP requests are considered idempotent if +// they have HTTP methods GET, HEAD, OPTIONS, or TRACE; or if their +// Header map contains an "Idempotency-Key" or "X-Idempotency-Key" +// entry. If the idempotency key value is an zero-length slice, the +// request is treated as idempotent but the header is not sent on the +// wire. type Transport struct { idleMu sync.Mutex wantIdle bool // user has requested to close all idle conns diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index 3f9750392c61d..22ca3f9550e40 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -4952,3 +4952,56 @@ func TestTransportCONNECTBidi(t *testing.T) { } } } + +func TestTransportRequestReplayable(t *testing.T) { + someBody := ioutil.NopCloser(strings.NewReader("")) + tests := []struct { + name string + req *Request + want bool + }{ + { + name: "GET", + req: &Request{Method: "GET"}, + want: true, + }, + { + name: "GET_http.NoBody", + req: &Request{Method: "GET", Body: NoBody}, + want: true, + }, + { + name: "GET_body", + req: &Request{Method: "GET", Body: someBody}, + want: false, + }, + { + name: "POST", + req: &Request{Method: "POST"}, + want: false, + }, + { + name: "POST_idempotency-key", + req: &Request{Method: "POST", Header: Header{"Idempotency-Key": {"x"}}}, + want: true, + }, + { + name: "POST_x-idempotency-key", + req: &Request{Method: "POST", Header: Header{"X-Idempotency-Key": {"x"}}}, + want: true, + }, + { + name: "POST_body", + req: &Request{Method: "POST", Header: Header{"Idempotency-Key": {"x"}}, Body: someBody}, + want: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := tt.req.ExportIsReplayable() + if got != tt.want { + t.Errorf("replyable = %v; want %v", got, tt.want) + } + }) + } +} From 89a791749389f196d15ca873ae50b81a30780287 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 14 Nov 2018 14:58:27 -0500 Subject: [PATCH 045/594] cmd/vendor/golang.org/x/tools: update to 7d6b83ca Also, add a script for future updates. Change-Id: I2565d1f26532b9dd7cf9d8ce198ba08fb3d53407 Reviewed-on: https://go-review.googlesource.com/c/149604 Run-TryBot: Alan Donovan TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Michael Matloob --- .../x/tools/go/analysis/cmd/vet-lite/main.go | 47 ++- .../analysis/internal/analysisflags/flags.go | 42 ++- .../analysis/internal/analysisflags/help.go | 100 ++++++ .../internal/unitchecker/unitchecker.go | 2 +- .../go/analysis/passes/asmdecl/asmdecl.go | 13 +- .../go/analysis/passes/cgocall/cgocall.go | 296 ++++++++++++++---- .../analysis/passes/lostcancel/lostcancel.go | 10 +- .../tools/go/analysis/passes/printf/printf.go | 44 ++- .../tools/go/analysis/passes/printf/types.go | 23 +- .../analysis/passes/stdmethods/stdmethods.go | 55 +--- .../go/analysis/passes/unmarshal/unmarshal.go | 92 ++++++ .../x/tools/go/ast/astutil/imports.go | 54 ++-- src/cmd/vendor/update-xtools.sh | 27 ++ 13 files changed, 647 insertions(+), 158 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go create mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go create mode 100755 src/cmd/vendor/update-xtools.sh diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go index ae66a7df28dec..b4b0e631b9c6a 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go @@ -1,14 +1,16 @@ // The vet-lite command is a driver for static checkers conforming to // the golang.org/x/tools/go/analysis API. It must be run by go vet: // -// $ GOVETTOOL=$(which vet-lite) go vet +// $ go vet -vettool=$(which vet-lite) // // For a checker also capable of running standalone, use multichecker. package main import ( "flag" + "fmt" "log" + "os" "strings" "golang.org/x/tools/go/analysis" @@ -33,13 +35,13 @@ import ( "golang.org/x/tools/go/analysis/passes/stdmethods" "golang.org/x/tools/go/analysis/passes/structtag" "golang.org/x/tools/go/analysis/passes/tests" + "golang.org/x/tools/go/analysis/passes/unmarshal" "golang.org/x/tools/go/analysis/passes/unreachable" "golang.org/x/tools/go/analysis/passes/unsafeptr" "golang.org/x/tools/go/analysis/passes/unusedresult" ) var analyzers = []*analysis.Analyzer{ - // For now, just the traditional vet suite: asmdecl.Analyzer, assign.Analyzer, atomic.Analyzer, @@ -54,11 +56,11 @@ var analyzers = []*analysis.Analyzer{ nilfunc.Analyzer, pkgfact.Analyzer, printf.Analyzer, - // shadow.Analyzer, // experimental; not enabled by default shift.Analyzer, stdmethods.Analyzer, structtag.Analyzer, tests.Analyzer, + unmarshal.Analyzer, unreachable.Analyzer, unsafeptr.Analyzer, unusedresult.Analyzer, @@ -72,9 +74,48 @@ func main() { log.Fatal(err) } + // Flags for legacy vet compatibility. + // + // These flags, plus the shims in analysisflags, enable + // existing scripts that run vet to continue to work. + // + // Legacy vet had the concept of "experimental" checkers. There + // was exactly one, shadow, and it had to be explicitly enabled + // by the -shadow flag, which would of course disable all the + // other tristate flags, requiring the -all flag to reenable them. + // (By itself, -all did not enable all checkers.) + // The -all flag is no longer needed, so it is a no-op. + // + // The shadow analyzer has been removed from the suite, + // but can be run using these additional commands: + // $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow + // $ go vet -vettool=$(which shadow) + // Alternatively, one could build a multichecker containing all + // the desired checks (vet's suite + shadow) and run it in a + // single "go vet" command. + for _, name := range []string{"source", "v", "all"} { + _ = flag.Bool(name, false, "no effect (deprecated)") + } + + flag.Usage = func() { + fmt.Fprintln(os.Stderr, `Usage of vet: + vet unit.cfg # execute analysis specified by config file + vet help # general help + vet help name # help on specific analyzer and its flags`) + flag.PrintDefaults() + os.Exit(1) + } + analyzers = analysisflags.Parse(analyzers, true) args := flag.Args() + if len(args) == 0 { + flag.Usage() + } + if args[0] == "help" { + analysisflags.Help("vet", analyzers, args[1:]) + os.Exit(0) + } if len(args) != 1 || !strings.HasSuffix(args[0], ".cfg") { log.Fatalf("invalid command: want .cfg file (this reduced version of vet is intended to be run only by the 'go vet' command)") } diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go index d6c13f2685c8f..d915be6d255ff 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go @@ -20,7 +20,7 @@ import ( ) // Parse creates a flag for each of the analyzer's flags, -// including (in multi mode) an --analysis.enable flag, +// including (in multi mode) a flag named after the analyzer, // parses the flags, then filters and returns the list of // analyzers enabled by flags. func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { @@ -36,16 +36,15 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { for _, a := range analyzers { var prefix string - // Add -analysis.enable flag. + // Add -NAME flag to enable it. if multi { prefix = a.Name + "." enable := new(triState) - enableName := prefix + "enable" enableUsage := "enable " + a.Name + " analysis" - flag.Var(enable, enableName, enableUsage) + flag.Var(enable, a.Name, enableUsage) enabled[a] = enable - analysisFlags = append(analysisFlags, analysisFlag{enableName, true, enableUsage}) + analysisFlags = append(analysisFlags, analysisFlag{a.Name, true, enableUsage}) } a.Flags.VisitAll(func(f *flag.Flag) { @@ -69,6 +68,14 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { printflags := flag.Bool("flags", false, "print analyzer flags in JSON") addVersionFlag() + // Add shims for legacy vet flags. + for old, new := range vetLegacyFlags { + newFlag := flag.Lookup(new) + if newFlag != nil && flag.Lookup(old) == nil { + flag.Var(newFlag.Value, old, "deprecated alias for -"+new) + } + } + flag.Parse() // (ExitOnError) // -flags: print flags so that go vet knows which ones are legitimate. @@ -81,8 +88,8 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { os.Exit(0) } - // If any --foo.enable flag is true, run only those analyzers. Otherwise, - // if any --foo.enable flag is false, run all but those analyzers. + // If any -NAME flag is true, run only those analyzers. Otherwise, + // if any -NAME flag is false, run all but those analyzers. if multi { var hasTrue, hasFalse bool for _, ts := range enabled { @@ -195,7 +202,7 @@ func (ts *triState) Set(value string) error { b, err := strconv.ParseBool(value) if err != nil { // This error message looks poor but package "flag" adds - // "invalid boolean value %q for -foo.enable: %s" + // "invalid boolean value %q for -NAME: %s" return fmt.Errorf("want true or false") } if b { @@ -221,3 +228,22 @@ func (ts *triState) String() string { func (ts triState) IsBoolFlag() bool { return true } + +// Legacy flag support + +// vetLegacyFlags maps flags used by legacy vet to their corresponding +// new names. The old names will continue to work. +var vetLegacyFlags = map[string]string{ + // Analyzer name changes + "bool": "bools", + "buildtags": "buildtag", + "methods": "stdmethods", + "rangeloops": "loopclosure", + + // Analyzer flags + "compositewhitelist": "composites.whitelist", + "printfuncs": "printf.funcs", + "shadowstrict": "shadow.strict", + "unusedfuncs": "unusedresult.funcs", + "unusedstringmethods": "unusedresult.stringmethods", +} diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go new file mode 100644 index 0000000000000..dc7ba06650064 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go @@ -0,0 +1,100 @@ +package analysisflags + +import ( + "flag" + "fmt" + "io" + "log" + "os" + "path/filepath" + "sort" + "strings" + + "golang.org/x/tools/go/analysis" +) + +const usage = `PROGNAME is a tool for static analysis of Go programs. + +PROGNAME examines Go source code and reports suspicious constructs, such as Printf +calls whose arguments do not align with the format string. It uses heuristics +that do not guarantee all reports are genuine problems, but it can find errors +not caught by the compilers. + +Usage: PROGNAME [-flag] [package] +` + +// PrintUsage prints the usage message to stderr. +func PrintUsage(out io.Writer) { + progname := filepath.Base(os.Args[0]) + fmt.Fprintln(out, strings.Replace(usage, "PROGNAME", progname, -1)) +} + +// Help implements the help subcommand for a multichecker or vet-lite +// style command. The optional args specify the analyzers to describe. +// Help calls log.Fatal if no such analyzer exists. +func Help(progname string, analyzers []*analysis.Analyzer, args []string) { + // No args: show summary of all analyzers. + if len(args) == 0 { + PrintUsage(os.Stdout) + fmt.Println("Registered analyzers:") + fmt.Println() + sort.Slice(analyzers, func(i, j int) bool { + return analyzers[i].Name < analyzers[j].Name + }) + for _, a := range analyzers { + title := strings.Split(a.Doc, "\n\n")[0] + fmt.Printf(" %-12s %s\n", a.Name, title) + } + fmt.Println("\nBy default all analyzers are run.") + fmt.Println("To select specific analyzers, use the -NAME flag for each one,") + fmt.Println(" or -NAME=false to run all analyzers not explicitly disabled.") + + // Show only the core command-line flags. + fmt.Println("\nCore flags:") + fmt.Println() + fs := flag.NewFlagSet("", flag.ExitOnError) + flag.VisitAll(func(f *flag.Flag) { + if !strings.Contains(f.Name, ".") { + fs.Var(f.Value, f.Name, f.Usage) + } + }) + fs.PrintDefaults() + + fmt.Printf("\nTo see details and flags of a specific analyzer, run '%s help name'.\n", progname) + + return + } + + // Show help on specific analyzer(s). +outer: + for _, arg := range args { + for _, a := range analyzers { + if a.Name == arg { + paras := strings.Split(a.Doc, "\n\n") + title := paras[0] + fmt.Printf("%s: %s\n", a.Name, title) + + // Show only the flags relating to this analysis, + // properly prefixed. + first := true + fs := flag.NewFlagSet(a.Name, flag.ExitOnError) + a.Flags.VisitAll(func(f *flag.Flag) { + if first { + first = false + fmt.Println("\nAnalyzer flags:") + fmt.Println() + } + fs.Var(f.Value, a.Name+"."+f.Name, f.Usage) + }) + fs.PrintDefaults() + + if len(paras) > 1 { + fmt.Printf("\n%s\n", strings.Join(paras[1:], "\n\n")) + } + + continue outer + } + } + log.Fatalf("Analyzer %q not registered", arg) + } +} diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go index b67c943b4e261..32b50c1be00a2 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go @@ -6,7 +6,7 @@ // driver that analyzes a single compilation unit during a build. // It is invoked by a build system such as "go vet": // -// $ GOVETTOOL=$(which vet) go vet +// $ go vet -vettool=$(which vet) // // It supports the following command-line protocol: // diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go index 11dfbf6bc8e30..0f8abb5748127 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go @@ -243,16 +243,17 @@ Files: } } if arch == "" { - badf("%s: cannot determine architecture for assembly file") + log.Printf("%s: cannot determine architecture for assembly file", fname) continue Files } } fnName = m[2] - if pkgName := strings.TrimSpace(m[1]); pkgName != "" { - pathParts := strings.Split(pkgName, "∕") - pkgName = pathParts[len(pathParts)-1] - if pkgName != pass.Pkg.Path() { - badf("[%s] cannot check cross-package assembly function: %s is in package %s", arch, fnName, pkgName) + if pkgPath := strings.TrimSpace(m[1]); pkgPath != "" { + // The assembler uses Unicode division slash within + // identifiers to represent the directory separator. + pkgPath = strings.Replace(pkgPath, "∕", "/", -1) + if pkgPath != pass.Pkg.Path() { + log.Printf("%s:%d: [%s] cannot check cross-package assembly function: %s is in package %s", fname, lineno, arch, fnName, pkgPath) fn = nil fnName = "" continue diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go index 7eb24a4a91e61..993f1ce3c4b4a 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go @@ -9,18 +9,22 @@ package cgocall import ( "fmt" "go/ast" + "go/build" + "go/format" + "go/parser" "go/token" "go/types" "log" - "strings" + "os" + "strconv" "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" "golang.org/x/tools/go/analysis/passes/internal/analysisutil" - "golang.org/x/tools/go/ast/inspector" ) -const Doc = `detect some violations of the cgo pointer passing rules +const debug = false + +const doc = `detect some violations of the cgo pointer passing rules Check for invalid cgo pointer passing. This looks for code that uses cgo to call C code passing values @@ -31,24 +35,41 @@ or slice to C, either directly, or via a pointer, array, or struct.` var Analyzer = &analysis.Analyzer{ Name: "cgocall", - Doc: Doc, - Requires: []*analysis.Analyzer{inspect.Analyzer}, + Doc: doc, RunDespiteErrors: true, Run: run, } func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + if imports(pass.Pkg, "runtime/cgo") == nil { + return nil, nil // doesn't use cgo + } - nodeFilter := []ast.Node{ - (*ast.CallExpr)(nil), + cgofiles, info, err := typeCheckCgoSourceFiles(pass.Fset, pass.Pkg, pass.Files, pass.TypesInfo) + if err != nil { + return nil, err + } + for _, f := range cgofiles { + checkCgo(pass.Fset, f, info, pass.Reportf) } - inspect.WithStack(nodeFilter, func(n ast.Node, push bool, stack []ast.Node) bool { - if !push { + return nil, nil +} + +func checkCgo(fset *token.FileSet, f *ast.File, info *types.Info, reportf func(token.Pos, string, ...interface{})) { + ast.Inspect(f, func(n ast.Node) bool { + call, ok := n.(*ast.CallExpr) + if !ok { return true } - call, name := findCall(pass.Fset, stack) - if call == nil { + + // Is this a C.f() call? + var name string + if sel, ok := analysisutil.Unparen(call.Fun).(*ast.SelectorExpr); ok { + if id, ok := sel.X.(*ast.Ident); ok && id.Name == "C" { + name = sel.Sel.Name + } + } + if name == "" { return true // not a call we need to check } @@ -57,92 +78,210 @@ func run(pass *analysis.Pass) (interface{}, error) { return true } - if false { - fmt.Printf("%s: inner call to C.%s\n", pass.Fset.Position(n.Pos()), name) - fmt.Printf("%s: outer call to C.%s\n", pass.Fset.Position(call.Lparen), name) + if debug { + log.Printf("%s: call to C.%s", fset.Position(call.Lparen), name) } for _, arg := range call.Args { - if !typeOKForCgoCall(cgoBaseType(pass.TypesInfo, arg), make(map[types.Type]bool)) { - pass.Reportf(arg.Pos(), "possibly passing Go type with embedded pointer to C") + if !typeOKForCgoCall(cgoBaseType(info, arg), make(map[types.Type]bool)) { + reportf(arg.Pos(), "possibly passing Go type with embedded pointer to C") break } // Check for passing the address of a bad type. if conv, ok := arg.(*ast.CallExpr); ok && len(conv.Args) == 1 && - isUnsafePointer(pass.TypesInfo, conv.Fun) { + isUnsafePointer(info, conv.Fun) { arg = conv.Args[0] } if u, ok := arg.(*ast.UnaryExpr); ok && u.Op == token.AND { - if !typeOKForCgoCall(cgoBaseType(pass.TypesInfo, u.X), make(map[types.Type]bool)) { - pass.Reportf(arg.Pos(), "possibly passing Go type with embedded pointer to C") + if !typeOKForCgoCall(cgoBaseType(info, u.X), make(map[types.Type]bool)) { + reportf(arg.Pos(), "possibly passing Go type with embedded pointer to C") break } } } return true }) - return nil, nil } -// findCall returns the CallExpr that we need to check, which may not be -// the same as the one we're currently visiting, due to code generation. -// It also returns the name of the function, such as "f" for C.f(...). -// -// This checker was initially written in vet to inpect unprocessed cgo -// source files using partial type information. However, Analyzers in -// the new analysis API are presented with the type-checked, processed -// Go ASTs resulting from cgo processing files, so we must choose -// between: +// typeCheckCgoSourceFiles returns type-checked syntax trees for the raw +// cgo files of a package (those that import "C"). Such files are not +// Go, so there may be gaps in type information around C.f references. // -// a) locating the cgo file (e.g. from //line directives) -// and working with that, or -// b) working with the file generated by cgo. +// This checker was initially written in vet to inpect raw cgo source +// files using partial type information. However, Analyzers in the new +// analysis API are presented with the type-checked, "cooked" Go ASTs +// resulting from cgo-processing files, so we must choose between +// working with the cooked file generated by cgo (which was tried but +// proved fragile) or locating the raw cgo file (e.g. from //line +// directives) and working with that, as we now do. // -// We cannot use (a) because it does not provide type information, which -// the analyzer needs, and it is infeasible for the analyzer to run the -// type checker on this file. Thus we choose (b), which is fragile, -// because the checker may need to change each time the cgo processor -// changes. +// Specifically, we must type-check the raw cgo source files (or at +// least the subtrees needed for this analyzer) in an environment that +// simulates the rest of the already type-checked package. // -// Consider a cgo source file containing this header: +// For example, for each raw cgo source file in the original package, +// such as this one: // -// /* void f(void *x, *y); */ -// import "C" +// package p +// import "C" +// import "fmt" +// type T int +// const k = 3 +// var x, y = fmt.Println() +// func f() { ... } +// func g() { ... C.malloc(k) ... } +// func (T) f(int) string { ... } // -// The cgo tool expands a call such as: +// we synthesize a new ast.File, shown below, that dot-imports the +// orginal "cooked" package using a special name ("·this·"), so that all +// references to package members resolve correctly. (References to +// unexported names cause an "unexported" error, which we ignore.) // -// C.f(x, y) +// To avoid shadowing names imported from the cooked package, +// package-level declarations in the new source file are modified so +// that they do not declare any names. +// (The cgocall analysis is concerned with uses, not declarations.) +// Specifically, type declarations are discarded; +// all names in each var and const declaration are blanked out; +// each method is turned into a regular function by turning +// the receiver into the first parameter; +// and all functions are renamed to "_". // -// to this: +// package p +// import . "·this·" // declares T, k, x, y, f, g, T.f +// import "C" +// import "fmt" +// const _ = 3 +// var _, _ = fmt.Println() +// func _() { ... } +// func _() { ... C.malloc(k) ... } +// func _(T, int) string { ... } // -// 1 func(param0, param1 unsafe.Pointer) { -// 2 ... various checks on params ... -// 3 (_Cfunc_f)(param0, param1) -// 4 }(x, y) +// In this way, the raw function bodies and const/var initializer +// expressions are preserved but refer to the "cooked" objects imported +// from "·this·", and none of the transformed package-level declarations +// actually declares anything. In the example above, the reference to k +// in the argument of the call to C.malloc resolves to "·this·".k, which +// has an accurate type. // -// We first locate the _Cfunc_f call on line 3, then -// walk up the stack of enclosing nodes until we find -// the call on line 4. +// This approach could in principle be generalized to more complex +// analyses on raw cgo files. One could synthesize a "C" package so that +// C.f would resolve to "·this·"._C_func_f, for example. But we have +// limited ourselves here to preserving function bodies and initializer +// expressions since that is all that the cgocall analyzer needs. // -func findCall(fset *token.FileSet, stack []ast.Node) (*ast.CallExpr, string) { - last := len(stack) - 1 - call := stack[last].(*ast.CallExpr) - if id, ok := analysisutil.Unparen(call.Fun).(*ast.Ident); ok { - if name := strings.TrimPrefix(id.Name, "_Cfunc_"); name != id.Name { - // Find the outer call with the arguments (x, y) we want to check. - for i := last - 1; i >= 0; i-- { - if outer, ok := stack[i].(*ast.CallExpr); ok { - return outer, name +func typeCheckCgoSourceFiles(fset *token.FileSet, pkg *types.Package, files []*ast.File, info *types.Info) ([]*ast.File, *types.Info, error) { + const thispkg = "·this·" + + // Which files are cgo files? + var cgoFiles []*ast.File + importMap := map[string]*types.Package{thispkg: pkg} + for _, raw := range files { + // If f is a cgo-generated file, Position reports + // the original file, honoring //line directives. + filename := fset.Position(raw.Pos()).Filename + f, err := parser.ParseFile(fset, filename, nil, parser.Mode(0)) + if err != nil { + return nil, nil, fmt.Errorf("can't parse raw cgo file: %v", err) + } + found := false + for _, spec := range f.Imports { + if spec.Path.Value == `"C"` { + found = true + break + } + } + if !found { + continue // not a cgo file + } + + // Record the original import map. + for _, spec := range raw.Imports { + path, _ := strconv.Unquote(spec.Path.Value) + importMap[path] = imported(info, spec) + } + + // Add special dot-import declaration: + // import . "·this·" + var decls []ast.Decl + decls = append(decls, &ast.GenDecl{ + Tok: token.IMPORT, + Specs: []ast.Spec{ + &ast.ImportSpec{ + Name: &ast.Ident{Name: "."}, + Path: &ast.BasicLit{ + Kind: token.STRING, + Value: strconv.Quote(thispkg), + }, + }, + }, + }) + + // Transform declarations from the raw cgo file. + for _, decl := range f.Decls { + switch decl := decl.(type) { + case *ast.GenDecl: + switch decl.Tok { + case token.TYPE: + // Discard type declarations. + continue + case token.IMPORT: + // Keep imports. + case token.VAR, token.CONST: + // Blank the declared var/const names. + for _, spec := range decl.Specs { + spec := spec.(*ast.ValueSpec) + for i := range spec.Names { + spec.Names[i].Name = "_" + } + } + } + case *ast.FuncDecl: + // Blank the declared func name. + decl.Name.Name = "_" + + // Turn a method receiver: func (T) f(P) R {...} + // into regular parameter: func _(T, P) R {...} + if decl.Recv != nil { + var params []*ast.Field + params = append(params, decl.Recv.List...) + params = append(params, decl.Type.Params.List...) + decl.Type.Params.List = params + decl.Recv = nil } } - // This shouldn't happen. - // Perhaps the code generator has changed? - log.Printf("%s: can't find outer call for C.%s(...)", - fset.Position(call.Lparen), name) + decls = append(decls, decl) + } + f.Decls = decls + if debug { + format.Node(os.Stderr, fset, f) // debugging } + cgoFiles = append(cgoFiles, f) + } + if cgoFiles == nil { + return nil, nil, nil // nothing to do (can't happen?) + } + + // Type-check the synthetic files. + tc := &types.Config{ + FakeImportC: true, + Importer: importerFunc(func(path string) (*types.Package, error) { + return importMap[path], nil + }), + // TODO(adonovan): Sizes should probably be provided by analysis.Pass. + Sizes: types.SizesFor("gc", build.Default.GOARCH), + Error: func(error) {}, // ignore errors (e.g. unused import) + } + + // It's tempting to record the new types in the + // existing pass.TypesInfo, but we don't own it. + altInfo := &types.Info{ + Types: make(map[ast.Expr]types.TypeAndValue), } - return nil, "" + tc.Check(pkg.Path(), fset, cgoFiles, altInfo) + + return cgoFiles, altInfo, nil } // cgoBaseType tries to look through type conversions involving @@ -224,3 +363,28 @@ func isUnsafePointer(info *types.Info, e ast.Expr) bool { t := info.Types[e].Type return t != nil && t.Underlying() == types.Typ[types.UnsafePointer] } + +type importerFunc func(path string) (*types.Package, error) + +func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } + +// TODO(adonovan): make this a library function or method of Info. +func imported(info *types.Info, spec *ast.ImportSpec) *types.Package { + obj, ok := info.Implicits[spec] + if !ok { + obj = info.Defs[spec.Name] // renaming import + } + return obj.(*types.PkgName).Imported() +} + +// imports reports whether pkg has path among its direct imports. +// It returns the imported package if so, or nil if not. +// TODO(adonovan): move to analysisutil. +func imports(pkg *types.Package, path string) *types.Package { + for _, imp := range pkg.Imports() { + if imp.Path() == path { + return imp + } + } + return nil +} diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go index fcf9f553a9f0b..996ecc4dd1e1e 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go @@ -132,11 +132,17 @@ func runFunc(pass *analysis.Pass, node ast.Node) { var sig *types.Signature switch node := node.(type) { case *ast.FuncDecl: - g = cfgs.FuncDecl(node) sig, _ = pass.TypesInfo.Defs[node.Name].Type().(*types.Signature) + if node.Name.Name == "main" && sig.Recv() == nil && pass.Pkg.Name() == "main" { + // Returning from main.main terminates the process, + // so there's no need to cancel contexts. + return + } + g = cfgs.FuncDecl(node) + case *ast.FuncLit: - g = cfgs.FuncLit(node) sig, _ = pass.TypesInfo.Types[node.Type].Type.(*types.Signature) + g = cfgs.FuncLit(node) } if sig == nil { return // missing type information diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go index 23f634fd98eb0..4b761e25b5b79 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go @@ -277,18 +277,56 @@ func checkPrintfFwd(pass *analysis.Pass, w *printfWrapper, call *ast.CallExpr, k // or case-insensitive identifiers such as "errorf". // // The -funcs flag adds to this set. +// +// The set below includes facts for many important standard library +// functions, even though the analysis is capable of deducing that, for +// example, fmt.Printf forwards to fmt.Fprintf. We avoid relying on the +// driver applying analyzers to standard packages because "go vet" does +// not do so with gccgo, and nor do some other build systems. +// TODO(adonovan): eliminate the redundant facts once this restriction +// is lifted. +// var isPrint = stringSet{ "fmt.Errorf": true, "fmt.Fprint": true, "fmt.Fprintf": true, "fmt.Fprintln": true, - "fmt.Print": true, // technically these three - "fmt.Printf": true, // are redundant because they - "fmt.Println": true, // forward to Fprint{,f,ln} + "fmt.Print": true, + "fmt.Printf": true, + "fmt.Println": true, "fmt.Sprint": true, "fmt.Sprintf": true, "fmt.Sprintln": true, + "runtime/trace.Logf": true, + + "log.Print": true, + "log.Printf": true, + "log.Println": true, + "log.Fatal": true, + "log.Fatalf": true, + "log.Fatalln": true, + "log.Panic": true, + "log.Panicf": true, + "log.Panicln": true, + "(*log.Logger).Fatal": true, + "(*log.Logger).Fatalf": true, + "(*log.Logger).Fatalln": true, + "(*log.Logger).Panic": true, + "(*log.Logger).Panicf": true, + "(*log.Logger).Panicln": true, + "(*log.Logger).Print": true, + "(*log.Logger).Printf": true, + "(*log.Logger).Println": true, + + "(*testing.common).Error": true, + "(*testing.common).Errorf": true, + "(*testing.common).Fatal": true, + "(*testing.common).Fatalf": true, + "(*testing.common).Log": true, + "(*testing.common).Logf": true, + "(*testing.common).Skip": true, + "(*testing.common).Skipf": true, // *testing.T and B are detected by induction, but testing.TB is // an interface and the inference can't follow dynamic calls. "(testing.TB).Error": true, diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go index 701d08bea2bb1..0ebc8107f3db8 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go @@ -97,12 +97,25 @@ func matchArgTypeInternal(pass *analysis.Pass, t printfArgType, typ types.Type, if t == argPointer { return true } - // If it's pointer to struct, that's equivalent in our analysis to whether we can print the struct. - if str, ok := typ.Elem().Underlying().(*types.Struct); ok { - return matchStructArgType(pass, t, str, arg, inProgress) + + under := typ.Elem().Underlying() + switch under.(type) { + case *types.Struct: // see below + case *types.Array: // see below + case *types.Slice: // see below + case *types.Map: // see below + default: + // Check whether the rest can print pointers. + return t&argPointer != 0 } - // Check whether the rest can print pointers. - return t&argPointer != 0 + // If it's a top-level pointer to a struct, array, slice, or + // map, that's equivalent in our analysis to whether we can + // print the type being pointed to. Pointers in nested levels + // are not supported to minimize fmt running into loops. + if len(inProgress) > 1 { + return false + } + return matchArgTypeInternal(pass, t, under, arg, inProgress) case *types.Struct: return matchStructArgType(pass, t, typ, arg, inProgress) diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go index eead289e4ccba..b61c32208bc24 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go @@ -7,10 +7,7 @@ package stdmethods import ( - "bytes" - "fmt" "go/ast" - "go/printer" "go/token" "go/types" "strings" @@ -95,12 +92,12 @@ func run(pass *analysis.Pass) (interface{}, error) { switch n := n.(type) { case *ast.FuncDecl: if n.Recv != nil { - canonicalMethod(pass, n.Name, n.Type) + canonicalMethod(pass, n.Name) } case *ast.InterfaceType: for _, field := range n.Methods.List { for _, id := range field.Names { - canonicalMethod(pass, id, field.Type.(*ast.FuncType)) + canonicalMethod(pass, id) } } } @@ -108,7 +105,7 @@ func run(pass *analysis.Pass) (interface{}, error) { return nil, nil } -func canonicalMethod(pass *analysis.Pass, id *ast.Ident, t *ast.FuncType) { +func canonicalMethod(pass *analysis.Pass, id *ast.Ident) { // Expected input/output. expect, ok := canonicalMethods[id.Name] if !ok { @@ -116,11 +113,9 @@ func canonicalMethod(pass *analysis.Pass, id *ast.Ident, t *ast.FuncType) { } // Actual input/output - args := typeFlatten(t.Params.List) - var results []ast.Expr - if t.Results != nil { - results = typeFlatten(t.Results.List) - } + sign := pass.TypesInfo.Defs[id].Type().(*types.Signature) + args := sign.Params() + results := sign.Results() // Do the =s (if any) all match? if !matchParams(pass, expect.args, args, "=") || !matchParams(pass, expect.results, results, "=") { @@ -136,11 +131,7 @@ func canonicalMethod(pass *analysis.Pass, id *ast.Ident, t *ast.FuncType) { expectFmt += " (" + argjoin(expect.results) + ")" } - var buf bytes.Buffer - if err := printer.Fprint(&buf, pass.Fset, t); err != nil { - fmt.Fprintf(&buf, "<%s>", err) - } - actual := buf.String() + actual := types.TypeString(sign, (*types.Package).Name) actual = strings.TrimPrefix(actual, "func") actual = id.Name + actual @@ -159,45 +150,27 @@ func argjoin(x []string) string { return strings.Join(y, ", ") } -// Turn parameter list into slice of types -// (in the ast, types are Exprs). -// Have to handle f(int, bool) and f(x, y, z int) -// so not a simple 1-to-1 conversion. -func typeFlatten(l []*ast.Field) []ast.Expr { - var t []ast.Expr - for _, f := range l { - if len(f.Names) == 0 { - t = append(t, f.Type) - continue - } - for range f.Names { - t = append(t, f.Type) - } - } - return t -} - // Does each type in expect with the given prefix match the corresponding type in actual? -func matchParams(pass *analysis.Pass, expect []string, actual []ast.Expr, prefix string) bool { +func matchParams(pass *analysis.Pass, expect []string, actual *types.Tuple, prefix string) bool { for i, x := range expect { if !strings.HasPrefix(x, prefix) { continue } - if i >= len(actual) { + if i >= actual.Len() { return false } - if !matchParamType(pass.Fset, pass.Pkg, x, actual[i]) { + if !matchParamType(pass.Fset, pass.Pkg, x, actual.At(i).Type()) { return false } } - if prefix == "" && len(actual) > len(expect) { + if prefix == "" && actual.Len() > len(expect) { return false } return true } // Does this one type match? -func matchParamType(fset *token.FileSet, pkg *types.Package, expect string, actual ast.Expr) bool { +func matchParamType(fset *token.FileSet, pkg *types.Package, expect string, actual types.Type) bool { expect = strings.TrimPrefix(expect, "=") // Strip package name if we're in that package. if n := len(pkg.Name()); len(expect) > n && expect[:n] == pkg.Name() && expect[n] == '.' { @@ -205,7 +178,5 @@ func matchParamType(fset *token.FileSet, pkg *types.Package, expect string, actu } // Overkill but easy. - var buf bytes.Buffer - printer.Fprint(&buf, fset, actual) - return buf.String() == expect + return actual.String() == expect } diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go new file mode 100644 index 0000000000000..6cf4358ab9a31 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go @@ -0,0 +1,92 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The unmarshal package defines an Analyzer that checks for passing +// non-pointer or non-interface types to unmarshal and decode functions. +package unmarshal + +import ( + "go/ast" + "go/types" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" + "golang.org/x/tools/go/types/typeutil" +) + +const doc = `report passing non-pointer or non-interface values to unmarshal + +The unmarshal analysis reports calls to functions such as json.Unmarshal +in which the argument type is not a pointer or an interface.` + +var Analyzer = &analysis.Analyzer{ + Name: "unmarshal", + Doc: doc, + Requires: []*analysis.Analyzer{inspect.Analyzer}, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + + nodeFilter := []ast.Node{ + (*ast.CallExpr)(nil), + } + inspect.Preorder(nodeFilter, func(n ast.Node) { + call := n.(*ast.CallExpr) + fn := typeutil.StaticCallee(pass.TypesInfo, call) + if fn == nil { + return // not a static call + } + + // Classify the callee (without allocating memory). + argidx := -1 + recv := fn.Type().(*types.Signature).Recv() + if fn.Name() == "Unmarshal" && recv == nil { + // "encoding/json".Unmarshal + // "encoding/xml".Unmarshal + switch fn.Pkg().Path() { + case "encoding/json", "encoding/xml": + argidx = 1 // func([]byte, interface{}) + } + } else if fn.Name() == "Decode" && recv != nil { + // (*"encoding/json".Decoder).Decode + // (* "encoding/gob".Decoder).Decode + // (* "encoding/xml".Decoder).Decode + t := recv.Type() + if ptr, ok := t.(*types.Pointer); ok { + t = ptr.Elem() + } + tname := t.(*types.Named).Obj() + if tname.Name() == "Decoder" { + switch tname.Pkg().Path() { + case "encoding/json", "encoding/xml", "encoding/gob": + argidx = 0 // func(interface{}) + } + } + } + if argidx < 0 { + return // not a function we are interested in + } + + if len(call.Args) < argidx+1 { + return // not enough arguments, e.g. called with return values of another function + } + + t := pass.TypesInfo.Types[call.Args[argidx]].Type + switch t.Underlying().(type) { + case *types.Pointer, *types.Interface: + return + } + + switch argidx { + case 0: + pass.Reportf(call.Lparen, "call of %s passes non-pointer", fn.Name()) + case 1: + pass.Reportf(call.Lparen, "call of %s passes non-pointer as second argument", fn.Name()) + } + }) + return nil, nil +} diff --git a/src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go index 04ad6795d921e..3e4b195368b35 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go +++ b/src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go @@ -14,26 +14,26 @@ import ( ) // AddImport adds the import path to the file f, if absent. -func AddImport(fset *token.FileSet, f *ast.File, ipath string) (added bool) { - return AddNamedImport(fset, f, "", ipath) +func AddImport(fset *token.FileSet, f *ast.File, path string) (added bool) { + return AddNamedImport(fset, f, "", path) } -// AddNamedImport adds the import path to the file f, if absent. +// AddNamedImport adds the import with the given name and path to the file f, if absent. // If name is not empty, it is used to rename the import. // // For example, calling // AddNamedImport(fset, f, "pathpkg", "path") // adds // import pathpkg "path" -func AddNamedImport(fset *token.FileSet, f *ast.File, name, ipath string) (added bool) { - if imports(f, ipath) { +func AddNamedImport(fset *token.FileSet, f *ast.File, name, path string) (added bool) { + if imports(f, name, path) { return false } newImport := &ast.ImportSpec{ Path: &ast.BasicLit{ Kind: token.STRING, - Value: strconv.Quote(ipath), + Value: strconv.Quote(path), }, } if name != "" { @@ -43,14 +43,14 @@ func AddNamedImport(fset *token.FileSet, f *ast.File, name, ipath string) (added // Find an import decl to add to. // The goal is to find an existing import // whose import path has the longest shared - // prefix with ipath. + // prefix with path. var ( bestMatch = -1 // length of longest shared prefix lastImport = -1 // index in f.Decls of the file's final import decl impDecl *ast.GenDecl // import decl containing the best match impIndex = -1 // spec index in impDecl containing the best match - isThirdPartyPath = isThirdParty(ipath) + isThirdPartyPath = isThirdParty(path) ) for i, decl := range f.Decls { gen, ok := decl.(*ast.GenDecl) @@ -81,7 +81,7 @@ func AddNamedImport(fset *token.FileSet, f *ast.File, name, ipath string) (added for j, spec := range gen.Specs { impspec := spec.(*ast.ImportSpec) p := importPath(impspec) - n := matchLen(p, ipath) + n := matchLen(p, path) if n > bestMatch || (bestMatch == 0 && !seenAnyThirdParty && isThirdPartyPath) { bestMatch = n impDecl = gen @@ -197,11 +197,13 @@ func isThirdParty(importPath string) bool { } // DeleteImport deletes the import path from the file f, if present. +// If there are duplicate import declarations, all matching ones are deleted. func DeleteImport(fset *token.FileSet, f *ast.File, path string) (deleted bool) { return DeleteNamedImport(fset, f, "", path) } // DeleteNamedImport deletes the import with the given name and path from the file f, if present. +// If there are duplicate import declarations, all matching ones are deleted. func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (deleted bool) { var delspecs []*ast.ImportSpec var delcomments []*ast.CommentGroup @@ -216,13 +218,7 @@ func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (del for j := 0; j < len(gen.Specs); j++ { spec := gen.Specs[j] impspec := spec.(*ast.ImportSpec) - if impspec.Name == nil && name != "" { - continue - } - if impspec.Name != nil && impspec.Name.Name != name { - continue - } - if importPath(impspec) != path { + if importName(impspec) != name || importPath(impspec) != path { continue } @@ -383,9 +379,14 @@ func (fn visitFn) Visit(node ast.Node) ast.Visitor { return fn } -// imports returns true if f imports path. -func imports(f *ast.File, path string) bool { - return importSpec(f, path) != nil +// imports reports whether f has an import with the specified name and path. +func imports(f *ast.File, name, path string) bool { + for _, s := range f.Imports { + if importName(s) == name && importPath(s) == path { + return true + } + } + return false } // importSpec returns the import spec if f imports path, @@ -399,14 +400,23 @@ func importSpec(f *ast.File, path string) *ast.ImportSpec { return nil } +// importName returns the name of s, +// or "" if the import is not named. +func importName(s *ast.ImportSpec) string { + if s.Name == nil { + return "" + } + return s.Name.Name +} + // importPath returns the unquoted import path of s, // or "" if the path is not properly quoted. func importPath(s *ast.ImportSpec) string { t, err := strconv.Unquote(s.Path.Value) - if err == nil { - return t + if err != nil { + return "" } - return "" + return t } // declImports reports whether gen contains an import of path. diff --git a/src/cmd/vendor/update-xtools.sh b/src/cmd/vendor/update-xtools.sh new file mode 100755 index 0000000000000..0097a729918a3 --- /dev/null +++ b/src/cmd/vendor/update-xtools.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# +# update-xtools.sh: idempotently update the vendored +# copy of the x/tools repository used by vet-lite. + +set -u + +analysis=$(go list -f {{.Dir}} golang.org/x/tools/go/analysis) || + { echo "Add golang.org/x/tools to your GOPATH"; exit 1; } >&2 +xtools=$(dirname $(dirname $analysis)) + +vendor=$(dirname $0) + +go list -f '{{.ImportPath}} {{.Dir}}' -deps golang.org/x/tools/go/analysis/cmd/vet-lite | + grep golang.org/x/tools | + while read path dir + do + mkdir -p $vendor/$path + cp $dir/* -t $vendor/$path 2>/dev/null # ignore errors from subdirectories + rm -f $vendor/$path/*_test.go + git add $vendor/$path + done + +echo "Copied $xtools@$(cd $analysis && git rev-parse --short HEAD) to $vendor" >&2 + +go build -o /dev/null ./golang.org/x/tools/go/analysis/cmd/vet-lite || + { echo "Failed to build vet-lite"; exit 1; } >&2 From 2de53906e199a744605ca6a0c6cc81653c6e4f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Wed, 14 Nov 2018 20:48:40 +0100 Subject: [PATCH 046/594] internal/cpu: move GODEBUGCPU options into GODEBUG MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change internal/cpu feature configuration to use GODEBUG=cpu.feature1=value,cpu.feature2=value... instead of GODEBUGCPU=feature1=value,feature2=value... . This is not a backwards compatibility breaking change since GODEBUGCPU was introduced in go1.11 as an undocumented compiler experiment. Fixes #28757 Change-Id: Ib21b3fed2334baeeb061a722ab1eb513d1137e87 Reviewed-on: https://go-review.googlesource.com/c/149578 Run-TryBot: Martin Möhrmann TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/internal/cpu/cpu.go | 29 +++++++++++++++++------------ src/internal/cpu/cpu_test.go | 8 ++++---- src/internal/cpu/cpu_x86_test.go | 12 ++++++------ src/runtime/proc.go | 8 ++++---- 4 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/internal/cpu/cpu.go b/src/internal/cpu/cpu.go index e210a6db9ec0b..5ac0989d79bd4 100644 --- a/src/internal/cpu/cpu.go +++ b/src/internal/cpu/cpu.go @@ -6,7 +6,8 @@ // used by the Go standard library. package cpu -// DebugOptions is set to true by the runtime if the OS supports GODEBUGCPU. +// DebugOptions is set to true by the runtime if the OS supports reading +// GODEBUG early in runtime startup. // This should not be changed after it is initialized. var DebugOptions bool @@ -130,13 +131,14 @@ type s390x struct { // Initialize examines the processor and sets the relevant variables above. // This is called by the runtime package early in program initialization, -// before normal init functions are run. env is set by runtime if the OS supports GODEBUGCPU. +// before normal init functions are run. env is set by runtime if the OS supports +// cpu feature options in GODEBUG. func Initialize(env string) { doinit() processOptions(env) } -// options contains the cpu debug options that can be used in GODEBUGCPU. +// options contains the cpu debug options that can be used in GODEBUG. // Options are arch dependent and are added by the arch specific doinit functions. // Features that are mandatory for the specific GOARCH should not be added to options // (e.g. SSE2 on amd64). @@ -146,16 +148,16 @@ var options []option type option struct { Name string Feature *bool - Specified bool // whether feature value was specified in GODEBUGCPU + Specified bool // whether feature value was specified in GODEBUG Enable bool // whether feature should be enabled Required bool // whether feature is mandatory and can not be disabled } // processOptions enables or disables CPU feature values based on the parsed env string. -// The env string is expected to be of the form feature1=value1,feature2=value2... +// The env string is expected to be of the form cpu.feature1=value1,cpu.feature2=value2... // where feature names is one of the architecture specifc list stored in the // cpu packages options variable and values are either 'on' or 'off'. -// If env contains all=off then all cpu features referenced through the options +// If env contains cpu.all=off then all cpu features referenced through the options // variable are disabled. Other feature names and values result in warning messages. func processOptions(env string) { field: @@ -167,12 +169,15 @@ field: } else { field, env = env[:i], env[i+1:] } + if len(field) < 4 || field[:4] != "cpu." { + continue + } i = indexByte(field, '=') if i < 0 { - print("GODEBUGCPU: no value specified for \"", field, "\"\n") + print("GODEBUG: no value specified for \"", field, "\"\n") continue } - key, value := field[:i], field[i+1:] + key, value := field[4:i], field[i+1:] // e.g. "SSE2", "on" var enable bool switch value { @@ -181,7 +186,7 @@ field: case "off": enable = false default: - print("GODEBUGCPU: value \"", value, "\" not supported for option ", key, "\n") + print("GODEBUG: value \"", value, "\" not supported for cpu option \"", key, "\"\n") continue field } @@ -201,7 +206,7 @@ field: } } - print("GODEBUGCPU: unknown cpu feature \"", key, "\"\n") + print("GODEBUG: unknown cpu feature \"", key, "\"\n") } for _, o := range options { @@ -210,12 +215,12 @@ field: } if o.Enable && !*o.Feature { - print("GODEBUGCPU: can not enable \"", o.Name, "\", missing hardware support\n") + print("GODEBUG: can not enable \"", o.Name, "\", missing CPU support\n") continue } if !o.Enable && o.Required { - print("GODEBUGCPU: can not disable \"", o.Name, "\", required feature\n") + print("GODEBUG: can not disable \"", o.Name, "\", required CPU feature\n") continue } diff --git a/src/internal/cpu/cpu_test.go b/src/internal/cpu/cpu_test.go index b01e212ce8b5c..e09bd2d8b99f7 100644 --- a/src/internal/cpu/cpu_test.go +++ b/src/internal/cpu/cpu_test.go @@ -41,7 +41,7 @@ func runDebugOptionsTest(t *testing.T, test string, options string) { testenv.MustHaveExec(t) - env := "GODEBUGCPU=" + options + env := "GODEBUG=" + options cmd := exec.Command(os.Args[0], "-test.run="+test) cmd.Env = append(cmd.Env, env) @@ -58,14 +58,14 @@ func runDebugOptionsTest(t *testing.T, test string, options string) { } func TestDisableAllCapabilities(t *testing.T) { - runDebugOptionsTest(t, "TestAllCapabilitiesDisabled", "all=off") + runDebugOptionsTest(t, "TestAllCapabilitiesDisabled", "cpu.all=off") } func TestAllCapabilitiesDisabled(t *testing.T) { MustHaveDebugOptionsSupport(t) - if os.Getenv("GODEBUGCPU") != "all=off" { - t.Skipf("skipping test: GODEBUGCPU=all=off not set") + if os.Getenv("GODEBUG") != "cpu.all=off" { + t.Skipf("skipping test: GODEBUG=cpu.all=off not set") } for _, o := range Options { diff --git a/src/internal/cpu/cpu_x86_test.go b/src/internal/cpu/cpu_x86_test.go index a79be41811f46..9e93d1af5d72c 100644 --- a/src/internal/cpu/cpu_x86_test.go +++ b/src/internal/cpu/cpu_x86_test.go @@ -20,14 +20,14 @@ func TestX86ifAVX2hasAVX(t *testing.T) { } func TestDisableSSE2(t *testing.T) { - runDebugOptionsTest(t, "TestSSE2DebugOption", "sse2=off") + runDebugOptionsTest(t, "TestSSE2DebugOption", "cpu.sse2=off") } func TestSSE2DebugOption(t *testing.T) { MustHaveDebugOptionsSupport(t) - if os.Getenv("GODEBUGCPU") != "sse2=off" { - t.Skipf("skipping test: GODEBUGCPU=sse2=off not set") + if os.Getenv("GODEBUG") != "cpu.sse2=off" { + t.Skipf("skipping test: GODEBUG=cpu.sse2=off not set") } want := runtime.GOARCH != "386" // SSE2 can only be disabled on 386. @@ -37,14 +37,14 @@ func TestSSE2DebugOption(t *testing.T) { } func TestDisableSSE3(t *testing.T) { - runDebugOptionsTest(t, "TestSSE3DebugOption", "sse3=off") + runDebugOptionsTest(t, "TestSSE3DebugOption", "cpu.sse3=off") } func TestSSE3DebugOption(t *testing.T) { MustHaveDebugOptionsSupport(t) - if os.Getenv("GODEBUGCPU") != "sse3=off" { - t.Skipf("skipping test: GODEBUGCPU=sse3=off not set") + if os.Getenv("GODEBUG") != "cpu.sse3=off" { + t.Skipf("skipping test: GODEBUG=cpu.sse3=off not set") } want := false diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 41ac75d3dd992..b78eff8ff6c52 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -476,10 +476,10 @@ const ( _GoidCacheBatch = 16 ) -// cpuinit extracts the environment variable GODEBUGCPU from the environment on -// Linux and Darwin and calls internal/cpu.Initialize. +// cpuinit extracts the environment variable GODEBUG from the environment on +// Unix-like operating systems and calls internal/cpu.Initialize. func cpuinit() { - const prefix = "GODEBUGCPU=" + const prefix = "GODEBUG=" var env string switch GOOS { @@ -487,7 +487,7 @@ func cpuinit() { cpu.DebugOptions = true // Similar to goenv_unix but extracts the environment value for - // GODEBUGCPU directly. + // GODEBUG directly. // TODO(moehrmann): remove when general goenvs() can be called before cpuinit() n := int32(0) for argv_index(argv, argc+1+n) != nil { From 8dba66dfeb8eb19b075d45a84dae9bcdddb347d6 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 14 Nov 2018 15:45:27 -0500 Subject: [PATCH 047/594] cmd/link: fix isStmt DWARF info When CL 147160 introduced function ABIs encoded as symbol versions in the linker, it became slightly more complicated to look up derived DWARF symbols. It fixed this by introducing a dwarfFuncSym function to hide this logic, but missed one derived lookup that was done in the object reader itself. As a result, we lost the isStmt tables from the compiler, so every PC was marked as a statement in the DWARF info. Fix this by moving this derived lookup out of the object reader and into the DWARF code and calling dwarfFuncSym to get the correctly versioned symbol. Should fix the linux-amd64-longtest builder. Updates #27539. Change-Id: If40d5ba28bab1918ac4ad18fbb5103666b6d978b Reviewed-on: https://go-review.googlesource.com/c/149605 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/link/internal/ld/dwarf.go | 7 +++++-- src/cmd/link/internal/objfile/objfile.go | 2 -- src/cmd/link/internal/sym/symbol.go | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index d10f4ab3c3ca1..a150306df9174 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -1219,11 +1219,14 @@ func writelines(ctxt *Link, unit *compilationUnit, ls *sym.Symbol) { pciterinit(ctxt, &pcfile, &s.FuncInfo.Pcfile) pciterinit(ctxt, &pcline, &s.FuncInfo.Pcline) - pciterinit(ctxt, &pcstmt, &sym.Pcdata{P: s.FuncInfo.IsStmtSym.P}) - if pcstmt.done != 0 { + isStmtSym := dwarfFuncSym(ctxt, s, dwarf.IsStmtPrefix, false) + if isStmtSym != nil && len(isStmtSym.P) > 0 { + pciterinit(ctxt, &pcstmt, &sym.Pcdata{P: isStmtSym.P}) + } else { // Assembly files lack a pcstmt section, we assume that every instruction // is a valid statement. + pcstmt.done = 1 pcstmt.value = 1 } diff --git a/src/cmd/link/internal/objfile/objfile.go b/src/cmd/link/internal/objfile/objfile.go index 77c3a7f9148c4..a85ba1ebee95b 100644 --- a/src/cmd/link/internal/objfile/objfile.go +++ b/src/cmd/link/internal/objfile/objfile.go @@ -320,8 +320,6 @@ overwrite: pc.InlTree[i].Func = r.readSymIndex() } - s.FuncInfo.IsStmtSym = r.syms.Lookup(dwarf.IsStmtPrefix+s.Name, int(s.Version)) - if !dupok { if s.Attr.OnList() { log.Fatalf("symbol %s listed multiple times", s.Name) diff --git a/src/cmd/link/internal/sym/symbol.go b/src/cmd/link/internal/sym/symbol.go index 5e5fca467da2e..a1af4670a28b5 100644 --- a/src/cmd/link/internal/sym/symbol.go +++ b/src/cmd/link/internal/sym/symbol.go @@ -499,7 +499,6 @@ type FuncInfo struct { Pcline Pcdata Pcinline Pcdata Pcdata []Pcdata - IsStmtSym *Symbol Funcdata []*Symbol Funcdataoff []int64 File []*Symbol From 82c260099d8178c55978e402385b8e19a6259011 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 7 Nov 2018 21:25:42 -0800 Subject: [PATCH 048/594] x/net/route: use libc calls on Darwin Starting with 1.12, we must use syscall versions of sysctl instead of the raw syscall. An identical CL went into the source copy at golang.org/x/net/route. This is just a cherry pick of that CL. (CL: https://go-review.googlesource.com/c/net/+/148597) Change-Id: I6286ab3e49f82512491afb5bcf349e89ab5645ab Reviewed-on: https://go-review.googlesource.com/c/149637 Reviewed-by: Brad Fitzpatrick --- src/vendor/golang_org/x/net/route/empty.s | 7 +++++ src/vendor/golang_org/x/net/route/syscall.go | 2 +- .../x/net/route/syscall_go1_11_darwin.go | 28 +++++++++++++++++++ .../x/net/route/syscall_go1_12_darwin.go | 12 ++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/vendor/golang_org/x/net/route/empty.s create mode 100644 src/vendor/golang_org/x/net/route/syscall_go1_11_darwin.go create mode 100644 src/vendor/golang_org/x/net/route/syscall_go1_12_darwin.go diff --git a/src/vendor/golang_org/x/net/route/empty.s b/src/vendor/golang_org/x/net/route/empty.s new file mode 100644 index 0000000000000..bff0231c7d57e --- /dev/null +++ b/src/vendor/golang_org/x/net/route/empty.s @@ -0,0 +1,7 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin,go1.12 + +// This exists solely so we can linkname in symbols from syscall. diff --git a/src/vendor/golang_org/x/net/route/syscall.go b/src/vendor/golang_org/x/net/route/syscall.go index 5f69ea63d91e1..72431b0341061 100644 --- a/src/vendor/golang_org/x/net/route/syscall.go +++ b/src/vendor/golang_org/x/net/route/syscall.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd netbsd openbsd +// +build dragonfly freebsd netbsd openbsd package route diff --git a/src/vendor/golang_org/x/net/route/syscall_go1_11_darwin.go b/src/vendor/golang_org/x/net/route/syscall_go1_11_darwin.go new file mode 100644 index 0000000000000..7228e443cd23f --- /dev/null +++ b/src/vendor/golang_org/x/net/route/syscall_go1_11_darwin.go @@ -0,0 +1,28 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.12 + +package route + +import ( + "syscall" + "unsafe" +) + +var zero uintptr + +func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error { + var p unsafe.Pointer + if len(mib) > 0 { + p = unsafe.Pointer(&mib[0]) + } else { + p = unsafe.Pointer(&zero) + } + _, _, errno := syscall.Syscall6(syscall.SYS___SYSCTL, uintptr(p), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), newlen) + if errno != 0 { + return error(errno) + } + return nil +} diff --git a/src/vendor/golang_org/x/net/route/syscall_go1_12_darwin.go b/src/vendor/golang_org/x/net/route/syscall_go1_12_darwin.go new file mode 100644 index 0000000000000..7922a6836fc3d --- /dev/null +++ b/src/vendor/golang_org/x/net/route/syscall_go1_12_darwin.go @@ -0,0 +1,12 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.12 + +package route + +import _ "unsafe" // for linkname + +//go:linkname sysctl syscall.sysctl +func sysctl(mib []int32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error From a18638c0f2ce487e08bbe67674a95faef5b43651 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Thu, 15 Nov 2018 12:15:18 -0500 Subject: [PATCH 049/594] cmd/vendor: update to golang.org/x/tools@f62bfb54 Change-Id: I3b3035784ce89ba2ac5ab8f6448c45a3d38fa97d Reviewed-on: https://go-review.googlesource.com/c/149778 Run-TryBot: Alan Donovan TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- .../x/tools/go/analysis/cmd/vet-lite/main.go | 133 +++---- .../golang.org/x/tools/go/analysis/doc.go | 18 +- .../analysis/internal/analysisflags/help.go | 23 +- .../tools/go/analysis/passes/printf/printf.go | 25 +- .../go/analysis/unitchecker/unitchecker.go | 356 ++++++++++++++++++ 5 files changed, 446 insertions(+), 109 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go index b4b0e631b9c6a..d767d56663c52 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go @@ -8,14 +8,8 @@ package main import ( "flag" - "fmt" - "log" - "os" - "strings" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/internal/analysisflags" - "golang.org/x/tools/go/analysis/internal/unitchecker" + "golang.org/x/tools/go/analysis/unitchecker" "golang.org/x/tools/go/analysis/passes/asmdecl" "golang.org/x/tools/go/analysis/passes/assign" @@ -41,84 +35,55 @@ import ( "golang.org/x/tools/go/analysis/passes/unusedresult" ) -var analyzers = []*analysis.Analyzer{ - asmdecl.Analyzer, - assign.Analyzer, - atomic.Analyzer, - bools.Analyzer, - buildtag.Analyzer, - cgocall.Analyzer, - composite.Analyzer, - copylock.Analyzer, - httpresponse.Analyzer, - loopclosure.Analyzer, - lostcancel.Analyzer, - nilfunc.Analyzer, - pkgfact.Analyzer, - printf.Analyzer, - shift.Analyzer, - stdmethods.Analyzer, - structtag.Analyzer, - tests.Analyzer, - unmarshal.Analyzer, - unreachable.Analyzer, - unsafeptr.Analyzer, - unusedresult.Analyzer, +// Flags for legacy vet compatibility. +// +// These flags, plus the shims in analysisflags, enable +// existing scripts that run vet to continue to work. +// +// Legacy vet had the concept of "experimental" checkers. There +// was exactly one, shadow, and it had to be explicitly enabled +// by the -shadow flag, which would of course disable all the +// other tristate flags, requiring the -all flag to reenable them. +// (By itself, -all did not enable all checkers.) +// The -all flag is no longer needed, so it is a no-op. +// +// The shadow analyzer has been removed from the suite, +// but can be run using these additional commands: +// $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow +// $ go vet -vettool=$(which shadow) +// Alternatively, one could build a multichecker containing all +// the desired checks (vet's suite + shadow) and run it in a +// single "go vet" command. +func init() { + _ = flag.Bool("source", false, "no effect (deprecated)") + _ = flag.Bool("v", false, "no effect (deprecated)") + _ = flag.Bool("all", false, "no effect (deprecated)") + _ = flag.String("tags", "", "no effect (deprecated)") } func main() { - log.SetFlags(0) - log.SetPrefix("vet: ") - - if err := analysis.Validate(analyzers); err != nil { - log.Fatal(err) - } - - // Flags for legacy vet compatibility. - // - // These flags, plus the shims in analysisflags, enable - // existing scripts that run vet to continue to work. - // - // Legacy vet had the concept of "experimental" checkers. There - // was exactly one, shadow, and it had to be explicitly enabled - // by the -shadow flag, which would of course disable all the - // other tristate flags, requiring the -all flag to reenable them. - // (By itself, -all did not enable all checkers.) - // The -all flag is no longer needed, so it is a no-op. - // - // The shadow analyzer has been removed from the suite, - // but can be run using these additional commands: - // $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow - // $ go vet -vettool=$(which shadow) - // Alternatively, one could build a multichecker containing all - // the desired checks (vet's suite + shadow) and run it in a - // single "go vet" command. - for _, name := range []string{"source", "v", "all"} { - _ = flag.Bool(name, false, "no effect (deprecated)") - } - - flag.Usage = func() { - fmt.Fprintln(os.Stderr, `Usage of vet: - vet unit.cfg # execute analysis specified by config file - vet help # general help - vet help name # help on specific analyzer and its flags`) - flag.PrintDefaults() - os.Exit(1) - } - - analyzers = analysisflags.Parse(analyzers, true) - - args := flag.Args() - if len(args) == 0 { - flag.Usage() - } - if args[0] == "help" { - analysisflags.Help("vet", analyzers, args[1:]) - os.Exit(0) - } - if len(args) != 1 || !strings.HasSuffix(args[0], ".cfg") { - log.Fatalf("invalid command: want .cfg file (this reduced version of vet is intended to be run only by the 'go vet' command)") - } - - unitchecker.Main(args[0], analyzers) + unitchecker.Main( + asmdecl.Analyzer, + assign.Analyzer, + atomic.Analyzer, + bools.Analyzer, + buildtag.Analyzer, + cgocall.Analyzer, + composite.Analyzer, + copylock.Analyzer, + httpresponse.Analyzer, + loopclosure.Analyzer, + lostcancel.Analyzer, + nilfunc.Analyzer, + pkgfact.Analyzer, + printf.Analyzer, + shift.Analyzer, + stdmethods.Analyzer, + structtag.Analyzer, + tests.Analyzer, + unmarshal.Analyzer, + unreachable.Analyzer, + unsafeptr.Analyzer, + unusedresult.Analyzer, + ) } diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go index 4223ab80fc199..5dee615181b89 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go @@ -72,11 +72,13 @@ To add a new Analyzer to an existing driver, add another item to the list: A driver may use the name, flags, and documentation to provide on-line help that describes the analyses its performs. +The doc comment contains a brief one-line summary, +optionally followed by paragraphs of explanation. The vet command, shown below, is an example of a driver that runs multiple analyzers. It is based on the multichecker package (see the "Standalone commands" section for details). - $ go build golang.org/x/tools/cmd/vet + $ go build golang.org/x/tools/go/analysis/cmd/vet $ ./vet help vet is a tool for static analysis of Go programs. @@ -285,6 +287,16 @@ pointed to by fact. This scheme assumes that the concrete type of fact is a pointer; this assumption is checked by the Validate function. See the "printf" analyzer for an example of object facts in action. +Some driver implementations (such as those based on Bazel and Blaze) do +not currently apply analyzers to packages of the standard library. +Therefore, for best results, analyzer authors should not rely on +analysis facts being available for standard packages. +For example, although the printf checker is capable of deducing during +analysis of the log package that log.Printf is a printf-wrapper, +this fact is built in to the analyzer so that it correctly checks +calls to log.Printf even when run in a driver that does not apply +it to standard packages. We plan to remove this limitation in future. + Testing an Analyzer @@ -298,14 +310,14 @@ diagnostics and facts (and no more). Expectations are expressed using Standalone commands Analyzers are provided in the form of packages that a driver program is -expected to import. The vet command imports a set of several analyses, +expected to import. The vet command imports a set of several analyzers, but users may wish to define their own analysis commands that perform additional checks. To simplify the task of creating an analysis command, either for a single analyzer or for a whole suite, we provide the singlechecker and multichecker subpackages. The singlechecker package provides the main function for a command that -runs one analysis. By convention, each analyzer such as +runs one analyzer. By convention, each analyzer such as go/passes/findcall should be accompanied by a singlechecker-based command such as go/analysis/passes/findcall/cmd/findcall, defined in its entirety as: diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go index dc7ba06650064..66aa624572ace 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go @@ -3,39 +3,28 @@ package analysisflags import ( "flag" "fmt" - "io" "log" - "os" - "path/filepath" "sort" "strings" "golang.org/x/tools/go/analysis" ) -const usage = `PROGNAME is a tool for static analysis of Go programs. +const help = `PROGNAME is a tool for static analysis of Go programs. -PROGNAME examines Go source code and reports suspicious constructs, such as Printf -calls whose arguments do not align with the format string. It uses heuristics -that do not guarantee all reports are genuine problems, but it can find errors -not caught by the compilers. - -Usage: PROGNAME [-flag] [package] +PROGNAME examines Go source code and reports suspicious constructs, +such as Printf calls whose arguments do not align with the format +string. It uses heuristics that do not guarantee all reports are +genuine problems, but it can find errors not caught by the compilers. ` -// PrintUsage prints the usage message to stderr. -func PrintUsage(out io.Writer) { - progname := filepath.Base(os.Args[0]) - fmt.Fprintln(out, strings.Replace(usage, "PROGNAME", progname, -1)) -} - // Help implements the help subcommand for a multichecker or vet-lite // style command. The optional args specify the analyzers to describe. // Help calls log.Fatal if no such analyzer exists. func Help(progname string, analyzers []*analysis.Analyzer, args []string) { // No args: show summary of all analyzers. if len(args) == 0 { - PrintUsage(os.Stdout) + fmt.Println(strings.Replace(help, "PROGNAME", progname, -1)) fmt.Println("Registered analyzers:") fmt.Println() sort.Slice(analyzers, func(i, j int) bool { diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go index 4b761e25b5b79..9fa0a1c603c7d 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go @@ -32,7 +32,7 @@ func init() { var Analyzer = &analysis.Analyzer{ Name: "printf", - Doc: "check printf-like invocations", + Doc: doc, Requires: []*analysis.Analyzer{inspect.Analyzer}, Run: run, FactTypes: []analysis.Fact{new(isWrapper)}, @@ -43,12 +43,12 @@ const doc = `check consistency of Printf format strings and arguments The check applies to known functions (for example, those in package fmt) as well as any detected wrappers of known functions. -A function that wants to avail itself of printf checking but does not -get found by this analyzer's heuristics (for example, due to use of +A function that wants to avail itself of printf checking but is not +found by this analyzer's heuristics (for example, due to use of dynamic calls) can insert a bogus call: if false { - fmt.Sprintf(format, args...) // enable printf checking + _ = fmt.Sprintf(format, args...) // enable printf checking } The -funcs flag specifies a comma-separated list of names of additional @@ -843,7 +843,22 @@ func recursiveStringer(pass *analysis.Pass, e ast.Expr) bool { } // Is the expression e within the body of that String method? - return stringMethod.Pkg() == pass.Pkg && stringMethod.Scope().Contains(e.Pos()) + if stringMethod.Pkg() != pass.Pkg || !stringMethod.Scope().Contains(e.Pos()) { + return false + } + + // Is it the receiver r, or &r? + recv := stringMethod.Type().(*types.Signature).Recv() + if recv == nil { + return false + } + if u, ok := e.(*ast.UnaryExpr); ok && u.Op == token.AND { + e = u.X // strip off & from &r + } + if id, ok := e.(*ast.Ident); ok { + return pass.TypesInfo.Uses[id] == recv + } + return false } // isFunctionValue reports whether the expression is a function as opposed to a function call. diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go new file mode 100644 index 0000000000000..edfca577bff89 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -0,0 +1,356 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The unitchecker package defines the main function for an analysis +// driver that analyzes a single compilation unit during a build. +// It is invoked by a build system such as "go vet": +// +// $ go vet -vettool=$(which vet) +// +// It supports the following command-line protocol: +// +// -V=full describe executable (to the build tool) +// -flags describe flags (to the build tool) +// foo.cfg description of compilation unit (from the build tool) +// +// This package does not depend on go/packages. +// If you need a standalone tool, use multichecker, +// which supports this mode but can also load packages +// from source using go/packages. +package unitchecker + +// TODO(adonovan): +// - with gccgo, go build does not build standard library, +// so we will not get to analyze it. Yet we must in order +// to create base facts for, say, the fmt package for the +// printf checker. +// - support JSON output, factored with multichecker. + +import ( + "encoding/gob" + "encoding/json" + "flag" + "fmt" + "go/ast" + "go/build" + "go/importer" + "go/parser" + "go/token" + "go/types" + "io" + "io/ioutil" + "log" + "os" + "path/filepath" + "sort" + "strings" + "sync" + "time" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/internal/analysisflags" + "golang.org/x/tools/go/analysis/internal/facts" +) + +// A Config describes a compilation unit to be analyzed. +// It is provided to the tool in a JSON-encoded file +// whose name ends with ".cfg". +type Config struct { + Compiler string + Dir string + ImportPath string + GoFiles []string + NonGoFiles []string + ImportMap map[string]string + PackageFile map[string]string + Standard map[string]bool + PackageVetx map[string]string + VetxOnly bool + VetxOutput string + SucceedOnTypecheckFailure bool +} + +// Main is the main function of a vet-like analysis tool that must be +// invoked by a build system to analyze a single package. +// +// The protocol required by 'go vet -vettool=...' is that the tool must support: +// +// -flags describe flags in JSON +// -V=full describe executable for build caching +// foo.cfg perform separate modular analyze on the single +// unit described by a JSON config file foo.cfg. +// +func Main(analyzers ...*analysis.Analyzer) { + progname := filepath.Base(os.Args[0]) + log.SetFlags(0) + log.SetPrefix(progname + ": ") + + if err := analysis.Validate(analyzers); err != nil { + log.Fatal(err) + } + + flag.Usage = func() { + fmt.Fprintf(os.Stderr, `%[1]s is a tool for static analysis of Go programs. + +Usage of %[1]s: + %.16[1]s unit.cfg # execute analysis specified by config file + %.16[1]s help # general help + %.16[1]s help name # help on specific analyzer and its flags +`, progname) + os.Exit(1) + } + + analyzers = analysisflags.Parse(analyzers, true) + + args := flag.Args() + if len(args) == 0 { + flag.Usage() + } + if args[0] == "help" { + analysisflags.Help(progname, analyzers, args[1:]) + os.Exit(0) + } + if len(args) != 1 || !strings.HasSuffix(args[0], ".cfg") { + log.Fatalf("invalid command: want .cfg file (this reduced version of %s is intended to be run only by the 'go vet' command)", progname) + } + Run(args[0], analyzers) +} + +// Run reads the *.cfg file, runs the analysis, +// and calls os.Exit with an appropriate error code. +// It assumes flags have already been set. +func Run(configFile string, analyzers []*analysis.Analyzer) { + cfg, err := readConfig(configFile) + if err != nil { + log.Fatal(err) + } + + fset := token.NewFileSet() + diags, err := run(fset, cfg, analyzers) + if err != nil { + log.Fatal(err) + } + + if !cfg.VetxOnly && len(diags) > 0 { + for _, diag := range diags { + fmt.Fprintf(os.Stderr, "%s: %s\n", fset.Position(diag.Pos), diag.Message) + } + os.Exit(1) + } + + os.Exit(0) +} + +func readConfig(filename string) (*Config, error) { + data, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + cfg := new(Config) + if err := json.Unmarshal(data, cfg); err != nil { + return nil, fmt.Errorf("cannot decode JSON config file %s: %v", filename, err) + } + if len(cfg.GoFiles) == 0 { + // The go command disallows packages with no files. + // The only exception is unsafe, but the go command + // doesn't call vet on it. + return nil, fmt.Errorf("package has no files: %s", cfg.ImportPath) + } + return cfg, nil +} + +func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]analysis.Diagnostic, error) { + // Load, parse, typecheck. + var files []*ast.File + for _, name := range cfg.GoFiles { + f, err := parser.ParseFile(fset, name, nil, parser.ParseComments) + if err != nil { + if cfg.SucceedOnTypecheckFailure { + // Silently succeed; let the compiler + // report parse errors. + err = nil + } + return nil, err + } + files = append(files, f) + } + compilerImporter := importer.For(cfg.Compiler, func(path string) (io.ReadCloser, error) { + // path is a resolved package path, not an import path. + file, ok := cfg.PackageFile[path] + if !ok { + if cfg.Compiler == "gccgo" && cfg.Standard[path] { + return nil, nil // fall back to default gccgo lookup + } + return nil, fmt.Errorf("no package file for %q", path) + } + return os.Open(file) + }) + importer := importerFunc(func(importPath string) (*types.Package, error) { + path, ok := cfg.ImportMap[importPath] // resolve vendoring, etc + if !ok { + return nil, fmt.Errorf("can't resolve import %q", path) + } + return compilerImporter.Import(path) + }) + tc := &types.Config{ + Importer: importer, + Sizes: types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc? + } + info := &types.Info{ + Types: make(map[ast.Expr]types.TypeAndValue), + Defs: make(map[*ast.Ident]types.Object), + Uses: make(map[*ast.Ident]types.Object), + Implicits: make(map[ast.Node]types.Object), + Scopes: make(map[ast.Node]*types.Scope), + Selections: make(map[*ast.SelectorExpr]*types.Selection), + } + pkg, err := tc.Check(cfg.ImportPath, fset, files, info) + if err != nil { + if cfg.SucceedOnTypecheckFailure { + // Silently succeed; let the compiler + // report type errors. + err = nil + } + return nil, err + } + + // Register fact types with gob. + // In VetxOnly mode, analyzers are only for their facts, + // so we can skip any analysis that neither produces facts + // nor depends on any analysis that produces facts. + // Also build a map to hold working state and result. + type action struct { + once sync.Once + result interface{} + err error + usesFacts bool // (transitively uses) + diagnostics []analysis.Diagnostic + } + actions := make(map[*analysis.Analyzer]*action) + var registerFacts func(a *analysis.Analyzer) bool + registerFacts = func(a *analysis.Analyzer) bool { + act, ok := actions[a] + if !ok { + act = new(action) + var usesFacts bool + for _, f := range a.FactTypes { + usesFacts = true + gob.Register(f) + } + for _, req := range a.Requires { + if registerFacts(req) { + usesFacts = true + } + } + act.usesFacts = usesFacts + actions[a] = act + } + return act.usesFacts + } + var filtered []*analysis.Analyzer + for _, a := range analyzers { + if registerFacts(a) || !cfg.VetxOnly { + filtered = append(filtered, a) + } + } + analyzers = filtered + + // Read facts from imported packages. + read := func(path string) ([]byte, error) { + if vetx, ok := cfg.PackageVetx[path]; ok { + return ioutil.ReadFile(vetx) + } + return nil, nil // no .vetx file, no facts + } + facts, err := facts.Decode(pkg, read) + if err != nil { + return nil, err + } + + // In parallel, execute the DAG of analyzers. + var exec func(a *analysis.Analyzer) *action + var execAll func(analyzers []*analysis.Analyzer) + exec = func(a *analysis.Analyzer) *action { + act := actions[a] + act.once.Do(func() { + execAll(a.Requires) // prefetch dependencies in parallel + + // The inputs to this analysis are the + // results of its prerequisites. + inputs := make(map[*analysis.Analyzer]interface{}) + var failed []string + for _, req := range a.Requires { + reqact := exec(req) + if reqact.err != nil { + failed = append(failed, req.String()) + continue + } + inputs[req] = reqact.result + } + + // Report an error if any dependency failed. + if failed != nil { + sort.Strings(failed) + act.err = fmt.Errorf("failed prerequisites: %s", strings.Join(failed, ", ")) + return + } + + pass := &analysis.Pass{ + Analyzer: a, + Fset: fset, + Files: files, + OtherFiles: cfg.NonGoFiles, + Pkg: pkg, + TypesInfo: info, + ResultOf: inputs, + Report: func(d analysis.Diagnostic) { act.diagnostics = append(act.diagnostics, d) }, + ImportObjectFact: facts.ImportObjectFact, + ExportObjectFact: facts.ExportObjectFact, + ImportPackageFact: facts.ImportPackageFact, + ExportPackageFact: facts.ExportPackageFact, + } + + t0 := time.Now() + act.result, act.err = a.Run(pass) + if false { + log.Printf("analysis %s = %s", pass, time.Since(t0)) + } + }) + return act + } + execAll = func(analyzers []*analysis.Analyzer) { + var wg sync.WaitGroup + for _, a := range analyzers { + wg.Add(1) + go func(a *analysis.Analyzer) { + _ = exec(a) + wg.Done() + }(a) + } + wg.Wait() + } + + execAll(analyzers) + + // Return diagnostics from root analyzers. + var diags []analysis.Diagnostic + for _, a := range analyzers { + act := actions[a] + if act.err != nil { + return nil, act.err // some analysis failed + } + diags = append(diags, act.diagnostics...) + } + + data := facts.Encode() + if err := ioutil.WriteFile(cfg.VetxOutput, data, 0666); err != nil { + return nil, fmt.Errorf("failed to write analysis facts: %v", err) + } + + return diags, nil +} + +type importerFunc func(path string) (*types.Package, error) + +func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } From b2df0bd5f53e599fef9fcb808304dd0e5ea3ba0b Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Mon, 12 Nov 2018 15:48:46 -0500 Subject: [PATCH 050/594] cmd/vet/all: use x/tools/go/analysis/cmd/vet not cmd/vet cmd/vet/all applies vet to all packages in the standard tree. It is run for every configuration using this command: GO_BUILDER_NAME=misc-vetall go tool dist test by the misc-vetall builder (see chart at build.golang.org). Ideally we would switch to 'go vet', but it effectively does a partial build. This means that its analysis has accurate type information, so it reports slightly fewer spurious diagnostics. However, it is more than twice as slow. Instead, cmd/vet/all builds and runs golang.org/x/tools/go/analysis/cmd/vet, which uses x/tools/go/packages to load the entire std lib from source. It takes about 4min to run all OS/ARCH pairs. An important consequence is that golang.org/x/tools must be on your $GOPATH to run cmd/vet/all. The test has been temporarily modified to warn and skip if this is not the case. This is a preparatory step for switching to the new cmd/vet based on vet-lite. Whitelist changes: - The two "deadcode" diagnostics removed from the whitelist were due to if-conditions that could now be proven false. - The asmdecl warnings are now printed with the log.Printf prefix, so they are discarded by the parser and needn't be whitelisted. Change-Id: I6486508b0de2cd947c897523af086a408cbaf4a8 Reviewed-on: https://go-review.googlesource.com/c/149097 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/vet/all/main.go | 80 ++++++++++++++++++--- src/cmd/vet/all/whitelist/386.txt | 2 - src/cmd/vet/all/whitelist/all.txt | 10 ++- src/cmd/vet/all/whitelist/amd64.txt | 3 - src/cmd/vet/all/whitelist/arm.txt | 2 - src/cmd/vet/all/whitelist/arm64.txt | 2 - src/cmd/vet/all/whitelist/mipsx.txt | 2 - src/cmd/vet/all/whitelist/nacl_386.txt | 2 - src/cmd/vet/all/whitelist/nacl_amd64p32.txt | 4 -- src/cmd/vet/all/whitelist/nacl_arm.txt | 2 - src/cmd/vet/all/whitelist/ppc64x.txt | 2 - src/cmd/vet/all/whitelist/s390x.txt | 15 ++-- src/cmd/vet/all/whitelist/wasm.txt | 3 - src/cmd/vet/all/whitelist/windows_386.txt | 1 - src/cmd/vet/all/whitelist/windows_amd64.txt | 1 - 15 files changed, 81 insertions(+), 50 deletions(-) diff --git a/src/cmd/vet/all/main.go b/src/cmd/vet/all/main.go index 7e4a68101f045..71915ed9f1213 100644 --- a/src/cmd/vet/all/main.go +++ b/src/cmd/vet/all/main.go @@ -7,6 +7,9 @@ // The vet/all command runs go vet on the standard library and commands. // It compares the output against a set of whitelists // maintained in the whitelist directory. +// +// This program attempts to build packages from golang.org/x/tools, +// which must be in your GOPATH. package main import ( @@ -18,6 +21,7 @@ import ( "go/types" "internal/testenv" "io" + "io/ioutil" "log" "os" "os/exec" @@ -217,13 +221,40 @@ func (p platform) vet() { w := make(whitelist) w.load(p.os, p.arch) - // 'go tool vet .' is considerably faster than 'go vet ./...' + tmpdir, err := ioutil.TempDir("", "cmd-vet-all") + if err != nil { + log.Fatal(err) + } + defer os.RemoveAll(tmpdir) + + // Build the go/packages-based vet command from the x/tools + // repo. It is considerably faster than "go vet", which rebuilds + // the standard library. + vetTool := filepath.Join(tmpdir, "vet") + cmd := exec.Command(cmdGoPath, "build", "-o", vetTool, "golang.org/x/tools/go/analysis/cmd/vet") + cmd.Dir = filepath.Join(runtime.GOROOT(), "src") + cmd.Stderr = os.Stderr + cmd.Stdout = os.Stderr + if err := cmd.Run(); err != nil { + if _, err := build.Default.Import("golang.org/x/tools/go/analysis/cmd/vet", "", 0); err != nil { + fmt.Printf("skipping because golang.org/x/tools is not in GOPATH") + return + } + log.Fatal(err) + } + // TODO: The unsafeptr checks are disabled for now, // because there are so many false positives, // and no clear way to improve vet to eliminate large chunks of them. // And having them in the whitelists will just cause annoyance // and churn when working on the runtime. - cmd := exec.Command(cmdGoPath, "tool", "vet", "-unsafeptr=false", "-source", ".") + cmd = exec.Command(vetTool, + "-unsafeptr=0", + "-nilness=0", // expensive, uses SSA + "std", + "cmd/...", + "cmd/compile/internal/gc/testdata", + ) cmd.Dir = filepath.Join(runtime.GOROOT(), "src") cmd.Env = append(os.Environ(), "GOOS="+p.os, "GOARCH="+p.arch, "CGO_ENABLED=0") stderr, err := cmd.StderrPipe() @@ -243,6 +274,9 @@ NextLine: if strings.HasPrefix(line, "vet: ") { // Typecheck failure: Malformed syntax or multiple packages or the like. // This will yield nicer error messages elsewhere, so ignore them here. + + // This includes warnings from asmdecl of the form: + // "vet: foo.s:16: [amd64] cannot check cross-package assembly function" continue } @@ -254,22 +288,48 @@ NextLine: io.Copy(os.Stderr, stderr) break } + if strings.HasPrefix(line, "# ") { + // 'go vet' prefixes the output of each vet invocation by a comment: + // # [package] + continue + } - fields := strings.SplitN(line, ":", 3) + // Parse line. + // Assume the part before the first ": " + // is the "file:line:col: " information. + // TODO(adonovan): parse vet -json output. var file, lineno, msg string - switch len(fields) { - case 2: - // vet message with no line number - file, msg = fields[0], fields[1] - case 3: - file, lineno, msg = fields[0], fields[1], fields[2] - default: + if i := strings.Index(line, ": "); i >= 0 { + msg = line[i+len(": "):] + + words := strings.Split(line[:i], ":") + switch len(words) { + case 3: + _ = words[2] // ignore column + fallthrough + case 2: + lineno = words[1] + fallthrough + case 1: + file = words[0] + + // Make the file name relative to GOROOT/src. + if rel, err := filepath.Rel(cmd.Dir, file); err == nil { + file = rel + } + default: + // error: too many columns + } + } + if file == "" { if !parseFailed { parseFailed = true fmt.Fprintf(os.Stderr, "failed to parse %s vet output:\n", p) } fmt.Fprintln(os.Stderr, line) + continue } + msg = strings.TrimSpace(msg) for _, ignore := range ignorePathPrefixes { diff --git a/src/cmd/vet/all/whitelist/386.txt b/src/cmd/vet/all/whitelist/386.txt index 3dbb340cbd6d1..f791a26570175 100644 --- a/src/cmd/vet/all/whitelist/386.txt +++ b/src/cmd/vet/all/whitelist/386.txt @@ -1,7 +1,5 @@ // 386-specific vet whitelist. See readme.txt for details. -internal/bytealg/compare_386.s: [386] cannot check cross-package assembly function: cmpstring is in package runtime - // startup code uses non-standard calling convention and intentionally // omits args. runtime/asm_386.s: [386] rt0_go: use of 4(SP) points beyond argument frame diff --git a/src/cmd/vet/all/whitelist/all.txt b/src/cmd/vet/all/whitelist/all.txt index 38caac3c3b356..c73516392f6bf 100644 --- a/src/cmd/vet/all/whitelist/all.txt +++ b/src/cmd/vet/all/whitelist/all.txt @@ -9,10 +9,6 @@ go/types/scope.go: method WriteTo(w io.Writer, n int, recurse bool) should have // False positives. -// Nothing much to do about cross-package assembly. Unfortunate. -internal/bytealg/equal_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: memequal is in package runtime -internal/bytealg/equal_ARCHSUFF.s: [GOARCH] cannot check cross-package assembly function: memequal_varlen is in package runtime - // The write barrier is called directly by the compiler, so no Go def runtime/asm_ARCHSUFF.s: [GOARCH] gcWriteBarrier: function gcWriteBarrier missing Go declaration @@ -22,8 +18,6 @@ encoding/json/decode_test.go: struct field m has json tag but is not exported encoding/json/decode_test.go: struct field m2 has json tag but is not exported encoding/json/decode_test.go: struct field s has json tag but is not exported encoding/json/tagkey_test.go: struct field tag `:"BadFormat"` not compatible with reflect.StructTag.Get: bad syntax for struct tag key -runtime/testdata/testprog/deadlock.go: unreachable code -runtime/testdata/testprog/deadlock.go: unreachable code // Compiler tests that make sure even vet-failing code adheres to the spec. cmd/compile/internal/gc/testdata/arithConst_test.go: a (64 bits) too small for shift of 4294967296 @@ -68,3 +62,7 @@ cmd/link/link_test.go: struct field tag "\n\tLondon. Michaelmas term lately over cmd/link/link_test.go: struct field tag "\n\tIt was grand to see how the wind awoke, and bent the trees, and drove the rain before it like a cloud of smoke; and to hear the solemn thunder, and to see the lightning; and while thinking with awe of the tremendous powers by which our little lives are encompassed, to consider how beneficent they are, and how upon the smallest flower and leaf there was already a freshness poured from all this seeming rage, which seemed to make creation new again." not compatible with reflect.StructTag.Get: bad syntax for struct tag key cmd/link/link_test.go: struct field tag "\n\tJarndyce and Jarndyce drones on. This scarecrow of a suit has, over the course of time, become so complicated, that no man alive knows what it means. The parties to it understand it least; but it has been observed that no two Chancery lawyers can talk about it for five minutes, without coming to a total disagreement as to all the premises. Innumerable children have been born into the cause; innumerable young people have married into it; innumerable old people have died out of it. Scores of persons have deliriously found themselves made parties in Jarndyce and Jarndyce, without knowing how or why; whole families have inherited legendary hatreds with the suit. The little plaintiff or defendant, who was promised a new rocking-horse when Jarndyce and Jarndyce should be settled, has grown up, possessed himself of a real horse, and trotted away into the other world. Fair wards of court have faded into mothers and grandmothers; a long procession of Chancellors has come in and gone out; the legion of bills in the suit have been transformed into mere bills of mortality; there are not three Jarndyces left upon the earth perhaps, since old Tom Jarndyce in despair blew his brains out at a coffee-house in Chancery Lane; but Jarndyce and Jarndyce still drags its dreary length before the Court, perennially hopeless." not compatible with reflect.StructTag.Get: bad syntax for struct tag key cmd/link/link_test.go: struct field tag "\n\tThe one great principle of the English law is, to make business for itself. There is no other principle distinctly, certainly, and consistently maintained through all its narrow turnings. Viewed by this light it becomes a coherent scheme, and not the monstrous maze the laity are apt to think it. Let them but once clearly perceive that its grand principle is to make business for itself at their expense, and surely they will cease to grumble." not compatible with reflect.StructTag.Get: bad syntax for struct tag key + +// Tests of Decode(nil) trigger legitimate diagnostics. +encoding/gob/encoder_test.go: call of Decode passes non-pointer +encoding/gob/encoder_test.go: call of Decode passes non-pointer diff --git a/src/cmd/vet/all/whitelist/amd64.txt b/src/cmd/vet/all/whitelist/amd64.txt index 94f782aa2fd2a..020241f615a50 100644 --- a/src/cmd/vet/all/whitelist/amd64.txt +++ b/src/cmd/vet/all/whitelist/amd64.txt @@ -2,9 +2,6 @@ // False positives. -// Nothing much to do about cross-package assembly. Unfortunate. -internal/bytealg/compare_amd64.s: [amd64] cannot check cross-package assembly function: cmpstring is in package runtime - // reflect trampolines intentionally omit arg size. Same for morestack. runtime/asm_amd64.s: [amd64] morestack: use of 8(SP) points beyond argument frame runtime/asm_amd64.s: [amd64] morestack: use of 16(SP) points beyond argument frame diff --git a/src/cmd/vet/all/whitelist/arm.txt b/src/cmd/vet/all/whitelist/arm.txt index 5dc2766e10d30..81a1f1831ea8f 100644 --- a/src/cmd/vet/all/whitelist/arm.txt +++ b/src/cmd/vet/all/whitelist/arm.txt @@ -1,7 +1,5 @@ // arm-specific vet whitelist. See readme.txt for details. -internal/bytealg/compare_arm.s: [arm] cannot check cross-package assembly function: cmpstring is in package runtime - // Intentionally missing declarations. runtime/asm_arm.s: [arm] emptyfunc: function emptyfunc missing Go declaration runtime/asm_arm.s: [arm] armPublicationBarrier: function armPublicationBarrier missing Go declaration diff --git a/src/cmd/vet/all/whitelist/arm64.txt b/src/cmd/vet/all/whitelist/arm64.txt index 72528c5145a37..5a0af626f6aea 100644 --- a/src/cmd/vet/all/whitelist/arm64.txt +++ b/src/cmd/vet/all/whitelist/arm64.txt @@ -1,7 +1,5 @@ // arm64-specific vet whitelist. See readme.txt for details. -internal/bytealg/compare_arm64.s: [arm64] cannot check cross-package assembly function: cmpstring is in package runtime - // Intentionally missing declarations. runtime/asm_arm64.s: [arm64] addmoduledata: function addmoduledata missing Go declaration runtime/duff_arm64.s: [arm64] duffzero: function duffzero missing Go declaration diff --git a/src/cmd/vet/all/whitelist/mipsx.txt b/src/cmd/vet/all/whitelist/mipsx.txt index bd53e9acdf853..1451a86e28c62 100644 --- a/src/cmd/vet/all/whitelist/mipsx.txt +++ b/src/cmd/vet/all/whitelist/mipsx.txt @@ -1,7 +1,5 @@ // mips/mipsle-specific vet whitelist. See readme.txt for details. -internal/bytealg/compare_mipsx.s: [GOARCH] cannot check cross-package assembly function: cmpstring is in package runtime - runtime/tls_mipsx.s: [GOARCH] save_g: function save_g missing Go declaration runtime/tls_mipsx.s: [GOARCH] load_g: function load_g missing Go declaration runtime/sys_linux_mipsx.s: [GOARCH] clone: 12(R29) should be mp+8(FP) diff --git a/src/cmd/vet/all/whitelist/nacl_386.txt b/src/cmd/vet/all/whitelist/nacl_386.txt index 68bba518ac673..c4b03e40936fe 100644 --- a/src/cmd/vet/all/whitelist/nacl_386.txt +++ b/src/cmd/vet/all/whitelist/nacl_386.txt @@ -1,7 +1,5 @@ // nacl/386-specific vet whitelist. See readme.txt for details. -runtime/sys_nacl_386.s: [386] cannot check cross-package assembly function: naclWrite is in package syscall -runtime/sys_nacl_386.s: [386] cannot check cross-package assembly function: now is in package syscall runtime/sys_nacl_386.s: [386] nacl_clock_gettime: function nacl_clock_gettime missing Go declaration runtime/sys_nacl_386.s: [386] setldt: function setldt missing Go declaration runtime/sys_nacl_386.s: [386] sigtramp: use of 20(SP) points beyond argument frame diff --git a/src/cmd/vet/all/whitelist/nacl_amd64p32.txt b/src/cmd/vet/all/whitelist/nacl_amd64p32.txt index 5625e3c55d0b4..9661f57b23d9c 100644 --- a/src/cmd/vet/all/whitelist/nacl_amd64p32.txt +++ b/src/cmd/vet/all/whitelist/nacl_amd64p32.txt @@ -1,7 +1,5 @@ // nacl/amd64p32-specific vet whitelist. See readme.txt for details. -internal/bytealg/compare_amd64p32.s: [amd64p32] cannot check cross-package assembly function: cmpstring is in package runtime - // reflect trampolines intentionally omit arg size. Same for morestack. runtime/asm_amd64p32.s: [amd64p32] morestack: use of 8(SP) points beyond argument frame runtime/asm_amd64p32.s: [amd64p32] morestack: use of 16(SP) points beyond argument frame @@ -13,8 +11,6 @@ runtime/sys_nacl_amd64p32.s: [amd64p32] sigtramp: unknown variable ctxt runtime/sys_nacl_amd64p32.s: [amd64p32] sigtramp: unknown variable ctxt runtime/sys_nacl_amd64p32.s: [amd64p32] sigtramp: unknown variable ctxt runtime/sys_nacl_amd64p32.s: [amd64p32] nacl_sysinfo: function nacl_sysinfo missing Go declaration -runtime/sys_nacl_amd64p32.s: [amd64p32] cannot check cross-package assembly function: naclWrite is in package syscall -runtime/sys_nacl_amd64p32.s: [amd64p32] cannot check cross-package assembly function: now is in package syscall runtime/sys_nacl_amd64p32.s: [amd64p32] nacl_clock_gettime: function nacl_clock_gettime missing Go declaration runtime/sys_nacl_amd64p32.s: [amd64p32] settls: function settls missing Go declaration diff --git a/src/cmd/vet/all/whitelist/nacl_arm.txt b/src/cmd/vet/all/whitelist/nacl_arm.txt index cc0fcbab7f2fe..dde0092570234 100644 --- a/src/cmd/vet/all/whitelist/nacl_arm.txt +++ b/src/cmd/vet/all/whitelist/nacl_arm.txt @@ -1,8 +1,6 @@ // nacl/arm-specific vet whitelist. See readme.txt for details. runtime/asm_arm.s: [arm] sigreturn: function sigreturn missing Go declaration -runtime/sys_nacl_arm.s: [arm] cannot check cross-package assembly function: naclWrite is in package syscall -runtime/sys_nacl_arm.s: [arm] cannot check cross-package assembly function: now is in package syscall runtime/sys_nacl_arm.s: [arm] nacl_clock_gettime: function nacl_clock_gettime missing Go declaration runtime/sys_nacl_arm.s: [arm] nacl_sysinfo: function nacl_sysinfo missing Go declaration runtime/sys_nacl_arm.s: [arm] read_tls_fallback: function read_tls_fallback missing Go declaration diff --git a/src/cmd/vet/all/whitelist/ppc64x.txt b/src/cmd/vet/all/whitelist/ppc64x.txt index 39f8c0da31adb..730a753afc2e0 100644 --- a/src/cmd/vet/all/whitelist/ppc64x.txt +++ b/src/cmd/vet/all/whitelist/ppc64x.txt @@ -1,7 +1,5 @@ // ppc64-specific vet whitelist. See readme.txt for details. -internal/bytealg/compare_ppc64x.s: [GOARCH] cannot check cross-package assembly function: cmpstring is in package runtime - runtime/asm_ppc64x.s: [GOARCH] reginit: function reginit missing Go declaration runtime/asm_ppc64x.s: [GOARCH] goexit: use of 24(R1) points beyond argument frame runtime/asm_ppc64x.s: [GOARCH] addmoduledata: function addmoduledata missing Go declaration diff --git a/src/cmd/vet/all/whitelist/s390x.txt b/src/cmd/vet/all/whitelist/s390x.txt index 4b84242038212..55cf44a5198bc 100644 --- a/src/cmd/vet/all/whitelist/s390x.txt +++ b/src/cmd/vet/all/whitelist/s390x.txt @@ -1,13 +1,12 @@ -internal/bytealg/compare_s390x.s: [s390x] cannot check cross-package assembly function: cmpstring is in package runtime runtime/asm_s390x.s: [s390x] addmoduledata: function addmoduledata missing Go declaration runtime/memclr_s390x.s: [s390x] memclr_s390x_exrl_xc: function memclr_s390x_exrl_xc missing Go declaration runtime/memmove_s390x.s: [s390x] memmove_s390x_exrl_mvc: function memmove_s390x_exrl_mvc missing Go declaration runtime/tls_s390x.s: [s390x] save_g: function save_g missing Go declaration runtime/tls_s390x.s: [s390x] load_g: function load_g missing Go declaration -internal/cpu/cpu_s390x.s: [s390x] stfle: invalid MOVD of ret+0(FP); cpu.facilityList is 32-byte value -internal/cpu/cpu_s390x.s: [s390x] kmQuery: invalid MOVD of ret+0(FP); cpu.queryResult is 16-byte value -internal/cpu/cpu_s390x.s: [s390x] kmcQuery: invalid MOVD of ret+0(FP); cpu.queryResult is 16-byte value -internal/cpu/cpu_s390x.s: [s390x] kmctrQuery: invalid MOVD of ret+0(FP); cpu.queryResult is 16-byte value -internal/cpu/cpu_s390x.s: [s390x] kmaQuery: invalid MOVD of ret+0(FP); cpu.queryResult is 16-byte value -internal/cpu/cpu_s390x.s: [s390x] kimdQuery: invalid MOVD of ret+0(FP); cpu.queryResult is 16-byte value -internal/cpu/cpu_s390x.s: [s390x] klmdQuery: invalid MOVD of ret+0(FP); cpu.queryResult is 16-byte value +internal/cpu/cpu_s390x.s: [s390x] stfle: invalid MOVD of ret+0(FP); internal/cpu.facilityList is 32-byte value +internal/cpu/cpu_s390x.s: [s390x] kmQuery: invalid MOVD of ret+0(FP); internal/cpu.queryResult is 16-byte value +internal/cpu/cpu_s390x.s: [s390x] kmcQuery: invalid MOVD of ret+0(FP); internal/cpu.queryResult is 16-byte value +internal/cpu/cpu_s390x.s: [s390x] kmctrQuery: invalid MOVD of ret+0(FP); internal/cpu.queryResult is 16-byte value +internal/cpu/cpu_s390x.s: [s390x] kmaQuery: invalid MOVD of ret+0(FP); internal/cpu.queryResult is 16-byte value +internal/cpu/cpu_s390x.s: [s390x] kimdQuery: invalid MOVD of ret+0(FP); internal/cpu.queryResult is 16-byte value +internal/cpu/cpu_s390x.s: [s390x] klmdQuery: invalid MOVD of ret+0(FP); internal/cpu.queryResult is 16-byte value diff --git a/src/cmd/vet/all/whitelist/wasm.txt b/src/cmd/vet/all/whitelist/wasm.txt index d066e5b76f8f0..a3f8c291bf9e2 100644 --- a/src/cmd/vet/all/whitelist/wasm.txt +++ b/src/cmd/vet/all/whitelist/wasm.txt @@ -2,9 +2,6 @@ // False positives. -// Nothing much to do about cross-package assembly. Unfortunate. -internal/bytealg/compare_wasm.s: [wasm] cannot check cross-package assembly function: cmpstring is in package runtime - // morestack intentionally omits arg size. runtime/asm_wasm.s: [wasm] morestack: use of 8(SP) points beyond argument frame runtime/asm_wasm.s: [wasm] morestack: use of 16(SP) points beyond argument frame diff --git a/src/cmd/vet/all/whitelist/windows_386.txt b/src/cmd/vet/all/whitelist/windows_386.txt index d910022ef655e..87b3b24d7f70d 100644 --- a/src/cmd/vet/all/whitelist/windows_386.txt +++ b/src/cmd/vet/all/whitelist/windows_386.txt @@ -6,4 +6,3 @@ runtime/sys_windows_386.s: [386] setldt: function setldt missing Go declaration runtime/sys_windows_386.s: [386] callbackasm1+0: function callbackasm1+0 missing Go declaration runtime/sys_windows_386.s: [386] tstart: function tstart missing Go declaration runtime/sys_windows_386.s: [386] tstart_stdcall: RET without writing to 4-byte ret+4(FP) -runtime/sys_windows_386.s: [386] cannot check cross-package assembly function: now is in package time diff --git a/src/cmd/vet/all/whitelist/windows_amd64.txt b/src/cmd/vet/all/whitelist/windows_amd64.txt index 676e6baf71b79..daa23e73a15fd 100644 --- a/src/cmd/vet/all/whitelist/windows_amd64.txt +++ b/src/cmd/vet/all/whitelist/windows_amd64.txt @@ -5,4 +5,3 @@ runtime/sys_windows_amd64.s: [amd64] ctrlhandler: RET without writing to 4-byte runtime/sys_windows_amd64.s: [amd64] callbackasm1: function callbackasm1 missing Go declaration runtime/sys_windows_amd64.s: [amd64] tstart_stdcall: RET without writing to 4-byte ret+8(FP) runtime/sys_windows_amd64.s: [amd64] settls: function settls missing Go declaration -runtime/sys_windows_amd64.s: [amd64] cannot check cross-package assembly function: now is in package time From e500ffd88cb906014320607c6a03a5fd05ee84cf Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 26 Sep 2018 14:20:58 -0400 Subject: [PATCH 051/594] runtime: track all heap arenas in a slice Currently, there's no efficient way to iterate over the Go heap. We're going to need this for fast free page sweeping, so this CL adds a slice of all allocated heap arenas. This will also be useful for generational GC. For #18155. Change-Id: I58d126cfb9c3f61b3125d80b74ccb1b2169efbcc Reviewed-on: https://go-review.googlesource.com/c/138076 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- src/runtime/malloc.go | 21 +++++++++++++++++++++ src/runtime/mheap.go | 11 ++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 12fa744052acc..e827dbae93d5b 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -641,6 +641,27 @@ mapped: } } + // Add the arena to the arenas list. + if len(h.allArenas) == cap(h.allArenas) { + size := 2 * uintptr(cap(h.allArenas)) * sys.PtrSize + if size == 0 { + size = physPageSize + } + newArray := (*notInHeap)(persistentalloc(size, sys.PtrSize, &memstats.gc_sys)) + if newArray == nil { + throw("out of memory allocating allArenas") + } + oldSlice := h.allArenas + *(*notInHeapSlice)(unsafe.Pointer(&h.allArenas)) = notInHeapSlice{newArray, len(h.allArenas), int(size / sys.PtrSize)} + copy(h.allArenas, oldSlice) + // Do not free the old backing array because + // there may be concurrent readers. Since we + // double the array each time, this can lead + // to at most 2x waste. + } + h.allArenas = h.allArenas[:len(h.allArenas)+1] + h.allArenas[len(h.allArenas)-1] = ri + // Store atomically just in case an object from the // new heap arena becomes visible before the heap lock // is released (which shouldn't happen, but there's diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 97a0448ad32d6..c8b2b6524fc85 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -133,7 +133,16 @@ type mheap struct { // (the actual arenas). This is only used on 32-bit. arena linearAlloc - // _ uint32 // ensure 64-bit alignment of central + // allArenas is the arenaIndex of every mapped arena. This can + // be used to iterate through the address space. + // + // Access is protected by mheap_.lock. However, since this is + // append-only and old backing arrays are never freed, it is + // safe to acquire mheap_.lock, copy the slice header, and + // then release mheap_.lock. + allArenas []arenaIdx + + _ uint32 // ensure 64-bit alignment of central // central free lists for small size classes. // the padding makes sure that the mcentrals are From 69e666e4f758cb5431e94aa90dc01a72ab806080 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 26 Sep 2018 16:32:52 -0400 Subject: [PATCH 052/594] runtime: record in-use spans in a page-indexed bitmap This adds a bitmap indexed by page number that marks the starts of in-use spans. This will be used to quickly find in-use spans with no marked objects for sweeping. For #18155. Change-Id: Icee56f029cde502447193e136fa54a74c74326dd Reviewed-on: https://go-review.googlesource.com/c/138957 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson Reviewed-by: Michael Knyszek --- src/runtime/mheap.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index c8b2b6524fc85..12868075d47d5 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -193,6 +193,14 @@ type heapArena struct { // must not be a safe-point between establishing that an // address is live and looking it up in the spans array. spans [pagesPerArena]*mspan + + // pageInUse is a bitmap that indicates which spans are in + // state mSpanInUse. This bitmap is indexed by page number, + // but only the bit corresponding to the first page in each + // span is used. + // + // Writes are protected by mheap_.lock. + pageInUse [pagesPerArena / 8]uint8 } // arenaHint is a hint for where to grow the heap arenas. See @@ -600,6 +608,16 @@ func spanOfHeap(p uintptr) *mspan { return s } +// pageIndexOf returns the arena, page index, and page mask for pointer p. +// The caller must ensure p is in the heap. +func pageIndexOf(p uintptr) (arena *heapArena, pageIdx uintptr, pageMask uint8) { + ai := arenaIndex(p) + arena = mheap_.arenas[ai.l1()][ai.l2()] + pageIdx = ((p / pageSize) / 8) % uintptr(len(arena.pageInUse)) + pageMask = byte(1 << ((p / pageSize) % 8)) + return +} + // Initialize the heap. func (h *mheap) init() { h.treapalloc.init(unsafe.Sizeof(treapNode{}), nil, nil, &memstats.other_sys) @@ -741,6 +759,10 @@ func (h *mheap) alloc_m(npage uintptr, spanclass spanClass, large bool) *mspan { s.baseMask = m.baseMask } + // Mark in-use span in arena page bitmap. + arena, pageIdx, pageMask := pageIndexOf(s.base()) + arena.pageInUse[pageIdx] |= pageMask + // update stats, sweep lists h.pagesInUse += uint64(npage) if large { @@ -1039,6 +1061,10 @@ func (h *mheap) freeSpanLocked(s *mspan, acctinuse, acctidle bool, unusedsince i throw("mheap.freeSpanLocked - invalid free") } h.pagesInUse -= uint64(s.npages) + + // Clear in-use bit in arena page bitmap. + arena, pageIdx, pageMask := pageIndexOf(s.base()) + arena.pageInUse[pageIdx] &^= pageMask default: throw("mheap.freeSpanLocked - invalid span state") } From ba1698e9632d2d21fb45302e0f1356d23031aeb1 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 26 Sep 2018 15:59:21 -0400 Subject: [PATCH 053/594] runtime: mark span when marking any object on the span MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds a mark bit for each span that is set if any objects on the span are marked. This will be used for sweeping. For #18155. The impact of this is negligible for most benchmarks, and < 1% for GC-heavy benchmarks. name old time/op new time/op delta Garbage/benchmem-MB=64-12 2.18ms ± 0% 2.20ms ± 1% +0.88% (p=0.000 n=16+18) (https://perf.golang.org/search?q=upload:20180928.1) name old time/op new time/op delta BinaryTree17-12 2.68s ± 1% 2.68s ± 1% ~ (p=0.707 n=17+19) Fannkuch11-12 2.28s ± 0% 2.39s ± 0% +4.95% (p=0.000 n=19+18) FmtFprintfEmpty-12 40.3ns ± 4% 39.4ns ± 2% -2.27% (p=0.000 n=17+18) FmtFprintfString-12 67.9ns ± 1% 68.3ns ± 1% +0.55% (p=0.000 n=18+19) FmtFprintfInt-12 75.7ns ± 1% 76.1ns ± 1% +0.44% (p=0.005 n=18+19) FmtFprintfIntInt-12 123ns ± 1% 121ns ± 1% -1.00% (p=0.000 n=18+18) FmtFprintfPrefixedInt-12 150ns ± 0% 148ns ± 0% -1.33% (p=0.000 n=16+13) FmtFprintfFloat-12 208ns ± 0% 204ns ± 0% -1.92% (p=0.000 n=13+17) FmtManyArgs-12 501ns ± 1% 498ns ± 0% -0.55% (p=0.000 n=19+17) GobDecode-12 6.24ms ± 0% 6.25ms ± 1% ~ (p=0.113 n=20+19) GobEncode-12 5.33ms ± 0% 5.29ms ± 1% -0.72% (p=0.000 n=20+18) Gzip-12 220ms ± 1% 218ms ± 1% -1.02% (p=0.000 n=19+19) Gunzip-12 35.5ms ± 0% 35.7ms ± 0% +0.45% (p=0.000 n=16+18) HTTPClientServer-12 77.9µs ± 1% 77.7µs ± 1% -0.30% (p=0.047 n=20+19) JSONEncode-12 8.82ms ± 0% 8.93ms ± 0% +1.20% (p=0.000 n=18+17) JSONDecode-12 47.3ms ± 0% 47.0ms ± 0% -0.49% (p=0.000 n=17+18) Mandelbrot200-12 3.69ms ± 0% 3.68ms ± 0% -0.25% (p=0.000 n=19+18) GoParse-12 3.13ms ± 1% 3.13ms ± 1% ~ (p=0.640 n=20+20) RegexpMatchEasy0_32-12 76.2ns ± 1% 76.2ns ± 1% ~ (p=0.818 n=20+19) RegexpMatchEasy0_1K-12 226ns ± 0% 226ns ± 0% -0.22% (p=0.001 n=17+18) RegexpMatchEasy1_32-12 71.9ns ± 1% 72.0ns ± 1% ~ (p=0.653 n=18+18) RegexpMatchEasy1_1K-12 355ns ± 1% 356ns ± 1% ~ (p=0.160 n=18+19) RegexpMatchMedium_32-12 106ns ± 1% 106ns ± 1% ~ (p=0.325 n=17+20) RegexpMatchMedium_1K-12 31.1µs ± 2% 31.2µs ± 0% +0.59% (p=0.007 n=19+15) RegexpMatchHard_32-12 1.54µs ± 2% 1.53µs ± 2% -0.78% (p=0.021 n=17+18) RegexpMatchHard_1K-12 46.0µs ± 1% 45.9µs ± 1% -0.31% (p=0.025 n=17+19) Revcomp-12 391ms ± 1% 394ms ± 2% +0.80% (p=0.000 n=17+19) Template-12 59.9ms ± 1% 59.9ms ± 1% ~ (p=0.428 n=20+19) TimeParse-12 304ns ± 1% 312ns ± 0% +2.88% (p=0.000 n=20+17) TimeFormat-12 318ns ± 0% 326ns ± 0% +2.64% (p=0.000 n=20+17) (https://perf.golang.org/search?q=upload:20180928.2) Change-Id: I336b9bf054113580a24103192904c8c76593e90e Reviewed-on: https://go-review.googlesource.com/c/138958 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson Reviewed-by: Michael Knyszek --- src/runtime/mgc.go | 12 ++++++++++++ src/runtime/mgcmark.go | 7 +++++++ src/runtime/mheap.go | 15 +++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index f4646db67aac5..0215a2c0c2d4f 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -2023,6 +2023,18 @@ func gcResetMarkState() { } unlock(&allglock) + // Clear page marks. This is just 1MB per 64GB of heap, so the + // time here is pretty trivial. + lock(&mheap_.lock) + arenas := mheap_.allArenas + unlock(&mheap_.lock) + for _, ai := range arenas { + ha := mheap_.arenas[ai.l1()][ai.l2()] + for i := range ha.pageMarks { + ha.pageMarks[i] = 0 + } + } + work.bytesMarked = 0 work.initialHeapLive = atomic.Load64(&memstats.heap_live) } diff --git a/src/runtime/mgcmark.go b/src/runtime/mgcmark.go index 28260ab7060bb..03c64c4b11375 100644 --- a/src/runtime/mgcmark.go +++ b/src/runtime/mgcmark.go @@ -1229,6 +1229,13 @@ func greyobject(obj, base, off uintptr, span *mspan, gcw *gcWork, objIndex uintp return } mbits.setMarked() + + // Mark span. + arena, pageIdx, pageMask := pageIndexOf(span.base()) + if arena.pageMarks[pageIdx]&pageMask == 0 { + atomic.Or8(&arena.pageMarks[pageIdx], pageMask) + } + // If this is a noscan object, fast-track it to black // instead of greying it. if span.spanclass.noscan() { diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 12868075d47d5..d183268b54fd6 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -201,6 +201,21 @@ type heapArena struct { // // Writes are protected by mheap_.lock. pageInUse [pagesPerArena / 8]uint8 + + // pageMarks is a bitmap that indicates which spans have any + // marked objects on them. Like pageInUse, only the bit + // corresponding to the first page in each span is used. + // + // Writes are done atomically during marking. Reads are + // non-atomic and lock-free since they only occur during + // sweeping (and hence never race with writes). + // + // This is used to quickly find whole spans that can be freed. + // + // TODO(austin): It would be nice if this was uint64 for + // faster scanning, but we don't have 64-bit atomic bit + // operations. + pageMarks [pagesPerArena / 8]uint8 } // arenaHint is a hint for where to grow the heap arenas. See From 5333550bdc1f4d3814c9dd0d66151ea331c39682 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 27 Sep 2018 11:34:07 -0400 Subject: [PATCH 054/594] runtime: implement efficient page reclaimer When we attempt to allocate an N page span (either for a large allocation or when an mcentral runs dry), we first try to sweep spans to release N pages. Currently, this can be extremely expensive: sweeping a span to emptiness is the hardest thing to ask for and the sweeper generally doesn't know where to even look for potentially fruitful results. Since this is on the critical path of many allocations, this is unfortunate. This CL changes how we reclaim empty spans. Instead of trying lots of spans and hoping for the best, it uses the newly introduced span marks to efficiently find empty spans. The span marks (and in-use bits) are in a dense bitmap, so these spans can be found with an efficient sequential memory scan. This approach can scan for unmarked spans at about 300 GB/ms and can free unmarked spans at about 32 MB/ms. We could probably significantly improve the rate at which is can free unmarked spans, but that's a separate issue. Like the current reclaimer, this is still linear in the number of spans that are swept, but the constant factor is now so vanishingly small that it doesn't matter. The benchmark in #18155 demonstrates both significant page reclaiming delays, and object reclaiming delays. With "-retain-count=20000000 -preallocate=true -loop-count=3", the benchmark demonstrates several page reclaiming delays on the order of 40ms. After this change, the page reclaims are insignificant. The longest sweeps are still ~150ms, but are object reclaiming delays. We'll address those in the next several CLs. Updates #18155. Fixes #21378 by completely replacing the logic that had that bug. Change-Id: Iad80eec11d7fc262d02c8f0761ac6998425c4064 Reviewed-on: https://go-review.googlesource.com/c/138959 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- src/runtime/mgc.go | 3 + src/runtime/mgcsweep.go | 27 ++++- src/runtime/mheap.go | 224 +++++++++++++++++++++++++++++----------- 3 files changed, 194 insertions(+), 60 deletions(-) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 0215a2c0c2d4f..2c7dd85b243c2 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1974,6 +1974,9 @@ func gcSweep(mode gcMode) { throw("non-empty swept list") } mheap_.pagesSwept = 0 + mheap_.sweepArenas = mheap_.allArenas + mheap_.reclaimIndex = 0 + mheap_.reclaimCredit = 0 unlock(&mheap_.lock) if !_ConcurrentSweep || mode == gcForceBlockMode { diff --git a/src/runtime/mgcsweep.go b/src/runtime/mgcsweep.go index 6733aa9b4a8aa..edb9fcac09026 100644 --- a/src/runtime/mgcsweep.go +++ b/src/runtime/mgcsweep.go @@ -4,6 +4,24 @@ // Garbage collector: sweeping +// The sweeper consists of two different algorithms: +// +// * The object reclaimer finds and frees unmarked slots in spans. It +// can free a whole span if none of the objects are marked, but that +// isn't its goal. This can be driven either synchronously by +// mcentral.cacheSpan for mcentral spans, or asynchronously by +// sweepone from the list of all in-use spans in mheap_.sweepSpans. +// +// * The span reclaimer looks for spans that contain no marked objects +// and frees whole spans. This is a separate algorithm because +// freeing whole spans is the hardest task for the object reclaimer, +// but is critical when allocating new spans. The entry point for +// this is mheap_.reclaim and it's driven by a sequential scan of +// the page marks bitmap in the heap arenas. +// +// Both algorithms ultimately call mspan.sweep, which sweeps a single +// heap span. + package runtime import ( @@ -72,7 +90,7 @@ func bgsweep(c chan int) { } } -// sweepone sweeps one span and returns the number of pages returned +// sweepone sweeps some unswept heap span and returns the number of pages returned // to the heap, or ^uintptr(0) if there was nothing to sweep. func sweepone() uintptr { _g_ := getg() @@ -115,7 +133,12 @@ func sweepone() uintptr { npages := ^uintptr(0) if s != nil { npages = s.npages - if !s.sweep(false) { + if s.sweep(false) { + // Whole span was freed. Count it toward the + // page reclaimer credit since these pages can + // now be used for span allocation. + atomic.Xadduintptr(&mheap_.reclaimCredit, npages) + } else { // Span is still in-use, so this returned no // pages to the heap and the span needs to // move to the swept in-use list. diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index d183268b54fd6..3dd79cfdfeaf1 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -89,6 +89,25 @@ type mheap struct { // TODO(austin): pagesInUse should be a uintptr, but the 386 // compiler can't 8-byte align fields. + // Page reclaimer state + + // reclaimIndex is the page index in allArenas of next page to + // reclaim. Specifically, it refers to page (i % + // pagesPerArena) of arena allArenas[i / pagesPerArena]. + // + // If this is >= 1<<63, the page reclaimer is done scanning + // the page marks. + // + // This is accessed atomically. + reclaimIndex uint64 + // reclaimCredit is spare credit for extra pages swept. Since + // the page reclaimer works in large chunks, it may reclaim + // more than requested. Any spare pages released go to this + // credit pool. + // + // This is accessed atomically. + reclaimCredit uintptr + // Malloc stats. largealloc uint64 // bytes allocated for large objects nlargealloc uint64 // number of large object allocations @@ -142,6 +161,11 @@ type mheap struct { // then release mheap_.lock. allArenas []arenaIdx + // sweepArenas is a snapshot of allArenas taken at the + // beginning of the sweep cycle. This can be read safely by + // simply blocking GC (by disabling preemption). + sweepArenas []arenaIdx + _ uint32 // ensure 64-bit alignment of central // central free lists for small size classes. @@ -658,61 +682,158 @@ func (h *mheap) init() { } } -// Sweeps spans in list until reclaims at least npages into heap. -// Returns the actual number of pages reclaimed. -func (h *mheap) reclaimList(list *mSpanList, npages uintptr) uintptr { - n := uintptr(0) - sg := mheap_.sweepgen -retry: - for s := list.first; s != nil; s = s.next { - if s.sweepgen == sg-2 && atomic.Cas(&s.sweepgen, sg-2, sg-1) { - list.remove(s) - // swept spans are at the end of the list - list.insertBack(s) // Puts it back on a busy list. s is not in the treap at this point. - unlock(&h.lock) - snpages := s.npages - if s.sweep(false) { - n += snpages +// reclaim sweeps and reclaims at least npage pages into the heap. +// It is called before allocating npage pages to keep growth in check. +// +// reclaim implements the page-reclaimer half of the sweeper. +// +// h must NOT be locked. +func (h *mheap) reclaim(npage uintptr) { + // This scans pagesPerChunk at a time. Higher values reduce + // contention on h.reclaimPos, but increase the minimum + // latency of performing a reclaim. + // + // Must be a multiple of the pageInUse bitmap element size. + // + // The time required by this can vary a lot depending on how + // many spans are actually freed. Experimentally, it can scan + // for pages at ~300 GB/ms on a 2.6GHz Core i7, but can only + // free spans at ~32 MB/ms. Using 512 pages bounds this at + // roughly 100µs. + // + // TODO(austin): Half of the time spent freeing spans is in + // locking/unlocking the heap (even with low contention). We + // could make the slow path here several times faster by + // batching heap frees. + const pagesPerChunk = 512 + + // Bail early if there's no more reclaim work. + if atomic.Load64(&h.reclaimIndex) >= 1<<63 { + return + } + + // Disable preemption so the GC can't start while we're + // sweeping, so we can read h.sweepArenas, and so + // traceGCSweepStart/Done pair on the P. + mp := acquirem() + + if trace.enabled { + traceGCSweepStart() + } + + arenas := h.sweepArenas + locked := false + for npage > 0 { + // Pull from accumulated credit first. + if credit := atomic.Loaduintptr(&h.reclaimCredit); credit > 0 { + take := credit + if take > npage { + // Take only what we need. + take = npage } - lock(&h.lock) - if n >= npages { - return n + if atomic.Casuintptr(&h.reclaimCredit, credit, credit-take) { + npage -= take } - // the span could have been moved elsewhere - goto retry - } - if s.sweepgen == sg-1 { - // the span is being swept by background sweeper, skip continue } - // already swept empty span, - // all subsequent ones must also be either swept or in process of sweeping - break + + // Claim a chunk of work. + idx := uintptr(atomic.Xadd64(&h.reclaimIndex, pagesPerChunk) - pagesPerChunk) + if idx/pagesPerArena >= uintptr(len(arenas)) { + // Page reclaiming is done. + atomic.Store64(&h.reclaimIndex, 1<<63) + break + } + + if !locked { + // Lock the heap for reclaimChunk. + lock(&h.lock) + locked = true + } + + // Scan this chunk. + nfound := h.reclaimChunk(arenas, idx, pagesPerChunk) + if nfound <= npage { + npage -= nfound + } else { + // Put spare pages toward global credit. + atomic.Xadduintptr(&h.reclaimCredit, nfound-npage) + npage = 0 + } + } + if locked { + unlock(&h.lock) } - return n -} -// Sweeps and reclaims at least npage pages into heap. -// Called before allocating npage pages. -func (h *mheap) reclaim(npage uintptr) { - if h.reclaimList(&h.busy, npage) != 0 { - return // Bingo! + if trace.enabled { + traceGCSweepDone() } + releasem(mp) +} - // Now sweep everything that is not yet swept. - var reclaimed uintptr - unlock(&h.lock) - for { - n := sweepone() - if n == ^uintptr(0) { // all spans are swept - break +// reclaimChunk sweeps unmarked spans that start at page indexes [pageIdx, pageIdx+n). +// It returns the number of pages returned to the heap. +// +// h.lock must be held and the caller must be non-preemptible. +func (h *mheap) reclaimChunk(arenas []arenaIdx, pageIdx, n uintptr) uintptr { + // The heap lock must be held because this accesses the + // heapArena.spans arrays using potentially non-live pointers. + // In particular, if a span were freed and merged concurrently + // with this probing heapArena.spans, it would be possible to + // observe arbitrary, stale span pointers. + n0 := n + var nFreed uintptr + sg := h.sweepgen + for n > 0 { + ai := arenas[pageIdx/pagesPerArena] + ha := h.arenas[ai.l1()][ai.l2()] + + // Get a chunk of the bitmap to work on. + arenaPage := uint(pageIdx % pagesPerArena) + inUse := ha.pageInUse[arenaPage/8:] + marked := ha.pageMarks[arenaPage/8:] + if uintptr(len(inUse)) > n/8 { + inUse = inUse[:n/8] + marked = marked[:n/8] } - reclaimed += n - if reclaimed >= npage { - break + + // Scan this bitmap chunk for spans that are in-use + // but have no marked objects on them. + for i := range inUse { + inUseUnmarked := inUse[i] &^ marked[i] + if inUseUnmarked == 0 { + continue + } + + for j := uint(0); j < 8; j++ { + if inUseUnmarked&(1< Date: Thu, 27 Sep 2018 11:50:46 -0400 Subject: [PATCH 055/594] runtime: eliminate mheap.busy* lists The old whole-page reclaimer was the only thing that used the busy span lists. Remove them so nothing uses them any more. Change-Id: I4007dd2be08b9ef41bfdb0c387215c73c392cc4c Reviewed-on: https://go-review.googlesource.com/c/138960 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson Reviewed-by: Michael Knyszek --- src/runtime/mheap.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 3dd79cfdfeaf1..99994593c3934 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -30,12 +30,11 @@ const minPhysPageSize = 4096 //go:notinheap type mheap struct { lock mutex - free mTreap // free and non-scavenged spans - scav mTreap // free and scavenged spans - busy mSpanList // busy list of spans - sweepgen uint32 // sweep generation, see comment in mspan - sweepdone uint32 // all spans are swept - sweepers uint32 // number of active sweepone calls + free mTreap // free and non-scavenged spans + scav mTreap // free and scavenged spans + sweepgen uint32 // sweep generation, see comment in mspan + sweepdone uint32 // all spans are swept + sweepers uint32 // number of active sweepone calls // allspans is a slice of all mspans ever created. Each mspan // appears exactly once. @@ -676,7 +675,7 @@ func (h *mheap) init() { h.spanalloc.zero = false // h->mapcache needs no init - h.busy.init() + for i := range h.central { h.central[i].mcentral.init(spanClass(i)) } @@ -893,8 +892,6 @@ func (h *mheap) alloc_m(npage uintptr, spanclass spanClass, large bool) *mspan { mheap_.largealloc += uint64(s.elemsize) mheap_.nlargealloc++ atomic.Xadd64(&memstats.heap_live, int64(npage<<_PageShift)) - // Swept spans are at the end of lists. - h.busy.insertBack(s) } } // heap_scan and heap_live were updated. @@ -1199,9 +1196,6 @@ func (h *mheap) freeSpanLocked(s *mspan, acctinuse, acctidle bool, unusedsince i memstats.heap_idle += uint64(s.npages << _PageShift) } s.state = mSpanFree - if s.inList() { - h.busy.remove(s) - } // Stamp newly unused spans. The scavenger will use that // info to potentially give back some pages to the OS. From cb4130996fa7f73c62dafcd65a94233359fd9e09 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 14 Nov 2018 16:29:30 -0500 Subject: [PATCH 056/594] cmd/vet: switch to x/tools/go/analysis implementation This change deletes the legacy implementation of vet, replacing it with a short main.go that merely selects the desired analyzers and calls into the "unitchecker" implementation vendored from golang.org/x/tools/go/analysis. Unlike the full vet checker (x/tools/go/analysis/cmd/vet), the 'lite' unitchecker cannot also be run standalone (as 'go tool vet' or cmd/vet); it must be invoked by 'go vet'. This design was chosen to avoid vendoring many additional dependencies into GOROOT, in particular go/packages. If go/packages should someday become part of the standard library, there will be considerable opportunity for simplification. This change also patches the vendored analysisflag package (by adding patch.go) so that it fully supports the build system's -V flag protocol. Also: - remove stale internal/unitchecker/ tree (belonged in https://go-review.googlesource.com/c/149778). - move vet legacy flags (-all, -v, -source, -tags) into analysisflags as all drivers will need them, not just unitchecker. I will upstream this change. A sampling of tests from the cmd/vet testsuite have been preserved as a smoke test, to ensure that each analyzer is being run, and for convenience when evaluating changes. Comprehensive tests for each analyzer live upstream in x/tools. The tests have been heavily reduced and reorganized so that they conform to the structure required by 'go vet'. Change-Id: I84b38caeef733e65deb95234b3b87b5f61046def Reviewed-on: https://go-review.googlesource.com/c/149609 Reviewed-by: Russ Cox --- .../analysis/internal/analysisflags/flags.go | 24 +- .../analysis/internal/analysisflags/patch.go | 7 + .../internal/unitchecker/unitchecker.go | 306 --- src/cmd/vet/asmdecl.go | 734 ------ src/cmd/vet/assign.go | 52 - src/cmd/vet/atomic.go | 71 - src/cmd/vet/bool.go | 197 -- src/cmd/vet/buildtag.go | 126 - src/cmd/vet/cgo.go | 141 -- src/cmd/vet/composite.go | 86 - src/cmd/vet/copylock.go | 266 -- src/cmd/vet/dead.go | 108 - src/cmd/vet/deadcode.go | 298 --- src/cmd/vet/doc.go | 219 -- src/cmd/vet/httpresponse.go | 137 -- src/cmd/vet/internal/cfg/builder.go | 512 ---- src/cmd/vet/internal/cfg/cfg.go | 142 -- src/cmd/vet/internal/cfg/cfg_test.go | 190 -- src/cmd/vet/internal/whitelist/whitelist.go | 28 - src/cmd/vet/lostcancel.go | 322 --- src/cmd/vet/main.go | 842 +------ src/cmd/vet/method.go | 150 -- src/cmd/vet/nilfunc.go | 67 - src/cmd/vet/print.go | 1070 --------- src/cmd/vet/rangeloop.go | 105 - src/cmd/vet/shadow.go | 243 -- src/cmd/vet/shift.go | 98 - src/cmd/vet/structtag.go | 241 -- src/cmd/vet/testdata/asm/asm.go | 48 - src/cmd/vet/testdata/asm/asm1.s | 315 --- src/cmd/vet/testdata/asm/asm2.s | 257 -- src/cmd/vet/testdata/asm/asm3.s | 192 -- src/cmd/vet/testdata/asm/asm4.s | 26 - src/cmd/vet/testdata/asm/asm5.s | 193 -- src/cmd/vet/testdata/asm/asm6.s | 193 -- src/cmd/vet/testdata/asm/asm7.s | 193 -- src/cmd/vet/testdata/asm8.s | 165 -- src/cmd/vet/testdata/atomic.go | 62 - src/cmd/vet/testdata/bool.go | 131 - src/cmd/vet/testdata/buildtag/buildtag_bad.go | 15 - src/cmd/vet/testdata/cgo/cgo.go | 59 - src/cmd/vet/testdata/cgo/cgo2.go | 12 - src/cmd/vet/testdata/cgo/cgo3.go | 13 - src/cmd/vet/testdata/cgo/cgo4.go | 15 - src/cmd/vet/testdata/composite.go | 120 - src/cmd/vet/testdata/copylock.go | 188 -- src/cmd/vet/testdata/copylock_func.go | 136 -- src/cmd/vet/testdata/copylock_range.go | 67 - src/cmd/vet/testdata/deadcode.go | 2134 ----------------- src/cmd/vet/testdata/divergent/buf.go | 17 - src/cmd/vet/testdata/divergent/buf_test.go | 35 - src/cmd/vet/testdata/httpresponse.go | 85 - .../vet/testdata/incomplete/examples_test.go | 33 - src/cmd/vet/testdata/lostcancel.go | 155 -- src/cmd/vet/testdata/nilfunc.go | 35 - src/cmd/vet/testdata/rangeloop.go | 90 - src/cmd/vet/testdata/shadow.go | 91 - src/cmd/vet/testdata/shift.go | 162 -- src/cmd/vet/testdata/src/asm/asm.go | 9 + src/cmd/vet/testdata/src/asm/asm1.s | 8 + .../vet/testdata/{ => src/assign}/assign.go | 2 +- src/cmd/vet/testdata/src/atomic/atomic.go | 14 + src/cmd/vet/testdata/src/bool/bool.go | 14 + .../testdata/{ => src}/buildtag/buildtag.go | 0 src/cmd/vet/testdata/src/cgo/cgo.go | 18 + .../vet/testdata/src/composite/composite.go | 24 + src/cmd/vet/testdata/src/copylock/copylock.go | 11 + src/cmd/vet/testdata/src/deadcode/deadcode.go | 14 + .../testdata/src/httpresponse/httpresponse.go | 22 + .../vet/testdata/src/lostcancel/lostcancel.go | 14 + .../vet/testdata/{ => src/method}/method.go | 12 +- src/cmd/vet/testdata/src/nilfunc/nilfunc.go | 13 + src/cmd/vet/testdata/{ => src/print}/print.go | 56 +- .../vet/testdata/src/rangeloop/rangeloop.go | 17 + src/cmd/vet/testdata/src/shift/shift.go | 13 + .../vet/testdata/src/structtag/structtag.go | 11 + .../vet/testdata/{ => src}/tagtest/file1.go | 3 + .../vet/testdata/{ => src}/tagtest/file2.go | 5 +- .../testdata/{ => src}/testingpkg/tests.go | 0 .../vet/testdata/src/testingpkg/tests_test.go | 3 + .../vet/testdata/src/unmarshal/unmarshal.go | 18 + .../vet/testdata/src/unsafeptr/unsafeptr.go | 14 + src/cmd/vet/testdata/src/unused/unused.go | 13 + src/cmd/vet/testdata/structtag.go | 113 - src/cmd/vet/testdata/testingpkg/tests_test.go | 74 - src/cmd/vet/testdata/unmarshal.go | 60 - src/cmd/vet/testdata/unsafeptr.go | 63 - src/cmd/vet/testdata/unused.go | 29 - src/cmd/vet/tests.go | 187 -- src/cmd/vet/types.go | 345 --- src/cmd/vet/unmarshal.go | 72 - src/cmd/vet/unsafeptr.go | 97 - src/cmd/vet/unused.go | 93 - src/cmd/vet/vet_test.go | 176 +- 94 files changed, 445 insertions(+), 13211 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/patch.go delete mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go delete mode 100644 src/cmd/vet/asmdecl.go delete mode 100644 src/cmd/vet/assign.go delete mode 100644 src/cmd/vet/atomic.go delete mode 100644 src/cmd/vet/bool.go delete mode 100644 src/cmd/vet/buildtag.go delete mode 100644 src/cmd/vet/cgo.go delete mode 100644 src/cmd/vet/composite.go delete mode 100644 src/cmd/vet/copylock.go delete mode 100644 src/cmd/vet/dead.go delete mode 100644 src/cmd/vet/deadcode.go delete mode 100644 src/cmd/vet/doc.go delete mode 100644 src/cmd/vet/httpresponse.go delete mode 100644 src/cmd/vet/internal/cfg/builder.go delete mode 100644 src/cmd/vet/internal/cfg/cfg.go delete mode 100644 src/cmd/vet/internal/cfg/cfg_test.go delete mode 100644 src/cmd/vet/internal/whitelist/whitelist.go delete mode 100644 src/cmd/vet/lostcancel.go delete mode 100644 src/cmd/vet/method.go delete mode 100644 src/cmd/vet/nilfunc.go delete mode 100644 src/cmd/vet/print.go delete mode 100644 src/cmd/vet/rangeloop.go delete mode 100644 src/cmd/vet/shadow.go delete mode 100644 src/cmd/vet/shift.go delete mode 100644 src/cmd/vet/structtag.go delete mode 100644 src/cmd/vet/testdata/asm/asm.go delete mode 100644 src/cmd/vet/testdata/asm/asm1.s delete mode 100644 src/cmd/vet/testdata/asm/asm2.s delete mode 100644 src/cmd/vet/testdata/asm/asm3.s delete mode 100644 src/cmd/vet/testdata/asm/asm4.s delete mode 100644 src/cmd/vet/testdata/asm/asm5.s delete mode 100644 src/cmd/vet/testdata/asm/asm6.s delete mode 100644 src/cmd/vet/testdata/asm/asm7.s delete mode 100644 src/cmd/vet/testdata/asm8.s delete mode 100644 src/cmd/vet/testdata/atomic.go delete mode 100644 src/cmd/vet/testdata/bool.go delete mode 100644 src/cmd/vet/testdata/buildtag/buildtag_bad.go delete mode 100644 src/cmd/vet/testdata/cgo/cgo.go delete mode 100644 src/cmd/vet/testdata/cgo/cgo2.go delete mode 100644 src/cmd/vet/testdata/cgo/cgo3.go delete mode 100644 src/cmd/vet/testdata/cgo/cgo4.go delete mode 100644 src/cmd/vet/testdata/composite.go delete mode 100644 src/cmd/vet/testdata/copylock.go delete mode 100644 src/cmd/vet/testdata/copylock_func.go delete mode 100644 src/cmd/vet/testdata/copylock_range.go delete mode 100644 src/cmd/vet/testdata/deadcode.go delete mode 100644 src/cmd/vet/testdata/divergent/buf.go delete mode 100644 src/cmd/vet/testdata/divergent/buf_test.go delete mode 100644 src/cmd/vet/testdata/httpresponse.go delete mode 100644 src/cmd/vet/testdata/incomplete/examples_test.go delete mode 100644 src/cmd/vet/testdata/lostcancel.go delete mode 100644 src/cmd/vet/testdata/nilfunc.go delete mode 100644 src/cmd/vet/testdata/rangeloop.go delete mode 100644 src/cmd/vet/testdata/shadow.go delete mode 100644 src/cmd/vet/testdata/shift.go create mode 100644 src/cmd/vet/testdata/src/asm/asm.go create mode 100644 src/cmd/vet/testdata/src/asm/asm1.s rename src/cmd/vet/testdata/{ => src/assign}/assign.go (97%) create mode 100644 src/cmd/vet/testdata/src/atomic/atomic.go create mode 100644 src/cmd/vet/testdata/src/bool/bool.go rename src/cmd/vet/testdata/{ => src}/buildtag/buildtag.go (100%) create mode 100644 src/cmd/vet/testdata/src/cgo/cgo.go create mode 100644 src/cmd/vet/testdata/src/composite/composite.go create mode 100644 src/cmd/vet/testdata/src/copylock/copylock.go create mode 100644 src/cmd/vet/testdata/src/deadcode/deadcode.go create mode 100644 src/cmd/vet/testdata/src/httpresponse/httpresponse.go create mode 100644 src/cmd/vet/testdata/src/lostcancel/lostcancel.go rename src/cmd/vet/testdata/{ => src/method}/method.go (62%) create mode 100644 src/cmd/vet/testdata/src/nilfunc/nilfunc.go rename src/cmd/vet/testdata/{ => src/print}/print.go (94%) create mode 100644 src/cmd/vet/testdata/src/rangeloop/rangeloop.go create mode 100644 src/cmd/vet/testdata/src/shift/shift.go create mode 100644 src/cmd/vet/testdata/src/structtag/structtag.go rename src/cmd/vet/testdata/{ => src}/tagtest/file1.go (85%) rename src/cmd/vet/testdata/{ => src}/tagtest/file2.go (80%) rename src/cmd/vet/testdata/{ => src}/testingpkg/tests.go (100%) create mode 100644 src/cmd/vet/testdata/src/testingpkg/tests_test.go create mode 100644 src/cmd/vet/testdata/src/unmarshal/unmarshal.go create mode 100644 src/cmd/vet/testdata/src/unsafeptr/unsafeptr.go create mode 100644 src/cmd/vet/testdata/src/unused/unused.go delete mode 100644 src/cmd/vet/testdata/structtag.go delete mode 100644 src/cmd/vet/testdata/testingpkg/tests_test.go delete mode 100644 src/cmd/vet/testdata/unmarshal.go delete mode 100644 src/cmd/vet/testdata/unsafeptr.go delete mode 100644 src/cmd/vet/testdata/unused.go delete mode 100644 src/cmd/vet/tests.go delete mode 100644 src/cmd/vet/types.go delete mode 100644 src/cmd/vet/unmarshal.go delete mode 100644 src/cmd/vet/unsafeptr.go delete mode 100644 src/cmd/vet/unused.go diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go index d915be6d255ff..b5ad4f47cb98a 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go @@ -56,10 +56,7 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { name := prefix + f.Name flag.Var(f.Value, name, f.Usage) - var isBool bool - if b, ok := f.Value.(interface{ IsBoolFlag() bool }); ok { - isBool = b.IsBoolFlag() - } + isBool := isBoolFlag(f.Value) analysisFlags = append(analysisFlags, analysisFlag{name, isBool, f.Usage}) }) } @@ -68,11 +65,23 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { printflags := flag.Bool("flags", false, "print analyzer flags in JSON") addVersionFlag() - // Add shims for legacy vet flags. + // Add shims for legacy vet flags to enable existing + // scripts that run vet to continue to work. + _ = flag.Bool("source", false, "no effect (deprecated)") + _ = flag.Bool("v", false, "no effect (deprecated)") + _ = flag.Bool("all", false, "no effect (deprecated)") + _ = flag.String("tags", "", "no effect (deprecated)") + for _, name := range []string{"source", "v", "all", "tags"} { + f := flag.Lookup(name) + isBool := isBoolFlag(f.Value) + analysisFlags = append(analysisFlags, analysisFlag{name, isBool, f.Usage}) + } for old, new := range vetLegacyFlags { newFlag := flag.Lookup(new) if newFlag != nil && flag.Lookup(old) == nil { flag.Var(newFlag.Value, old, "deprecated alias for -"+new) + isBool := isBoolFlag(newFlag.Value) + analysisFlags = append(analysisFlags, analysisFlag{old, isBool, newFlag.Usage}) } } @@ -229,6 +238,11 @@ func (ts triState) IsBoolFlag() bool { return true } +func isBoolFlag(v flag.Value) bool { + b, ok := v.(interface{ IsBoolFlag() bool }) + return ok && b.IsBoolFlag() +} + // Legacy flag support // vetLegacyFlags maps flags used by legacy vet to their corresponding diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/patch.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/patch.go new file mode 100644 index 0000000000000..8f9741055cbac --- /dev/null +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/patch.go @@ -0,0 +1,7 @@ +package analysisflags + +import "cmd/internal/objabi" + +// This additional file changes the behavior of the vendored code. + +func init() { addVersionFlag = objabi.AddVersionFlag } diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go deleted file mode 100644 index 32b50c1be00a2..0000000000000 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go +++ /dev/null @@ -1,306 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// The unitchecker package defines the main function for an analysis -// driver that analyzes a single compilation unit during a build. -// It is invoked by a build system such as "go vet": -// -// $ go vet -vettool=$(which vet) -// -// It supports the following command-line protocol: -// -// -V=full describe executable (to the build tool) -// -flags describe flags (to the build tool) -// foo.cfg description of compilation unit (from the build tool) -// -// This package does not depend on go/packages. -// If you need a standalone tool, use multichecker, -// which supports this mode but can also load packages -// from source using go/packages. -package unitchecker - -// TODO(adonovan): -// - with gccgo, go build does not build standard library, -// so we will not get to analyze it. Yet we must in order -// to create base facts for, say, the fmt package for the -// printf checker. -// - support JSON output, factored with multichecker. - -import ( - "encoding/gob" - "encoding/json" - "fmt" - "go/ast" - "go/build" - "go/importer" - "go/parser" - "go/token" - "go/types" - "io" - "io/ioutil" - "log" - "os" - "sort" - "strings" - "sync" - "time" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/internal/facts" -) - -// A Config describes a compilation unit to be analyzed. -// It is provided to the tool in a JSON-encoded file -// whose name ends with ".cfg". -type Config struct { - Compiler string - Dir string - ImportPath string - GoFiles []string - OtherFiles []string // TODO(adonovan): make go vet populate this (github.com/golang/go/issues/27665) - ImportMap map[string]string - PackageFile map[string]string - Standard map[string]bool - PackageVetx map[string]string - VetxOnly bool - VetxOutput string - SucceedOnTypecheckFailure bool -} - -// Main reads the *.cfg file, runs the analysis, -// and calls os.Exit with an appropriate error code. -func Main(configFile string, analyzers []*analysis.Analyzer) { - cfg, err := readConfig(configFile) - if err != nil { - log.Fatal(err) - } - - fset := token.NewFileSet() - diags, err := run(fset, cfg, analyzers) - if err != nil { - log.Fatal(err) - } - - if len(diags) > 0 { - for _, diag := range diags { - fmt.Fprintf(os.Stderr, "%s: %s\n", fset.Position(diag.Pos), diag.Message) - } - os.Exit(1) - } - - os.Exit(0) -} - -func readConfig(filename string) (*Config, error) { - data, err := ioutil.ReadFile(filename) - if err != nil { - return nil, err - } - cfg := new(Config) - if err := json.Unmarshal(data, cfg); err != nil { - return nil, fmt.Errorf("cannot decode JSON config file %s: %v", filename, err) - } - if len(cfg.GoFiles) == 0 { - // The go command disallows packages with no files. - // The only exception is unsafe, but the go command - // doesn't call vet on it. - return nil, fmt.Errorf("package has no files: %s", cfg.ImportPath) - } - return cfg, nil -} - -func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]analysis.Diagnostic, error) { - // Load, parse, typecheck. - var files []*ast.File - for _, name := range cfg.GoFiles { - f, err := parser.ParseFile(fset, name, nil, parser.ParseComments) - if err != nil { - if cfg.SucceedOnTypecheckFailure { - // Silently succeed; let the compiler - // report parse errors. - err = nil - } - return nil, err - } - files = append(files, f) - } - compilerImporter := importer.For(cfg.Compiler, func(path string) (io.ReadCloser, error) { - // path is a resolved package path, not an import path. - file, ok := cfg.PackageFile[path] - if !ok { - if cfg.Compiler == "gccgo" && cfg.Standard[path] { - return nil, nil // fall back to default gccgo lookup - } - return nil, fmt.Errorf("no package file for %q", path) - } - return os.Open(file) - }) - importer := importerFunc(func(importPath string) (*types.Package, error) { - path, ok := cfg.ImportMap[importPath] // resolve vendoring, etc - if !ok { - return nil, fmt.Errorf("can't resolve import %q", path) - } - return compilerImporter.Import(path) - }) - tc := &types.Config{ - Importer: importer, - Sizes: types.SizesFor("gc", build.Default.GOARCH), // assume gccgo ≡ gc? - } - info := &types.Info{ - Types: make(map[ast.Expr]types.TypeAndValue), - Defs: make(map[*ast.Ident]types.Object), - Uses: make(map[*ast.Ident]types.Object), - Implicits: make(map[ast.Node]types.Object), - Scopes: make(map[ast.Node]*types.Scope), - Selections: make(map[*ast.SelectorExpr]*types.Selection), - } - pkg, err := tc.Check(cfg.ImportPath, fset, files, info) - if err != nil { - if cfg.SucceedOnTypecheckFailure { - // Silently succeed; let the compiler - // report type errors. - err = nil - } - return nil, err - } - - // Register fact types with gob. - // In VetxOnly mode, analyzers are only for their facts, - // so we can skip any analysis that neither produces facts - // nor depends on any analysis that produces facts. - // Also build a map to hold working state and result. - type action struct { - once sync.Once - result interface{} - err error - usesFacts bool // (transitively uses) - diagnostics []analysis.Diagnostic - } - actions := make(map[*analysis.Analyzer]*action) - var registerFacts func(a *analysis.Analyzer) bool - registerFacts = func(a *analysis.Analyzer) bool { - act, ok := actions[a] - if !ok { - act = new(action) - var usesFacts bool - for _, f := range a.FactTypes { - usesFacts = true - gob.Register(f) - } - for _, req := range a.Requires { - if registerFacts(req) { - usesFacts = true - } - } - act.usesFacts = usesFacts - actions[a] = act - } - return act.usesFacts - } - var filtered []*analysis.Analyzer - for _, a := range analyzers { - if registerFacts(a) || !cfg.VetxOnly { - filtered = append(filtered, a) - } - } - analyzers = filtered - - // Read facts from imported packages. - read := func(path string) ([]byte, error) { - if vetx, ok := cfg.PackageVetx[path]; ok { - return ioutil.ReadFile(vetx) - } - return nil, nil // no .vetx file, no facts - } - facts, err := facts.Decode(pkg, read) - if err != nil { - return nil, err - } - - // In parallel, execute the DAG of analyzers. - var exec func(a *analysis.Analyzer) *action - var execAll func(analyzers []*analysis.Analyzer) - exec = func(a *analysis.Analyzer) *action { - act := actions[a] - act.once.Do(func() { - execAll(a.Requires) // prefetch dependencies in parallel - - // The inputs to this analysis are the - // results of its prerequisites. - inputs := make(map[*analysis.Analyzer]interface{}) - var failed []string - for _, req := range a.Requires { - reqact := exec(req) - if reqact.err != nil { - failed = append(failed, req.String()) - continue - } - inputs[req] = reqact.result - } - - // Report an error if any dependency failed. - if failed != nil { - sort.Strings(failed) - act.err = fmt.Errorf("failed prerequisites: %s", strings.Join(failed, ", ")) - return - } - - pass := &analysis.Pass{ - Analyzer: a, - Fset: fset, - Files: files, - OtherFiles: cfg.OtherFiles, - Pkg: pkg, - TypesInfo: info, - ResultOf: inputs, - Report: func(d analysis.Diagnostic) { act.diagnostics = append(act.diagnostics, d) }, - ImportObjectFact: facts.ImportObjectFact, - ExportObjectFact: facts.ExportObjectFact, - ImportPackageFact: facts.ImportPackageFact, - ExportPackageFact: facts.ExportPackageFact, - } - - t0 := time.Now() - act.result, act.err = a.Run(pass) - if false { - log.Printf("analysis %s = %s", pass, time.Since(t0)) - } - }) - return act - } - execAll = func(analyzers []*analysis.Analyzer) { - var wg sync.WaitGroup - for _, a := range analyzers { - wg.Add(1) - go func(a *analysis.Analyzer) { - _ = exec(a) - wg.Done() - }(a) - } - wg.Wait() - } - - execAll(analyzers) - - // Return diagnostics from root analyzers. - var diags []analysis.Diagnostic - for _, a := range analyzers { - act := actions[a] - if act.err != nil { - return nil, act.err // some analysis failed - } - diags = append(diags, act.diagnostics...) - } - - data := facts.Encode() - if err := ioutil.WriteFile(cfg.VetxOutput, data, 0666); err != nil { - return nil, fmt.Errorf("failed to write analysis facts: %v", err) - } - - return diags, nil -} - -type importerFunc func(path string) (*types.Package, error) - -func (f importerFunc) Import(path string) (*types.Package, error) { return f(path) } diff --git a/src/cmd/vet/asmdecl.go b/src/cmd/vet/asmdecl.go deleted file mode 100644 index ccf6269f1db29..0000000000000 --- a/src/cmd/vet/asmdecl.go +++ /dev/null @@ -1,734 +0,0 @@ -// Copyright 2013 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. - -// Identify mismatches between assembly files and Go func declarations. - -package main - -import ( - "bytes" - "fmt" - "go/ast" - "go/build" - "go/token" - "go/types" - "regexp" - "strconv" - "strings" -) - -// 'kind' is a kind of assembly variable. -// The kinds 1, 2, 4, 8 stand for values of that size. -type asmKind int - -// These special kinds are not valid sizes. -const ( - asmString asmKind = 100 + iota - asmSlice - asmArray - asmInterface - asmEmptyInterface - asmStruct - asmComplex -) - -// An asmArch describes assembly parameters for an architecture -type asmArch struct { - name string - bigEndian bool - stack string - lr bool - // calculated during initialization - sizes types.Sizes - intSize int - ptrSize int - maxAlign int -} - -// An asmFunc describes the expected variables for a function on a given architecture. -type asmFunc struct { - arch *asmArch - size int // size of all arguments - vars map[string]*asmVar - varByOffset map[int]*asmVar -} - -// An asmVar describes a single assembly variable. -type asmVar struct { - name string - kind asmKind - typ string - off int - size int - inner []*asmVar -} - -var ( - asmArch386 = asmArch{name: "386", bigEndian: false, stack: "SP", lr: false} - asmArchArm = asmArch{name: "arm", bigEndian: false, stack: "R13", lr: true} - asmArchArm64 = asmArch{name: "arm64", bigEndian: false, stack: "RSP", lr: true} - asmArchAmd64 = asmArch{name: "amd64", bigEndian: false, stack: "SP", lr: false} - asmArchAmd64p32 = asmArch{name: "amd64p32", bigEndian: false, stack: "SP", lr: false} - asmArchMips = asmArch{name: "mips", bigEndian: true, stack: "R29", lr: true} - asmArchMipsLE = asmArch{name: "mipsle", bigEndian: false, stack: "R29", lr: true} - asmArchMips64 = asmArch{name: "mips64", bigEndian: true, stack: "R29", lr: true} - asmArchMips64LE = asmArch{name: "mips64le", bigEndian: false, stack: "R29", lr: true} - asmArchPpc64 = asmArch{name: "ppc64", bigEndian: true, stack: "R1", lr: true} - asmArchPpc64LE = asmArch{name: "ppc64le", bigEndian: false, stack: "R1", lr: true} - asmArchS390X = asmArch{name: "s390x", bigEndian: true, stack: "R15", lr: true} - asmArchWasm = asmArch{name: "wasm", bigEndian: false, stack: "SP", lr: false} - - arches = []*asmArch{ - &asmArch386, - &asmArchArm, - &asmArchArm64, - &asmArchAmd64, - &asmArchAmd64p32, - &asmArchMips, - &asmArchMipsLE, - &asmArchMips64, - &asmArchMips64LE, - &asmArchPpc64, - &asmArchPpc64LE, - &asmArchS390X, - &asmArchWasm, - } -) - -func init() { - for _, arch := range arches { - arch.sizes = types.SizesFor("gc", arch.name) - if arch.sizes == nil { - panic("missing SizesFor for gc/" + arch.name) - } - arch.intSize = int(arch.sizes.Sizeof(types.Typ[types.Int])) - arch.ptrSize = int(arch.sizes.Sizeof(types.Typ[types.UnsafePointer])) - arch.maxAlign = int(arch.sizes.Alignof(types.Typ[types.Int64])) - } - - registerPkgCheck("asmdecl", asmCheck) -} - -var ( - re = regexp.MustCompile - asmPlusBuild = re(`//\s+\+build\s+([^\n]+)`) - asmTEXT = re(`\bTEXT\b(.*)·([^\(]+)\(SB\)(?:\s*,\s*([0-9A-Z|+()]+))?(?:\s*,\s*\$(-?[0-9]+)(?:-([0-9]+))?)?`) - asmDATA = re(`\b(DATA|GLOBL)\b`) - asmNamedFP = re(`([a-zA-Z0-9_\xFF-\x{10FFFF}]+)(?:\+([0-9]+))\(FP\)`) - asmUnnamedFP = re(`[^+\-0-9](([0-9]+)\(FP\))`) - asmSP = re(`[^+\-0-9](([0-9]+)\(([A-Z0-9]+)\))`) - asmOpcode = re(`^\s*(?:[A-Z0-9a-z_]+:)?\s*([A-Z]+)\s*([^,]*)(?:,\s*(.*))?`) - ppc64Suff = re(`([BHWD])(ZU|Z|U|BR)?$`) -) - -func asmCheck(pkg *Package) { - if vcfg.VetxOnly { - return - } - - // No work if no assembly files. - if !pkg.hasFileWithSuffix(".s") { - return - } - - // Gather declarations. knownFunc[name][arch] is func description. - knownFunc := make(map[string]map[string]*asmFunc) - - for _, f := range pkg.files { - if f.file != nil { - for _, decl := range f.file.Decls { - if decl, ok := decl.(*ast.FuncDecl); ok && decl.Body == nil { - knownFunc[decl.Name.Name] = f.asmParseDecl(decl) - } - } - } - } - -Files: - for _, f := range pkg.files { - if !strings.HasSuffix(f.name, ".s") { - continue - } - Println("Checking file", f.name) - - // Determine architecture from file name if possible. - var arch string - var archDef *asmArch - for _, a := range arches { - if strings.HasSuffix(f.name, "_"+a.name+".s") { - arch = a.name - archDef = a - break - } - } - - lines := strings.SplitAfter(string(f.content), "\n") - var ( - fn *asmFunc - fnName string - localSize, argSize int - wroteSP bool - haveRetArg bool - retLine []int - ) - - flushRet := func() { - if fn != nil && fn.vars["ret"] != nil && !haveRetArg && len(retLine) > 0 { - v := fn.vars["ret"] - for _, line := range retLine { - f.Badf(token.NoPos, "%s:%d: [%s] %s: RET without writing to %d-byte ret+%d(FP)", f.name, line, arch, fnName, v.size, v.off) - } - } - retLine = nil - } - for lineno, line := range lines { - lineno++ - - badf := func(format string, args ...interface{}) { - f.Badf(token.NoPos, "%s:%d: [%s] %s: %s", f.name, lineno, arch, fnName, fmt.Sprintf(format, args...)) - } - - if arch == "" { - // Determine architecture from +build line if possible. - if m := asmPlusBuild.FindStringSubmatch(line); m != nil { - // There can be multiple architectures in a single +build line, - // so accumulate them all and then prefer the one that - // matches build.Default.GOARCH. - var archCandidates []*asmArch - for _, fld := range strings.Fields(m[1]) { - for _, a := range arches { - if a.name == fld { - archCandidates = append(archCandidates, a) - } - } - } - for _, a := range archCandidates { - if a.name == build.Default.GOARCH { - archCandidates = []*asmArch{a} - break - } - } - if len(archCandidates) > 0 { - arch = archCandidates[0].name - archDef = archCandidates[0] - } - } - } - - if m := asmTEXT.FindStringSubmatch(line); m != nil { - flushRet() - if arch == "" { - // Arch not specified by filename or build tags. - // Fall back to build.Default.GOARCH. - for _, a := range arches { - if a.name == build.Default.GOARCH { - arch = a.name - archDef = a - break - } - } - if arch == "" { - f.Warnf(token.NoPos, "%s: cannot determine architecture for assembly file", f.name) - continue Files - } - } - fnName = m[2] - if pkgName := strings.TrimSpace(m[1]); pkgName != "" { - pathParts := strings.Split(pkgName, "∕") - pkgName = pathParts[len(pathParts)-1] - if pkgName != f.pkg.path { - f.Warnf(token.NoPos, "%s:%d: [%s] cannot check cross-package assembly function: %s is in package %s", f.name, lineno, arch, fnName, pkgName) - fn = nil - fnName = "" - continue - } - } - flag := m[3] - fn = knownFunc[fnName][arch] - if fn != nil { - size, _ := strconv.Atoi(m[5]) - if size != fn.size && (flag != "7" && !strings.Contains(flag, "NOSPLIT") || size != 0) { - badf("wrong argument size %d; expected $...-%d", size, fn.size) - } - } - localSize, _ = strconv.Atoi(m[4]) - localSize += archDef.intSize - if archDef.lr && !strings.Contains(flag, "NOFRAME") { - // Account for caller's saved LR - localSize += archDef.intSize - } - argSize, _ = strconv.Atoi(m[5]) - if fn == nil && !strings.Contains(fnName, "<>") { - badf("function %s missing Go declaration", fnName) - } - wroteSP = false - haveRetArg = false - continue - } else if strings.Contains(line, "TEXT") && strings.Contains(line, "SB") { - // function, but not visible from Go (didn't match asmTEXT), so stop checking - flushRet() - fn = nil - fnName = "" - continue - } - - if strings.Contains(line, "RET") { - retLine = append(retLine, lineno) - } - - if fnName == "" { - continue - } - - if asmDATA.FindStringSubmatch(line) != nil { - fn = nil - } - - if archDef == nil { - continue - } - - if strings.Contains(line, ", "+archDef.stack) || strings.Contains(line, ",\t"+archDef.stack) { - wroteSP = true - continue - } - - for _, m := range asmSP.FindAllStringSubmatch(line, -1) { - if m[3] != archDef.stack || wroteSP { - continue - } - off := 0 - if m[1] != "" { - off, _ = strconv.Atoi(m[2]) - } - if off >= localSize { - if fn != nil { - v := fn.varByOffset[off-localSize] - if v != nil { - badf("%s should be %s+%d(FP)", m[1], v.name, off-localSize) - continue - } - } - if off >= localSize+argSize { - badf("use of %s points beyond argument frame", m[1]) - continue - } - badf("use of %s to access argument frame", m[1]) - } - } - - if fn == nil { - continue - } - - for _, m := range asmUnnamedFP.FindAllStringSubmatch(line, -1) { - off, _ := strconv.Atoi(m[2]) - v := fn.varByOffset[off] - if v != nil { - badf("use of unnamed argument %s; offset %d is %s+%d(FP)", m[1], off, v.name, v.off) - } else { - badf("use of unnamed argument %s", m[1]) - } - } - - for _, m := range asmNamedFP.FindAllStringSubmatch(line, -1) { - name := m[1] - off := 0 - if m[2] != "" { - off, _ = strconv.Atoi(m[2]) - } - if name == "ret" || strings.HasPrefix(name, "ret_") { - haveRetArg = true - } - v := fn.vars[name] - if v == nil { - // Allow argframe+0(FP). - if name == "argframe" && off == 0 { - continue - } - v = fn.varByOffset[off] - if v != nil { - badf("unknown variable %s; offset %d is %s+%d(FP)", name, off, v.name, v.off) - } else { - badf("unknown variable %s", name) - } - continue - } - asmCheckVar(badf, fn, line, m[0], off, v) - } - } - flushRet() - } -} - -func asmKindForType(t types.Type, size int) asmKind { - switch t := t.Underlying().(type) { - case *types.Basic: - switch t.Kind() { - case types.String: - return asmString - case types.Complex64, types.Complex128: - return asmComplex - } - return asmKind(size) - case *types.Pointer, *types.Chan, *types.Map, *types.Signature: - return asmKind(size) - case *types.Struct: - return asmStruct - case *types.Interface: - if t.Empty() { - return asmEmptyInterface - } - return asmInterface - case *types.Array: - return asmArray - case *types.Slice: - return asmSlice - } - panic("unreachable") -} - -// A component is an assembly-addressable component of a composite type, -// or a composite type itself. -type component struct { - size int - offset int - kind asmKind - typ string - suffix string // Such as _base for string base, _0_lo for lo half of first element of [1]uint64 on 32 bit machine. - outer string // The suffix for immediately containing composite type. -} - -func newComponent(suffix string, kind asmKind, typ string, offset, size int, outer string) component { - return component{suffix: suffix, kind: kind, typ: typ, offset: offset, size: size, outer: outer} -} - -// componentsOfType generates a list of components of type t. -// For example, given string, the components are the string itself, the base, and the length. -func componentsOfType(arch *asmArch, t types.Type) []component { - return appendComponentsRecursive(arch, t, nil, "", 0) -} - -// appendComponentsRecursive implements componentsOfType. -// Recursion is required to correct handle structs and arrays, -// which can contain arbitrary other types. -func appendComponentsRecursive(arch *asmArch, t types.Type, cc []component, suffix string, off int) []component { - s := t.String() - size := int(arch.sizes.Sizeof(t)) - kind := asmKindForType(t, size) - cc = append(cc, newComponent(suffix, kind, s, off, size, suffix)) - - switch kind { - case 8: - if arch.ptrSize == 4 { - w1, w2 := "lo", "hi" - if arch.bigEndian { - w1, w2 = w2, w1 - } - cc = append(cc, newComponent(suffix+"_"+w1, 4, "half "+s, off, 4, suffix)) - cc = append(cc, newComponent(suffix+"_"+w2, 4, "half "+s, off+4, 4, suffix)) - } - - case asmEmptyInterface: - cc = append(cc, newComponent(suffix+"_type", asmKind(arch.ptrSize), "interface type", off, arch.ptrSize, suffix)) - cc = append(cc, newComponent(suffix+"_data", asmKind(arch.ptrSize), "interface data", off+arch.ptrSize, arch.ptrSize, suffix)) - - case asmInterface: - cc = append(cc, newComponent(suffix+"_itable", asmKind(arch.ptrSize), "interface itable", off, arch.ptrSize, suffix)) - cc = append(cc, newComponent(suffix+"_data", asmKind(arch.ptrSize), "interface data", off+arch.ptrSize, arch.ptrSize, suffix)) - - case asmSlice: - cc = append(cc, newComponent(suffix+"_base", asmKind(arch.ptrSize), "slice base", off, arch.ptrSize, suffix)) - cc = append(cc, newComponent(suffix+"_len", asmKind(arch.intSize), "slice len", off+arch.ptrSize, arch.intSize, suffix)) - cc = append(cc, newComponent(suffix+"_cap", asmKind(arch.intSize), "slice cap", off+arch.ptrSize+arch.intSize, arch.intSize, suffix)) - - case asmString: - cc = append(cc, newComponent(suffix+"_base", asmKind(arch.ptrSize), "string base", off, arch.ptrSize, suffix)) - cc = append(cc, newComponent(suffix+"_len", asmKind(arch.intSize), "string len", off+arch.ptrSize, arch.intSize, suffix)) - - case asmComplex: - fsize := size / 2 - cc = append(cc, newComponent(suffix+"_real", asmKind(fsize), fmt.Sprintf("real(complex%d)", size*8), off, fsize, suffix)) - cc = append(cc, newComponent(suffix+"_imag", asmKind(fsize), fmt.Sprintf("imag(complex%d)", size*8), off+fsize, fsize, suffix)) - - case asmStruct: - tu := t.Underlying().(*types.Struct) - fields := make([]*types.Var, tu.NumFields()) - for i := 0; i < tu.NumFields(); i++ { - fields[i] = tu.Field(i) - } - offsets := arch.sizes.Offsetsof(fields) - for i, f := range fields { - cc = appendComponentsRecursive(arch, f.Type(), cc, suffix+"_"+f.Name(), off+int(offsets[i])) - } - - case asmArray: - tu := t.Underlying().(*types.Array) - elem := tu.Elem() - // Calculate offset of each element array. - fields := []*types.Var{ - types.NewVar(token.NoPos, nil, "fake0", elem), - types.NewVar(token.NoPos, nil, "fake1", elem), - } - offsets := arch.sizes.Offsetsof(fields) - elemoff := int(offsets[1]) - for i := 0; i < int(tu.Len()); i++ { - cc = appendComponentsRecursive(arch, elem, cc, suffix+"_"+strconv.Itoa(i), i*elemoff) - } - } - - return cc -} - -// asmParseDecl parses a function decl for expected assembly variables. -func (f *File) asmParseDecl(decl *ast.FuncDecl) map[string]*asmFunc { - var ( - arch *asmArch - fn *asmFunc - offset int - ) - - // addParams adds asmVars for each of the parameters in list. - // isret indicates whether the list are the arguments or the return values. - addParams := func(list []*ast.Field, isret bool) { - argnum := 0 - for _, fld := range list { - t := f.pkg.types[fld.Type].Type - align := int(arch.sizes.Alignof(t)) - size := int(arch.sizes.Sizeof(t)) - offset += -offset & (align - 1) - cc := componentsOfType(arch, t) - - // names is the list of names with this type. - names := fld.Names - if len(names) == 0 { - // Anonymous args will be called arg, arg1, arg2, ... - // Similarly so for return values: ret, ret1, ret2, ... - name := "arg" - if isret { - name = "ret" - } - if argnum > 0 { - name += strconv.Itoa(argnum) - } - names = []*ast.Ident{ast.NewIdent(name)} - } - argnum += len(names) - - // Create variable for each name. - for _, id := range names { - name := id.Name - for _, c := range cc { - outer := name + c.outer - v := asmVar{ - name: name + c.suffix, - kind: c.kind, - typ: c.typ, - off: offset + c.offset, - size: c.size, - } - if vo := fn.vars[outer]; vo != nil { - vo.inner = append(vo.inner, &v) - } - fn.vars[v.name] = &v - for i := 0; i < v.size; i++ { - fn.varByOffset[v.off+i] = &v - } - } - offset += size - } - } - } - - m := make(map[string]*asmFunc) - for _, arch = range arches { - fn = &asmFunc{ - arch: arch, - vars: make(map[string]*asmVar), - varByOffset: make(map[int]*asmVar), - } - offset = 0 - addParams(decl.Type.Params.List, false) - if decl.Type.Results != nil && len(decl.Type.Results.List) > 0 { - offset += -offset & (arch.maxAlign - 1) - addParams(decl.Type.Results.List, true) - } - fn.size = offset - m[arch.name] = fn - } - - return m -} - -// asmCheckVar checks a single variable reference. -func asmCheckVar(badf func(string, ...interface{}), fn *asmFunc, line, expr string, off int, v *asmVar) { - m := asmOpcode.FindStringSubmatch(line) - if m == nil { - if !strings.HasPrefix(strings.TrimSpace(line), "//") { - badf("cannot find assembly opcode") - } - return - } - - // Determine operand sizes from instruction. - // Typically the suffix suffices, but there are exceptions. - var src, dst, kind asmKind - op := m[1] - switch fn.arch.name + "." + op { - case "386.FMOVLP": - src, dst = 8, 4 - case "arm.MOVD": - src = 8 - case "arm.MOVW": - src = 4 - case "arm.MOVH", "arm.MOVHU": - src = 2 - case "arm.MOVB", "arm.MOVBU": - src = 1 - // LEA* opcodes don't really read the second arg. - // They just take the address of it. - case "386.LEAL": - dst = 4 - case "amd64.LEAQ": - dst = 8 - case "amd64p32.LEAL": - dst = 4 - default: - switch fn.arch.name { - case "386", "amd64": - if strings.HasPrefix(op, "F") && (strings.HasSuffix(op, "D") || strings.HasSuffix(op, "DP")) { - // FMOVDP, FXCHD, etc - src = 8 - break - } - if strings.HasPrefix(op, "P") && strings.HasSuffix(op, "RD") { - // PINSRD, PEXTRD, etc - src = 4 - break - } - if strings.HasPrefix(op, "F") && (strings.HasSuffix(op, "F") || strings.HasSuffix(op, "FP")) { - // FMOVFP, FXCHF, etc - src = 4 - break - } - if strings.HasSuffix(op, "SD") { - // MOVSD, SQRTSD, etc - src = 8 - break - } - if strings.HasSuffix(op, "SS") { - // MOVSS, SQRTSS, etc - src = 4 - break - } - if strings.HasPrefix(op, "SET") { - // SETEQ, etc - src = 1 - break - } - switch op[len(op)-1] { - case 'B': - src = 1 - case 'W': - src = 2 - case 'L': - src = 4 - case 'D', 'Q': - src = 8 - } - case "ppc64", "ppc64le": - // Strip standard suffixes to reveal size letter. - m := ppc64Suff.FindStringSubmatch(op) - if m != nil { - switch m[1][0] { - case 'B': - src = 1 - case 'H': - src = 2 - case 'W': - src = 4 - case 'D': - src = 8 - } - } - case "mips", "mipsle", "mips64", "mips64le": - switch op { - case "MOVB", "MOVBU": - src = 1 - case "MOVH", "MOVHU": - src = 2 - case "MOVW", "MOVWU", "MOVF": - src = 4 - case "MOVV", "MOVD": - src = 8 - } - case "s390x": - switch op { - case "MOVB", "MOVBZ": - src = 1 - case "MOVH", "MOVHZ": - src = 2 - case "MOVW", "MOVWZ", "FMOVS": - src = 4 - case "MOVD", "FMOVD": - src = 8 - } - } - } - if dst == 0 { - dst = src - } - - // Determine whether the match we're holding - // is the first or second argument. - if strings.Index(line, expr) > strings.Index(line, ",") { - kind = dst - } else { - kind = src - } - - vk := v.kind - vs := v.size - vt := v.typ - switch vk { - case asmInterface, asmEmptyInterface, asmString, asmSlice: - // allow reference to first word (pointer) - vk = v.inner[0].kind - vs = v.inner[0].size - vt = v.inner[0].typ - } - - if off != v.off { - var inner bytes.Buffer - for i, vi := range v.inner { - if len(v.inner) > 1 { - fmt.Fprintf(&inner, ",") - } - fmt.Fprintf(&inner, " ") - if i == len(v.inner)-1 { - fmt.Fprintf(&inner, "or ") - } - fmt.Fprintf(&inner, "%s+%d(FP)", vi.name, vi.off) - } - badf("invalid offset %s; expected %s+%d(FP)%s", expr, v.name, v.off, inner.String()) - return - } - if kind != 0 && kind != vk { - var inner bytes.Buffer - if len(v.inner) > 0 { - fmt.Fprintf(&inner, " containing") - for i, vi := range v.inner { - if i > 0 && len(v.inner) > 2 { - fmt.Fprintf(&inner, ",") - } - fmt.Fprintf(&inner, " ") - if i > 0 && i == len(v.inner)-1 { - fmt.Fprintf(&inner, "and ") - } - fmt.Fprintf(&inner, "%s+%d(FP)", vi.name, vi.off) - } - } - badf("invalid %s of %s; %s is %d-byte value%s", op, expr, vt, vs, inner.String()) - } -} diff --git a/src/cmd/vet/assign.go b/src/cmd/vet/assign.go deleted file mode 100644 index 223e80d400710..0000000000000 --- a/src/cmd/vet/assign.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2013 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. - -/* -This file contains the code to check for useless assignments. -*/ - -package main - -import ( - "go/ast" - "go/token" - "reflect" -) - -func init() { - register("assign", - "check for useless assignments", - checkAssignStmt, - assignStmt) -} - -// TODO: should also check for assignments to struct fields inside methods -// that are on T instead of *T. - -// checkAssignStmt checks for assignments of the form " = ". -// These are almost always useless, and even when they aren't they are usually a mistake. -func checkAssignStmt(f *File, node ast.Node) { - stmt := node.(*ast.AssignStmt) - if stmt.Tok != token.ASSIGN { - return // ignore := - } - if len(stmt.Lhs) != len(stmt.Rhs) { - // If LHS and RHS have different cardinality, they can't be the same. - return - } - for i, lhs := range stmt.Lhs { - rhs := stmt.Rhs[i] - if hasSideEffects(f, lhs) || hasSideEffects(f, rhs) { - continue // expressions may not be equal - } - if reflect.TypeOf(lhs) != reflect.TypeOf(rhs) { - continue // short-circuit the heavy-weight gofmt check - } - le := f.gofmt(lhs) - re := f.gofmt(rhs) - if le == re { - f.Badf(stmt.Pos(), "self-assignment of %s to %s", re, le) - } - } -} diff --git a/src/cmd/vet/atomic.go b/src/cmd/vet/atomic.go deleted file mode 100644 index b425669e1ae05..0000000000000 --- a/src/cmd/vet/atomic.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "go/ast" - "go/token" - "go/types" -) - -func init() { - register("atomic", - "check for common mistaken usages of the sync/atomic package", - checkAtomicAssignment, - assignStmt) -} - -// checkAtomicAssignment walks the assignment statement checking for common -// mistaken usage of atomic package, such as: x = atomic.AddUint64(&x, 1) -func checkAtomicAssignment(f *File, node ast.Node) { - n := node.(*ast.AssignStmt) - if len(n.Lhs) != len(n.Rhs) { - return - } - if len(n.Lhs) == 1 && n.Tok == token.DEFINE { - return - } - - for i, right := range n.Rhs { - call, ok := right.(*ast.CallExpr) - if !ok { - continue - } - sel, ok := call.Fun.(*ast.SelectorExpr) - if !ok { - continue - } - pkgIdent, _ := sel.X.(*ast.Ident) - pkgName, ok := f.pkg.uses[pkgIdent].(*types.PkgName) - if !ok || pkgName.Imported().Path() != "sync/atomic" { - continue - } - - switch sel.Sel.Name { - case "AddInt32", "AddInt64", "AddUint32", "AddUint64", "AddUintptr": - f.checkAtomicAddAssignment(n.Lhs[i], call) - } - } -} - -// checkAtomicAddAssignment walks the atomic.Add* method calls checking for assigning the return value -// to the same variable being used in the operation -func (f *File) checkAtomicAddAssignment(left ast.Expr, call *ast.CallExpr) { - if len(call.Args) != 2 { - return - } - arg := call.Args[0] - broken := false - - if uarg, ok := arg.(*ast.UnaryExpr); ok && uarg.Op == token.AND { - broken = f.gofmt(left) == f.gofmt(uarg.X) - } else if star, ok := left.(*ast.StarExpr); ok { - broken = f.gofmt(star.X) == f.gofmt(arg) - } - - if broken { - f.Bad(left.Pos(), "direct assignment to atomic value") - } -} diff --git a/src/cmd/vet/bool.go b/src/cmd/vet/bool.go deleted file mode 100644 index 1cd477f988caf..0000000000000 --- a/src/cmd/vet/bool.go +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright 2014 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. - -// This file contains boolean condition tests. - -package main - -import ( - "go/ast" - "go/token" -) - -func init() { - register("bool", - "check for mistakes involving boolean operators", - checkBool, - binaryExpr) -} - -func checkBool(f *File, n ast.Node) { - e := n.(*ast.BinaryExpr) - - var op boolOp - switch e.Op { - case token.LOR: - op = or - case token.LAND: - op = and - default: - return - } - - comm := op.commutativeSets(f, e) - for _, exprs := range comm { - op.checkRedundant(f, exprs) - op.checkSuspect(f, exprs) - } -} - -type boolOp struct { - name string - tok token.Token // token corresponding to this operator - badEq token.Token // token corresponding to the equality test that should not be used with this operator -} - -var ( - or = boolOp{"or", token.LOR, token.NEQ} - and = boolOp{"and", token.LAND, token.EQL} -) - -// commutativeSets returns all side effect free sets of -// expressions in e that are connected by op. -// For example, given 'a || b || f() || c || d' with the or op, -// commutativeSets returns {{b, a}, {d, c}}. -func (op boolOp) commutativeSets(f *File, e *ast.BinaryExpr) [][]ast.Expr { - exprs := op.split(e) - - // Partition the slice of expressions into commutative sets. - i := 0 - var sets [][]ast.Expr - for j := 0; j <= len(exprs); j++ { - if j == len(exprs) || hasSideEffects(f, exprs[j]) { - if i < j { - sets = append(sets, exprs[i:j]) - } - i = j + 1 - } - } - - return sets -} - -// checkRedundant checks for expressions of the form -// e && e -// e || e -// Exprs must contain only side effect free expressions. -func (op boolOp) checkRedundant(f *File, exprs []ast.Expr) { - seen := make(map[string]bool) - for _, e := range exprs { - efmt := f.gofmt(e) - if seen[efmt] { - f.Badf(e.Pos(), "redundant %s: %s %s %s", op.name, efmt, op.tok, efmt) - } else { - seen[efmt] = true - } - } -} - -// checkSuspect checks for expressions of the form -// x != c1 || x != c2 -// x == c1 && x == c2 -// where c1 and c2 are constant expressions. -// If c1 and c2 are the same then it's redundant; -// if c1 and c2 are different then it's always true or always false. -// Exprs must contain only side effect free expressions. -func (op boolOp) checkSuspect(f *File, exprs []ast.Expr) { - // seen maps from expressions 'x' to equality expressions 'x != c'. - seen := make(map[string]string) - - for _, e := range exprs { - bin, ok := e.(*ast.BinaryExpr) - if !ok || bin.Op != op.badEq { - continue - } - - // In order to avoid false positives, restrict to cases - // in which one of the operands is constant. We're then - // interested in the other operand. - // In the rare case in which both operands are constant - // (e.g. runtime.GOOS and "windows"), we'll only catch - // mistakes if the LHS is repeated, which is how most - // code is written. - var x ast.Expr - switch { - case f.pkg.types[bin.Y].Value != nil: - x = bin.X - case f.pkg.types[bin.X].Value != nil: - x = bin.Y - default: - continue - } - - // e is of the form 'x != c' or 'x == c'. - xfmt := f.gofmt(x) - efmt := f.gofmt(e) - if prev, found := seen[xfmt]; found { - // checkRedundant handles the case in which efmt == prev. - if efmt != prev { - f.Badf(e.Pos(), "suspect %s: %s %s %s", op.name, efmt, op.tok, prev) - } - } else { - seen[xfmt] = efmt - } - } -} - -// hasSideEffects reports whether evaluation of e has side effects. -func hasSideEffects(f *File, e ast.Expr) bool { - safe := true - ast.Inspect(e, func(node ast.Node) bool { - switch n := node.(type) { - case *ast.CallExpr: - typVal := f.pkg.types[n.Fun] - switch { - case typVal.IsType(): - // Type conversion, which is safe. - case typVal.IsBuiltin(): - // Builtin func, conservatively assumed to not - // be safe for now. - safe = false - return false - default: - // A non-builtin func or method call. - // Conservatively assume that all of them have - // side effects for now. - safe = false - return false - } - case *ast.UnaryExpr: - if n.Op == token.ARROW { - safe = false - return false - } - } - return true - }) - return !safe -} - -// split returns a slice of all subexpressions in e that are connected by op. -// For example, given 'a || (b || c) || d' with the or op, -// split returns []{d, c, b, a}. -func (op boolOp) split(e ast.Expr) (exprs []ast.Expr) { - for { - e = unparen(e) - if b, ok := e.(*ast.BinaryExpr); ok && b.Op == op.tok { - exprs = append(exprs, op.split(b.Y)...) - e = b.X - } else { - exprs = append(exprs, e) - break - } - } - return -} - -// unparen returns e with any enclosing parentheses stripped. -func unparen(e ast.Expr) ast.Expr { - for { - p, ok := e.(*ast.ParenExpr) - if !ok { - return e - } - e = p.X - } -} diff --git a/src/cmd/vet/buildtag.go b/src/cmd/vet/buildtag.go deleted file mode 100644 index ba3a361b9113b..0000000000000 --- a/src/cmd/vet/buildtag.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "bytes" - "fmt" - "os" - "strings" - "unicode" -) - -var ( - nl = []byte("\n") - slashSlash = []byte("//") - plusBuild = []byte("+build") -) - -func badfLine(f *File, line int, format string, args ...interface{}) { - msg := fmt.Sprintf(format, args...) - fmt.Fprintf(os.Stderr, "%s:%d: %s\n", f.name, line, msg) - setExit(1) -} - -// checkBuildTag checks that build tags are in the correct location and well-formed. -func checkBuildTag(f *File) { - if !vet("buildtags") { - return - } - - // we must look at the raw lines, as build tags may appear in non-Go - // files such as assembly files. - lines := bytes.SplitAfter(f.content, nl) - - // lineWithComment reports whether a line corresponds to a comment in - // the source file. If the source file wasn't Go, the function always - // returns true. - lineWithComment := func(line int) bool { - if f.file == nil { - // Current source file is not Go, so be conservative. - return true - } - for _, group := range f.file.Comments { - startLine := f.fset.Position(group.Pos()).Line - endLine := f.fset.Position(group.End()).Line - if startLine <= line && line <= endLine { - return true - } - } - return false - } - - // Determine cutpoint where +build comments are no longer valid. - // They are valid in leading // comments in the file followed by - // a blank line. - var cutoff int - for i, line := range lines { - line = bytes.TrimSpace(line) - if len(line) == 0 { - cutoff = i - continue - } - if bytes.HasPrefix(line, slashSlash) { - continue - } - break - } - - for i, line := range lines { - line = bytes.TrimSpace(line) - if !bytes.HasPrefix(line, slashSlash) { - continue - } - if !bytes.Contains(line, plusBuild) { - // Check that the comment contains "+build" early, to - // avoid unnecessary lineWithComment calls that may - // incur linear searches. - continue - } - if !lineWithComment(i + 1) { - // This is a line in a Go source file that looks like a - // comment, but actually isn't - such as part of a raw - // string. - continue - } - - text := bytes.TrimSpace(line[2:]) - if bytes.HasPrefix(text, plusBuild) { - fields := bytes.Fields(text) - if !bytes.Equal(fields[0], plusBuild) { - // Comment is something like +buildasdf not +build. - badfLine(f, i+1, "possible malformed +build comment") - continue - } - if i >= cutoff { - badfLine(f, i+1, "+build comment must appear before package clause and be followed by a blank line") - continue - } - // Check arguments. - Args: - for _, arg := range fields[1:] { - for _, elem := range strings.Split(string(arg), ",") { - if strings.HasPrefix(elem, "!!") { - badfLine(f, i+1, "invalid double negative in build constraint: %s", arg) - break Args - } - elem = strings.TrimPrefix(elem, "!") - for _, c := range elem { - if !unicode.IsLetter(c) && !unicode.IsDigit(c) && c != '_' && c != '.' { - badfLine(f, i+1, "invalid non-alphanumeric build constraint: %s", arg) - break Args - } - } - } - } - continue - } - // Comment with +build but not at beginning. - if i < cutoff { - badfLine(f, i+1, "possible malformed +build comment") - continue - } - } -} diff --git a/src/cmd/vet/cgo.go b/src/cmd/vet/cgo.go deleted file mode 100644 index 76364ff6ed8be..0000000000000 --- a/src/cmd/vet/cgo.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2015 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. - -// Check for invalid cgo pointer passing. -// This looks for code that uses cgo to call C code passing values -// whose types are almost always invalid according to the cgo pointer -// sharing rules. -// Specifically, it warns about attempts to pass a Go chan, map, func, -// or slice to C, either directly, or via a pointer, array, or struct. - -package main - -import ( - "go/ast" - "go/token" - "go/types" -) - -func init() { - register("cgocall", - "check for types that may not be passed to cgo calls", - checkCgoCall, - callExpr) -} - -func checkCgoCall(f *File, node ast.Node) { - x := node.(*ast.CallExpr) - - // We are only looking for calls to functions imported from - // the "C" package. - sel, ok := x.Fun.(*ast.SelectorExpr) - if !ok { - return - } - id, ok := sel.X.(*ast.Ident) - if !ok { - return - } - - pkgname, ok := f.pkg.uses[id].(*types.PkgName) - if !ok || pkgname.Imported().Path() != "C" { - return - } - - // A call to C.CBytes passes a pointer but is always safe. - if sel.Sel.Name == "CBytes" { - return - } - - for _, arg := range x.Args { - if !typeOKForCgoCall(cgoBaseType(f, arg), make(map[types.Type]bool)) { - f.Badf(arg.Pos(), "possibly passing Go type with embedded pointer to C") - } - - // Check for passing the address of a bad type. - if conv, ok := arg.(*ast.CallExpr); ok && len(conv.Args) == 1 && f.hasBasicType(conv.Fun, types.UnsafePointer) { - arg = conv.Args[0] - } - if u, ok := arg.(*ast.UnaryExpr); ok && u.Op == token.AND { - if !typeOKForCgoCall(cgoBaseType(f, u.X), make(map[types.Type]bool)) { - f.Badf(arg.Pos(), "possibly passing Go type with embedded pointer to C") - } - } - } -} - -// cgoBaseType tries to look through type conversions involving -// unsafe.Pointer to find the real type. It converts: -// unsafe.Pointer(x) => x -// *(*unsafe.Pointer)(unsafe.Pointer(&x)) => x -func cgoBaseType(f *File, arg ast.Expr) types.Type { - switch arg := arg.(type) { - case *ast.CallExpr: - if len(arg.Args) == 1 && f.hasBasicType(arg.Fun, types.UnsafePointer) { - return cgoBaseType(f, arg.Args[0]) - } - case *ast.StarExpr: - call, ok := arg.X.(*ast.CallExpr) - if !ok || len(call.Args) != 1 { - break - } - // Here arg is *f(v). - t := f.pkg.types[call.Fun].Type - if t == nil { - break - } - ptr, ok := t.Underlying().(*types.Pointer) - if !ok { - break - } - // Here arg is *(*p)(v) - elem, ok := ptr.Elem().Underlying().(*types.Basic) - if !ok || elem.Kind() != types.UnsafePointer { - break - } - // Here arg is *(*unsafe.Pointer)(v) - call, ok = call.Args[0].(*ast.CallExpr) - if !ok || len(call.Args) != 1 { - break - } - // Here arg is *(*unsafe.Pointer)(f(v)) - if !f.hasBasicType(call.Fun, types.UnsafePointer) { - break - } - // Here arg is *(*unsafe.Pointer)(unsafe.Pointer(v)) - u, ok := call.Args[0].(*ast.UnaryExpr) - if !ok || u.Op != token.AND { - break - } - // Here arg is *(*unsafe.Pointer)(unsafe.Pointer(&v)) - return cgoBaseType(f, u.X) - } - - return f.pkg.types[arg].Type -} - -// typeOKForCgoCall reports whether the type of arg is OK to pass to a -// C function using cgo. This is not true for Go types with embedded -// pointers. m is used to avoid infinite recursion on recursive types. -func typeOKForCgoCall(t types.Type, m map[types.Type]bool) bool { - if t == nil || m[t] { - return true - } - m[t] = true - switch t := t.Underlying().(type) { - case *types.Chan, *types.Map, *types.Signature, *types.Slice: - return false - case *types.Pointer: - return typeOKForCgoCall(t.Elem(), m) - case *types.Array: - return typeOKForCgoCall(t.Elem(), m) - case *types.Struct: - for i := 0; i < t.NumFields(); i++ { - if !typeOKForCgoCall(t.Field(i).Type(), m) { - return false - } - } - } - return true -} diff --git a/src/cmd/vet/composite.go b/src/cmd/vet/composite.go deleted file mode 100644 index 861e040aac4e5..0000000000000 --- a/src/cmd/vet/composite.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2012 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. - -// This file contains the test for unkeyed struct literals. - -package main - -import ( - "cmd/vet/internal/whitelist" - "flag" - "go/ast" - "go/types" - "strings" -) - -var compositeWhiteList = flag.Bool("compositewhitelist", true, "use composite white list; for testing only") - -func init() { - register("composites", - "check that composite literals of types from imported packages use field-keyed elements", - checkUnkeyedLiteral, - compositeLit) -} - -// checkUnkeyedLiteral checks if a composite literal is a struct literal with -// unkeyed fields. -func checkUnkeyedLiteral(f *File, node ast.Node) { - cl := node.(*ast.CompositeLit) - - typ := f.pkg.types[cl].Type - if typ == nil { - // cannot determine composite literals' type, skip it - return - } - typeName := typ.String() - if *compositeWhiteList && whitelist.UnkeyedLiteral[typeName] { - // skip whitelisted types - return - } - under := typ.Underlying() - for { - ptr, ok := under.(*types.Pointer) - if !ok { - break - } - under = ptr.Elem().Underlying() - } - if _, ok := under.(*types.Struct); !ok { - // skip non-struct composite literals - return - } - if isLocalType(f, typ) { - // allow unkeyed locally defined composite literal - return - } - - // check if the CompositeLit contains an unkeyed field - allKeyValue := true - for _, e := range cl.Elts { - if _, ok := e.(*ast.KeyValueExpr); !ok { - allKeyValue = false - break - } - } - if allKeyValue { - // all the composite literal fields are keyed - return - } - - f.Badf(cl.Pos(), "%s composite literal uses unkeyed fields", typeName) -} - -func isLocalType(f *File, typ types.Type) bool { - switch x := typ.(type) { - case *types.Struct: - // struct literals are local types - return true - case *types.Pointer: - return isLocalType(f, x.Elem()) - case *types.Named: - // names in package foo are local to foo_test too - return strings.TrimSuffix(x.Obj().Pkg().Path(), "_test") == strings.TrimSuffix(f.pkg.path, "_test") - } - return false -} diff --git a/src/cmd/vet/copylock.go b/src/cmd/vet/copylock.go deleted file mode 100644 index ed88ca89603a4..0000000000000 --- a/src/cmd/vet/copylock.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2013 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. - -// This file contains the code to check that locks are not passed by value. - -package main - -import ( - "bytes" - "fmt" - "go/ast" - "go/token" - "go/types" -) - -func init() { - register("copylocks", - "check that locks are not passed by value", - checkCopyLocks, - funcDecl, rangeStmt, funcLit, callExpr, assignStmt, genDecl, compositeLit, returnStmt) -} - -// checkCopyLocks checks whether node might -// inadvertently copy a lock. -func checkCopyLocks(f *File, node ast.Node) { - switch node := node.(type) { - case *ast.RangeStmt: - checkCopyLocksRange(f, node) - case *ast.FuncDecl: - checkCopyLocksFunc(f, node.Name.Name, node.Recv, node.Type) - case *ast.FuncLit: - checkCopyLocksFunc(f, "func", nil, node.Type) - case *ast.CallExpr: - checkCopyLocksCallExpr(f, node) - case *ast.AssignStmt: - checkCopyLocksAssign(f, node) - case *ast.GenDecl: - checkCopyLocksGenDecl(f, node) - case *ast.CompositeLit: - checkCopyLocksCompositeLit(f, node) - case *ast.ReturnStmt: - checkCopyLocksReturnStmt(f, node) - } -} - -// checkCopyLocksAssign checks whether an assignment -// copies a lock. -func checkCopyLocksAssign(f *File, as *ast.AssignStmt) { - for i, x := range as.Rhs { - if path := lockPathRhs(f, x); path != nil { - f.Badf(x.Pos(), "assignment copies lock value to %v: %v", f.gofmt(as.Lhs[i]), path) - } - } -} - -// checkCopyLocksGenDecl checks whether lock is copied -// in variable declaration. -func checkCopyLocksGenDecl(f *File, gd *ast.GenDecl) { - if gd.Tok != token.VAR { - return - } - for _, spec := range gd.Specs { - valueSpec := spec.(*ast.ValueSpec) - for i, x := range valueSpec.Values { - if path := lockPathRhs(f, x); path != nil { - f.Badf(x.Pos(), "variable declaration copies lock value to %v: %v", valueSpec.Names[i].Name, path) - } - } - } -} - -// checkCopyLocksCompositeLit detects lock copy inside a composite literal -func checkCopyLocksCompositeLit(f *File, cl *ast.CompositeLit) { - for _, x := range cl.Elts { - if node, ok := x.(*ast.KeyValueExpr); ok { - x = node.Value - } - if path := lockPathRhs(f, x); path != nil { - f.Badf(x.Pos(), "literal copies lock value from %v: %v", f.gofmt(x), path) - } - } -} - -// checkCopyLocksReturnStmt detects lock copy in return statement -func checkCopyLocksReturnStmt(f *File, rs *ast.ReturnStmt) { - for _, x := range rs.Results { - if path := lockPathRhs(f, x); path != nil { - f.Badf(x.Pos(), "return copies lock value: %v", path) - } - } -} - -// checkCopyLocksCallExpr detects lock copy in the arguments to a function call -func checkCopyLocksCallExpr(f *File, ce *ast.CallExpr) { - var id *ast.Ident - switch fun := ce.Fun.(type) { - case *ast.Ident: - id = fun - case *ast.SelectorExpr: - id = fun.Sel - } - if fun, ok := f.pkg.uses[id].(*types.Builtin); ok { - switch fun.Name() { - case "new", "len", "cap", "Sizeof": - return - } - } - for _, x := range ce.Args { - if path := lockPathRhs(f, x); path != nil { - f.Badf(x.Pos(), "call of %s copies lock value: %v", f.gofmt(ce.Fun), path) - } - } -} - -// checkCopyLocksFunc checks whether a function might -// inadvertently copy a lock, by checking whether -// its receiver, parameters, or return values -// are locks. -func checkCopyLocksFunc(f *File, name string, recv *ast.FieldList, typ *ast.FuncType) { - if recv != nil && len(recv.List) > 0 { - expr := recv.List[0].Type - if path := lockPath(f.pkg.typesPkg, f.pkg.types[expr].Type); path != nil { - f.Badf(expr.Pos(), "%s passes lock by value: %v", name, path) - } - } - - if typ.Params != nil { - for _, field := range typ.Params.List { - expr := field.Type - if path := lockPath(f.pkg.typesPkg, f.pkg.types[expr].Type); path != nil { - f.Badf(expr.Pos(), "%s passes lock by value: %v", name, path) - } - } - } - - // Don't check typ.Results. If T has a Lock field it's OK to write - // return T{} - // because that is returning the zero value. Leave result checking - // to the return statement. -} - -// checkCopyLocksRange checks whether a range statement -// might inadvertently copy a lock by checking whether -// any of the range variables are locks. -func checkCopyLocksRange(f *File, r *ast.RangeStmt) { - checkCopyLocksRangeVar(f, r.Tok, r.Key) - checkCopyLocksRangeVar(f, r.Tok, r.Value) -} - -func checkCopyLocksRangeVar(f *File, rtok token.Token, e ast.Expr) { - if e == nil { - return - } - id, isId := e.(*ast.Ident) - if isId && id.Name == "_" { - return - } - - var typ types.Type - if rtok == token.DEFINE { - if !isId { - return - } - obj := f.pkg.defs[id] - if obj == nil { - return - } - typ = obj.Type() - } else { - typ = f.pkg.types[e].Type - } - - if typ == nil { - return - } - if path := lockPath(f.pkg.typesPkg, typ); path != nil { - f.Badf(e.Pos(), "range var %s copies lock: %v", f.gofmt(e), path) - } -} - -type typePath []types.Type - -// String pretty-prints a typePath. -func (path typePath) String() string { - n := len(path) - var buf bytes.Buffer - for i := range path { - if i > 0 { - fmt.Fprint(&buf, " contains ") - } - // The human-readable path is in reverse order, outermost to innermost. - fmt.Fprint(&buf, path[n-i-1].String()) - } - return buf.String() -} - -func lockPathRhs(f *File, x ast.Expr) typePath { - if _, ok := x.(*ast.CompositeLit); ok { - return nil - } - if _, ok := x.(*ast.CallExpr); ok { - // A call may return a zero value. - return nil - } - if star, ok := x.(*ast.StarExpr); ok { - if _, ok := star.X.(*ast.CallExpr); ok { - // A call may return a pointer to a zero value. - return nil - } - } - return lockPath(f.pkg.typesPkg, f.pkg.types[x].Type) -} - -// lockPath returns a typePath describing the location of a lock value -// contained in typ. If there is no contained lock, it returns nil. -func lockPath(tpkg *types.Package, typ types.Type) typePath { - if typ == nil { - return nil - } - - for { - atyp, ok := typ.Underlying().(*types.Array) - if !ok { - break - } - typ = atyp.Elem() - } - - // We're only interested in the case in which the underlying - // type is a struct. (Interfaces and pointers are safe to copy.) - styp, ok := typ.Underlying().(*types.Struct) - if !ok { - return nil - } - - // We're looking for cases in which a pointer to this type - // is a sync.Locker, but a value is not. This differentiates - // embedded interfaces from embedded values. - if types.Implements(types.NewPointer(typ), lockerType) && !types.Implements(typ, lockerType) { - return []types.Type{typ} - } - - nfields := styp.NumFields() - for i := 0; i < nfields; i++ { - ftyp := styp.Field(i).Type() - subpath := lockPath(tpkg, ftyp) - if subpath != nil { - return append(subpath, typ) - } - } - - return nil -} - -var lockerType *types.Interface - -// Construct a sync.Locker interface type. -func init() { - nullary := types.NewSignature(nil, nil, nil, false) // func() - methods := []*types.Func{ - types.NewFunc(token.NoPos, nil, "Lock", nullary), - types.NewFunc(token.NoPos, nil, "Unlock", nullary), - } - lockerType = types.NewInterface(methods, nil).Complete() -} diff --git a/src/cmd/vet/dead.go b/src/cmd/vet/dead.go deleted file mode 100644 index 0facec552583a..0000000000000 --- a/src/cmd/vet/dead.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Simplified dead code detector. Used for skipping certain checks -// on unreachable code (for instance, shift checks on arch-specific code). - -package main - -import ( - "go/ast" - "go/constant" -) - -// updateDead puts unreachable "if" and "case" nodes into f.dead. -func (f *File) updateDead(node ast.Node) { - if f.dead[node] { - // The node is already marked as dead. - return - } - - switch stmt := node.(type) { - case *ast.IfStmt: - // "if" branch is dead if its condition evaluates - // to constant false. - v := f.pkg.types[stmt.Cond].Value - if v == nil { - return - } - if !constant.BoolVal(v) { - f.setDead(stmt.Body) - return - } - f.setDead(stmt.Else) - case *ast.SwitchStmt: - // Case clause with empty switch tag is dead if it evaluates - // to constant false. - if stmt.Tag == nil { - BodyLoopBool: - for _, stmt := range stmt.Body.List { - cc := stmt.(*ast.CaseClause) - if cc.List == nil { - // Skip default case. - continue - } - for _, expr := range cc.List { - v := f.pkg.types[expr].Value - if v == nil || v.Kind() != constant.Bool || constant.BoolVal(v) { - continue BodyLoopBool - } - } - f.setDead(cc) - } - return - } - - // Case clause is dead if its constant value doesn't match - // the constant value from the switch tag. - // TODO: This handles integer comparisons only. - v := f.pkg.types[stmt.Tag].Value - if v == nil || v.Kind() != constant.Int { - return - } - tagN, ok := constant.Uint64Val(v) - if !ok { - return - } - BodyLoopInt: - for _, x := range stmt.Body.List { - cc := x.(*ast.CaseClause) - if cc.List == nil { - // Skip default case. - continue - } - for _, expr := range cc.List { - v := f.pkg.types[expr].Value - if v == nil { - continue BodyLoopInt - } - n, ok := constant.Uint64Val(v) - if !ok || tagN == n { - continue BodyLoopInt - } - } - f.setDead(cc) - } - } -} - -// setDead marks the node and all the children as dead. -func (f *File) setDead(node ast.Node) { - dv := deadVisitor{ - f: f, - } - ast.Walk(dv, node) -} - -type deadVisitor struct { - f *File -} - -func (dv deadVisitor) Visit(node ast.Node) ast.Visitor { - if node == nil { - return nil - } - dv.f.dead[node] = true - return dv -} diff --git a/src/cmd/vet/deadcode.go b/src/cmd/vet/deadcode.go deleted file mode 100644 index b1077aef38fdc..0000000000000 --- a/src/cmd/vet/deadcode.go +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright 2013 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. - -// Check for syntactically unreachable code. - -package main - -import ( - "go/ast" - "go/token" -) - -func init() { - register("unreachable", - "check for unreachable code", - checkUnreachable, - funcDecl, funcLit) -} - -type deadState struct { - f *File - hasBreak map[ast.Stmt]bool - hasGoto map[string]bool - labels map[string]ast.Stmt - breakTarget ast.Stmt - - reachable bool -} - -// checkUnreachable checks a function body for dead code. -// -// TODO(adonovan): use the new cfg package, which is more precise. -func checkUnreachable(f *File, node ast.Node) { - var body *ast.BlockStmt - switch n := node.(type) { - case *ast.FuncDecl: - body = n.Body - case *ast.FuncLit: - body = n.Body - } - if body == nil { - return - } - - d := &deadState{ - f: f, - hasBreak: make(map[ast.Stmt]bool), - hasGoto: make(map[string]bool), - labels: make(map[string]ast.Stmt), - } - - d.findLabels(body) - - d.reachable = true - d.findDead(body) -} - -// findLabels gathers information about the labels defined and used by stmt -// and about which statements break, whether a label is involved or not. -func (d *deadState) findLabels(stmt ast.Stmt) { - switch x := stmt.(type) { - default: - d.f.Warnf(x.Pos(), "internal error in findLabels: unexpected statement %T", x) - - case *ast.AssignStmt, - *ast.BadStmt, - *ast.DeclStmt, - *ast.DeferStmt, - *ast.EmptyStmt, - *ast.ExprStmt, - *ast.GoStmt, - *ast.IncDecStmt, - *ast.ReturnStmt, - *ast.SendStmt: - // no statements inside - - case *ast.BlockStmt: - for _, stmt := range x.List { - d.findLabels(stmt) - } - - case *ast.BranchStmt: - switch x.Tok { - case token.GOTO: - if x.Label != nil { - d.hasGoto[x.Label.Name] = true - } - - case token.BREAK: - stmt := d.breakTarget - if x.Label != nil { - stmt = d.labels[x.Label.Name] - } - if stmt != nil { - d.hasBreak[stmt] = true - } - } - - case *ast.IfStmt: - d.findLabels(x.Body) - if x.Else != nil { - d.findLabels(x.Else) - } - - case *ast.LabeledStmt: - d.labels[x.Label.Name] = x.Stmt - d.findLabels(x.Stmt) - - // These cases are all the same, but the x.Body only works - // when the specific type of x is known, so the cases cannot - // be merged. - case *ast.ForStmt: - outer := d.breakTarget - d.breakTarget = x - d.findLabels(x.Body) - d.breakTarget = outer - - case *ast.RangeStmt: - outer := d.breakTarget - d.breakTarget = x - d.findLabels(x.Body) - d.breakTarget = outer - - case *ast.SelectStmt: - outer := d.breakTarget - d.breakTarget = x - d.findLabels(x.Body) - d.breakTarget = outer - - case *ast.SwitchStmt: - outer := d.breakTarget - d.breakTarget = x - d.findLabels(x.Body) - d.breakTarget = outer - - case *ast.TypeSwitchStmt: - outer := d.breakTarget - d.breakTarget = x - d.findLabels(x.Body) - d.breakTarget = outer - - case *ast.CommClause: - for _, stmt := range x.Body { - d.findLabels(stmt) - } - - case *ast.CaseClause: - for _, stmt := range x.Body { - d.findLabels(stmt) - } - } -} - -// findDead walks the statement looking for dead code. -// If d.reachable is false on entry, stmt itself is dead. -// When findDead returns, d.reachable tells whether the -// statement following stmt is reachable. -func (d *deadState) findDead(stmt ast.Stmt) { - // Is this a labeled goto target? - // If so, assume it is reachable due to the goto. - // This is slightly conservative, in that we don't - // check that the goto is reachable, so - // L: goto L - // will not provoke a warning. - // But it's good enough. - if x, isLabel := stmt.(*ast.LabeledStmt); isLabel && d.hasGoto[x.Label.Name] { - d.reachable = true - } - - if !d.reachable { - switch stmt.(type) { - case *ast.EmptyStmt: - // do not warn about unreachable empty statements - default: - d.f.Bad(stmt.Pos(), "unreachable code") - d.reachable = true // silence error about next statement - } - } - - switch x := stmt.(type) { - default: - d.f.Warnf(x.Pos(), "internal error in findDead: unexpected statement %T", x) - - case *ast.AssignStmt, - *ast.BadStmt, - *ast.DeclStmt, - *ast.DeferStmt, - *ast.EmptyStmt, - *ast.GoStmt, - *ast.IncDecStmt, - *ast.SendStmt: - // no control flow - - case *ast.BlockStmt: - for _, stmt := range x.List { - d.findDead(stmt) - } - - case *ast.BranchStmt: - switch x.Tok { - case token.BREAK, token.GOTO, token.FALLTHROUGH: - d.reachable = false - case token.CONTINUE: - // NOTE: We accept "continue" statements as terminating. - // They are not necessary in the spec definition of terminating, - // because a continue statement cannot be the final statement - // before a return. But for the more general problem of syntactically - // identifying dead code, continue redirects control flow just - // like the other terminating statements. - d.reachable = false - } - - case *ast.ExprStmt: - // Call to panic? - call, ok := x.X.(*ast.CallExpr) - if ok { - name, ok := call.Fun.(*ast.Ident) - if ok && name.Name == "panic" && name.Obj == nil { - d.reachable = false - } - } - - case *ast.ForStmt: - d.findDead(x.Body) - d.reachable = x.Cond != nil || d.hasBreak[x] - - case *ast.IfStmt: - d.findDead(x.Body) - if x.Else != nil { - r := d.reachable - d.reachable = true - d.findDead(x.Else) - d.reachable = d.reachable || r - } else { - // might not have executed if statement - d.reachable = true - } - - case *ast.LabeledStmt: - d.findDead(x.Stmt) - - case *ast.RangeStmt: - d.findDead(x.Body) - d.reachable = true - - case *ast.ReturnStmt: - d.reachable = false - - case *ast.SelectStmt: - // NOTE: Unlike switch and type switch below, we don't care - // whether a select has a default, because a select without a - // default blocks until one of the cases can run. That's different - // from a switch without a default, which behaves like it has - // a default with an empty body. - anyReachable := false - for _, comm := range x.Body.List { - d.reachable = true - for _, stmt := range comm.(*ast.CommClause).Body { - d.findDead(stmt) - } - anyReachable = anyReachable || d.reachable - } - d.reachable = anyReachable || d.hasBreak[x] - - case *ast.SwitchStmt: - anyReachable := false - hasDefault := false - for _, cas := range x.Body.List { - cc := cas.(*ast.CaseClause) - if cc.List == nil { - hasDefault = true - } - d.reachable = true - for _, stmt := range cc.Body { - d.findDead(stmt) - } - anyReachable = anyReachable || d.reachable - } - d.reachable = anyReachable || d.hasBreak[x] || !hasDefault - - case *ast.TypeSwitchStmt: - anyReachable := false - hasDefault := false - for _, cas := range x.Body.List { - cc := cas.(*ast.CaseClause) - if cc.List == nil { - hasDefault = true - } - d.reachable = true - for _, stmt := range cc.Body { - d.findDead(stmt) - } - anyReachable = anyReachable || d.reachable - } - d.reachable = anyReachable || d.hasBreak[x] || !hasDefault - } -} diff --git a/src/cmd/vet/doc.go b/src/cmd/vet/doc.go deleted file mode 100644 index d9af0a88759a3..0000000000000 --- a/src/cmd/vet/doc.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright 2010 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. - -/* - -Vet examines Go source code and reports suspicious constructs, such as Printf -calls whose arguments do not align with the format string. Vet uses heuristics -that do not guarantee all reports are genuine problems, but it can find errors -not caught by the compilers. - -Vet is normally invoked using the go command by running "go vet": - - go vet -vets the package in the current directory. - - go vet package/path/name -vets the package whose path is provided. - -Use "go help packages" to see other ways of specifying which packages to vet. - -Vet's exit code is 2 for erroneous invocation of the tool, 1 if a -problem was reported, and 0 otherwise. Note that the tool does not -check every possible problem and depends on unreliable heuristics -so it should be used as guidance only, not as a firm indicator of -program correctness. - -By default the -all flag is set so all checks are performed. -If any flags are explicitly set to true, only those tests are run. Conversely, if -any flag is explicitly set to false, only those tests are disabled. Thus -printf=true -runs the printf check, -printf=false runs all checks except the printf check. - -By default vet uses the object files generated by 'go install some/pkg' to typecheck the code. -If the -source flag is provided, vet uses only source code. - -Available checks: - -Assembly declarations - -Flag: -asmdecl - -Mismatches between assembly files and Go function declarations. - -Useless assignments - -Flag: -assign - -Check for useless assignments. - -Atomic mistakes - -Flag: -atomic - -Common mistaken usages of the sync/atomic package. - -Boolean conditions - -Flag: -bool - -Mistakes involving boolean operators. - -Build tags - -Flag: -buildtags - -Badly formed or misplaced +build tags. - -Invalid uses of cgo - -Flag: -cgocall - -Detect some violations of the cgo pointer passing rules. - -Unkeyed composite literals - -Flag: -composites - -Composite struct literals that do not use the field-keyed syntax. - -Copying locks - -Flag: -copylocks - -Locks that are erroneously passed by value. - -HTTP responses used incorrectly - -Flag: -httpresponse - -Mistakes deferring a function call on an HTTP response before -checking whether the error returned with the response was nil. - -Failure to call the cancelation function returned by WithCancel - -Flag: -lostcancel - -The cancelation function returned by context.WithCancel, WithTimeout, -and WithDeadline must be called or the new context will remain live -until its parent context is cancelled. -(The background context is never cancelled.) - -Methods - -Flag: -methods - -Non-standard signatures for methods with familiar names, including: - Format GobEncode GobDecode MarshalJSON MarshalXML - Peek ReadByte ReadFrom ReadRune Scan Seek - UnmarshalJSON UnreadByte UnreadRune WriteByte - WriteTo - -Nil function comparison - -Flag: -nilfunc - -Comparisons between functions and nil. - -Printf family - -Flag: -printf - -Suspicious calls to fmt.Print, fmt.Printf, and related functions. -The check applies to known functions (for example, those in package fmt) -as well as any detected wrappers of known functions. - -The -printfuncs flag specifies a comma-separated list of names of -additional known formatting functions. Each name can be of the form -pkg.Name or pkg.Type.Name, where pkg is a complete import path, -or else can be a case-insensitive unqualified identifier like "errorf". -If a listed name ends in f, the function is assumed to be Printf-like, -taking a format string before the argument list. Otherwise it is -assumed to be Print-like, taking a list of arguments with no format string. - -Range loop variables - -Flag: -rangeloops - -Incorrect uses of range loop variables in closures. - -Shadowed variables - -Flag: -shadow=false (experimental; must be set explicitly) - -Variables that may have been unintentionally shadowed. - -Shifts - -Flag: -shift - -Shifts equal to or longer than the variable's length. - -Struct tags - -Flag: -structtags - -Struct tags that do not follow the format understood by reflect.StructTag.Get. -Well-known encoding struct tags (json, xml) used with unexported fields. - -Tests and documentation examples - -Flag: -tests - -Mistakes involving tests including functions with incorrect names or signatures -and example tests that document identifiers not in the package. - -Unreachable code - -Flag: -unreachable - -Unreachable code. - -Misuse of unsafe Pointers - -Flag: -unsafeptr - -Likely incorrect uses of unsafe.Pointer to convert integers to pointers. -A conversion from uintptr to unsafe.Pointer is invalid if it implies that -there is a uintptr-typed word in memory that holds a pointer value, -because that word will be invisible to stack copying and to the garbage -collector. - -Unused result of certain function calls - -Flag: -unusedresult - -Calls to well-known functions and methods that return a value that is -discarded. By default, this includes functions like fmt.Errorf and -fmt.Sprintf and methods like String and Error. The flags -unusedfuncs -and -unusedstringmethods control the set. - -Other flags - -These flags configure the behavior of vet: - - -all (default true) - Enable all non-experimental checks. - -v - Verbose mode - -printfuncs - A comma-separated list of print-like function names - to supplement the standard list. - For more information, see the discussion of the -printf flag. - -shadowstrict - Whether to be strict about shadowing; can be noisy. - -Using vet directly - -For testing and debugging vet can be run directly by invoking -"go tool vet" or just running the binary. Run this way, vet might not -have up to date information for imported packages. - - go tool vet source/directory/*.go -vets the files named, all of which must be in the same package. - - go tool vet source/directory -recursively descends the directory, vetting each package it finds. - -*/ -package main diff --git a/src/cmd/vet/httpresponse.go b/src/cmd/vet/httpresponse.go deleted file mode 100644 index 791d11d5bdef0..0000000000000 --- a/src/cmd/vet/httpresponse.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains the check for http.Response values being used before -// checking for errors. - -package main - -import ( - "go/ast" - "go/types" -) - -func init() { - register("httpresponse", - "check errors are checked before using an http Response", - checkHTTPResponse, callExpr) -} - -func checkHTTPResponse(f *File, node ast.Node) { - call := node.(*ast.CallExpr) - if !isHTTPFuncOrMethodOnClient(f, call) { - return // the function call is not related to this check. - } - - finder := &blockStmtFinder{node: call} - ast.Walk(finder, f.file) - stmts := finder.stmts() - if len(stmts) < 2 { - return // the call to the http function is the last statement of the block. - } - - asg, ok := stmts[0].(*ast.AssignStmt) - if !ok { - return // the first statement is not assignment. - } - resp := rootIdent(asg.Lhs[0]) - if resp == nil { - return // could not find the http.Response in the assignment. - } - - def, ok := stmts[1].(*ast.DeferStmt) - if !ok { - return // the following statement is not a defer. - } - root := rootIdent(def.Call.Fun) - if root == nil { - return // could not find the receiver of the defer call. - } - - if resp.Obj == root.Obj { - f.Badf(root.Pos(), "using %s before checking for errors", resp.Name) - } -} - -// isHTTPFuncOrMethodOnClient checks whether the given call expression is on -// either a function of the net/http package or a method of http.Client that -// returns (*http.Response, error). -func isHTTPFuncOrMethodOnClient(f *File, expr *ast.CallExpr) bool { - fun, _ := expr.Fun.(*ast.SelectorExpr) - sig, _ := f.pkg.types[fun].Type.(*types.Signature) - if sig == nil { - return false // the call is not on of the form x.f() - } - - res := sig.Results() - if res.Len() != 2 { - return false // the function called does not return two values. - } - if ptr, ok := res.At(0).Type().(*types.Pointer); !ok || !isNamedType(ptr.Elem(), "net/http", "Response") { - return false // the first return type is not *http.Response. - } - if !types.Identical(res.At(1).Type().Underlying(), errorType) { - return false // the second return type is not error - } - - typ := f.pkg.types[fun.X].Type - if typ == nil { - id, ok := fun.X.(*ast.Ident) - return ok && id.Name == "http" // function in net/http package. - } - - if isNamedType(typ, "net/http", "Client") { - return true // method on http.Client. - } - ptr, ok := typ.(*types.Pointer) - return ok && isNamedType(ptr.Elem(), "net/http", "Client") // method on *http.Client. -} - -// blockStmtFinder is an ast.Visitor that given any ast node can find the -// statement containing it and its succeeding statements in the same block. -type blockStmtFinder struct { - node ast.Node // target of search - stmt ast.Stmt // innermost statement enclosing argument to Visit - block *ast.BlockStmt // innermost block enclosing argument to Visit. -} - -// Visit finds f.node performing a search down the ast tree. -// It keeps the last block statement and statement seen for later use. -func (f *blockStmtFinder) Visit(node ast.Node) ast.Visitor { - if node == nil || f.node.Pos() < node.Pos() || f.node.End() > node.End() { - return nil // not here - } - switch n := node.(type) { - case *ast.BlockStmt: - f.block = n - case ast.Stmt: - f.stmt = n - } - if f.node.Pos() == node.Pos() && f.node.End() == node.End() { - return nil // found - } - return f // keep looking -} - -// stmts returns the statements of f.block starting from the one including f.node. -func (f *blockStmtFinder) stmts() []ast.Stmt { - for i, v := range f.block.List { - if f.stmt == v { - return f.block.List[i:] - } - } - return nil -} - -// rootIdent finds the root identifier x in a chain of selections x.y.z, or nil if not found. -func rootIdent(n ast.Node) *ast.Ident { - switch n := n.(type) { - case *ast.SelectorExpr: - return rootIdent(n.X) - case *ast.Ident: - return n - default: - return nil - } -} diff --git a/src/cmd/vet/internal/cfg/builder.go b/src/cmd/vet/internal/cfg/builder.go deleted file mode 100644 index da1cc7e6384df..0000000000000 --- a/src/cmd/vet/internal/cfg/builder.go +++ /dev/null @@ -1,512 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cfg - -// This file implements the CFG construction pass. - -import ( - "fmt" - "go/ast" - "go/token" -) - -type builder struct { - cfg *CFG - mayReturn func(*ast.CallExpr) bool - current *Block - lblocks map[*ast.Object]*lblock // labeled blocks - targets *targets // linked stack of branch targets -} - -func (b *builder) stmt(_s ast.Stmt) { - // The label of the current statement. If non-nil, its _goto - // target is always set; its _break and _continue are set only - // within the body of switch/typeswitch/select/for/range. - // It is effectively an additional default-nil parameter of stmt(). - var label *lblock -start: - switch s := _s.(type) { - case *ast.BadStmt, - *ast.SendStmt, - *ast.IncDecStmt, - *ast.GoStmt, - *ast.DeferStmt, - *ast.EmptyStmt, - *ast.AssignStmt: - // No effect on control flow. - b.add(s) - - case *ast.ExprStmt: - b.add(s) - if call, ok := s.X.(*ast.CallExpr); ok && !b.mayReturn(call) { - // Calls to panic, os.Exit, etc, never return. - b.current = b.newUnreachableBlock("unreachable.call") - } - - case *ast.DeclStmt: - // Treat each var ValueSpec as a separate statement. - d := s.Decl.(*ast.GenDecl) - if d.Tok == token.VAR { - for _, spec := range d.Specs { - if spec, ok := spec.(*ast.ValueSpec); ok { - b.add(spec) - } - } - } - - case *ast.LabeledStmt: - label = b.labeledBlock(s.Label) - b.jump(label._goto) - b.current = label._goto - _s = s.Stmt - goto start // effectively: tailcall stmt(g, s.Stmt, label) - - case *ast.ReturnStmt: - b.add(s) - b.current = b.newUnreachableBlock("unreachable.return") - - case *ast.BranchStmt: - var block *Block - switch s.Tok { - case token.BREAK: - if s.Label != nil { - if lb := b.labeledBlock(s.Label); lb != nil { - block = lb._break - } - } else { - for t := b.targets; t != nil && block == nil; t = t.tail { - block = t._break - } - } - - case token.CONTINUE: - if s.Label != nil { - if lb := b.labeledBlock(s.Label); lb != nil { - block = lb._continue - } - } else { - for t := b.targets; t != nil && block == nil; t = t.tail { - block = t._continue - } - } - - case token.FALLTHROUGH: - for t := b.targets; t != nil; t = t.tail { - block = t._fallthrough - } - - case token.GOTO: - if s.Label != nil { - block = b.labeledBlock(s.Label)._goto - } - } - if block == nil { - block = b.newBlock("undefined.branch") - } - b.jump(block) - b.current = b.newUnreachableBlock("unreachable.branch") - - case *ast.BlockStmt: - b.stmtList(s.List) - - case *ast.IfStmt: - if s.Init != nil { - b.stmt(s.Init) - } - then := b.newBlock("if.then") - done := b.newBlock("if.done") - _else := done - if s.Else != nil { - _else = b.newBlock("if.else") - } - b.add(s.Cond) - b.ifelse(then, _else) - b.current = then - b.stmt(s.Body) - b.jump(done) - - if s.Else != nil { - b.current = _else - b.stmt(s.Else) - b.jump(done) - } - - b.current = done - - case *ast.SwitchStmt: - b.switchStmt(s, label) - - case *ast.TypeSwitchStmt: - b.typeSwitchStmt(s, label) - - case *ast.SelectStmt: - b.selectStmt(s, label) - - case *ast.ForStmt: - b.forStmt(s, label) - - case *ast.RangeStmt: - b.rangeStmt(s, label) - - default: - panic(fmt.Sprintf("unexpected statement kind: %T", s)) - } -} - -func (b *builder) stmtList(list []ast.Stmt) { - for _, s := range list { - b.stmt(s) - } -} - -func (b *builder) switchStmt(s *ast.SwitchStmt, label *lblock) { - if s.Init != nil { - b.stmt(s.Init) - } - if s.Tag != nil { - b.add(s.Tag) - } - done := b.newBlock("switch.done") - if label != nil { - label._break = done - } - // We pull the default case (if present) down to the end. - // But each fallthrough label must point to the next - // body block in source order, so we preallocate a - // body block (fallthru) for the next case. - // Unfortunately this makes for a confusing block order. - var defaultBody *[]ast.Stmt - var defaultFallthrough *Block - var fallthru, defaultBlock *Block - ncases := len(s.Body.List) - for i, clause := range s.Body.List { - body := fallthru - if body == nil { - body = b.newBlock("switch.body") // first case only - } - - // Preallocate body block for the next case. - fallthru = done - if i+1 < ncases { - fallthru = b.newBlock("switch.body") - } - - cc := clause.(*ast.CaseClause) - if cc.List == nil { - // Default case. - defaultBody = &cc.Body - defaultFallthrough = fallthru - defaultBlock = body - continue - } - - var nextCond *Block - for _, cond := range cc.List { - nextCond = b.newBlock("switch.next") - b.add(cond) // one half of the tag==cond condition - b.ifelse(body, nextCond) - b.current = nextCond - } - b.current = body - b.targets = &targets{ - tail: b.targets, - _break: done, - _fallthrough: fallthru, - } - b.stmtList(cc.Body) - b.targets = b.targets.tail - b.jump(done) - b.current = nextCond - } - if defaultBlock != nil { - b.jump(defaultBlock) - b.current = defaultBlock - b.targets = &targets{ - tail: b.targets, - _break: done, - _fallthrough: defaultFallthrough, - } - b.stmtList(*defaultBody) - b.targets = b.targets.tail - } - b.jump(done) - b.current = done -} - -func (b *builder) typeSwitchStmt(s *ast.TypeSwitchStmt, label *lblock) { - if s.Init != nil { - b.stmt(s.Init) - } - if s.Assign != nil { - b.add(s.Assign) - } - - done := b.newBlock("typeswitch.done") - if label != nil { - label._break = done - } - var default_ *ast.CaseClause - for _, clause := range s.Body.List { - cc := clause.(*ast.CaseClause) - if cc.List == nil { - default_ = cc - continue - } - body := b.newBlock("typeswitch.body") - var next *Block - for _, casetype := range cc.List { - next = b.newBlock("typeswitch.next") - // casetype is a type, so don't call b.add(casetype). - // This block logically contains a type assertion, - // x.(casetype), but it's unclear how to represent x. - _ = casetype - b.ifelse(body, next) - b.current = next - } - b.current = body - b.typeCaseBody(cc, done) - b.current = next - } - if default_ != nil { - b.typeCaseBody(default_, done) - } else { - b.jump(done) - } - b.current = done -} - -func (b *builder) typeCaseBody(cc *ast.CaseClause, done *Block) { - b.targets = &targets{ - tail: b.targets, - _break: done, - } - b.stmtList(cc.Body) - b.targets = b.targets.tail - b.jump(done) -} - -func (b *builder) selectStmt(s *ast.SelectStmt, label *lblock) { - // First evaluate channel expressions. - // TODO(adonovan): fix: evaluate only channel exprs here. - for _, clause := range s.Body.List { - if comm := clause.(*ast.CommClause).Comm; comm != nil { - b.stmt(comm) - } - } - - done := b.newBlock("select.done") - if label != nil { - label._break = done - } - - var defaultBody *[]ast.Stmt - for _, cc := range s.Body.List { - clause := cc.(*ast.CommClause) - if clause.Comm == nil { - defaultBody = &clause.Body - continue - } - body := b.newBlock("select.body") - next := b.newBlock("select.next") - b.ifelse(body, next) - b.current = body - b.targets = &targets{ - tail: b.targets, - _break: done, - } - switch comm := clause.Comm.(type) { - case *ast.ExprStmt: // <-ch - // nop - case *ast.AssignStmt: // x := <-states[state].Chan - b.add(comm.Lhs[0]) - } - b.stmtList(clause.Body) - b.targets = b.targets.tail - b.jump(done) - b.current = next - } - if defaultBody != nil { - b.targets = &targets{ - tail: b.targets, - _break: done, - } - b.stmtList(*defaultBody) - b.targets = b.targets.tail - b.jump(done) - } - b.current = done -} - -func (b *builder) forStmt(s *ast.ForStmt, label *lblock) { - // ...init... - // jump loop - // loop: - // if cond goto body else done - // body: - // ...body... - // jump post - // post: (target of continue) - // ...post... - // jump loop - // done: (target of break) - if s.Init != nil { - b.stmt(s.Init) - } - body := b.newBlock("for.body") - done := b.newBlock("for.done") // target of 'break' - loop := body // target of back-edge - if s.Cond != nil { - loop = b.newBlock("for.loop") - } - cont := loop // target of 'continue' - if s.Post != nil { - cont = b.newBlock("for.post") - } - if label != nil { - label._break = done - label._continue = cont - } - b.jump(loop) - b.current = loop - if loop != body { - b.add(s.Cond) - b.ifelse(body, done) - b.current = body - } - b.targets = &targets{ - tail: b.targets, - _break: done, - _continue: cont, - } - b.stmt(s.Body) - b.targets = b.targets.tail - b.jump(cont) - - if s.Post != nil { - b.current = cont - b.stmt(s.Post) - b.jump(loop) // back-edge - } - b.current = done -} - -func (b *builder) rangeStmt(s *ast.RangeStmt, label *lblock) { - b.add(s.X) - - if s.Key != nil { - b.add(s.Key) - } - if s.Value != nil { - b.add(s.Value) - } - - // ... - // loop: (target of continue) - // if ... goto body else done - // body: - // ... - // jump loop - // done: (target of break) - - loop := b.newBlock("range.loop") - b.jump(loop) - b.current = loop - - body := b.newBlock("range.body") - done := b.newBlock("range.done") - b.ifelse(body, done) - b.current = body - - if label != nil { - label._break = done - label._continue = loop - } - b.targets = &targets{ - tail: b.targets, - _break: done, - _continue: loop, - } - b.stmt(s.Body) - b.targets = b.targets.tail - b.jump(loop) // back-edge - b.current = done -} - -// -------- helpers -------- - -// Destinations associated with unlabeled for/switch/select stmts. -// We push/pop one of these as we enter/leave each construct and for -// each BranchStmt we scan for the innermost target of the right type. -// -type targets struct { - tail *targets // rest of stack - _break *Block - _continue *Block - _fallthrough *Block -} - -// Destinations associated with a labeled block. -// We populate these as labels are encountered in forward gotos or -// labeled statements. -// -type lblock struct { - _goto *Block - _break *Block - _continue *Block -} - -// labeledBlock returns the branch target associated with the -// specified label, creating it if needed. -// -func (b *builder) labeledBlock(label *ast.Ident) *lblock { - lb := b.lblocks[label.Obj] - if lb == nil { - lb = &lblock{_goto: b.newBlock(label.Name)} - if b.lblocks == nil { - b.lblocks = make(map[*ast.Object]*lblock) - } - b.lblocks[label.Obj] = lb - } - return lb -} - -// newBlock appends a new unconnected basic block to b.cfg's block -// slice and returns it. -// It does not automatically become the current block. -// comment is an optional string for more readable debugging output. -func (b *builder) newBlock(comment string) *Block { - g := b.cfg - block := &Block{ - index: int32(len(g.Blocks)), - comment: comment, - } - block.Succs = block.succs2[:0] - g.Blocks = append(g.Blocks, block) - return block -} - -func (b *builder) newUnreachableBlock(comment string) *Block { - block := b.newBlock(comment) - block.unreachable = true - return block -} - -func (b *builder) add(n ast.Node) { - b.current.Nodes = append(b.current.Nodes, n) -} - -// jump adds an edge from the current block to the target block, -// and sets b.current to nil. -func (b *builder) jump(target *Block) { - b.current.Succs = append(b.current.Succs, target) - b.current = nil -} - -// ifelse emits edges from the current block to the t and f blocks, -// and sets b.current to nil. -func (b *builder) ifelse(t, f *Block) { - b.current.Succs = append(b.current.Succs, t, f) - b.current = nil -} diff --git a/src/cmd/vet/internal/cfg/cfg.go b/src/cmd/vet/internal/cfg/cfg.go deleted file mode 100644 index e4d5bfe5d2d3b..0000000000000 --- a/src/cmd/vet/internal/cfg/cfg.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This package constructs a simple control-flow graph (CFG) of the -// statements and expressions within a single function. -// -// Use cfg.New to construct the CFG for a function body. -// -// The blocks of the CFG contain all the function's non-control -// statements. The CFG does not contain control statements such as If, -// Switch, Select, and Branch, but does contain their subexpressions. -// For example, this source code: -// -// if x := f(); x != nil { -// T() -// } else { -// F() -// } -// -// produces this CFG: -// -// 1: x := f() -// x != nil -// succs: 2, 3 -// 2: T() -// succs: 4 -// 3: F() -// succs: 4 -// 4: -// -// The CFG does contain Return statements; even implicit returns are -// materialized (at the position of the function's closing brace). -// -// The CFG does not record conditions associated with conditional branch -// edges, nor the short-circuit semantics of the && and || operators, -// nor abnormal control flow caused by panic. If you need this -// information, use golang.org/x/tools/go/ssa instead. -// -package cfg - -// Although the vet tool has type information, it is often extremely -// fragmentary, so for simplicity this package does not depend on -// go/types. Consequently control-flow conditions are ignored even -// when constant, and "mayReturn" information must be provided by the -// client. -import ( - "bytes" - "fmt" - "go/ast" - "go/format" - "go/token" -) - -// A CFG represents the control-flow graph of a single function. -// -// The entry point is Blocks[0]; there may be multiple return blocks. -type CFG struct { - Blocks []*Block // block[0] is entry; order otherwise undefined -} - -// A Block represents a basic block: a list of statements and -// expressions that are always evaluated sequentially. -// -// A block may have 0-2 successors: zero for a return block or a block -// that calls a function such as panic that never returns; one for a -// normal (jump) block; and two for a conditional (if) block. -type Block struct { - Nodes []ast.Node // statements, expressions, and ValueSpecs - Succs []*Block // successor nodes in the graph - - comment string // for debugging - index int32 // index within CFG.Blocks - unreachable bool // is block of stmts following return/panic/for{} - succs2 [2]*Block // underlying array for Succs -} - -// New returns a new control-flow graph for the specified function body, -// which must be non-nil. -// -// The CFG builder calls mayReturn to determine whether a given function -// call may return. For example, calls to panic, os.Exit, and log.Fatal -// do not return, so the builder can remove infeasible graph edges -// following such calls. The builder calls mayReturn only for a -// CallExpr beneath an ExprStmt. -func New(body *ast.BlockStmt, mayReturn func(*ast.CallExpr) bool) *CFG { - b := builder{ - mayReturn: mayReturn, - cfg: new(CFG), - } - b.current = b.newBlock("entry") - b.stmt(body) - - // Does control fall off the end of the function's body? - // Make implicit return explicit. - if b.current != nil && !b.current.unreachable { - b.add(&ast.ReturnStmt{ - Return: body.End() - 1, - }) - } - - return b.cfg -} - -func (b *Block) String() string { - return fmt.Sprintf("block %d (%s)", b.index, b.comment) -} - -// Return returns the return statement at the end of this block if present, nil otherwise. -func (b *Block) Return() (ret *ast.ReturnStmt) { - if len(b.Nodes) > 0 { - ret, _ = b.Nodes[len(b.Nodes)-1].(*ast.ReturnStmt) - } - return -} - -// Format formats the control-flow graph for ease of debugging. -func (g *CFG) Format(fset *token.FileSet) string { - var buf bytes.Buffer - for _, b := range g.Blocks { - fmt.Fprintf(&buf, ".%d: # %s\n", b.index, b.comment) - for _, n := range b.Nodes { - fmt.Fprintf(&buf, "\t%s\n", formatNode(fset, n)) - } - if len(b.Succs) > 0 { - fmt.Fprintf(&buf, "\tsuccs:") - for _, succ := range b.Succs { - fmt.Fprintf(&buf, " %d", succ.index) - } - buf.WriteByte('\n') - } - buf.WriteByte('\n') - } - return buf.String() -} - -func formatNode(fset *token.FileSet, n ast.Node) string { - var buf bytes.Buffer - format.Node(&buf, fset, n) - // Indent secondary lines by a tab. - return string(bytes.Replace(buf.Bytes(), []byte("\n"), []byte("\n\t"), -1)) -} diff --git a/src/cmd/vet/internal/cfg/cfg_test.go b/src/cmd/vet/internal/cfg/cfg_test.go deleted file mode 100644 index 2400fed6f4b2f..0000000000000 --- a/src/cmd/vet/internal/cfg/cfg_test.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cfg - -import ( - "bytes" - "fmt" - "go/ast" - "go/parser" - "go/token" - "testing" -) - -const src = `package main - -import "log" - -func f1() { - live() - return - dead() -} - -func f2() { - for { - live() - } - dead() -} - -func f3() { - if true { // even known values are ignored - return - } - for true { // even known values are ignored - live() - } - for { - live() - } - dead() -} - -func f4(x int) { - switch x { - case 1: - live() - fallthrough - case 2: - live() - log.Fatal() - default: - panic("oops") - } - dead() -} - -func f4(ch chan int) { - select { - case <-ch: - live() - return - default: - live() - panic("oops") - } - dead() -} - -func f5(unknown bool) { - for { - if unknown { - break - } - continue - dead() - } - live() -} - -func f6(unknown bool) { -outer: - for { - for { - break outer - dead() - } - dead() - } - live() -} - -func f7() { - for { - break nosuchlabel - dead() - } - dead() -} - -func f8() { - select{} - dead() -} - -func f9(ch chan int) { - select { - case <-ch: - return - } - dead() -} - -func f10(ch chan int) { - select { - case <-ch: - return - dead() - default: - } - live() -} - -func f11() { - goto; // mustn't crash - dead() -} - -` - -func TestDeadCode(t *testing.T) { - // We'll use dead code detection to verify the CFG. - - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, "dummy.go", src, parser.Mode(0)) - if err != nil { - t.Fatal(err) - } - for _, decl := range f.Decls { - if decl, ok := decl.(*ast.FuncDecl); ok { - g := New(decl.Body, mayReturn) - - // Mark blocks reachable from entry. - live := make(map[*Block]bool) - var visit func(*Block) - visit = func(b *Block) { - if !live[b] { - live[b] = true - for _, succ := range b.Succs { - visit(succ) - } - } - } - visit(g.Blocks[0]) - - // Print statements in unreachable blocks - // (in order determined by builder). - var buf bytes.Buffer - for _, b := range g.Blocks { - if !live[b] { - for _, n := range b.Nodes { - fmt.Fprintf(&buf, "\t%s\n", formatNode(fset, n)) - } - } - } - - // Check that the result contains "dead" at least once but not "live". - if !bytes.Contains(buf.Bytes(), []byte("dead")) || - bytes.Contains(buf.Bytes(), []byte("live")) { - t.Errorf("unexpected dead statements in function %s:\n%s", - decl.Name.Name, - &buf) - t.Logf("control flow graph:\n%s", g.Format(fset)) - } - } - } -} - -// A trivial mayReturn predicate that looks only at syntax, not types. -func mayReturn(call *ast.CallExpr) bool { - switch fun := call.Fun.(type) { - case *ast.Ident: - return fun.Name != "panic" - case *ast.SelectorExpr: - return fun.Sel.Name != "Fatal" - } - return true -} diff --git a/src/cmd/vet/internal/whitelist/whitelist.go b/src/cmd/vet/internal/whitelist/whitelist.go deleted file mode 100644 index fdd65d373233e..0000000000000 --- a/src/cmd/vet/internal/whitelist/whitelist.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package whitelist defines exceptions for the vet tool. -package whitelist - -// UnkeyedLiteral is a white list of types in the standard packages -// that are used with unkeyed literals we deem to be acceptable. -var UnkeyedLiteral = map[string]bool{ - // These image and image/color struct types are frozen. We will never add fields to them. - "image/color.Alpha16": true, - "image/color.Alpha": true, - "image/color.CMYK": true, - "image/color.Gray16": true, - "image/color.Gray": true, - "image/color.NRGBA64": true, - "image/color.NRGBA": true, - "image/color.NYCbCrA": true, - "image/color.RGBA64": true, - "image/color.RGBA": true, - "image/color.YCbCr": true, - "image.Point": true, - "image.Rectangle": true, - "image.Uniform": true, - - "unicode.Range16": true, -} diff --git a/src/cmd/vet/lostcancel.go b/src/cmd/vet/lostcancel.go deleted file mode 100644 index ee0342035fe37..0000000000000 --- a/src/cmd/vet/lostcancel.go +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "cmd/vet/internal/cfg" - "fmt" - "go/ast" - "go/types" - "strconv" -) - -func init() { - register("lostcancel", - "check for failure to call cancelation function returned by context.WithCancel", - checkLostCancel, - funcDecl, funcLit) -} - -const debugLostCancel = false - -var contextPackage = "context" - -// checkLostCancel reports a failure to the call the cancel function -// returned by context.WithCancel, either because the variable was -// assigned to the blank identifier, or because there exists a -// control-flow path from the call to a return statement and that path -// does not "use" the cancel function. Any reference to the variable -// counts as a use, even within a nested function literal. -// -// checkLostCancel analyzes a single named or literal function. -func checkLostCancel(f *File, node ast.Node) { - // Fast path: bypass check if file doesn't use context.WithCancel. - if !hasImport(f.file, contextPackage) { - return - } - - // Maps each cancel variable to its defining ValueSpec/AssignStmt. - cancelvars := make(map[*types.Var]ast.Node) - - // Find the set of cancel vars to analyze. - stack := make([]ast.Node, 0, 32) - ast.Inspect(node, func(n ast.Node) bool { - switch n.(type) { - case *ast.FuncLit: - if len(stack) > 0 { - return false // don't stray into nested functions - } - case nil: - stack = stack[:len(stack)-1] // pop - return true - } - stack = append(stack, n) // push - - // Look for [{AssignStmt,ValueSpec} CallExpr SelectorExpr]: - // - // ctx, cancel := context.WithCancel(...) - // ctx, cancel = context.WithCancel(...) - // var ctx, cancel = context.WithCancel(...) - // - if isContextWithCancel(f, n) && isCall(stack[len(stack)-2]) { - var id *ast.Ident // id of cancel var - stmt := stack[len(stack)-3] - switch stmt := stmt.(type) { - case *ast.ValueSpec: - if len(stmt.Names) > 1 { - id = stmt.Names[1] - } - case *ast.AssignStmt: - if len(stmt.Lhs) > 1 { - id, _ = stmt.Lhs[1].(*ast.Ident) - } - } - if id != nil { - if id.Name == "_" { - f.Badf(id.Pos(), "the cancel function returned by context.%s should be called, not discarded, to avoid a context leak", - n.(*ast.SelectorExpr).Sel.Name) - } else if v, ok := f.pkg.uses[id].(*types.Var); ok { - cancelvars[v] = stmt - } else if v, ok := f.pkg.defs[id].(*types.Var); ok { - cancelvars[v] = stmt - } - } - } - - return true - }) - - if len(cancelvars) == 0 { - return // no need to build CFG - } - - // Tell the CFG builder which functions never return. - info := &types.Info{Uses: f.pkg.uses, Selections: f.pkg.selectors} - mayReturn := func(call *ast.CallExpr) bool { - name := callName(info, call) - return !noReturnFuncs[name] - } - - // Build the CFG. - var g *cfg.CFG - var sig *types.Signature - switch node := node.(type) { - case *ast.FuncDecl: - obj := f.pkg.defs[node.Name] - if obj == nil { - return // type error (e.g. duplicate function declaration) - } - sig, _ = obj.Type().(*types.Signature) - g = cfg.New(node.Body, mayReturn) - case *ast.FuncLit: - sig, _ = f.pkg.types[node.Type].Type.(*types.Signature) - g = cfg.New(node.Body, mayReturn) - } - - // Print CFG. - if debugLostCancel { - fmt.Println(g.Format(f.fset)) - } - - // Examine the CFG for each variable in turn. - // (It would be more efficient to analyze all cancelvars in a - // single pass over the AST, but seldom is there more than one.) - for v, stmt := range cancelvars { - if ret := lostCancelPath(f, g, v, stmt, sig); ret != nil { - lineno := f.fset.Position(stmt.Pos()).Line - f.Badf(stmt.Pos(), "the %s function is not used on all paths (possible context leak)", v.Name()) - f.Badf(ret.Pos(), "this return statement may be reached without using the %s var defined on line %d", v.Name(), lineno) - } - } -} - -func isCall(n ast.Node) bool { _, ok := n.(*ast.CallExpr); return ok } - -func hasImport(f *ast.File, path string) bool { - for _, imp := range f.Imports { - v, _ := strconv.Unquote(imp.Path.Value) - if v == path { - return true - } - } - return false -} - -// isContextWithCancel reports whether n is one of the qualified identifiers -// context.With{Cancel,Timeout,Deadline}. -func isContextWithCancel(f *File, n ast.Node) bool { - if sel, ok := n.(*ast.SelectorExpr); ok { - switch sel.Sel.Name { - case "WithCancel", "WithTimeout", "WithDeadline": - if x, ok := sel.X.(*ast.Ident); ok { - if pkgname, ok := f.pkg.uses[x].(*types.PkgName); ok { - return pkgname.Imported().Path() == contextPackage - } - // Import failed, so we can't check package path. - // Just check the local package name (heuristic). - return x.Name == "context" - } - } - } - return false -} - -// lostCancelPath finds a path through the CFG, from stmt (which defines -// the 'cancel' variable v) to a return statement, that doesn't "use" v. -// If it finds one, it returns the return statement (which may be synthetic). -// sig is the function's type, if known. -func lostCancelPath(f *File, g *cfg.CFG, v *types.Var, stmt ast.Node, sig *types.Signature) *ast.ReturnStmt { - vIsNamedResult := sig != nil && tupleContains(sig.Results(), v) - - // uses reports whether stmts contain a "use" of variable v. - uses := func(f *File, v *types.Var, stmts []ast.Node) bool { - found := false - for _, stmt := range stmts { - ast.Inspect(stmt, func(n ast.Node) bool { - switch n := n.(type) { - case *ast.Ident: - if f.pkg.uses[n] == v { - found = true - } - case *ast.ReturnStmt: - // A naked return statement counts as a use - // of the named result variables. - if n.Results == nil && vIsNamedResult { - found = true - } - } - return !found - }) - } - return found - } - - // blockUses computes "uses" for each block, caching the result. - memo := make(map[*cfg.Block]bool) - blockUses := func(f *File, v *types.Var, b *cfg.Block) bool { - res, ok := memo[b] - if !ok { - res = uses(f, v, b.Nodes) - memo[b] = res - } - return res - } - - // Find the var's defining block in the CFG, - // plus the rest of the statements of that block. - var defblock *cfg.Block - var rest []ast.Node -outer: - for _, b := range g.Blocks { - for i, n := range b.Nodes { - if n == stmt { - defblock = b - rest = b.Nodes[i+1:] - break outer - } - } - } - if defblock == nil { - panic("internal error: can't find defining block for cancel var") - } - - // Is v "used" in the remainder of its defining block? - if uses(f, v, rest) { - return nil - } - - // Does the defining block return without using v? - if ret := defblock.Return(); ret != nil { - return ret - } - - // Search the CFG depth-first for a path, from defblock to a - // return block, in which v is never "used". - seen := make(map[*cfg.Block]bool) - var search func(blocks []*cfg.Block) *ast.ReturnStmt - search = func(blocks []*cfg.Block) *ast.ReturnStmt { - for _, b := range blocks { - if !seen[b] { - seen[b] = true - - // Prune the search if the block uses v. - if blockUses(f, v, b) { - continue - } - - // Found path to return statement? - if ret := b.Return(); ret != nil { - if debugLostCancel { - fmt.Printf("found path to return in block %s\n", b) - } - return ret // found - } - - // Recur - if ret := search(b.Succs); ret != nil { - if debugLostCancel { - fmt.Printf(" from block %s\n", b) - } - return ret - } - } - } - return nil - } - return search(defblock.Succs) -} - -func tupleContains(tuple *types.Tuple, v *types.Var) bool { - for i := 0; i < tuple.Len(); i++ { - if tuple.At(i) == v { - return true - } - } - return false -} - -var noReturnFuncs = map[string]bool{ - "(*testing.common).FailNow": true, - "(*testing.common).Fatal": true, - "(*testing.common).Fatalf": true, - "(*testing.common).Skip": true, - "(*testing.common).SkipNow": true, - "(*testing.common).Skipf": true, - "log.Fatal": true, - "log.Fatalf": true, - "log.Fatalln": true, - "os.Exit": true, - "panic": true, - "runtime.Goexit": true, -} - -// callName returns the canonical name of the builtin, method, or -// function called by call, if known. -func callName(info *types.Info, call *ast.CallExpr) string { - switch fun := call.Fun.(type) { - case *ast.Ident: - // builtin, e.g. "panic" - if obj, ok := info.Uses[fun].(*types.Builtin); ok { - return obj.Name() - } - case *ast.SelectorExpr: - if sel, ok := info.Selections[fun]; ok && sel.Kind() == types.MethodVal { - // method call, e.g. "(*testing.common).Fatal" - meth := sel.Obj() - return fmt.Sprintf("(%s).%s", - meth.Type().(*types.Signature).Recv().Type(), - meth.Name()) - } - if obj, ok := info.Uses[fun.Sel]; ok { - // qualified identifier, e.g. "os.Exit" - return fmt.Sprintf("%s.%s", - obj.Pkg().Path(), - obj.Name()) - } - } - - // function with no name, or defined in missing imported package - return "" -} diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go index 799f0bfb64329..16ce61980f123 100644 --- a/src/cmd/vet/main.go +++ b/src/cmd/vet/main.go @@ -1,783 +1,75 @@ -// Copyright 2010 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. - -// Vet is a simple checker for static errors in Go source code. -// See doc.go for more information. - +// The vet command is a driver for static checkers conforming to +// the golang.org/x/tools/go/analysis API. Run it using 'go vet'. +// +// For a tool capable of running standalone, use a multichecker-based +// tool such as golang.org/x/tools/go/analysis/cmd/vet. package main import ( - "bytes" - "encoding/gob" - "encoding/json" - "flag" - "fmt" - "go/ast" - "go/build" - "go/importer" - "go/parser" - "go/printer" - "go/token" - "go/types" - "io" - "io/ioutil" - "log" - "os" - "path/filepath" - "sort" - "strconv" - "strings" - - "cmd/internal/objabi" -) - -var ( - verbose = flag.Bool("v", false, "verbose") - flags = flag.Bool("flags", false, "print flags in JSON") - source = flag.Bool("source", false, "import from source instead of compiled object files") - tags = flag.String("tags", "", "space-separated list of build tags to apply when parsing") - tagList = []string{} // exploded version of tags flag; set in main - - vcfg vetConfig - mustTypecheck bool -) - -var exitCode = 0 - -// "-all" flag enables all non-experimental checks -var all = triStateFlag("all", unset, "enable all non-experimental checks") - -// Flags to control which individual checks to perform. -var report = map[string]*triState{ - // Only unusual checks are written here. - // Most checks that operate during the AST walk are added by register. - "asmdecl": triStateFlag("asmdecl", unset, "check assembly against Go declarations"), - "buildtags": triStateFlag("buildtags", unset, "check that +build tags are valid"), -} - -// experimental records the flags enabling experimental features. These must be -// requested explicitly; they are not enabled by -all. -var experimental = map[string]bool{} - -// setTrueCount record how many flags are explicitly set to true. -var setTrueCount int - -// dirsRun and filesRun indicate whether the vet is applied to directory or -// file targets. The distinction affects which checks are run. -var dirsRun, filesRun bool - -// includesNonTest indicates whether the vet is applied to non-test targets. -// Certain checks are relevant only if they touch both test and non-test files. -var includesNonTest bool - -// A triState is a boolean that knows whether it has been set to either true or false. -// It is used to identify if a flag appears; the standard boolean flag cannot -// distinguish missing from unset. It also satisfies flag.Value. -type triState int - -const ( - unset triState = iota - setTrue - setFalse + "golang.org/x/tools/go/analysis/unitchecker" + + "golang.org/x/tools/go/analysis/passes/asmdecl" + "golang.org/x/tools/go/analysis/passes/assign" + "golang.org/x/tools/go/analysis/passes/atomic" + "golang.org/x/tools/go/analysis/passes/bools" + "golang.org/x/tools/go/analysis/passes/buildtag" + "golang.org/x/tools/go/analysis/passes/cgocall" + "golang.org/x/tools/go/analysis/passes/composite" + "golang.org/x/tools/go/analysis/passes/copylock" + "golang.org/x/tools/go/analysis/passes/httpresponse" + "golang.org/x/tools/go/analysis/passes/loopclosure" + "golang.org/x/tools/go/analysis/passes/lostcancel" + "golang.org/x/tools/go/analysis/passes/nilfunc" + "golang.org/x/tools/go/analysis/passes/pkgfact" + "golang.org/x/tools/go/analysis/passes/printf" + "golang.org/x/tools/go/analysis/passes/shift" + "golang.org/x/tools/go/analysis/passes/stdmethods" + "golang.org/x/tools/go/analysis/passes/structtag" + "golang.org/x/tools/go/analysis/passes/tests" + "golang.org/x/tools/go/analysis/passes/unmarshal" + "golang.org/x/tools/go/analysis/passes/unreachable" + "golang.org/x/tools/go/analysis/passes/unsafeptr" + "golang.org/x/tools/go/analysis/passes/unusedresult" ) -func triStateFlag(name string, value triState, usage string) *triState { - flag.Var(&value, name, usage) - return &value -} - -// triState implements flag.Value, flag.Getter, and flag.boolFlag. -// They work like boolean flags: we can say vet -printf as well as vet -printf=true -func (ts *triState) Get() interface{} { - return *ts == setTrue -} - -func (ts triState) isTrue() bool { - return ts == setTrue -} - -func (ts *triState) Set(value string) error { - b, err := strconv.ParseBool(value) - if err != nil { - return err - } - if b { - *ts = setTrue - setTrueCount++ - } else { - *ts = setFalse - } - return nil -} - -func (ts *triState) String() string { - switch *ts { - case unset: - return "true" // An unset flag will be set by -all, so defaults to true. - case setTrue: - return "true" - case setFalse: - return "false" - } - panic("not reached") -} - -func (ts triState) IsBoolFlag() bool { - return true -} - -// vet tells whether to report errors for the named check, a flag name. -func vet(name string) bool { - return report[name].isTrue() -} - -// setExit sets the value for os.Exit when it is called, later. It -// remembers the highest value. -func setExit(err int) { - if err > exitCode { - exitCode = err - } -} - -var ( - // Each of these vars has a corresponding case in (*File).Visit. - assignStmt *ast.AssignStmt - binaryExpr *ast.BinaryExpr - callExpr *ast.CallExpr - compositeLit *ast.CompositeLit - exprStmt *ast.ExprStmt - forStmt *ast.ForStmt - funcDecl *ast.FuncDecl - funcLit *ast.FuncLit - genDecl *ast.GenDecl - interfaceType *ast.InterfaceType - rangeStmt *ast.RangeStmt - returnStmt *ast.ReturnStmt - structType *ast.StructType - - // checkers is a two-level map. - // The outer level is keyed by a nil pointer, one of the AST vars above. - // The inner level is keyed by checker name. - checkers = make(map[ast.Node]map[string]func(*File, ast.Node)) - pkgCheckers = make(map[string]func(*Package)) - exporters = make(map[string]func() interface{}) -) - -// The exporters data as written to the vetx output file. -type vetxExport struct { - Name string - Data interface{} -} - -// Vet can provide its own "export information" -// about package A to future invocations of vet -// on packages importing A. If B imports A, -// then running "go vet B" actually invokes vet twice: -// first, it runs vet on A, in "vetx-only" mode, which -// skips most checks and only computes export data -// describing A. Then it runs vet on B, making A's vetx -// data available for consultation. The vet of B -// computes vetx data for B in addition to its -// usual vet checks. - -// register registers the named check function, -// to be called with AST nodes of the given types. -// The registered functions are not called in vetx-only mode. -func register(name, usage string, fn func(*File, ast.Node), types ...ast.Node) { - report[name] = triStateFlag(name, unset, usage) - for _, typ := range types { - m := checkers[typ] - if m == nil { - m = make(map[string]func(*File, ast.Node)) - checkers[typ] = m - } - m[name] = fn - } -} - -// registerPkgCheck registers a package-level checking function, -// to be invoked with the whole package being vetted -// before any of the per-node handlers. -// The registered function fn is called even in vetx-only mode -// (see comment above), so fn must take care not to report -// errors when vcfg.VetxOnly is true. -func registerPkgCheck(name string, fn func(*Package)) { - pkgCheckers[name] = fn -} - -// registerExport registers a function to return vetx export data -// that should be saved and provided to future invocations of vet -// when checking packages importing this one. -// The value returned by fn should be nil or else valid to encode using gob. -// Typically a registerExport call is paired with a call to gob.Register. -func registerExport(name string, fn func() interface{}) { - exporters[name] = fn -} - -// Usage is a replacement usage function for the flags package. -func Usage() { - fmt.Fprintf(os.Stderr, "Usage of vet:\n") - fmt.Fprintf(os.Stderr, "\tvet [flags] directory...\n") - fmt.Fprintf(os.Stderr, "\tvet [flags] files... # Must be a single package\n") - fmt.Fprintf(os.Stderr, "By default, -all is set and all non-experimental checks are run.\n") - fmt.Fprintf(os.Stderr, "For more information run\n") - fmt.Fprintf(os.Stderr, "\tgo doc cmd/vet\n\n") - fmt.Fprintf(os.Stderr, "Flags:\n") - flag.PrintDefaults() - os.Exit(2) -} - -// File is a wrapper for the state of a file used in the parser. -// The parse tree walkers are all methods of this type. -type File struct { - pkg *Package - fset *token.FileSet - name string - content []byte - file *ast.File - b bytes.Buffer // for use by methods - - // Parsed package "foo" when checking package "foo_test" - basePkg *Package - - // The keys are the objects that are receivers of a "String() - // string" method. The value reports whether the method has a - // pointer receiver. - // This is used by the recursiveStringer method in print.go. - stringerPtrs map[*ast.Object]bool - - // Registered checkers to run. - checkers map[ast.Node][]func(*File, ast.Node) - - // Unreachable nodes; can be ignored in shift check. - dead map[ast.Node]bool -} +// Legacy vet had the concept of "experimental" checkers. + +// There was exactly one, shadow, and it had to be explicitly +// enabled by the -shadow flag, which would of course disable +// all the other tristate flags, requiring the -all flag (which +// is now a no-op) to reenable them. +// +// The shadow analyzer has been removed from the suite, +// but can be run using these additional commands: +// $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow +// $ go vet -vettool=$(which shadow) +// Alternatively, one could build a multichecker containing all +// the desired checks (vet's suite + shadow) and run it in a +// single "go vet" command. func main() { - objabi.AddVersionFlag() - flag.Usage = Usage - flag.Parse() - - // -flags: print flags as JSON. Used by go vet. - if *flags { - type jsonFlag struct { - Name string - Bool bool - Usage string - } - var jsonFlags []jsonFlag - flag.VisitAll(func(f *flag.Flag) { - isBool := false - switch v := f.Value.(type) { - case interface{ BoolFlag() bool }: - isBool = v.BoolFlag() - case *triState: - isBool = true // go vet should treat it as boolean - } - jsonFlags = append(jsonFlags, jsonFlag{f.Name, isBool, f.Usage}) - }) - data, err := json.MarshalIndent(jsonFlags, "", "\t") - if err != nil { - log.Fatal(err) - } - os.Stdout.Write(data) - os.Exit(0) - } - - // If any flag is set, we run only those checks requested. - // If all flag is set true or if no flags are set true, set all the non-experimental ones - // not explicitly set (in effect, set the "-all" flag). - if setTrueCount == 0 || *all == setTrue { - for name, setting := range report { - if *setting == unset && !experimental[name] { - *setting = setTrue - } - } - } - - // Accept space-separated tags because that matches - // the go command's other subcommands. - // Accept commas because go tool vet traditionally has. - tagList = strings.Fields(strings.ReplaceAll(*tags, ",", " ")) - - initPrintFlags() - initUnusedFlags() - - if flag.NArg() == 0 { - Usage() - } - - // Special case for "go vet" passing an explicit configuration: - // single argument ending in vet.cfg. - // Once we have a more general mechanism for obtaining this - // information from build tools like the go command, - // vet should be changed to use it. This vet.cfg hack is an - // experiment to learn about what form that information should take. - if flag.NArg() == 1 && strings.HasSuffix(flag.Arg(0), "vet.cfg") { - doPackageCfg(flag.Arg(0)) - os.Exit(exitCode) - } - - for _, name := range flag.Args() { - // Is it a directory? - fi, err := os.Stat(name) - if err != nil { - warnf("error walking tree: %s", err) - continue - } - if fi.IsDir() { - dirsRun = true - } else { - filesRun = true - if !strings.HasSuffix(name, "_test.go") { - includesNonTest = true - } - } - } - if dirsRun && filesRun { - Usage() - } - if dirsRun { - for _, name := range flag.Args() { - walkDir(name) - } - os.Exit(exitCode) - } - if doPackage(flag.Args(), nil) == nil { - warnf("no files checked") - } - os.Exit(exitCode) -} - -// prefixDirectory places the directory name on the beginning of each name in the list. -func prefixDirectory(directory string, names []string) { - if directory != "." { - for i, name := range names { - names[i] = filepath.Join(directory, name) - } - } -} - -// vetConfig is the JSON config struct prepared by the Go command. -type vetConfig struct { - Compiler string - Dir string - ImportPath string - GoFiles []string - NonGoFiles []string - ImportMap map[string]string - PackageFile map[string]string - Standard map[string]bool - PackageVetx map[string]string // map from import path to vetx data file - VetxOnly bool // only compute vetx output; don't run ordinary checks - VetxOutput string // file where vetx output should be written - - SucceedOnTypecheckFailure bool - - imp types.Importer -} - -func (v *vetConfig) Import(path string) (*types.Package, error) { - if v.imp == nil { - v.imp = importer.For(v.Compiler, v.openPackageFile) - } - if path == "unsafe" { - return v.imp.Import("unsafe") - } - p := v.ImportMap[path] - if p == "" { - return nil, fmt.Errorf("unknown import path %q", path) - } - if v.PackageFile[p] == "" { - if v.Compiler == "gccgo" && v.Standard[path] { - // gccgo doesn't have sources for standard library packages, - // but the importer will do the right thing. - return v.imp.Import(path) - } - return nil, fmt.Errorf("unknown package file for import %q", path) - } - return v.imp.Import(p) -} - -func (v *vetConfig) openPackageFile(path string) (io.ReadCloser, error) { - file := v.PackageFile[path] - if file == "" { - if v.Compiler == "gccgo" && v.Standard[path] { - // The importer knows how to handle this. - return nil, nil - } - // Note that path here has been translated via v.ImportMap, - // unlike in the error in Import above. We prefer the error in - // Import, but it's worth diagnosing this one too, just in case. - return nil, fmt.Errorf("unknown package file for %q", path) - } - f, err := os.Open(file) - if err != nil { - return nil, err - } - return f, nil -} - -// doPackageCfg analyzes a single package described in a config file. -func doPackageCfg(cfgFile string) { - js, err := ioutil.ReadFile(cfgFile) - if err != nil { - errorf("%v", err) - } - if err := json.Unmarshal(js, &vcfg); err != nil { - errorf("parsing vet config %s: %v", cfgFile, err) - } - stdImporter = &vcfg - inittypes() - mustTypecheck = true - - var allFiles []string - allFiles = append(allFiles, vcfg.GoFiles...) - allFiles = append(allFiles, vcfg.NonGoFiles...) - - doPackage(allFiles, nil) - if vcfg.VetxOutput != "" { - out := make([]vetxExport, 0, len(exporters)) - for name, fn := range exporters { - out = append(out, vetxExport{ - Name: name, - Data: fn(), - }) - } - // Sort the data so that it is consistent across builds. - sort.Slice(out, func(i, j int) bool { - return out[i].Name < out[j].Name - }) - var buf bytes.Buffer - if err := gob.NewEncoder(&buf).Encode(out); err != nil { - errorf("encoding vet output: %v", err) - return - } - if err := ioutil.WriteFile(vcfg.VetxOutput, buf.Bytes(), 0666); err != nil { - errorf("saving vet output: %v", err) - return - } - } -} - -// doPackageDir analyzes the single package found in the directory, if there is one, -// plus a test package, if there is one. -func doPackageDir(directory string) { - context := build.Default - if len(context.BuildTags) != 0 { - warnf("build tags %s previously set", context.BuildTags) - } - context.BuildTags = append(tagList, context.BuildTags...) - - pkg, err := context.ImportDir(directory, 0) - if err != nil { - // If it's just that there are no go source files, that's fine. - if _, nogo := err.(*build.NoGoError); nogo { - return - } - // Non-fatal: we are doing a recursive walk and there may be other directories. - warnf("cannot process directory %s: %s", directory, err) - return - } - var names []string - names = append(names, pkg.GoFiles...) - names = append(names, pkg.CgoFiles...) - names = append(names, pkg.TestGoFiles...) // These are also in the "foo" package. - names = append(names, pkg.SFiles...) - prefixDirectory(directory, names) - basePkg := doPackage(names, nil) - // Is there also a "foo_test" package? If so, do that one as well. - if len(pkg.XTestGoFiles) > 0 { - names = pkg.XTestGoFiles - prefixDirectory(directory, names) - doPackage(names, basePkg) - } -} - -type Package struct { - path string - defs map[*ast.Ident]types.Object - uses map[*ast.Ident]types.Object - implicits map[ast.Node]types.Object - selectors map[*ast.SelectorExpr]*types.Selection - types map[ast.Expr]types.TypeAndValue - spans map[types.Object]Span - files []*File - typesPkg *types.Package -} - -// doPackage analyzes the single package constructed from the named files. -// It returns the parsed Package or nil if none of the files have been checked. -func doPackage(names []string, basePkg *Package) *Package { - var files []*File - var astFiles []*ast.File - fs := token.NewFileSet() - for _, name := range names { - data, err := ioutil.ReadFile(name) - if err != nil { - // Warn but continue to next package. - warnf("%s: %s", name, err) - return nil - } - var parsedFile *ast.File - if strings.HasSuffix(name, ".go") { - parsedFile, err = parser.ParseFile(fs, name, data, parser.ParseComments) - if err != nil { - warnf("%s: %s", name, err) - return nil - } - astFiles = append(astFiles, parsedFile) - } - file := &File{ - fset: fs, - content: data, - name: name, - file: parsedFile, - dead: make(map[ast.Node]bool), - } - files = append(files, file) - } - if len(astFiles) == 0 { - return nil - } - pkg := new(Package) - pkg.path = astFiles[0].Name.Name - pkg.files = files - // Type check the package. - errs := pkg.check(fs, astFiles) - if errs != nil { - if vcfg.SucceedOnTypecheckFailure { - os.Exit(0) - } - if *verbose || mustTypecheck { - for _, err := range errs { - fmt.Fprintf(os.Stderr, "%v\n", err) - } - if mustTypecheck { - // This message could be silenced, and we could just exit, - // but it might be helpful at least at first to make clear that the - // above errors are coming from vet and not the compiler - // (they often look like compiler errors, such as "declared but not used"). - errorf("typecheck failures") - } - } - } - - // Check. - for _, file := range files { - file.pkg = pkg - file.basePkg = basePkg - } - for name, fn := range pkgCheckers { - if vet(name) { - fn(pkg) - } - } - if vcfg.VetxOnly { - return pkg - } - - chk := make(map[ast.Node][]func(*File, ast.Node)) - for typ, set := range checkers { - for name, fn := range set { - if vet(name) { - chk[typ] = append(chk[typ], fn) - } - } - } - for _, file := range files { - checkBuildTag(file) - file.checkers = chk - if file.file != nil { - file.walkFile(file.name, file.file) - } - } - return pkg -} - -func visit(path string, f os.FileInfo, err error) error { - if err != nil { - warnf("walk error: %s", err) - return err - } - // One package per directory. Ignore the files themselves. - if !f.IsDir() { - return nil - } - doPackageDir(path) - return nil -} - -func (pkg *Package) hasFileWithSuffix(suffix string) bool { - for _, f := range pkg.files { - if strings.HasSuffix(f.name, suffix) { - return true - } - } - return false -} - -// walkDir recursively walks the tree looking for Go packages. -func walkDir(root string) { - filepath.Walk(root, visit) -} - -// errorf formats the error to standard error, adding program -// identification and a newline, and exits. -func errorf(format string, args ...interface{}) { - fmt.Fprintf(os.Stderr, "vet: "+format+"\n", args...) - os.Exit(2) -} - -// warnf formats the error to standard error, adding program -// identification and a newline, but does not exit. -func warnf(format string, args ...interface{}) { - fmt.Fprintf(os.Stderr, "vet: "+format+"\n", args...) - setExit(1) -} - -// Println is fmt.Println guarded by -v. -func Println(args ...interface{}) { - if !*verbose { - return - } - fmt.Println(args...) -} - -// Printf is fmt.Printf guarded by -v. -func Printf(format string, args ...interface{}) { - if !*verbose { - return - } - fmt.Printf(format+"\n", args...) -} - -// Bad reports an error and sets the exit code.. -func (f *File) Bad(pos token.Pos, args ...interface{}) { - f.Warn(pos, args...) - setExit(1) -} - -// Badf reports a formatted error and sets the exit code. -func (f *File) Badf(pos token.Pos, format string, args ...interface{}) { - f.Warnf(pos, format, args...) - setExit(1) -} - -// loc returns a formatted representation of the position. -func (f *File) loc(pos token.Pos) string { - if pos == token.NoPos { - return "" - } - // Do not print columns. Because the pos often points to the start of an - // expression instead of the inner part with the actual error, the - // precision can mislead. - posn := f.fset.Position(pos) - return fmt.Sprintf("%s:%d", posn.Filename, posn.Line) -} - -// locPrefix returns a formatted representation of the position for use as a line prefix. -func (f *File) locPrefix(pos token.Pos) string { - if pos == token.NoPos { - return "" - } - return fmt.Sprintf("%s: ", f.loc(pos)) -} - -// Warn reports an error but does not set the exit code. -func (f *File) Warn(pos token.Pos, args ...interface{}) { - fmt.Fprintf(os.Stderr, "%s%s", f.locPrefix(pos), fmt.Sprintln(args...)) -} - -// Warnf reports a formatted error but does not set the exit code. -func (f *File) Warnf(pos token.Pos, format string, args ...interface{}) { - fmt.Fprintf(os.Stderr, "%s%s\n", f.locPrefix(pos), fmt.Sprintf(format, args...)) -} - -// walkFile walks the file's tree. -func (f *File) walkFile(name string, file *ast.File) { - Println("Checking file", name) - ast.Walk(f, file) -} - -// Visit implements the ast.Visitor interface. -func (f *File) Visit(node ast.Node) ast.Visitor { - f.updateDead(node) - var key ast.Node - switch node.(type) { - case *ast.AssignStmt: - key = assignStmt - case *ast.BinaryExpr: - key = binaryExpr - case *ast.CallExpr: - key = callExpr - case *ast.CompositeLit: - key = compositeLit - case *ast.ExprStmt: - key = exprStmt - case *ast.ForStmt: - key = forStmt - case *ast.FuncDecl: - key = funcDecl - case *ast.FuncLit: - key = funcLit - case *ast.GenDecl: - key = genDecl - case *ast.InterfaceType: - key = interfaceType - case *ast.RangeStmt: - key = rangeStmt - case *ast.ReturnStmt: - key = returnStmt - case *ast.StructType: - key = structType - } - for _, fn := range f.checkers[key] { - fn(f, node) - } - return f -} - -// gofmt returns a string representation of the expression. -func (f *File) gofmt(x ast.Expr) string { - f.b.Reset() - printer.Fprint(&f.b, f.fset, x) - return f.b.String() -} - -// imported[path][key] is previously written export data. -var imported = make(map[string]map[string]interface{}) - -// readVetx reads export data written by a previous -// invocation of vet on an imported package (path). -// The key is the name passed to registerExport -// when the data was originally generated. -// readVetx returns nil if the data is unavailable. -func readVetx(path, key string) interface{} { - if path == "unsafe" || vcfg.ImportPath == "" { - return nil - } - m := imported[path] - if m == nil { - file := vcfg.PackageVetx[path] - if file == "" { - return nil - } - data, err := ioutil.ReadFile(file) - if err != nil { - return nil - } - var out []vetxExport - err = gob.NewDecoder(bytes.NewReader(data)).Decode(&out) - if err != nil { - return nil - } - m = make(map[string]interface{}) - for _, x := range out { - m[x.Name] = x.Data - } - imported[path] = m - } - return m[key] + unitchecker.Main( + asmdecl.Analyzer, + assign.Analyzer, + atomic.Analyzer, + bools.Analyzer, + buildtag.Analyzer, + cgocall.Analyzer, + composite.Analyzer, + copylock.Analyzer, + httpresponse.Analyzer, + loopclosure.Analyzer, + lostcancel.Analyzer, + nilfunc.Analyzer, + pkgfact.Analyzer, + printf.Analyzer, + shift.Analyzer, + stdmethods.Analyzer, + structtag.Analyzer, + tests.Analyzer, + unmarshal.Analyzer, + unreachable.Analyzer, + unsafeptr.Analyzer, + unusedresult.Analyzer, + ) } diff --git a/src/cmd/vet/method.go b/src/cmd/vet/method.go deleted file mode 100644 index 8b404e069782a..0000000000000 --- a/src/cmd/vet/method.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2010 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. - -// This file contains the code to check canonical methods. - -package main - -import ( - "go/ast" - "go/types" - "strings" -) - -func init() { - register("methods", - "check that canonically named methods are canonically defined", - checkCanonicalMethod, - funcDecl, interfaceType) -} - -type MethodSig struct { - args []string - results []string -} - -// canonicalMethods lists the input and output types for Go methods -// that are checked using dynamic interface checks. Because the -// checks are dynamic, such methods would not cause a compile error -// if they have the wrong signature: instead the dynamic check would -// fail, sometimes mysteriously. If a method is found with a name listed -// here but not the input/output types listed here, vet complains. -// -// A few of the canonical methods have very common names. -// For example, a type might implement a Scan method that -// has nothing to do with fmt.Scanner, but we still want to check -// the methods that are intended to implement fmt.Scanner. -// To do that, the arguments that have a = prefix are treated as -// signals that the canonical meaning is intended: if a Scan -// method doesn't have a fmt.ScanState as its first argument, -// we let it go. But if it does have a fmt.ScanState, then the -// rest has to match. -var canonicalMethods = map[string]MethodSig{ - // "Flush": {{}, {"error"}}, // http.Flusher and jpeg.writer conflict - "Format": {[]string{"=fmt.State", "rune"}, []string{}}, // fmt.Formatter - "GobDecode": {[]string{"[]byte"}, []string{"error"}}, // gob.GobDecoder - "GobEncode": {[]string{}, []string{"[]byte", "error"}}, // gob.GobEncoder - "MarshalJSON": {[]string{}, []string{"[]byte", "error"}}, // json.Marshaler - "MarshalXML": {[]string{"*xml.Encoder", "xml.StartElement"}, []string{"error"}}, // xml.Marshaler - "ReadByte": {[]string{}, []string{"byte", "error"}}, // io.ByteReader - "ReadFrom": {[]string{"=io.Reader"}, []string{"int64", "error"}}, // io.ReaderFrom - "ReadRune": {[]string{}, []string{"rune", "int", "error"}}, // io.RuneReader - "Scan": {[]string{"=fmt.ScanState", "rune"}, []string{"error"}}, // fmt.Scanner - "Seek": {[]string{"=int64", "int"}, []string{"int64", "error"}}, // io.Seeker - "UnmarshalJSON": {[]string{"[]byte"}, []string{"error"}}, // json.Unmarshaler - "UnmarshalXML": {[]string{"*xml.Decoder", "xml.StartElement"}, []string{"error"}}, // xml.Unmarshaler - "UnreadByte": {[]string{}, []string{"error"}}, - "UnreadRune": {[]string{}, []string{"error"}}, - "WriteByte": {[]string{"byte"}, []string{"error"}}, // jpeg.writer (matching bufio.Writer) - "WriteTo": {[]string{"=io.Writer"}, []string{"int64", "error"}}, // io.WriterTo -} - -func checkCanonicalMethod(f *File, node ast.Node) { - switch n := node.(type) { - case *ast.FuncDecl: - if n.Recv != nil { - canonicalMethod(f, n.Name) - } - case *ast.InterfaceType: - for _, field := range n.Methods.List { - for _, id := range field.Names { - canonicalMethod(f, id) - } - } - } -} - -func canonicalMethod(f *File, id *ast.Ident) { - // Expected input/output. - expect, ok := canonicalMethods[id.Name] - if !ok { - return - } - sign := f.pkg.defs[id].Type().(*types.Signature) - args := sign.Params() - results := sign.Results() - - // Do the =s (if any) all match? - if !f.matchParams(expect.args, args, "=") || !f.matchParams(expect.results, results, "=") { - return - } - - // Everything must match. - if !f.matchParams(expect.args, args, "") || !f.matchParams(expect.results, results, "") { - expectFmt := id.Name + "(" + argjoin(expect.args) + ")" - if len(expect.results) == 1 { - expectFmt += " " + argjoin(expect.results) - } else if len(expect.results) > 1 { - expectFmt += " (" + argjoin(expect.results) + ")" - } - - actual := sign.String() - actual = strings.TrimPrefix(actual, "func") - actual = id.Name + actual - - f.Badf(id.Pos(), "method %s should have signature %s", actual, expectFmt) - } -} - -func argjoin(x []string) string { - y := make([]string, len(x)) - for i, s := range x { - if s[0] == '=' { - s = s[1:] - } - y[i] = s - } - return strings.Join(y, ", ") -} - -// Does each type in expect with the given prefix match the corresponding type in actual? -func (f *File) matchParams(expect []string, actual *types.Tuple, prefix string) bool { - for i, x := range expect { - if !strings.HasPrefix(x, prefix) { - continue - } - if i >= actual.Len() { - return false - } - if !f.matchParamType(x, actual.At(i).Type()) { - return false - } - } - if prefix == "" && actual.Len() > len(expect) { - return false - } - return true -} - -// Does this one type match? -func (f *File) matchParamType(expect string, actual types.Type) bool { - expect = strings.TrimPrefix(expect, "=") - // Strip package name if we're in that package. - if n := len(f.file.Name.Name); len(expect) > n && expect[:n] == f.file.Name.Name && expect[n] == '.' { - expect = expect[n+1:] - } - - // Overkill but easy. - return actual.String() == expect -} diff --git a/src/cmd/vet/nilfunc.go b/src/cmd/vet/nilfunc.go deleted file mode 100644 index bfe05e3353da9..0000000000000 --- a/src/cmd/vet/nilfunc.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 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. - -/* -This file contains the code to check for useless function comparisons. -A useless comparison is one like f == nil as opposed to f() == nil. -*/ - -package main - -import ( - "go/ast" - "go/token" - "go/types" -) - -func init() { - register("nilfunc", - "check for comparisons between functions and nil", - checkNilFuncComparison, - binaryExpr) -} - -func checkNilFuncComparison(f *File, node ast.Node) { - e := node.(*ast.BinaryExpr) - - // Only want == or != comparisons. - if e.Op != token.EQL && e.Op != token.NEQ { - return - } - - // Only want comparisons with a nil identifier on one side. - var e2 ast.Expr - switch { - case f.isNil(e.X): - e2 = e.Y - case f.isNil(e.Y): - e2 = e.X - default: - return - } - - // Only want identifiers or selector expressions. - var obj types.Object - switch v := e2.(type) { - case *ast.Ident: - obj = f.pkg.uses[v] - case *ast.SelectorExpr: - obj = f.pkg.uses[v.Sel] - default: - return - } - - // Only want functions. - if _, ok := obj.(*types.Func); !ok { - return - } - - f.Badf(e.Pos(), "comparison of function %v %v nil is always %v", obj.Name(), e.Op, e.Op == token.NEQ) -} - -// isNil reports whether the provided expression is the built-in nil -// identifier. -func (f *File) isNil(e ast.Expr) bool { - return f.pkg.types[e].Type == types.Typ[types.UntypedNil] -} diff --git a/src/cmd/vet/print.go b/src/cmd/vet/print.go deleted file mode 100644 index 3a2eea0beba55..0000000000000 --- a/src/cmd/vet/print.go +++ /dev/null @@ -1,1070 +0,0 @@ -// Copyright 2010 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. - -// This file contains the printf-checker. - -package main - -import ( - "bytes" - "encoding/gob" - "flag" - "fmt" - "go/ast" - "go/constant" - "go/token" - "go/types" - "regexp" - "sort" - "strconv" - "strings" - "unicode/utf8" -) - -var printfuncs = flag.String("printfuncs", "", "comma-separated list of print function names to check") - -func init() { - register("printf", - "check printf-like invocations", - checkFmtPrintfCall, - funcDecl, callExpr) - registerPkgCheck("printf", findPrintfLike) - registerExport("printf", exportPrintfLike) - gob.Register([]printfExport(nil)) -} - -func initPrintFlags() { - if *printfuncs == "" { - return - } - for _, name := range strings.Split(*printfuncs, ",") { - if len(name) == 0 { - flag.Usage() - } - - // Backwards compatibility: skip optional first argument - // index after the colon. - if colon := strings.LastIndex(name, ":"); colon > 0 { - name = name[:colon] - } - - if !strings.Contains(name, ".") { - name = strings.ToLower(name) - } - isPrint[name] = true - } -} - -var localPrintfLike = make(map[string]int) - -type printfExport struct { - Name string - Kind int -} - -// printfImported maps from package name to the printf vet data -// exported by that package. -var printfImported = make(map[string]map[string]int) - -type printfWrapper struct { - name string - fn *ast.FuncDecl - format *ast.Field - args *ast.Field - callers []printfCaller - failed bool // if true, not a printf wrapper -} - -type printfCaller struct { - w *printfWrapper - call *ast.CallExpr -} - -// maybePrintfWrapper decides whether decl (a declared function) may be a wrapper -// around a fmt.Printf or fmt.Print function. If so it returns a printfWrapper -// function describing the declaration. Later processing will analyze the -// graph of potential printf wrappers to pick out the ones that are true wrappers. -// A function may be a Printf or Print wrapper if its last argument is ...interface{}. -// If the next-to-last argument is a string, then this may be a Printf wrapper. -// Otherwise it may be a Print wrapper. -func maybePrintfWrapper(decl ast.Decl) *printfWrapper { - // Look for functions with final argument type ...interface{}. - fn, ok := decl.(*ast.FuncDecl) - if !ok || fn.Body == nil { - return nil - } - name := fn.Name.Name - if fn.Recv != nil { - // For (*T).Name or T.name, use "T.name". - rcvr := fn.Recv.List[0].Type - if ptr, ok := rcvr.(*ast.StarExpr); ok { - rcvr = ptr.X - } - id, ok := rcvr.(*ast.Ident) - if !ok { - return nil - } - name = id.Name + "." + name - } - params := fn.Type.Params.List - if len(params) == 0 { - return nil - } - args := params[len(params)-1] - if len(args.Names) != 1 { - return nil - } - ddd, ok := args.Type.(*ast.Ellipsis) - if !ok { - return nil - } - iface, ok := ddd.Elt.(*ast.InterfaceType) - if !ok || len(iface.Methods.List) > 0 { - return nil - } - var format *ast.Field - if len(params) >= 2 { - p := params[len(params)-2] - if len(p.Names) == 1 { - if id, ok := p.Type.(*ast.Ident); ok && id.Name == "string" { - format = p - } - } - } - - return &printfWrapper{ - name: name, - fn: fn, - format: format, - args: args, - } -} - -// findPrintfLike scans the entire package to find printf-like functions. -func findPrintfLike(pkg *Package) { - if vcfg.ImportPath == "" { // no type or vetx information; don't bother - return - } - - // Gather potential wrappesr and call graph between them. - byName := make(map[string]*printfWrapper) - var wrappers []*printfWrapper - for _, file := range pkg.files { - if file.file == nil { - continue - } - for _, decl := range file.file.Decls { - w := maybePrintfWrapper(decl) - if w == nil { - continue - } - byName[w.name] = w - wrappers = append(wrappers, w) - } - } - - // Walk the graph to figure out which are really printf wrappers. - for _, w := range wrappers { - // Scan function for calls that could be to other printf-like functions. - ast.Inspect(w.fn.Body, func(n ast.Node) bool { - if w.failed { - return false - } - - // TODO: Relax these checks; issue 26555. - if assign, ok := n.(*ast.AssignStmt); ok { - for _, lhs := range assign.Lhs { - if match(lhs, w.format) || match(lhs, w.args) { - // Modifies the format - // string or args in - // some way, so not a - // simple wrapper. - w.failed = true - return false - } - } - } - if un, ok := n.(*ast.UnaryExpr); ok && un.Op == token.AND { - if match(un.X, w.format) || match(un.X, w.args) { - // Taking the address of the - // format string or args, - // so not a simple wrapper. - w.failed = true - return false - } - } - - call, ok := n.(*ast.CallExpr) - if !ok || len(call.Args) == 0 || !match(call.Args[len(call.Args)-1], w.args) { - return true - } - - pkgpath, name, kind := printfNameAndKind(pkg, call.Fun) - if kind != 0 { - checkPrintfFwd(pkg, w, call, kind) - return true - } - - // If the call is to another function in this package, - // maybe we will find out it is printf-like later. - // Remember this call for later checking. - if pkgpath == "" && byName[name] != nil { - callee := byName[name] - callee.callers = append(callee.callers, printfCaller{w, call}) - } - - return true - }) - } -} - -func match(arg ast.Expr, param *ast.Field) bool { - id, ok := arg.(*ast.Ident) - return ok && id.Obj != nil && id.Obj.Decl == param -} - -const ( - kindPrintf = 1 - kindPrint = 2 -) - -// printfLike reports whether a call to fn should be considered a call to a printf-like function. -// It returns 0 (indicating not a printf-like function), kindPrintf, or kindPrint. -func printfLike(pkg *Package, fn ast.Expr, byName map[string]*printfWrapper) int { - if id, ok := fn.(*ast.Ident); ok && id.Obj != nil { - if w := byName[id.Name]; w != nil && id.Obj.Decl == w.fn { - // Found call to function in same package. - return localPrintfLike[id.Name] - } - } - if sel, ok := fn.(*ast.SelectorExpr); ok { - if id, ok := sel.X.(*ast.Ident); ok && id.Name == "fmt" && strings.Contains(sel.Sel.Name, "rint") { - if strings.HasSuffix(sel.Sel.Name, "f") { - return kindPrintf - } - return kindPrint - } - } - return 0 -} - -// checkPrintfFwd checks that a printf-forwarding wrapper is forwarding correctly. -// It diagnoses writing fmt.Printf(format, args) instead of fmt.Printf(format, args...). -func checkPrintfFwd(pkg *Package, w *printfWrapper, call *ast.CallExpr, kind int) { - matched := kind == kindPrint || - kind == kindPrintf && len(call.Args) >= 2 && match(call.Args[len(call.Args)-2], w.format) - if !matched { - return - } - - if !call.Ellipsis.IsValid() { - typ, ok := pkg.types[call.Fun].Type.(*types.Signature) - if !ok { - return - } - if len(call.Args) > typ.Params().Len() { - // If we're passing more arguments than what the - // print/printf function can take, adding an ellipsis - // would break the program. For example: - // - // func foo(arg1 string, arg2 ...interface{} { - // fmt.Printf("%s %v", arg1, arg2) - // } - return - } - if !vcfg.VetxOnly { - desc := "printf" - if kind == kindPrint { - desc = "print" - } - pkg.files[0].Badf(call.Pos(), "missing ... in args forwarded to %s-like function", desc) - } - return - } - name := w.name - if localPrintfLike[name] == 0 { - localPrintfLike[name] = kind - for _, caller := range w.callers { - checkPrintfFwd(pkg, caller.w, caller.call, kind) - } - } -} - -func exportPrintfLike() interface{} { - out := make([]printfExport, 0, len(localPrintfLike)) - for name, kind := range localPrintfLike { - out = append(out, printfExport{ - Name: name, - Kind: kind, - }) - } - sort.Slice(out, func(i, j int) bool { - return out[i].Name < out[j].Name - }) - return out -} - -// isPrint records the print functions. -// If a key ends in 'f' then it is assumed to be a formatted print. -var isPrint = map[string]bool{ - "fmt.Errorf": true, - "fmt.Fprint": true, - "fmt.Fprintf": true, - "fmt.Fprintln": true, - "fmt.Print": true, - "fmt.Printf": true, - "fmt.Println": true, - "fmt.Sprint": true, - "fmt.Sprintf": true, - "fmt.Sprintln": true, - - // testing.B, testing.T not auto-detected - // because the methods are picked up by embedding. - "testing.B.Error": true, - "testing.B.Errorf": true, - "testing.B.Fatal": true, - "testing.B.Fatalf": true, - "testing.B.Log": true, - "testing.B.Logf": true, - "testing.B.Skip": true, - "testing.B.Skipf": true, - "testing.T.Error": true, - "testing.T.Errorf": true, - "testing.T.Fatal": true, - "testing.T.Fatalf": true, - "testing.T.Log": true, - "testing.T.Logf": true, - "testing.T.Skip": true, - "testing.T.Skipf": true, - - // testing.TB is an interface, so can't detect wrapping. - "testing.TB.Error": true, - "testing.TB.Errorf": true, - "testing.TB.Fatal": true, - "testing.TB.Fatalf": true, - "testing.TB.Log": true, - "testing.TB.Logf": true, - "testing.TB.Skip": true, - "testing.TB.Skipf": true, -} - -// formatString returns the format string argument and its index within -// the given printf-like call expression. -// -// The last parameter before variadic arguments is assumed to be -// a format string. -// -// The first string literal or string constant is assumed to be a format string -// if the call's signature cannot be determined. -// -// If it cannot find any format string parameter, it returns ("", -1). -func formatString(f *File, call *ast.CallExpr) (format string, idx int) { - typ := f.pkg.types[call.Fun].Type - if typ != nil { - if sig, ok := typ.(*types.Signature); ok { - if !sig.Variadic() { - // Skip checking non-variadic functions. - return "", -1 - } - idx := sig.Params().Len() - 2 - if idx < 0 { - // Skip checking variadic functions without - // fixed arguments. - return "", -1 - } - s, ok := stringConstantArg(f, call, idx) - if !ok { - // The last argument before variadic args isn't a string. - return "", -1 - } - return s, idx - } - } - - // Cannot determine call's signature. Fall back to scanning for the first - // string constant in the call. - for idx := range call.Args { - if s, ok := stringConstantArg(f, call, idx); ok { - return s, idx - } - if f.pkg.types[call.Args[idx]].Type == types.Typ[types.String] { - // Skip checking a call with a non-constant format - // string argument, since its contents are unavailable - // for validation. - return "", -1 - } - } - return "", -1 -} - -// stringConstantArg returns call's string constant argument at the index idx. -// -// ("", false) is returned if call's argument at the index idx isn't a string -// constant. -func stringConstantArg(f *File, call *ast.CallExpr, idx int) (string, bool) { - if idx >= len(call.Args) { - return "", false - } - arg := call.Args[idx] - lit := f.pkg.types[arg].Value - if lit != nil && lit.Kind() == constant.String { - return constant.StringVal(lit), true - } - return "", false -} - -// checkCall triggers the print-specific checks if the call invokes a print function. -func checkFmtPrintfCall(f *File, node ast.Node) { - if f.pkg.typesPkg == nil { - // This check now requires type information. - return - } - - if d, ok := node.(*ast.FuncDecl); ok && isStringer(f, d) { - // Remember we saw this. - if f.stringerPtrs == nil { - f.stringerPtrs = make(map[*ast.Object]bool) - } - if l := d.Recv.List; len(l) == 1 { - if n := l[0].Names; len(n) == 1 { - typ := f.pkg.types[l[0].Type] - _, ptrRecv := typ.Type.(*types.Pointer) - f.stringerPtrs[n[0].Obj] = ptrRecv - } - } - return - } - - call, ok := node.(*ast.CallExpr) - if !ok { - return - } - - // Construct name like pkg.Printf or pkg.Type.Printf for lookup. - _, name, kind := printfNameAndKind(f.pkg, call.Fun) - if kind == kindPrintf { - f.checkPrintf(call, name) - } - if kind == kindPrint { - f.checkPrint(call, name) - } -} - -func printfName(pkg *Package, called ast.Expr) (pkgpath, name string) { - switch x := called.(type) { - case *ast.Ident: - if fn, ok := pkg.uses[x].(*types.Func); ok { - if fn.Pkg() == nil || fn.Pkg() == pkg.typesPkg { - pkgpath = "" - } else { - pkgpath = fn.Pkg().Path() - } - return pkgpath, x.Name - } - - case *ast.SelectorExpr: - // Check for "fmt.Printf". - if id, ok := x.X.(*ast.Ident); ok { - if pkgName, ok := pkg.uses[id].(*types.PkgName); ok { - return pkgName.Imported().Path(), x.Sel.Name - } - } - - // Check for t.Logf where t is a *testing.T. - if sel := pkg.selectors[x]; sel != nil { - recv := sel.Recv() - if p, ok := recv.(*types.Pointer); ok { - recv = p.Elem() - } - if named, ok := recv.(*types.Named); ok { - obj := named.Obj() - if obj.Pkg() == nil || obj.Pkg() == pkg.typesPkg { - pkgpath = "" - } else { - pkgpath = obj.Pkg().Path() - } - return pkgpath, obj.Name() + "." + x.Sel.Name - } - } - } - return "", "" -} - -func printfNameAndKind(pkg *Package, called ast.Expr) (pkgpath, name string, kind int) { - pkgpath, name = printfName(pkg, called) - if name == "" { - return pkgpath, name, 0 - } - - if pkgpath == "" { - kind = localPrintfLike[name] - } else if m, ok := printfImported[pkgpath]; ok { - kind = m[name] - } else { - var m map[string]int - if out, ok := readVetx(pkgpath, "printf").([]printfExport); ok { - m = make(map[string]int) - for _, x := range out { - m[x.Name] = x.Kind - } - } - printfImported[pkgpath] = m - kind = m[name] - } - - if kind == 0 { - _, ok := isPrint[pkgpath+"."+name] - if !ok { - // Next look up just "printf", for use with -printfuncs. - short := name[strings.LastIndex(name, ".")+1:] - _, ok = isPrint[strings.ToLower(short)] - } - if ok { - if strings.HasSuffix(name, "f") { - kind = kindPrintf - } else { - kind = kindPrint - } - } - } - return pkgpath, name, kind -} - -// isStringer reports whether the provided declaration is a "String() string" -// method, an implementation of fmt.Stringer. -func isStringer(f *File, d *ast.FuncDecl) bool { - return d.Recv != nil && d.Name.Name == "String" && d.Type.Results != nil && - len(d.Type.Params.List) == 0 && len(d.Type.Results.List) == 1 && - f.pkg.types[d.Type.Results.List[0].Type].Type == types.Typ[types.String] -} - -// isFormatter reports whether t satisfies fmt.Formatter. -// Unlike fmt.Stringer, it's impossible to satisfy fmt.Formatter without importing fmt. -func (f *File) isFormatter(t types.Type) bool { - return formatterType != nil && types.Implements(t, formatterType) -} - -// formatState holds the parsed representation of a printf directive such as "%3.*[4]d". -// It is constructed by parsePrintfVerb. -type formatState struct { - verb rune // the format verb: 'd' for "%d" - format string // the full format directive from % through verb, "%.3d". - name string // Printf, Sprintf etc. - flags []byte // the list of # + etc. - argNums []int // the successive argument numbers that are consumed, adjusted to refer to actual arg in call - firstArg int // Index of first argument after the format in the Printf call. - // Used only during parse. - file *File - call *ast.CallExpr - argNum int // Which argument we're expecting to format now. - hasIndex bool // Whether the argument is indexed. - indexPending bool // Whether we have an indexed argument that has not resolved. - nbytes int // number of bytes of the format string consumed. -} - -// checkPrintf checks a call to a formatted print routine such as Printf. -func (f *File) checkPrintf(call *ast.CallExpr, name string) { - format, idx := formatString(f, call) - if idx < 0 { - if *verbose { - f.Warn(call.Pos(), "can't check non-constant format in call to", name) - } - return - } - - firstArg := idx + 1 // Arguments are immediately after format string. - if !strings.Contains(format, "%") { - if len(call.Args) > firstArg { - f.Badf(call.Pos(), "%s call has arguments but no formatting directives", name) - } - return - } - // Hard part: check formats against args. - argNum := firstArg - maxArgNum := firstArg - anyIndex := false - for i, w := 0, 0; i < len(format); i += w { - w = 1 - if format[i] != '%' { - continue - } - state := f.parsePrintfVerb(call, name, format[i:], firstArg, argNum) - if state == nil { - return - } - w = len(state.format) - if !f.okPrintfArg(call, state) { // One error per format is enough. - return - } - if state.hasIndex { - anyIndex = true - } - if len(state.argNums) > 0 { - // Continue with the next sequential argument. - argNum = state.argNums[len(state.argNums)-1] + 1 - } - for _, n := range state.argNums { - if n >= maxArgNum { - maxArgNum = n + 1 - } - } - } - // Dotdotdot is hard. - if call.Ellipsis.IsValid() && maxArgNum >= len(call.Args)-1 { - return - } - // If any formats are indexed, extra arguments are ignored. - if anyIndex { - return - } - // There should be no leftover arguments. - if maxArgNum != len(call.Args) { - expect := maxArgNum - firstArg - numArgs := len(call.Args) - firstArg - f.Badf(call.Pos(), "%s call needs %v but has %v", name, count(expect, "arg"), count(numArgs, "arg")) - } -} - -// parseFlags accepts any printf flags. -func (s *formatState) parseFlags() { - for s.nbytes < len(s.format) { - switch c := s.format[s.nbytes]; c { - case '#', '0', '+', '-', ' ': - s.flags = append(s.flags, c) - s.nbytes++ - default: - return - } - } -} - -// scanNum advances through a decimal number if present. -func (s *formatState) scanNum() { - for ; s.nbytes < len(s.format); s.nbytes++ { - c := s.format[s.nbytes] - if c < '0' || '9' < c { - return - } - } -} - -// parseIndex scans an index expression. It returns false if there is a syntax error. -func (s *formatState) parseIndex() bool { - if s.nbytes == len(s.format) || s.format[s.nbytes] != '[' { - return true - } - // Argument index present. - s.nbytes++ // skip '[' - start := s.nbytes - s.scanNum() - ok := true - if s.nbytes == len(s.format) || s.nbytes == start || s.format[s.nbytes] != ']' { - ok = false - s.nbytes = strings.Index(s.format, "]") - if s.nbytes < 0 { - s.file.Badf(s.call.Pos(), "%s format %s is missing closing ]", s.name, s.format) - return false - } - } - arg32, err := strconv.ParseInt(s.format[start:s.nbytes], 10, 32) - if err != nil || !ok || arg32 <= 0 || arg32 > int64(len(s.call.Args)-s.firstArg) { - s.file.Badf(s.call.Pos(), "%s format has invalid argument index [%s]", s.name, s.format[start:s.nbytes]) - return false - } - s.nbytes++ // skip ']' - arg := int(arg32) - arg += s.firstArg - 1 // We want to zero-index the actual arguments. - s.argNum = arg - s.hasIndex = true - s.indexPending = true - return true -} - -// parseNum scans a width or precision (or *). It returns false if there's a bad index expression. -func (s *formatState) parseNum() bool { - if s.nbytes < len(s.format) && s.format[s.nbytes] == '*' { - if s.indexPending { // Absorb it. - s.indexPending = false - } - s.nbytes++ - s.argNums = append(s.argNums, s.argNum) - s.argNum++ - } else { - s.scanNum() - } - return true -} - -// parsePrecision scans for a precision. It returns false if there's a bad index expression. -func (s *formatState) parsePrecision() bool { - // If there's a period, there may be a precision. - if s.nbytes < len(s.format) && s.format[s.nbytes] == '.' { - s.flags = append(s.flags, '.') // Treat precision as a flag. - s.nbytes++ - if !s.parseIndex() { - return false - } - if !s.parseNum() { - return false - } - } - return true -} - -// parsePrintfVerb looks the formatting directive that begins the format string -// and returns a formatState that encodes what the directive wants, without looking -// at the actual arguments present in the call. The result is nil if there is an error. -func (f *File) parsePrintfVerb(call *ast.CallExpr, name, format string, firstArg, argNum int) *formatState { - state := &formatState{ - format: format, - name: name, - flags: make([]byte, 0, 5), - argNum: argNum, - argNums: make([]int, 0, 1), - nbytes: 1, // There's guaranteed to be a percent sign. - firstArg: firstArg, - file: f, - call: call, - } - // There may be flags. - state.parseFlags() - // There may be an index. - if !state.parseIndex() { - return nil - } - // There may be a width. - if !state.parseNum() { - return nil - } - // There may be a precision. - if !state.parsePrecision() { - return nil - } - // Now a verb, possibly prefixed by an index (which we may already have). - if !state.indexPending && !state.parseIndex() { - return nil - } - if state.nbytes == len(state.format) { - f.Badf(call.Pos(), "%s format %s is missing verb at end of string", name, state.format) - return nil - } - verb, w := utf8.DecodeRuneInString(state.format[state.nbytes:]) - state.verb = verb - state.nbytes += w - if verb != '%' { - state.argNums = append(state.argNums, state.argNum) - } - state.format = state.format[:state.nbytes] - return state -} - -// printfArgType encodes the types of expressions a printf verb accepts. It is a bitmask. -type printfArgType int - -const ( - argBool printfArgType = 1 << iota - argInt - argRune - argString - argFloat - argComplex - argPointer - anyType printfArgType = ^0 -) - -type printVerb struct { - verb rune // User may provide verb through Formatter; could be a rune. - flags string // known flags are all ASCII - typ printfArgType -} - -// Common flag sets for printf verbs. -const ( - noFlag = "" - numFlag = " -+.0" - sharpNumFlag = " -+.0#" - allFlags = " -+.0#" -) - -// printVerbs identifies which flags are known to printf for each verb. -var printVerbs = []printVerb{ - // '-' is a width modifier, always valid. - // '.' is a precision for float, max width for strings. - // '+' is required sign for numbers, Go format for %v. - // '#' is alternate format for several verbs. - // ' ' is spacer for numbers - {'%', noFlag, 0}, - {'b', numFlag, argInt | argFloat | argComplex}, - {'c', "-", argRune | argInt}, - {'d', numFlag, argInt | argPointer}, - {'e', sharpNumFlag, argFloat | argComplex}, - {'E', sharpNumFlag, argFloat | argComplex}, - {'f', sharpNumFlag, argFloat | argComplex}, - {'F', sharpNumFlag, argFloat | argComplex}, - {'g', sharpNumFlag, argFloat | argComplex}, - {'G', sharpNumFlag, argFloat | argComplex}, - {'o', sharpNumFlag, argInt}, - {'p', "-#", argPointer}, - {'q', " -+.0#", argRune | argInt | argString}, - {'s', " -+.0", argString}, - {'t', "-", argBool}, - {'T', "-", anyType}, - {'U', "-#", argRune | argInt}, - {'v', allFlags, anyType}, - {'x', sharpNumFlag, argRune | argInt | argString | argPointer}, - {'X', sharpNumFlag, argRune | argInt | argString | argPointer}, -} - -// okPrintfArg compares the formatState to the arguments actually present, -// reporting any discrepancies it can discern. If the final argument is ellipsissed, -// there's little it can do for that. -func (f *File) okPrintfArg(call *ast.CallExpr, state *formatState) (ok bool) { - var v printVerb - found := false - // Linear scan is fast enough for a small list. - for _, v = range printVerbs { - if v.verb == state.verb { - found = true - break - } - } - - // Does current arg implement fmt.Formatter? - formatter := false - if state.argNum < len(call.Args) { - if tv, ok := f.pkg.types[call.Args[state.argNum]]; ok { - formatter = f.isFormatter(tv.Type) - } - } - - if !formatter { - if !found { - f.Badf(call.Pos(), "%s format %s has unknown verb %c", state.name, state.format, state.verb) - return false - } - for _, flag := range state.flags { - // TODO: Disable complaint about '0' for Go 1.10. To be fixed properly in 1.11. - // See issues 23598 and 23605. - if flag == '0' { - continue - } - if !strings.ContainsRune(v.flags, rune(flag)) { - f.Badf(call.Pos(), "%s format %s has unrecognized flag %c", state.name, state.format, flag) - return false - } - } - } - // Verb is good. If len(state.argNums)>trueArgs, we have something like %.*s and all - // but the final arg must be an integer. - trueArgs := 1 - if state.verb == '%' { - trueArgs = 0 - } - nargs := len(state.argNums) - for i := 0; i < nargs-trueArgs; i++ { - argNum := state.argNums[i] - if !f.argCanBeChecked(call, i, state) { - return - } - arg := call.Args[argNum] - if !f.matchArgType(argInt, nil, arg) { - f.Badf(call.Pos(), "%s format %s uses non-int %s as argument of *", state.name, state.format, f.gofmt(arg)) - return false - } - } - if state.verb == '%' || formatter { - return true - } - argNum := state.argNums[len(state.argNums)-1] - if !f.argCanBeChecked(call, len(state.argNums)-1, state) { - return false - } - arg := call.Args[argNum] - if f.isFunctionValue(arg) && state.verb != 'p' && state.verb != 'T' { - f.Badf(call.Pos(), "%s format %s arg %s is a func value, not called", state.name, state.format, f.gofmt(arg)) - return false - } - if !f.matchArgType(v.typ, nil, arg) { - typeString := "" - if typ := f.pkg.types[arg].Type; typ != nil { - typeString = typ.String() - } - f.Badf(call.Pos(), "%s format %s has arg %s of wrong type %s", state.name, state.format, f.gofmt(arg), typeString) - return false - } - if v.typ&argString != 0 && v.verb != 'T' && !bytes.Contains(state.flags, []byte{'#'}) && f.recursiveStringer(arg) { - f.Badf(call.Pos(), "%s format %s with arg %s causes recursive String method call", state.name, state.format, f.gofmt(arg)) - return false - } - return true -} - -// recursiveStringer reports whether the provided argument is r or &r for the -// fmt.Stringer receiver identifier r. -func (f *File) recursiveStringer(e ast.Expr) bool { - if len(f.stringerPtrs) == 0 { - return false - } - ptr := false - var obj *ast.Object - switch e := e.(type) { - case *ast.Ident: - obj = e.Obj - case *ast.UnaryExpr: - if id, ok := e.X.(*ast.Ident); ok && e.Op == token.AND { - obj = id.Obj - ptr = true - } - } - - // It's unlikely to be a recursive stringer if it has a Format method. - if typ := f.pkg.types[e].Type; typ != nil { - if f.isFormatter(typ) { - return false - } - } - - // We compare the underlying Object, which checks that the identifier - // is the one we declared as the receiver for the String method in - // which this printf appears. - ptrRecv, exist := f.stringerPtrs[obj] - if !exist { - return false - } - // We also need to check that using &t when we declared String - // on (t *T) is ok; in such a case, the address is printed. - if ptr && ptrRecv { - return false - } - return true -} - -// isFunctionValue reports whether the expression is a function as opposed to a function call. -// It is almost always a mistake to print a function value. -func (f *File) isFunctionValue(e ast.Expr) bool { - if typ := f.pkg.types[e].Type; typ != nil { - _, ok := typ.(*types.Signature) - return ok - } - return false -} - -// argCanBeChecked reports whether the specified argument is statically present; -// it may be beyond the list of arguments or in a terminal slice... argument, which -// means we can't see it. -func (f *File) argCanBeChecked(call *ast.CallExpr, formatArg int, state *formatState) bool { - argNum := state.argNums[formatArg] - if argNum <= 0 { - // Shouldn't happen, so catch it with prejudice. - panic("negative arg num") - } - if argNum < len(call.Args)-1 { - return true // Always OK. - } - if call.Ellipsis.IsValid() { - return false // We just can't tell; there could be many more arguments. - } - if argNum < len(call.Args) { - return true - } - // There are bad indexes in the format or there are fewer arguments than the format needs. - // This is the argument number relative to the format: Printf("%s", "hi") will give 1 for the "hi". - arg := argNum - state.firstArg + 1 // People think of arguments as 1-indexed. - f.Badf(call.Pos(), "%s format %s reads arg #%d, but call has %v", state.name, state.format, arg, count(len(call.Args)-state.firstArg, "arg")) - return false -} - -// printFormatRE is the regexp we match and report as a possible format string -// in the first argument to unformatted prints like fmt.Print. -// We exclude the space flag, so that printing a string like "x % y" is not reported as a format. -var printFormatRE = regexp.MustCompile(`%` + flagsRE + numOptRE + `\.?` + numOptRE + indexOptRE + verbRE) - -const ( - flagsRE = `[+\-#]*` - indexOptRE = `(\[[0-9]+\])?` - numOptRE = `([0-9]+|` + indexOptRE + `\*)?` - verbRE = `[bcdefgopqstvxEFGTUX]` -) - -// checkPrint checks a call to an unformatted print routine such as Println. -func (f *File) checkPrint(call *ast.CallExpr, name string) { - firstArg := 0 - typ := f.pkg.types[call.Fun].Type - if typ == nil { - // Skip checking functions with unknown type. - return - } - if sig, ok := typ.(*types.Signature); ok { - if !sig.Variadic() { - // Skip checking non-variadic functions. - return - } - params := sig.Params() - firstArg = params.Len() - 1 - - typ := params.At(firstArg).Type() - typ = typ.(*types.Slice).Elem() - it, ok := typ.(*types.Interface) - if !ok || !it.Empty() { - // Skip variadic functions accepting non-interface{} args. - return - } - } - args := call.Args - if len(args) <= firstArg { - // Skip calls without variadic args. - return - } - args = args[firstArg:] - - if firstArg == 0 { - if sel, ok := call.Args[0].(*ast.SelectorExpr); ok { - if x, ok := sel.X.(*ast.Ident); ok { - if x.Name == "os" && strings.HasPrefix(sel.Sel.Name, "Std") { - f.Badf(call.Pos(), "%s does not take io.Writer but has first arg %s", name, f.gofmt(call.Args[0])) - } - } - } - } - - arg := args[0] - if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING { - // Ignore trailing % character in lit.Value. - // The % in "abc 0.0%" couldn't be a formatting directive. - s := strings.TrimSuffix(lit.Value, `%"`) - if strings.Contains(s, "%") { - m := printFormatRE.FindStringSubmatch(s) - if m != nil { - f.Badf(call.Pos(), "%s call has possible formatting directive %s", name, m[0]) - } - } - } - if strings.HasSuffix(name, "ln") { - // The last item, if a string, should not have a newline. - arg = args[len(args)-1] - if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING { - str, _ := strconv.Unquote(lit.Value) - if strings.HasSuffix(str, "\n") { - f.Badf(call.Pos(), "%s arg list ends with redundant newline", name) - } - } - } - for _, arg := range args { - if f.isFunctionValue(arg) { - f.Badf(call.Pos(), "%s arg %s is a func value, not called", name, f.gofmt(arg)) - } - if f.recursiveStringer(arg) { - f.Badf(call.Pos(), "%s arg %s causes recursive call to String method", name, f.gofmt(arg)) - } - } -} - -// count(n, what) returns "1 what" or "N whats" -// (assuming the plural of what is whats). -func count(n int, what string) string { - if n == 1 { - return "1 " + what - } - return fmt.Sprintf("%d %ss", n, what) -} diff --git a/src/cmd/vet/rangeloop.go b/src/cmd/vet/rangeloop.go deleted file mode 100644 index 53a41364dfe1b..0000000000000 --- a/src/cmd/vet/rangeloop.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2012 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. - -/* -This file contains the code to check range loop variables bound inside function -literals that are deferred or launched in new goroutines. We only check -instances where the defer or go statement is the last statement in the loop -body, as otherwise we would need whole program analysis. - -For example: - - for i, v := range s { - go func() { - println(i, v) // not what you might expect - }() - } - -See: https://golang.org/doc/go_faq.html#closures_and_goroutines -*/ - -package main - -import "go/ast" - -func init() { - register("rangeloops", - "check that loop variables are used correctly", - checkLoop, - rangeStmt, forStmt) -} - -// checkLoop walks the body of the provided loop statement, checking whether -// its index or value variables are used unsafely inside goroutines or deferred -// function literals. -func checkLoop(f *File, node ast.Node) { - // Find the variables updated by the loop statement. - var vars []*ast.Ident - addVar := func(expr ast.Expr) { - if id, ok := expr.(*ast.Ident); ok { - vars = append(vars, id) - } - } - var body *ast.BlockStmt - switch n := node.(type) { - case *ast.RangeStmt: - body = n.Body - addVar(n.Key) - addVar(n.Value) - case *ast.ForStmt: - body = n.Body - switch post := n.Post.(type) { - case *ast.AssignStmt: - // e.g. for p = head; p != nil; p = p.next - for _, lhs := range post.Lhs { - addVar(lhs) - } - case *ast.IncDecStmt: - // e.g. for i := 0; i < n; i++ - addVar(post.X) - } - } - if vars == nil { - return - } - - // Inspect a go or defer statement - // if it's the last one in the loop body. - // (We give up if there are following statements, - // because it's hard to prove go isn't followed by wait, - // or defer by return.) - if len(body.List) == 0 { - return - } - var last *ast.CallExpr - switch s := body.List[len(body.List)-1].(type) { - case *ast.GoStmt: - last = s.Call - case *ast.DeferStmt: - last = s.Call - default: - return - } - lit, ok := last.Fun.(*ast.FuncLit) - if !ok { - return - } - ast.Inspect(lit.Body, func(n ast.Node) bool { - id, ok := n.(*ast.Ident) - if !ok || id.Obj == nil { - return true - } - if f.pkg.types[id].Type == nil { - // Not referring to a variable (e.g. struct field name) - return true - } - for _, v := range vars { - if v.Obj == id.Obj { - f.Badf(id.Pos(), "loop variable %s captured by func literal", - id.Name) - } - } - return true - }) -} diff --git a/src/cmd/vet/shadow.go b/src/cmd/vet/shadow.go deleted file mode 100644 index 47a48834bfcc0..0000000000000 --- a/src/cmd/vet/shadow.go +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2013 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. - -/* -This file contains the code to check for shadowed variables. -A shadowed variable is a variable declared in an inner scope -with the same name and type as a variable in an outer scope, -and where the outer variable is mentioned after the inner one -is declared. - -(This definition can be refined; the module generates too many -false positives and is not yet enabled by default.) - -For example: - - func BadRead(f *os.File, buf []byte) error { - var err error - for { - n, err := f.Read(buf) // shadows the function variable 'err' - if err != nil { - break // causes return of wrong value - } - foo(buf) - } - return err - } - -*/ - -package main - -import ( - "flag" - "go/ast" - "go/token" - "go/types" -) - -var strictShadowing = flag.Bool("shadowstrict", false, "whether to be strict about shadowing; can be noisy") - -func init() { - register("shadow", - "check for shadowed variables (experimental; must be set explicitly)", - checkShadow, - assignStmt, genDecl) - experimental["shadow"] = true -} - -func checkShadow(f *File, node ast.Node) { - switch n := node.(type) { - case *ast.AssignStmt: - checkShadowAssignment(f, n) - case *ast.GenDecl: - checkShadowDecl(f, n) - } -} - -// Span stores the minimum range of byte positions in the file in which a -// given variable (types.Object) is mentioned. It is lexically defined: it spans -// from the beginning of its first mention to the end of its last mention. -// A variable is considered shadowed (if *strictShadowing is off) only if the -// shadowing variable is declared within the span of the shadowed variable. -// In other words, if a variable is shadowed but not used after the shadowed -// variable is declared, it is inconsequential and not worth complaining about. -// This simple check dramatically reduces the nuisance rate for the shadowing -// check, at least until something cleverer comes along. -// -// One wrinkle: A "naked return" is a silent use of a variable that the Span -// will not capture, but the compilers catch naked returns of shadowed -// variables so we don't need to. -// -// Cases this gets wrong (TODO): -// - If a for loop's continuation statement mentions a variable redeclared in -// the block, we should complain about it but don't. -// - A variable declared inside a function literal can falsely be identified -// as shadowing a variable in the outer function. -// -type Span struct { - min token.Pos - max token.Pos -} - -// contains reports whether the position is inside the span. -func (s Span) contains(pos token.Pos) bool { - return s.min <= pos && pos < s.max -} - -// growSpan expands the span for the object to contain the source range [pos, end). -func (pkg *Package) growSpan(obj types.Object, pos, end token.Pos) { - if *strictShadowing { - return // No need - } - span, ok := pkg.spans[obj] - if ok { - if span.min > pos { - span.min = pos - } - if span.max < end { - span.max = end - } - } else { - span = Span{pos, end} - } - pkg.spans[obj] = span -} - -// checkShadowAssignment checks for shadowing in a short variable declaration. -func checkShadowAssignment(f *File, a *ast.AssignStmt) { - if a.Tok != token.DEFINE { - return - } - if f.idiomaticShortRedecl(a) { - return - } - for _, expr := range a.Lhs { - ident, ok := expr.(*ast.Ident) - if !ok { - f.Badf(expr.Pos(), "invalid AST: short variable declaration of non-identifier") - return - } - checkShadowing(f, ident) - } -} - -// idiomaticShortRedecl reports whether this short declaration can be ignored for -// the purposes of shadowing, that is, that any redeclarations it contains are deliberate. -func (f *File) idiomaticShortRedecl(a *ast.AssignStmt) bool { - // Don't complain about deliberate redeclarations of the form - // i := i - // Such constructs are idiomatic in range loops to create a new variable - // for each iteration. Another example is - // switch n := n.(type) - if len(a.Rhs) != len(a.Lhs) { - return false - } - // We know it's an assignment, so the LHS must be all identifiers. (We check anyway.) - for i, expr := range a.Lhs { - lhs, ok := expr.(*ast.Ident) - if !ok { - f.Badf(expr.Pos(), "invalid AST: short variable declaration of non-identifier") - return true // Don't do any more processing. - } - switch rhs := a.Rhs[i].(type) { - case *ast.Ident: - if lhs.Name != rhs.Name { - return false - } - case *ast.TypeAssertExpr: - if id, ok := rhs.X.(*ast.Ident); ok { - if lhs.Name != id.Name { - return false - } - } - default: - return false - } - } - return true -} - -// idiomaticRedecl reports whether this declaration spec can be ignored for -// the purposes of shadowing, that is, that any redeclarations it contains are deliberate. -func (f *File) idiomaticRedecl(d *ast.ValueSpec) bool { - // Don't complain about deliberate redeclarations of the form - // var i, j = i, j - if len(d.Names) != len(d.Values) { - return false - } - for i, lhs := range d.Names { - if rhs, ok := d.Values[i].(*ast.Ident); ok { - if lhs.Name != rhs.Name { - return false - } - } - } - return true -} - -// checkShadowDecl checks for shadowing in a general variable declaration. -func checkShadowDecl(f *File, d *ast.GenDecl) { - if d.Tok != token.VAR { - return - } - for _, spec := range d.Specs { - valueSpec, ok := spec.(*ast.ValueSpec) - if !ok { - f.Badf(spec.Pos(), "invalid AST: var GenDecl not ValueSpec") - return - } - // Don't complain about deliberate redeclarations of the form - // var i = i - if f.idiomaticRedecl(valueSpec) { - return - } - for _, ident := range valueSpec.Names { - checkShadowing(f, ident) - } - } -} - -// checkShadowing checks whether the identifier shadows an identifier in an outer scope. -func checkShadowing(f *File, ident *ast.Ident) { - if ident.Name == "_" { - // Can't shadow the blank identifier. - return - } - obj := f.pkg.defs[ident] - if obj == nil { - return - } - // obj.Parent.Parent is the surrounding scope. If we can find another declaration - // starting from there, we have a shadowed identifier. - _, shadowed := obj.Parent().Parent().LookupParent(obj.Name(), obj.Pos()) - if shadowed == nil { - return - } - // Don't complain if it's shadowing a universe-declared identifier; that's fine. - if shadowed.Parent() == types.Universe { - return - } - if *strictShadowing { - // The shadowed identifier must appear before this one to be an instance of shadowing. - if shadowed.Pos() > ident.Pos() { - return - } - } else { - // Don't complain if the span of validity of the shadowed identifier doesn't include - // the shadowing identifier. - span, ok := f.pkg.spans[shadowed] - if !ok { - f.Badf(shadowed.Pos(), "internal error: no range for %q", shadowed.Name()) - return - } - if !span.contains(ident.Pos()) { - return - } - } - // Don't complain if the types differ: that implies the programmer really wants two different things. - if types.Identical(obj.Type(), shadowed.Type()) { - f.Badf(ident.Pos(), "declaration of %q shadows declaration at %s", obj.Name(), f.loc(shadowed.Pos())) - } -} diff --git a/src/cmd/vet/shift.go b/src/cmd/vet/shift.go deleted file mode 100644 index 1e48d325242bd..0000000000000 --- a/src/cmd/vet/shift.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2014 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. - -/* -This file contains the code to check for suspicious shifts. -*/ - -package main - -import ( - "go/ast" - "go/constant" - "go/token" - "go/types" -) - -func init() { - register("shift", - "check for useless shifts", - checkShift, - binaryExpr, assignStmt) -} - -func checkShift(f *File, node ast.Node) { - if f.dead[node] { - // Skip shift checks on unreachable nodes. - return - } - - switch node := node.(type) { - case *ast.BinaryExpr: - if node.Op == token.SHL || node.Op == token.SHR { - checkLongShift(f, node, node.X, node.Y) - } - case *ast.AssignStmt: - if len(node.Lhs) != 1 || len(node.Rhs) != 1 { - return - } - if node.Tok == token.SHL_ASSIGN || node.Tok == token.SHR_ASSIGN { - checkLongShift(f, node, node.Lhs[0], node.Rhs[0]) - } - } -} - -// checkLongShift checks if shift or shift-assign operations shift by more than -// the length of the underlying variable. -func checkLongShift(f *File, node ast.Node, x, y ast.Expr) { - if f.pkg.types[x].Value != nil { - // Ignore shifts of constants. - // These are frequently used for bit-twiddling tricks - // like ^uint(0) >> 63 for 32/64 bit detection and compatibility. - return - } - - v := f.pkg.types[y].Value - if v == nil { - return - } - amt, ok := constant.Int64Val(v) - if !ok { - return - } - t := f.pkg.types[x].Type - if t == nil { - return - } - b, ok := t.Underlying().(*types.Basic) - if !ok { - return - } - var size int64 - switch b.Kind() { - case types.Uint8, types.Int8: - size = 8 - case types.Uint16, types.Int16: - size = 16 - case types.Uint32, types.Int32: - size = 32 - case types.Uint64, types.Int64: - size = 64 - case types.Int, types.Uint: - size = uintBitSize - case types.Uintptr: - size = uintptrBitSize - default: - return - } - if amt >= size { - ident := f.gofmt(x) - f.Badf(node.Pos(), "%s (%d bits) too small for shift of %d", ident, size, amt) - } -} - -var ( - uintBitSize = 8 * archSizes.Sizeof(types.Typ[types.Uint]) - uintptrBitSize = 8 * archSizes.Sizeof(types.Typ[types.Uintptr]) -) diff --git a/src/cmd/vet/structtag.go b/src/cmd/vet/structtag.go deleted file mode 100644 index 32366eab44bac..0000000000000 --- a/src/cmd/vet/structtag.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2010 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. - -// This file contains the test for canonical struct tags. - -package main - -import ( - "errors" - "go/ast" - "go/token" - "go/types" - "reflect" - "strconv" - "strings" -) - -func init() { - register("structtags", - "check that struct field tags have canonical format and apply to exported fields as needed", - checkStructFieldTags, - structType) -} - -// checkStructFieldTags checks all the field tags of a struct, including checking for duplicates. -func checkStructFieldTags(f *File, node ast.Node) { - astType := node.(*ast.StructType) - typ := f.pkg.types[astType].Type.(*types.Struct) - var seen map[[2]string]token.Pos - for i := 0; i < typ.NumFields(); i++ { - field := typ.Field(i) - tag := typ.Tag(i) - checkCanonicalFieldTag(f, astType, field, tag, &seen) - } -} - -var checkTagDups = []string{"json", "xml"} -var checkTagSpaces = map[string]bool{"json": true, "xml": true, "asn1": true} - -// checkCanonicalFieldTag checks a single struct field tag. -// top is the top-level struct type that is currently being checked. -func checkCanonicalFieldTag(f *File, top *ast.StructType, field *types.Var, tag string, seen *map[[2]string]token.Pos) { - for _, key := range checkTagDups { - checkTagDuplicates(f, tag, key, field, field, seen) - } - - if err := validateStructTag(tag); err != nil { - f.Badf(field.Pos(), "struct field tag %#q not compatible with reflect.StructTag.Get: %s", tag, err) - } - - // Check for use of json or xml tags with unexported fields. - - // Embedded struct. Nothing to do for now, but that - // may change, depending on what happens with issue 7363. - if field.Anonymous() { - return - } - - if field.Exported() { - return - } - - for _, enc := range [...]string{"json", "xml"} { - if reflect.StructTag(tag).Get(enc) != "" { - f.Badf(field.Pos(), "struct field %s has %s tag but is not exported", field.Name(), enc) - return - } - } -} - -// checkTagDuplicates checks a single struct field tag to see if any tags are -// duplicated. nearest is the field that's closest to the field being checked, -// while still being part of the top-level struct type. -func checkTagDuplicates(f *File, tag, key string, nearest, field *types.Var, seen *map[[2]string]token.Pos) { - val := reflect.StructTag(tag).Get(key) - if val == "-" { - // Ignored, even if the field is anonymous. - return - } - if val == "" || val[0] == ',' { - if field.Anonymous() { - typ, ok := field.Type().Underlying().(*types.Struct) - if !ok { - return - } - for i := 0; i < typ.NumFields(); i++ { - field := typ.Field(i) - if !field.Exported() { - continue - } - tag := typ.Tag(i) - checkTagDuplicates(f, tag, key, nearest, field, seen) - } - } - // Ignored if the field isn't anonymous. - return - } - if key == "xml" && field.Name() == "XMLName" { - // XMLName defines the XML element name of the struct being - // checked. That name cannot collide with element or attribute - // names defined on other fields of the struct. Vet does not have a - // check for untagged fields of type struct defining their own name - // by containing a field named XMLName; see issue 18256. - return - } - if i := strings.Index(val, ","); i >= 0 { - if key == "xml" { - // Use a separate namespace for XML attributes. - for _, opt := range strings.Split(val[i:], ",") { - if opt == "attr" { - key += " attribute" // Key is part of the error message. - break - } - } - } - val = val[:i] - } - if *seen == nil { - *seen = map[[2]string]token.Pos{} - } - if pos, ok := (*seen)[[2]string{key, val}]; ok { - f.Badf(nearest.Pos(), "struct field %s repeats %s tag %q also at %s", field.Name(), key, val, f.loc(pos)) - } else { - (*seen)[[2]string{key, val}] = field.Pos() - } -} - -var ( - errTagSyntax = errors.New("bad syntax for struct tag pair") - errTagKeySyntax = errors.New("bad syntax for struct tag key") - errTagValueSyntax = errors.New("bad syntax for struct tag value") - errTagValueSpace = errors.New("suspicious space in struct tag value") - errTagSpace = errors.New("key:\"value\" pairs not separated by spaces") -) - -// validateStructTag parses the struct tag and returns an error if it is not -// in the canonical format, which is a space-separated list of key:"value" -// settings. The value may contain spaces. -func validateStructTag(tag string) error { - // This code is based on the StructTag.Get code in package reflect. - - n := 0 - for ; tag != ""; n++ { - if n > 0 && tag != "" && tag[0] != ' ' { - // More restrictive than reflect, but catches likely mistakes - // like `x:"foo",y:"bar"`, which parses as `x:"foo" ,y:"bar"` with second key ",y". - return errTagSpace - } - // Skip leading space. - i := 0 - for i < len(tag) && tag[i] == ' ' { - i++ - } - tag = tag[i:] - if tag == "" { - break - } - - // Scan to colon. A space, a quote or a control character is a syntax error. - // Strictly speaking, control chars include the range [0x7f, 0x9f], not just - // [0x00, 0x1f], but in practice, we ignore the multi-byte control characters - // as it is simpler to inspect the tag's bytes than the tag's runes. - i = 0 - for i < len(tag) && tag[i] > ' ' && tag[i] != ':' && tag[i] != '"' && tag[i] != 0x7f { - i++ - } - if i == 0 { - return errTagKeySyntax - } - if i+1 >= len(tag) || tag[i] != ':' { - return errTagSyntax - } - if tag[i+1] != '"' { - return errTagValueSyntax - } - key := tag[:i] - tag = tag[i+1:] - - // Scan quoted string to find value. - i = 1 - for i < len(tag) && tag[i] != '"' { - if tag[i] == '\\' { - i++ - } - i++ - } - if i >= len(tag) { - return errTagValueSyntax - } - qvalue := tag[:i+1] - tag = tag[i+1:] - - value, err := strconv.Unquote(qvalue) - if err != nil { - return errTagValueSyntax - } - - if !checkTagSpaces[key] { - continue - } - - switch key { - case "xml": - // If the first or last character in the XML tag is a space, it is - // suspicious. - if strings.Trim(value, " ") != value { - return errTagValueSpace - } - - // If there are multiple spaces, they are suspicious. - if strings.Count(value, " ") > 1 { - return errTagValueSpace - } - - // If there is no comma, skip the rest of the checks. - comma := strings.IndexRune(value, ',') - if comma < 0 { - continue - } - - // If the character before a comma is a space, this is suspicious. - if comma > 0 && value[comma-1] == ' ' { - return errTagValueSpace - } - value = value[comma+1:] - case "json": - // JSON allows using spaces in the name, so skip it. - comma := strings.IndexRune(value, ',') - if comma < 0 { - continue - } - value = value[comma+1:] - } - - if strings.IndexByte(value, ' ') >= 0 { - return errTagValueSpace - } - } - return nil -} diff --git a/src/cmd/vet/testdata/asm/asm.go b/src/cmd/vet/testdata/asm/asm.go deleted file mode 100644 index 2237ddc3b05c9..0000000000000 --- a/src/cmd/vet/testdata/asm/asm.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This file contains declarations to test the assembly in test_asm.s. - -package testdata - -type S struct { - i int32 - b bool - s string -} - -func arg1(x int8, y uint8) -func arg2(x int16, y uint16) -func arg4(x int32, y uint32) -func arg8(x int64, y uint64) -func argint(x int, y uint) -func argptr(x *byte, y *byte, c chan int, m map[int]int, f func()) -func argstring(x, y string) -func argslice(x, y []string) -func argiface(x interface{}, y interface { - m() -}) -func argcomplex(x complex64, y complex128) -func argstruct(x S, y struct{}) -func argarray(x [2]S) -func returnint() int -func returnbyte(x int) byte -func returnnamed(x byte) (r1 int, r2 int16, r3 string, r4 byte) -func returnintmissing() int -func leaf(x, y int) int - -func noprof(x int) -func dupok(x int) -func nosplit(x int) -func rodata(x int) -func noptr(x int) -func wrapper(x int) - -func f15271() (x uint32) -func f17584(x float32, y complex64) - -func noframe1(x int32) -func noframe2(x int32) diff --git a/src/cmd/vet/testdata/asm/asm1.s b/src/cmd/vet/testdata/asm/asm1.s deleted file mode 100644 index cac6ed22cd003..0000000000000 --- a/src/cmd/vet/testdata/asm/asm1.s +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build amd64 -// +build vet_test - -TEXT ·arg1(SB),0,$0-2 - MOVB x+0(FP), AX - // MOVB x+0(FP), AX // commented out instructions used to panic - MOVB y+1(FP), BX - MOVW x+0(FP), AX // ERROR "\[amd64\] arg1: invalid MOVW of x\+0\(FP\); int8 is 1-byte value" - MOVW y+1(FP), AX // ERROR "invalid MOVW of y\+1\(FP\); uint8 is 1-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int8 is 1-byte value" - MOVL y+1(FP), AX // ERROR "invalid MOVL of y\+1\(FP\); uint8 is 1-byte value" - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int8 is 1-byte value" - MOVQ y+1(FP), AX // ERROR "invalid MOVQ of y\+1\(FP\); uint8 is 1-byte value" - MOVB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - MOVB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - TESTB x+0(FP), AX - TESTB y+1(FP), BX - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int8 is 1-byte value" - TESTW y+1(FP), AX // ERROR "invalid TESTW of y\+1\(FP\); uint8 is 1-byte value" - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int8 is 1-byte value" - TESTL y+1(FP), AX // ERROR "invalid TESTL of y\+1\(FP\); uint8 is 1-byte value" - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int8 is 1-byte value" - TESTQ y+1(FP), AX // ERROR "invalid TESTQ of y\+1\(FP\); uint8 is 1-byte value" - TESTB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - TESTB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - MOVB 8(SP), AX // ERROR "8\(SP\) should be x\+0\(FP\)" - MOVB 9(SP), AX // ERROR "9\(SP\) should be y\+1\(FP\)" - MOVB 10(SP), AX // ERROR "use of 10\(SP\) points beyond argument frame" - RET - -TEXT ·arg2(SB),0,$0-4 - MOVB x+0(FP), AX // ERROR "arg2: invalid MOVB of x\+0\(FP\); int16 is 2-byte value" - MOVB y+2(FP), AX // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" - MOVW x+0(FP), AX - MOVW y+2(FP), BX - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int16 is 2-byte value" - MOVL y+2(FP), AX // ERROR "invalid MOVL of y\+2\(FP\); uint16 is 2-byte value" - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int16 is 2-byte value" - MOVQ y+2(FP), AX // ERROR "invalid MOVQ of y\+2\(FP\); uint16 is 2-byte value" - MOVW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - MOVW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int16 is 2-byte value" - TESTB y+2(FP), AX // ERROR "invalid TESTB of y\+2\(FP\); uint16 is 2-byte value" - TESTW x+0(FP), AX - TESTW y+2(FP), BX - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int16 is 2-byte value" - TESTL y+2(FP), AX // ERROR "invalid TESTL of y\+2\(FP\); uint16 is 2-byte value" - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int16 is 2-byte value" - TESTQ y+2(FP), AX // ERROR "invalid TESTQ of y\+2\(FP\); uint16 is 2-byte value" - TESTW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - TESTW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - RET - -TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" - MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int32 is 4-byte value" - MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); uint32 is 4-byte value" - MOVL x+0(FP), AX - MOVL y+4(FP), AX - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int32 is 4-byte value" - MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); uint32 is 4-byte value" - MOVL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int32 is 4-byte value" - TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); uint32 is 4-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int32 is 4-byte value" - TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); uint32 is 4-byte value" - TESTL x+0(FP), AX - TESTL y+4(FP), AX - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int32 is 4-byte value" - TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); uint32 is 4-byte value" - TESTL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - TESTL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" - MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value" - MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int64 is 8-byte value" - MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); uint64 is 8-byte value" - MOVQ x+0(FP), AX - MOVQ y+8(FP), AX - MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int64 is 8-byte value" - TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); uint64 is 8-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int64 is 8-byte value" - TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); uint64 is 8-byte value" - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int64 is 8-byte value" - TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); uint64 is 8-byte value" - TESTQ x+0(FP), AX - TESTQ y+8(FP), AX - TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int is 8-byte value" - MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint is 8-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int is 8-byte value" - MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint is 8-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int is 8-byte value" - MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); uint is 8-byte value" - MOVQ x+0(FP), AX - MOVQ y+8(FP), AX - MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int is 8-byte value" - TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); uint is 8-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int is 8-byte value" - TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); uint is 8-byte value" - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int is 8-byte value" - TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); uint is 8-byte value" - TESTQ x+0(FP), AX - TESTQ y+8(FP), AX - TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-40" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 8-byte value" - MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); \*byte is 8-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); \*byte is 8-byte value" - MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); \*byte is 8-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); \*byte is 8-byte value" - MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); \*byte is 8-byte value" - MOVQ x+0(FP), AX - MOVQ y+8(FP), AX - MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); \*byte is 8-byte value" - TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); \*byte is 8-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); \*byte is 8-byte value" - TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); \*byte is 8-byte value" - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); \*byte is 8-byte value" - TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); \*byte is 8-byte value" - TESTQ x+0(FP), AX - TESTQ y+8(FP), AX - TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - MOVL c+16(FP), AX // ERROR "invalid MOVL of c\+16\(FP\); chan int is 8-byte value" - MOVL m+24(FP), AX // ERROR "invalid MOVL of m\+24\(FP\); map\[int\]int is 8-byte value" - MOVL f+32(FP), AX // ERROR "invalid MOVL of f\+32\(FP\); func\(\) is 8-byte value" - RET - -TEXT ·argstring(SB),0,$32 // ERROR "wrong argument size 0; expected \$\.\.\.-32" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); string base is 8-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); string base is 8-byte value" - MOVQ x+0(FP), AX - MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); string base is 8-byte value" - MOVL x_base+0(FP), AX // ERROR "invalid MOVL of x_base\+0\(FP\); string base is 8-byte value" - MOVQ x_base+0(FP), AX - MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+8(FP), AX // ERROR "invalid MOVW of x_len\+8\(FP\); string len is 8-byte value" - MOVL x_len+8(FP), AX // ERROR "invalid MOVL of x_len\+8\(FP\); string len is 8-byte value" - MOVQ x_len+8(FP), AX - MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+16\(FP\)" - MOVQ y_len+8(FP), AX // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+24\(FP\)" - RET - -TEXT ·argslice(SB),0,$48 // ERROR "wrong argument size 0; expected \$\.\.\.-48" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); slice base is 8-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); slice base is 8-byte value" - MOVQ x+0(FP), AX - MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); slice base is 8-byte value" - MOVL x_base+0(FP), AX // ERROR "invalid MOVL of x_base\+0\(FP\); slice base is 8-byte value" - MOVQ x_base+0(FP), AX - MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+8(FP), AX // ERROR "invalid MOVW of x_len\+8\(FP\); slice len is 8-byte value" - MOVL x_len+8(FP), AX // ERROR "invalid MOVL of x_len\+8\(FP\); slice len is 8-byte value" - MOVQ x_len+8(FP), AX - MOVW x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVL x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVQ x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVW x_cap+16(FP), AX // ERROR "invalid MOVW of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVL x_cap+16(FP), AX // ERROR "invalid MOVL of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVQ x_cap+16(FP), AX - MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+24\(FP\)" - MOVQ y_len+8(FP), AX // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+32\(FP\)" - MOVQ y_cap+16(FP), AX // ERROR "invalid offset y_cap\+16\(FP\); expected y_cap\+40\(FP\)" - RET - -TEXT ·argiface(SB),0,$0-32 - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); interface type is 8-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); interface type is 8-byte value" - MOVQ x+0(FP), AX - MOVW x_type+0(FP), AX // ERROR "invalid MOVW of x_type\+0\(FP\); interface type is 8-byte value" - MOVL x_type+0(FP), AX // ERROR "invalid MOVL of x_type\+0\(FP\); interface type is 8-byte value" - MOVQ x_type+0(FP), AX - MOVQ x_itable+0(FP), AX // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" - MOVQ x_itable+1(FP), AX // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" - MOVW x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVL x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVQ x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVW x_data+8(FP), AX // ERROR "invalid MOVW of x_data\+8\(FP\); interface data is 8-byte value" - MOVL x_data+8(FP), AX // ERROR "invalid MOVL of x_data\+8\(FP\); interface data is 8-byte value" - MOVQ x_data+8(FP), AX - MOVW y+16(FP), AX // ERROR "invalid MOVW of y\+16\(FP\); interface itable is 8-byte value" - MOVL y+16(FP), AX // ERROR "invalid MOVL of y\+16\(FP\); interface itable is 8-byte value" - MOVQ y+16(FP), AX - MOVW y_itable+16(FP), AX // ERROR "invalid MOVW of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVL y_itable+16(FP), AX // ERROR "invalid MOVL of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVQ y_itable+16(FP), AX - MOVQ y_type+16(FP), AX // ERROR "unknown variable y_type; offset 16 is y_itable\+16\(FP\)" - MOVW y_data+16(FP), AX // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVL y_data+16(FP), AX // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVQ y_data+16(FP), AX // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVW y_data+24(FP), AX // ERROR "invalid MOVW of y_data\+24\(FP\); interface data is 8-byte value" - MOVL y_data+24(FP), AX // ERROR "invalid MOVL of y_data\+24\(FP\); interface data is 8-byte value" - MOVQ y_data+24(FP), AX - RET - -TEXT ·argcomplex(SB),0,$24 // ERROR "wrong argument size 0; expected \$\.\.\.-24" - MOVSS x+0(FP), X0 // ERROR "invalid MOVSS of x\+0\(FP\); complex64 is 8-byte value containing x_real\+0\(FP\) and x_imag\+4\(FP\)" - MOVSD x+0(FP), X0 // ERROR "invalid MOVSD of x\+0\(FP\); complex64 is 8-byte value containing x_real\+0\(FP\) and x_imag\+4\(FP\)" - MOVSS x_real+0(FP), X0 - MOVSD x_real+0(FP), X0 // ERROR "invalid MOVSD of x_real\+0\(FP\); real\(complex64\) is 4-byte value" - MOVSS x_real+4(FP), X0 // ERROR "invalid offset x_real\+4\(FP\); expected x_real\+0\(FP\)" - MOVSS x_imag+4(FP), X0 - MOVSD x_imag+4(FP), X0 // ERROR "invalid MOVSD of x_imag\+4\(FP\); imag\(complex64\) is 4-byte value" - MOVSS x_imag+8(FP), X0 // ERROR "invalid offset x_imag\+8\(FP\); expected x_imag\+4\(FP\)" - MOVSD y+8(FP), X0 // ERROR "invalid MOVSD of y\+8\(FP\); complex128 is 16-byte value containing y_real\+8\(FP\) and y_imag\+16\(FP\)" - MOVSS y_real+8(FP), X0 // ERROR "invalid MOVSS of y_real\+8\(FP\); real\(complex128\) is 8-byte value" - MOVSD y_real+8(FP), X0 - MOVSS y_real+16(FP), X0 // ERROR "invalid offset y_real\+16\(FP\); expected y_real\+8\(FP\)" - MOVSS y_imag+16(FP), X0 // ERROR "invalid MOVSS of y_imag\+16\(FP\); imag\(complex128\) is 8-byte value" - MOVSD y_imag+16(FP), X0 - MOVSS y_imag+24(FP), X0 // ERROR "invalid offset y_imag\+24\(FP\); expected y_imag\+16\(FP\)" - RET - -TEXT ·argstruct(SB),0,$64 // ERROR "wrong argument size 0; expected \$\.\.\.-24" - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); testdata.S is 24-byte value" - MOVQ x_i+0(FP), AX // ERROR "invalid MOVQ of x_i\+0\(FP\); int32 is 4-byte value" - MOVQ x_b+0(FP), AX // ERROR "invalid offset x_b\+0\(FP\); expected x_b\+4\(FP\)" - MOVQ x_s+8(FP), AX - MOVQ x_s_base+8(FP), AX - MOVQ x_s+16(FP), AX // ERROR "invalid offset x_s\+16\(FP\); expected x_s\+8\(FP\), x_s_base\+8\(FP\), or x_s_len\+16\(FP\)" - MOVQ x_s_len+16(FP), AX - RET - -TEXT ·argarray(SB),0,$64 // ERROR "wrong argument size 0; expected \$\.\.\.-48" - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); \[2\]testdata.S is 48-byte value" - MOVQ x_0_i+0(FP), AX // ERROR "invalid MOVQ of x_0_i\+0\(FP\); int32 is 4-byte value" - MOVQ x_0_b+0(FP), AX // ERROR "invalid offset x_0_b\+0\(FP\); expected x_0_b\+4\(FP\)" - MOVQ x_0_s+8(FP), AX - MOVQ x_0_s_base+8(FP), AX - MOVQ x_0_s+16(FP), AX // ERROR "invalid offset x_0_s\+16\(FP\); expected x_0_s\+8\(FP\), x_0_s_base\+8\(FP\), or x_0_s_len\+16\(FP\)" - MOVQ x_0_s_len+16(FP), AX - MOVB foo+25(FP), AX // ERROR "unknown variable foo; offset 25 is x_1_i\+24\(FP\)" - MOVQ x_1_s+32(FP), AX - MOVQ x_1_s_base+32(FP), AX - MOVQ x_1_s+40(FP), AX // ERROR "invalid offset x_1_s\+40\(FP\); expected x_1_s\+32\(FP\), x_1_s_base\+32\(FP\), or x_1_s_len\+40\(FP\)" - MOVQ x_1_s_len+40(FP), AX - RET - -TEXT ·returnint(SB),0,$0-8 - MOVB AX, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 8-byte value" - MOVW AX, ret+0(FP) // ERROR "invalid MOVW of ret\+0\(FP\); int is 8-byte value" - MOVL AX, ret+0(FP) // ERROR "invalid MOVL of ret\+0\(FP\); int is 8-byte value" - MOVQ AX, ret+0(FP) - MOVQ AX, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" - MOVQ AX, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" - RET - -TEXT ·returnbyte(SB),0,$0-9 - MOVQ x+0(FP), AX - MOVB AX, ret+8(FP) - MOVW AX, ret+8(FP) // ERROR "invalid MOVW of ret\+8\(FP\); byte is 1-byte value" - MOVL AX, ret+8(FP) // ERROR "invalid MOVL of ret\+8\(FP\); byte is 1-byte value" - MOVQ AX, ret+8(FP) // ERROR "invalid MOVQ of ret\+8\(FP\); byte is 1-byte value" - MOVB AX, ret+7(FP) // ERROR "invalid offset ret\+7\(FP\); expected ret\+8\(FP\)" - RET - -TEXT ·returnnamed(SB),0,$0-41 - MOVB x+0(FP), AX - MOVQ AX, r1+8(FP) - MOVW AX, r2+16(FP) - MOVQ AX, r3+24(FP) - MOVQ AX, r3_base+24(FP) - MOVQ AX, r3_len+32(FP) - MOVB AX, r4+40(FP) - MOVL AX, r1+8(FP) // ERROR "invalid MOVL of r1\+8\(FP\); int is 8-byte value" - RET - -TEXT ·returnintmissing(SB),0,$0-8 - RET // ERROR "RET without writing to 8-byte ret\+0\(FP\)" - - -// issue 15271 -TEXT ·f15271(SB), NOSPLIT, $0-4 - // Stick 123 into the low 32 bits of X0. - MOVQ $123, AX - PINSRD $0, AX, X0 - - // Return them. - PEXTRD $0, X0, x+0(FP) - RET - -// issue 17584 -TEXT ·f17584(SB), NOSPLIT, $12 - MOVSS x+0(FP), X0 - MOVSS y_real+4(FP), X0 - MOVSS y_imag+8(FP), X0 - RET diff --git a/src/cmd/vet/testdata/asm/asm2.s b/src/cmd/vet/testdata/asm/asm2.s deleted file mode 100644 index c33c02a70b27e..0000000000000 --- a/src/cmd/vet/testdata/asm/asm2.s +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build 386 -// +build vet_test - -TEXT ·arg1(SB),0,$0-2 - MOVB x+0(FP), AX - MOVB y+1(FP), BX - MOVW x+0(FP), AX // ERROR "\[386\] arg1: invalid MOVW of x\+0\(FP\); int8 is 1-byte value" - MOVW y+1(FP), AX // ERROR "invalid MOVW of y\+1\(FP\); uint8 is 1-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int8 is 1-byte value" - MOVL y+1(FP), AX // ERROR "invalid MOVL of y\+1\(FP\); uint8 is 1-byte value" - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int8 is 1-byte value" - MOVQ y+1(FP), AX // ERROR "invalid MOVQ of y\+1\(FP\); uint8 is 1-byte value" - MOVB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - MOVB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - TESTB x+0(FP), AX - TESTB y+1(FP), BX - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int8 is 1-byte value" - TESTW y+1(FP), AX // ERROR "invalid TESTW of y\+1\(FP\); uint8 is 1-byte value" - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int8 is 1-byte value" - TESTL y+1(FP), AX // ERROR "invalid TESTL of y\+1\(FP\); uint8 is 1-byte value" - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int8 is 1-byte value" - TESTQ y+1(FP), AX // ERROR "invalid TESTQ of y\+1\(FP\); uint8 is 1-byte value" - TESTB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - TESTB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - MOVB 4(SP), AX // ERROR "4\(SP\) should be x\+0\(FP\)" - MOVB 5(SP), AX // ERROR "5\(SP\) should be y\+1\(FP\)" - MOVB 6(SP), AX // ERROR "use of 6\(SP\) points beyond argument frame" - RET - -TEXT ·arg2(SB),0,$0-4 - MOVB x+0(FP), AX // ERROR "arg2: invalid MOVB of x\+0\(FP\); int16 is 2-byte value" - MOVB y+2(FP), AX // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" - MOVW x+0(FP), AX - MOVW y+2(FP), BX - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int16 is 2-byte value" - MOVL y+2(FP), AX // ERROR "invalid MOVL of y\+2\(FP\); uint16 is 2-byte value" - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int16 is 2-byte value" - MOVQ y+2(FP), AX // ERROR "invalid MOVQ of y\+2\(FP\); uint16 is 2-byte value" - MOVW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - MOVW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int16 is 2-byte value" - TESTB y+2(FP), AX // ERROR "invalid TESTB of y\+2\(FP\); uint16 is 2-byte value" - TESTW x+0(FP), AX - TESTW y+2(FP), BX - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int16 is 2-byte value" - TESTL y+2(FP), AX // ERROR "invalid TESTL of y\+2\(FP\); uint16 is 2-byte value" - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int16 is 2-byte value" - TESTQ y+2(FP), AX // ERROR "invalid TESTQ of y\+2\(FP\); uint16 is 2-byte value" - TESTW x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - TESTW y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - RET - -TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" - MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int32 is 4-byte value" - MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); uint32 is 4-byte value" - MOVL x+0(FP), AX - MOVL y+4(FP), AX - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int32 is 4-byte value" - MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); uint32 is 4-byte value" - MOVL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int32 is 4-byte value" - TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); uint32 is 4-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int32 is 4-byte value" - TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); uint32 is 4-byte value" - TESTL x+0(FP), AX - TESTL y+4(FP), AX - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int32 is 4-byte value" - TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); uint32 is 4-byte value" - TESTL x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - TESTL y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" - MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value" - MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value" - MOVL x+0(FP), AX // ERROR "invalid MOVL of x\+0\(FP\); int64 is 8-byte value containing x_lo\+0\(FP\) and x_hi\+4\(FP\)" - MOVL x_lo+0(FP), AX - MOVL x_hi+4(FP), AX - MOVL y+8(FP), AX // ERROR "invalid MOVL of y\+8\(FP\); uint64 is 8-byte value containing y_lo\+8\(FP\) and y_hi\+12\(FP\)" - MOVL y_lo+8(FP), AX - MOVL y_hi+12(FP), AX - MOVQ x+0(FP), AX - MOVQ y+8(FP), AX - MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int64 is 8-byte value" - TESTB y+8(FP), BX // ERROR "invalid TESTB of y\+8\(FP\); uint64 is 8-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int64 is 8-byte value" - TESTW y+8(FP), AX // ERROR "invalid TESTW of y\+8\(FP\); uint64 is 8-byte value" - TESTL x+0(FP), AX // ERROR "invalid TESTL of x\+0\(FP\); int64 is 8-byte value containing x_lo\+0\(FP\) and x_hi\+4\(FP\)" - TESTL y+8(FP), AX // ERROR "invalid TESTL of y\+8\(FP\); uint64 is 8-byte value containing y_lo\+8\(FP\) and y_hi\+12\(FP\)" - TESTQ x+0(FP), AX - TESTQ y+8(FP), AX - TESTQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int is 4-byte value" - MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint is 4-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int is 4-byte value" - MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); uint is 4-byte value" - MOVL x+0(FP), AX - MOVL y+4(FP), AX - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); int is 4-byte value" - MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); uint is 4-byte value" - MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); int is 4-byte value" - TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); uint is 4-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); int is 4-byte value" - TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); uint is 4-byte value" - TESTL x+0(FP), AX - TESTL y+4(FP), AX - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); int is 4-byte value" - TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); uint is 4-byte value" - TESTQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-20" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 4-byte value" - MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); \*byte is 4-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); \*byte is 4-byte value" - MOVW y+4(FP), AX // ERROR "invalid MOVW of y\+4\(FP\); \*byte is 4-byte value" - MOVL x+0(FP), AX - MOVL y+4(FP), AX - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); \*byte is 4-byte value" - MOVQ y+4(FP), AX // ERROR "invalid MOVQ of y\+4\(FP\); \*byte is 4-byte value" - MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - TESTB x+0(FP), AX // ERROR "invalid TESTB of x\+0\(FP\); \*byte is 4-byte value" - TESTB y+4(FP), BX // ERROR "invalid TESTB of y\+4\(FP\); \*byte is 4-byte value" - TESTW x+0(FP), AX // ERROR "invalid TESTW of x\+0\(FP\); \*byte is 4-byte value" - TESTW y+4(FP), AX // ERROR "invalid TESTW of y\+4\(FP\); \*byte is 4-byte value" - TESTL x+0(FP), AX - TESTL y+4(FP), AX - TESTQ x+0(FP), AX // ERROR "invalid TESTQ of x\+0\(FP\); \*byte is 4-byte value" - TESTQ y+4(FP), AX // ERROR "invalid TESTQ of y\+4\(FP\); \*byte is 4-byte value" - TESTQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - TESTQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - MOVW c+8(FP), AX // ERROR "invalid MOVW of c\+8\(FP\); chan int is 4-byte value" - MOVW m+12(FP), AX // ERROR "invalid MOVW of m\+12\(FP\); map\[int\]int is 4-byte value" - MOVW f+16(FP), AX // ERROR "invalid MOVW of f\+16\(FP\); func\(\) is 4-byte value" - RET - -TEXT ·argstring(SB),0,$16 // ERROR "wrong argument size 0; expected \$\.\.\.-16" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); string base is 4-byte value" - MOVL x+0(FP), AX - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); string base is 4-byte value" - MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); string base is 4-byte value" - MOVL x_base+0(FP), AX - MOVQ x_base+0(FP), AX // ERROR "invalid MOVQ of x_base\+0\(FP\); string base is 4-byte value" - MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVW x_len+4(FP), AX // ERROR "invalid MOVW of x_len\+4\(FP\); string len is 4-byte value" - MOVL x_len+4(FP), AX - MOVQ x_len+4(FP), AX // ERROR "invalid MOVQ of x_len\+4\(FP\); string len is 4-byte value" - MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+8\(FP\)" - MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+12\(FP\)" - RET - -TEXT ·argslice(SB),0,$24 // ERROR "wrong argument size 0; expected \$\.\.\.-24" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); slice base is 4-byte value" - MOVL x+0(FP), AX - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); slice base is 4-byte value" - MOVW x_base+0(FP), AX // ERROR "invalid MOVW of x_base\+0\(FP\); slice base is 4-byte value" - MOVL x_base+0(FP), AX - MOVQ x_base+0(FP), AX // ERROR "invalid MOVQ of x_base\+0\(FP\); slice base is 4-byte value" - MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVL x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVW x_len+4(FP), AX // ERROR "invalid MOVW of x_len\+4\(FP\); slice len is 4-byte value" - MOVL x_len+4(FP), AX - MOVQ x_len+4(FP), AX // ERROR "invalid MOVQ of x_len\+4\(FP\); slice len is 4-byte value" - MOVW x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVL x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVQ x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVW x_cap+8(FP), AX // ERROR "invalid MOVW of x_cap\+8\(FP\); slice cap is 4-byte value" - MOVL x_cap+8(FP), AX - MOVQ x_cap+8(FP), AX // ERROR "invalid MOVQ of x_cap\+8\(FP\); slice cap is 4-byte value" - MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+12\(FP\)" - MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+16\(FP\)" - MOVQ y_cap+8(FP), AX // ERROR "invalid offset y_cap\+8\(FP\); expected y_cap\+20\(FP\)" - RET - -TEXT ·argiface(SB),0,$0-16 - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); interface type is 4-byte value" - MOVL x+0(FP), AX - MOVQ x+0(FP), AX // ERROR "invalid MOVQ of x\+0\(FP\); interface type is 4-byte value" - MOVW x_type+0(FP), AX // ERROR "invalid MOVW of x_type\+0\(FP\); interface type is 4-byte value" - MOVL x_type+0(FP), AX - MOVQ x_type+0(FP), AX // ERROR "invalid MOVQ of x_type\+0\(FP\); interface type is 4-byte value" - MOVQ x_itable+0(FP), AX // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" - MOVQ x_itable+1(FP), AX // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" - MOVW x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVL x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVQ x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVW x_data+4(FP), AX // ERROR "invalid MOVW of x_data\+4\(FP\); interface data is 4-byte value" - MOVL x_data+4(FP), AX - MOVQ x_data+4(FP), AX // ERROR "invalid MOVQ of x_data\+4\(FP\); interface data is 4-byte value" - MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); interface itable is 4-byte value" - MOVL y+8(FP), AX - MOVQ y+8(FP), AX // ERROR "invalid MOVQ of y\+8\(FP\); interface itable is 4-byte value" - MOVW y_itable+8(FP), AX // ERROR "invalid MOVW of y_itable\+8\(FP\); interface itable is 4-byte value" - MOVL y_itable+8(FP), AX - MOVQ y_itable+8(FP), AX // ERROR "invalid MOVQ of y_itable\+8\(FP\); interface itable is 4-byte value" - MOVQ y_type+8(FP), AX // ERROR "unknown variable y_type; offset 8 is y_itable\+8\(FP\)" - MOVW y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVL y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVQ y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVW y_data+12(FP), AX // ERROR "invalid MOVW of y_data\+12\(FP\); interface data is 4-byte value" - MOVL y_data+12(FP), AX - MOVQ y_data+12(FP), AX // ERROR "invalid MOVQ of y_data\+12\(FP\); interface data is 4-byte value" - RET - -TEXT ·returnint(SB),0,$0-4 - MOVB AX, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 4-byte value" - MOVW AX, ret+0(FP) // ERROR "invalid MOVW of ret\+0\(FP\); int is 4-byte value" - MOVL AX, ret+0(FP) - MOVQ AX, ret+0(FP) // ERROR "invalid MOVQ of ret\+0\(FP\); int is 4-byte value" - MOVQ AX, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" - MOVQ AX, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" - RET - -TEXT ·returnbyte(SB),0,$0-5 - MOVL x+0(FP), AX - MOVB AX, ret+4(FP) - MOVW AX, ret+4(FP) // ERROR "invalid MOVW of ret\+4\(FP\); byte is 1-byte value" - MOVL AX, ret+4(FP) // ERROR "invalid MOVL of ret\+4\(FP\); byte is 1-byte value" - MOVQ AX, ret+4(FP) // ERROR "invalid MOVQ of ret\+4\(FP\); byte is 1-byte value" - MOVB AX, ret+3(FP) // ERROR "invalid offset ret\+3\(FP\); expected ret\+4\(FP\)" - RET - -TEXT ·returnnamed(SB),0,$0-21 - MOVB x+0(FP), AX - MOVL AX, r1+4(FP) - MOVW AX, r2+8(FP) - MOVL AX, r3+12(FP) - MOVL AX, r3_base+12(FP) - MOVL AX, r3_len+16(FP) - MOVB AX, r4+20(FP) - MOVQ AX, r1+4(FP) // ERROR "invalid MOVQ of r1\+4\(FP\); int is 4-byte value" - RET - -TEXT ·returnintmissing(SB),0,$0-4 - RET // ERROR "RET without writing to 4-byte ret\+0\(FP\)" diff --git a/src/cmd/vet/testdata/asm/asm3.s b/src/cmd/vet/testdata/asm/asm3.s deleted file mode 100644 index 83e53862d7d1b..0000000000000 --- a/src/cmd/vet/testdata/asm/asm3.s +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build arm -// +build vet_test - -TEXT ·arg1(SB),0,$0-2 - MOVB x+0(FP), AX - MOVB y+1(FP), BX - MOVH x+0(FP), AX // ERROR "\[arm\] arg1: invalid MOVH of x\+0\(FP\); int8 is 1-byte value" - MOVH y+1(FP), AX // ERROR "invalid MOVH of y\+1\(FP\); uint8 is 1-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int8 is 1-byte value" - MOVW y+1(FP), AX // ERROR "invalid MOVW of y\+1\(FP\); uint8 is 1-byte value" - MOVB x+1(FP), AX // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - MOVB y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - MOVB 8(R13), AX // ERROR "8\(R13\) should be x\+0\(FP\)" - MOVB 9(R13), AX // ERROR "9\(R13\) should be y\+1\(FP\)" - MOVB 10(R13), AX // ERROR "use of 10\(R13\) points beyond argument frame" - RET - -TEXT ·arg2(SB),0,$0-4 - MOVB x+0(FP), AX // ERROR "arg2: invalid MOVB of x\+0\(FP\); int16 is 2-byte value" - MOVB y+2(FP), AX // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" - MOVH x+0(FP), AX - MOVH y+2(FP), BX - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int16 is 2-byte value" - MOVW y+2(FP), AX // ERROR "invalid MOVW of y\+2\(FP\); uint16 is 2-byte value" - MOVH x+2(FP), AX // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - MOVH y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - RET - -TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" - MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" - MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); int32 is 4-byte value" - MOVH y+4(FP), AX // ERROR "invalid MOVH of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+0(FP), AX - MOVW y+4(FP), AX - MOVW x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVW y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" - MOVB y+8(FP), BX // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" - MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); int64 is 8-byte value" - MOVH y+8(FP), AX // ERROR "invalid MOVH of y\+8\(FP\); uint64 is 8-byte value" - MOVW x+0(FP), AX // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value containing x_lo\+0\(FP\) and x_hi\+4\(FP\)" - MOVW x_lo+0(FP), AX - MOVW x_hi+4(FP), AX - MOVW y+8(FP), AX // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value containing y_lo\+8\(FP\) and y_hi\+12\(FP\)" - MOVW y_lo+8(FP), AX - MOVW y_hi+12(FP), AX - MOVQ x+0(FP), AX - MOVQ y+8(FP), AX - MOVQ x+8(FP), AX // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); int is 4-byte value" - MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); uint is 4-byte value" - MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); int is 4-byte value" - MOVH y+4(FP), AX // ERROR "invalid MOVH of y\+4\(FP\); uint is 4-byte value" - MOVW x+0(FP), AX - MOVW y+4(FP), AX - MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-20" - MOVB x+0(FP), AX // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 4-byte value" - MOVB y+4(FP), BX // ERROR "invalid MOVB of y\+4\(FP\); \*byte is 4-byte value" - MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); \*byte is 4-byte value" - MOVH y+4(FP), AX // ERROR "invalid MOVH of y\+4\(FP\); \*byte is 4-byte value" - MOVW x+0(FP), AX - MOVW y+4(FP), AX - MOVQ x+4(FP), AX // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVQ y+2(FP), AX // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - MOVH c+8(FP), AX // ERROR "invalid MOVH of c\+8\(FP\); chan int is 4-byte value" - MOVH m+12(FP), AX // ERROR "invalid MOVH of m\+12\(FP\); map\[int\]int is 4-byte value" - MOVH f+16(FP), AX // ERROR "invalid MOVH of f\+16\(FP\); func\(\) is 4-byte value" - RET - -TEXT ·argstring(SB),0,$16 // ERROR "wrong argument size 0; expected \$\.\.\.-16" - MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); string base is 4-byte value" - MOVW x+0(FP), AX - MOVH x_base+0(FP), AX // ERROR "invalid MOVH of x_base\+0\(FP\); string base is 4-byte value" - MOVW x_base+0(FP), AX - MOVH x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVH x_len+4(FP), AX // ERROR "invalid MOVH of x_len\+4\(FP\); string len is 4-byte value" - MOVW x_len+4(FP), AX - MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+8\(FP\)" - MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+12\(FP\)" - RET - -TEXT ·argslice(SB),0,$24 // ERROR "wrong argument size 0; expected \$\.\.\.-24" - MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); slice base is 4-byte value" - MOVW x+0(FP), AX - MOVH x_base+0(FP), AX // ERROR "invalid MOVH of x_base\+0\(FP\); slice base is 4-byte value" - MOVW x_base+0(FP), AX - MOVH x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVW x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVQ x_len+0(FP), AX // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVH x_len+4(FP), AX // ERROR "invalid MOVH of x_len\+4\(FP\); slice len is 4-byte value" - MOVW x_len+4(FP), AX - MOVH x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVW x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVQ x_cap+0(FP), AX // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVH x_cap+8(FP), AX // ERROR "invalid MOVH of x_cap\+8\(FP\); slice cap is 4-byte value" - MOVW x_cap+8(FP), AX - MOVQ y+0(FP), AX // ERROR "invalid offset y\+0\(FP\); expected y\+12\(FP\)" - MOVQ y_len+4(FP), AX // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+16\(FP\)" - MOVQ y_cap+8(FP), AX // ERROR "invalid offset y_cap\+8\(FP\); expected y_cap\+20\(FP\)" - RET - -TEXT ·argiface(SB),0,$0-16 - MOVH x+0(FP), AX // ERROR "invalid MOVH of x\+0\(FP\); interface type is 4-byte value" - MOVW x+0(FP), AX - MOVH x_type+0(FP), AX // ERROR "invalid MOVH of x_type\+0\(FP\); interface type is 4-byte value" - MOVW x_type+0(FP), AX - MOVQ x_itable+0(FP), AX // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" - MOVQ x_itable+1(FP), AX // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" - MOVH x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVW x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVQ x_data+0(FP), AX // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVH x_data+4(FP), AX // ERROR "invalid MOVH of x_data\+4\(FP\); interface data is 4-byte value" - MOVW x_data+4(FP), AX - MOVH y+8(FP), AX // ERROR "invalid MOVH of y\+8\(FP\); interface itable is 4-byte value" - MOVW y+8(FP), AX - MOVH y_itable+8(FP), AX // ERROR "invalid MOVH of y_itable\+8\(FP\); interface itable is 4-byte value" - MOVW y_itable+8(FP), AX - MOVQ y_type+8(FP), AX // ERROR "unknown variable y_type; offset 8 is y_itable\+8\(FP\)" - MOVH y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVW y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVQ y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVH y_data+12(FP), AX // ERROR "invalid MOVH of y_data\+12\(FP\); interface data is 4-byte value" - MOVW y_data+12(FP), AX - RET - -TEXT ·returnint(SB),0,$0-4 - MOVB AX, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 4-byte value" - MOVH AX, ret+0(FP) // ERROR "invalid MOVH of ret\+0\(FP\); int is 4-byte value" - MOVW AX, ret+0(FP) - MOVQ AX, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" - MOVQ AX, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" - RET - -TEXT ·returnbyte(SB),0,$0-5 - MOVW x+0(FP), AX - MOVB AX, ret+4(FP) - MOVH AX, ret+4(FP) // ERROR "invalid MOVH of ret\+4\(FP\); byte is 1-byte value" - MOVW AX, ret+4(FP) // ERROR "invalid MOVW of ret\+4\(FP\); byte is 1-byte value" - MOVB AX, ret+3(FP) // ERROR "invalid offset ret\+3\(FP\); expected ret\+4\(FP\)" - RET - -TEXT ·returnnamed(SB),0,$0-21 - MOVB x+0(FP), AX - MOVW AX, r1+4(FP) - MOVH AX, r2+8(FP) - MOVW AX, r3+12(FP) - MOVW AX, r3_base+12(FP) - MOVW AX, r3_len+16(FP) - MOVB AX, r4+20(FP) - MOVB AX, r1+4(FP) // ERROR "invalid MOVB of r1\+4\(FP\); int is 4-byte value" - RET - -TEXT ·returnintmissing(SB),0,$0-4 - RET // ERROR "RET without writing to 4-byte ret\+0\(FP\)" - -TEXT ·leaf(SB),0,$-4-12 - MOVW x+0(FP), AX - MOVW y+4(FP), AX - MOVW AX, ret+8(FP) - RET - -TEXT ·noframe1(SB),0,$0-4 - MOVW 0(R13), AX // Okay; our saved LR - MOVW 4(R13), AX // Okay; caller's saved LR - MOVW x+8(R13), AX // Okay; x argument - MOVW 12(R13), AX // ERROR "use of 12\(R13\) points beyond argument frame" - RET - -TEXT ·noframe2(SB),NOFRAME,$0-4 - MOVW 0(R13), AX // Okay; caller's saved LR - MOVW x+4(R13), AX // Okay; x argument - MOVW 8(R13), AX // ERROR "use of 8\(R13\) points beyond argument frame" - MOVW 12(R13), AX // ERROR "use of 12\(R13\) points beyond argument frame" - RET diff --git a/src/cmd/vet/testdata/asm/asm4.s b/src/cmd/vet/testdata/asm/asm4.s deleted file mode 100644 index 044b050b6b99e..0000000000000 --- a/src/cmd/vet/testdata/asm/asm4.s +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build amd64 -// +build vet_test - -// Test cases for symbolic NOSPLIT etc. on TEXT symbols. - -TEXT ·noprof(SB),NOPROF,$0-8 - RET - -TEXT ·dupok(SB),DUPOK,$0-8 - RET - -TEXT ·nosplit(SB),NOSPLIT,$0 - RET - -TEXT ·rodata(SB),RODATA,$0-8 - RET - -TEXT ·noptr(SB),NOPTR|NOSPLIT,$0 - RET - -TEXT ·wrapper(SB),WRAPPER,$0-8 - RET diff --git a/src/cmd/vet/testdata/asm/asm5.s b/src/cmd/vet/testdata/asm/asm5.s deleted file mode 100644 index c6176e9669f57..0000000000000 --- a/src/cmd/vet/testdata/asm/asm5.s +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build mips64 -// +build vet_test - -TEXT ·arg1(SB),0,$0-2 - MOVB x+0(FP), R1 - MOVBU y+1(FP), R2 - MOVH x+0(FP), R1 // ERROR "\[mips64\] arg1: invalid MOVH of x\+0\(FP\); int8 is 1-byte value" - MOVHU y+1(FP), R1 // ERROR "invalid MOVHU of y\+1\(FP\); uint8 is 1-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int8 is 1-byte value" - MOVWU y+1(FP), R1 // ERROR "invalid MOVWU of y\+1\(FP\); uint8 is 1-byte value" - MOVV x+0(FP), R1 // ERROR "invalid MOVV of x\+0\(FP\); int8 is 1-byte value" - MOVV y+1(FP), R1 // ERROR "invalid MOVV of y\+1\(FP\); uint8 is 1-byte value" - MOVB x+1(FP), R1 // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - MOVBU y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - MOVB 16(R29), R1 // ERROR "16\(R29\) should be x\+0\(FP\)" - MOVB 17(R29), R1 // ERROR "17\(R29\) should be y\+1\(FP\)" - MOVB 18(R29), R1 // ERROR "use of 18\(R29\) points beyond argument frame" - RET - -TEXT ·arg2(SB),0,$0-4 - MOVBU x+0(FP), R1 // ERROR "arg2: invalid MOVBU of x\+0\(FP\); int16 is 2-byte value" - MOVB y+2(FP), R1 // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" - MOVHU x+0(FP), R1 - MOVH y+2(FP), R2 - MOVWU x+0(FP), R1 // ERROR "invalid MOVWU of x\+0\(FP\); int16 is 2-byte value" - MOVW y+2(FP), R1 // ERROR "invalid MOVW of y\+2\(FP\); uint16 is 2-byte value" - MOVV x+0(FP), R1 // ERROR "invalid MOVV of x\+0\(FP\); int16 is 2-byte value" - MOVV y+2(FP), R1 // ERROR "invalid MOVV of y\+2\(FP\); uint16 is 2-byte value" - MOVHU x+2(FP), R1 // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - MOVH y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - RET - -TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" - MOVB y+4(FP), R2 // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int32 is 4-byte value" - MOVH y+4(FP), R1 // ERROR "invalid MOVH of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+0(FP), R1 - MOVW y+4(FP), R1 - MOVV x+0(FP), R1 // ERROR "invalid MOVV of x\+0\(FP\); int32 is 4-byte value" - MOVV y+4(FP), R1 // ERROR "invalid MOVV of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+4(FP), R1 // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVW y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" - MOVB y+8(FP), R2 // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int64 is 8-byte value" - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); uint64 is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value" - MOVW y+8(FP), R1 // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value" - MOVV x+0(FP), R1 - MOVV y+8(FP), R1 - MOVV x+8(FP), R1 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVV y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int is 8-byte value" - MOVB y+8(FP), R2 // ERROR "invalid MOVB of y\+8\(FP\); uint is 8-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int is 8-byte value" - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); uint is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int is 8-byte value" - MOVW y+8(FP), R1 // ERROR "invalid MOVW of y\+8\(FP\); uint is 8-byte value" - MOVV x+0(FP), R1 - MOVV y+8(FP), R1 - MOVV x+8(FP), R1 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVV y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-40" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 8-byte value" - MOVB y+8(FP), R2 // ERROR "invalid MOVB of y\+8\(FP\); \*byte is 8-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); \*byte is 8-byte value" - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); \*byte is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); \*byte is 8-byte value" - MOVW y+8(FP), R1 // ERROR "invalid MOVW of y\+8\(FP\); \*byte is 8-byte value" - MOVV x+0(FP), R1 - MOVV y+8(FP), R1 - MOVV x+8(FP), R1 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVV y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - MOVW c+16(FP), R1 // ERROR "invalid MOVW of c\+16\(FP\); chan int is 8-byte value" - MOVW m+24(FP), R1 // ERROR "invalid MOVW of m\+24\(FP\); map\[int\]int is 8-byte value" - MOVW f+32(FP), R1 // ERROR "invalid MOVW of f\+32\(FP\); func\(\) is 8-byte value" - RET - -TEXT ·argstring(SB),0,$32 // ERROR "wrong argument size 0; expected \$\.\.\.-32" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); string base is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); string base is 8-byte value" - MOVV x+0(FP), R1 - MOVH x_base+0(FP), R1 // ERROR "invalid MOVH of x_base\+0\(FP\); string base is 8-byte value" - MOVW x_base+0(FP), R1 // ERROR "invalid MOVW of x_base\+0\(FP\); string base is 8-byte value" - MOVV x_base+0(FP), R1 - MOVH x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVV x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVH x_len+8(FP), R1 // ERROR "invalid MOVH of x_len\+8\(FP\); string len is 8-byte value" - MOVW x_len+8(FP), R1 // ERROR "invalid MOVW of x_len\+8\(FP\); string len is 8-byte value" - MOVV x_len+8(FP), R1 - MOVV y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+16\(FP\)" - MOVV y_len+8(FP), R1 // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+24\(FP\)" - RET - -TEXT ·argslice(SB),0,$48 // ERROR "wrong argument size 0; expected \$\.\.\.-48" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); slice base is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); slice base is 8-byte value" - MOVV x+0(FP), R1 - MOVH x_base+0(FP), R1 // ERROR "invalid MOVH of x_base\+0\(FP\); slice base is 8-byte value" - MOVW x_base+0(FP), R1 // ERROR "invalid MOVW of x_base\+0\(FP\); slice base is 8-byte value" - MOVV x_base+0(FP), R1 - MOVH x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVV x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVH x_len+8(FP), R1 // ERROR "invalid MOVH of x_len\+8\(FP\); slice len is 8-byte value" - MOVW x_len+8(FP), R1 // ERROR "invalid MOVW of x_len\+8\(FP\); slice len is 8-byte value" - MOVV x_len+8(FP), R1 - MOVH x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVW x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVV x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVH x_cap+16(FP), R1 // ERROR "invalid MOVH of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVW x_cap+16(FP), R1 // ERROR "invalid MOVW of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVV x_cap+16(FP), R1 - MOVV y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+24\(FP\)" - MOVV y_len+8(FP), R1 // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+32\(FP\)" - MOVV y_cap+16(FP), R1 // ERROR "invalid offset y_cap\+16\(FP\); expected y_cap\+40\(FP\)" - RET - -TEXT ·argiface(SB),0,$0-32 - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); interface type is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); interface type is 8-byte value" - MOVV x+0(FP), R1 - MOVH x_type+0(FP), R1 // ERROR "invalid MOVH of x_type\+0\(FP\); interface type is 8-byte value" - MOVW x_type+0(FP), R1 // ERROR "invalid MOVW of x_type\+0\(FP\); interface type is 8-byte value" - MOVV x_type+0(FP), R1 - MOVV x_itable+0(FP), R1 // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" - MOVV x_itable+1(FP), R1 // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" - MOVH x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVW x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVV x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVH x_data+8(FP), R1 // ERROR "invalid MOVH of x_data\+8\(FP\); interface data is 8-byte value" - MOVW x_data+8(FP), R1 // ERROR "invalid MOVW of x_data\+8\(FP\); interface data is 8-byte value" - MOVV x_data+8(FP), R1 - MOVH y+16(FP), R1 // ERROR "invalid MOVH of y\+16\(FP\); interface itable is 8-byte value" - MOVW y+16(FP), R1 // ERROR "invalid MOVW of y\+16\(FP\); interface itable is 8-byte value" - MOVV y+16(FP), R1 - MOVH y_itable+16(FP), R1 // ERROR "invalid MOVH of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVW y_itable+16(FP), R1 // ERROR "invalid MOVW of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVV y_itable+16(FP), R1 - MOVV y_type+16(FP), R1 // ERROR "unknown variable y_type; offset 16 is y_itable\+16\(FP\)" - MOVH y_data+16(FP), R1 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVW y_data+16(FP), R1 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVV y_data+16(FP), R1 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVH y_data+24(FP), R1 // ERROR "invalid MOVH of y_data\+24\(FP\); interface data is 8-byte value" - MOVW y_data+24(FP), R1 // ERROR "invalid MOVW of y_data\+24\(FP\); interface data is 8-byte value" - MOVV y_data+24(FP), R1 - RET - -TEXT ·returnint(SB),0,$0-8 - MOVB R1, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 8-byte value" - MOVH R1, ret+0(FP) // ERROR "invalid MOVH of ret\+0\(FP\); int is 8-byte value" - MOVW R1, ret+0(FP) // ERROR "invalid MOVW of ret\+0\(FP\); int is 8-byte value" - MOVV R1, ret+0(FP) - MOVV R1, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" - MOVV R1, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" - RET - -TEXT ·returnbyte(SB),0,$0-9 - MOVV x+0(FP), R1 - MOVB R1, ret+8(FP) - MOVH R1, ret+8(FP) // ERROR "invalid MOVH of ret\+8\(FP\); byte is 1-byte value" - MOVW R1, ret+8(FP) // ERROR "invalid MOVW of ret\+8\(FP\); byte is 1-byte value" - MOVV R1, ret+8(FP) // ERROR "invalid MOVV of ret\+8\(FP\); byte is 1-byte value" - MOVB R1, ret+7(FP) // ERROR "invalid offset ret\+7\(FP\); expected ret\+8\(FP\)" - RET - -TEXT ·returnnamed(SB),0,$0-41 - MOVB x+0(FP), R1 - MOVV R1, r1+8(FP) - MOVH R1, r2+16(FP) - MOVV R1, r3+24(FP) - MOVV R1, r3_base+24(FP) - MOVV R1, r3_len+32(FP) - MOVB R1, r4+40(FP) - MOVW R1, r1+8(FP) // ERROR "invalid MOVW of r1\+8\(FP\); int is 8-byte value" - RET - -TEXT ·returnintmissing(SB),0,$0-8 - RET // ERROR "RET without writing to 8-byte ret\+0\(FP\)" diff --git a/src/cmd/vet/testdata/asm/asm6.s b/src/cmd/vet/testdata/asm/asm6.s deleted file mode 100644 index 4e85ab3dcf967..0000000000000 --- a/src/cmd/vet/testdata/asm/asm6.s +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build s390x -// +build vet_test - -TEXT ·arg1(SB),0,$0-2 - MOVB x+0(FP), R1 - MOVBZ y+1(FP), R2 - MOVH x+0(FP), R1 // ERROR "\[s390x\] arg1: invalid MOVH of x\+0\(FP\); int8 is 1-byte value" - MOVHZ y+1(FP), R1 // ERROR "invalid MOVHZ of y\+1\(FP\); uint8 is 1-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int8 is 1-byte value" - MOVWZ y+1(FP), R1 // ERROR "invalid MOVWZ of y\+1\(FP\); uint8 is 1-byte value" - MOVD x+0(FP), R1 // ERROR "invalid MOVD of x\+0\(FP\); int8 is 1-byte value" - MOVD y+1(FP), R1 // ERROR "invalid MOVD of y\+1\(FP\); uint8 is 1-byte value" - MOVB x+1(FP), R1 // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - MOVBZ y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - MOVB 16(R15), R1 // ERROR "16\(R15\) should be x\+0\(FP\)" - MOVB 17(R15), R1 // ERROR "17\(R15\) should be y\+1\(FP\)" - MOVB 18(R15), R1 // ERROR "use of 18\(R15\) points beyond argument frame" - RET - -TEXT ·arg2(SB),0,$0-4 - MOVBZ x+0(FP), R1 // ERROR "arg2: invalid MOVBZ of x\+0\(FP\); int16 is 2-byte value" - MOVB y+2(FP), R1 // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" - MOVHZ x+0(FP), R1 - MOVH y+2(FP), R2 - MOVWZ x+0(FP), R1 // ERROR "invalid MOVWZ of x\+0\(FP\); int16 is 2-byte value" - MOVW y+2(FP), R1 // ERROR "invalid MOVW of y\+2\(FP\); uint16 is 2-byte value" - MOVD x+0(FP), R1 // ERROR "invalid MOVD of x\+0\(FP\); int16 is 2-byte value" - MOVD y+2(FP), R1 // ERROR "invalid MOVD of y\+2\(FP\); uint16 is 2-byte value" - MOVHZ x+2(FP), R1 // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - MOVH y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - RET - -TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" - MOVB y+4(FP), R2 // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int32 is 4-byte value" - MOVH y+4(FP), R1 // ERROR "invalid MOVH of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+0(FP), R1 - MOVW y+4(FP), R1 - MOVD x+0(FP), R1 // ERROR "invalid MOVD of x\+0\(FP\); int32 is 4-byte value" - MOVD y+4(FP), R1 // ERROR "invalid MOVD of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+4(FP), R1 // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVW y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" - MOVB y+8(FP), R2 // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int64 is 8-byte value" - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); uint64 is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value" - MOVW y+8(FP), R1 // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value" - MOVD x+0(FP), R1 - MOVD y+8(FP), R1 - MOVD x+8(FP), R1 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVD y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int is 8-byte value" - MOVB y+8(FP), R2 // ERROR "invalid MOVB of y\+8\(FP\); uint is 8-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int is 8-byte value" - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); uint is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int is 8-byte value" - MOVW y+8(FP), R1 // ERROR "invalid MOVW of y\+8\(FP\); uint is 8-byte value" - MOVD x+0(FP), R1 - MOVD y+8(FP), R1 - MOVD x+8(FP), R1 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVD y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-40" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 8-byte value" - MOVB y+8(FP), R2 // ERROR "invalid MOVB of y\+8\(FP\); \*byte is 8-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); \*byte is 8-byte value" - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); \*byte is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); \*byte is 8-byte value" - MOVW y+8(FP), R1 // ERROR "invalid MOVW of y\+8\(FP\); \*byte is 8-byte value" - MOVD x+0(FP), R1 - MOVD y+8(FP), R1 - MOVD x+8(FP), R1 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVD y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - MOVW c+16(FP), R1 // ERROR "invalid MOVW of c\+16\(FP\); chan int is 8-byte value" - MOVW m+24(FP), R1 // ERROR "invalid MOVW of m\+24\(FP\); map\[int\]int is 8-byte value" - MOVW f+32(FP), R1 // ERROR "invalid MOVW of f\+32\(FP\); func\(\) is 8-byte value" - RET - -TEXT ·argstring(SB),0,$32 // ERROR "wrong argument size 0; expected \$\.\.\.-32" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); string base is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); string base is 8-byte value" - MOVD x+0(FP), R1 - MOVH x_base+0(FP), R1 // ERROR "invalid MOVH of x_base\+0\(FP\); string base is 8-byte value" - MOVW x_base+0(FP), R1 // ERROR "invalid MOVW of x_base\+0\(FP\); string base is 8-byte value" - MOVD x_base+0(FP), R1 - MOVH x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVD x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVH x_len+8(FP), R1 // ERROR "invalid MOVH of x_len\+8\(FP\); string len is 8-byte value" - MOVW x_len+8(FP), R1 // ERROR "invalid MOVW of x_len\+8\(FP\); string len is 8-byte value" - MOVD x_len+8(FP), R1 - MOVD y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+16\(FP\)" - MOVD y_len+8(FP), R1 // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+24\(FP\)" - RET - -TEXT ·argslice(SB),0,$48 // ERROR "wrong argument size 0; expected \$\.\.\.-48" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); slice base is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); slice base is 8-byte value" - MOVD x+0(FP), R1 - MOVH x_base+0(FP), R1 // ERROR "invalid MOVH of x_base\+0\(FP\); slice base is 8-byte value" - MOVW x_base+0(FP), R1 // ERROR "invalid MOVW of x_base\+0\(FP\); slice base is 8-byte value" - MOVD x_base+0(FP), R1 - MOVH x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVD x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVH x_len+8(FP), R1 // ERROR "invalid MOVH of x_len\+8\(FP\); slice len is 8-byte value" - MOVW x_len+8(FP), R1 // ERROR "invalid MOVW of x_len\+8\(FP\); slice len is 8-byte value" - MOVD x_len+8(FP), R1 - MOVH x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVW x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVD x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVH x_cap+16(FP), R1 // ERROR "invalid MOVH of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVW x_cap+16(FP), R1 // ERROR "invalid MOVW of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVD x_cap+16(FP), R1 - MOVD y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+24\(FP\)" - MOVD y_len+8(FP), R1 // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+32\(FP\)" - MOVD y_cap+16(FP), R1 // ERROR "invalid offset y_cap\+16\(FP\); expected y_cap\+40\(FP\)" - RET - -TEXT ·argiface(SB),0,$0-32 - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); interface type is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); interface type is 8-byte value" - MOVD x+0(FP), R1 - MOVH x_type+0(FP), R1 // ERROR "invalid MOVH of x_type\+0\(FP\); interface type is 8-byte value" - MOVW x_type+0(FP), R1 // ERROR "invalid MOVW of x_type\+0\(FP\); interface type is 8-byte value" - MOVD x_type+0(FP), R1 - MOVD x_itable+0(FP), R1 // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" - MOVD x_itable+1(FP), R1 // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" - MOVH x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVW x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVD x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVH x_data+8(FP), R1 // ERROR "invalid MOVH of x_data\+8\(FP\); interface data is 8-byte value" - MOVW x_data+8(FP), R1 // ERROR "invalid MOVW of x_data\+8\(FP\); interface data is 8-byte value" - MOVD x_data+8(FP), R1 - MOVH y+16(FP), R1 // ERROR "invalid MOVH of y\+16\(FP\); interface itable is 8-byte value" - MOVW y+16(FP), R1 // ERROR "invalid MOVW of y\+16\(FP\); interface itable is 8-byte value" - MOVD y+16(FP), R1 - MOVH y_itable+16(FP), R1 // ERROR "invalid MOVH of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVW y_itable+16(FP), R1 // ERROR "invalid MOVW of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVD y_itable+16(FP), R1 - MOVD y_type+16(FP), R1 // ERROR "unknown variable y_type; offset 16 is y_itable\+16\(FP\)" - MOVH y_data+16(FP), R1 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVW y_data+16(FP), R1 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVD y_data+16(FP), R1 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVH y_data+24(FP), R1 // ERROR "invalid MOVH of y_data\+24\(FP\); interface data is 8-byte value" - MOVW y_data+24(FP), R1 // ERROR "invalid MOVW of y_data\+24\(FP\); interface data is 8-byte value" - MOVD y_data+24(FP), R1 - RET - -TEXT ·returnint(SB),0,$0-8 - MOVB R1, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 8-byte value" - MOVH R1, ret+0(FP) // ERROR "invalid MOVH of ret\+0\(FP\); int is 8-byte value" - MOVW R1, ret+0(FP) // ERROR "invalid MOVW of ret\+0\(FP\); int is 8-byte value" - MOVD R1, ret+0(FP) - MOVD R1, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" - MOVD R1, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" - RET - -TEXT ·returnbyte(SB),0,$0-9 - MOVD x+0(FP), R1 - MOVB R1, ret+8(FP) - MOVH R1, ret+8(FP) // ERROR "invalid MOVH of ret\+8\(FP\); byte is 1-byte value" - MOVW R1, ret+8(FP) // ERROR "invalid MOVW of ret\+8\(FP\); byte is 1-byte value" - MOVD R1, ret+8(FP) // ERROR "invalid MOVD of ret\+8\(FP\); byte is 1-byte value" - MOVB R1, ret+7(FP) // ERROR "invalid offset ret\+7\(FP\); expected ret\+8\(FP\)" - RET - -TEXT ·returnnamed(SB),0,$0-41 - MOVB x+0(FP), R1 - MOVD R1, r1+8(FP) - MOVH R1, r2+16(FP) - MOVD R1, r3+24(FP) - MOVD R1, r3_base+24(FP) - MOVD R1, r3_len+32(FP) - MOVB R1, r4+40(FP) - MOVW R1, r1+8(FP) // ERROR "invalid MOVW of r1\+8\(FP\); int is 8-byte value" - RET - -TEXT ·returnintmissing(SB),0,$0-8 - RET // ERROR "RET without writing to 8-byte ret\+0\(FP\)" diff --git a/src/cmd/vet/testdata/asm/asm7.s b/src/cmd/vet/testdata/asm/asm7.s deleted file mode 100644 index d5ff5460a565d..0000000000000 --- a/src/cmd/vet/testdata/asm/asm7.s +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ppc64 ppc64le -// +build vet_test - -TEXT ·arg1(SB),0,$0-2 - MOVB x+0(FP), R3 - MOVBZ y+1(FP), R4 - MOVH x+0(FP), R3 // ERROR "\[(ppc64|ppc64le)\] arg1: invalid MOVH of x\+0\(FP\); int8 is 1-byte value" - MOVHZ y+1(FP), R3 // ERROR "invalid MOVHZ of y\+1\(FP\); uint8 is 1-byte value" - MOVW x+0(FP), R3 // ERROR "invalid MOVW of x\+0\(FP\); int8 is 1-byte value" - MOVWZ y+1(FP), R3 // ERROR "invalid MOVWZ of y\+1\(FP\); uint8 is 1-byte value" - MOVD x+0(FP), R3 // ERROR "invalid MOVD of x\+0\(FP\); int8 is 1-byte value" - MOVD y+1(FP), R3 // ERROR "invalid MOVD of y\+1\(FP\); uint8 is 1-byte value" - MOVB x+1(FP), R3 // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - MOVBZ y+2(FP), R3 // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - MOVB 16(R1), R3 // ERROR "16\(R1\) should be x\+0\(FP\)" - MOVB 17(R1), R3 // ERROR "17\(R1\) should be y\+1\(FP\)" - MOVB 18(R1), R3 // ERROR "use of 18\(R1\) points beyond argument frame" - RET - -TEXT ·arg2(SB),0,$0-4 - MOVBZ x+0(FP), R3 // ERROR "arg2: invalid MOVBZ of x\+0\(FP\); int16 is 2-byte value" - MOVB y+2(FP), R3 // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" - MOVHZ x+0(FP), R3 - MOVH y+2(FP), R4 - MOVWZ x+0(FP), R3 // ERROR "invalid MOVWZ of x\+0\(FP\); int16 is 2-byte value" - MOVW y+2(FP), R3 // ERROR "invalid MOVW of y\+2\(FP\); uint16 is 2-byte value" - MOVD x+0(FP), R3 // ERROR "invalid MOVD of x\+0\(FP\); int16 is 2-byte value" - MOVD y+2(FP), R3 // ERROR "invalid MOVD of y\+2\(FP\); uint16 is 2-byte value" - MOVHZ x+2(FP), R3 // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - MOVH y+0(FP), R3 // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - RET - -TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), R3 // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" - MOVB y+4(FP), R4 // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" - MOVH x+0(FP), R3 // ERROR "invalid MOVH of x\+0\(FP\); int32 is 4-byte value" - MOVH y+4(FP), R3 // ERROR "invalid MOVH of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+0(FP), R3 - MOVW y+4(FP), R3 - MOVD x+0(FP), R3 // ERROR "invalid MOVD of x\+0\(FP\); int32 is 4-byte value" - MOVD y+4(FP), R3 // ERROR "invalid MOVD of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+4(FP), R3 // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVW y+2(FP), R3 // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), R3 // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" - MOVB y+8(FP), R4 // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" - MOVH x+0(FP), R3 // ERROR "invalid MOVH of x\+0\(FP\); int64 is 8-byte value" - MOVH y+8(FP), R3 // ERROR "invalid MOVH of y\+8\(FP\); uint64 is 8-byte value" - MOVW x+0(FP), R3 // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value" - MOVW y+8(FP), R3 // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value" - MOVD x+0(FP), R3 - MOVD y+8(FP), R3 - MOVD x+8(FP), R3 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVD y+2(FP), R3 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), R3 // ERROR "invalid MOVB of x\+0\(FP\); int is 8-byte value" - MOVB y+8(FP), R4 // ERROR "invalid MOVB of y\+8\(FP\); uint is 8-byte value" - MOVH x+0(FP), R3 // ERROR "invalid MOVH of x\+0\(FP\); int is 8-byte value" - MOVH y+8(FP), R3 // ERROR "invalid MOVH of y\+8\(FP\); uint is 8-byte value" - MOVW x+0(FP), R3 // ERROR "invalid MOVW of x\+0\(FP\); int is 8-byte value" - MOVW y+8(FP), R3 // ERROR "invalid MOVW of y\+8\(FP\); uint is 8-byte value" - MOVD x+0(FP), R3 - MOVD y+8(FP), R3 - MOVD x+8(FP), R3 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVD y+2(FP), R3 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - RET - -TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-40" - MOVB x+0(FP), R3 // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 8-byte value" - MOVB y+8(FP), R4 // ERROR "invalid MOVB of y\+8\(FP\); \*byte is 8-byte value" - MOVH x+0(FP), R3 // ERROR "invalid MOVH of x\+0\(FP\); \*byte is 8-byte value" - MOVH y+8(FP), R3 // ERROR "invalid MOVH of y\+8\(FP\); \*byte is 8-byte value" - MOVW x+0(FP), R3 // ERROR "invalid MOVW of x\+0\(FP\); \*byte is 8-byte value" - MOVW y+8(FP), R3 // ERROR "invalid MOVW of y\+8\(FP\); \*byte is 8-byte value" - MOVD x+0(FP), R3 - MOVD y+8(FP), R3 - MOVD x+8(FP), R3 // ERROR "invalid offset x\+8\(FP\); expected x\+0\(FP\)" - MOVD y+2(FP), R3 // ERROR "invalid offset y\+2\(FP\); expected y\+8\(FP\)" - MOVW c+16(FP), R3 // ERROR "invalid MOVW of c\+16\(FP\); chan int is 8-byte value" - MOVW m+24(FP), R3 // ERROR "invalid MOVW of m\+24\(FP\); map\[int\]int is 8-byte value" - MOVW f+32(FP), R3 // ERROR "invalid MOVW of f\+32\(FP\); func\(\) is 8-byte value" - RET - -TEXT ·argstring(SB),0,$32 // ERROR "wrong argument size 0; expected \$\.\.\.-32" - MOVH x+0(FP), R3 // ERROR "invalid MOVH of x\+0\(FP\); string base is 8-byte value" - MOVW x+0(FP), R3 // ERROR "invalid MOVW of x\+0\(FP\); string base is 8-byte value" - MOVD x+0(FP), R3 - MOVH x_base+0(FP), R3 // ERROR "invalid MOVH of x_base\+0\(FP\); string base is 8-byte value" - MOVW x_base+0(FP), R3 // ERROR "invalid MOVW of x_base\+0\(FP\); string base is 8-byte value" - MOVD x_base+0(FP), R3 - MOVH x_len+0(FP), R3 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+0(FP), R3 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVD x_len+0(FP), R3 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVH x_len+8(FP), R3 // ERROR "invalid MOVH of x_len\+8\(FP\); string len is 8-byte value" - MOVW x_len+8(FP), R3 // ERROR "invalid MOVW of x_len\+8\(FP\); string len is 8-byte value" - MOVD x_len+8(FP), R3 - MOVD y+0(FP), R3 // ERROR "invalid offset y\+0\(FP\); expected y\+16\(FP\)" - MOVD y_len+8(FP), R3 // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+24\(FP\)" - RET - -TEXT ·argslice(SB),0,$48 // ERROR "wrong argument size 0; expected \$\.\.\.-48" - MOVH x+0(FP), R3 // ERROR "invalid MOVH of x\+0\(FP\); slice base is 8-byte value" - MOVW x+0(FP), R3 // ERROR "invalid MOVW of x\+0\(FP\); slice base is 8-byte value" - MOVD x+0(FP), R3 - MOVH x_base+0(FP), R3 // ERROR "invalid MOVH of x_base\+0\(FP\); slice base is 8-byte value" - MOVW x_base+0(FP), R3 // ERROR "invalid MOVW of x_base\+0\(FP\); slice base is 8-byte value" - MOVD x_base+0(FP), R3 - MOVH x_len+0(FP), R3 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVW x_len+0(FP), R3 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVD x_len+0(FP), R3 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+8\(FP\)" - MOVH x_len+8(FP), R3 // ERROR "invalid MOVH of x_len\+8\(FP\); slice len is 8-byte value" - MOVW x_len+8(FP), R3 // ERROR "invalid MOVW of x_len\+8\(FP\); slice len is 8-byte value" - MOVD x_len+8(FP), R3 - MOVH x_cap+0(FP), R3 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVW x_cap+0(FP), R3 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVD x_cap+0(FP), R3 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+16\(FP\)" - MOVH x_cap+16(FP), R3 // ERROR "invalid MOVH of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVW x_cap+16(FP), R3 // ERROR "invalid MOVW of x_cap\+16\(FP\); slice cap is 8-byte value" - MOVD x_cap+16(FP), R3 - MOVD y+0(FP), R3 // ERROR "invalid offset y\+0\(FP\); expected y\+24\(FP\)" - MOVD y_len+8(FP), R3 // ERROR "invalid offset y_len\+8\(FP\); expected y_len\+32\(FP\)" - MOVD y_cap+16(FP), R3 // ERROR "invalid offset y_cap\+16\(FP\); expected y_cap\+40\(FP\)" - RET - -TEXT ·argiface(SB),0,$0-32 - MOVH x+0(FP), R3 // ERROR "invalid MOVH of x\+0\(FP\); interface type is 8-byte value" - MOVW x+0(FP), R3 // ERROR "invalid MOVW of x\+0\(FP\); interface type is 8-byte value" - MOVD x+0(FP), R3 - MOVH x_type+0(FP), R3 // ERROR "invalid MOVH of x_type\+0\(FP\); interface type is 8-byte value" - MOVW x_type+0(FP), R3 // ERROR "invalid MOVW of x_type\+0\(FP\); interface type is 8-byte value" - MOVD x_type+0(FP), R3 - MOVD x_itable+0(FP), R3 // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" - MOVD x_itable+1(FP), R3 // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" - MOVH x_data+0(FP), R3 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVW x_data+0(FP), R3 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVD x_data+0(FP), R3 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+8\(FP\)" - MOVH x_data+8(FP), R3 // ERROR "invalid MOVH of x_data\+8\(FP\); interface data is 8-byte value" - MOVW x_data+8(FP), R3 // ERROR "invalid MOVW of x_data\+8\(FP\); interface data is 8-byte value" - MOVD x_data+8(FP), R3 - MOVH y+16(FP), R3 // ERROR "invalid MOVH of y\+16\(FP\); interface itable is 8-byte value" - MOVW y+16(FP), R3 // ERROR "invalid MOVW of y\+16\(FP\); interface itable is 8-byte value" - MOVD y+16(FP), R3 - MOVH y_itable+16(FP), R3 // ERROR "invalid MOVH of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVW y_itable+16(FP), R3 // ERROR "invalid MOVW of y_itable\+16\(FP\); interface itable is 8-byte value" - MOVD y_itable+16(FP), R3 - MOVD y_type+16(FP), R3 // ERROR "unknown variable y_type; offset 16 is y_itable\+16\(FP\)" - MOVH y_data+16(FP), R3 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVW y_data+16(FP), R3 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVD y_data+16(FP), R3 // ERROR "invalid offset y_data\+16\(FP\); expected y_data\+24\(FP\)" - MOVH y_data+24(FP), R3 // ERROR "invalid MOVH of y_data\+24\(FP\); interface data is 8-byte value" - MOVW y_data+24(FP), R3 // ERROR "invalid MOVW of y_data\+24\(FP\); interface data is 8-byte value" - MOVD y_data+24(FP), R3 - RET - -TEXT ·returnint(SB),0,$0-8 - MOVB R3, ret+0(FP) // ERROR "invalid MOVB of ret\+0\(FP\); int is 8-byte value" - MOVH R3, ret+0(FP) // ERROR "invalid MOVH of ret\+0\(FP\); int is 8-byte value" - MOVW R3, ret+0(FP) // ERROR "invalid MOVW of ret\+0\(FP\); int is 8-byte value" - MOVD R3, ret+0(FP) - MOVD R3, ret+1(FP) // ERROR "invalid offset ret\+1\(FP\); expected ret\+0\(FP\)" - MOVD R3, r+0(FP) // ERROR "unknown variable r; offset 0 is ret\+0\(FP\)" - RET - -TEXT ·returnbyte(SB),0,$0-9 - MOVD x+0(FP), R3 - MOVB R3, ret+8(FP) - MOVH R3, ret+8(FP) // ERROR "invalid MOVH of ret\+8\(FP\); byte is 1-byte value" - MOVW R3, ret+8(FP) // ERROR "invalid MOVW of ret\+8\(FP\); byte is 1-byte value" - MOVD R3, ret+8(FP) // ERROR "invalid MOVD of ret\+8\(FP\); byte is 1-byte value" - MOVB R3, ret+7(FP) // ERROR "invalid offset ret\+7\(FP\); expected ret\+8\(FP\)" - RET - -TEXT ·returnnamed(SB),0,$0-41 - MOVB x+0(FP), R3 - MOVD R3, r1+8(FP) - MOVH R3, r2+16(FP) - MOVD R3, r3+24(FP) - MOVD R3, r3_base+24(FP) - MOVD R3, r3_len+32(FP) - MOVB R3, r4+40(FP) - MOVW R3, r1+8(FP) // ERROR "invalid MOVW of r1\+8\(FP\); int is 8-byte value" - RET - -TEXT ·returnintmissing(SB),0,$0-8 - RET // ERROR "RET without writing to 8-byte ret\+0\(FP\)" diff --git a/src/cmd/vet/testdata/asm8.s b/src/cmd/vet/testdata/asm8.s deleted file mode 100644 index 550d92a8d2daa..0000000000000 --- a/src/cmd/vet/testdata/asm8.s +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build mipsle -// +build vet_test - -TEXT ·arg1(SB),0,$0-2 - MOVB x+0(FP), R1 - MOVBU y+1(FP), R2 - MOVH x+0(FP), R1 // ERROR "\[mipsle\] arg1: invalid MOVH of x\+0\(FP\); int8 is 1-byte value" - MOVHU y+1(FP), R1 // ERROR "invalid MOVHU of y\+1\(FP\); uint8 is 1-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int8 is 1-byte value" - MOVWU y+1(FP), R1 // ERROR "invalid MOVWU of y\+1\(FP\); uint8 is 1-byte value" - MOVW y+1(FP), R1 // ERROR "invalid MOVW of y\+1\(FP\); uint8 is 1-byte value" - MOVB x+1(FP), R1 // ERROR "invalid offset x\+1\(FP\); expected x\+0\(FP\)" - MOVBU y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+1\(FP\)" - MOVB 8(R29), R1 // ERROR "8\(R29\) should be x\+0\(FP\)" - MOVB 9(R29), R1 // ERROR "9\(R29\) should be y\+1\(FP\)" - MOVB 10(R29), R1 // ERROR "use of 10\(R29\) points beyond argument frame" - RET - -TEXT ·arg2(SB),0,$0-4 - MOVBU x+0(FP), R1 // ERROR "arg2: invalid MOVBU of x\+0\(FP\); int16 is 2-byte value" - MOVB y+2(FP), R1 // ERROR "invalid MOVB of y\+2\(FP\); uint16 is 2-byte value" - MOVHU x+0(FP), R1 - MOVH y+2(FP), R2 - MOVWU x+0(FP), R1 // ERROR "invalid MOVWU of x\+0\(FP\); int16 is 2-byte value" - MOVW y+2(FP), R1 // ERROR "invalid MOVW of y\+2\(FP\); uint16 is 2-byte value" - MOVHU x+2(FP), R1 // ERROR "invalid offset x\+2\(FP\); expected x\+0\(FP\)" - MOVH y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+2\(FP\)" - RET - -TEXT ·arg4(SB),0,$0-2 // ERROR "arg4: wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int32 is 4-byte value" - MOVB y+4(FP), R2 // ERROR "invalid MOVB of y\+4\(FP\); uint32 is 4-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int32 is 4-byte value" - MOVH y+4(FP), R1 // ERROR "invalid MOVH of y\+4\(FP\); uint32 is 4-byte value" - MOVW x+0(FP), R1 - MOVW y+4(FP), R1 - MOVW x+4(FP), R1 // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVW y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·arg8(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-16" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int64 is 8-byte value" - MOVB y+8(FP), R2 // ERROR "invalid MOVB of y\+8\(FP\); uint64 is 8-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int64 is 8-byte value" - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); uint64 is 8-byte value" - MOVW x+0(FP), R1 // ERROR "invalid MOVW of x\+0\(FP\); int64 is 8-byte value containing x_lo\+0\(FP\) and x_hi\+4\(FP\)" - MOVW x_lo+0(FP), R1 - MOVW x_hi+4(FP), R1 - MOVW y+8(FP), R1 // ERROR "invalid MOVW of y\+8\(FP\); uint64 is 8-byte value containing y_lo\+8\(FP\) and y_hi\+12\(FP\)" - MOVW y_lo+8(FP), R1 - MOVW y_hi+12(FP), R1 - RET - -TEXT ·argint(SB),0,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-8" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); int is 4-byte value" - MOVB y+4(FP), R2 // ERROR "invalid MOVB of y\+4\(FP\); uint is 4-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); int is 4-byte value" - MOVH y+4(FP), R1 // ERROR "invalid MOVH of y\+4\(FP\); uint is 4-byte value" - MOVW x+0(FP), R1 - MOVW y+4(FP), R1 - MOVW x+4(FP), R1 // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVW y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - RET - -TEXT ·argptr(SB),7,$0-2 // ERROR "wrong argument size 2; expected \$\.\.\.-20" - MOVB x+0(FP), R1 // ERROR "invalid MOVB of x\+0\(FP\); \*byte is 4-byte value" - MOVB y+4(FP), R2 // ERROR "invalid MOVB of y\+4\(FP\); \*byte is 4-byte value" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); \*byte is 4-byte value" - MOVH y+4(FP), R1 // ERROR "invalid MOVH of y\+4\(FP\); \*byte is 4-byte value" - MOVW x+0(FP), R1 - MOVW y+4(FP), R1 - MOVW x+4(FP), R1 // ERROR "invalid offset x\+4\(FP\); expected x\+0\(FP\)" - MOVW y+2(FP), R1 // ERROR "invalid offset y\+2\(FP\); expected y\+4\(FP\)" - MOVH c+8(FP), R1 // ERROR "invalid MOVH of c\+8\(FP\); chan int is 4-byte value" - MOVH m+12(FP), R1 // ERROR "invalid MOVH of m\+12\(FP\); map\[int\]int is 4-byte value" - MOVH f+16(FP), R1 // ERROR "invalid MOVH of f\+16\(FP\); func\(\) is 4-byte value" - RET - -TEXT ·argstring(SB),0,$16 // ERROR "wrong argument size 0; expected \$\.\.\.-16" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); string base is 4-byte value" - MOVW x+0(FP), R1 - MOVH x_base+0(FP), R1 // ERROR "invalid MOVH of x_base\+0\(FP\); string base is 4-byte value" - MOVW x_base+0(FP), R1 - MOVH x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVW x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVH x_len+4(FP), R1 // ERROR "invalid MOVH of x_len\+4\(FP\); string len is 4-byte value" - MOVW x_len+4(FP), R1 - MOVW y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+8\(FP\)" - MOVW y_len+4(FP), R1 // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+12\(FP\)" - RET - -TEXT ·argslice(SB),0,$24 // ERROR "wrong argument size 0; expected \$\.\.\.-24" - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); slice base is 4-byte value" - MOVW x+0(FP), R1 - MOVH x_base+0(FP), R1 // ERROR "invalid MOVH of x_base\+0\(FP\); slice base is 4-byte value" - MOVW x_base+0(FP), R1 - MOVH x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVW x_len+0(FP), R1 // ERROR "invalid offset x_len\+0\(FP\); expected x_len\+4\(FP\)" - MOVH x_len+4(FP), R1 // ERROR "invalid MOVH of x_len\+4\(FP\); slice len is 4-byte value" - MOVW x_len+4(FP), R1 - MOVH x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVW x_cap+0(FP), R1 // ERROR "invalid offset x_cap\+0\(FP\); expected x_cap\+8\(FP\)" - MOVH x_cap+8(FP), R1 // ERROR "invalid MOVH of x_cap\+8\(FP\); slice cap is 4-byte value" - MOVW x_cap+8(FP), R1 - MOVW y+0(FP), R1 // ERROR "invalid offset y\+0\(FP\); expected y\+12\(FP\)" - MOVW y_len+4(FP), R1 // ERROR "invalid offset y_len\+4\(FP\); expected y_len\+16\(FP\)" - MOVW y_cap+8(FP), R1 // ERROR "invalid offset y_cap\+8\(FP\); expected y_cap\+20\(FP\)" - RET - -TEXT ·argiface(SB),0,$0-16 - MOVH x+0(FP), R1 // ERROR "invalid MOVH of x\+0\(FP\); interface type is 4-byte value" - MOVW x+0(FP), R1 - MOVH x_type+0(FP), R1 // ERROR "invalid MOVH of x_type\+0\(FP\); interface type is 4-byte value" - MOVW x_type+0(FP), R1 - MOVQ x_itable+0(FP), R1 // ERROR "unknown variable x_itable; offset 0 is x_type\+0\(FP\)" - MOVQ x_itable+1(FP), R1 // ERROR "unknown variable x_itable; offset 1 is x_type\+0\(FP\)" - MOVH x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVW x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVQ x_data+0(FP), R1 // ERROR "invalid offset x_data\+0\(FP\); expected x_data\+4\(FP\)" - MOVH x_data+4(FP), R1 // ERROR "invalid MOVH of x_data\+4\(FP\); interface data is 4-byte value" - MOVW x_data+4(FP), R1 - MOVH y+8(FP), R1 // ERROR "invalid MOVH of y\+8\(FP\); interface itable is 4-byte value" - MOVW y+8(FP), R1 - MOVH y_itable+8(FP), R1 // ERROR "invalid MOVH of y_itable\+8\(FP\); interface itable is 4-byte value" - MOVW y_itable+8(FP), R1 - MOVW y_type+8(FP), AX // ERROR "unknown variable y_type; offset 8 is y_itable\+8\(FP\)" - MOVH y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVW y_data+8(FP), AX // ERROR "invalid offset y_data\+8\(FP\); expected y_data\+12\(FP\)" - MOVH y_data+12(FP), AX // ERROR "invalid MOVH of y_data\+12\(FP\); interface data is 4-byte value" - MOVW y_data+12(FP), AX - RET - -TEXT ·returnbyte(SB),0,$0-5 - MOVW x+0(FP), R1 - MOVB R1, ret+4(FP) - MOVH R1, ret+4(FP) // ERROR "invalid MOVH of ret\+4\(FP\); byte is 1-byte value" - MOVW R1, ret+4(FP) // ERROR "invalid MOVW of ret\+4\(FP\); byte is 1-byte value" - MOVB R1, ret+3(FP) // ERROR "invalid offset ret\+3\(FP\); expected ret\+4\(FP\)" - RET - -TEXT ·returnbyte(SB),0,$0-5 - MOVW x+0(FP), R1 - MOVB R1, ret+4(FP) - MOVH R1, ret+4(FP) // ERROR "invalid MOVH of ret\+4\(FP\); byte is 1-byte value" - MOVW R1, ret+4(FP) // ERROR "invalid MOVW of ret\+4\(FP\); byte is 1-byte value" - MOVB R1, ret+3(FP) // ERROR "invalid offset ret\+3\(FP\); expected ret\+4\(FP\)" - RET - -TEXT ·returnnamed(SB),0,$0-21 - MOVB x+0(FP), AX - MOVW R1, r1+4(FP) - MOVH R1, r2+8(FP) - MOVW R1, r3+12(FP) - MOVW R1, r3_base+12(FP) - MOVW R1, r3_len+16(FP) - MOVB R1, r4+20(FP) - MOVB R1, r1+4(FP) // ERROR "invalid MOVB of r1\+4\(FP\); int is 4-byte value" - RET - -TEXT ·returnintmissing(SB),0,$0-4 - RET // ERROR "RET without writing to 4-byte ret\+0\(FP\)" diff --git a/src/cmd/vet/testdata/atomic.go b/src/cmd/vet/testdata/atomic.go deleted file mode 100644 index 69730b4e6f03f..0000000000000 --- a/src/cmd/vet/testdata/atomic.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2013 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. - -// This file contains tests for the atomic checker. - -package testdata - -import ( - "sync/atomic" -) - -type Counter uint64 - -func AtomicTests() { - x := uint64(1) - x = atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value" - _, x = 10, atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value" - x, _ = atomic.AddUint64(&x, 1), 10 // ERROR "direct assignment to atomic value" - - y := &x - *y = atomic.AddUint64(y, 1) // ERROR "direct assignment to atomic value" - - var su struct{ Counter uint64 } - su.Counter = atomic.AddUint64(&su.Counter, 1) // ERROR "direct assignment to atomic value" - z1 := atomic.AddUint64(&su.Counter, 1) - _ = z1 // Avoid err "z declared and not used" - - var sp struct{ Counter *uint64 } - *sp.Counter = atomic.AddUint64(sp.Counter, 1) // ERROR "direct assignment to atomic value" - z2 := atomic.AddUint64(sp.Counter, 1) - _ = z2 // Avoid err "z declared and not used" - - au := []uint64{10, 20} - au[0] = atomic.AddUint64(&au[0], 1) // ERROR "direct assignment to atomic value" - au[1] = atomic.AddUint64(&au[0], 1) - - ap := []*uint64{&au[0], &au[1]} - *ap[0] = atomic.AddUint64(ap[0], 1) // ERROR "direct assignment to atomic value" - *ap[1] = atomic.AddUint64(ap[0], 1) - - x = atomic.AddUint64() // Used to make vet crash; now silently ignored. - - { - // A variable declaration creates a new variable in the current scope. - x := atomic.AddUint64(&x, 1) // ERROR "declaration of .x. shadows declaration at atomic.go:16" - - // Re-declaration assigns a new value. - x, w := atomic.AddUint64(&x, 1), 10 // ERROR "direct assignment to atomic value" - _ = w - } -} - -type T struct{} - -func (T) AddUint64(addr *uint64, delta uint64) uint64 { return 0 } - -func NonAtomic() { - x := uint64(1) - var atomic T - x = atomic.AddUint64(&x, 1) // ok; not the imported pkg -} diff --git a/src/cmd/vet/testdata/bool.go b/src/cmd/vet/testdata/bool.go deleted file mode 100644 index 80c44d25ca388..0000000000000 --- a/src/cmd/vet/testdata/bool.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2014 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. - -// This file contains tests for the bool checker. - -package testdata - -import "io" - -type T int - -func (t T) Foo() int { return int(t) } - -type FT func() int - -var S []int - -func RatherStupidConditions() { - var f, g func() int - if f() == 0 || f() == 0 { // OK f might have side effects - } - var t T - _ = t.Foo() == 2 || t.Foo() == 2 // OK Foo might have side effects - if v, w := f(), g(); v == w || v == w { // ERROR "redundant or: v == w || v == w" - } - _ = f == nil || f == nil // ERROR "redundant or: f == nil || f == nil" - - _ = i == byte(1) || i == byte(1) // ERROR "redundant or: i == byte(1) || i == byte(1)" - _ = i == T(2) || i == T(2) // ERROR "redundant or: i == T(2) || i == T(2)" - _ = FT(f) == nil || FT(f) == nil // ERROR "redundant or: FT(f) == nil || FT(f) == nil" - - _ = (func() int)(f) == nil || (func() int)(f) == nil // ERROR "redundant or: (func() int)(f) == nil || (func() int)(f) == nil" - _ = append(S, 3) == nil || append(S, 3) == nil // OK append has side effects - - var namedFuncVar FT - _ = namedFuncVar() == namedFuncVar() // OK still func calls - - var c chan int - _ = 0 == <-c || 0 == <-c // OK subsequent receives may yield different values - for i, j := <-c, <-c; i == j || i == j; i, j = <-c, <-c { // ERROR "redundant or: i == j || i == j" - } - - var i, j, k int - _ = i+1 == 1 || i+1 == 1 // ERROR "redundant or: i\+1 == 1 || i\+1 == 1" - _ = i == 1 || j+1 == i || i == 1 // ERROR "redundant or: i == 1 || i == 1" - - _ = i == 1 || i == 1 || f() == 1 // ERROR "redundant or: i == 1 || i == 1" - _ = i == 1 || f() == 1 || i == 1 // OK f may alter i as a side effect - _ = f() == 1 || i == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" - - // Test partition edge cases - _ = f() == 1 || i == 1 || i == 1 || j == 1 // ERROR "redundant or: i == 1 || i == 1" - _ = f() == 1 || j == 1 || i == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" - _ = i == 1 || f() == 1 || i == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" - _ = i == 1 || i == 1 || f() == 1 || i == 1 // ERROR "redundant or: i == 1 || i == 1" - _ = i == 1 || i == 1 || j == 1 || f() == 1 // ERROR "redundant or: i == 1 || i == 1" - _ = j == 1 || i == 1 || i == 1 || f() == 1 // ERROR "redundant or: i == 1 || i == 1" - _ = i == 1 || f() == 1 || f() == 1 || i == 1 - - _ = i == 1 || (i == 1 || i == 2) // ERROR "redundant or: i == 1 || i == 1" - _ = i == 1 || (f() == 1 || i == 1) // OK f may alter i as a side effect - _ = i == 1 || (i == 1 || f() == 1) // ERROR "redundant or: i == 1 || i == 1" - _ = i == 1 || (i == 2 || (i == 1 || i == 3)) // ERROR "redundant or: i == 1 || i == 1" - - var a, b bool - _ = i == 1 || (a || (i == 1 || b)) // ERROR "redundant or: i == 1 || i == 1" - - // Check that all redundant ors are flagged - _ = j == 0 || - i == 1 || - f() == 1 || - j == 0 || // ERROR "redundant or: j == 0 || j == 0" - i == 1 || // ERROR "redundant or: i == 1 || i == 1" - i == 1 || // ERROR "redundant or: i == 1 || i == 1" - i == 1 || - j == 0 || - k == 0 - - _ = i == 1*2*3 || i == 1*2*3 // ERROR "redundant or: i == 1\*2\*3 || i == 1\*2\*3" - - // These test that redundant, suspect expressions do not trigger multiple errors. - _ = i != 0 || i != 0 // ERROR "redundant or: i != 0 || i != 0" - _ = i == 0 && i == 0 // ERROR "redundant and: i == 0 && i == 0" - - // and is dual to or; check the basics and - // let the or tests pull the rest of the weight. - _ = 0 != <-c && 0 != <-c // OK subsequent receives may yield different values - _ = f() != 0 && f() != 0 // OK f might have side effects - _ = f != nil && f != nil // ERROR "redundant and: f != nil && f != nil" - _ = i != 1 && i != 1 && f() != 1 // ERROR "redundant and: i != 1 && i != 1" - _ = i != 1 && f() != 1 && i != 1 // OK f may alter i as a side effect - _ = f() != 1 && i != 1 && i != 1 // ERROR "redundant and: i != 1 && i != 1" -} - -func RoyallySuspectConditions() { - var i, j int - - _ = i == 0 || i == 1 // OK - _ = i != 0 || i != 1 // ERROR "suspect or: i != 0 || i != 1" - _ = i != 0 || 1 != i // ERROR "suspect or: i != 0 || 1 != i" - _ = 0 != i || 1 != i // ERROR "suspect or: 0 != i || 1 != i" - _ = 0 != i || i != 1 // ERROR "suspect or: 0 != i || i != 1" - - _ = (0 != i) || i != 1 // ERROR "suspect or: 0 != i || i != 1" - - _ = i+3 != 7 || j+5 == 0 || i+3 != 9 // ERROR "suspect or: i\+3 != 7 || i\+3 != 9" - - _ = i != 0 || j == 0 || i != 1 // ERROR "suspect or: i != 0 || i != 1" - - _ = i != 0 || i != 1<<4 // ERROR "suspect or: i != 0 || i != 1<<4" - - _ = i != 0 || j != 0 - _ = 0 != i || 0 != j - - var s string - _ = s != "one" || s != "the other" // ERROR "suspect or: s != .one. || s != .the other." - - _ = "et" != "alii" || "et" != "cetera" // ERROR "suspect or: .et. != .alii. || .et. != .cetera." - _ = "me gustas" != "tu" || "le gustas" != "tu" // OK we could catch this case, but it's not worth the code - - var err error - _ = err != nil || err != io.EOF // TODO catch this case? - - // Sanity check and. - _ = i != 0 && i != 1 // OK - _ = i == 0 && i == 1 // ERROR "suspect and: i == 0 && i == 1" - _ = i == 0 && 1 == i // ERROR "suspect and: i == 0 && 1 == i" - _ = 0 == i && 1 == i // ERROR "suspect and: 0 == i && 1 == i" - _ = 0 == i && i == 1 // ERROR "suspect and: 0 == i && i == 1" -} diff --git a/src/cmd/vet/testdata/buildtag/buildtag_bad.go b/src/cmd/vet/testdata/buildtag/buildtag_bad.go deleted file mode 100644 index fbe10cf748f58..0000000000000 --- a/src/cmd/vet/testdata/buildtag/buildtag_bad.go +++ /dev/null @@ -1,15 +0,0 @@ -// This file contains misplaced or malformed build constraints. -// The Go tool will skip it, because the constraints are invalid. -// It serves only to test the tag checker during make test. - -// Mention +build // ERROR "possible malformed \+build comment" - -// +build !!bang // ERROR "invalid double negative in build constraint" -// +build @#$ // ERROR "invalid non-alphanumeric build constraint" - -// +build toolate // ERROR "build comment must appear before package clause and be followed by a blank line" -package bad - -// This is package 'bad' rather than 'main' so the erroneous build -// tag doesn't end up looking like a package doc for the vet command -// when examined by godoc. diff --git a/src/cmd/vet/testdata/cgo/cgo.go b/src/cmd/vet/testdata/cgo/cgo.go deleted file mode 100644 index d0df7cf6787fe..0000000000000 --- a/src/cmd/vet/testdata/cgo/cgo.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2015 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. - -// This file contains tests for the cgo checker. - -package testdata - -// void f(void *); -import "C" - -import "unsafe" - -func CgoTests() { - var c chan bool - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&c))) // ERROR "embedded pointer" - C.f(unsafe.Pointer(&c)) // ERROR "embedded pointer" - - var m map[string]string - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&m))) // ERROR "embedded pointer" - C.f(unsafe.Pointer(&m)) // ERROR "embedded pointer" - - var f func() - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&f))) // ERROR "embedded pointer" - C.f(unsafe.Pointer(&f)) // ERROR "embedded pointer" - - var s []int - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&s))) // ERROR "embedded pointer" - C.f(unsafe.Pointer(&s)) // ERROR "embedded pointer" - - var a [1][]int - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&a))) // ERROR "embedded pointer" - C.f(unsafe.Pointer(&a)) // ERROR "embedded pointer" - - var st struct{ f []int } - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&st))) // ERROR "embedded pointer" - C.f(unsafe.Pointer(&st)) // ERROR "embedded pointer" - - // The following cases are OK. - var i int - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&i))) - C.f(unsafe.Pointer(&i)) - - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&s[0]))) - C.f(unsafe.Pointer(&s[0])) - - var a2 [1]int - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&a2))) - C.f(unsafe.Pointer(&a2)) - - var st2 struct{ i int } - C.f(*(*unsafe.Pointer)(unsafe.Pointer(&st2))) - C.f(unsafe.Pointer(&st2)) - - type cgoStruct struct{ p *cgoStruct } - C.f(unsafe.Pointer(&cgoStruct{})) - - C.CBytes([]byte("hello")) -} diff --git a/src/cmd/vet/testdata/cgo/cgo2.go b/src/cmd/vet/testdata/cgo/cgo2.go deleted file mode 100644 index 4f27116893138..0000000000000 --- a/src/cmd/vet/testdata/cgo/cgo2.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Test the cgo checker on a file that doesn't use cgo. - -package testdata - -var _ = C.f(*p(**p)) - -// Passing a pointer (via the slice), but C isn't cgo. -var _ = C.f([]int{3}) diff --git a/src/cmd/vet/testdata/cgo/cgo3.go b/src/cmd/vet/testdata/cgo/cgo3.go deleted file mode 100644 index 0b1518e1f930a..0000000000000 --- a/src/cmd/vet/testdata/cgo/cgo3.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Used by TestVetVerbose to test that vet -v doesn't fail because it -// can't find "C". - -package testdata - -import "C" - -func F() { -} diff --git a/src/cmd/vet/testdata/cgo/cgo4.go b/src/cmd/vet/testdata/cgo/cgo4.go deleted file mode 100644 index 67b54506abae1..0000000000000 --- a/src/cmd/vet/testdata/cgo/cgo4.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Test the cgo checker on a file that doesn't use cgo, but has an -// import named "C". - -package testdata - -import C "fmt" - -var _ = C.Println(*p(**p)) - -// Passing a pointer (via a slice), but C is fmt, not cgo. -var _ = C.Println([]int{3}) diff --git a/src/cmd/vet/testdata/composite.go b/src/cmd/vet/testdata/composite.go deleted file mode 100644 index 3fe3eac78cb38..0000000000000 --- a/src/cmd/vet/testdata/composite.go +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2012 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. - -// This file contains the test for untagged struct literals. - -package testdata - -import ( - "flag" - "go/scanner" - "image" - "unicode" - - "path/to/unknownpkg" -) - -var Okay1 = []string{ - "Name", - "Usage", - "DefValue", -} - -var Okay2 = map[string]bool{ - "Name": true, - "Usage": true, - "DefValue": true, -} - -var Okay3 = struct { - X string - Y string - Z string -}{ - "Name", - "Usage", - "DefValue", -} - -var Okay4 = []struct { - A int - B int -}{ - {1, 2}, - {3, 4}, -} - -type MyStruct struct { - X string - Y string - Z string -} - -var Okay5 = &MyStruct{ - "Name", - "Usage", - "DefValue", -} - -var Okay6 = []MyStruct{ - {"foo", "bar", "baz"}, - {"aa", "bb", "cc"}, -} - -var Okay7 = []*MyStruct{ - {"foo", "bar", "baz"}, - {"aa", "bb", "cc"}, -} - -// Testing is awkward because we need to reference things from a separate package -// to trigger the warnings. - -var goodStructLiteral = flag.Flag{ - Name: "Name", - Usage: "Usage", -} -var badStructLiteral = flag.Flag{ // ERROR "unkeyed fields" - "Name", - "Usage", - nil, // Value - "DefValue", -} - -// SpecialCase is a named slice of CaseRange to test issue 9171. -var goodNamedSliceLiteral = unicode.SpecialCase{ - {Lo: 1, Hi: 2}, - unicode.CaseRange{Lo: 1, Hi: 2}, -} -var badNamedSliceLiteral = unicode.SpecialCase{ - {1, 2}, // ERROR "unkeyed fields" - unicode.CaseRange{1, 2}, // ERROR "unkeyed fields" -} - -// ErrorList is a named slice, so no warnings should be emitted. -var goodScannerErrorList = scanner.ErrorList{ - &scanner.Error{Msg: "foobar"}, -} -var badScannerErrorList = scanner.ErrorList{ - &scanner.Error{"foobar"}, // ERROR "unkeyed fields" -} - -// Check whitelisted structs: if vet is run with --compositewhitelist=false, -// this line triggers an error. -var whitelistedPoint = image.Point{1, 2} - -// Do not check type from unknown package. -// See issue 15408. -var unknownPkgVar = unknownpkg.Foobar{"foo", "bar"} - -// A named pointer slice of CaseRange to test issue 23539. In -// particular, we're interested in how some slice elements omit their -// type. -var goodNamedPointerSliceLiteral = []*unicode.CaseRange{ - {Lo: 1, Hi: 2}, - &unicode.CaseRange{Lo: 1, Hi: 2}, -} -var badNamedPointerSliceLiteral = []*unicode.CaseRange{ - {1, 2}, // ERROR "unkeyed fields" - &unicode.CaseRange{1, 2}, // ERROR "unkeyed fields" -} diff --git a/src/cmd/vet/testdata/copylock.go b/src/cmd/vet/testdata/copylock.go deleted file mode 100644 index e9902a27f10dd..0000000000000 --- a/src/cmd/vet/testdata/copylock.go +++ /dev/null @@ -1,188 +0,0 @@ -package testdata - -import ( - "sync" - "sync/atomic" - "unsafe" - . "unsafe" - unsafe1 "unsafe" -) - -func OkFunc() { - var x *sync.Mutex - p := x - var y sync.Mutex - p = &y - - var z = sync.Mutex{} - w := sync.Mutex{} - - w = sync.Mutex{} - q := struct{ L sync.Mutex }{ - L: sync.Mutex{}, - } - - yy := []Tlock{ - Tlock{}, - Tlock{ - once: sync.Once{}, - }, - } - - nl := new(sync.Mutex) - mx := make([]sync.Mutex, 10) - xx := struct{ L *sync.Mutex }{ - L: new(sync.Mutex), - } -} - -type Tlock struct { - once sync.Once -} - -func BadFunc() { - var x *sync.Mutex - p := x - var y sync.Mutex - p = &y - *p = *x // ERROR "assignment copies lock value to \*p: sync.Mutex" - - var t Tlock - var tp *Tlock - tp = &t - *tp = t // ERROR "assignment copies lock value to \*tp: testdata.Tlock contains sync.Once contains sync.Mutex" - t = *tp // ERROR "assignment copies lock value to t: testdata.Tlock contains sync.Once contains sync.Mutex" - - y := *x // ERROR "assignment copies lock value to y: sync.Mutex" - var z = t // ERROR "variable declaration copies lock value to z: testdata.Tlock contains sync.Once contains sync.Mutex" - - w := struct{ L sync.Mutex }{ - L: *x, // ERROR "literal copies lock value from \*x: sync.Mutex" - } - var q = map[int]Tlock{ - 1: t, // ERROR "literal copies lock value from t: testdata.Tlock contains sync.Once contains sync.Mutex" - 2: *tp, // ERROR "literal copies lock value from \*tp: testdata.Tlock contains sync.Once contains sync.Mutex" - } - yy := []Tlock{ - t, // ERROR "literal copies lock value from t: testdata.Tlock contains sync.Once contains sync.Mutex" - *tp, // ERROR "literal copies lock value from \*tp: testdata.Tlock contains sync.Once contains sync.Mutex" - } - - // override 'new' keyword - new := func(interface{}) {} - new(t) // ERROR "call of new copies lock value: testdata.Tlock contains sync.Once contains sync.Mutex" - - // copy of array of locks - var muA [5]sync.Mutex - muB := muA // ERROR "assignment copies lock value to muB: sync.Mutex" - muA = muB // ERROR "assignment copies lock value to muA: sync.Mutex" - muSlice := muA[:] // OK - - // multidimensional array - var mmuA [5][5]sync.Mutex - mmuB := mmuA // ERROR "assignment copies lock value to mmuB: sync.Mutex" - mmuA = mmuB // ERROR "assignment copies lock value to mmuA: sync.Mutex" - mmuSlice := mmuA[:] // OK - - // slice copy is ok - var fmuA [5][][5]sync.Mutex - fmuB := fmuA // OK - fmuA = fmuB // OK - fmuSlice := fmuA[:] // OK -} - -func LenAndCapOnLockArrays() { - var a [5]sync.Mutex - aLen := len(a) // OK - aCap := cap(a) // OK - - // override 'len' and 'cap' keywords - - len := func(interface{}) {} - len(a) // ERROR "call of len copies lock value: sync.Mutex" - - cap := func(interface{}) {} - cap(a) // ERROR "call of cap copies lock value: sync.Mutex" -} - -func SizeofMutex() { - var mu sync.Mutex - unsafe.Sizeof(mu) // OK - unsafe1.Sizeof(mu) // OK - Sizeof(mu) // OK - unsafe := struct{ Sizeof func(interface{}) }{} - unsafe.Sizeof(mu) // ERROR "call of unsafe.Sizeof copies lock value: sync.Mutex" - Sizeof := func(interface{}) {} - Sizeof(mu) // ERROR "call of Sizeof copies lock value: sync.Mutex" -} - -// SyncTypesCheck checks copying of sync.* types except sync.Mutex -func SyncTypesCheck() { - // sync.RWMutex copying - var rwmuX sync.RWMutex - var rwmuXX = sync.RWMutex{} - rwmuX1 := new(sync.RWMutex) - rwmuY := rwmuX // ERROR "assignment copies lock value to rwmuY: sync.RWMutex" - rwmuY = rwmuX // ERROR "assignment copies lock value to rwmuY: sync.RWMutex" - var rwmuYY = rwmuX // ERROR "variable declaration copies lock value to rwmuYY: sync.RWMutex" - rwmuP := &rwmuX - rwmuZ := &sync.RWMutex{} - - // sync.Cond copying - var condX sync.Cond - var condXX = sync.Cond{} - condX1 := new(sync.Cond) - condY := condX // ERROR "assignment copies lock value to condY: sync.Cond contains sync.noCopy" - condY = condX // ERROR "assignment copies lock value to condY: sync.Cond contains sync.noCopy" - var condYY = condX // ERROR "variable declaration copies lock value to condYY: sync.Cond contains sync.noCopy" - condP := &condX - condZ := &sync.Cond{ - L: &sync.Mutex{}, - } - condZ = sync.NewCond(&sync.Mutex{}) - - // sync.WaitGroup copying - var wgX sync.WaitGroup - var wgXX = sync.WaitGroup{} - wgX1 := new(sync.WaitGroup) - wgY := wgX // ERROR "assignment copies lock value to wgY: sync.WaitGroup contains sync.noCopy" - wgY = wgX // ERROR "assignment copies lock value to wgY: sync.WaitGroup contains sync.noCopy" - var wgYY = wgX // ERROR "variable declaration copies lock value to wgYY: sync.WaitGroup contains sync.noCopy" - wgP := &wgX - wgZ := &sync.WaitGroup{} - - // sync.Pool copying - var poolX sync.Pool - var poolXX = sync.Pool{} - poolX1 := new(sync.Pool) - poolY := poolX // ERROR "assignment copies lock value to poolY: sync.Pool contains sync.noCopy" - poolY = poolX // ERROR "assignment copies lock value to poolY: sync.Pool contains sync.noCopy" - var poolYY = poolX // ERROR "variable declaration copies lock value to poolYY: sync.Pool contains sync.noCopy" - poolP := &poolX - poolZ := &sync.Pool{} - - // sync.Once copying - var onceX sync.Once - var onceXX = sync.Once{} - onceX1 := new(sync.Once) - onceY := onceX // ERROR "assignment copies lock value to onceY: sync.Once contains sync.Mutex" - onceY = onceX // ERROR "assignment copies lock value to onceY: sync.Once contains sync.Mutex" - var onceYY = onceX // ERROR "variable declaration copies lock value to onceYY: sync.Once contains sync.Mutex" - onceP := &onceX - onceZ := &sync.Once{} -} - -// AtomicTypesCheck checks copying of sync/atomic types -func AtomicTypesCheck() { - // atomic.Value copying - var vX atomic.Value - var vXX = atomic.Value{} - vX1 := new(atomic.Value) - // These are OK because the value has not been used yet. - // (And vet can't tell whether it has been used, so they're always OK.) - vY := vX - vY = vX - var vYY = vX - vP := &vX - vZ := &atomic.Value{} -} diff --git a/src/cmd/vet/testdata/copylock_func.go b/src/cmd/vet/testdata/copylock_func.go deleted file mode 100644 index 280747a3bf46d..0000000000000 --- a/src/cmd/vet/testdata/copylock_func.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2013 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. - -// This file contains tests for the copylock checker's -// function declaration analysis. - -package testdata - -import "sync" - -func OkFunc(*sync.Mutex) {} -func BadFunc(sync.Mutex) {} // ERROR "BadFunc passes lock by value: sync.Mutex" -func BadFunc2(sync.Map) {} // ERROR "BadFunc2 passes lock by value: sync.Map contains sync.Mutex" -func OkRet() *sync.Mutex {} -func BadRet() sync.Mutex {} // Don't warn about results - -var ( - OkClosure = func(*sync.Mutex) {} - BadClosure = func(sync.Mutex) {} // ERROR "func passes lock by value: sync.Mutex" - BadClosure2 = func(sync.Map) {} // ERROR "func passes lock by value: sync.Map contains sync.Mutex" -) - -type EmbeddedRWMutex struct { - sync.RWMutex -} - -func (*EmbeddedRWMutex) OkMeth() {} -func (EmbeddedRWMutex) BadMeth() {} // ERROR "BadMeth passes lock by value: testdata.EmbeddedRWMutex" -func OkFunc(e *EmbeddedRWMutex) {} -func BadFunc(EmbeddedRWMutex) {} // ERROR "BadFunc passes lock by value: testdata.EmbeddedRWMutex" -func OkRet() *EmbeddedRWMutex {} -func BadRet() EmbeddedRWMutex {} // Don't warn about results - -type FieldMutex struct { - s sync.Mutex -} - -func (*FieldMutex) OkMeth() {} -func (FieldMutex) BadMeth() {} // ERROR "BadMeth passes lock by value: testdata.FieldMutex contains sync.Mutex" -func OkFunc(*FieldMutex) {} -func BadFunc(FieldMutex, int) {} // ERROR "BadFunc passes lock by value: testdata.FieldMutex contains sync.Mutex" - -type L0 struct { - L1 -} - -type L1 struct { - l L2 -} - -type L2 struct { - sync.Mutex -} - -func (*L0) Ok() {} -func (L0) Bad() {} // ERROR "Bad passes lock by value: testdata.L0 contains testdata.L1 contains testdata.L2" - -type EmbeddedMutexPointer struct { - s *sync.Mutex // safe to copy this pointer -} - -func (*EmbeddedMutexPointer) Ok() {} -func (EmbeddedMutexPointer) AlsoOk() {} -func StillOk(EmbeddedMutexPointer) {} -func LookinGood() EmbeddedMutexPointer {} - -type EmbeddedLocker struct { - sync.Locker // safe to copy interface values -} - -func (*EmbeddedLocker) Ok() {} -func (EmbeddedLocker) AlsoOk() {} - -type CustomLock struct{} - -func (*CustomLock) Lock() {} -func (*CustomLock) Unlock() {} - -func Ok(*CustomLock) {} -func Bad(CustomLock) {} // ERROR "Bad passes lock by value: testdata.CustomLock" - -// Passing lock values into interface function arguments -func FuncCallInterfaceArg(f func(a int, b interface{})) { - var m sync.Mutex - var t struct{ lock sync.Mutex } - - f(1, "foo") - f(2, &t) - f(3, &sync.Mutex{}) - f(4, m) // ERROR "call of f copies lock value: sync.Mutex" - f(5, t) // ERROR "call of f copies lock value: struct.lock sync.Mutex. contains sync.Mutex" - var fntab []func(t) - fntab[0](t) // ERROR "call of fntab.0. copies lock value: struct.lock sync.Mutex. contains sync.Mutex" -} - -// Returning lock via interface value -func ReturnViaInterface(x int) (int, interface{}) { - var m sync.Mutex - var t struct{ lock sync.Mutex } - - switch x % 4 { - case 0: - return 0, "qwe" - case 1: - return 1, &sync.Mutex{} - case 2: - return 2, m // ERROR "return copies lock value: sync.Mutex" - default: - return 3, t // ERROR "return copies lock value: struct.lock sync.Mutex. contains sync.Mutex" - } -} - -// Some cases that we don't warn about. - -func AcceptedCases() { - x := EmbeddedRwMutex{} // composite literal on RHS is OK (#16227) - x = BadRet() // function call on RHS is OK (#16227) - x = *OKRet() // indirection of function call on RHS is OK (#16227) -} - -// TODO: Unfortunate cases - -// Non-ideal error message: -// Since we're looking for Lock methods, sync.Once's underlying -// sync.Mutex gets called out, but without any reference to the sync.Once. -type LocalOnce sync.Once - -func (LocalOnce) Bad() {} // ERROR "Bad passes lock by value: testdata.LocalOnce contains sync.Mutex" - -// False negative: -// LocalMutex doesn't have a Lock method. -// Nevertheless, it is probably a bad idea to pass it by value. -type LocalMutex sync.Mutex - -func (LocalMutex) Bad() {} // WANTED: An error here :( diff --git a/src/cmd/vet/testdata/copylock_range.go b/src/cmd/vet/testdata/copylock_range.go deleted file mode 100644 index f127381213cd7..0000000000000 --- a/src/cmd/vet/testdata/copylock_range.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2014 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. - -// This file contains tests for the copylock checker's -// range statement analysis. - -package testdata - -import "sync" - -func rangeMutex() { - var mu sync.Mutex - var i int - - var s []sync.Mutex - for range s { - } - for i = range s { - } - for i := range s { - } - for i, _ = range s { - } - for i, _ := range s { - } - for _, mu = range s { // ERROR "range var mu copies lock: sync.Mutex" - } - for _, m := range s { // ERROR "range var m copies lock: sync.Mutex" - } - for i, mu = range s { // ERROR "range var mu copies lock: sync.Mutex" - } - for i, m := range s { // ERROR "range var m copies lock: sync.Mutex" - } - - var a [3]sync.Mutex - for _, m := range a { // ERROR "range var m copies lock: sync.Mutex" - } - - var m map[sync.Mutex]sync.Mutex - for k := range m { // ERROR "range var k copies lock: sync.Mutex" - } - for mu, _ = range m { // ERROR "range var mu copies lock: sync.Mutex" - } - for k, _ := range m { // ERROR "range var k copies lock: sync.Mutex" - } - for _, mu = range m { // ERROR "range var mu copies lock: sync.Mutex" - } - for _, v := range m { // ERROR "range var v copies lock: sync.Mutex" - } - - var c chan sync.Mutex - for range c { - } - for mu = range c { // ERROR "range var mu copies lock: sync.Mutex" - } - for v := range c { // ERROR "range var v copies lock: sync.Mutex" - } - - // Test non-idents in range variables - var t struct { - i int - mu sync.Mutex - } - for t.i, t.mu = range s { // ERROR "range var t.mu copies lock: sync.Mutex" - } -} diff --git a/src/cmd/vet/testdata/deadcode.go b/src/cmd/vet/testdata/deadcode.go deleted file mode 100644 index d1a7adee38d2c..0000000000000 --- a/src/cmd/vet/testdata/deadcode.go +++ /dev/null @@ -1,2134 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This file contains tests for the dead code checker. - -package testdata - -type T int - -var x interface{} -var c chan int - -func external() int // ok - -func _() int { -} - -func _() int { - print(1) -} - -func _() int { - print(1) - return 2 - println() // ERROR "unreachable code" -} - -func _() int { -L: - print(1) - goto L - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - panic(2) - println() // ERROR "unreachable code" -} - -// but only builtin panic -func _() int { - var panic = func(int) {} - print(1) - panic(2) - println() // ok -} - -func _() int { - { - print(1) - return 2 - println() // ERROR "unreachable code" - } - println() // ok -} - -func _() int { - { - print(1) - return 2 - } - println() // ERROR "unreachable code" -} - -func _() int { -L: - { - print(1) - goto L - println() // ERROR "unreachable code" - } - println() // ok -} - -func _() int { -L: - { - print(1) - goto L - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - { - panic(2) - } -} - -func _() int { - print(1) - { - panic(2) - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - { - panic(2) - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - return 2 - { // ERROR "unreachable code" - } -} - -func _() int { -L: - print(1) - goto L - { // ERROR "unreachable code" - } -} - -func _() int { - print(1) - panic(2) - { // ERROR "unreachable code" - } -} - -func _() int { - { - print(1) - return 2 - { // ERROR "unreachable code" - } - } -} - -func _() int { -L: - { - print(1) - goto L - { // ERROR "unreachable code" - } - } -} - -func _() int { - print(1) - { - panic(2) - { // ERROR "unreachable code" - } - } -} - -func _() int { - { - print(1) - return 2 - } - { // ERROR "unreachable code" - } -} - -func _() int { -L: - { - print(1) - goto L - } - { // ERROR "unreachable code" - } -} - -func _() int { - print(1) - { - panic(2) - } - { // ERROR "unreachable code" - } -} - -func _() int { - print(1) - if x == nil { - panic(2) - } else { - panic(3) - } - println() // ERROR "unreachable code" -} - -func _() int { -L: - print(1) - if x == nil { - panic(2) - } else { - goto L - } - println() // ERROR "unreachable code" -} - -func _() int { -L: - print(1) - if x == nil { - panic(2) - } else if x == 1 { - return 0 - } else if x != 2 { - panic(3) - } else { - goto L - } - println() // ERROR "unreachable code" -} - -// if-else chain missing final else is not okay, even if the -// conditions cover every possible case. - -func _() int { - print(1) - if x == nil { - panic(2) - } else if x != nil { - panic(3) - } - println() // ok -} - -func _() int { - print(1) - if x == nil { - panic(2) - } - println() // ok -} - -func _() int { -L: - print(1) - if x == nil { - panic(2) - } else if x == 1 { - return 0 - } else if x != 1 { - panic(3) - } - println() // ok -} - -func _() int { - print(1) - for { - } - println() // ERROR "unreachable code" -} - -func _() int { - for { - for { - break - } - } - println() // ERROR "unreachable code" -} - -func _() int { - for { - for { - break - println() // ERROR "unreachable code" - } - } -} - -func _() int { - for { - for { - continue - println() // ERROR "unreachable code" - } - } -} - -func _() int { - for { - L: - for { - break L - } - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - for { - break - } - println() // ok -} - -func _() int { - for { - for { - } - break // ERROR "unreachable code" - } - println() // ok -} - -func _() int { -L: - for { - for { - break L - } - } - println() // ok -} - -func _() int { - print(1) - for x == nil { - } - println() // ok -} - -func _() int { - for x == nil { - for { - break - } - } - println() // ok -} - -func _() int { - for x == nil { - L: - for { - break L - } - } - println() // ok -} - -func _() int { - print(1) - for true { - } - println() // ok -} - -func _() int { - for true { - for { - break - } - } - println() // ok -} - -func _() int { - for true { - L: - for { - break L - } - } - println() // ok -} - -func _() int { - print(1) - select {} - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - select { - case <-c: - print(2) - for { - } - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - select { - case <-c: - print(2) - for { - } - } - println() // ERROR "unreachable code" -} - -func _() int { -L: - print(1) - select { - case <-c: - print(2) - panic("abc") - println() // ERROR "unreachable code" - case c <- 1: - print(2) - goto L - println() // ERROR "unreachable code" - } -} - -func _() int { -L: - print(1) - select { - case <-c: - print(2) - panic("abc") - case c <- 1: - print(2) - goto L - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - println() // ERROR "unreachable code" - default: - select {} - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - default: - select {} - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - select { - case <-c: - print(2) - } - println() // ok -} - -func _() int { -L: - print(1) - select { - case <-c: - print(2) - panic("abc") - goto L // ERROR "unreachable code" - case c <- 1: - print(2) - } - println() // ok -} - -func _() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - default: - print(2) - } - println() // ok -} - -func _() int { - print(1) - select { - default: - break - } - println() // ok -} - -func _() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - break // ERROR "unreachable code" - } - println() // ok -} - -func _() int { - print(1) -L: - select { - case <-c: - print(2) - for { - break L - } - } - println() // ok -} - -func _() int { - print(1) -L: - select { - case <-c: - print(2) - panic("abc") - case c <- 1: - print(2) - break L - } - println() // ok -} - -func _() int { - print(1) - select { - case <-c: - print(1) - panic("abc") - default: - select {} - break // ERROR "unreachable code" - } - println() // ok -} - -func _() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - println() // ERROR "unreachable code" - default: - return 4 - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - default: - return 4 - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - switch x { - default: - return 4 - println() // ERROR "unreachable code" - case 1: - print(2) - panic(3) - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - switch x { - default: - return 4 - case 1: - print(2) - panic(3) - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - switch x { - case 1: - print(2) - fallthrough - default: - return 4 - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - switch x { - case 1: - print(2) - fallthrough - default: - return 4 - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - switch { - } - println() // ok -} - -func _() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - case 2: - return 4 - } - println() // ok -} - -func _() int { - print(1) - switch x { - case 2: - return 4 - case 1: - print(2) - panic(3) - } - println() // ok -} - -func _() int { - print(1) - switch x { - case 1: - print(2) - fallthrough - case 2: - return 4 - } - println() // ok -} - -func _() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - } - println() // ok -} - -func _() int { - print(1) -L: - switch x { - case 1: - print(2) - panic(3) - break L // ERROR "unreachable code" - default: - return 4 - } - println() // ok -} - -func _() int { - print(1) - switch x { - default: - return 4 - break // ERROR "unreachable code" - case 1: - print(2) - panic(3) - } - println() // ok -} - -func _() int { - print(1) -L: - switch x { - case 1: - print(2) - for { - break L - } - default: - return 4 - } - println() // ok -} - -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - println() // ERROR "unreachable code" - default: - return 4 - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - default: - return 4 - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - switch x.(type) { - default: - return 4 - println() // ERROR "unreachable code" - case int: - print(2) - panic(3) - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - switch x.(type) { - default: - return 4 - case int: - print(2) - panic(3) - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - default: - return 4 - println() // ERROR "unreachable code" - } -} - -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - default: - return 4 - } - println() // ERROR "unreachable code" -} - -func _() int { - print(1) - switch { - } - println() // ok -} - -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - case float64: - return 4 - } - println() // ok -} - -func _() int { - print(1) - switch x.(type) { - case float64: - return 4 - case int: - print(2) - panic(3) - } - println() // ok -} - -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - case float64: - return 4 - } - println() // ok -} - -func _() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - } - println() // ok -} - -func _() int { - print(1) -L: - switch x.(type) { - case int: - print(2) - panic(3) - break L // ERROR "unreachable code" - default: - return 4 - } - println() // ok -} - -func _() int { - print(1) - switch x.(type) { - default: - return 4 - break // ERROR "unreachable code" - case int: - print(2) - panic(3) - } - println() // ok -} - -func _() int { - print(1) -L: - switch x.(type) { - case int: - print(2) - for { - break L - } - default: - return 4 - } - println() // ok -} - -// again, but without the leading print(1). -// testing that everything works when the terminating statement is first. - -func _() int { - println() // ok -} - -func _() int { - return 2 - println() // ERROR "unreachable code" -} - -func _() int { -L: - goto L - println() // ERROR "unreachable code" -} - -func _() int { - panic(2) - println() // ERROR "unreachable code" -} - -// but only builtin panic -func _() int { - var panic = func(int) {} - panic(2) - println() // ok -} - -func _() int { - { - return 2 - println() // ERROR "unreachable code" - } -} - -func _() int { - { - return 2 - } - println() // ERROR "unreachable code" -} - -func _() int { -L: - { - goto L - println() // ERROR "unreachable code" - } -} - -func _() int { -L: - { - goto L - } - println() // ERROR "unreachable code" -} - -func _() int { - { - panic(2) - println() // ERROR "unreachable code" - } -} - -func _() int { - { - panic(2) - } - println() // ERROR "unreachable code" -} - -func _() int { - return 2 - { // ERROR "unreachable code" - } - println() // ok -} - -func _() int { -L: - goto L - { // ERROR "unreachable code" - } - println() // ok -} - -func _() int { - panic(2) - { // ERROR "unreachable code" - } - println() // ok -} - -func _() int { - { - return 2 - { // ERROR "unreachable code" - } - } - println() // ok -} - -func _() int { -L: - { - goto L - { // ERROR "unreachable code" - } - } - println() // ok -} - -func _() int { - { - panic(2) - { // ERROR "unreachable code" - } - } - println() // ok -} - -func _() int { - { - return 2 - } - { // ERROR "unreachable code" - } - println() // ok -} - -func _() int { -L: - { - goto L - } - { // ERROR "unreachable code" - } - println() // ok -} - -func _() int { - { - panic(2) - } - { // ERROR "unreachable code" - } - println() // ok -} - -// again, with func literals - -var _ = func() int { -} - -var _ = func() int { - print(1) -} - -var _ = func() int { - print(1) - return 2 - println() // ERROR "unreachable code" -} - -var _ = func() int { -L: - print(1) - goto L - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - panic(2) - println() // ERROR "unreachable code" -} - -// but only builtin panic -var _ = func() int { - var panic = func(int) {} - print(1) - panic(2) - println() // ok -} - -var _ = func() int { - { - print(1) - return 2 - println() // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { - { - print(1) - return 2 - } - println() // ERROR "unreachable code" -} - -var _ = func() int { -L: - { - print(1) - goto L - println() // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { -L: - { - print(1) - goto L - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - { - panic(2) - } -} - -var _ = func() int { - print(1) - { - panic(2) - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - { - panic(2) - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - return 2 - { // ERROR "unreachable code" - } -} - -var _ = func() int { -L: - print(1) - goto L - { // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - panic(2) - { // ERROR "unreachable code" - } -} - -var _ = func() int { - { - print(1) - return 2 - { // ERROR "unreachable code" - } - } -} - -var _ = func() int { -L: - { - print(1) - goto L - { // ERROR "unreachable code" - } - } -} - -var _ = func() int { - print(1) - { - panic(2) - { // ERROR "unreachable code" - } - } -} - -var _ = func() int { - { - print(1) - return 2 - } - { // ERROR "unreachable code" - } -} - -var _ = func() int { -L: - { - print(1) - goto L - } - { // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - { - panic(2) - } - { // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - if x == nil { - panic(2) - } else { - panic(3) - } - println() // ERROR "unreachable code" -} - -var _ = func() int { -L: - print(1) - if x == nil { - panic(2) - } else { - goto L - } - println() // ERROR "unreachable code" -} - -var _ = func() int { -L: - print(1) - if x == nil { - panic(2) - } else if x == 1 { - return 0 - } else if x != 2 { - panic(3) - } else { - goto L - } - println() // ERROR "unreachable code" -} - -// if-else chain missing final else is not okay, even if the -// conditions cover every possible case. - -var _ = func() int { - print(1) - if x == nil { - panic(2) - } else if x != nil { - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) - if x == nil { - panic(2) - } - println() // ok -} - -var _ = func() int { -L: - print(1) - if x == nil { - panic(2) - } else if x == 1 { - return 0 - } else if x != 1 { - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) - for { - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - for { - for { - break - } - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - for { - for { - break - println() // ERROR "unreachable code" - } - } -} - -var _ = func() int { - for { - for { - continue - println() // ERROR "unreachable code" - } - } -} - -var _ = func() int { - for { - L: - for { - break L - } - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - for { - break - } - println() // ok -} - -var _ = func() int { - for { - for { - } - break // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { -L: - for { - for { - break L - } - } - println() // ok -} - -var _ = func() int { - print(1) - for x == nil { - } - println() // ok -} - -var _ = func() int { - for x == nil { - for { - break - } - } - println() // ok -} - -var _ = func() int { - for x == nil { - L: - for { - break L - } - } - println() // ok -} - -var _ = func() int { - print(1) - for true { - } - println() // ok -} - -var _ = func() int { - for true { - for { - break - } - } - println() // ok -} - -var _ = func() int { - for true { - L: - for { - break L - } - } - println() // ok -} - -var _ = func() int { - print(1) - select {} - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - for { - } - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - for { - } - } - println() // ERROR "unreachable code" -} - -var _ = func() int { -L: - print(1) - select { - case <-c: - print(2) - panic("abc") - println() // ERROR "unreachable code" - case c <- 1: - print(2) - goto L - println() // ERROR "unreachable code" - } -} - -var _ = func() int { -L: - print(1) - select { - case <-c: - print(2) - panic("abc") - case c <- 1: - print(2) - goto L - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - println() // ERROR "unreachable code" - default: - select {} - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - default: - select {} - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - } - println() // ok -} - -var _ = func() int { -L: - print(1) - select { - case <-c: - print(2) - panic("abc") - goto L // ERROR "unreachable code" - case c <- 1: - print(2) - } - println() // ok -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - default: - print(2) - } - println() // ok -} - -var _ = func() int { - print(1) - select { - default: - break - } - println() // ok -} - -var _ = func() int { - print(1) - select { - case <-c: - print(2) - panic("abc") - break // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { - print(1) -L: - select { - case <-c: - print(2) - for { - break L - } - } - println() // ok -} - -var _ = func() int { - print(1) -L: - select { - case <-c: - print(2) - panic("abc") - case c <- 1: - print(2) - break L - } - println() // ok -} - -var _ = func() int { - print(1) - select { - case <-c: - print(1) - panic("abc") - default: - select {} - break // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - println() // ERROR "unreachable code" - default: - return 4 - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - default: - return 4 - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - switch x { - default: - return 4 - println() // ERROR "unreachable code" - case 1: - print(2) - panic(3) - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - switch x { - default: - return 4 - case 1: - print(2) - panic(3) - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - switch x { - case 1: - print(2) - fallthrough - default: - return 4 - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - switch x { - case 1: - print(2) - fallthrough - default: - return 4 - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - switch { - } - println() // ok -} - -var _ = func() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - case 2: - return 4 - } - println() // ok -} - -var _ = func() int { - print(1) - switch x { - case 2: - return 4 - case 1: - print(2) - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) - switch x { - case 1: - print(2) - fallthrough - case 2: - return 4 - } - println() // ok -} - -var _ = func() int { - print(1) - switch x { - case 1: - print(2) - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) -L: - switch x { - case 1: - print(2) - panic(3) - break L // ERROR "unreachable code" - default: - return 4 - } - println() // ok -} - -var _ = func() int { - print(1) - switch x { - default: - return 4 - break // ERROR "unreachable code" - case 1: - print(2) - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) -L: - switch x { - case 1: - print(2) - for { - break L - } - default: - return 4 - } - println() // ok -} - -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - println() // ERROR "unreachable code" - default: - return 4 - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - default: - return 4 - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - switch x.(type) { - default: - return 4 - println() // ERROR "unreachable code" - case int: - print(2) - panic(3) - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - switch x.(type) { - default: - return 4 - case int: - print(2) - panic(3) - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - default: - return 4 - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - default: - return 4 - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - print(1) - switch { - } - println() // ok -} - -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - case float64: - return 4 - } - println() // ok -} - -var _ = func() int { - print(1) - switch x.(type) { - case float64: - return 4 - case int: - print(2) - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - fallthrough - case float64: - return 4 - } - println() // ok -} - -var _ = func() int { - print(1) - switch x.(type) { - case int: - print(2) - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) -L: - switch x.(type) { - case int: - print(2) - panic(3) - break L // ERROR "unreachable code" - default: - return 4 - } - println() // ok -} - -var _ = func() int { - print(1) - switch x.(type) { - default: - return 4 - break // ERROR "unreachable code" - case int: - print(2) - panic(3) - } - println() // ok -} - -var _ = func() int { - print(1) -L: - switch x.(type) { - case int: - print(2) - for { - break L - } - default: - return 4 - } - println() // ok -} - -// again, but without the leading print(1). -// testing that everything works when the terminating statement is first. - -var _ = func() int { - println() // ok -} - -var _ = func() int { - return 2 - println() // ERROR "unreachable code" -} - -var _ = func() int { -L: - goto L - println() // ERROR "unreachable code" -} - -var _ = func() int { - panic(2) - println() // ERROR "unreachable code" -} - -// but only builtin panic -var _ = func() int { - var panic = func(int) {} - panic(2) - println() // ok -} - -var _ = func() int { - { - return 2 - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - { - return 2 - } - println() // ERROR "unreachable code" -} - -var _ = func() int { -L: - { - goto L - println() // ERROR "unreachable code" - } -} - -var _ = func() int { -L: - { - goto L - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - { - panic(2) - println() // ERROR "unreachable code" - } -} - -var _ = func() int { - { - panic(2) - } - println() // ERROR "unreachable code" -} - -var _ = func() int { - return 2 - { // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { -L: - goto L - { // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { - panic(2) - { // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { - { - return 2 - { // ERROR "unreachable code" - } - } - println() // ok -} - -var _ = func() int { -L: - { - goto L - { // ERROR "unreachable code" - } - } - println() // ok -} - -var _ = func() int { - { - panic(2) - { // ERROR "unreachable code" - } - } - println() // ok -} - -var _ = func() int { - { - return 2 - } - { // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { -L: - { - goto L - } - { // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() int { - { - panic(2) - } - { // ERROR "unreachable code" - } - println() // ok -} - -var _ = func() { - // goto without label used to panic - goto -} - -func _() int { - // Empty switch tag with non-bool case value used to panic. - switch { - case 1: - println() - } - println() -} diff --git a/src/cmd/vet/testdata/divergent/buf.go b/src/cmd/vet/testdata/divergent/buf.go deleted file mode 100644 index 0efe0f838d56e..0000000000000 --- a/src/cmd/vet/testdata/divergent/buf.go +++ /dev/null @@ -1,17 +0,0 @@ -// Test of examples with divergent packages. - -// Package buf ... -package buf - -// Buf is a ... -type Buf []byte - -// Append ... -func (*Buf) Append([]byte) {} - -func (Buf) Reset() {} - -func (Buf) Len() int { return 0 } - -// DefaultBuf is a ... -var DefaultBuf Buf diff --git a/src/cmd/vet/testdata/divergent/buf_test.go b/src/cmd/vet/testdata/divergent/buf_test.go deleted file mode 100644 index b75d55eaf4f2d..0000000000000 --- a/src/cmd/vet/testdata/divergent/buf_test.go +++ /dev/null @@ -1,35 +0,0 @@ -// Test of examples with divergent packages. - -package buf_test - -func Example() {} // OK because is package-level. - -func Example_suffix() {} // OK because refers to suffix annotation. - -func Example_BadSuffix() {} // ERROR "Example_BadSuffix has malformed example suffix: BadSuffix" - -func ExampleBuf() {} // OK because refers to known top-level type. - -func ExampleBuf_Append() {} // OK because refers to known method. - -func ExampleBuf_Clear() {} // ERROR "ExampleBuf_Clear refers to unknown field or method: Buf.Clear" - -func ExampleBuf_suffix() {} // OK because refers to suffix annotation. - -func ExampleBuf_Append_Bad() {} // ERROR "ExampleBuf_Append_Bad has malformed example suffix: Bad" - -func ExampleBuf_Append_suffix() {} // OK because refers to known method with valid suffix. - -func ExampleDefaultBuf() {} // OK because refers to top-level identifier. - -func ExampleBuf_Reset() bool { return true } // ERROR "ExampleBuf_Reset should return nothing" - -func ExampleBuf_Len(i int) {} // ERROR "ExampleBuf_Len should be niladic" - -// "Puffer" is German for "Buffer". - -func ExamplePuffer() {} // ERROR "ExamplePuffer refers to unknown identifier: Puffer" - -func ExamplePuffer_Append() {} // ERROR "ExamplePuffer_Append refers to unknown identifier: Puffer" - -func ExamplePuffer_suffix() {} // ERROR "ExamplePuffer_suffix refers to unknown identifier: Puffer" diff --git a/src/cmd/vet/testdata/httpresponse.go b/src/cmd/vet/testdata/httpresponse.go deleted file mode 100644 index 7302a64a3b6a5..0000000000000 --- a/src/cmd/vet/testdata/httpresponse.go +++ /dev/null @@ -1,85 +0,0 @@ -package testdata - -import ( - "log" - "net/http" -) - -func goodHTTPGet() { - res, err := http.Get("http://foo.com") - if err != nil { - log.Fatal(err) - } - defer res.Body.Close() -} - -func badHTTPGet() { - res, err := http.Get("http://foo.com") - defer res.Body.Close() // ERROR "using res before checking for errors" - if err != nil { - log.Fatal(err) - } -} - -func badHTTPHead() { - res, err := http.Head("http://foo.com") - defer res.Body.Close() // ERROR "using res before checking for errors" - if err != nil { - log.Fatal(err) - } -} - -func goodClientGet() { - client := http.DefaultClient - res, err := client.Get("http://foo.com") - if err != nil { - log.Fatal(err) - } - defer res.Body.Close() -} - -func badClientPtrGet() { - client := http.DefaultClient - resp, err := client.Get("http://foo.com") - defer resp.Body.Close() // ERROR "using resp before checking for errors" - if err != nil { - log.Fatal(err) - } -} - -func badClientGet() { - client := http.Client{} - resp, err := client.Get("http://foo.com") - defer resp.Body.Close() // ERROR "using resp before checking for errors" - if err != nil { - log.Fatal(err) - } -} - -func badClientPtrDo() { - client := http.DefaultClient - req, err := http.NewRequest("GET", "http://foo.com", nil) - if err != nil { - log.Fatal(err) - } - - resp, err := client.Do(req) - defer resp.Body.Close() // ERROR "using resp before checking for errors" - if err != nil { - log.Fatal(err) - } -} - -func badClientDo() { - var client http.Client - req, err := http.NewRequest("GET", "http://foo.com", nil) - if err != nil { - log.Fatal(err) - } - - resp, err := client.Do(req) - defer resp.Body.Close() // ERROR "using resp before checking for errors" - if err != nil { - log.Fatal(err) - } -} diff --git a/src/cmd/vet/testdata/incomplete/examples_test.go b/src/cmd/vet/testdata/incomplete/examples_test.go deleted file mode 100644 index 445502b39ecde..0000000000000 --- a/src/cmd/vet/testdata/incomplete/examples_test.go +++ /dev/null @@ -1,33 +0,0 @@ -// Test of examples. - -package testdata - -func Example() {} // OK because is package-level. - -func Example_suffix() // OK because refers to suffix annotation. - -func Example_BadSuffix() // OK because non-test package was excluded. No false positives wanted. - -func ExampleBuf() // OK because non-test package was excluded. No false positives wanted. - -func ExampleBuf_Append() {} // OK because non-test package was excluded. No false positives wanted. - -func ExampleBuf_Clear() {} // OK because non-test package was excluded. No false positives wanted. - -func ExampleBuf_suffix() {} // OK because refers to suffix annotation. - -func ExampleBuf_Append_Bad() {} // OK because non-test package was excluded. No false positives wanted. - -func ExampleBuf_Append_suffix() {} // OK because refers to known method with valid suffix. - -func ExampleBuf_Reset() bool { return true } // ERROR "ExampleBuf_Reset should return nothing" - -func ExampleBuf_Len(i int) {} // ERROR "ExampleBuf_Len should be niladic" - -// "Puffer" is German for "Buffer". - -func ExamplePuffer() // OK because non-test package was excluded. No false positives wanted. - -func ExamplePuffer_Append() // OK because non-test package was excluded. No false positives wanted. - -func ExamplePuffer_suffix() // OK because non-test package was excluded. No false positives wanted. diff --git a/src/cmd/vet/testdata/lostcancel.go b/src/cmd/vet/testdata/lostcancel.go deleted file mode 100644 index b7549c0051112..0000000000000 --- a/src/cmd/vet/testdata/lostcancel.go +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package testdata - -import ( - "context" - "log" - "os" - "testing" -) - -// Check the three functions and assignment forms (var, :=, =) we look for. -// (Do these early: line numbers are fragile.) -func _() { - var ctx, cancel = context.WithCancel() // ERROR "the cancel function is not used on all paths \(possible context leak\)" -} // ERROR "this return statement may be reached without using the cancel var defined on line 17" - -func _() { - ctx, cancel2 := context.WithDeadline() // ERROR "the cancel2 function is not used..." -} // ERROR "may be reached without using the cancel2 var defined on line 21" - -func _() { - var ctx context.Context - var cancel3 func() - ctx, cancel3 = context.WithTimeout() // ERROR "function is not used..." -} // ERROR "this return statement may be reached without using the cancel3 var defined on line 27" - -func _() { - ctx, _ := context.WithCancel() // ERROR "the cancel function returned by context.WithCancel should be called, not discarded, to avoid a context leak" - ctx, _ = context.WithTimeout() // ERROR "the cancel function returned by context.WithTimeout should be called, not discarded, to avoid a context leak" - ctx, _ = context.WithDeadline() // ERROR "the cancel function returned by context.WithDeadline should be called, not discarded, to avoid a context leak" -} - -func _() { - ctx, cancel := context.WithCancel() - defer cancel() // ok -} - -func _() { - ctx, cancel := context.WithCancel() // ERROR "not used on all paths" - if condition { - cancel() - } - return // ERROR "this return statement may be reached without using the cancel var" -} - -func _() { - ctx, cancel := context.WithCancel() - if condition { - cancel() - } else { - // ok: infinite loop - for { - print(0) - } - } -} - -func _() { - ctx, cancel := context.WithCancel() // ERROR "not used on all paths" - if condition { - cancel() - } else { - for i := 0; i < 10; i++ { - print(0) - } - } -} // ERROR "this return statement may be reached without using the cancel var" - -func _() { - ctx, cancel := context.WithCancel() - // ok: used on all paths - switch someInt { - case 0: - new(testing.T).FailNow() - case 1: - log.Fatal() - case 2: - cancel() - case 3: - print("hi") - fallthrough - default: - os.Exit(1) - } -} - -func _() { - ctx, cancel := context.WithCancel() // ERROR "not used on all paths" - switch someInt { - case 0: - new(testing.T).FailNow() - case 1: - log.Fatal() - case 2: - cancel() - case 3: - print("hi") // falls through to implicit return - default: - os.Exit(1) - } -} // ERROR "this return statement may be reached without using the cancel var" - -func _(ch chan int) int { - ctx, cancel := context.WithCancel() // ERROR "not used on all paths" - select { - case <-ch: - new(testing.T).FailNow() - case y <- ch: - print("hi") // falls through to implicit return - case ch <- 1: - cancel() - default: - os.Exit(1) - } -} // ERROR "this return statement may be reached without using the cancel var" - -func _(ch chan int) int { - ctx, cancel := context.WithCancel() - // A blocking select must execute one of its cases. - select { - case <-ch: - panic() - } -} - -func _() { - go func() { - ctx, cancel := context.WithCancel() // ERROR "not used on all paths" - print(ctx) - }() // ERROR "may be reached without using the cancel var" -} - -var condition bool -var someInt int - -// Regression test for Go issue 16143. -func _() { - var x struct{ f func() } - x.f() -} - -// Regression test for Go issue 16230. -func _() (ctx context.Context, cancel func()) { - ctx, cancel = context.WithCancel() - return // a naked return counts as a load of the named result values -} - -// Same as above, but for literal function. -var _ = func() (ctx context.Context, cancel func()) { - ctx, cancel = context.WithCancel() - return -} diff --git a/src/cmd/vet/testdata/nilfunc.go b/src/cmd/vet/testdata/nilfunc.go deleted file mode 100644 index 2ce7bc8ca82ec..0000000000000 --- a/src/cmd/vet/testdata/nilfunc.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package testdata - -func F() {} - -type T struct { - F func() -} - -func (T) M() {} - -var Fv = F - -func Comparison() { - var t T - var fn func() - if fn == nil || Fv == nil || t.F == nil { - // no error; these func vars or fields may be nil - } - if F == nil { // ERROR "comparison of function F == nil is always false" - panic("can't happen") - } - if t.M == nil { // ERROR "comparison of function M == nil is always false" - panic("can't happen") - } - if F != nil { // ERROR "comparison of function F != nil is always true" - if t.M != nil { // ERROR "comparison of function M != nil is always true" - return - } - } - panic("can't happen") -} diff --git a/src/cmd/vet/testdata/rangeloop.go b/src/cmd/vet/testdata/rangeloop.go deleted file mode 100644 index cd3b4cbc45223..0000000000000 --- a/src/cmd/vet/testdata/rangeloop.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2012 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. - -// This file contains tests for the rangeloop checker. - -package testdata - -func RangeLoopTests() { - var s []int - for i, v := range s { - go func() { - println(i) // ERROR "loop variable i captured by func literal" - println(v) // ERROR "loop variable v captured by func literal" - }() - } - for i, v := range s { - defer func() { - println(i) // ERROR "loop variable i captured by func literal" - println(v) // ERROR "loop variable v captured by func literal" - }() - } - for i := range s { - go func() { - println(i) // ERROR "loop variable i captured by func literal" - }() - } - for _, v := range s { - go func() { - println(v) // ERROR "loop variable v captured by func literal" - }() - } - for i, v := range s { - go func() { - println(i, v) - }() - println("unfortunately, we don't catch the error above because of this statement") - } - for i, v := range s { - go func(i, v int) { - println(i, v) - }(i, v) - } - for i, v := range s { - i, v := i, v - go func() { - println(i, v) - }() - } - // If the key of the range statement is not an identifier - // the code should not panic (it used to). - var x [2]int - var f int - for x[0], f = range s { - go func() { - _ = f // ERROR "loop variable f captured by func literal" - }() - } - type T struct { - v int - } - for _, v := range s { - go func() { - _ = T{v: 1} - _ = []int{v: 1} // ERROR "loop variable v captured by func literal" - }() - } - - // ordinary for-loops - for i := 0; i < 10; i++ { - go func() { - print(i) // ERROR "loop variable i captured by func literal" - }() - } - for i, j := 0, 1; i < 100; i, j = j, i+j { - go func() { - print(j) // ERROR "loop variable j captured by func literal" - }() - } - type cons struct { - car int - cdr *cons - } - var head *cons - for p := head; p != nil; p = p.next { - go func() { - print(p.car) // ERROR "loop variable p captured by func literal" - }() - } -} diff --git a/src/cmd/vet/testdata/shadow.go b/src/cmd/vet/testdata/shadow.go deleted file mode 100644 index d10fde2b811d0..0000000000000 --- a/src/cmd/vet/testdata/shadow.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2013 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. - -// This file contains tests for the shadowed variable checker. -// Some of these errors are caught by the compiler (shadowed return parameters for example) -// but are nonetheless useful tests. - -package testdata - -import "os" - -func ShadowRead(f *os.File, buf []byte) (err error) { - var x int - if f != nil { - err := 3 // OK - different type. - _ = err - } - if f != nil { - _, err := f.Read(buf) // ERROR "declaration of .err. shadows declaration at shadow.go:13" - if err != nil { - return err - } - i := 3 // OK - _ = i - } - if f != nil { - x := one() // ERROR "declaration of .x. shadows declaration at shadow.go:14" - var _, err = f.Read(buf) // ERROR "declaration of .err. shadows declaration at shadow.go:13" - if x == 1 && err != nil { - return err - } - } - for i := 0; i < 10; i++ { - i := i // OK: obviously intentional idiomatic redeclaration - go func() { - println(i) - }() - } - var shadowTemp interface{} - switch shadowTemp := shadowTemp.(type) { // OK: obviously intentional idiomatic redeclaration - case int: - println("OK") - _ = shadowTemp - } - if shadowTemp := shadowTemp; true { // OK: obviously intentional idiomatic redeclaration - var f *os.File // OK because f is not mentioned later in the function. - // The declaration of x is a shadow because x is mentioned below. - var x int // ERROR "declaration of .x. shadows declaration at shadow.go:14" - _, _, _ = x, f, shadowTemp - } - // Use a couple of variables to trigger shadowing errors. - _, _ = err, x - return -} - -func one() int { - return 1 -} - -// Must not complain with an internal error for the -// implicitly declared type switch variable v. -func issue26725(x interface{}) int { - switch v := x.(type) { - case int, int32: - if v, ok := x.(int); ok { - return v - } - case int64: - return int(v) - } - return 0 -} - -// Verify that implicitly declared variables from -// type switches are considered in shadowing analysis. -func shadowTypeSwitch(a interface{}) { - switch t := a.(type) { - case int: - { - t := 0 // ERROR "declaration of .t. shadows declaration at shadow.go:78" - _ = t - } - _ = t - case uint: - { - t := uint(0) // OK because t is not mentioned later in this function - _ = t - } - } -} diff --git a/src/cmd/vet/testdata/shift.go b/src/cmd/vet/testdata/shift.go deleted file mode 100644 index 73cbaf884180c..0000000000000 --- a/src/cmd/vet/testdata/shift.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2014 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. - -// This file contains tests for the suspicious shift checker. - -package testdata - -import ( - "fmt" - "unsafe" -) - -func ShiftTest() { - var i8 int8 - _ = i8 << 7 - _ = (i8 + 1) << 8 // ERROR ".i8 . 1. .8 bits. too small for shift of 8" - _ = i8 << (7 + 1) // ERROR "i8 .8 bits. too small for shift of 8" - _ = i8 >> 8 // ERROR "i8 .8 bits. too small for shift of 8" - i8 <<= 8 // ERROR "i8 .8 bits. too small for shift of 8" - i8 >>= 8 // ERROR "i8 .8 bits. too small for shift of 8" - var i16 int16 - _ = i16 << 15 - _ = i16 << 16 // ERROR "i16 .16 bits. too small for shift of 16" - _ = i16 >> 16 // ERROR "i16 .16 bits. too small for shift of 16" - i16 <<= 16 // ERROR "i16 .16 bits. too small for shift of 16" - i16 >>= 16 // ERROR "i16 .16 bits. too small for shift of 16" - var i32 int32 - _ = i32 << 31 - _ = i32 << 32 // ERROR "i32 .32 bits. too small for shift of 32" - _ = i32 >> 32 // ERROR "i32 .32 bits. too small for shift of 32" - i32 <<= 32 // ERROR "i32 .32 bits. too small for shift of 32" - i32 >>= 32 // ERROR "i32 .32 bits. too small for shift of 32" - var i64 int64 - _ = i64 << 63 - _ = i64 << 64 // ERROR "i64 .64 bits. too small for shift of 64" - _ = i64 >> 64 // ERROR "i64 .64 bits. too small for shift of 64" - i64 <<= 64 // ERROR "i64 .64 bits. too small for shift of 64" - i64 >>= 64 // ERROR "i64 .64 bits. too small for shift of 64" - var u8 uint8 - _ = u8 << 7 - _ = u8 << 8 // ERROR "u8 .8 bits. too small for shift of 8" - _ = u8 >> 8 // ERROR "u8 .8 bits. too small for shift of 8" - u8 <<= 8 // ERROR "u8 .8 bits. too small for shift of 8" - u8 >>= 8 // ERROR "u8 .8 bits. too small for shift of 8" - var u16 uint16 - _ = u16 << 15 - _ = u16 << 16 // ERROR "u16 .16 bits. too small for shift of 16" - _ = u16 >> 16 // ERROR "u16 .16 bits. too small for shift of 16" - u16 <<= 16 // ERROR "u16 .16 bits. too small for shift of 16" - u16 >>= 16 // ERROR "u16 .16 bits. too small for shift of 16" - var u32 uint32 - _ = u32 << 31 - _ = u32 << 32 // ERROR "u32 .32 bits. too small for shift of 32" - _ = u32 >> 32 // ERROR "u32 .32 bits. too small for shift of 32" - u32 <<= 32 // ERROR "u32 .32 bits. too small for shift of 32" - u32 >>= 32 // ERROR "u32 .32 bits. too small for shift of 32" - var u64 uint64 - _ = u64 << 63 - _ = u64 << 64 // ERROR "u64 .64 bits. too small for shift of 64" - _ = u64 >> 64 // ERROR "u64 .64 bits. too small for shift of 64" - u64 <<= 64 // ERROR "u64 .64 bits. too small for shift of 64" - u64 >>= 64 // ERROR "u64 .64 bits. too small for shift of 64" - _ = u64 << u64 // Non-constant shifts should succeed. - - var i int - _ = i << 31 - const in = 8 * unsafe.Sizeof(i) - _ = i << in // ERROR "too small for shift" - _ = i >> in // ERROR "too small for shift" - i <<= in // ERROR "too small for shift" - i >>= in // ERROR "too small for shift" - const ix = 8*unsafe.Sizeof(i) - 1 - _ = i << ix - _ = i >> ix - i <<= ix - i >>= ix - - var u uint - _ = u << 31 - const un = 8 * unsafe.Sizeof(u) - _ = u << un // ERROR "too small for shift" - _ = u >> un // ERROR "too small for shift" - u <<= un // ERROR "too small for shift" - u >>= un // ERROR "too small for shift" - const ux = 8*unsafe.Sizeof(u) - 1 - _ = u << ux - _ = u >> ux - u <<= ux - u >>= ux - - var p uintptr - _ = p << 31 - const pn = 8 * unsafe.Sizeof(p) - _ = p << pn // ERROR "too small for shift" - _ = p >> pn // ERROR "too small for shift" - p <<= pn // ERROR "too small for shift" - p >>= pn // ERROR "too small for shift" - const px = 8*unsafe.Sizeof(p) - 1 - _ = p << px - _ = p >> px - p <<= px - p >>= px - - const oneIf64Bit = ^uint(0) >> 63 // allow large shifts of constants; they are used for 32/64 bit compatibility tricks - - var h uintptr - h = h<<8 | (h >> (8 * (unsafe.Sizeof(h) - 1))) - h <<= 8 * unsafe.Sizeof(h) // ERROR "too small for shift" - h >>= 7 * unsafe.Alignof(h) - h >>= 8 * unsafe.Alignof(h) // ERROR "too small for shift" -} - -func ShiftDeadCode() { - var i int - const iBits = 8 * unsafe.Sizeof(i) - - if iBits <= 32 { - if iBits == 16 { - _ = i >> 8 - } else { - _ = i >> 16 - } - } else { - _ = i >> 32 - } - - if iBits >= 64 { - _ = i << 32 - if iBits == 128 { - _ = i << 64 - } - } else { - _ = i << 16 - } - - if iBits == 64 { - _ = i << 32 - } - - switch iBits { - case 128, 64: - _ = i << 32 - default: - _ = i << 16 - } - - switch { - case iBits < 32: - _ = i << 16 - case iBits > 64: - _ = i << 64 - default: - _ = i << 64 // ERROR "too small for shift" - } - - // Make sure other vet checks work in dead code. - if iBits == 1024 { - _ = i << 512 // OK - fmt.Printf("foo %s bar", 123) // ERROR "Printf" - } -} diff --git a/src/cmd/vet/testdata/src/asm/asm.go b/src/cmd/vet/testdata/src/asm/asm.go new file mode 100644 index 0000000000000..72ff452aae844 --- /dev/null +++ b/src/cmd/vet/testdata/src/asm/asm.go @@ -0,0 +1,9 @@ +// Copyright 2010 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. + +// This file contains declarations to test the assembly in asm1.s. + +package testdata + +func arg1(x int8, y uint8) diff --git a/src/cmd/vet/testdata/src/asm/asm1.s b/src/cmd/vet/testdata/src/asm/asm1.s new file mode 100644 index 0000000000000..c3ba986fb8b12 --- /dev/null +++ b/src/cmd/vet/testdata/src/asm/asm1.s @@ -0,0 +1,8 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build amd64 + +TEXT ·arg1(SB),0,$0-2 + MOVW x+0(FP), AX // ERROR "\[amd64\] arg1: invalid MOVW of x\+0\(FP\); int8 is 1-byte value" diff --git a/src/cmd/vet/testdata/assign.go b/src/cmd/vet/testdata/src/assign/assign.go similarity index 97% rename from src/cmd/vet/testdata/assign.go rename to src/cmd/vet/testdata/src/assign/assign.go index 6140ad4db8cc0..112614e562c68 100644 --- a/src/cmd/vet/testdata/assign.go +++ b/src/cmd/vet/testdata/src/assign/assign.go @@ -4,7 +4,7 @@ // This file contains tests for the useless-assignment checker. -package testdata +package assign import "math/rand" diff --git a/src/cmd/vet/testdata/src/atomic/atomic.go b/src/cmd/vet/testdata/src/atomic/atomic.go new file mode 100644 index 0000000000000..650d56bdadaef --- /dev/null +++ b/src/cmd/vet/testdata/src/atomic/atomic.go @@ -0,0 +1,14 @@ +// Copyright 2013 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. + +// This file contains tests for the atomic checker. + +package atomic + +import "sync/atomic" + +func AtomicTests() { + x := uint64(1) + x = atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value" +} diff --git a/src/cmd/vet/testdata/src/bool/bool.go b/src/cmd/vet/testdata/src/bool/bool.go new file mode 100644 index 0000000000000..20e01aa46f091 --- /dev/null +++ b/src/cmd/vet/testdata/src/bool/bool.go @@ -0,0 +1,14 @@ +// Copyright 2014 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. + +// This file contains tests for the bool checker. + +package bool + +func _() { + var f, g func() int + + if v, w := f(), g(); v == w || v == w { // ERROR "redundant or: v == w || v == w" + } +} diff --git a/src/cmd/vet/testdata/buildtag/buildtag.go b/src/cmd/vet/testdata/src/buildtag/buildtag.go similarity index 100% rename from src/cmd/vet/testdata/buildtag/buildtag.go rename to src/cmd/vet/testdata/src/buildtag/buildtag.go diff --git a/src/cmd/vet/testdata/src/cgo/cgo.go b/src/cmd/vet/testdata/src/cgo/cgo.go new file mode 100644 index 0000000000000..292d7fdab7dff --- /dev/null +++ b/src/cmd/vet/testdata/src/cgo/cgo.go @@ -0,0 +1,18 @@ +// Copyright 2015 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. + +// This file contains tests for the cgo checker. + +package testdata + +// void f(void *p) {} +import "C" + +import "unsafe" + +func CgoTests() { + var c chan bool + C.f(*(*unsafe.Pointer)(unsafe.Pointer(&c))) // ERROR "embedded pointer" + C.f(unsafe.Pointer(&c)) // ERROR "embedded pointer" +} diff --git a/src/cmd/vet/testdata/src/composite/composite.go b/src/cmd/vet/testdata/src/composite/composite.go new file mode 100644 index 0000000000000..63a28378515cc --- /dev/null +++ b/src/cmd/vet/testdata/src/composite/composite.go @@ -0,0 +1,24 @@ +// Copyright 2012 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. + +// This file contains the test for untagged struct literals. + +package composite + +import "flag" + +// Testing is awkward because we need to reference things from a separate package +// to trigger the warnings. + +var goodStructLiteral = flag.Flag{ + Name: "Name", + Usage: "Usage", +} + +var badStructLiteral = flag.Flag{ // ERROR "unkeyed fields" + "Name", + "Usage", + nil, // Value + "DefValue", +} diff --git a/src/cmd/vet/testdata/src/copylock/copylock.go b/src/cmd/vet/testdata/src/copylock/copylock.go new file mode 100644 index 0000000000000..8079cf3248b78 --- /dev/null +++ b/src/cmd/vet/testdata/src/copylock/copylock.go @@ -0,0 +1,11 @@ +package copylock + +import "sync" + +func BadFunc() { + var x *sync.Mutex + p := x + var y sync.Mutex + p = &y + *p = *x // ERROR "assignment copies lock value to \*p: sync.Mutex" +} diff --git a/src/cmd/vet/testdata/src/deadcode/deadcode.go b/src/cmd/vet/testdata/src/deadcode/deadcode.go new file mode 100644 index 0000000000000..af83cdfbb1e82 --- /dev/null +++ b/src/cmd/vet/testdata/src/deadcode/deadcode.go @@ -0,0 +1,14 @@ +// Copyright 2013 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. + +// This file contains tests for the dead code checker. + +package deadcode + +func _() int { + print(1) + return 2 + println() // ERROR "unreachable code" + return 3 +} diff --git a/src/cmd/vet/testdata/src/httpresponse/httpresponse.go b/src/cmd/vet/testdata/src/httpresponse/httpresponse.go new file mode 100644 index 0000000000000..6141f6e06dce6 --- /dev/null +++ b/src/cmd/vet/testdata/src/httpresponse/httpresponse.go @@ -0,0 +1,22 @@ +package httpresponse + +import ( + "log" + "net/http" +) + +func goodHTTPGet() { + res, err := http.Get("http://foo.com") + if err != nil { + log.Fatal(err) + } + defer res.Body.Close() +} + +func badHTTPGet() { + res, err := http.Get("http://foo.com") + defer res.Body.Close() // ERROR "using res before checking for errors" + if err != nil { + log.Fatal(err) + } +} diff --git a/src/cmd/vet/testdata/src/lostcancel/lostcancel.go b/src/cmd/vet/testdata/src/lostcancel/lostcancel.go new file mode 100644 index 0000000000000..1bbb22d27b4b3 --- /dev/null +++ b/src/cmd/vet/testdata/src/lostcancel/lostcancel.go @@ -0,0 +1,14 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lostcancel + +import "context" + +func _() { + var _, cancel = context.WithCancel(context.Background()) // ERROR "the cancel function is not used on all paths \(possible context leak\)" + if false { + _ = cancel + } +} // ERROR "this return statement may be reached without using the cancel var defined on line 10" diff --git a/src/cmd/vet/testdata/method.go b/src/cmd/vet/testdata/src/method/method.go similarity index 62% rename from src/cmd/vet/testdata/method.go rename to src/cmd/vet/testdata/src/method/method.go index 978527d09089b..51c3f65fcc728 100644 --- a/src/cmd/vet/testdata/method.go +++ b/src/cmd/vet/testdata/src/method/method.go @@ -2,21 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This file contains tests for the canonical method checker. - // This file contains the code to check canonical methods. -package testdata +package method -import ( - "fmt" -) +import "fmt" type MethodTest int func (t *MethodTest) Scan(x fmt.ScanState, c byte) { // ERROR "should have signature Scan\(fmt\.ScanState, rune\) error" } - -type MethodTestInterface interface { - ReadByte() byte // ERROR "should have signature ReadByte\(\) \(byte, error\)" -} diff --git a/src/cmd/vet/testdata/src/nilfunc/nilfunc.go b/src/cmd/vet/testdata/src/nilfunc/nilfunc.go new file mode 100644 index 0000000000000..c34d60e05214c --- /dev/null +++ b/src/cmd/vet/testdata/src/nilfunc/nilfunc.go @@ -0,0 +1,13 @@ +// Copyright 2013 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package nilfunc + +func F() {} + +func Comparison() { + if F == nil { // ERROR "comparison of function F == nil is always false" + panic("can't happen") + } +} diff --git a/src/cmd/vet/testdata/print.go b/src/cmd/vet/testdata/src/print/print.go similarity index 94% rename from src/cmd/vet/testdata/print.go rename to src/cmd/vet/testdata/src/print/print.go index 994902d01dad7..6bacd0fd747c8 100644 --- a/src/cmd/vet/testdata/print.go +++ b/src/cmd/vet/testdata/src/print/print.go @@ -4,7 +4,7 @@ // This file contains tests for the printf checker. -package testdata +package print import ( "fmt" @@ -126,16 +126,16 @@ func PrintfTests() { fmt.Printf("%U", x) // ERROR "Printf format %U has arg x of wrong type float64" fmt.Printf("%x", nil) // ERROR "Printf format %x has arg nil of wrong type untyped nil" fmt.Printf("%X", 2.3) // ERROR "Printf format %X has arg 2.3 of wrong type float64" - fmt.Printf("%s", stringerv) // ERROR "Printf format %s has arg stringerv of wrong type testdata.ptrStringer" - fmt.Printf("%t", stringerv) // ERROR "Printf format %t has arg stringerv of wrong type testdata.ptrStringer" - fmt.Printf("%s", embeddedStringerv) // ERROR "Printf format %s has arg embeddedStringerv of wrong type testdata.embeddedStringer" - fmt.Printf("%t", embeddedStringerv) // ERROR "Printf format %t has arg embeddedStringerv of wrong type testdata.embeddedStringer" - fmt.Printf("%q", notstringerv) // ERROR "Printf format %q has arg notstringerv of wrong type testdata.notstringer" - fmt.Printf("%t", notstringerv) // ERROR "Printf format %t has arg notstringerv of wrong type testdata.notstringer" - fmt.Printf("%t", stringerarrayv) // ERROR "Printf format %t has arg stringerarrayv of wrong type testdata.stringerarray" - fmt.Printf("%t", notstringerarrayv) // ERROR "Printf format %t has arg notstringerarrayv of wrong type testdata.notstringerarray" - fmt.Printf("%q", notstringerarrayv) // ERROR "Printf format %q has arg notstringerarrayv of wrong type testdata.notstringerarray" - fmt.Printf("%d", BoolFormatter(true)) // ERROR "Printf format %d has arg BoolFormatter\(true\) of wrong type testdata.BoolFormatter" + fmt.Printf("%s", stringerv) // ERROR "Printf format %s has arg stringerv of wrong type print.ptrStringer" + fmt.Printf("%t", stringerv) // ERROR "Printf format %t has arg stringerv of wrong type print.ptrStringer" + fmt.Printf("%s", embeddedStringerv) // ERROR "Printf format %s has arg embeddedStringerv of wrong type print.embeddedStringer" + fmt.Printf("%t", embeddedStringerv) // ERROR "Printf format %t has arg embeddedStringerv of wrong type print.embeddedStringer" + fmt.Printf("%q", notstringerv) // ERROR "Printf format %q has arg notstringerv of wrong type print.notstringer" + fmt.Printf("%t", notstringerv) // ERROR "Printf format %t has arg notstringerv of wrong type print.notstringer" + fmt.Printf("%t", stringerarrayv) // ERROR "Printf format %t has arg stringerarrayv of wrong type print.stringerarray" + fmt.Printf("%t", notstringerarrayv) // ERROR "Printf format %t has arg notstringerarrayv of wrong type print.notstringerarray" + fmt.Printf("%q", notstringerarrayv) // ERROR "Printf format %q has arg notstringerarrayv of wrong type print.notstringerarray" + fmt.Printf("%d", BoolFormatter(true)) // ERROR "Printf format %d has arg BoolFormatter\(true\) of wrong type print.BoolFormatter" fmt.Printf("%z", FormatterVal(true)) // correct (the type is responsible for formatting) fmt.Printf("%d", FormatterVal(true)) // correct (the type is responsible for formatting) fmt.Printf("%s", nonemptyinterface) // correct (the type is responsible for formatting) @@ -186,10 +186,10 @@ func PrintfTests() { Printf("d%", 2) // ERROR "Printf format % is missing verb at end of string" Printf("%d", percentDV) Printf("%d", &percentDV) - Printf("%d", notPercentDV) // ERROR "Printf format %d has arg notPercentDV of wrong type testdata.notPercentDStruct" - Printf("%d", ¬PercentDV) // ERROR "Printf format %d has arg ¬PercentDV of wrong type \*testdata.notPercentDStruct" + Printf("%d", notPercentDV) // ERROR "Printf format %d has arg notPercentDV of wrong type print.notPercentDStruct" + Printf("%d", ¬PercentDV) // ERROR "Printf format %d has arg ¬PercentDV of wrong type \*print.notPercentDStruct" Printf("%p", ¬PercentDV) // Works regardless: we print it as a pointer. - Printf("%q", &percentDV) // ERROR "Printf format %q has arg &percentDV of wrong type \*testdata.percentDStruct" + Printf("%q", &percentDV) // ERROR "Printf format %q has arg &percentDV of wrong type \*print.percentDStruct" Printf("%s", percentSV) Printf("%s", &percentSV) // Good argument reorderings. @@ -234,7 +234,7 @@ func PrintfTests() { Printf("%T", someFunction) // ok: maybe someone wants to see the type // Bug: used to recur forever. Printf("%p %x", recursiveStructV, recursiveStructV.next) - Printf("%p %x", recursiveStruct1V, recursiveStruct1V.next) // ERROR "Printf format %x has arg recursiveStruct1V\.next of wrong type \*testdata\.RecursiveStruct2" + Printf("%p %x", recursiveStruct1V, recursiveStruct1V.next) // ERROR "Printf format %x has arg recursiveStruct1V\.next of wrong type \*print\.RecursiveStruct2" Printf("%p %x", recursiveSliceV, recursiveSliceV) Printf("%p %x", recursiveMapV, recursiveMapV) // Special handling for Log. @@ -250,7 +250,7 @@ func PrintfTests() { // Multiple string arguments before variadic args errorf("WARNING", "foobar") // OK errorf("INFO", "s=%s, n=%d", "foo", 1) // OK - errorf("ERROR", "%d") // no error "errorf format %d reads arg #1, but call has 0 args" + errorf("ERROR", "%d") // ERROR "errorf format %d reads arg #1, but call has 0 args" // Printf from external package // externalprintf.Printf("%d", 42) // OK @@ -587,37 +587,37 @@ func UnexportedStringerOrError() { fmt.Printf("%s", unexportedInterface{3}) // ok; we can't see the problem us := unexportedStringer{} - fmt.Printf("%s", us) // ERROR "Printf format %s has arg us of wrong type testdata.unexportedStringer" - fmt.Printf("%s", &us) // ERROR "Printf format %s has arg &us of wrong type [*]testdata.unexportedStringer" + fmt.Printf("%s", us) // ERROR "Printf format %s has arg us of wrong type print.unexportedStringer" + fmt.Printf("%s", &us) // ERROR "Printf format %s has arg &us of wrong type [*]print.unexportedStringer" usf := unexportedStringerOtherFields{ s: "foo", S: "bar", } - fmt.Printf("%s", usf) // ERROR "Printf format %s has arg usf of wrong type testdata.unexportedStringerOtherFields" - fmt.Printf("%s", &usf) // ERROR "Printf format %s has arg &usf of wrong type [*]testdata.unexportedStringerOtherFields" + fmt.Printf("%s", usf) // ERROR "Printf format %s has arg usf of wrong type print.unexportedStringerOtherFields" + fmt.Printf("%s", &usf) // ERROR "Printf format %s has arg &usf of wrong type [*]print.unexportedStringerOtherFields" ue := unexportedError{ e: &errorer{}, } - fmt.Printf("%s", ue) // ERROR "Printf format %s has arg ue of wrong type testdata.unexportedError" - fmt.Printf("%s", &ue) // ERROR "Printf format %s has arg &ue of wrong type [*]testdata.unexportedError" + fmt.Printf("%s", ue) // ERROR "Printf format %s has arg ue of wrong type print.unexportedError" + fmt.Printf("%s", &ue) // ERROR "Printf format %s has arg &ue of wrong type [*]print.unexportedError" uef := unexportedErrorOtherFields{ s: "foo", e: &errorer{}, S: "bar", } - fmt.Printf("%s", uef) // ERROR "Printf format %s has arg uef of wrong type testdata.unexportedErrorOtherFields" - fmt.Printf("%s", &uef) // ERROR "Printf format %s has arg &uef of wrong type [*]testdata.unexportedErrorOtherFields" + fmt.Printf("%s", uef) // ERROR "Printf format %s has arg uef of wrong type print.unexportedErrorOtherFields" + fmt.Printf("%s", &uef) // ERROR "Printf format %s has arg &uef of wrong type [*]print.unexportedErrorOtherFields" uce := unexportedCustomError{ e: errorer{}, } - fmt.Printf("%s", uce) // ERROR "Printf format %s has arg uce of wrong type testdata.unexportedCustomError" + fmt.Printf("%s", uce) // ERROR "Printf format %s has arg uce of wrong type print.unexportedCustomError" uei := unexportedErrorInterface{} - fmt.Printf("%s", uei) // ERROR "Printf format %s has arg uei of wrong type testdata.unexportedErrorInterface" + fmt.Printf("%s", uei) // ERROR "Printf format %s has arg uei of wrong type print.unexportedErrorInterface" fmt.Println("foo\n", "bar") // not an error fmt.Println("foo\n") // ERROR "Println arg list ends with redundant newline" @@ -627,7 +627,7 @@ func UnexportedStringerOrError() { intSlice := []int{3, 4} fmt.Printf("%s", intSlice) // ERROR "Printf format %s has arg intSlice of wrong type \[\]int" nonStringerArray := [1]unexportedStringer{{}} - fmt.Printf("%s", nonStringerArray) // ERROR "Printf format %s has arg nonStringerArray of wrong type \[1\]testdata.unexportedStringer" + fmt.Printf("%s", nonStringerArray) // ERROR "Printf format %s has arg nonStringerArray of wrong type \[1\]print.unexportedStringer" fmt.Printf("%s", []stringer{3, 4}) // not an error fmt.Printf("%s", [2]stringer{3, 4}) // not an error } @@ -677,5 +677,5 @@ func PointersToCompoundTypes() { type T1 struct { X *T2 } - fmt.Printf("%s\n", T1{&T2{"x"}}) // ERROR "Printf format %s has arg T1{&T2{.x.}} of wrong type testdata\.T1" + fmt.Printf("%s\n", T1{&T2{"x"}}) // ERROR "Printf format %s has arg T1{&T2{.x.}} of wrong type print\.T1" } diff --git a/src/cmd/vet/testdata/src/rangeloop/rangeloop.go b/src/cmd/vet/testdata/src/rangeloop/rangeloop.go new file mode 100644 index 0000000000000..4e21564186969 --- /dev/null +++ b/src/cmd/vet/testdata/src/rangeloop/rangeloop.go @@ -0,0 +1,17 @@ +// Copyright 2012 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. + +// This file contains tests for the rangeloop checker. + +package rangeloop + +func RangeLoopTests() { + var s []int + for i, v := range s { + go func() { + println(i) // ERROR "loop variable i captured by func literal" + println(v) // ERROR "loop variable v captured by func literal" + }() + } +} diff --git a/src/cmd/vet/testdata/src/shift/shift.go b/src/cmd/vet/testdata/src/shift/shift.go new file mode 100644 index 0000000000000..6b7a5ac9e180a --- /dev/null +++ b/src/cmd/vet/testdata/src/shift/shift.go @@ -0,0 +1,13 @@ +// Copyright 2014 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. + +// This file contains tests for the suspicious shift checker. + +package shift + +func ShiftTest() { + var i8 int8 + _ = i8 << 7 + _ = (i8 + 1) << 8 // ERROR ".i8 . 1. .8 bits. too small for shift of 8" +} diff --git a/src/cmd/vet/testdata/src/structtag/structtag.go b/src/cmd/vet/testdata/src/structtag/structtag.go new file mode 100644 index 0000000000000..cbcc453376070 --- /dev/null +++ b/src/cmd/vet/testdata/src/structtag/structtag.go @@ -0,0 +1,11 @@ +// Copyright 2010 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. + +// This file contains the test for canonical struct tags. + +package structtag + +type StructTagTest struct { + A int "hello" // ERROR "`hello` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair" +} diff --git a/src/cmd/vet/testdata/tagtest/file1.go b/src/cmd/vet/testdata/src/tagtest/file1.go similarity index 85% rename from src/cmd/vet/testdata/tagtest/file1.go rename to src/cmd/vet/testdata/src/tagtest/file1.go index 22a1509acc0bc..47fe3c80afe34 100644 --- a/src/cmd/vet/testdata/tagtest/file1.go +++ b/src/cmd/vet/testdata/src/tagtest/file1.go @@ -6,5 +6,8 @@ package main +import "fmt" + func main() { + fmt.Printf("%s", 0) } diff --git a/src/cmd/vet/testdata/tagtest/file2.go b/src/cmd/vet/testdata/src/tagtest/file2.go similarity index 80% rename from src/cmd/vet/testdata/tagtest/file2.go rename to src/cmd/vet/testdata/src/tagtest/file2.go index ba7dd91bbd89c..1f45efcbf2f43 100644 --- a/src/cmd/vet/testdata/tagtest/file2.go +++ b/src/cmd/vet/testdata/src/tagtest/file2.go @@ -6,5 +6,8 @@ package main -func ignore() { +import "fmt" + +func main() { + fmt.Printf("%s", 0) } diff --git a/src/cmd/vet/testdata/testingpkg/tests.go b/src/cmd/vet/testdata/src/testingpkg/tests.go similarity index 100% rename from src/cmd/vet/testdata/testingpkg/tests.go rename to src/cmd/vet/testdata/src/testingpkg/tests.go diff --git a/src/cmd/vet/testdata/src/testingpkg/tests_test.go b/src/cmd/vet/testdata/src/testingpkg/tests_test.go new file mode 100644 index 0000000000000..09bb98d980ecd --- /dev/null +++ b/src/cmd/vet/testdata/src/testingpkg/tests_test.go @@ -0,0 +1,3 @@ +package testdata + +func Example_BadSuffix() {} // ERROR "Example_BadSuffix has malformed example suffix: BadSuffix" diff --git a/src/cmd/vet/testdata/src/unmarshal/unmarshal.go b/src/cmd/vet/testdata/src/unmarshal/unmarshal.go new file mode 100644 index 0000000000000..b387bbbd23420 --- /dev/null +++ b/src/cmd/vet/testdata/src/unmarshal/unmarshal.go @@ -0,0 +1,18 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file contains tests for the unmarshal checker. + +package unmarshal + +import "encoding/json" + +func _() { + type t struct { + a int + } + var v t + + json.Unmarshal([]byte{}, v) // ERROR "call of Unmarshal passes non-pointer as second argument" +} diff --git a/src/cmd/vet/testdata/src/unsafeptr/unsafeptr.go b/src/cmd/vet/testdata/src/unsafeptr/unsafeptr.go new file mode 100644 index 0000000000000..e9b866ea21b30 --- /dev/null +++ b/src/cmd/vet/testdata/src/unsafeptr/unsafeptr.go @@ -0,0 +1,14 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package unsafeptr + +import "unsafe" + +func _() { + var x unsafe.Pointer + var y uintptr + x = unsafe.Pointer(y) // ERROR "possible misuse of unsafe.Pointer" + _ = x +} diff --git a/src/cmd/vet/testdata/src/unused/unused.go b/src/cmd/vet/testdata/src/unused/unused.go new file mode 100644 index 0000000000000..1e83e90d68fc3 --- /dev/null +++ b/src/cmd/vet/testdata/src/unused/unused.go @@ -0,0 +1,13 @@ +// Copyright 2015 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. + +// This file contains tests for the unusedresult checker. + +package unused + +import "fmt" + +func _() { + fmt.Errorf("") // ERROR "result of fmt.Errorf call not used" +} diff --git a/src/cmd/vet/testdata/structtag.go b/src/cmd/vet/testdata/structtag.go deleted file mode 100644 index 755d52be849af..0000000000000 --- a/src/cmd/vet/testdata/structtag.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2010 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. - -// This file contains the test for canonical struct tags. - -package testdata - -import "encoding/xml" - -type StructTagTest struct { - A int "hello" // ERROR "`hello` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair" - B int "\tx:\"y\"" // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag key" - C int "x:\"y\"\tx:\"y\"" // ERROR "not compatible with reflect.StructTag.Get" - D int "x:`y`" // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value" - E int "ct\brl:\"char\"" // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag pair" - F int `:"emptykey"` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag key" - G int `x:"noEndQuote` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value" - H int `x:"trunc\x0"` // ERROR "not compatible with reflect.StructTag.Get: bad syntax for struct tag value" - I int `x:"foo",y:"bar"` // ERROR "not compatible with reflect.StructTag.Get: key:.value. pairs not separated by spaces" - J int `x:"foo"y:"bar"` // ERROR "not compatible with reflect.StructTag.Get: key:.value. pairs not separated by spaces" - OK0 int `x:"y" u:"v" w:""` - OK1 int `x:"y:z" u:"v" w:""` // note multiple colons. - OK2 int "k0:\"values contain spaces\" k1:\"literal\ttabs\" k2:\"and\\tescaped\\tabs\"" - OK3 int `under_scores:"and" CAPS:"ARE_OK"` -} - -type UnexportedEncodingTagTest struct { - x int `json:"xx"` // ERROR "struct field x has json tag but is not exported" - y int `xml:"yy"` // ERROR "struct field y has xml tag but is not exported" - z int - A int `json:"aa" xml:"bb"` -} - -type unexp struct{} - -type JSONEmbeddedField struct { - UnexportedEncodingTagTest `is:"embedded"` - unexp `is:"embedded,notexported" json:"unexp"` // OK for now, see issue 7363 -} - -type AnonymousJSON struct{} -type AnonymousXML struct{} - -type AnonymousJSONField struct { - DuplicateAnonJSON int `json:"a"` - - A int "hello" // ERROR "`hello` not compatible with reflect.StructTag.Get: bad syntax for struct tag pair" -} - -type DuplicateJSONFields struct { - JSON int `json:"a"` - DuplicateJSON int `json:"a"` // ERROR "struct field DuplicateJSON repeats json tag .a. also at structtag.go:52" - IgnoredJSON int `json:"-"` - OtherIgnoredJSON int `json:"-"` - OmitJSON int `json:",omitempty"` - OtherOmitJSON int `json:",omitempty"` - DuplicateOmitJSON int `json:"a,omitempty"` // ERROR "struct field DuplicateOmitJSON repeats json tag .a. also at structtag.go:52" - NonJSON int `foo:"a"` - DuplicateNonJSON int `foo:"a"` - Embedded struct { - DuplicateJSON int `json:"a"` // OK because it's not in the same struct type - } - AnonymousJSON `json:"a"` // ERROR "struct field AnonymousJSON repeats json tag .a. also at structtag.go:52" - - AnonymousJSONField // ERROR "struct field DuplicateAnonJSON repeats json tag .a. also at structtag.go:52" - - XML int `xml:"a"` - DuplicateXML int `xml:"a"` // ERROR "struct field DuplicateXML repeats xml tag .a. also at structtag.go:68" - IgnoredXML int `xml:"-"` - OtherIgnoredXML int `xml:"-"` - OmitXML int `xml:",omitempty"` - OtherOmitXML int `xml:",omitempty"` - DuplicateOmitXML int `xml:"a,omitempty"` // ERROR "struct field DuplicateOmitXML repeats xml tag .a. also at structtag.go:68" - NonXML int `foo:"a"` - DuplicateNonXML int `foo:"a"` - Embedded2 struct { - DuplicateXML int `xml:"a"` // OK because it's not in the same struct type - } - AnonymousXML `xml:"a"` // ERROR "struct field AnonymousXML repeats xml tag .a. also at structtag.go:68" - Attribute struct { - XMLName xml.Name `xml:"b"` - NoDup int `xml:"b"` // OK because XMLName above affects enclosing struct. - Attr int `xml:"b,attr"` // OK because 0 is valid. - DupAttr int `xml:"b,attr"` // ERROR "struct field DupAttr repeats xml attribute tag .b. also at structtag.go:84" - DupOmitAttr int `xml:"b,omitempty,attr"` // ERROR "struct field DupOmitAttr repeats xml attribute tag .b. also at structtag.go:84" - - AnonymousXML `xml:"b,attr"` // ERROR "struct field AnonymousXML repeats xml attribute tag .b. also at structtag.go:84" - } - - AnonymousJSONField `json:"not_anon"` // ok; fields aren't embedded in JSON - AnonymousJSONField `json:"-"` // ok; entire field is ignored in JSON -} - -type UnexpectedSpacetest struct { - A int `json:"a,omitempty"` - B int `json:"b, omitempty"` // ERROR "suspicious space in struct tag value" - C int `json:"c ,omitempty"` - D int `json:"d,omitempty, string"` // ERROR "suspicious space in struct tag value" - E int `xml:"e local"` - F int `xml:"f "` // ERROR "suspicious space in struct tag value" - G int `xml:" g"` // ERROR "suspicious space in struct tag value" - H int `xml:"h ,omitempty"` // ERROR "suspicious space in struct tag value" - I int `xml:"i, omitempty"` // ERROR "suspicious space in struct tag value" - J int `xml:"j local ,omitempty"` // ERROR "suspicious space in struct tag value" - K int `xml:"k local, omitempty"` // ERROR "suspicious space in struct tag value" - L int `xml:" l local,omitempty"` // ERROR "suspicious space in struct tag value" - M int `xml:"m local,omitempty"` // ERROR "suspicious space in struct tag value" - N int `xml:" "` // ERROR "suspicious space in struct tag value" - O int `xml:""` - P int `xml:","` - Q int `foo:" doesn't care "` -} diff --git a/src/cmd/vet/testdata/testingpkg/tests_test.go b/src/cmd/vet/testdata/testingpkg/tests_test.go deleted file mode 100644 index f5bbc3922a99f..0000000000000 --- a/src/cmd/vet/testdata/testingpkg/tests_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package testdata - -import ( - "testing" -) - -// Buf is a ... -type Buf []byte - -// Append ... -func (*Buf) Append([]byte) {} - -func (Buf) Reset() {} - -func (Buf) Len() int { return 0 } - -// DefaultBuf is a ... -var DefaultBuf Buf - -func Example() {} // OK because is package-level. - -func Example_goodSuffix() // OK because refers to suffix annotation. - -func Example_BadSuffix() // ERROR "Example_BadSuffix has malformed example suffix: BadSuffix" - -func ExampleBuf() // OK because refers to known top-level type. - -func ExampleBuf_Append() {} // OK because refers to known method. - -func ExampleBuf_Clear() {} // ERROR "ExampleBuf_Clear refers to unknown field or method: Buf.Clear" - -func ExampleBuf_suffix() {} // OK because refers to suffix annotation. - -func ExampleBuf_Append_Bad() {} // ERROR "ExampleBuf_Append_Bad has malformed example suffix: Bad" - -func ExampleBuf_Append_suffix() {} // OK because refers to known method with valid suffix. - -func ExampleDefaultBuf() {} // OK because refers to top-level identifier. - -func ExampleBuf_Reset() bool { return true } // ERROR "ExampleBuf_Reset should return nothing" - -func ExampleBuf_Len(i int) {} // ERROR "ExampleBuf_Len should be niladic" - -// "Puffer" is German for "Buffer". - -func ExamplePuffer() // ERROR "ExamplePuffer refers to unknown identifier: Puffer" - -func ExamplePuffer_Append() // ERROR "ExamplePuffer_Append refers to unknown identifier: Puffer" - -func ExamplePuffer_suffix() // ERROR "ExamplePuffer_suffix refers to unknown identifier: Puffer" - -func nonTest() {} // OK because it doesn't start with "Test". - -func (Buf) TesthasReceiver() {} // OK because it has a receiver. - -func TestOKSuffix(*testing.T) {} // OK because first char after "Test" is Uppercase. - -func TestÜnicodeWorks(*testing.T) {} // OK because the first char after "Test" is Uppercase. - -func TestbadSuffix(*testing.T) {} // ERROR "first letter after 'Test' must not be lowercase" - -func TestemptyImportBadSuffix(*T) {} // ERROR "first letter after 'Test' must not be lowercase" - -func Test(*testing.T) {} // OK "Test" on its own is considered a test. - -func Testify() {} // OK because it takes no parameters. - -func TesttooManyParams(*testing.T, string) {} // OK because it takes too many parameters. - -func TesttooManyNames(a, b *testing.T) {} // OK because it takes too many names. - -func TestnoTParam(string) {} // OK because it doesn't take a *testing.T - -func BenchmarkbadSuffix(*testing.B) {} // ERROR "first letter after 'Benchmark' must not be lowercase" diff --git a/src/cmd/vet/testdata/unmarshal.go b/src/cmd/vet/testdata/unmarshal.go deleted file mode 100644 index f541b4a414941..0000000000000 --- a/src/cmd/vet/testdata/unmarshal.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file contains tests for the unmarshal checker. - -package testdata - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "encoding/xml" - "errors" - "fmt" -) - -func _() { - type t struct { - a int - } - var v t - var r io.Reader - - json.Unmarshal([]byte{}, v) // ERROR "call of Unmarshal passes non-pointer as second argument" - json.Unmarshal([]byte{}, &v) - json.NewDecoder(r).Decode(v) // ERROR "call of Decode passes non-pointer" - json.NewDecoder(r).Decode(&v) - gob.NewDecoder(r).Decode(v) // ERROR "call of Decode passes non-pointer" - gob.NewDecoder(r).Decode(&v) - xml.Unmarshal([]byte{}, v) // ERROR "call of Unmarshal passes non-pointer as second argument" - xml.Unmarshal([]byte{}, &v) - xml.NewDecoder(r).Decode(v) // ERROR "call of Decode passes non-pointer" - xml.NewDecoder(r).Decode(&v) - - var p *t - json.Unmarshal([]byte{}, p) - json.Unmarshal([]byte{}, *p) // ERROR "call of Unmarshal passes non-pointer as second argument" - json.NewDecoder(r).Decode(p) - json.NewDecoder(r).Decode(*p) // ERROR "call of Decode passes non-pointer" - gob.NewDecoder(r).Decode(p) - gob.NewDecoder(r).Decode(*p) // ERROR "call of Decode passes non-pointer" - xml.Unmarshal([]byte{}, p) - xml.Unmarshal([]byte{}, *p) // ERROR "call of Unmarshal passes non-pointer as second argument" - xml.NewDecoder(r).Decode(p) - xml.NewDecoder(r).Decode(*p) // ERROR "call of Decode passes non-pointer" - - var i interface{} - json.Unmarshal([]byte{}, i) - json.NewDecoder(r).Decode(i) - - json.Unmarshal([]byte{}, nil) // ERROR "call of Unmarshal passes non-pointer as second argument" - json.Unmarshal([]byte{}, []t{}) // ERROR "call of Unmarshal passes non-pointer as second argument" - json.Unmarshal([]byte{}, map[string]int{}) // ERROR "call of Unmarshal passes non-pointer as second argument" - json.NewDecoder(r).Decode(nil) // ERROR "call of Decode passes non-pointer" - json.NewDecoder(r).Decode([]t{}) // ERROR "call of Decode passes non-pointer" - json.NewDecoder(r).Decode(map[string]int{}) // ERROR "call of Decode passes non-pointer" - - json.Unmarshal(func() ([]byte, interface{}) { return []byte{}, v }()) -} diff --git a/src/cmd/vet/testdata/unsafeptr.go b/src/cmd/vet/testdata/unsafeptr.go deleted file mode 100644 index ce852009ea733..0000000000000 --- a/src/cmd/vet/testdata/unsafeptr.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package testdata - -import ( - "reflect" - "unsafe" -) - -func f() { - var x unsafe.Pointer - var y uintptr - x = unsafe.Pointer(y) // ERROR "possible misuse of unsafe.Pointer" - y = uintptr(x) - - // only allowed pointer arithmetic is ptr +/-/&^ num. - // num+ptr is technically okay but still flagged: write ptr+num instead. - x = unsafe.Pointer(uintptr(x) + 1) - x = unsafe.Pointer(1 + uintptr(x)) // ERROR "possible misuse of unsafe.Pointer" - x = unsafe.Pointer(uintptr(x) + uintptr(x)) // ERROR "possible misuse of unsafe.Pointer" - x = unsafe.Pointer(uintptr(x) - 1) - x = unsafe.Pointer(1 - uintptr(x)) // ERROR "possible misuse of unsafe.Pointer" - x = unsafe.Pointer(uintptr(x) &^ 3) - x = unsafe.Pointer(1 &^ uintptr(x)) // ERROR "possible misuse of unsafe.Pointer" - - // certain uses of reflect are okay - var v reflect.Value - x = unsafe.Pointer(v.Pointer()) - x = unsafe.Pointer(v.UnsafeAddr()) - var s1 *reflect.StringHeader - x = unsafe.Pointer(s1.Data) - var s2 *reflect.SliceHeader - x = unsafe.Pointer(s2.Data) - var s3 reflect.StringHeader - x = unsafe.Pointer(s3.Data) // ERROR "possible misuse of unsafe.Pointer" - var s4 reflect.SliceHeader - x = unsafe.Pointer(s4.Data) // ERROR "possible misuse of unsafe.Pointer" - - // but only in reflect - var vv V - x = unsafe.Pointer(vv.Pointer()) // ERROR "possible misuse of unsafe.Pointer" - x = unsafe.Pointer(vv.UnsafeAddr()) // ERROR "possible misuse of unsafe.Pointer" - var ss1 *StringHeader - x = unsafe.Pointer(ss1.Data) // ERROR "possible misuse of unsafe.Pointer" - var ss2 *SliceHeader - x = unsafe.Pointer(ss2.Data) // ERROR "possible misuse of unsafe.Pointer" - -} - -type V interface { - Pointer() uintptr - UnsafeAddr() uintptr -} - -type StringHeader struct { - Data uintptr -} - -type SliceHeader struct { - Data uintptr -} diff --git a/src/cmd/vet/testdata/unused.go b/src/cmd/vet/testdata/unused.go deleted file mode 100644 index d50f6594d9b46..0000000000000 --- a/src/cmd/vet/testdata/unused.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 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. - -// This file contains tests for the unusedresult checker. - -package testdata - -import ( - "bytes" - "errors" - "fmt" -) - -func _() { - fmt.Errorf("") // ERROR "result of fmt.Errorf call not used" - _ = fmt.Errorf("") - - errors.New("") // ERROR "result of errors.New call not used" - - err := errors.New("") - err.Error() // ERROR "result of \(error\).Error call not used" - - var buf bytes.Buffer - buf.String() // ERROR "result of \(bytes.Buffer\).String call not used" - - fmt.Sprint("") // ERROR "result of fmt.Sprint call not used" - fmt.Sprintf("") // ERROR "result of fmt.Sprintf call not used" -} diff --git a/src/cmd/vet/tests.go b/src/cmd/vet/tests.go deleted file mode 100644 index 5b157084fa257..0000000000000 --- a/src/cmd/vet/tests.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "go/ast" - "go/types" - "strings" - "unicode" - "unicode/utf8" -) - -func init() { - register("tests", - "check for common mistaken usages of tests/documentation examples", - checkTestFunctions, - funcDecl) -} - -func isExampleSuffix(s string) bool { - r, size := utf8.DecodeRuneInString(s) - return size > 0 && unicode.IsLower(r) -} - -func isTestSuffix(name string) bool { - if len(name) == 0 { - // "Test" is ok. - return true - } - r, _ := utf8.DecodeRuneInString(name) - return !unicode.IsLower(r) -} - -func isTestParam(typ ast.Expr, wantType string) bool { - ptr, ok := typ.(*ast.StarExpr) - if !ok { - // Not a pointer. - return false - } - // No easy way of making sure it's a *testing.T or *testing.B: - // ensure the name of the type matches. - if name, ok := ptr.X.(*ast.Ident); ok { - return name.Name == wantType - } - if sel, ok := ptr.X.(*ast.SelectorExpr); ok { - return sel.Sel.Name == wantType - } - return false -} - -func lookup(name string, scopes []*types.Scope) types.Object { - for _, scope := range scopes { - if o := scope.Lookup(name); o != nil { - return o - } - } - return nil -} - -func extendedScope(f *File) []*types.Scope { - scopes := []*types.Scope{f.pkg.typesPkg.Scope()} - if f.basePkg != nil { - scopes = append(scopes, f.basePkg.typesPkg.Scope()) - } else { - // If basePkg is not specified (e.g. when checking a single file) try to - // find it among imports. - pkgName := f.pkg.typesPkg.Name() - if strings.HasSuffix(pkgName, "_test") { - basePkgName := strings.TrimSuffix(pkgName, "_test") - for _, p := range f.pkg.typesPkg.Imports() { - if p.Name() == basePkgName { - scopes = append(scopes, p.Scope()) - break - } - } - } - } - return scopes -} - -func checkExample(fn *ast.FuncDecl, f *File, report reporter) { - fnName := fn.Name.Name - if params := fn.Type.Params; len(params.List) != 0 { - report("%s should be niladic", fnName) - } - if results := fn.Type.Results; results != nil && len(results.List) != 0 { - report("%s should return nothing", fnName) - } - - if filesRun && !includesNonTest { - // The coherence checks between a test and the package it tests - // will report false positives if no non-test files have - // been provided. - return - } - - if fnName == "Example" { - // Nothing more to do. - return - } - - var ( - exName = strings.TrimPrefix(fnName, "Example") - elems = strings.SplitN(exName, "_", 3) - ident = elems[0] - obj = lookup(ident, extendedScope(f)) - ) - if ident != "" && obj == nil { - // Check ExampleFoo and ExampleBadFoo. - report("%s refers to unknown identifier: %s", fnName, ident) - // Abort since obj is absent and no subsequent checks can be performed. - return - } - if len(elems) < 2 { - // Nothing more to do. - return - } - - if ident == "" { - // Check Example_suffix and Example_BadSuffix. - if residual := strings.TrimPrefix(exName, "_"); !isExampleSuffix(residual) { - report("%s has malformed example suffix: %s", fnName, residual) - } - return - } - - mmbr := elems[1] - if !isExampleSuffix(mmbr) { - // Check ExampleFoo_Method and ExampleFoo_BadMethod. - if obj, _, _ := types.LookupFieldOrMethod(obj.Type(), true, obj.Pkg(), mmbr); obj == nil { - report("%s refers to unknown field or method: %s.%s", fnName, ident, mmbr) - } - } - if len(elems) == 3 && !isExampleSuffix(elems[2]) { - // Check ExampleFoo_Method_suffix and ExampleFoo_Method_Badsuffix. - report("%s has malformed example suffix: %s", fnName, elems[2]) - } -} - -func checkTest(fn *ast.FuncDecl, prefix string, report reporter) { - // Want functions with 0 results and 1 parameter. - if fn.Type.Results != nil && len(fn.Type.Results.List) > 0 || - fn.Type.Params == nil || - len(fn.Type.Params.List) != 1 || - len(fn.Type.Params.List[0].Names) > 1 { - return - } - - // The param must look like a *testing.T or *testing.B. - if !isTestParam(fn.Type.Params.List[0].Type, prefix[:1]) { - return - } - - if !isTestSuffix(fn.Name.Name[len(prefix):]) { - report("%s has malformed name: first letter after '%s' must not be lowercase", fn.Name.Name, prefix) - } -} - -type reporter func(format string, args ...interface{}) - -// checkTestFunctions walks Test, Benchmark and Example functions checking -// malformed names, wrong signatures and examples documenting nonexistent -// identifiers. -func checkTestFunctions(f *File, node ast.Node) { - if !strings.HasSuffix(f.name, "_test.go") { - return - } - - fn, ok := node.(*ast.FuncDecl) - if !ok || fn.Recv != nil { - // Ignore non-functions or functions with receivers. - return - } - - report := func(format string, args ...interface{}) { f.Badf(node.Pos(), format, args...) } - - switch { - case strings.HasPrefix(fn.Name.Name, "Example"): - checkExample(fn, f, report) - case strings.HasPrefix(fn.Name.Name, "Test"): - checkTest(fn, "Test", report) - case strings.HasPrefix(fn.Name.Name, "Benchmark"): - checkTest(fn, "Benchmark", report) - } -} diff --git a/src/cmd/vet/types.go b/src/cmd/vet/types.go deleted file mode 100644 index 8cb0e8e77dbeb..0000000000000 --- a/src/cmd/vet/types.go +++ /dev/null @@ -1,345 +0,0 @@ -// Copyright 2010 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. - -// This file contains the pieces of the tool that use typechecking from the go/types package. - -package main - -import ( - "go/ast" - "go/build" - "go/importer" - "go/token" - "go/types" -) - -// stdImporter is the importer we use to import packages. -// It is shared so that all packages are imported by the same importer. -var stdImporter types.Importer - -var ( - errorType *types.Interface - stringerType *types.Interface // possibly nil - formatterType *types.Interface // possibly nil -) - -func inittypes() { - errorType = types.Universe.Lookup("error").Type().Underlying().(*types.Interface) - - if typ := importType("fmt", "Stringer"); typ != nil { - stringerType = typ.Underlying().(*types.Interface) - } - if typ := importType("fmt", "Formatter"); typ != nil { - formatterType = typ.Underlying().(*types.Interface) - } -} - -// isNamedType reports whether t is the named type path.name. -func isNamedType(t types.Type, path, name string) bool { - n, ok := t.(*types.Named) - if !ok { - return false - } - obj := n.Obj() - return obj.Name() == name && obj.Pkg() != nil && obj.Pkg().Path() == path -} - -// importType returns the type denoted by the qualified identifier -// path.name, and adds the respective package to the imports map -// as a side effect. In case of an error, importType returns nil. -func importType(path, name string) types.Type { - pkg, err := stdImporter.Import(path) - if err != nil { - // This can happen if the package at path hasn't been compiled yet. - warnf("import failed: %v", err) - return nil - } - if obj, ok := pkg.Scope().Lookup(name).(*types.TypeName); ok { - return obj.Type() - } - warnf("invalid type name %q", name) - return nil -} - -func (pkg *Package) check(fs *token.FileSet, astFiles []*ast.File) []error { - if stdImporter == nil { - if *source { - stdImporter = importer.For("source", nil) - } else { - stdImporter = importer.Default() - } - inittypes() - } - pkg.defs = make(map[*ast.Ident]types.Object) - pkg.uses = make(map[*ast.Ident]types.Object) - pkg.implicits = make(map[ast.Node]types.Object) - pkg.selectors = make(map[*ast.SelectorExpr]*types.Selection) - pkg.spans = make(map[types.Object]Span) - pkg.types = make(map[ast.Expr]types.TypeAndValue) - - var allErrors []error - config := types.Config{ - // We use the same importer for all imports to ensure that - // everybody sees identical packages for the given paths. - Importer: stdImporter, - // By providing a Config with our own error function, it will continue - // past the first error. We collect them all for printing later. - Error: func(e error) { - allErrors = append(allErrors, e) - }, - - Sizes: archSizes, - } - info := &types.Info{ - Selections: pkg.selectors, - Types: pkg.types, - Defs: pkg.defs, - Uses: pkg.uses, - Implicits: pkg.implicits, - } - typesPkg, err := config.Check(pkg.path, fs, astFiles, info) - if len(allErrors) == 0 && err != nil { - allErrors = append(allErrors, err) - } - pkg.typesPkg = typesPkg - // update spans - for id, obj := range pkg.defs { - // Ignore identifiers that don't denote objects - // (package names, symbolic variables such as t - // in t := x.(type) of type switch headers). - if obj != nil { - pkg.growSpan(obj, id.Pos(), id.End()) - } - } - for id, obj := range pkg.uses { - pkg.growSpan(obj, id.Pos(), id.End()) - } - for node, obj := range pkg.implicits { - // A type switch with a short variable declaration - // such as t := x.(type) doesn't declare the symbolic - // variable (t in the example) at the switch header; - // instead a new variable t (with specific type) is - // declared implicitly for each case. Such variables - // are found in the types.Info.Implicits (not Defs) - // map. Add them here, assuming they are declared at - // the type cases' colon ":". - if cc, ok := node.(*ast.CaseClause); ok { - pkg.growSpan(obj, cc.Colon, cc.Colon) - } - } - return allErrors -} - -// matchArgType reports an error if printf verb t is not appropriate -// for operand arg. -// -// typ is used only for recursive calls; external callers must supply nil. -// -// (Recursion arises from the compound types {map,chan,slice} which -// may be printed with %d etc. if that is appropriate for their element -// types.) -func (f *File) matchArgType(t printfArgType, typ types.Type, arg ast.Expr) bool { - return f.matchArgTypeInternal(t, typ, arg, make(map[types.Type]bool)) -} - -// matchArgTypeInternal is the internal version of matchArgType. It carries a map -// remembering what types are in progress so we don't recur when faced with recursive -// types or mutually recursive types. -func (f *File) matchArgTypeInternal(t printfArgType, typ types.Type, arg ast.Expr, inProgress map[types.Type]bool) bool { - // %v, %T accept any argument type. - if t == anyType { - return true - } - if typ == nil { - // external call - typ = f.pkg.types[arg].Type - if typ == nil { - return true // probably a type check problem - } - } - // If the type implements fmt.Formatter, we have nothing to check. - if f.isFormatter(typ) { - return true - } - // If we can use a string, might arg (dynamically) implement the Stringer or Error interface? - if t&argString != 0 && isConvertibleToString(typ) { - return true - } - - typ = typ.Underlying() - if inProgress[typ] { - // We're already looking at this type. The call that started it will take care of it. - return true - } - inProgress[typ] = true - - switch typ := typ.(type) { - case *types.Signature: - return t&argPointer != 0 - - case *types.Map: - // Recur: map[int]int matches %d. - return t&argPointer != 0 || - (f.matchArgTypeInternal(t, typ.Key(), arg, inProgress) && f.matchArgTypeInternal(t, typ.Elem(), arg, inProgress)) - - case *types.Chan: - return t&argPointer != 0 - - case *types.Array: - // Same as slice. - if types.Identical(typ.Elem().Underlying(), types.Typ[types.Byte]) && t&argString != 0 { - return true // %s matches []byte - } - // Recur: []int matches %d. - return t&argPointer != 0 || f.matchArgTypeInternal(t, typ.Elem(), arg, inProgress) - - case *types.Slice: - // Same as array. - if types.Identical(typ.Elem().Underlying(), types.Typ[types.Byte]) && t&argString != 0 { - return true // %s matches []byte - } - // Recur: []int matches %d. But watch out for - // type T []T - // If the element is a pointer type (type T[]*T), it's handled fine by the Pointer case below. - return t&argPointer != 0 || f.matchArgTypeInternal(t, typ.Elem(), arg, inProgress) - - case *types.Pointer: - // Ugly, but dealing with an edge case: a known pointer to an invalid type, - // probably something from a failed import. - if typ.Elem().String() == "invalid type" { - if *verbose { - f.Warnf(arg.Pos(), "printf argument %v is pointer to invalid or unknown type", f.gofmt(arg)) - } - return true // special case - } - // If it's actually a pointer with %p, it prints as one. - if t == argPointer { - return true - } - under := typ.Elem().Underlying() - switch under.(type) { - case *types.Struct: // see below - case *types.Array: // see below - case *types.Slice: // see below - case *types.Map: // see below - default: - // Check whether the rest can print pointers. - return t&argPointer != 0 - } - // If it's a top-level pointer to a struct, array, slice, or - // map, that's equivalent in our analysis to whether we can - // print the type being pointed to. Pointers in nested levels - // are not supported to minimize fmt running into loops. - if len(inProgress) > 1 { - return false - } - return f.matchArgTypeInternal(t, under, arg, inProgress) - - case *types.Struct: - return f.matchStructArgType(t, typ, arg, inProgress) - - case *types.Interface: - // There's little we can do. - // Whether any particular verb is valid depends on the argument. - // The user may have reasonable prior knowledge of the contents of the interface. - return true - - case *types.Basic: - switch typ.Kind() { - case types.UntypedBool, - types.Bool: - return t&argBool != 0 - - case types.UntypedInt, - types.Int, - types.Int8, - types.Int16, - types.Int32, - types.Int64, - types.Uint, - types.Uint8, - types.Uint16, - types.Uint32, - types.Uint64, - types.Uintptr: - return t&argInt != 0 - - case types.UntypedFloat, - types.Float32, - types.Float64: - return t&argFloat != 0 - - case types.UntypedComplex, - types.Complex64, - types.Complex128: - return t&argComplex != 0 - - case types.UntypedString, - types.String: - return t&argString != 0 - - case types.UnsafePointer: - return t&(argPointer|argInt) != 0 - - case types.UntypedRune: - return t&(argInt|argRune) != 0 - - case types.UntypedNil: - return false - - case types.Invalid: - if *verbose { - f.Warnf(arg.Pos(), "printf argument %v has invalid or unknown type", f.gofmt(arg)) - } - return true // Probably a type check problem. - } - panic("unreachable") - } - - return false -} - -func isConvertibleToString(typ types.Type) bool { - if bt, ok := typ.(*types.Basic); ok && bt.Kind() == types.UntypedNil { - // We explicitly don't want untyped nil, which is - // convertible to both of the interfaces below, as it - // would just panic anyway. - return false - } - if types.ConvertibleTo(typ, errorType) { - return true // via .Error() - } - if stringerType != nil && types.ConvertibleTo(typ, stringerType) { - return true // via .String() - } - return false -} - -// hasBasicType reports whether x's type is a types.Basic with the given kind. -func (f *File) hasBasicType(x ast.Expr, kind types.BasicKind) bool { - t := f.pkg.types[x].Type - if t != nil { - t = t.Underlying() - } - b, ok := t.(*types.Basic) - return ok && b.Kind() == kind -} - -// matchStructArgType reports whether all the elements of the struct match the expected -// type. For instance, with "%d" all the elements must be printable with the "%d" format. -func (f *File) matchStructArgType(t printfArgType, typ *types.Struct, arg ast.Expr, inProgress map[types.Type]bool) bool { - for i := 0; i < typ.NumFields(); i++ { - typf := typ.Field(i) - if !f.matchArgTypeInternal(t, typf.Type(), arg, inProgress) { - return false - } - if t&argString != 0 && !typf.Exported() && isConvertibleToString(typf.Type()) { - // Issue #17798: unexported Stringer or error cannot be properly fomatted. - return false - } - } - return true -} - -var archSizes = types.SizesFor("gc", build.Default.GOARCH) diff --git a/src/cmd/vet/unmarshal.go b/src/cmd/vet/unmarshal.go deleted file mode 100644 index 3e4c25b6b9970..0000000000000 --- a/src/cmd/vet/unmarshal.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file defines the check for passing non-pointer or non-interface -// types to unmarshal and decode functions. - -package main - -import ( - "go/ast" - "go/types" - "strings" -) - -func init() { - register("unmarshal", - "check for passing non-pointer or non-interface types to unmarshal and decode functions", - checkUnmarshalArg, - callExpr) -} - -var pointerArgFuncs = map[string]int{ - "encoding/json.Unmarshal": 1, - "(*encoding/json.Decoder).Decode": 0, - "(*encoding/gob.Decoder).Decode": 0, - "encoding/xml.Unmarshal": 1, - "(*encoding/xml.Decoder).Decode": 0, -} - -func checkUnmarshalArg(f *File, n ast.Node) { - call, ok := n.(*ast.CallExpr) - if !ok { - return // not a call statement - } - fun := unparen(call.Fun) - - if f.pkg.types[fun].IsType() { - return // a conversion, not a call - } - - info := &types.Info{Uses: f.pkg.uses, Selections: f.pkg.selectors} - name := callName(info, call) - - arg, ok := pointerArgFuncs[name] - if !ok { - return // not a function we are interested in - } - - if len(call.Args) < arg+1 { - return // not enough arguments, e.g. called with return values of another function - } - - typ := f.pkg.types[call.Args[arg]] - - if typ.Type == nil { - return // type error prevents further analysis - } - - switch typ.Type.Underlying().(type) { - case *types.Pointer, *types.Interface: - return - } - - shortname := name[strings.LastIndexByte(name, '.')+1:] - switch arg { - case 0: - f.Badf(call.Lparen, "call of %s passes non-pointer", shortname) - case 1: - f.Badf(call.Lparen, "call of %s passes non-pointer as second argument", shortname) - } -} diff --git a/src/cmd/vet/unsafeptr.go b/src/cmd/vet/unsafeptr.go deleted file mode 100644 index cb2cc818897aa..0000000000000 --- a/src/cmd/vet/unsafeptr.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2014 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. - -// Check for invalid uintptr -> unsafe.Pointer conversions. - -package main - -import ( - "go/ast" - "go/token" - "go/types" -) - -func init() { - register("unsafeptr", - "check for misuse of unsafe.Pointer", - checkUnsafePointer, - callExpr) -} - -func checkUnsafePointer(f *File, node ast.Node) { - x := node.(*ast.CallExpr) - if len(x.Args) != 1 { - return - } - if f.hasBasicType(x.Fun, types.UnsafePointer) && f.hasBasicType(x.Args[0], types.Uintptr) && !f.isSafeUintptr(x.Args[0]) { - f.Badf(x.Pos(), "possible misuse of unsafe.Pointer") - } -} - -// isSafeUintptr reports whether x - already known to be a uintptr - -// is safe to convert to unsafe.Pointer. It is safe if x is itself derived -// directly from an unsafe.Pointer via conversion and pointer arithmetic -// or if x is the result of reflect.Value.Pointer or reflect.Value.UnsafeAddr -// or obtained from the Data field of a *reflect.SliceHeader or *reflect.StringHeader. -func (f *File) isSafeUintptr(x ast.Expr) bool { - switch x := x.(type) { - case *ast.ParenExpr: - return f.isSafeUintptr(x.X) - - case *ast.SelectorExpr: - switch x.Sel.Name { - case "Data": - // reflect.SliceHeader and reflect.StringHeader are okay, - // but only if they are pointing at a real slice or string. - // It's not okay to do: - // var x SliceHeader - // x.Data = uintptr(unsafe.Pointer(...)) - // ... use x ... - // p := unsafe.Pointer(x.Data) - // because in the middle the garbage collector doesn't - // see x.Data as a pointer and so x.Data may be dangling - // by the time we get to the conversion at the end. - // For now approximate by saying that *Header is okay - // but Header is not. - pt, ok := f.pkg.types[x.X].Type.(*types.Pointer) - if ok { - t, ok := pt.Elem().(*types.Named) - if ok && t.Obj().Pkg().Path() == "reflect" { - switch t.Obj().Name() { - case "StringHeader", "SliceHeader": - return true - } - } - } - } - - case *ast.CallExpr: - switch len(x.Args) { - case 0: - // maybe call to reflect.Value.Pointer or reflect.Value.UnsafeAddr. - sel, ok := x.Fun.(*ast.SelectorExpr) - if !ok { - break - } - switch sel.Sel.Name { - case "Pointer", "UnsafeAddr": - t, ok := f.pkg.types[sel.X].Type.(*types.Named) - if ok && t.Obj().Pkg().Path() == "reflect" && t.Obj().Name() == "Value" { - return true - } - } - - case 1: - // maybe conversion of uintptr to unsafe.Pointer - return f.hasBasicType(x.Fun, types.Uintptr) && f.hasBasicType(x.Args[0], types.UnsafePointer) - } - - case *ast.BinaryExpr: - switch x.Op { - case token.ADD, token.SUB, token.AND_NOT: - return f.isSafeUintptr(x.X) && !f.isSafeUintptr(x.Y) - } - } - return false -} diff --git a/src/cmd/vet/unused.go b/src/cmd/vet/unused.go deleted file mode 100644 index 02fcd841cd06d..0000000000000 --- a/src/cmd/vet/unused.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2015 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. - -// This file defines the check for unused results of calls to certain -// pure functions. - -package main - -import ( - "flag" - "go/ast" - "go/token" - "go/types" - "strings" -) - -var unusedFuncsFlag = flag.String("unusedfuncs", - "errors.New,fmt.Errorf,fmt.Sprintf,fmt.Sprint,sort.Reverse", - "comma-separated list of functions whose results must be used") - -var unusedStringMethodsFlag = flag.String("unusedstringmethods", - "Error,String", - "comma-separated list of names of methods of type func() string whose results must be used") - -func init() { - register("unusedresult", - "check for unused result of calls to functions in -unusedfuncs list and methods in -unusedstringmethods list", - checkUnusedResult, - exprStmt) -} - -// func() string -var sigNoArgsStringResult = types.NewSignature(nil, nil, - types.NewTuple(types.NewVar(token.NoPos, nil, "", types.Typ[types.String])), - false) - -var unusedFuncs = make(map[string]bool) -var unusedStringMethods = make(map[string]bool) - -func initUnusedFlags() { - commaSplit := func(s string, m map[string]bool) { - if s != "" { - for _, name := range strings.Split(s, ",") { - if len(name) == 0 { - flag.Usage() - } - m[name] = true - } - } - } - commaSplit(*unusedFuncsFlag, unusedFuncs) - commaSplit(*unusedStringMethodsFlag, unusedStringMethods) -} - -func checkUnusedResult(f *File, n ast.Node) { - call, ok := unparen(n.(*ast.ExprStmt).X).(*ast.CallExpr) - if !ok { - return // not a call statement - } - fun := unparen(call.Fun) - - if f.pkg.types[fun].IsType() { - return // a conversion, not a call - } - - selector, ok := fun.(*ast.SelectorExpr) - if !ok { - return // neither a method call nor a qualified ident - } - - sel, ok := f.pkg.selectors[selector] - if ok && sel.Kind() == types.MethodVal { - // method (e.g. foo.String()) - obj := sel.Obj().(*types.Func) - sig := sel.Type().(*types.Signature) - if types.Identical(sig, sigNoArgsStringResult) { - if unusedStringMethods[obj.Name()] { - f.Badf(call.Lparen, "result of (%s).%s call not used", - sig.Recv().Type(), obj.Name()) - } - } - } else if !ok { - // package-qualified function (e.g. fmt.Errorf) - obj := f.pkg.uses[selector.Sel] - if obj, ok := obj.(*types.Func); ok { - qname := obj.Pkg().Path() + "." + obj.Name() - if unusedFuncs[qname] { - f.Badf(call.Lparen, "result of %v call not used", qname) - } - } - } -} diff --git a/src/cmd/vet/vet_test.go b/src/cmd/vet/vet_test.go index 6b2125924d7a8..2471679a14340 100644 --- a/src/cmd/vet/vet_test.go +++ b/src/cmd/vet/vet_test.go @@ -15,7 +15,6 @@ import ( "os/exec" "path/filepath" "regexp" - "runtime" "strconv" "strings" "sync" @@ -60,107 +59,69 @@ func Build(t *testing.T) { built = true } -func Vet(t *testing.T, files []string) { - flags := []string{ - "-printfuncs=Warn:1,Warnf:1", - "-all", - "-shadow", +func vetCmd(t *testing.T, args ...string) *exec.Cmd { + cmd := exec.Command(testenv.GoToolPath(t), "vet", "-vettool="+binary) + cmd.Args = append(cmd.Args, args...) + testdata, err := filepath.Abs("testdata") + if err != nil { + t.Fatal(err) } - cmd := exec.Command(binary, append(flags, files...)...) - errchk(cmd, files, t) + cmd.Env = append(os.Environ(), "GOPATH="+testdata) + return cmd } // TestVet is equivalent to running this: // go build -o ./testvet -// errorCheck the output of ./testvet -shadow -printfuncs='Warn:1,Warnf:1' testdata/*.go testdata/*.s +// errorCheck the output of ./testvet -printfuncs='Warn:1,Warnf:1' testdata/*.go testdata/*.s // rm ./testvet // - -// TestVet tests self-contained files in testdata/*.go. -// -// If a file contains assembly or has inter-dependencies, it should be -// in its own test, like TestVetAsm, TestDivergentPackagesExamples, -// etc below. func TestVet(t *testing.T) { - Build(t) - t.Parallel() - - gos, err := filepath.Glob(filepath.Join(dataDir, "*.go")) - if err != nil { - t.Fatal(err) - } - wide := runtime.GOMAXPROCS(0) - if wide > len(gos) { - wide = len(gos) - } - batch := make([][]string, wide) - for i, file := range gos { - // The print.go test is run by TestVetPrint. - if strings.HasSuffix(file, "print.go") { - continue - } - batch[i%wide] = append(batch[i%wide], file) - } - for i, files := range batch { - if len(files) == 0 { - continue - } - files := files - t.Run(fmt.Sprint(i), func(t *testing.T) { - t.Parallel() - t.Logf("files: %q", files) - Vet(t, files) - }) - } -} - -func TestVetPrint(t *testing.T) { - Build(t) - file := filepath.Join("testdata", "print.go") - cmd := exec.Command( - "go", "vet", "-vettool="+binary, - "-printf", - "-printfuncs=Warn:1,Warnf:1", - file, - ) - errchk(cmd, []string{file}, t) -} - -func TestVetAsm(t *testing.T) { - Build(t) - - asmDir := filepath.Join(dataDir, "asm") - gos, err := filepath.Glob(filepath.Join(asmDir, "*.go")) - if err != nil { - t.Fatal(err) - } - asms, err := filepath.Glob(filepath.Join(asmDir, "*.s")) - if err != nil { - t.Fatal(err) - } - - t.Parallel() - Vet(t, append(gos, asms...)) -} - -func TestVetDirs(t *testing.T) { t.Parallel() Build(t) - for _, dir := range []string{ - "testingpkg", - "divergent", + for _, pkg := range []string{ + "asm", + "assign", + "atomic", + "bool", "buildtag", - "incomplete", // incomplete examples "cgo", + "composite", + "copylock", + "deadcode", + "httpresponse", + "lostcancel", + "method", + "nilfunc", + "print", + "rangeloop", + "shift", + "structtag", + "testingpkg", + // "testtag" has its own test + "unmarshal", + "unsafeptr", + "unused", } { - dir := dir - t.Run(dir, func(t *testing.T) { + pkg := pkg + t.Run(pkg, func(t *testing.T) { t.Parallel() - gos, err := filepath.Glob(filepath.Join("testdata", dir, "*.go")) + + cmd := vetCmd(t, "-printfuncs=Warn,Warnf", pkg) + + dir := filepath.Join("testdata/src", pkg) + gos, err := filepath.Glob(filepath.Join(dir, "*.go")) if err != nil { t.Fatal(err) } - Vet(t, gos) + asms, err := filepath.Glob(filepath.Join(dir, "*.s")) + if err != nil { + t.Fatal(err) + } + var files []string + files = append(files, gos...) + files = append(files, asms...) + + errchk(cmd, files, t) }) } } @@ -185,44 +146,35 @@ func errchk(c *exec.Cmd, files []string, t *testing.T) { func TestTags(t *testing.T) { t.Parallel() Build(t) - for _, tag := range []string{"testtag", "x testtag y", "x,testtag,y"} { - tag := tag + for tag, wantFile := range map[string]int{ + "testtag": 1, // file1 + "x testtag y": 1, + "othertag": 2, + } { + tag, wantFile := tag, wantFile t.Run(tag, func(t *testing.T) { t.Parallel() t.Logf("-tags=%s", tag) - args := []string{ - "-tags=" + tag, - "-v", // We're going to look at the files it examines. - "testdata/tagtest", - } - cmd := exec.Command(binary, args...) + cmd := vetCmd(t, "-tags="+tag, "tagtest") output, err := cmd.CombinedOutput() - if err != nil { - t.Fatal(err) - } + + want := fmt.Sprintf("file%d.go", wantFile) + dontwant := fmt.Sprintf("file%d.go", 3-wantFile) + // file1 has testtag and file2 has !testtag. - if !bytes.Contains(output, []byte(filepath.Join("tagtest", "file1.go"))) { - t.Error("file1 was excluded, should be included") + if !bytes.Contains(output, []byte(filepath.Join("tagtest", want))) { + t.Errorf("%s: %s was excluded, should be included", tag, want) } - if bytes.Contains(output, []byte(filepath.Join("tagtest", "file2.go"))) { - t.Error("file2 was included, should be excluded") + if bytes.Contains(output, []byte(filepath.Join("tagtest", dontwant))) { + t.Errorf("%s: %s was included, should be excluded", tag, dontwant) + } + if t.Failed() { + t.Logf("err=%s, output=<<%s>>", err, output) } }) } } -// Issue #21188. -func TestVetVerbose(t *testing.T) { - t.Parallel() - Build(t) - cmd := exec.Command(binary, "-v", "-all", "testdata/cgo/cgo3.go") - out, err := cmd.CombinedOutput() - if err != nil { - t.Logf("%s", out) - t.Error(err) - } -} - // All declarations below were adapted from test/run.go. // errorCheck matches errors in outStr against comments in source files. From 03eb137aa311e6a5fe43f75c9f0178d042b560d9 Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Thu, 15 Nov 2018 23:24:51 +0000 Subject: [PATCH 057/594] cmd/go: correctly suggest tidy instead of nonexistent fix for -fix CL 129682 removed go mod fix but unfortunately we hadn't updated the source code hence running go mod -fix would suggest go mod fix which is a nonexistent command. This change fixes that to instead suggest go mod tidy Change-Id: Ie0d7c90805034e9fe6df24afaa15340c44d4f426 GitHub-Last-Rev: 5ae1340954c5f6b8535f837755a7bd79ebc7109d GitHub-Pull-Request: golang/go#28402 Reviewed-on: https://go-review.googlesource.com/c/144838 Reviewed-by: Emmanuel Odeke Run-TryBot: Emmanuel Odeke TryBot-Result: Gobot Gobot --- src/cmd/go/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index 6a188262cce67..4f8ab7f55a9eb 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -151,10 +151,10 @@ func main() { flag = flag[:i] } switch flag { - case "-sync": - fmt.Fprintf(os.Stderr, "go: go mod -sync is now go mod tidy\n") + case "-sync", "-fix": + fmt.Fprintf(os.Stderr, "go: go mod %s is now go mod tidy\n", flag) os.Exit(2) - case "-init", "-fix", "-graph", "-vendor", "-verify": + case "-init", "-graph", "-vendor", "-verify": fmt.Fprintf(os.Stderr, "go: go mod %s is now go mod %s\n", flag, flag[1:]) os.Exit(2) case "-fmt", "-json", "-module", "-require", "-droprequire", "-replace", "-dropreplace", "-exclude", "-dropexclude": From 3096b85d37c3b71fb89e42a830b90e48d12e89b4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 22 Jun 2018 10:13:33 -0700 Subject: [PATCH 058/594] cmd/cgo: fix comment grammar Change-Id: I9c881943685177ce14841da53ccaed301c4955dd Reviewed-on: https://go-review.googlesource.com/c/149859 Reviewed-by: Tobias Klauser --- src/cmd/cgo/gcc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 9b615db5db6dd..23b60a646afc8 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -1095,8 +1095,8 @@ func (p *Package) mangle(f *File, arg *ast.Expr) (ast.Expr, bool) { return *arg, needsUnsafe } -// checkIndex checks whether arg the form &a[i], possibly inside type -// conversions. If so, it writes +// checkIndex checks whether arg has the form &a[i], possibly inside +// type conversions. If so, it writes // _cgoIndexNN := a // _cgoNN := &cgoIndexNN[i] // with type conversions, if any // to sb, and writes @@ -1135,7 +1135,7 @@ func (p *Package) checkIndex(sb, sbCheck *bytes.Buffer, arg ast.Expr, i int) boo } // checkAddr checks whether arg has the form &x, possibly inside type -// conversions. If so it writes +// conversions. If so, it writes // _cgoBaseNN := &x // _cgoNN := _cgoBaseNN // with type conversions, if any // to sb, and writes From 48e4d36fed94f0549f17ca082c0106bada094d5d Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 16 Nov 2018 11:26:16 +0100 Subject: [PATCH 059/594] misc/cgo/testsanitizers: gofmt Change-Id: I4e7328bb89f504dbca3948b8565d22c44d41db3d Reviewed-on: https://go-review.googlesource.com/c/149917 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- misc/cgo/testsanitizers/tsan_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cgo/testsanitizers/tsan_test.go b/misc/cgo/testsanitizers/tsan_test.go index 314b5072f360e..1d769a98b6e26 100644 --- a/misc/cgo/testsanitizers/tsan_test.go +++ b/misc/cgo/testsanitizers/tsan_test.go @@ -5,9 +5,9 @@ package sanitizers_test import ( + "runtime" "strings" "testing" - "runtime" ) func TestTSAN(t *testing.T) { From 9ffd5f31dcb95189eeb5c1754291df7b477d5dda Mon Sep 17 00:00:00 2001 From: Vladimir Kovpak Date: Fri, 16 Nov 2018 14:23:17 +0000 Subject: [PATCH 060/594] reflect: add comment for String method of Kind struct On reflect documentation page only this function doesn't have description, this commit add simple description. Change-Id: Idcda89ddd1f6fdd1938c4030e89ebdc186255ce6 GitHub-Last-Rev: 1553b834bb4f7a49efc7ff81763a255bc51bbf17 GitHub-Pull-Request: golang/go#28818 Reviewed-on: https://go-review.googlesource.com/c/149721 Reviewed-by: Ian Lance Taylor --- src/reflect/type.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/reflect/type.go b/src/reflect/type.go index 5bbab79fc0775..f48f9cf09de46 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -593,6 +593,7 @@ const ( kindMask = (1 << 5) - 1 ) +// String returns the name of k. func (k Kind) String() string { if int(k) < len(kindNames) { return kindNames[k] From 41660d0086b302654fce0c948b84e464095398a1 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 16 Nov 2018 09:23:46 -0500 Subject: [PATCH 061/594] cmd/vet: fix two failing test cases Select linux/arm64 for the asm test. Disable the cgo test for now. Will fix properly in a follow-up. Filed Issue 28829 to track it. Updates #28829 Change-Id: Ic05f619700b06e91c43f8c150b089b8e77d92c85 Reviewed-on: https://go-review.googlesource.com/c/149937 Run-TryBot: Alan Donovan TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/vet/vet_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/cmd/vet/vet_test.go b/src/cmd/vet/vet_test.go index 2471679a14340..597681aa30f25 100644 --- a/src/cmd/vet/vet_test.go +++ b/src/cmd/vet/vet_test.go @@ -106,8 +106,19 @@ func TestVet(t *testing.T) { t.Run(pkg, func(t *testing.T) { t.Parallel() + // Skip for now, pending investigation. + if pkg == "cgo" { + t.Skip("cgo test disabled -- github.com/golang/go/issues/28829") + return + } + cmd := vetCmd(t, "-printfuncs=Warn,Warnf", pkg) + // The asm test assumes amd64. + if pkg == "asm" { + cmd.Env = append(cmd.Env, "GOOS=linux", "GOARCH=amd64") + } + dir := filepath.Join("testdata/src", pkg) gos, err := filepath.Glob(filepath.Join(dir, "*.go")) if err != nil { From b1e8846dfb619dedbb90ef0b8edbbde2f5e766ea Mon Sep 17 00:00:00 2001 From: mbj36 Date: Fri, 16 Nov 2018 16:38:39 +0000 Subject: [PATCH 062/594] net/http: fix typo in the SameSite docs Fixes #28244 Change-Id: I3ca36fd513f5543af0c8af254d267254c7d5e803 GitHub-Last-Rev: 83b16fac4e221a249ed036c034367d6f680ae578 GitHub-Pull-Request: golang/go#28302 Reviewed-on: https://go-review.googlesource.com/c/143480 Reviewed-by: Brad Fitzpatrick --- src/net/http/cookie.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/http/cookie.go b/src/net/http/cookie.go index 289c3c37b1989..ad7903f074c18 100644 --- a/src/net/http/cookie.go +++ b/src/net/http/cookie.go @@ -38,7 +38,7 @@ type Cookie struct { // SameSite allows a server to define a cookie attribute making it impossible for // the browser to send this cookie along with cross-site requests. The main -// goal is to mitigate the risk of cross-origin information leakage, and provides +// goal is to mitigate the risk of cross-origin information leakage, and provide // some protection against cross-site request forgery attacks. // // See https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00 for details. From 8f4bc468a7f5846149d7f0b51633c6fea3861515 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Fri, 16 Nov 2018 02:20:58 +0000 Subject: [PATCH 063/594] testing: add example to package doc The package doc for the testing package doesn't have a simple example demonstrating how to write a test with an expectation. The doc has simple examples for benchmarks, examples, and skipping, and it would be useful for people new to writing tests in Go. Also moved the skip example further down because it references tests and benchmarks but benchmarks haven't been discussed in detail until the next section. Skip is also a less used feature and it seems misplaced to sit so high up in the package documentation. As an example, Skip is used 570 times the Go code repository which is significantly less than Error and Fatal that are used 23,303 times. Also changed 'sample' to 'simple' in other places in the package documentation to keep the language used consistent when describing the small examples. Fixes #27839 Change-Id: Ie01a3751986ee61adf2a2f2eda59cc182342baa7 GitHub-Last-Rev: 7357bfdcd29ed1dc1719c9436b5d5420020610ee GitHub-Pull-Request: golang/go#27840 Reviewed-on: https://go-review.googlesource.com/c/137175 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Emmanuel Odeke --- src/testing/testing.go | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/testing/testing.go b/src/testing/testing.go index 0bc222c0bb338..0ac51b6fe5162 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -17,13 +17,13 @@ // package builds but will be included when the ``go test'' command is run. // For more detail, run ``go help test'' and ``go help testflag''. // -// Tests and benchmarks may be skipped if not applicable with a call to -// the Skip method of *T and *B: -// func TestTimeConsuming(t *testing.T) { -// if testing.Short() { -// t.Skip("skipping test in short mode.") +// A simple test function looks like this: +// +// func TestAbs(t *testing.T) { +// got := Abs(-1) +// if got != 1 { +// t.Errorf("Abs(-1) = %d; want 1", got) // } -// ... // } // // Benchmarks @@ -132,6 +132,18 @@ // example function, at least one other function, type, variable, or constant // declaration, and no test or benchmark functions. // +// Skipping +// +// Tests or benchmarks may be skipped at run time with a call to +// the Skip method of *T or *B: +// +// func TestTimeConsuming(t *testing.T) { +// if testing.Short() { +// t.Skip("skipping test in short mode.") +// } +// ... +// } +// // Subtests and Sub-benchmarks // // The Run methods of T and B allow defining subtests and sub-benchmarks, From 8d335084cc58c8167b12ce5d1791bfc6db1355f2 Mon Sep 17 00:00:00 2001 From: Daniel Theophanes Date: Fri, 16 Mar 2018 10:57:44 -0700 Subject: [PATCH 064/594] database/sql: add examples for opening and testing a DB pool Show two larger application examples. One example that could be used in a CLI, the other in a long running service. These demonstarates different strategies for handling DB.Ping errors in context. Fixes #23738 Change-Id: Id01213caf1f47917239a7506b01d30e37db74d31 Reviewed-on: https://go-review.googlesource.com/c/101216 Reviewed-by: Brad Fitzpatrick --- src/database/sql/example_cli_test.go | 86 ++++++++++++ src/database/sql/example_service_test.go | 158 +++++++++++++++++++++++ src/database/sql/example_test.go | 77 +++++++---- 3 files changed, 298 insertions(+), 23 deletions(-) create mode 100644 src/database/sql/example_cli_test.go create mode 100644 src/database/sql/example_service_test.go diff --git a/src/database/sql/example_cli_test.go b/src/database/sql/example_cli_test.go new file mode 100644 index 0000000000000..8c61d755bb845 --- /dev/null +++ b/src/database/sql/example_cli_test.go @@ -0,0 +1,86 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sql_test + +import ( + "context" + "database/sql" + "flag" + "log" + "os" + "os/signal" + "time" +) + +var pool *sql.DB // Database connection pool. + +func Example_openDBCLI() { + id := flag.Int64("id", 0, "person ID to find") + dsn := flag.String("dsn", os.Getenv("DSN"), "connection data source name") + flag.Parse() + + if len(*dsn) == 0 { + log.Fatal("missing dsn flag") + } + if *id == 0 { + log.Fatal("missing person ID") + } + var err error + + // Opening a driver typically will not attempt to connect to the database. + pool, err = sql.Open("driver-name", *dsn) + if err != nil { + // This will not be a connection error, but a DSN parse error or + // another initialization error. + log.Fatal("unable to use data source name", err) + } + defer pool.Close() + + pool.SetConnMaxLifetime(0) + pool.SetMaxIdleConns(3) + pool.SetMaxOpenConns(3) + + ctx, stop := context.WithCancel(context.Background()) + defer stop() + + appSignal := make(chan os.Signal, 3) + signal.Notify(appSignal, os.Interrupt) + + go func() { + select { + case <-appSignal: + stop() + } + }() + + Ping(ctx) + + Query(ctx, *id) +} + +// Ping the database to verify DSN provided by the user is valid and the +// server accessible. If the ping fails exit the program with an error. +func Ping(ctx context.Context) { + ctx, cancel := context.WithTimeout(ctx, 1*time.Second) + defer cancel() + + if err := pool.PingContext(ctx); err != nil { + log.Fatalf("unable to connect to database: %v", err) + } +} + +// Query the database for the information requested and prints the results. +// If the query fails exit the program with an error. +func Query(ctx context.Context, id int64) { + ctx, cancel := context.WithTimeout(ctx, 5*time.Second) + defer cancel() + + var name string + err := pool.QueryRowContext(ctx, "select p.name from people as p where p.id = :id;", sql.Named("id", id)).Scan(&name) + if err != nil { + log.Fatal("unable to execute search query", err) + } + log.Println("name=", name) +} diff --git a/src/database/sql/example_service_test.go b/src/database/sql/example_service_test.go new file mode 100644 index 0000000000000..768307c1471a7 --- /dev/null +++ b/src/database/sql/example_service_test.go @@ -0,0 +1,158 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package sql_test + +import ( + "context" + "database/sql" + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "time" +) + +func Example_openDBService() { + // Opening a driver typically will not attempt to connect to the database. + db, err := sql.Open("driver-name", "database=test1") + if err != nil { + // This will not be a connection error, but a DSN parse error or + // another initialization error. + log.Fatal(err) + } + db.SetConnMaxLifetime(0) + db.SetMaxIdleConns(50) + db.SetMaxOpenConns(50) + + s := &Service{db: db} + + http.ListenAndServe(":8080", s) +} + +type Service struct { + db *sql.DB +} + +func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request) { + db := s.db + switch r.URL.Path { + default: + http.Error(w, "not found", http.StatusNotFound) + return + case "/healthz": + ctx, cancel := context.WithTimeout(r.Context(), 1*time.Second) + defer cancel() + + err := s.db.PingContext(ctx) + if err != nil { + http.Error(w, fmt.Sprintf("db down: %v", err), http.StatusFailedDependency) + return + } + w.WriteHeader(http.StatusOK) + return + case "/quick-action": + // This is a short SELECT. Use the request context as the base of + // the context timeout. + ctx, cancel := context.WithTimeout(r.Context(), 3*time.Second) + defer cancel() + + id := 5 + org := 10 + var name string + err := db.QueryRowContext(ctx, ` +select + p.name +from + people as p + join organization as o on p.organization = o.id +where + p.id = :id + and o.id = :org +;`, + sql.Named("id", id), + sql.Named("org", org), + ).Scan(&name) + if err != nil { + if err == sql.ErrNoRows { + http.Error(w, "not found", http.StatusNotFound) + return + } + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + io.WriteString(w, name) + return + case "/long-action": + // This is a long SELECT. Use the request context as the base of + // the context timeout, but give it some time to finish. If + // the client cancels before the query is done the query will also + // be canceled. + ctx, cancel := context.WithTimeout(r.Context(), 60*time.Second) + defer cancel() + + var names []string + rows, err := db.QueryContext(ctx, "select p.name from people as p where p.active = true;") + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + for rows.Next() { + var name string + err = rows.Scan(&name) + if err != nil { + break + } + names = append(names, name) + } + // Check for errors during rows "Close". + // This may be more important if multiple statements are executed + // in a single batch and rows were written as well as read. + if closeErr := rows.Close(); closeErr != nil { + http.Error(w, closeErr.Error(), http.StatusInternalServerError) + return + } + + // Check for row scan error. + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + // Check for errors during row iteration. + if err = rows.Err(); err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + json.NewEncoder(w).Encode(names) + return + case "/async-action": + // This action has side effects that we want to preserve + // even if the client cancels the HTTP request part way through. + // For this we do not use the http request context as a base for + // the timeout. + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + + var orderRef = "ABC123" + tx, err := db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable}) + _, err = tx.ExecContext(ctx, "stored_proc_name", orderRef) + + if err != nil { + tx.Rollback() + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + err = tx.Commit() + if err != nil { + http.Error(w, "action in unknown state, check state before attempting again", http.StatusInternalServerError) + return + } + w.WriteHeader(http.StatusOK) + return + } +} diff --git a/src/database/sql/example_test.go b/src/database/sql/example_test.go index da938b071a121..6f9bd91276edf 100644 --- a/src/database/sql/example_test.go +++ b/src/database/sql/example_test.go @@ -13,8 +13,10 @@ import ( "time" ) -var ctx = context.Background() -var db *sql.DB +var ( + ctx context.Context + db *sql.DB +) func ExampleDB_QueryContext() { age := 27 @@ -24,13 +26,25 @@ func ExampleDB_QueryContext() { } defer rows.Close() names := make([]string, 0) + for rows.Next() { var name string if err := rows.Scan(&name); err != nil { + // Check for a scan error. + // Query rows will be closed with defer. log.Fatal(err) } names = append(names, name) } + // If the database is being written to ensure to check for Close + // errors that may be returned from the driver. The query may + // encounter an auto-commit error and be forced to rollback changes. + rerr := rows.Close() + if rerr != nil { + log.Fatal(err) + } + + // Rows.Err will report the last error encountered by Rows.Scan. if err := rows.Err(); err != nil { log.Fatal(err) } @@ -44,11 +58,11 @@ func ExampleDB_QueryRowContext() { err := db.QueryRowContext(ctx, "SELECT username, created_at FROM users WHERE id=?", id).Scan(&username, &created) switch { case err == sql.ErrNoRows: - log.Printf("No user with id %d", id) + log.Printf("no user with id %d\n", id) case err != nil: - log.Fatal(err) + log.Fatalf("query error: %v\n", err) default: - fmt.Printf("Username is %s, account created on %s\n", username, created) + log.Printf("username is %q, account created on %s\n", username, created) } } @@ -63,7 +77,7 @@ func ExampleDB_ExecContext() { log.Fatal(err) } if rows != 1 { - panic(err) + log.Fatalf("expected to affect 1 row, affected %d", rows) } } @@ -104,10 +118,10 @@ from if err := rows.Scan(&id, &name); err != nil { log.Fatal(err) } - fmt.Printf("id %d name is %s\n", id, name) + log.Printf("id %d name is %s\n", id, name) } if !rows.NextResultSet() { - log.Fatal("expected more result sets", rows.Err()) + log.Fatalf("expected more result sets: %v", rows.Err()) } var roleMap = map[int64]string{ 1: "user", @@ -122,7 +136,7 @@ from if err := rows.Scan(&id, &role); err != nil { log.Fatal(err) } - fmt.Printf("id %d has role %s\n", id, roleMap[role]) + log.Printf("id %d has role %s\n", id, roleMap[role]) } if err := rows.Err(); err != nil { log.Fatal(err) @@ -130,11 +144,23 @@ from } func ExampleDB_PingContext() { + // Ping and PingContext may be used to determine if communication with + // the database server is still possible. + // + // When used in a command line application Ping may be used to establish + // that further queries are possible; that the provided DSN is valid. + // + // When used in long running service Ping may be part of the health + // checking system. + ctx, cancel := context.WithTimeout(ctx, 1*time.Second) defer cancel() + + status := "up" if err := db.PingContext(ctx); err != nil { - log.Fatal(err) + status = "down" } + log.Println(status) } func ExampleConn_BeginTx() { @@ -162,7 +188,7 @@ func ExampleConn_ExecContext() { } defer conn.Close() // Return the connection to the pool. id := 41 - result, err := conn.ExecContext(ctx, `UPDATE balances SET balance = balance + 10 WHERE user_id = ?`, id) + result, err := conn.ExecContext(ctx, `UPDATE balances SET balance = balance + 10 WHERE user_id = ?;`, id) if err != nil { log.Fatal(err) } @@ -171,7 +197,7 @@ func ExampleConn_ExecContext() { log.Fatal(err) } if rows != 1 { - panic(err) + log.Fatalf("expected single row affected, got %d rows affected", rows) } } @@ -184,9 +210,9 @@ func ExampleTx_ExecContext() { _, execErr := tx.ExecContext(ctx, "UPDATE users SET status = ? WHERE id = ?", "paid", id) if execErr != nil { if rollbackErr := tx.Rollback(); rollbackErr != nil { - log.Printf("Could not roll back: %v\n", rollbackErr) + log.Fatalf("update failed: %v, unable to rollback: %v\n", execErr, rollbackErr) } - log.Fatal(execErr) + log.Fatalf("update failed: %v", execErr) } if err := tx.Commit(); err != nil { log.Fatal(err) @@ -199,17 +225,17 @@ func ExampleTx_Rollback() { log.Fatal(err) } id := 53 - _, err = tx.ExecContext(ctx, "UPDATE drivers SET status = ? WHERE id = ?", "assigned", id) + _, err = tx.ExecContext(ctx, "UPDATE drivers SET status = ? WHERE id = ?;", "assigned", id) if err != nil { if rollbackErr := tx.Rollback(); rollbackErr != nil { - log.Printf("Could not roll back: %v\n", rollbackErr) + log.Fatalf("update drivers: unable to rollback: %v", rollbackErr) } log.Fatal(err) } - _, err = tx.ExecContext(ctx, "UPDATE pickups SET driver_id = $1", id) + _, err = tx.ExecContext(ctx, "UPDATE pickups SET driver_id = $1;", id) if err != nil { if rollbackErr := tx.Rollback(); rollbackErr != nil { - log.Printf("Could not roll back: %v\n", rollbackErr) + log.Fatalf("update failed: %v, unable to back: %v", err, rollbackErr) } log.Fatal(err) } @@ -225,17 +251,18 @@ func ExampleStmt() { log.Fatal(err) } defer stmt.Close() + // Then reuse it each time you need to issue the query. id := 43 var username string err = stmt.QueryRowContext(ctx, id).Scan(&username) switch { case err == sql.ErrNoRows: - log.Printf("No user with that ID.") + log.Fatalf("no user with id %d", id) case err != nil: log.Fatal(err) default: - fmt.Printf("Username is %s\n", username) + log.Printf("username is %s\n", username) } } @@ -245,17 +272,19 @@ func ExampleStmt_QueryRowContext() { if err != nil { log.Fatal(err) } + defer stmt.Close() + // Then reuse it each time you need to issue the query. id := 43 var username string err = stmt.QueryRowContext(ctx, id).Scan(&username) switch { case err == sql.ErrNoRows: - log.Printf("No user with that ID.") + log.Fatalf("no user with id %d", id) case err != nil: log.Fatal(err) default: - fmt.Printf("Username is %s\n", username) + log.Printf("username is %s\n", username) } } @@ -266,6 +295,7 @@ func ExampleRows() { log.Fatal(err) } defer rows.Close() + names := make([]string, 0) for rows.Next() { var name string @@ -274,8 +304,9 @@ func ExampleRows() { } names = append(names, name) } + // Check for errors from iterating over rows. if err := rows.Err(); err != nil { log.Fatal(err) } - fmt.Printf("%s are %d years old", strings.Join(names, ", "), age) + log.Printf("%s are %d years old", strings.Join(names, ", "), age) } From 69010963aa233b7b2762762595ae230692b1c724 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 13 Nov 2018 15:33:57 -0800 Subject: [PATCH 065/594] cmd/compile: provide updating mechanism for format test The compiler's Format test verifies that the correct format strings for the given arguments are used in the compiler sources. The format strings are fairly specialized which is why we cannot use go vet; and the mapping is based on a hard-wired map. In the past, if that map got out of sync with the compiler sources, it was necessary to manually update the map. This change introduces an update mechanism which simply requires the test to be run with the -u flag. (Formerly, the -u flag was used to automatically rewrite format strings; now we use -r for that.) Change-Id: I9259566a6120a13cf34b143875975ada62697890 Reviewed-on: https://go-review.googlesource.com/c/149460 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/cmd/compile/fmt_test.go | 275 ++++++++------------------------- src/cmd/compile/fmtmap_test.go | 203 ++++++++++++++++++++++++ 2 files changed, 269 insertions(+), 209 deletions(-) create mode 100644 src/cmd/compile/fmtmap_test.go diff --git a/src/cmd/compile/fmt_test.go b/src/cmd/compile/fmt_test.go index c5c050fa17c47..51079e3dcf21c 100644 --- a/src/cmd/compile/fmt_test.go +++ b/src/cmd/compile/fmt_test.go @@ -9,18 +9,24 @@ // TestFormats finds potential (Printf, etc.) format strings. // If they are used in a call, the format verbs are verified // based on the matching argument type against a precomputed -// table of valid formats. The knownFormats table can be used -// to automatically rewrite format strings with the -u flag. +// map of valid formats (knownFormats). This map can be used to +// automatically rewrite format strings across all compiler +// files with the -r flag. // -// A new knownFormats table based on the found formats is printed -// when the test is run in verbose mode (-v flag). The table -// needs to be updated whenever a new (type, format) combination -// is found and the format verb is not 'v' or 'T' (as in "%v" or -// "%T"). +// The format map needs to be updated whenever a new (type, +// format) combination is found and the format verb is not +// 'v' or 'T' (as in "%v" or "%T"). To update the map auto- +// matically from the compiler source's use of format strings, +// use the -u flag. (Whether formats are valid for the values +// to be formatted must be verified manually, of course.) // -// Run as: go test -run Formats [-u][-v] +// The -v flag prints out the names of all functions called +// with a format string, the names of files that were not +// processed, and any format rewrites made (with -r). // -// Known bugs: +// Run as: go test -run Formats [-r][-u][-v] +// +// Known shortcomings: // - indexed format strings ("%[2]s", etc.) are not supported // (the test will fail) // - format strings that are not simple string literals cannot @@ -45,6 +51,7 @@ import ( "go/token" "go/types" "internal/testenv" + "io" "io/ioutil" "log" "os" @@ -56,7 +63,10 @@ import ( "unicode/utf8" ) -var update = flag.Bool("u", false, "update format strings") +var ( + rewrite = flag.Bool("r", false, "rewrite format strings") + update = flag.Bool("u", false, "update known formats") +) // The following variables collect information across all processed files. var ( @@ -173,11 +183,11 @@ func TestFormats(t *testing.T) { // write dirty files back var filesUpdated bool - if len(updatedFiles) > 0 && *update { + if len(updatedFiles) > 0 && *rewrite { for _, file := range updatedFiles { var buf bytes.Buffer if err := format.Node(&buf, fset, file.ast); err != nil { - t.Errorf("WARNING: formatting %s failed: %v", file.name, err) + t.Errorf("WARNING: gofmt %s failed: %v", file.name, err) continue } if err := ioutil.WriteFile(file.name, buf.Bytes(), 0x666); err != nil { @@ -189,7 +199,7 @@ func TestFormats(t *testing.T) { } } - // report all function names containing a format string + // report the names of all functions called with a format string if len(callSites) > 0 && testing.Verbose() { set := make(map[string]bool) for _, p := range callSites { @@ -199,23 +209,33 @@ func TestFormats(t *testing.T) { for s := range set { list = append(list, s) } - fmt.Println("\nFunctions") - printList(list) + fmt.Println("\nFunctions called with a format string") + writeList(os.Stdout, list) } - // report all formats found - if len(foundFormats) > 0 && testing.Verbose() { + // update formats + if len(foundFormats) > 0 && *update { var list []string for s := range foundFormats { list = append(list, fmt.Sprintf("%q: \"\",", s)) } - fmt.Println("\nvar knownFormats = map[string]string{") - printList(list) - fmt.Println("}") + var buf bytes.Buffer + buf.WriteString(knownFormatsHeader) + writeList(&buf, list) + buf.WriteString("}\n") + out, err := format.Source(buf.Bytes()) + const outfile = "fmtmap_test.go" + if err != nil { + t.Errorf("WARNING: gofmt %s failed: %v", outfile, err) + out = buf.Bytes() // continue with unformatted source + } + if err = ioutil.WriteFile(outfile, out, 0644); err != nil { + t.Errorf("WARNING: updating format map failed: %v", err) + } } // check that knownFormats is up to date - if !testing.Verbose() && !*update { + if !*rewrite && !*update { var mismatch bool for s := range foundFormats { if _, ok := knownFormats[s]; !ok { @@ -232,7 +252,7 @@ func TestFormats(t *testing.T) { } } if mismatch { - t.Errorf("knownFormats is out of date; please 'go test -v fmt_test.go > foo', then extract new definition of knownFormats from foo") + t.Errorf("format map is out of date; run 'go test -u' to update and manually verify correctness of change'") } } @@ -256,7 +276,7 @@ func TestFormats(t *testing.T) { list = append(list, fmt.Sprintf("%s: %s", posString(lit), nodeString(lit))) } fmt.Println("\nWARNING: Potentially missed format strings") - printList(list) + writeList(os.Stdout, list) t.Fail() } @@ -365,11 +385,11 @@ func collectPkgFormats(t *testing.T, pkg *build.Package) { } } -// printList prints list in sorted order. -func printList(list []string) { +// writeList writes list in sorted order to w. +func writeList(w io.Writer, list []string) { sort.Strings(list) for _, s := range list { - fmt.Println("\t", s) + fmt.Fprintln(w, "\t", s) } } @@ -542,7 +562,7 @@ func init() { // verify that knownFormats entries are correctly formatted for key, val := range knownFormats { // key must be "typename format", and format starts with a '%' - // (formats containing '*' alone are not collected in this table) + // (formats containing '*' alone are not collected in this map) i := strings.Index(key, "%") if i < 0 || !oneFormat(key[i:]) { log.Fatalf("incorrect knownFormats key: %q", key) @@ -554,189 +574,26 @@ func init() { } } +const knownFormatsHeader = `// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements the knownFormats map which records the valid +// formats for a given type. The valid formats must correspond to +// supported compiler formats implemented in fmt.go, or whatever +// other format verbs are implemented for the given type. The map may +// also be used to change the use of a format verb across all compiler +// sources automatically (for instance, if the implementation of fmt.go +// changes), by using the -r option together with the new formats in the +// map. To generate this file automatically from the existing source, +// run: go test -run Formats -u. +// +// See the package comment in fmt_test.go for additional information. + +package main_test + // knownFormats entries are of the form "typename format" -> "newformat". // An absent entry means that the format is not recognized as valid. // An empty new format means that the format should remain unchanged. -// To print out a new table, run: go test -run Formats -v. var knownFormats = map[string]string{ - "*bytes.Buffer %s": "", - "*cmd/compile/internal/gc.Mpflt %v": "", - "*cmd/compile/internal/gc.Mpint %v": "", - "*cmd/compile/internal/gc.Node %#v": "", - "*cmd/compile/internal/gc.Node %+S": "", - "*cmd/compile/internal/gc.Node %+v": "", - "*cmd/compile/internal/gc.Node %0j": "", - "*cmd/compile/internal/gc.Node %L": "", - "*cmd/compile/internal/gc.Node %S": "", - "*cmd/compile/internal/gc.Node %j": "", - "*cmd/compile/internal/gc.Node %p": "", - "*cmd/compile/internal/gc.Node %v": "", - "*cmd/compile/internal/ssa.Block %s": "", - "*cmd/compile/internal/ssa.Block %v": "", - "*cmd/compile/internal/ssa.Func %s": "", - "*cmd/compile/internal/ssa.Func %v": "", - "*cmd/compile/internal/ssa.Register %s": "", - "*cmd/compile/internal/ssa.Register %v": "", - "*cmd/compile/internal/ssa.SparseTreeNode %v": "", - "*cmd/compile/internal/ssa.Value %s": "", - "*cmd/compile/internal/ssa.Value %v": "", - "*cmd/compile/internal/ssa.sparseTreeMapEntry %v": "", - "*cmd/compile/internal/types.Field %p": "", - "*cmd/compile/internal/types.Field %v": "", - "*cmd/compile/internal/types.Sym %0S": "", - "*cmd/compile/internal/types.Sym %S": "", - "*cmd/compile/internal/types.Sym %p": "", - "*cmd/compile/internal/types.Sym %v": "", - "*cmd/compile/internal/types.Type %#L": "", - "*cmd/compile/internal/types.Type %#v": "", - "*cmd/compile/internal/types.Type %+v": "", - "*cmd/compile/internal/types.Type %-S": "", - "*cmd/compile/internal/types.Type %0S": "", - "*cmd/compile/internal/types.Type %L": "", - "*cmd/compile/internal/types.Type %S": "", - "*cmd/compile/internal/types.Type %p": "", - "*cmd/compile/internal/types.Type %s": "", - "*cmd/compile/internal/types.Type %v": "", - "*cmd/internal/obj.Addr %v": "", - "*cmd/internal/obj.LSym %v": "", - "*math/big.Float %f": "", - "*math/big.Int %#x": "", - "*math/big.Int %s": "", - "*math/big.Int %v": "", - "[16]byte %x": "", - "[]*cmd/compile/internal/gc.Node %v": "", - "[]*cmd/compile/internal/ssa.Block %v": "", - "[]*cmd/compile/internal/ssa.Value %v": "", - "[][]string %q": "", - "[]byte %s": "", - "[]byte %x": "", - "[]cmd/compile/internal/ssa.Edge %v": "", - "[]cmd/compile/internal/ssa.ID %v": "", - "[]cmd/compile/internal/ssa.posetNode %v": "", - "[]cmd/compile/internal/ssa.posetUndo %v": "", - "[]cmd/compile/internal/syntax.token %s": "", - "[]string %v": "", - "[]uint32 %v": "", - "bool %v": "", - "byte %08b": "", - "byte %c": "", - "byte %v": "", - "cmd/compile/internal/arm.shift %d": "", - "cmd/compile/internal/gc.Class %d": "", - "cmd/compile/internal/gc.Class %s": "", - "cmd/compile/internal/gc.Class %v": "", - "cmd/compile/internal/gc.Ctype %d": "", - "cmd/compile/internal/gc.Ctype %v": "", - "cmd/compile/internal/gc.Level %d": "", - "cmd/compile/internal/gc.Level %v": "", - "cmd/compile/internal/gc.Nodes %#v": "", - "cmd/compile/internal/gc.Nodes %+v": "", - "cmd/compile/internal/gc.Nodes %.v": "", - "cmd/compile/internal/gc.Nodes %v": "", - "cmd/compile/internal/gc.Op %#v": "", - "cmd/compile/internal/gc.Op %v": "", - "cmd/compile/internal/gc.Val %#v": "", - "cmd/compile/internal/gc.Val %T": "", - "cmd/compile/internal/gc.Val %v": "", - "cmd/compile/internal/gc.fmtMode %d": "", - "cmd/compile/internal/gc.initKind %d": "", - "cmd/compile/internal/gc.itag %v": "", - "cmd/compile/internal/ssa.BranchPrediction %d": "", - "cmd/compile/internal/ssa.Edge %v": "", - "cmd/compile/internal/ssa.GCNode %v": "", - "cmd/compile/internal/ssa.ID %d": "", - "cmd/compile/internal/ssa.ID %v": "", - "cmd/compile/internal/ssa.LocPair %s": "", - "cmd/compile/internal/ssa.LocalSlot %s": "", - "cmd/compile/internal/ssa.LocalSlot %v": "", - "cmd/compile/internal/ssa.Location %T": "", - "cmd/compile/internal/ssa.Location %s": "", - "cmd/compile/internal/ssa.Op %s": "", - "cmd/compile/internal/ssa.Op %v": "", - "cmd/compile/internal/ssa.ValAndOff %s": "", - "cmd/compile/internal/ssa.domain %v": "", - "cmd/compile/internal/ssa.posetNode %v": "", - "cmd/compile/internal/ssa.posetTestOp %v": "", - "cmd/compile/internal/ssa.rbrank %d": "", - "cmd/compile/internal/ssa.regMask %d": "", - "cmd/compile/internal/ssa.register %d": "", - "cmd/compile/internal/syntax.Error %q": "", - "cmd/compile/internal/syntax.Expr %#v": "", - "cmd/compile/internal/syntax.Node %T": "", - "cmd/compile/internal/syntax.Operator %s": "", - "cmd/compile/internal/syntax.Pos %s": "", - "cmd/compile/internal/syntax.Pos %v": "", - "cmd/compile/internal/syntax.position %s": "", - "cmd/compile/internal/syntax.token %q": "", - "cmd/compile/internal/syntax.token %s": "", - "cmd/compile/internal/types.EType %d": "", - "cmd/compile/internal/types.EType %s": "", - "cmd/compile/internal/types.EType %v": "", - "cmd/internal/obj.ABI %v": "", - "error %v": "", - "float64 %.2f": "", - "float64 %.3f": "", - "float64 %.6g": "", - "float64 %g": "", - "int %-12d": "", - "int %-6d": "", - "int %-8o": "", - "int %02d": "", - "int %6d": "", - "int %c": "", - "int %d": "", - "int %v": "", - "int %x": "", - "int16 %d": "", - "int16 %x": "", - "int32 %d": "", - "int32 %v": "", - "int32 %x": "", - "int64 %+d": "", - "int64 %-10d": "", - "int64 %.5d": "", - "int64 %X": "", - "int64 %d": "", - "int64 %v": "", - "int64 %x": "", - "int8 %d": "", - "int8 %x": "", - "interface{} %#v": "", - "interface{} %T": "", - "interface{} %p": "", - "interface{} %q": "", - "interface{} %s": "", - "interface{} %v": "", - "map[*cmd/compile/internal/gc.Node]*cmd/compile/internal/ssa.Value %v": "", - "map[cmd/compile/internal/ssa.ID]uint32 %v": "", - "math/big.Accuracy %s": "", - "reflect.Type %s": "", - "rune %#U": "", - "rune %c": "", - "string %-*s": "", - "string %-16s": "", - "string %-6s": "", - "string %.*s": "", - "string %q": "", - "string %s": "", - "string %v": "", - "time.Duration %d": "", - "time.Duration %v": "", - "uint %04x": "", - "uint %5d": "", - "uint %d": "", - "uint %x": "", - "uint16 %d": "", - "uint16 %v": "", - "uint16 %x": "", - "uint32 %#x": "", - "uint32 %d": "", - "uint32 %v": "", - "uint32 %x": "", - "uint64 %08x": "", - "uint64 %d": "", - "uint64 %x": "", - "uint8 %d": "", - "uint8 %x": "", - "uintptr %d": "", -} +` diff --git a/src/cmd/compile/fmtmap_test.go b/src/cmd/compile/fmtmap_test.go new file mode 100644 index 0000000000000..063445cc9dcb2 --- /dev/null +++ b/src/cmd/compile/fmtmap_test.go @@ -0,0 +1,203 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file implements the knownFormats map which records the valid +// formats for a given type. The valid formats must correspond to +// supported compiler formats implemented in fmt.go, or whatever +// other format verbs are implemented for the given type. The map may +// also be used to change the use of a format verb across all compiler +// sources automatically (for instance, if the implementation of fmt.go +// changes), by using the -r option together with the new formats in the +// map. To generate this file automatically from the existing source, +// run: go test -run Formats -u. +// +// See the package comment in fmt_test.go for additional information. + +package main_test + +// knownFormats entries are of the form "typename format" -> "newformat". +// An absent entry means that the format is not recognized as valid. +// An empty new format means that the format should remain unchanged. +var knownFormats = map[string]string{ + "*bytes.Buffer %s": "", + "*cmd/compile/internal/gc.Mpflt %v": "", + "*cmd/compile/internal/gc.Mpint %v": "", + "*cmd/compile/internal/gc.Node %#v": "", + "*cmd/compile/internal/gc.Node %+S": "", + "*cmd/compile/internal/gc.Node %+v": "", + "*cmd/compile/internal/gc.Node %0j": "", + "*cmd/compile/internal/gc.Node %L": "", + "*cmd/compile/internal/gc.Node %S": "", + "*cmd/compile/internal/gc.Node %j": "", + "*cmd/compile/internal/gc.Node %p": "", + "*cmd/compile/internal/gc.Node %v": "", + "*cmd/compile/internal/ssa.Block %s": "", + "*cmd/compile/internal/ssa.Block %v": "", + "*cmd/compile/internal/ssa.Func %s": "", + "*cmd/compile/internal/ssa.Func %v": "", + "*cmd/compile/internal/ssa.Register %s": "", + "*cmd/compile/internal/ssa.Register %v": "", + "*cmd/compile/internal/ssa.SparseTreeNode %v": "", + "*cmd/compile/internal/ssa.Value %s": "", + "*cmd/compile/internal/ssa.Value %v": "", + "*cmd/compile/internal/ssa.sparseTreeMapEntry %v": "", + "*cmd/compile/internal/types.Field %p": "", + "*cmd/compile/internal/types.Field %v": "", + "*cmd/compile/internal/types.Sym %0S": "", + "*cmd/compile/internal/types.Sym %S": "", + "*cmd/compile/internal/types.Sym %p": "", + "*cmd/compile/internal/types.Sym %v": "", + "*cmd/compile/internal/types.Type %#L": "", + "*cmd/compile/internal/types.Type %#v": "", + "*cmd/compile/internal/types.Type %+v": "", + "*cmd/compile/internal/types.Type %-S": "", + "*cmd/compile/internal/types.Type %0S": "", + "*cmd/compile/internal/types.Type %L": "", + "*cmd/compile/internal/types.Type %S": "", + "*cmd/compile/internal/types.Type %p": "", + "*cmd/compile/internal/types.Type %s": "", + "*cmd/compile/internal/types.Type %v": "", + "*cmd/internal/obj.Addr %v": "", + "*cmd/internal/obj.LSym %v": "", + "*math/big.Float %f": "", + "*math/big.Int %#x": "", + "*math/big.Int %s": "", + "*math/big.Int %v": "", + "[16]byte %x": "", + "[]*cmd/compile/internal/gc.Node %v": "", + "[]*cmd/compile/internal/ssa.Block %v": "", + "[]*cmd/compile/internal/ssa.Value %v": "", + "[][]string %q": "", + "[]byte %s": "", + "[]byte %x": "", + "[]cmd/compile/internal/ssa.Edge %v": "", + "[]cmd/compile/internal/ssa.ID %v": "", + "[]cmd/compile/internal/ssa.posetNode %v": "", + "[]cmd/compile/internal/ssa.posetUndo %v": "", + "[]cmd/compile/internal/syntax.token %s": "", + "[]string %v": "", + "[]uint32 %v": "", + "bool %v": "", + "byte %08b": "", + "byte %c": "", + "byte %v": "", + "cmd/compile/internal/arm.shift %d": "", + "cmd/compile/internal/gc.Class %d": "", + "cmd/compile/internal/gc.Class %s": "", + "cmd/compile/internal/gc.Class %v": "", + "cmd/compile/internal/gc.Ctype %d": "", + "cmd/compile/internal/gc.Ctype %v": "", + "cmd/compile/internal/gc.Level %d": "", + "cmd/compile/internal/gc.Level %v": "", + "cmd/compile/internal/gc.Nodes %#v": "", + "cmd/compile/internal/gc.Nodes %+v": "", + "cmd/compile/internal/gc.Nodes %.v": "", + "cmd/compile/internal/gc.Nodes %v": "", + "cmd/compile/internal/gc.Op %#v": "", + "cmd/compile/internal/gc.Op %v": "", + "cmd/compile/internal/gc.Val %#v": "", + "cmd/compile/internal/gc.Val %T": "", + "cmd/compile/internal/gc.Val %v": "", + "cmd/compile/internal/gc.fmtMode %d": "", + "cmd/compile/internal/gc.initKind %d": "", + "cmd/compile/internal/gc.itag %v": "", + "cmd/compile/internal/ssa.BranchPrediction %d": "", + "cmd/compile/internal/ssa.Edge %v": "", + "cmd/compile/internal/ssa.GCNode %v": "", + "cmd/compile/internal/ssa.ID %d": "", + "cmd/compile/internal/ssa.ID %v": "", + "cmd/compile/internal/ssa.LocPair %s": "", + "cmd/compile/internal/ssa.LocalSlot %s": "", + "cmd/compile/internal/ssa.LocalSlot %v": "", + "cmd/compile/internal/ssa.Location %T": "", + "cmd/compile/internal/ssa.Location %s": "", + "cmd/compile/internal/ssa.Op %s": "", + "cmd/compile/internal/ssa.Op %v": "", + "cmd/compile/internal/ssa.ValAndOff %s": "", + "cmd/compile/internal/ssa.domain %v": "", + "cmd/compile/internal/ssa.posetNode %v": "", + "cmd/compile/internal/ssa.posetTestOp %v": "", + "cmd/compile/internal/ssa.rbrank %d": "", + "cmd/compile/internal/ssa.regMask %d": "", + "cmd/compile/internal/ssa.register %d": "", + "cmd/compile/internal/syntax.Error %q": "", + "cmd/compile/internal/syntax.Expr %#v": "", + "cmd/compile/internal/syntax.Node %T": "", + "cmd/compile/internal/syntax.Operator %s": "", + "cmd/compile/internal/syntax.Pos %s": "", + "cmd/compile/internal/syntax.Pos %v": "", + "cmd/compile/internal/syntax.position %s": "", + "cmd/compile/internal/syntax.token %q": "", + "cmd/compile/internal/syntax.token %s": "", + "cmd/compile/internal/types.EType %d": "", + "cmd/compile/internal/types.EType %s": "", + "cmd/compile/internal/types.EType %v": "", + "cmd/internal/obj.ABI %v": "", + "error %v": "", + "float64 %.2f": "", + "float64 %.3f": "", + "float64 %.6g": "", + "float64 %g": "", + "int %-12d": "", + "int %-6d": "", + "int %-8o": "", + "int %02d": "", + "int %6d": "", + "int %c": "", + "int %d": "", + "int %v": "", + "int %x": "", + "int16 %d": "", + "int16 %x": "", + "int32 %d": "", + "int32 %v": "", + "int32 %x": "", + "int64 %+d": "", + "int64 %-10d": "", + "int64 %.5d": "", + "int64 %X": "", + "int64 %d": "", + "int64 %v": "", + "int64 %x": "", + "int8 %d": "", + "int8 %x": "", + "interface{} %#v": "", + "interface{} %T": "", + "interface{} %p": "", + "interface{} %q": "", + "interface{} %s": "", + "interface{} %v": "", + "map[*cmd/compile/internal/gc.Node]*cmd/compile/internal/ssa.Value %v": "", + "map[cmd/compile/internal/ssa.ID]uint32 %v": "", + "math/big.Accuracy %s": "", + "reflect.Type %s": "", + "rune %#U": "", + "rune %c": "", + "string %-*s": "", + "string %-16s": "", + "string %-6s": "", + "string %.*s": "", + "string %q": "", + "string %s": "", + "string %v": "", + "time.Duration %d": "", + "time.Duration %v": "", + "uint %04x": "", + "uint %5d": "", + "uint %d": "", + "uint %x": "", + "uint16 %d": "", + "uint16 %v": "", + "uint16 %x": "", + "uint32 %#x": "", + "uint32 %d": "", + "uint32 %v": "", + "uint32 %x": "", + "uint64 %08x": "", + "uint64 %d": "", + "uint64 %x": "", + "uint8 %d": "", + "uint8 %x": "", + "uintptr %d": "", +} From f53a98685664e5157977c92651bc99b1f0418db5 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 13 Nov 2018 09:28:33 -0500 Subject: [PATCH 066/594] cmd/go: fix detection of unexpected files in downloaded zips A bug in the old code was indirectly causing a confusing print, but CL 131635 fixed the print instead of the surrounding code. Fix the surrounding code, restore the old print, and test that the error is actually reported (it was being ignored in a direct go get but displaying in go build). Change-Id: I03c21380fce481060c443b0cc820f3617497fdd9 Reviewed-on: https://go-review.googlesource.com/c/149317 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/modfetch/fetch.go | 4 ++-- src/cmd/go/internal/modget/get.go | 2 ++ src/cmd/go/proxy_test.go | 8 +++++++- src/cmd/go/testdata/mod/rsc.io_badzip_v1.0.0.txt | 11 +++++++++++ src/cmd/go/testdata/script/mod_load_badzip.txt | 11 +++++++++++ 5 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/cmd/go/testdata/mod/rsc.io_badzip_v1.0.0.txt create mode 100644 src/cmd/go/testdata/script/mod_load_badzip.txt diff --git a/src/cmd/go/internal/modfetch/fetch.go b/src/cmd/go/internal/modfetch/fetch.go index 8485932b42fca..9984595c05510 100644 --- a/src/cmd/go/internal/modfetch/fetch.go +++ b/src/cmd/go/internal/modfetch/fetch.go @@ -119,11 +119,11 @@ func downloadZip(mod module.Version, target string) error { if err != nil { return err } - prefix := mod.Path + "@" + mod.Version + prefix := mod.Path + "@" + mod.Version + "/" for _, f := range z.File { if !strings.HasPrefix(f.Name, prefix) { z.Close() - return fmt.Errorf("zip for %s has unexpected file %s", prefix, f.Name) + return fmt.Errorf("zip for %s has unexpected file %s", prefix[:len(prefix)-1], f.Name) } } z.Close() diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go index ffc9a12f95364..c2e134c2d695d 100644 --- a/src/cmd/go/internal/modget/get.go +++ b/src/cmd/go/internal/modget/get.go @@ -534,9 +534,11 @@ func runGet(cmd *base.Command, args []string) { // module root. continue } + base.Errorf("%s", p.Error) } todo = append(todo, p) } + base.ExitIfErrors() // If -d was specified, we're done after the download: no build. // (The load.PackagesAndErrors is what did the download diff --git a/src/cmd/go/proxy_test.go b/src/cmd/go/proxy_test.go index 97fc4b0e80735..830cea029b7ac 100644 --- a/src/cmd/go/proxy_test.go +++ b/src/cmd/go/proxy_test.go @@ -197,7 +197,13 @@ func proxyHandler(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(f.Name, ".") { continue } - zf, err := z.Create(path + "@" + vers + "/" + f.Name) + var zipName string + if strings.HasPrefix(f.Name, "/") { + zipName = f.Name[1:] + } else { + zipName = path + "@" + vers + "/" + f.Name + } + zf, err := z.Create(zipName) if err != nil { return cached{nil, err} } diff --git a/src/cmd/go/testdata/mod/rsc.io_badzip_v1.0.0.txt b/src/cmd/go/testdata/mod/rsc.io_badzip_v1.0.0.txt new file mode 100644 index 0000000000000..07a38fa6d7d74 --- /dev/null +++ b/src/cmd/go/testdata/mod/rsc.io_badzip_v1.0.0.txt @@ -0,0 +1,11 @@ +rsc.io/badzip v1.0.0 +written by hand + +-- .mod -- +module rsc.io/badzip +-- .info -- +{"Version":"v1.0.0"} +-- x.go -- +package x +-- /rsc.io/badzip@v1.0.0.txt -- +This file should not be here. diff --git a/src/cmd/go/testdata/script/mod_load_badzip.txt b/src/cmd/go/testdata/script/mod_load_badzip.txt new file mode 100644 index 0000000000000..95513de4a6588 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_load_badzip.txt @@ -0,0 +1,11 @@ +# Zip files with unexpected file names inside should be rejected. +env GO111MODULE=on + +! go get -d rsc.io/badzip +stderr 'zip for rsc.io/badzip@v1.0.0 has unexpected file rsc.io/badzip@v1.0.0.txt' + +! go build rsc.io/badzip +stderr 'zip for rsc.io/badzip@v1.0.0 has unexpected file rsc.io/badzip@v1.0.0.txt' + +-- go.mod -- +module m From 94f7795d05937fdf6187c7f850f8902c0f7a6d81 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 13 Nov 2018 10:09:22 -0500 Subject: [PATCH 067/594] cmd/go: fix experiment isolation in cache key In general we don't assume that the go command knows the specific version of the compiler being used, including which experiments the compiler was built with. Let the compiler tell us, instead of importing cmd/internal/objabi from cmd/go. Replacement for CL 128735. Change-Id: Iaa07f46e19764d0fb14a1c89979bea7bb7139b9c Reviewed-on: https://go-review.googlesource.com/c/149338 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/work/buildid.go | 6 ------ src/cmd/internal/objabi/flag.go | 13 +++++++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/cmd/go/internal/work/buildid.go b/src/cmd/go/internal/work/buildid.go index c5aa1db50b8d6..750bc3c6cdbe4 100644 --- a/src/cmd/go/internal/work/buildid.go +++ b/src/cmd/go/internal/work/buildid.go @@ -18,7 +18,6 @@ import ( "cmd/go/internal/load" "cmd/go/internal/str" "cmd/internal/buildid" - "cmd/internal/objabi" ) // Build IDs @@ -208,11 +207,6 @@ func (b *Builder) toolID(name string) string { id = f[2] } - // For the compiler, add any experiments. - if name == "compile" { - id += " " + objabi.Expstring() - } - b.id.Lock() b.toolIDCache[name] = id b.id.Unlock() diff --git a/src/cmd/internal/objabi/flag.go b/src/cmd/internal/objabi/flag.go index 30cd7dccac20f..90e944656bb8a 100644 --- a/src/cmd/internal/objabi/flag.go +++ b/src/cmd/internal/objabi/flag.go @@ -100,9 +100,18 @@ func (versionFlag) Set(s string) error { // for releases, but during development we include the full // build ID of the binary, so that if the compiler is changed and // rebuilt, we notice and rebuild all packages. - if s == "full" && strings.HasPrefix(Version, "devel") { - p += " buildID=" + buildID + if s == "full" { + // If there's an active experiment, include that, + // to distinguish go1.10.2 with an experiment + // from go1.10.2 without an experiment. + if x := Expstring(); x != "" { + p += " " + x + } + if strings.HasPrefix(Version, "devel") { + p += " buildID=" + buildID + } } + fmt.Printf("%s version %s%s%s\n", name, Version, sep, p) os.Exit(0) return nil From b7ba5233550cadd2b06c4b98c702b45e7904f7ae Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 13 Nov 2018 10:23:01 -0500 Subject: [PATCH 068/594] doc/go_spec: tweak wording to avoid 'explicit assignment' misreading This text changed in CL 139099 to add "explicit" in front of "conversion". But now "explicit conversion or assignment" reads like it might mean "explicit [conversion or assignment]" when what is meant is "[explicit conversion] or assignment". To make clear that explicit does not apply to assignment, use "assignment or explicit conversion". Change-Id: I8ff7a5b3ecd9f562793502fa6808242f22264f28 Reviewed-on: https://go-review.googlesource.com/c/149340 Reviewed-by: Robert Griesemer --- doc/go_spec.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 098a92551a914..dcc81ed628717 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -1348,8 +1348,9 @@

Channel types

The optional <- operator specifies the channel direction, send or receive. If no direction is given, the channel is bidirectional. -A channel may be constrained only to send or only to receive by explicit -conversion or assignment. +A channel may be constrained only to send or only to receive by +assignment or +explicit conversion.

@@ -3624,7 +3625,7 @@ 

Integer overflow

-, *, /, and << may legally overflow and the resulting value exists and is deterministically defined by the signed integer representation, the operation, and its operands. -Overflow does not cause a run-time panic. +Overflow does not cause a run-time panic. A compiler may not optimize code under the assumption that overflow does not occur. For instance, it may not assume that x < x + 1 is always true.

From 55e1fc930b3a4efe4ac8ad74ff7844be4c7ef162 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 16 Nov 2018 10:43:21 -0500 Subject: [PATCH 069/594] cmd/vet: reenable cgo test The reason the 386 trybot was happy but 'GOARCH=386 go test cmd/vet' was not is that CgoEnabled defaults to false in a cross build; I have no idea why. Now we ask the go command for the effective value so that the test works in both cases. Also, remove stale comment. Fixes #28829 Change-Id: I1210af34da6986f47924059de5c1f08b2824ace9 Reviewed-on: https://go-review.googlesource.com/c/149958 Run-TryBot: Alan Donovan TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/vet/vet_test.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/cmd/vet/vet_test.go b/src/cmd/vet/vet_test.go index 597681aa30f25..d106c5c29ce7c 100644 --- a/src/cmd/vet/vet_test.go +++ b/src/cmd/vet/vet_test.go @@ -70,11 +70,6 @@ func vetCmd(t *testing.T, args ...string) *exec.Cmd { return cmd } -// TestVet is equivalent to running this: -// go build -o ./testvet -// errorCheck the output of ./testvet -printfuncs='Warn:1,Warnf:1' testdata/*.go testdata/*.s -// rm ./testvet -// func TestVet(t *testing.T) { t.Parallel() Build(t) @@ -106,9 +101,8 @@ func TestVet(t *testing.T) { t.Run(pkg, func(t *testing.T) { t.Parallel() - // Skip for now, pending investigation. - if pkg == "cgo" { - t.Skip("cgo test disabled -- github.com/golang/go/issues/28829") + // Skip cgo test on platforms without cgo. + if pkg == "cgo" && !cgoEnabled(t) { return } @@ -137,6 +131,17 @@ func TestVet(t *testing.T) { } } +func cgoEnabled(t *testing.T) bool { + // Don't trust build.Default.CgoEnabled as it is false for + // cross-builds unless CGO_ENABLED is explicitly specified. + // That's fine for the builders, but causes commands like + // 'GOARCH=386 go test .' to fail. + // Instead, we ask the go command. + cmd := exec.Command(testenv.GoToolPath(t), "list", "-f", "{{context.CgoEnabled}}") + out, _ := cmd.CombinedOutput() + return string(out) == "true\n" +} + func errchk(c *exec.Cmd, files []string, t *testing.T) { output, err := c.CombinedOutput() if _, ok := err.(*exec.ExitError); !ok { From 2a07c50a5cbf548a313eed6e691be78a0bac8b3e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 16 Nov 2018 12:47:33 -0500 Subject: [PATCH 070/594] build: clear GO111MODULE during make.bash etc The standard build assumes the variable is unset. Make it so, like we do for GOFLAGS, GOBIN, and so on. Change-Id: I4ad5695f8021b08bd1a35dd99112970a813d247c Reviewed-on: https://go-review.googlesource.com/c/149959 Run-TryBot: Russ Cox Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/make.bash | 1 + src/make.bat | 1 + src/make.rc | 1 + src/run.bash | 1 + src/run.bat | 1 + src/run.rc | 1 + 6 files changed, 6 insertions(+) diff --git a/src/make.bash b/src/make.bash index 78882d98341f6..13497eb039d89 100755 --- a/src/make.bash +++ b/src/make.bash @@ -64,6 +64,7 @@ set -e unset GOBIN # Issue 14340 unset GOFLAGS +unset GO111MODULE if [ ! -f run.bash ]; then echo 'make.bash must be run from $GOROOT/src' 1>&2 diff --git a/src/make.bat b/src/make.bat index 9ca7afb5aa979..69275e22568a2 100644 --- a/src/make.bat +++ b/src/make.bat @@ -48,6 +48,7 @@ setlocal set GOBUILDFAIL=0 set GOFLAGS= +set GO111MODULE= if exist make.bat goto ok echo Must run make.bat from Go src directory. diff --git a/src/make.rc b/src/make.rc index a97dfc8a0105f..5f888c19fd7bd 100755 --- a/src/make.rc +++ b/src/make.rc @@ -48,6 +48,7 @@ if(~ $1 -v) { } GOFLAGS=() +GO111MODULE=() GOROOT = `{cd .. && pwd} if(! ~ $#GOROOT_BOOTSTRAP 1) GOROOT_BOOTSTRAP = $home/go1.4 diff --git a/src/run.bash b/src/run.bash index c14f4a206d3f3..1c6c4244349f5 100755 --- a/src/run.bash +++ b/src/run.bash @@ -21,6 +21,7 @@ export GOPATH unset CDPATH # in case user has it set unset GOBIN # Issue 14340 unset GOFLAGS +unset GO111MODULE export GOHOSTOS export CC diff --git a/src/run.bat b/src/run.bat index 0e0c413617c76..123edcc35dd7d 100644 --- a/src/run.bat +++ b/src/run.bat @@ -18,6 +18,7 @@ set GOPATH= :: Issue 14340: ignore GOBIN during all.bat. set GOBIN= set GOFLAGS= +set GO111MODULE= rem TODO avoid rebuild if possible diff --git a/src/run.rc b/src/run.rc index 49d6fd9a4df1e..c346f5cf5c6a2 100755 --- a/src/run.rc +++ b/src/run.rc @@ -11,5 +11,6 @@ GOPATH = () # we disallow local import for non-local packages, if $GOROOT happen # to be under $GOPATH, then some tests below will fail GOBIN = () # Issue 14340 GOFLAGS = () +GO111MODULE = () exec go tool dist test -rebuild $* From 35244d8fd160f6aa7614f4daa7bfccda1a518510 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 16 Nov 2018 13:27:55 -0500 Subject: [PATCH 071/594] cmd/go: vet: provide package ID to the vet tool This field, which matches the IDs used by go list, will enable all vet drivers to produce JSON output in a consistent format (a map from package ID to analysis name to result). Change-Id: Icac703b944de55df42c996dc2f672005014ad57a Reviewed-on: https://go-review.googlesource.com/c/149960 Reviewed-by: Russ Cox --- src/cmd/go/internal/work/exec.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index d6f9021c35c09..ca588911fed84 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -881,6 +881,7 @@ func (b *Builder) loadCachedSrcFiles(a *Action) bool { // vetConfig is the configuration passed to vet describing a single package. type vetConfig struct { + ID string // package ID (example: "fmt [fmt.test]") Compiler string // compiler name (gc, gccgo) Dir string // directory containing package ImportPath string // canonical import path ("package path") @@ -914,6 +915,7 @@ func buildVetConfig(a *Action, srcfiles []string) { // so that we can reformat them relative to the directory // in which the go command is invoked. vcfg := &vetConfig{ + ID: a.Package.ImportPath, Compiler: cfg.BuildToolchainName, Dir: a.Package.Dir, GoFiles: mkAbsFiles(a.Package.Dir, gofiles), From 92caeef8924ab0023719613f573b33d14cb3ef8e Mon Sep 17 00:00:00 2001 From: marwan-at-work Date: Fri, 16 Nov 2018 02:04:44 +0000 Subject: [PATCH 072/594] cmd/go: accept @hash/branch in mod download Go get in mod-enabled packages lets you do go get "pkg@" or "pkg@". Go internally will switch the hash or branch into a pseudo version. Go mod download should do the same. The bug lay in the fact that the disk cache was not being written when Go converted the hash/branch into a pseudo version. Fixes #27947 Change-Id: I94c29a5c95f69ab18a9cd7a2ecade128047c5e36 GitHub-Last-Rev: 668634b3e70206c6eadabae5969fca1b03093b0d GitHub-Pull-Request: golang/go#28042 Reviewed-on: https://go-review.googlesource.com/c/140257 Reviewed-by: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/go/internal/modfetch/cache.go | 8 ++++--- .../go/testdata/script/mod_download_hash.txt | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 src/cmd/go/testdata/script/mod_download_hash.txt diff --git a/src/cmd/go/internal/modfetch/cache.go b/src/cmd/go/internal/modfetch/cache.go index 1f9cc96c3ec80..171718d20b068 100644 --- a/src/cmd/go/internal/modfetch/cache.go +++ b/src/cmd/go/internal/modfetch/cache.go @@ -129,16 +129,18 @@ func (r *cachingRepo) Stat(rev string) (*RevInfo, error) { } info, err = r.r.Stat(rev) if err == nil { - if err := writeDiskStat(file, info); err != nil { - fmt.Fprintf(os.Stderr, "go: writing stat cache: %v\n", err) - } // If we resolved, say, 1234abcde to v0.0.0-20180604122334-1234abcdef78, // then save the information under the proper version, for future use. if info.Version != rev { + file, _ = CachePath(module.Version{Path: r.path, Version: info.Version}, "info") r.cache.Do("stat:"+info.Version, func() interface{} { return cachedInfo{info, err} }) } + + if err := writeDiskStat(file, info); err != nil { + fmt.Fprintf(os.Stderr, "go: writing stat cache: %v\n", err) + } } return cachedInfo{info, err} }).(cachedInfo) diff --git a/src/cmd/go/testdata/script/mod_download_hash.txt b/src/cmd/go/testdata/script/mod_download_hash.txt new file mode 100644 index 0000000000000..1662043207ed6 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_download_hash.txt @@ -0,0 +1,23 @@ +env GO111MODULE=on + +# Testing mod download with non semantic versions; turn off proxy. +[!net] skip +[!exec:git] skip +env GOPROXY= + +go mod download rsc.io/quote@a91498bed0a73d4bb9c1fb2597925f7883bc40a7 +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v0.0.0-20180709162918-a91498bed0a7.info +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v0.0.0-20180709162918-a91498bed0a7.mod +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v0.0.0-20180709162918-a91498bed0a7.zip + +go mod download rsc.io/quote@master +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v0.0.0-20180710144737-5d9f230bcfba.info +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v0.0.0-20180710144737-5d9f230bcfba.mod +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v0.0.0-20180710144737-5d9f230bcfba.zip + + +-- go.mod -- +module m + +-- m.go -- +package m \ No newline at end of file From b411c4268ed6cfdd3ba955e6f119573127ab2534 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 16 Nov 2018 14:23:15 -0500 Subject: [PATCH 073/594] cmd/vendor: update to golang.org/x/tools@8e5aba0a - Adds 'go vet -json' and 'go vet -c=1' flags - Removes the pkgfact analyzer, included by mistake. Change-Id: Id3f1879af479efc567ea0508a1de7a37db5bee89 Reviewed-on: https://go-review.googlesource.com/c/149961 Run-TryBot: Brad Fitzpatrick Run-TryBot: Michael Matloob Reviewed-by: Michael Matloob TryBot-Result: Gobot Gobot --- .../x/tools/go/analysis/cmd/vet-lite/main.go | 15 -- .../analysis/internal/analysisflags/flags.go | 136 ++++++++++++++---- .../go/analysis/unitchecker/unitchecker.go | 56 ++++++-- 3 files changed, 149 insertions(+), 58 deletions(-) diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go index d767d56663c52..259d3976b4e50 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go @@ -7,8 +7,6 @@ package main import ( - "flag" - "golang.org/x/tools/go/analysis/unitchecker" "golang.org/x/tools/go/analysis/passes/asmdecl" @@ -23,7 +21,6 @@ import ( "golang.org/x/tools/go/analysis/passes/loopclosure" "golang.org/x/tools/go/analysis/passes/lostcancel" "golang.org/x/tools/go/analysis/passes/nilfunc" - "golang.org/x/tools/go/analysis/passes/pkgfact" "golang.org/x/tools/go/analysis/passes/printf" "golang.org/x/tools/go/analysis/passes/shift" "golang.org/x/tools/go/analysis/passes/stdmethods" @@ -35,11 +32,6 @@ import ( "golang.org/x/tools/go/analysis/passes/unusedresult" ) -// Flags for legacy vet compatibility. -// -// These flags, plus the shims in analysisflags, enable -// existing scripts that run vet to continue to work. -// // Legacy vet had the concept of "experimental" checkers. There // was exactly one, shadow, and it had to be explicitly enabled // by the -shadow flag, which would of course disable all the @@ -54,12 +46,6 @@ import ( // Alternatively, one could build a multichecker containing all // the desired checks (vet's suite + shadow) and run it in a // single "go vet" command. -func init() { - _ = flag.Bool("source", false, "no effect (deprecated)") - _ = flag.Bool("v", false, "no effect (deprecated)") - _ = flag.Bool("all", false, "no effect (deprecated)") - _ = flag.String("tags", "", "no effect (deprecated)") -} func main() { unitchecker.Main( @@ -75,7 +61,6 @@ func main() { loopclosure.Analyzer, lostcancel.Analyzer, nilfunc.Analyzer, - pkgfact.Analyzer, printf.Analyzer, shift.Analyzer, stdmethods.Analyzer, diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go index b5ad4f47cb98a..729ac3b41768d 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go @@ -11,27 +11,29 @@ import ( "encoding/json" "flag" "fmt" + "go/token" "io" + "io/ioutil" "log" "os" "strconv" + "strings" "golang.org/x/tools/go/analysis" ) +// flags common to all {single,multi,unit}checkers. +var ( + JSON = false // -json + Context = -1 // -c=N: if N>0, display offending line plus N lines of context +) + // Parse creates a flag for each of the analyzer's flags, // including (in multi mode) a flag named after the analyzer, // parses the flags, then filters and returns the list of // analyzers enabled by flags. func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { // Connect each analysis flag to the command line as -analysis.flag. - type analysisFlag struct { - Name string - Bool bool - Usage string - } - var analysisFlags []analysisFlag - enabled := make(map[*analysis.Analyzer]*triState) for _, a := range analyzers { var prefix string @@ -44,7 +46,6 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { enableUsage := "enable " + a.Name + " analysis" flag.Var(enable, a.Name, enableUsage) enabled[a] = enable - analysisFlags = append(analysisFlags, analysisFlag{a.Name, true, enableUsage}) } a.Flags.VisitAll(func(f *flag.Flag) { @@ -55,9 +56,6 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { name := prefix + f.Name flag.Var(f.Value, name, f.Usage) - - isBool := isBoolFlag(f.Value) - analysisFlags = append(analysisFlags, analysisFlag{name, isBool, f.Usage}) }) } @@ -65,23 +63,20 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { printflags := flag.Bool("flags", false, "print analyzer flags in JSON") addVersionFlag() + // flags common to all checkers + flag.BoolVar(&JSON, "json", JSON, "emit JSON output") + flag.IntVar(&Context, "c", Context, `display offending line with this many lines of context`) + // Add shims for legacy vet flags to enable existing // scripts that run vet to continue to work. _ = flag.Bool("source", false, "no effect (deprecated)") _ = flag.Bool("v", false, "no effect (deprecated)") _ = flag.Bool("all", false, "no effect (deprecated)") _ = flag.String("tags", "", "no effect (deprecated)") - for _, name := range []string{"source", "v", "all", "tags"} { - f := flag.Lookup(name) - isBool := isBoolFlag(f.Value) - analysisFlags = append(analysisFlags, analysisFlag{name, isBool, f.Usage}) - } for old, new := range vetLegacyFlags { newFlag := flag.Lookup(new) if newFlag != nil && flag.Lookup(old) == nil { flag.Var(newFlag.Value, old, "deprecated alias for -"+new) - isBool := isBoolFlag(newFlag.Value) - analysisFlags = append(analysisFlags, analysisFlag{old, isBool, newFlag.Usage}) } } @@ -89,11 +84,7 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { // -flags: print flags so that go vet knows which ones are legitimate. if *printflags { - data, err := json.MarshalIndent(analysisFlags, "", "\t") - if err != nil { - log.Fatal(err) - } - os.Stdout.Write(data) + printFlags() os.Exit(0) } @@ -131,6 +122,33 @@ func Parse(analyzers []*analysis.Analyzer, multi bool) []*analysis.Analyzer { return analyzers } +func printFlags() { + type jsonFlag struct { + Name string + Bool bool + Usage string + } + var flags []jsonFlag = nil + flag.VisitAll(func(f *flag.Flag) { + // Don't report {single,multi}checker debugging + // flags as these have no effect on unitchecker + // (as invoked by 'go vet'). + switch f.Name { + case "debug", "cpuprofile", "memprofile", "trace": + return + } + + b, ok := f.Value.(interface{ IsBoolFlag() bool }) + isBool := ok && b.IsBoolFlag() + flags = append(flags, jsonFlag{f.Name, isBool, f.Usage}) + }) + data, err := json.MarshalIndent(flags, "", "\t") + if err != nil { + log.Fatal(err) + } + os.Stdout.Write(data) +} + // addVersionFlag registers a -V flag that, if set, // prints the executable version and exits 0. // @@ -238,11 +256,6 @@ func (ts triState) IsBoolFlag() bool { return true } -func isBoolFlag(v flag.Value) bool { - b, ok := v.(interface{ IsBoolFlag() bool }) - return ok && b.IsBoolFlag() -} - // Legacy flag support // vetLegacyFlags maps flags used by legacy vet to their corresponding @@ -261,3 +274,70 @@ var vetLegacyFlags = map[string]string{ "unusedfuncs": "unusedresult.funcs", "unusedstringmethods": "unusedresult.stringmethods", } + +// ---- output helpers common to all drivers ---- + +// PrintPlain prints a diagnostic in plain text form, +// with context specified by the -c flag. +func PrintPlain(fset *token.FileSet, diag analysis.Diagnostic) { + posn := fset.Position(diag.Pos) + fmt.Fprintf(os.Stderr, "%s: %s\n", posn, diag.Message) + + // -c=N: show offending line plus N lines of context. + if Context >= 0 { + data, _ := ioutil.ReadFile(posn.Filename) + lines := strings.Split(string(data), "\n") + for i := posn.Line - Context; i <= posn.Line+Context; i++ { + if 1 <= i && i <= len(lines) { + fmt.Fprintf(os.Stderr, "%d\t%s\n", i, lines[i-1]) + } + } + } +} + +// A JSONTree is a mapping from package ID to analysis name to result. +// Each result is either a jsonError or a list of jsonDiagnostic. +type JSONTree map[string]map[string]interface{} + +// Add adds the result of analysis 'name' on package 'id'. +// The result is either a list of diagnostics or an error. +func (tree JSONTree) Add(fset *token.FileSet, id, name string, diags []analysis.Diagnostic, err error) { + var v interface{} + if err != nil { + type jsonError struct { + Err string `json:"error"` + } + v = jsonError{err.Error()} + } else if len(diags) > 0 { + type jsonDiagnostic struct { + Category string `json:"category,omitempty"` + Posn string `json:"posn"` + Message string `json:"message"` + } + var diagnostics []jsonDiagnostic + for _, f := range diags { + diagnostics = append(diagnostics, jsonDiagnostic{ + Category: f.Category, + Posn: fset.Position(f.Pos).String(), + Message: f.Message, + }) + } + v = diagnostics + } + if v != nil { + m, ok := tree[id] + if !ok { + m = make(map[string]interface{}) + tree[id] = m + } + m[name] = v + } +} + +func (tree JSONTree) Print() { + data, err := json.MarshalIndent(tree, "", "\t") + if err != nil { + log.Panicf("internal error: JSON marshalling failed: %v", err) + } + fmt.Printf("%s\n", data) +} diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index edfca577bff89..7b8fec9db28d5 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -25,7 +25,6 @@ package unitchecker // so we will not get to analyze it. Yet we must in order // to create base facts for, say, the fmt package for the // printf checker. -// - support JSON output, factored with multichecker. import ( "encoding/gob" @@ -57,6 +56,7 @@ import ( // It is provided to the tool in a JSON-encoded file // whose name ends with ".cfg". type Config struct { + ID string // e.g. "fmt [fmt.test]" Compiler string Dir string ImportPath string @@ -127,16 +127,37 @@ func Run(configFile string, analyzers []*analysis.Analyzer) { } fset := token.NewFileSet() - diags, err := run(fset, cfg, analyzers) + results, err := run(fset, cfg, analyzers) if err != nil { log.Fatal(err) } - if !cfg.VetxOnly && len(diags) > 0 { - for _, diag := range diags { - fmt.Fprintf(os.Stderr, "%s: %s\n", fset.Position(diag.Pos), diag.Message) + // In VetxOnly mode, the analysis is run only for facts. + if !cfg.VetxOnly { + if analysisflags.JSON { + // JSON output + tree := make(analysisflags.JSONTree) + for _, res := range results { + tree.Add(fset, cfg.ID, res.a.Name, res.diagnostics, res.err) + } + tree.Print() + } else { + // plain text + exit := 0 + for _, res := range results { + if res.err != nil { + log.Println(res.err) + exit = 1 + } + } + for _, res := range results { + for _, diag := range res.diagnostics { + analysisflags.PrintPlain(fset, diag) + exit = 1 + } + } + os.Exit(exit) } - os.Exit(1) } os.Exit(0) @@ -160,7 +181,7 @@ func readConfig(filename string) (*Config, error) { return cfg, nil } -func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]analysis.Diagnostic, error) { +func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]result, error) { // Load, parse, typecheck. var files []*ast.File for _, name := range cfg.GoFiles { @@ -333,14 +354,13 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]an execAll(analyzers) - // Return diagnostics from root analyzers. - var diags []analysis.Diagnostic - for _, a := range analyzers { + // Return diagnostics and errors from root analyzers. + results := make([]result, len(analyzers)) + for i, a := range analyzers { act := actions[a] - if act.err != nil { - return nil, act.err // some analysis failed - } - diags = append(diags, act.diagnostics...) + results[i].a = a + results[i].err = act.err + results[i].diagnostics = act.diagnostics } data := facts.Encode() @@ -348,7 +368,13 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]an return nil, fmt.Errorf("failed to write analysis facts: %v", err) } - return diags, nil + return results, nil +} + +type result struct { + a *analysis.Analyzer + diagnostics []analysis.Diagnostic + err error } type importerFunc func(path string) (*types.Package, error) From a3f64237adf0ccfe379ffa2cb00e013896995a3a Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 16 Nov 2018 14:43:23 -0500 Subject: [PATCH 074/594] cmd/vet: basic tests of go vet -json -c=N flags Change-Id: I787592a5d92ff9329ecdfcf879e491af66c8b749 Reviewed-on: https://go-review.googlesource.com/c/149962 Run-TryBot: Alan Donovan Reviewed-by: Michael Matloob TryBot-Result: Gobot Gobot --- src/cmd/go/testdata/script/vet_asm.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/cmd/go/testdata/script/vet_asm.txt b/src/cmd/go/testdata/script/vet_asm.txt index b7e1874b8cb0d..807e2b76f5899 100644 --- a/src/cmd/go/testdata/script/vet_asm.txt +++ b/src/cmd/go/testdata/script/vet_asm.txt @@ -5,6 +5,21 @@ env GOARCH=amd64 ! go vet -asmdecl a stderr 'f: invalid MOVW of x' +# -c flag shows context +! go vet -c=2 -asmdecl a +stderr '...invalid MOVW...' +stderr '1 .*TEXT' +stderr '2 MOVW' +stderr '3 RET' +stderr '4' + +# -json causes success, even with diagnostics and errors. +go vet -json -asmdecl a +stderr '"a": {' +stderr '"asmdecl":' +stderr '"posn": ".*asm.s:2:1",' +stderr '"message": ".*invalid MOVW.*"' + -- a/a.go -- package a From b358987666de3f2ec1d7c6ad65eeb0c7874c7f2a Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 16 Nov 2018 16:28:49 +0000 Subject: [PATCH 075/594] cmd/vet/all: remove skip when x/tools isn't in $GOPATH Now that the build system has been updated to install x/tools in $GOPATH (CL 149658), depend on it being there and don't ignore failures to build the tool. Update to CL 149097. Change-Id: I72fde347217533697068b6a6773696cc2b83e9ed Reviewed-on: https://go-review.googlesource.com/c/150017 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Alan Donovan --- src/cmd/vet/all/main.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/cmd/vet/all/main.go b/src/cmd/vet/all/main.go index 71915ed9f1213..2500c690bfd6e 100644 --- a/src/cmd/vet/all/main.go +++ b/src/cmd/vet/all/main.go @@ -236,10 +236,6 @@ func (p platform) vet() { cmd.Stderr = os.Stderr cmd.Stdout = os.Stderr if err := cmd.Run(); err != nil { - if _, err := build.Default.Import("golang.org/x/tools/go/analysis/cmd/vet", "", 0); err != nil { - fmt.Printf("skipping because golang.org/x/tools is not in GOPATH") - return - } log.Fatal(err) } From 925568861085c29f834ff7949481f8208264f5ee Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 15 Nov 2018 15:23:48 -0500 Subject: [PATCH 076/594] cmd/asm: rename -symabis to -gensymabis Currently, both asm and compile have a -symabis flag, but in asm it's a boolean flag that means to generate a symbol ABIs file and in the compiler its a string flag giving the path of the symbol ABIs file to consume. I'm worried about this false symmetry biting us in the future, so rename asm's flag to -gensymabis. Updates #27539. Change-Id: I8b9c18a852d2838099718f8989813f19d82e7434 Reviewed-on: https://go-review.googlesource.com/c/149818 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/asm/doc.go | 2 ++ src/cmd/asm/internal/flags/flags.go | 2 +- src/cmd/dist/build.go | 2 +- src/cmd/go/internal/work/gc.go | 4 ++-- test/run.go | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cmd/asm/doc.go b/src/cmd/asm/doc.go index c39cab3c19585..8bf0acac25f79 100644 --- a/src/cmd/asm/doc.go +++ b/src/cmd/asm/doc.go @@ -39,6 +39,8 @@ Flags: Generate code that can be linked into a shared library. -trimpath prefix Remove prefix from recorded source file paths. + -gensymabis + Write symbol ABI information to output file. Don't assemble. Input language: The assembler uses mostly the same syntax for all architectures, diff --git a/src/cmd/asm/internal/flags/flags.go b/src/cmd/asm/internal/flags/flags.go index 752a1d45265d3..5fe3fd9d53c6f 100644 --- a/src/cmd/asm/internal/flags/flags.go +++ b/src/cmd/asm/internal/flags/flags.go @@ -22,7 +22,7 @@ var ( Shared = flag.Bool("shared", false, "generate code that can be linked into a shared library") Dynlink = flag.Bool("dynlink", false, "support references to Go symbols defined in other shared libraries") AllErrors = flag.Bool("e", false, "no limit on number of errors reported") - SymABIs = flag.Bool("symabis", false, "write symbol ABI information to output file, don't assemble") + SymABIs = flag.Bool("gensymabis", false, "write symbol ABI information to output file, don't assemble") ) var ( diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index a94a43fd66459..8d7b14d17c650 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -804,7 +804,7 @@ func runInstall(dir string, ch chan struct{}) { if len(sfiles) > 0 { symabis = pathf("%s/symabis", workdir) var wg sync.WaitGroup - asmabis := append(asmArgs[:len(asmArgs):len(asmArgs)], "-symabis", "-o", symabis) + asmabis := append(asmArgs[:len(asmArgs):len(asmArgs)], "-gensymabis", "-o", symabis) asmabis = append(asmabis, sfiles...) if err := ioutil.WriteFile(goasmh, nil, 0666); err != nil { fatalf("cannot write empty go_asm.h: %s", err) diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index 89ef2da8cb59f..a14a970ffbd3c 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -265,7 +265,7 @@ func (gcToolchain) asm(b *Builder, a *Action, sfiles []string) ([]string, error) func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, error) { mkSymabis := func(p *load.Package, sfiles []string, path string) error { args := asmArgs(a, p) - args = append(args, "-symabis", "-o", path) + args = append(args, "-gensymabis", "-o", path) for _, sfile := range sfiles { if p.ImportPath == "runtime/cgo" && strings.HasPrefix(sfile, "gcc_") { continue @@ -274,7 +274,7 @@ func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, erro } // Supply an empty go_asm.h as if the compiler had been run. - // -symabis parsing is lax enough that we don't need the + // -gensymabis parsing is lax enough that we don't need the // actual definitions that would appear in go_asm.h. if err := b.writeFile(a.Objdir+"go_asm.h", nil); err != nil { return err diff --git a/test/run.go b/test/run.go index 3a9e267940f25..39647d7252d15 100644 --- a/test/run.go +++ b/test/run.go @@ -813,7 +813,7 @@ func (t *test) run() { t.err = fmt.Errorf("write empty go_asm.h: %s", err) return } - cmd := []string{goTool(), "tool", "asm", "-symabis", "-o", "symabis"} + cmd := []string{goTool(), "tool", "asm", "-gensymabis", "-o", "symabis"} cmd = append(cmd, asms...) _, err = runcmd(cmd...) if err != nil { From ba8f6fa0ca6d5880c637918b16726237480e2854 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 15 Nov 2018 18:41:03 -0800 Subject: [PATCH 077/594] cmd/cgo: recognized untyped Go constants as untyped constants Fixes #28772 Change-Id: I9446d95fb73fbcbb1cd9a4d2156ebc91bc9e91cb Reviewed-on: https://go-review.googlesource.com/c/149858 Run-TryBot: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- misc/cgo/test/issue28545.go | 6 ++++++ src/cmd/cgo/ast.go | 13 +++++++++++++ src/cmd/cgo/gcc.go | 3 ++- src/cmd/cgo/main.go | 1 + 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/misc/cgo/test/issue28545.go b/misc/cgo/test/issue28545.go index 802a20b779e6e..0410a1662267d 100644 --- a/misc/cgo/test/issue28545.go +++ b/misc/cgo/test/issue28545.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // Failed to add type conversion for negative constant. +// Issue 28772: Failed to add type conversion for Go constant set to C constant. // No runtime test; just make sure it compiles. package cgotest @@ -10,11 +11,16 @@ package cgotest /* #include +#define issue28772Constant 1 + static void issue28545F(char **p, int n, complex double a) {} */ import "C" +const issue28772Constant = C.issue28772Constant + func issue28545G(p **C.char) { C.issue28545F(p, -1, (0)) C.issue28545F(p, 2+3, complex(1, 1)) + C.issue28545F(p, issue28772Constant, (0)) } diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go index 4462136bf4bc5..c342a017833b5 100644 --- a/src/cmd/cgo/ast.go +++ b/src/cmd/cgo/ast.go @@ -66,6 +66,7 @@ func (f *File) ParseGo(name string, src []byte) { f.Package = ast1.Name.Name f.Name = make(map[string]*Name) f.NamePos = make(map[*Name]token.Pos) + f.Consts = make(map[string]bool) // In ast1, find the import "C" line and get any extra C preamble. sawC := false @@ -191,6 +192,18 @@ func (f *File) saveExprs(x interface{}, context astContext) { } case *ast.CallExpr: f.saveCall(x, context) + case *ast.GenDecl: + if x.Tok == token.CONST { + for _, spec := range x.Specs { + vs := spec.(*ast.ValueSpec) + if vs.Type == nil { + for _, name := range spec.(*ast.ValueSpec).Names { + f.Consts[name.Name] = true + } + } + } + } + } } diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 23b60a646afc8..fdd34f560fd71 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -1232,7 +1232,8 @@ func (p *Package) isConst(f *File, x ast.Expr) bool { return x.Name == "nil" || strings.HasPrefix(x.Name, "_Ciconst_") || strings.HasPrefix(x.Name, "_Cfconst_") || - strings.HasPrefix(x.Name, "_Csconst_") + strings.HasPrefix(x.Name, "_Csconst_") || + f.Consts[x.Name] case *ast.UnaryExpr: return p.isConst(f, x.X) case *ast.BinaryExpr: diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index 3098a4a63d3dc..a317a1494d782 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -62,6 +62,7 @@ type File struct { Name map[string]*Name // map from Go name to Name NamePos map[*Name]token.Pos // map from Name to position of the first reference Edit *edit.Buffer + Consts map[string]bool // untyped constants } func (f *File) offset(p token.Pos) int { From 1f388bc80628f38b033fb229b76997d8f5660c10 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 16 Nov 2018 16:51:33 -0500 Subject: [PATCH 078/594] cmd/vet: remove pkgfact analyzer, left in by mistake Also, document process for updating vendored x/tools. Change-Id: I826744603ae0752e508a6db7334a2bf9adaf1289 Reviewed-on: https://go-review.googlesource.com/c/149963 Run-TryBot: Alan Donovan TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/vendor/README | 4 ++++ src/cmd/vet/main.go | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/vendor/README b/src/cmd/vendor/README index 740905c652fdb..7eb97a1b9b16f 100644 --- a/src/cmd/vendor/README +++ b/src/cmd/vendor/README @@ -19,3 +19,7 @@ make govendor work and will create the .cache folder in $GOROOT as a side-effect. Please make sure to delete the directory and not to include the directory in the commit by accident. + +The vendored copy of golang.org/x/tools is maintained by +running the update-xtools.sh script in this directory, +not by govendor. \ No newline at end of file diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go index 16ce61980f123..3ea781a7d4932 100644 --- a/src/cmd/vet/main.go +++ b/src/cmd/vet/main.go @@ -20,7 +20,6 @@ import ( "golang.org/x/tools/go/analysis/passes/loopclosure" "golang.org/x/tools/go/analysis/passes/lostcancel" "golang.org/x/tools/go/analysis/passes/nilfunc" - "golang.org/x/tools/go/analysis/passes/pkgfact" "golang.org/x/tools/go/analysis/passes/printf" "golang.org/x/tools/go/analysis/passes/shift" "golang.org/x/tools/go/analysis/passes/stdmethods" @@ -61,7 +60,6 @@ func main() { loopclosure.Analyzer, lostcancel.Analyzer, nilfunc.Analyzer, - pkgfact.Analyzer, printf.Analyzer, shift.Analyzer, stdmethods.Analyzer, From a889aaf8bfcf803eaed411ebae672cc6c52252bc Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 17 Nov 2018 10:00:14 +0100 Subject: [PATCH 079/594] runtime: don't use thread local storage before it is set up on iOS CL 138675 added a call to runtime.save_g which uses thread local storage to store g. On iOS however, that storage was not initialized yet. Move the call to below _cgo_init where it is set up. Change-Id: I14538d3e7d56ff35a6fa02c47bca306d24c38010 Reviewed-on: https://go-review.googlesource.com/c/150157 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/runtime/asm_arm64.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s index 28d3077b9dea0..bbeb3df0c85f5 100644 --- a/src/runtime/asm_arm64.s +++ b/src/runtime/asm_arm64.s @@ -18,7 +18,6 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0 // create istack out of the given (operating system) stack. // _cgo_init may update stackguard. MOVD $runtime·g0(SB), g - BL runtime·save_g(SB) MOVD RSP, R7 MOVD $(-64*1024)(R7), R0 MOVD R0, g_stackguard0(g) @@ -45,6 +44,7 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0 ADD $16, RSP nocgo: + BL runtime·save_g(SB) // update stackguard after _cgo_init MOVD (g_stack+stack_lo)(g), R0 ADD $const__StackGuard, R0 From 5001a38cc1a25850314a77bcde5df32371493236 Mon Sep 17 00:00:00 2001 From: sevki Date: Sat, 17 Nov 2018 21:28:08 +0000 Subject: [PATCH 080/594] crypto/hmac: rename CheckHMAC to ValidHMAC in package docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Procedure names should reflect what they do; function names should reflect what they return. Functions are used in expressions, often in things like if's, so they need to read appropriately. if CheckHMAC(a, b, key) is unhelpful because we can't deduce whether CheckHMAC returns true on error or non­-error; instead if ValidHMAC(a, b, key) makes the point clear and makes a future mistake in using the routine less likely. https://www.lysator.liu.se/c/pikestyle.html Change-Id: I7c4b1981c90c8d7475ddd8ec18dee3db2e0f42df GitHub-Last-Rev: 32199a418b5e5507259fa4b6715da8a9c185f90a GitHub-Pull-Request: golang/go#28823 Reviewed-on: https://go-review.googlesource.com/c/149857 Reviewed-by: Filippo Valsorda --- src/crypto/hmac/hmac.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypto/hmac/hmac.go b/src/crypto/hmac/hmac.go index c8c0617c47f78..801ece67ae415 100644 --- a/src/crypto/hmac/hmac.go +++ b/src/crypto/hmac/hmac.go @@ -11,8 +11,8 @@ The receiver verifies the hash by recomputing it using the same key. Receivers should be careful to use Equal to compare MACs in order to avoid timing side-channels: - // CheckMAC reports whether messageMAC is a valid HMAC tag for message. - func CheckMAC(message, messageMAC, key []byte) bool { + // ValidMAC reports whether messageMAC is a valid HMAC tag for message. + func ValidMAC(message, messageMAC, key []byte) bool { mac := hmac.New(sha256.New, key) mac.Write(message) expectedMAC := mac.Sum(nil) From 760ac1dd33f460a1e73c912913eb0c3da7afb286 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 17 Nov 2018 14:09:24 +0100 Subject: [PATCH 081/594] os: make RemoveAll("") fail silently on unix CL 146020 changed the behavior of RemoveAll("") on unix systems using the *at functions to return syscall.EINVAL instead of nil. Adjust the *at implementation to retain this behavior as is the case on the *noat systems. Additionally, also make sure RemoveAll("") on systems not using the "at functions (e.g. nacl and js/wasm) follow the same behavior (which wasn't the case previously). Fixes #28830 Change-Id: I8383c1423fefe871d18ff49134a1d23077ec6867 Reviewed-on: https://go-review.googlesource.com/c/150158 Run-TryBot: Tobias Klauser Reviewed-by: Brad Fitzpatrick Reviewed-by: roger peppe --- src/os/removeall_at.go | 8 +++++++- src/os/removeall_noat.go | 6 ++++++ src/os/removeall_test.go | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index eb220bd103f0c..5aa1b46117158 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -13,8 +13,14 @@ import ( ) func RemoveAll(path string) error { + if path == "" { + // fail silently to retain compatibility with previous behavior + // of RemoveAll. See issue 28830. + return nil + } + // Not allowed in unix - if path == "" || endsWithDot(path) { + if endsWithDot(path) { return syscall.EINVAL } diff --git a/src/os/removeall_noat.go b/src/os/removeall_noat.go index d1dd43ff6ac44..d382b42af33f9 100644 --- a/src/os/removeall_noat.go +++ b/src/os/removeall_noat.go @@ -16,6 +16,12 @@ import ( // it encounters. If the path does not exist, RemoveAll // returns nil (no error). func RemoveAll(path string) error { + if path == "" { + // fail silently to retain compatibility with previous behavior + // of RemoveAll. See issue 28830. + return nil + } + // Simple case: if Remove works, we're done. err := Remove(path) if err == nil || IsNotExist(err) { diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go index 5eec8cd154731..fd3b8d22f980d 100644 --- a/src/os/removeall_test.go +++ b/src/os/removeall_test.go @@ -21,6 +21,10 @@ func TestRemoveAll(t *testing.T) { } defer RemoveAll(tmpDir) + if err := RemoveAll(""); err != nil { + t.Errorf("RemoveAll(\"\"): %v; want nil", err) + } + file := filepath.Join(tmpDir, "file") path := filepath.Join(tmpDir, "_TestRemoveAll_") fpath := filepath.Join(path, "file") From 404ab866d1522fbe4c5596fe9889d61aec84fabe Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 16 Nov 2018 15:51:49 -0800 Subject: [PATCH 082/594] cmd/go: packages that use SWIG depend on "unsafe" Fixes #28834 Change-Id: I95d6874e62d36974415f43843881a4ae85b3c7ce Reviewed-on: https://go-review.googlesource.com/c/149964 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Emmanuel Odeke Reviewed-by: Alan Donovan Reviewed-by: Josh Bleecher Snyder --- src/cmd/go/internal/load/pkg.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 3d1b0e649d7f1..ae738c6a12e52 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -1343,6 +1343,7 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) { // SWIG adds imports of some standard packages. if p.UsesSwig() { + addImport("unsafe", true) if cfg.BuildContext.Compiler != "gccgo" { addImport("runtime/cgo", true) } From bc43889566d442b2596b1e6d8d3fce61b4aa3bec Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sun, 18 Nov 2018 08:34:38 -0800 Subject: [PATCH 083/594] cmd/compile: bulk rename This change does a bulk rename of several identifiers in the compiler. See #27167 and https://docs.google.com/document/d/19_ExiylD9MRfeAjKIfEsMU1_RGhuxB9sA0b5Zv7byVI/ for context and for discussion of these particular renames. Commands run to generate this change: gorename -from '"cmd/compile/internal/gc".OPROC' -to OGO gorename -from '"cmd/compile/internal/gc".OCOM' -to OBITNOT gorename -from '"cmd/compile/internal/gc".OMINUS' -to ONEG gorename -from '"cmd/compile/internal/gc".OIND' -to ODEREF gorename -from '"cmd/compile/internal/gc".OARRAYBYTESTR' -to OBYTES2STR gorename -from '"cmd/compile/internal/gc".OARRAYBYTESTRTMP' -to OBYTES2STRTMP gorename -from '"cmd/compile/internal/gc".OARRAYRUNESTR' -to ORUNES2STR gorename -from '"cmd/compile/internal/gc".OSTRARRAYBYTE' -to OSTR2BYTES gorename -from '"cmd/compile/internal/gc".OSTRARRAYBYTETMP' -to OSTR2BYTESTMP gorename -from '"cmd/compile/internal/gc".OSTRARRAYRUNE' -to OSTR2RUNES gorename -from '"cmd/compile/internal/gc".Etop' -to ctxStmt gorename -from '"cmd/compile/internal/gc".Erv' -to ctxExpr gorename -from '"cmd/compile/internal/gc".Ecall' -to ctxCallee gorename -from '"cmd/compile/internal/gc".Efnstruct' -to ctxMultiOK gorename -from '"cmd/compile/internal/gc".Easgn' -to ctxAssign gorename -from '"cmd/compile/internal/gc".Ecomplit' -to ctxCompLit Not altered: parameters and local variables (mostly in typecheck.go) named top, which should probably now be called ctx (and which should probably have a named type). Also not altered: Field called Top in gc.Func. gorename -from '"cmd/compile/internal/gc".Node.Isddd' -to IsDDD gorename -from '"cmd/compile/internal/gc".Node.SetIsddd' -to SetIsDDD gorename -from '"cmd/compile/internal/gc".nodeIsddd' -to nodeIsDDD gorename -from '"cmd/compile/internal/types".Field.Isddd' -to IsDDD gorename -from '"cmd/compile/internal/types".Field.SetIsddd' -to SetIsDDD gorename -from '"cmd/compile/internal/types".fieldIsddd' -to fieldIsDDD Not altered: function gc.hasddd, params and local variables called isddd Also not altered: fmt.go prints nodes using "isddd(%v)". cd cmd/compile/internal/gc; go generate I then manually found impacted comments using exact string match and fixed them up by hand. The comment changes were trivial. Passes toolstash-check. Fixes #27167. If this experiment is deemed a success, we will open a new tracking issue for renames to do at the end of the 1.13 cycles. Change-Id: I2dc541533d2ab0d06cb3d31d65df205ecfb151e8 Reviewed-on: https://go-review.googlesource.com/c/150140 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/gc/alg.go | 16 +- src/cmd/compile/internal/gc/closure.go | 18 +- src/cmd/compile/internal/gc/const.go | 16 +- src/cmd/compile/internal/gc/dcl.go | 8 +- src/cmd/compile/internal/gc/esc.go | 66 ++-- src/cmd/compile/internal/gc/fmt.go | 204 +++++------ src/cmd/compile/internal/gc/iexport.go | 18 +- src/cmd/compile/internal/gc/iimport.go | 14 +- src/cmd/compile/internal/gc/init.go | 8 +- src/cmd/compile/internal/gc/inl.go | 42 +-- src/cmd/compile/internal/gc/main.go | 8 +- src/cmd/compile/internal/gc/noder.go | 18 +- src/cmd/compile/internal/gc/op_string.go | 4 +- src/cmd/compile/internal/gc/order.go | 80 ++--- src/cmd/compile/internal/gc/range.go | 34 +- src/cmd/compile/internal/gc/reflect.go | 4 +- src/cmd/compile/internal/gc/select.go | 32 +- src/cmd/compile/internal/gc/sinit.go | 46 +-- src/cmd/compile/internal/gc/ssa.go | 56 +-- src/cmd/compile/internal/gc/subr.go | 32 +- src/cmd/compile/internal/gc/swt.go | 52 +-- src/cmd/compile/internal/gc/syntax.go | 60 ++-- src/cmd/compile/internal/gc/typecheck.go | 390 ++++++++++----------- src/cmd/compile/internal/gc/universe.go | 4 +- src/cmd/compile/internal/gc/unsafe.go | 6 +- src/cmd/compile/internal/gc/walk.go | 168 ++++----- src/cmd/compile/internal/types/identity.go | 2 +- src/cmd/compile/internal/types/type.go | 12 +- 28 files changed, 709 insertions(+), 709 deletions(-) diff --git a/src/cmd/compile/internal/gc/alg.go b/src/cmd/compile/internal/gc/alg.go index f52c15b1f5c3c..2710e04f40f25 100644 --- a/src/cmd/compile/internal/gc/alg.go +++ b/src/cmd/compile/internal/gc/alg.go @@ -217,7 +217,7 @@ func genhash(sym *types.Sym, t *types.Type) { // pure memory. hashel := hashfor(t.Elem()) - n := nod(ORANGE, nil, nod(OIND, np, nil)) + n := nod(ORANGE, nil, nod(ODEREF, np, nil)) ni := newname(lookup("i")) ni.Type = types.Types[TINT] n.List.Set1(ni) @@ -290,10 +290,10 @@ func genhash(sym *types.Sym, t *types.Type) { funcbody() fn.Func.SetDupok(true) - fn = typecheck(fn, Etop) + fn = typecheck(fn, ctxStmt) Curfn = fn - typecheckslice(fn.Nbody.Slice(), Etop) + typecheckslice(fn.Nbody.Slice(), ctxStmt) Curfn = nil if debug_dclstack != 0 { @@ -375,7 +375,7 @@ func geneq(sym *types.Sym, t *types.Type) { // pure memory. Even if we unrolled the range loop, // each iteration would be a function call, so don't bother // unrolling. - nrange := nod(ORANGE, nil, nod(OIND, np, nil)) + nrange := nod(ORANGE, nil, nod(ODEREF, np, nil)) ni := newname(lookup("i")) ni.Type = types.Types[TINT] @@ -465,10 +465,10 @@ func geneq(sym *types.Sym, t *types.Type) { funcbody() fn.Func.SetDupok(true) - fn = typecheck(fn, Etop) + fn = typecheck(fn, ctxStmt) Curfn = fn - typecheckslice(fn.Nbody.Slice(), Etop) + typecheckslice(fn.Nbody.Slice(), ctxStmt) Curfn = nil if debug_dclstack != 0 { @@ -497,8 +497,8 @@ func eqfield(p *Node, q *Node, field *types.Sym) *Node { func eqmem(p *Node, q *Node, field *types.Sym, size int64) *Node { nx := nod(OADDR, nodSym(OXDOT, p, field), nil) ny := nod(OADDR, nodSym(OXDOT, q, field), nil) - nx = typecheck(nx, Erv) - ny = typecheck(ny, Erv) + nx = typecheck(nx, ctxExpr) + ny = typecheck(ny, ctxExpr) fn, needsize := eqmemfunc(size, nx.Type.Elem()) call := nod(OCALL, fn, nil) diff --git a/src/cmd/compile/internal/gc/closure.go b/src/cmd/compile/internal/gc/closure.go index 5123df8e9d15f..07064415f499e 100644 --- a/src/cmd/compile/internal/gc/closure.go +++ b/src/cmd/compile/internal/gc/closure.go @@ -93,7 +93,7 @@ func typecheckclosure(clo *Node, top int) { xfunc.Func.Nname.Sym = closurename(Curfn) disableExport(xfunc.Func.Nname.Sym) declare(xfunc.Func.Nname, PFUNC) - xfunc = typecheck(xfunc, Etop) + xfunc = typecheck(xfunc, ctxStmt) clo.Func.Ntype = typecheck(clo.Func.Ntype, Etype) clo.Type = clo.Func.Ntype.Type @@ -108,7 +108,7 @@ func typecheckclosure(clo *Node, top int) { Curfn = xfunc olddd := decldepth decldepth = 1 - typecheckslice(xfunc.Nbody.Slice(), Etop) + typecheckslice(xfunc.Nbody.Slice(), ctxStmt) decldepth = olddd Curfn = oldfn } @@ -199,7 +199,7 @@ func capturevars(xfunc *Node) { Warnl(v.Pos, "%v capturing by %s: %v (addr=%v assign=%v width=%d)", name, how, v.Sym, outermost.Addrtaken(), outermost.Assigned(), int32(v.Type.Width)) } - outer = typecheck(outer, Erv) + outer = typecheck(outer, ctxExpr) clo.Func.Enter.Append(outer) } @@ -214,7 +214,7 @@ func transformclosure(xfunc *Node) { lineno = xfunc.Pos clo := xfunc.Func.Closure - if clo.Func.Top&Ecall != 0 { + if clo.Func.Top&ctxCallee != 0 { // If the closure is directly called, we transform it to a plain function call // with variables passed as args. This avoids allocation of a closure object. // Here we do only a part of the transformation. Walk of OCALLFUNC(OCLOSURE) @@ -305,7 +305,7 @@ func transformclosure(xfunc *Node) { } if len(body) > 0 { - typecheckslice(body, Etop) + typecheckslice(body, ctxStmt) xfunc.Func.Enter.Set(body) xfunc.Func.SetNeedctxt(true) } @@ -383,7 +383,7 @@ func walkclosure(clo *Node, init *Nodes) *Node { typ := closureType(clo) - clos := nod(OCOMPLIT, nil, nod(OIND, typenod(typ), nil)) + clos := nod(OCOMPLIT, nil, nod(ODEREF, typenod(typ), nil)) clos.Esc = clo.Esc clos.Right.SetImplicit(true) clos.List.Set(append([]*Node{nod(OCFUNC, xfunc.Func.Nname, nil)}, clo.Func.Enter.Slice()...)) @@ -467,7 +467,7 @@ func makepartialcall(fn *Node, t0 *types.Type, meth *types.Sym) *Node { call := nod(OCALL, nodSym(OXDOT, ptr, meth), nil) call.List.Set(paramNnames(tfn.Type)) - call.SetIsddd(tfn.Type.IsVariadic()) + call.SetIsDDD(tfn.Type.IsVariadic()) if t0.NumResults() != 0 { n := nod(ORETURN, nil, nil) n.List.Set1(call) @@ -478,7 +478,7 @@ func makepartialcall(fn *Node, t0 *types.Type, meth *types.Sym) *Node { xfunc.Nbody.Set(body) funcbody() - xfunc = typecheck(xfunc, Etop) + xfunc = typecheck(xfunc, ctxStmt) sym.Def = asTypesNode(xfunc) xtop = append(xtop, xfunc) Curfn = savecurfn @@ -516,7 +516,7 @@ func walkpartialcall(n *Node, init *Nodes) *Node { typ := partialCallType(n) - clos := nod(OCOMPLIT, nil, nod(OIND, typenod(typ), nil)) + clos := nod(OCOMPLIT, nil, nod(ODEREF, typenod(typ), nil)) clos.Esc = n.Esc clos.Right.SetImplicit(true) clos.List.Set2(nod(OCFUNC, n.Func.Nname, nil), n.Left) diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index a77759832a32a..9f5afadd70dfa 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -588,7 +588,7 @@ func evconst(n *Node) { // Pick off just the opcodes that can be constant evaluated. switch op := n.Op; op { - case OPLUS, OMINUS, OCOM, ONOT: + case OPLUS, ONEG, OBITNOT, ONOT: if nl.Op == OLITERAL { setconst(n, unaryOp(op, nl.Val(), n.Type)) } @@ -623,7 +623,7 @@ func evconst(n *Node) { setconst(n, convlit1(nl, n.Type, true, false).Val()) } - case OARRAYBYTESTR: + case OBYTES2STR: // string([]byte(nil)) or string([]rune(nil)) if nl.Op == OLITERAL && nl.Val().Ctype() == CTNIL { setconst(n, Val{U: ""}) @@ -873,7 +873,7 @@ func unaryOp(op Op, x Val, t *types.Type) Val { return x } - case OMINUS: + case ONEG: switch x.Ctype() { case CTINT, CTRUNE: x := x.U.(*Mpint) @@ -900,7 +900,7 @@ func unaryOp(op Op, x Val, t *types.Type) Val { return Val{U: u} } - case OCOM: + case OBITNOT: x := x.U.(*Mpint) u := new(Mpint) @@ -1024,9 +1024,9 @@ func idealkind(n *Node) Ctype { case OADD, OAND, OANDNOT, - OCOM, + OBITNOT, ODIV, - OMINUS, + ONEG, OMOD, OMUL, OSUB, @@ -1281,7 +1281,7 @@ func (n *Node) isGoConst() bool { OAND, OANDAND, OANDNOT, - OCOM, + OBITNOT, ODIV, OEQ, OGE, @@ -1289,7 +1289,7 @@ func (n *Node) isGoConst() bool { OLE, OLSH, OLT, - OMINUS, + ONEG, OMOD, OMUL, ONE, diff --git a/src/cmd/compile/internal/gc/dcl.go b/src/cmd/compile/internal/gc/dcl.go index d4d0708b1c876..9f25e5e15ba26 100644 --- a/src/cmd/compile/internal/gc/dcl.go +++ b/src/cmd/compile/internal/gc/dcl.go @@ -283,7 +283,7 @@ func oldname(s *types.Sym) *Node { c = newname(s) c.SetClass(PAUTOHEAP) c.SetIsClosureVar(true) - c.SetIsddd(n.Isddd()) + c.SetIsDDD(n.IsDDD()) c.Name.Defn = n c.SetAddable(false) @@ -455,7 +455,7 @@ func funcarg(n *Node, ctxt Class) { n.Right = newnamel(n.Pos, n.Sym) n.Right.Name.Param.Ntype = n.Left - n.Right.SetIsddd(n.Isddd()) + n.Right.SetIsDDD(n.IsDDD()) declare(n.Right, ctxt) vargen++ @@ -488,7 +488,7 @@ func funcarg2(f *types.Field, ctxt Class) { n := newnamel(f.Pos, f.Sym) f.Nname = asTypesNode(n) n.Type = f.Type - n.SetIsddd(f.Isddd()) + n.SetIsDDD(f.IsDDD()) declare(n, ctxt) } @@ -628,7 +628,7 @@ func tofunargs(l []*Node, funarg types.Funarg) *types.Type { fields := make([]*types.Field, len(l)) for i, n := range l { f := structfield(n) - f.SetIsddd(n.Isddd()) + f.SetIsDDD(n.IsDDD()) if n.Right != nil { n.Right.Type = f.Type f.Nname = asTypesNode(n.Right) diff --git a/src/cmd/compile/internal/gc/esc.go b/src/cmd/compile/internal/gc/esc.go index 2310b1e5fd2e9..c003964fa7466 100644 --- a/src/cmd/compile/internal/gc/esc.go +++ b/src/cmd/compile/internal/gc/esc.go @@ -671,7 +671,7 @@ func (e *EscState) isSliceSelfAssign(dst, src *Node) bool { // when we evaluate it for dst and for src. // dst is ONAME dereference. - if dst.Op != OIND && dst.Op != ODOTPTR || dst.Left.Op != ONAME { + if dst.Op != ODEREF && dst.Op != ODOTPTR || dst.Left.Op != ONAME { return false } // src is a slice operation. @@ -695,7 +695,7 @@ func (e *EscState) isSliceSelfAssign(dst, src *Node) bool { return false } // slice is applied to ONAME dereference. - if src.Left.Op != OIND && src.Left.Op != ODOTPTR || src.Left.Left.Op != ONAME { + if src.Left.Op != ODEREF && src.Left.Op != ODOTPTR || src.Left.Left.Op != ONAME { return false } // dst and src reference the same base ONAME. @@ -757,8 +757,8 @@ func (e *EscState) mayAffectMemory(n *Node) bool { return e.mayAffectMemory(n.Left) || e.mayAffectMemory(n.Right) // Left group. - case ODOT, ODOTPTR, OIND, OCONVNOP, OCONV, OLEN, OCAP, - ONOT, OCOM, OPLUS, OMINUS, OALIGNOF, OOFFSETOF, OSIZEOF: + case ODOT, ODOTPTR, ODEREF, OCONVNOP, OCONV, OLEN, OCAP, + ONOT, OBITNOT, OPLUS, ONEG, OALIGNOF, OOFFSETOF, OSIZEOF: return e.mayAffectMemory(n.Left) default: @@ -935,7 +935,7 @@ opSwitch: e.escassignSinkWhy(n, arg, "defer func arg") } - case OPROC: + case OGO: // go f(x) - f and x escape e.escassignSinkWhy(n, n.Left.Left, "go func") e.escassignSinkWhy(n, n.Left.Right, "go func ...") // ODDDARG for call @@ -991,7 +991,7 @@ opSwitch: e.escassignSinkWhy(n, n.Left, "panic") case OAPPEND: - if !n.Isddd() { + if !n.IsDDD() { for _, nn := range n.List.Slice()[1:] { e.escassignSinkWhy(n, nn, "appended to slice") // lose track of assign to dereference } @@ -1072,7 +1072,7 @@ opSwitch: a = nod(OADDR, a, nil) a.Pos = v.Pos e.nodeEscState(a).Loopdepth = e.loopdepth - a = typecheck(a, Erv) + a = typecheck(a, ctxExpr) } e.escassignWhyWhere(n, a, "captured by a closure", n) @@ -1083,10 +1083,10 @@ opSwitch: OMAKEMAP, OMAKESLICE, ONEW, - OARRAYRUNESTR, - OARRAYBYTESTR, - OSTRARRAYRUNE, - OSTRARRAYBYTE, + ORUNES2STR, + OBYTES2STR, + OSTR2RUNES, + OSTR2BYTES, ORUNESTR: e.track(n) @@ -1223,7 +1223,7 @@ func (e *EscState) escassign(dst, src *Node, step *EscStep) { dstwhy = "slice-element-equals" dst = &e.theSink // lose track of dereference - case OIND: + case ODEREF: dstwhy = "star-equals" dst = &e.theSink // lose track of dereference @@ -1243,7 +1243,7 @@ func (e *EscState) escassign(dst, src *Node, step *EscStep) { switch src.Op { case OADDR, // dst = &x - OIND, // dst = *x + ODEREF, // dst = *x ODOTPTR, // dst = (*x).f ONAME, ODDDARG, @@ -1255,10 +1255,10 @@ func (e *EscState) escassign(dst, src *Node, step *EscStep) { OMAKECHAN, OMAKEMAP, OMAKESLICE, - OARRAYRUNESTR, - OARRAYBYTESTR, - OSTRARRAYRUNE, - OSTRARRAYBYTE, + ORUNES2STR, + OBYTES2STR, + OSTR2RUNES, + OSTR2BYTES, OADDSTR, ONEW, OCALLPART, @@ -1293,7 +1293,7 @@ func (e *EscState) escassign(dst, src *Node, step *EscStep) { case OCONV, OCONVNOP, ODOTMETH, - // treat recv.meth as a value with recv in it, only happens in ODEFER and OPROC + // treat recv.meth as a value with recv in it, only happens in ODEFER and OGO // iface.method already leaks iface in esccall, no need to put in extra ODOTINTER edge here OSLICE, OSLICE3, @@ -1338,8 +1338,8 @@ func (e *EscState) escassign(dst, src *Node, step *EscStep) { OAND, OANDNOT, OPLUS, - OMINUS, - OCOM: + ONEG, + OBITNOT: e.escassign(dst, src.Left, e.stepAssign(step, originalDst, src, dstwhy)) e.escassign(dst, src.Right, e.stepAssign(step, originalDst, src, dstwhy)) @@ -1500,16 +1500,16 @@ func (e *EscState) escassignDereference(dst *Node, src *Node, step *EscStep) { e.escassign(dst, e.addDereference(src), step) } -// addDereference constructs a suitable OIND note applied to src. +// addDereference constructs a suitable ODEREF note applied to src. // Because this is for purposes of escape accounting, not execution, // some semantically dubious node combinations are (currently) possible. func (e *EscState) addDereference(n *Node) *Node { - ind := nod(OIND, n, nil) + ind := nod(ODEREF, n, nil) e.nodeEscState(ind).Loopdepth = e.nodeEscState(n).Loopdepth ind.Pos = n.Pos t := n.Type if t.IsPtr() || t.IsSlice() { - // This should model our own sloppy use of OIND to encode + // This should model our own sloppy use of ODEREF to encode // decreasing levels of indirection; i.e., "indirecting" a slice // yields the type of an element. t = t.Elem() @@ -1665,7 +1665,7 @@ func (e *EscState) esccall(call *Node, parent *Node) { continue } arg := args[0] - if n.Isddd() && !call.Isddd() { + if n.IsDDD() && !call.IsDDD() { // Introduce ODDDARG node to represent ... allocation. arg = nod(ODDDARG, nil, nil) arr := types.NewArray(n.Type.Elem(), int64(len(args))) @@ -1722,7 +1722,7 @@ func (e *EscState) esccall(call *Node, parent *Node) { for i, param := range fntype.Params().FieldSlice() { note := param.Note var arg *Node - if param.Isddd() && !call.Isddd() { + if param.IsDDD() && !call.IsDDD() { rest := args[i:] if len(rest) == 0 { break @@ -1754,7 +1754,7 @@ func (e *EscState) esccall(call *Node, parent *Node) { } } - if types.Haspointers(param.Type) && e.escassignfromtag(note, cE.Retval, arg, call)&EscMask == EscNone && parent.Op != ODEFER && parent.Op != OPROC { + if types.Haspointers(param.Type) && e.escassignfromtag(note, cE.Retval, arg, call)&EscMask == EscNone && parent.Op != ODEFER && parent.Op != OGO { a := arg for a.Op == OCONVNOP { a = a.Left @@ -2057,10 +2057,10 @@ func (e *EscState) escwalkBody(level Level, dst *Node, src *Node, step *EscStep, case OMAKECHAN, OMAKEMAP, OMAKESLICE, - OARRAYRUNESTR, - OARRAYBYTESTR, - OSTRARRAYRUNE, - OSTRARRAYBYTE, + ORUNES2STR, + OBYTES2STR, + OSTR2RUNES, + OSTR2BYTES, OADDSTR, OMAPLIT, ONEW, @@ -2100,7 +2100,7 @@ func (e *EscState) escwalkBody(level Level, dst *Node, src *Node, step *EscStep, e.escwalk(level.inc(), dst, src.Left, e.stepWalk(dst, src.Left, "dot of pointer", step)) case OINDEXMAP: e.escwalk(level.inc(), dst, src.Left, e.stepWalk(dst, src.Left, "map index", step)) - case OIND: + case ODEREF: e.escwalk(level.inc(), dst, src.Left, e.stepWalk(dst, src.Left, "indirection", step)) // In this case a link went directly to a call, but should really go @@ -2142,7 +2142,7 @@ func addrescapes(n *Node) { default: // Unexpected Op, probably due to a previous type error. Ignore. - case OIND, ODOTPTR: + case ODEREF, ODOTPTR: // Nothing to do. case ONAME: @@ -2347,7 +2347,7 @@ func (e *EscState) esctag(fn *Node) { f.Note = uintptrEscapesTag } - if f.Isddd() && f.Type.Elem().Etype == TUINTPTR { + if f.IsDDD() && f.Type.Elem().Etype == TUINTPTR { // final argument is ...uintptr. if Debug['m'] != 0 { Warnl(fn.Pos, "%v marking %v as escaping ...uintptr", funcSym(fn), name(f.Sym, narg)) diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go index 16b81e6a88df6..36f7545b3ca0f 100644 --- a/src/cmd/compile/internal/gc/fmt.go +++ b/src/cmd/compile/internal/gc/fmt.go @@ -159,7 +159,7 @@ var goopnames = []string{ OCASE: "case", OCLOSE: "close", OCOMPLEX: "complex", - OCOM: "^", + OBITNOT: "^", OCONTINUE: "continue", OCOPY: "copy", ODELETE: "delete", @@ -174,13 +174,13 @@ var goopnames = []string{ OGT: ">", OIF: "if", OIMAG: "imag", - OIND: "*", + ODEREF: "*", OLEN: "len", OLE: "<=", OLSH: "<<", OLT: "<", OMAKE: "make", - OMINUS: "-", + ONEG: "-", OMOD: "%", OMUL: "*", ONEW: "new", @@ -464,8 +464,8 @@ func (n *Node) jconv(s fmt.State, flag FmtFlag) { fmt.Fprintf(s, " tc(%d)", n.Typecheck()) } - if n.Isddd() { - fmt.Fprintf(s, " isddd(%v)", n.Isddd()) + if n.IsDDD() { + fmt.Fprintf(s, " isddd(%v)", n.IsDDD()) } if n.Implicit() { @@ -942,7 +942,7 @@ func (n *Node) stmtfmt(s fmt.State, mode fmtMode) { case ORETJMP: mode.Fprintf(s, "retjmp %v", n.Sym) - case OPROC: + case OGO: mode.Fprintf(s, "go %v", n.Left) case ODEFER: @@ -1064,92 +1064,92 @@ func (n *Node) stmtfmt(s fmt.State, mode fmtMode) { } var opprec = []int{ - OALIGNOF: 8, - OAPPEND: 8, - OARRAYBYTESTR: 8, - OARRAYLIT: 8, - OSLICELIT: 8, - OARRAYRUNESTR: 8, - OCALLFUNC: 8, - OCALLINTER: 8, - OCALLMETH: 8, - OCALL: 8, - OCAP: 8, - OCLOSE: 8, - OCONVIFACE: 8, - OCONVNOP: 8, - OCONV: 8, - OCOPY: 8, - ODELETE: 8, - OGETG: 8, - OLEN: 8, - OLITERAL: 8, - OMAKESLICE: 8, - OMAKE: 8, - OMAPLIT: 8, - ONAME: 8, - ONEW: 8, - ONONAME: 8, - OOFFSETOF: 8, - OPACK: 8, - OPANIC: 8, - OPAREN: 8, - OPRINTN: 8, - OPRINT: 8, - ORUNESTR: 8, - OSIZEOF: 8, - OSTRARRAYBYTE: 8, - OSTRARRAYRUNE: 8, - OSTRUCTLIT: 8, - OTARRAY: 8, - OTCHAN: 8, - OTFUNC: 8, - OTINTER: 8, - OTMAP: 8, - OTSTRUCT: 8, - OINDEXMAP: 8, - OINDEX: 8, - OSLICE: 8, - OSLICESTR: 8, - OSLICEARR: 8, - OSLICE3: 8, - OSLICE3ARR: 8, - OSLICEHEADER: 8, - ODOTINTER: 8, - ODOTMETH: 8, - ODOTPTR: 8, - ODOTTYPE2: 8, - ODOTTYPE: 8, - ODOT: 8, - OXDOT: 8, - OCALLPART: 8, - OPLUS: 7, - ONOT: 7, - OCOM: 7, - OMINUS: 7, - OADDR: 7, - OIND: 7, - ORECV: 7, - OMUL: 6, - ODIV: 6, - OMOD: 6, - OLSH: 6, - ORSH: 6, - OAND: 6, - OANDNOT: 6, - OADD: 5, - OSUB: 5, - OOR: 5, - OXOR: 5, - OEQ: 4, - OLT: 4, - OLE: 4, - OGE: 4, - OGT: 4, - ONE: 4, - OSEND: 3, - OANDAND: 2, - OOROR: 1, + OALIGNOF: 8, + OAPPEND: 8, + OBYTES2STR: 8, + OARRAYLIT: 8, + OSLICELIT: 8, + ORUNES2STR: 8, + OCALLFUNC: 8, + OCALLINTER: 8, + OCALLMETH: 8, + OCALL: 8, + OCAP: 8, + OCLOSE: 8, + OCONVIFACE: 8, + OCONVNOP: 8, + OCONV: 8, + OCOPY: 8, + ODELETE: 8, + OGETG: 8, + OLEN: 8, + OLITERAL: 8, + OMAKESLICE: 8, + OMAKE: 8, + OMAPLIT: 8, + ONAME: 8, + ONEW: 8, + ONONAME: 8, + OOFFSETOF: 8, + OPACK: 8, + OPANIC: 8, + OPAREN: 8, + OPRINTN: 8, + OPRINT: 8, + ORUNESTR: 8, + OSIZEOF: 8, + OSTR2BYTES: 8, + OSTR2RUNES: 8, + OSTRUCTLIT: 8, + OTARRAY: 8, + OTCHAN: 8, + OTFUNC: 8, + OTINTER: 8, + OTMAP: 8, + OTSTRUCT: 8, + OINDEXMAP: 8, + OINDEX: 8, + OSLICE: 8, + OSLICESTR: 8, + OSLICEARR: 8, + OSLICE3: 8, + OSLICE3ARR: 8, + OSLICEHEADER: 8, + ODOTINTER: 8, + ODOTMETH: 8, + ODOTPTR: 8, + ODOTTYPE2: 8, + ODOTTYPE: 8, + ODOT: 8, + OXDOT: 8, + OCALLPART: 8, + OPLUS: 7, + ONOT: 7, + OBITNOT: 7, + ONEG: 7, + OADDR: 7, + ODEREF: 7, + ORECV: 7, + OMUL: 6, + ODIV: 6, + OMOD: 6, + OLSH: 6, + ORSH: 6, + OAND: 6, + OANDNOT: 6, + OADD: 5, + OSUB: 5, + OOR: 5, + OXOR: 5, + OEQ: 4, + OLT: 4, + OLE: 4, + OGE: 4, + OGT: 4, + ONE: 4, + OSEND: 3, + OANDAND: 2, + OOROR: 1, // Statements handled by stmtfmt OAS: -1, @@ -1172,7 +1172,7 @@ var opprec = []int{ OGOTO: -1, OIF: -1, OLABEL: -1, - OPROC: -1, + OGO: -1, ORANGE: -1, ORETURN: -1, OSELECT: -1, @@ -1183,7 +1183,7 @@ var opprec = []int{ } func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) { - for n != nil && n.Implicit() && (n.Op == OIND || n.Op == OADDR) { + for n != nil && n.Implicit() && (n.Op == ODEREF || n.Op == OADDR) { n = n.Left } @@ -1406,10 +1406,10 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) { case OCONV, OCONVIFACE, OCONVNOP, - OARRAYBYTESTR, - OARRAYRUNESTR, - OSTRARRAYBYTE, - OSTRARRAYRUNE, + OBYTES2STR, + ORUNES2STR, + OSTR2BYTES, + OSTR2RUNES, ORUNESTR: if n.Type == nil || n.Type.Sym == nil { mode.Fprintf(s, "(%v)", n.Type) @@ -1442,7 +1442,7 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) { mode.Fprintf(s, "%#v(%v)", n.Op, n.Left) return } - if n.Isddd() { + if n.IsDDD() { mode.Fprintf(s, "%#v(%.v...)", n.Op, n.List) return } @@ -1450,7 +1450,7 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) { case OCALL, OCALLFUNC, OCALLINTER, OCALLMETH, OGETG: n.Left.exprfmt(s, nprec, mode) - if n.Isddd() { + if n.IsDDD() { mode.Fprintf(s, "(%.v...)", n.List) return } @@ -1471,7 +1471,7 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) { } mode.Fprintf(s, "make(%v)", n.Type) - case OPLUS, OMINUS, OADDR, OCOM, OIND, ONOT, ORECV: + case OPLUS, ONEG, OADDR, OBITNOT, ODEREF, ONOT, ORECV: // Unary mode.Fprintf(s, "%#v", n.Op) if n.Left != nil && n.Left.Op == n.Op { @@ -1694,7 +1694,7 @@ func fldconv(f *types.Field, flag FmtFlag, mode fmtMode, depth int, funarg types } var typ string - if f.Isddd() { + if f.IsDDD() { var et *types.Type if f.Type != nil { et = f.Type.Elem() diff --git a/src/cmd/compile/internal/gc/iexport.go b/src/cmd/compile/internal/gc/iexport.go index e77ca9a6c1794..cc43c2e2876d2 100644 --- a/src/cmd/compile/internal/gc/iexport.go +++ b/src/cmd/compile/internal/gc/iexport.go @@ -439,7 +439,7 @@ func (p *iexporter) doDecl(n *Node) { case OLITERAL: // Constant. - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) w.tag('C') w.pos(n.Pos) w.value(n.Type, n.Val()) @@ -707,7 +707,7 @@ func (w *exportWriter) signature(t *types.Type) { w.paramList(t.Params().FieldSlice()) w.paramList(t.Results().FieldSlice()) if n := t.Params().NumFields(); n > 0 { - w.bool(t.Params().Field(n - 1).Isddd()) + w.bool(t.Params().Field(n - 1).IsDDD()) } } @@ -1047,7 +1047,7 @@ func (w *exportWriter) stmt(n *Node) { // case ORETJMP: // unreachable - generated by compiler for trampolin routines - case OPROC, ODEFER: + case OGO, ODEFER: w.op(op) w.pos(n.Pos) w.expr(n.Left) @@ -1127,7 +1127,7 @@ func (w *exportWriter) expr(n *Node) { // } // from exprfmt (fmt.go) - for n.Op == OPAREN || n.Implicit() && (n.Op == OIND || n.Op == OADDR || n.Op == ODOT || n.Op == ODOTPTR) { + for n.Op == OPAREN || n.Implicit() && (n.Op == ODEREF || n.Op == OADDR || n.Op == ODOT || n.Op == ODOTPTR) { n = n.Left } @@ -1252,7 +1252,7 @@ func (w *exportWriter) expr(n *Node) { w.expr(n.Right) w.op(OEND) - case OCONV, OCONVIFACE, OCONVNOP, OARRAYBYTESTR, OARRAYRUNESTR, OSTRARRAYBYTE, OSTRARRAYRUNE, ORUNESTR: + case OCONV, OCONVIFACE, OCONVNOP, OBYTES2STR, ORUNES2STR, OSTR2BYTES, OSTR2RUNES, ORUNESTR: w.op(OCONV) w.pos(n.Pos) w.expr(n.Left) @@ -1269,8 +1269,8 @@ func (w *exportWriter) expr(n *Node) { } // only append() calls may contain '...' arguments if op == OAPPEND { - w.bool(n.Isddd()) - } else if n.Isddd() { + w.bool(n.IsDDD()) + } else if n.IsDDD() { Fatalf("exporter: unexpected '...' with %v call", op) } @@ -1279,7 +1279,7 @@ func (w *exportWriter) expr(n *Node) { w.pos(n.Pos) w.expr(n.Left) w.exprList(n.List) - w.bool(n.Isddd()) + w.bool(n.IsDDD()) case OMAKEMAP, OMAKECHAN, OMAKESLICE: w.op(op) // must keep separate from OMAKE for importer @@ -1301,7 +1301,7 @@ func (w *exportWriter) expr(n *Node) { } // unary expressions - case OPLUS, OMINUS, OADDR, OCOM, OIND, ONOT, ORECV: + case OPLUS, ONEG, OADDR, OBITNOT, ODEREF, ONOT, ORECV: w.op(op) w.pos(n.Pos) w.expr(n.Left) diff --git a/src/cmd/compile/internal/gc/iimport.go b/src/cmd/compile/internal/gc/iimport.go index c9198499dd643..ff98b79835f27 100644 --- a/src/cmd/compile/internal/gc/iimport.go +++ b/src/cmd/compile/internal/gc/iimport.go @@ -608,7 +608,7 @@ func (r *importReader) signature(recv *types.Field) *types.Type { params := r.paramList() results := r.paramList() if n := len(params); n > 0 { - params[n-1].SetIsddd(r.bool()) + params[n-1].SetIsDDD(r.bool()) } t := functypefield(recv, params, results) t.SetPkg(r.currPkg) @@ -820,7 +820,7 @@ func (r *importReader) node() *Node { if !r.bool() /* !implicit, i.e. '&' operator */ { if n.Op == OCOMPLIT { // Special case for &T{...}: turn into (*T){...}. - n.Right = nodl(pos, OIND, n.Right, nil) + n.Right = nodl(pos, ODEREF, n.Right, nil) n.Right.SetImplicit(true) } else { n = nodl(pos, OADDR, n, nil) @@ -887,7 +887,7 @@ func (r *importReader) node() *Node { n.SetSliceBounds(low, high, max) return n - // case OCONV, OCONVIFACE, OCONVNOP, OARRAYBYTESTR, OARRAYRUNESTR, OSTRARRAYBYTE, OSTRARRAYRUNE, ORUNESTR: + // case OCONV, OCONVIFACE, OCONVNOP, OBYTES2STR, ORUNES2STR, OSTR2BYTES, OSTR2RUNES, ORUNESTR: // unreachable - mapped to OCONV case below by exporter case OCONV: @@ -899,7 +899,7 @@ func (r *importReader) node() *Node { n := npos(r.pos(), builtinCall(op)) n.List.Set(r.exprList()) if op == OAPPEND { - n.SetIsddd(r.bool()) + n.SetIsDDD(r.bool()) } return n @@ -909,7 +909,7 @@ func (r *importReader) node() *Node { case OCALL: n := nodl(r.pos(), OCALL, r.expr(), nil) n.List.Set(r.exprList()) - n.SetIsddd(r.bool()) + n.SetIsDDD(r.bool()) return n case OMAKEMAP, OMAKECHAN, OMAKESLICE: @@ -919,7 +919,7 @@ func (r *importReader) node() *Node { return n // unary expressions - case OPLUS, OMINUS, OADDR, OCOM, OIND, ONOT, ORECV: + case OPLUS, ONEG, OADDR, OBITNOT, ODEREF, ONOT, ORECV: return nodl(r.pos(), op, r.expr(), nil) // binary expressions @@ -982,7 +982,7 @@ func (r *importReader) node() *Node { // case ORETJMP: // unreachable - generated by compiler for trampolin routines (not exported) - case OPROC, ODEFER: + case OGO, ODEFER: return nodl(r.pos(), op, r.expr(), nil) case OIF: diff --git a/src/cmd/compile/internal/gc/init.go b/src/cmd/compile/internal/gc/init.go index bb2bc4b844e65..ae8748807547f 100644 --- a/src/cmd/compile/internal/gc/init.go +++ b/src/cmd/compile/internal/gc/init.go @@ -166,7 +166,7 @@ func fninit(n []*Node) { rhs := asNode(s.Def) rhs.checkInitFuncSignature() as := nod(OAS, lhs, rhs) - as = typecheck(as, Etop) + as = typecheck(as, ctxStmt) genAsStatic(as) } @@ -187,7 +187,7 @@ func fninit(n []*Node) { loop.Nbody.Set1(body) loop.Ninit.Set1(zero) - loop = typecheck(loop, Etop) + loop = typecheck(loop, ctxStmt) r = append(r, loop) } @@ -206,8 +206,8 @@ func fninit(n []*Node) { funcbody() Curfn = fn - fn = typecheck(fn, Etop) - typecheckslice(r, Etop) + fn = typecheck(fn, ctxStmt) + typecheckslice(r, ctxStmt) Curfn = nil funccompile(fn) } diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index b26758a77ead8..3f649be7cb0b2 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -90,7 +90,7 @@ func typecheckinl(fn *Node) { savefn := Curfn Curfn = fn - typecheckslice(fn.Func.Inl.Body, Etop) + typecheckslice(fn.Func.Inl.Body, ctxStmt) Curfn = savefn // During typechecking, declarations are added to @@ -377,7 +377,7 @@ func (v *hairyVisitor) visit(n *Node) bool { OFORUNTIL, OSELECT, OTYPESW, - OPROC, + OGO, ODEFER, ODCLTYPE, // can't print yet OBREAK, @@ -552,7 +552,7 @@ func inlnode(n *Node, maxCost int32) *Node { switch n.Op { // inhibit inlining of their argument - case ODEFER, OPROC: + case ODEFER, OGO: switch n.Left.Op { case OCALLFUNC, OCALLMETH: n.Left.SetNoInline(true) @@ -620,7 +620,7 @@ func inlnode(n *Node, maxCost int32) *Node { n.Rlist.Set(inlconv2list(n.Rlist.First())) n.Op = OAS2 n.SetTypecheck(0) - n = typecheck(n, Etop) + n = typecheck(n, ctxStmt) } else { s := n.Rlist.Slice() for i1, n1 := range s { @@ -815,7 +815,7 @@ func tinlvar(t *types.Field, inlvars map[*Node]*Node) *Node { return inlvar } - return typecheck(nblank, Erv|Easgn) + return typecheck(nblank, ctxExpr|ctxAssign) } var inlgen int @@ -897,21 +897,21 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { } if v.Name.Byval() { - iv := typecheck(inlvar(v), Erv) + iv := typecheck(inlvar(v), ctxExpr) ninit.Append(nod(ODCL, iv, nil)) - ninit.Append(typecheck(nod(OAS, iv, o), Etop)) + ninit.Append(typecheck(nod(OAS, iv, o), ctxStmt)) inlvars[v] = iv } else { addr := newname(lookup("&" + v.Sym.Name)) addr.Type = types.NewPtr(v.Type) - ia := typecheck(inlvar(addr), Erv) + ia := typecheck(inlvar(addr), ctxExpr) ninit.Append(nod(ODCL, ia, nil)) - ninit.Append(typecheck(nod(OAS, ia, nod(OADDR, o, nil)), Etop)) + ninit.Append(typecheck(nod(OAS, ia, nod(OADDR, o, nil)), ctxStmt)) inlvars[addr] = ia // When capturing by reference, all occurrence of the captured var // must be substituted with dereference of the temporary address - inlvars[v] = typecheck(nod(OIND, ia, nil), Erv) + inlvars[v] = typecheck(nod(ODEREF, ia, nil), ctxExpr) } } } @@ -927,7 +927,7 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { if ln.isParamStackCopy() { // ignore the on-stack copy of a parameter that moved to the heap continue } - inlvars[ln] = typecheck(inlvar(ln), Erv) + inlvars[ln] = typecheck(inlvar(ln), ctxExpr) if ln.Class() == PPARAM || ln.Name.Param.Stackcopy != nil && ln.Name.Param.Stackcopy.Class() == PPARAM { ninit.Append(nod(ODCL, inlvars[ln], nil)) } @@ -950,7 +950,7 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { mpos := t.Pos if n := asNode(t.Nname); n != nil && !n.isBlank() { m = inlvar(n) - m = typecheck(m, Erv) + m = typecheck(m, ctxExpr) inlvars[n] = m } else { // anonymous return values, synthesize names for use in assignment that replaces return @@ -990,7 +990,7 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { Fatalf("method call without receiver: %+v", n) } ras := nod(OAS, tinlvar(rcv, inlvars), n.Left.Left) - ras = typecheck(ras, Etop) + ras = typecheck(ras, ctxStmt) ninit.Append(ras) } else { // For T.M(...), add the receiver parameter to @@ -1007,7 +1007,7 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { // For ordinary parameters or variadic parameters in // dotted calls, just add the variable to the // assignment list, and we're done. - if !param.Isddd() || n.Isddd() { + if !param.IsDDD() || n.IsDDD() { as.List.Append(tinlvar(param, inlvars)) continue } @@ -1037,19 +1037,19 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { } if as.Rlist.Len() != 0 { - as = typecheck(as, Etop) + as = typecheck(as, ctxStmt) ninit.Append(as) } if vas != nil { - vas = typecheck(vas, Etop) + vas = typecheck(vas, ctxStmt) ninit.Append(vas) } // Zero the return parameters. for _, n := range retvars { ras := nod(OAS, n, nil) - ras = typecheck(ras, Etop) + ras = typecheck(ras, ctxStmt) ninit.Append(ras) } @@ -1083,7 +1083,7 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { lab := nodSym(OLABEL, nil, retlabel) body = append(body, lab) - typecheckslice(body, Etop) + typecheckslice(body, ctxStmt) if genDwarfInline > 0 { for _, v := range inlfvars { @@ -1239,12 +1239,12 @@ func (subst *inlsubst) node(n *Node) *Node { as.List.Append(n) } as.Rlist.Set(subst.list(n.List)) - as = typecheck(as, Etop) + as = typecheck(as, ctxStmt) m.Ninit.Append(as) } - typecheckslice(m.Ninit.Slice(), Etop) - m = typecheck(m, Etop) + typecheckslice(m.Ninit.Slice(), ctxStmt) + m = typecheck(m, ctxStmt) // dump("Return after substitution", m); return m diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 7e9dd4d5cd344..b843ebf437047 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -509,7 +509,7 @@ func Main(archInit func(*Arch)) { for i := 0; i < len(xtop); i++ { n := xtop[i] if op := n.Op; op != ODCL && op != OAS && op != OAS2 && (op != ODCLTYPE || !n.Left.Name.Param.Alias) { - xtop[i] = typecheck(n, Etop) + xtop[i] = typecheck(n, ctxStmt) } } @@ -521,7 +521,7 @@ func Main(archInit func(*Arch)) { for i := 0; i < len(xtop); i++ { n := xtop[i] if op := n.Op; op == ODCL || op == OAS || op == OAS2 || op == ODCLTYPE && n.Left.Name.Param.Alias { - xtop[i] = typecheck(n, Etop) + xtop[i] = typecheck(n, ctxStmt) } } resumecheckwidth() @@ -536,7 +536,7 @@ func Main(archInit func(*Arch)) { Curfn = n decldepth = 1 saveerrors() - typecheckslice(Curfn.Nbody.Slice(), Etop) + typecheckslice(Curfn.Nbody.Slice(), ctxStmt) checkreturn(Curfn) if nerrors != 0 { Curfn.Nbody.Set(nil) // type errors; do not compile @@ -693,7 +693,7 @@ func Main(archInit func(*Arch)) { timings.Start("be", "externaldcls") for i, n := range externdcl { if n.Op == ONAME { - externdcl[i] = typecheck(externdcl[i], Erv) + externdcl[i] = typecheck(externdcl[i], ctxExpr) } } // Check the map keys again, since we typechecked the external diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go index a2ed103c80c7a..b9849e7a8491b 100644 --- a/src/cmd/compile/internal/gc/noder.go +++ b/src/cmd/compile/internal/gc/noder.go @@ -542,9 +542,9 @@ func (p *noder) param(param *syntax.Field, dddOk, final bool) *Node { typ.Op = OTARRAY typ.Right = typ.Left typ.Left = nil - n.SetIsddd(true) + n.SetIsDDD(true) if n.Left != nil { - n.Left.SetIsddd(true) + n.Left.SetIsDDD(true) } } @@ -632,7 +632,7 @@ func (p *noder) expr(expr syntax.Expr) *Node { x = unparen(x) // TODO(mdempsky): Needed? if x.Op == OCOMPLIT { // Special case for &T{...}: turn into (*T){...}. - x.Right = p.nod(expr, OIND, x.Right, nil) + x.Right = p.nod(expr, ODEREF, x.Right, nil) x.Right.SetImplicit(true) return x } @@ -643,7 +643,7 @@ func (p *noder) expr(expr syntax.Expr) *Node { case *syntax.CallExpr: n := p.nod(expr, OCALL, p.expr(expr.Fun), nil) n.List.Set(p.exprs(expr.ArgList)) - n.SetIsddd(expr.HasDots) + n.SetIsDDD(expr.HasDots) return n case *syntax.ArrayType: @@ -870,7 +870,7 @@ func (p *noder) embedded(typ syntax.Expr) *Node { n.SetEmbedded(true) if isStar { - n.Left = p.nod(op, OIND, n.Left, nil) + n.Left = p.nod(op, ODEREF, n.Left, nil) } return n } @@ -969,7 +969,7 @@ func (p *noder) stmtFall(stmt syntax.Stmt, fallOK bool) *Node { case syntax.Defer: op = ODEFER case syntax.Go: - op = OPROC + op = OGO default: panic("unhandled CallStmt") } @@ -1245,13 +1245,13 @@ func (p *noder) labeledStmt(label *syntax.LabeledStmt, fallOK bool) *Node { var unOps = [...]Op{ syntax.Recv: ORECV, - syntax.Mul: OIND, + syntax.Mul: ODEREF, syntax.And: OADDR, syntax.Not: ONOT, - syntax.Xor: OCOM, + syntax.Xor: OBITNOT, syntax.Add: OPLUS, - syntax.Sub: OMINUS, + syntax.Sub: ONEG, } func (p *noder) unOp(op syntax.Operator) Op { diff --git a/src/cmd/compile/internal/gc/op_string.go b/src/cmd/compile/internal/gc/op_string.go index 34c3249d90382..fe80e39064d78 100644 --- a/src/cmd/compile/internal/gc/op_string.go +++ b/src/cmd/compile/internal/gc/op_string.go @@ -4,9 +4,9 @@ package gc import "strconv" -const _Op_name = "XXXNAMENONAMETYPEPACKLITERALADDSUBORXORADDSTRADDRANDANDAPPENDARRAYBYTESTRARRAYBYTESTRTMPARRAYRUNESTRSTRARRAYBYTESTRARRAYBYTETMPSTRARRAYRUNEASAS2AS2FUNCAS2RECVAS2MAPRAS2DOTTYPEASOPCALLCALLFUNCCALLMETHCALLINTERCALLPARTCAPCLOSECLOSURECOMPLITMAPLITSTRUCTLITARRAYLITSLICELITPTRLITCONVCONVIFACECONVNOPCOPYDCLDCLFUNCDCLFIELDDCLCONSTDCLTYPEDELETEDOTDOTPTRDOTMETHDOTINTERXDOTDOTTYPEDOTTYPE2EQNELTLEGEGTINDINDEXINDEXMAPKEYSTRUCTKEYLENMAKEMAKECHANMAKEMAPMAKESLICEMULDIVMODLSHRSHANDANDNOTNEWNOTCOMPLUSMINUSORORPANICPRINTPRINTNPARENSENDSLICESLICEARRSLICESTRSLICE3SLICE3ARRSLICEHEADERRECOVERRECVRUNESTRSELRECVSELRECV2IOTAREALIMAGCOMPLEXALIGNOFOFFSETOFSIZEOFBLOCKBREAKCASEXCASECONTINUEDEFEREMPTYFALLFORFORUNTILGOTOIFLABELPROCRANGERETURNSELECTSWITCHTYPESWTCHANTMAPTSTRUCTTINTERTFUNCTARRAYDDDDDDARGINLCALLEFACEITABIDATASPTRCLOSUREVARCFUNCCHECKNILVARDEFVARKILLVARLIVEINDREGSPRETJMPGETGEND" +const _Op_name = "XXXNAMENONAMETYPEPACKLITERALADDSUBORXORADDSTRADDRANDANDAPPENDBYTES2STRBYTES2STRTMPRUNES2STRSTR2BYTESSTR2BYTESTMPSTR2RUNESASAS2AS2FUNCAS2RECVAS2MAPRAS2DOTTYPEASOPCALLCALLFUNCCALLMETHCALLINTERCALLPARTCAPCLOSECLOSURECOMPLITMAPLITSTRUCTLITARRAYLITSLICELITPTRLITCONVCONVIFACECONVNOPCOPYDCLDCLFUNCDCLFIELDDCLCONSTDCLTYPEDELETEDOTDOTPTRDOTMETHDOTINTERXDOTDOTTYPEDOTTYPE2EQNELTLEGEGTDEREFINDEXINDEXMAPKEYSTRUCTKEYLENMAKEMAKECHANMAKEMAPMAKESLICEMULDIVMODLSHRSHANDANDNOTNEWNOTBITNOTPLUSNEGORORPANICPRINTPRINTNPARENSENDSLICESLICEARRSLICESTRSLICE3SLICE3ARRSLICEHEADERRECOVERRECVRUNESTRSELRECVSELRECV2IOTAREALIMAGCOMPLEXALIGNOFOFFSETOFSIZEOFBLOCKBREAKCASEXCASECONTINUEDEFEREMPTYFALLFORFORUNTILGOTOIFLABELGORANGERETURNSELECTSWITCHTYPESWTCHANTMAPTSTRUCTTINTERTFUNCTARRAYDDDDDDARGINLCALLEFACEITABIDATASPTRCLOSUREVARCFUNCCHECKNILVARDEFVARKILLVARLIVEINDREGSPRETJMPGETGEND" -var _Op_index = [...]uint16{0, 3, 7, 13, 17, 21, 28, 31, 34, 36, 39, 45, 49, 55, 61, 73, 88, 100, 112, 127, 139, 141, 144, 151, 158, 165, 175, 179, 183, 191, 199, 208, 216, 219, 224, 231, 238, 244, 253, 261, 269, 275, 279, 288, 295, 299, 302, 309, 317, 325, 332, 338, 341, 347, 354, 362, 366, 373, 381, 383, 385, 387, 389, 391, 393, 396, 401, 409, 412, 421, 424, 428, 436, 443, 452, 455, 458, 461, 464, 467, 470, 476, 479, 482, 485, 489, 494, 498, 503, 508, 514, 519, 523, 528, 536, 544, 550, 559, 570, 577, 581, 588, 595, 603, 607, 611, 615, 622, 629, 637, 643, 648, 653, 657, 662, 670, 675, 680, 684, 687, 695, 699, 701, 706, 710, 715, 721, 727, 733, 739, 744, 748, 755, 761, 766, 772, 775, 781, 788, 793, 797, 802, 806, 816, 821, 829, 835, 842, 849, 857, 863, 867, 870} +var _Op_index = [...]uint16{0, 3, 7, 13, 17, 21, 28, 31, 34, 36, 39, 45, 49, 55, 61, 70, 82, 91, 100, 112, 121, 123, 126, 133, 140, 147, 157, 161, 165, 173, 181, 190, 198, 201, 206, 213, 220, 226, 235, 243, 251, 257, 261, 270, 277, 281, 284, 291, 299, 307, 314, 320, 323, 329, 336, 344, 348, 355, 363, 365, 367, 369, 371, 373, 375, 380, 385, 393, 396, 405, 408, 412, 420, 427, 436, 439, 442, 445, 448, 451, 454, 460, 463, 466, 472, 476, 479, 483, 488, 493, 499, 504, 508, 513, 521, 529, 535, 544, 555, 562, 566, 573, 580, 588, 592, 596, 600, 607, 614, 622, 628, 633, 638, 642, 647, 655, 660, 665, 669, 672, 680, 684, 686, 691, 693, 698, 704, 710, 716, 722, 727, 731, 738, 744, 749, 755, 758, 764, 771, 776, 780, 785, 789, 799, 804, 812, 818, 825, 832, 840, 846, 850, 853} func (i Op) String() string { if i >= Op(len(_Op_index)-1) { diff --git a/src/cmd/compile/internal/gc/order.go b/src/cmd/compile/internal/gc/order.go index da2b3343a131f..2eec537e4e6cb 100644 --- a/src/cmd/compile/internal/gc/order.go +++ b/src/cmd/compile/internal/gc/order.go @@ -81,7 +81,7 @@ func (o *Order) newTemp(t *types.Type, clear bool) *Node { } if clear { a := nod(OAS, v, nil) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) o.out = append(o.out, a) } @@ -104,7 +104,7 @@ func (o *Order) newTemp(t *types.Type, clear bool) *Node { func (o *Order) copyExpr(n *Node, t *types.Type, clear bool) *Node { v := o.newTemp(t, clear) a := nod(OAS, v, n) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) o.out = append(o.out, a) return v } @@ -128,7 +128,7 @@ func (o *Order) cheapExpr(n *Node) *Node { } a := n.sepcopy() a.Left = l - return typecheck(a, Erv) + return typecheck(a, ctxExpr) } return o.copyExpr(n, n.Type, false) @@ -153,16 +153,16 @@ func (o *Order) safeExpr(n *Node) *Node { } a := n.sepcopy() a.Left = l - return typecheck(a, Erv) + return typecheck(a, ctxExpr) - case ODOTPTR, OIND: + case ODOTPTR, ODEREF: l := o.cheapExpr(n.Left) if l == n.Left { return n } a := n.sepcopy() a.Left = l - return typecheck(a, Erv) + return typecheck(a, ctxExpr) case OINDEX, OINDEXMAP: var l *Node @@ -178,7 +178,7 @@ func (o *Order) safeExpr(n *Node) *Node { a := n.sepcopy() a.Left = l a.Right = r - return typecheck(a, Erv) + return typecheck(a, ctxExpr) default: Fatalf("ordersafeexpr %v", n.Op) @@ -213,7 +213,7 @@ func (o *Order) addrTemp(n *Node) *Node { if out != nil { Fatalf("staticassign of const generated code: %+v", n) } - vstat = typecheck(vstat, Erv) + vstat = typecheck(vstat, ctxExpr) return vstat } if isaddrokay(n) { @@ -233,7 +233,7 @@ func (o *Order) mapKeyTemp(t *types.Type, n *Node) *Node { return n } -// mapKeyReplaceStrConv replaces OARRAYBYTESTR by OARRAYBYTESTRTMP +// mapKeyReplaceStrConv replaces OBYTES2STR by OBYTES2STRTMP // in n to avoid string allocations for keys in map lookups. // Returns a bool that signals if a modification was made. // @@ -250,8 +250,8 @@ func (o *Order) mapKeyTemp(t *types.Type, n *Node) *Node { func mapKeyReplaceStrConv(n *Node) bool { var replaced bool switch n.Op { - case OARRAYBYTESTR: - n.Op = OARRAYBYTESTRTMP + case OBYTES2STR: + n.Op = OBYTES2STRTMP replaced = true case OSTRUCTLIT: for _, elem := range n.List.Slice() { @@ -300,11 +300,11 @@ func (o *Order) cleanTempNoPop(mark ordermarker) []*Node { n.Name.SetKeepalive(false) n.SetAddrtaken(true) // ensure SSA keeps the n variable live := nod(OVARLIVE, n, nil) - live = typecheck(live, Etop) + live = typecheck(live, ctxStmt) out = append(out, live) } kill := nod(OVARKILL, n, nil) - kill = typecheck(kill, Etop) + kill = typecheck(kill, ctxStmt) out = append(out, kill) } return out @@ -418,7 +418,7 @@ func (o *Order) copyRet(n *Node) []*Node { as := nod(OAS2, nil, nil) as.List.Set(l1) as.Rlist.Set1(n) - as = typecheck(as, Etop) + as = typecheck(as, ctxStmt) o.stmt(as) return l2 @@ -463,7 +463,7 @@ func (o *Order) call(n *Node) { for i, t := range n.Left.Type.Params().FieldSlice() { // Check for "unsafe-uintptr" tag provided by escape analysis. - if t.Isddd() && !n.Isddd() { + if t.IsDDD() && !n.IsDDD() { if t.Note == uintptrEscapesTag { for ; i < n.List.Len(); i++ { keepAlive(i) @@ -528,7 +528,7 @@ func (o *Order) mapAssign(n *Node) { t := o.newTemp(m.Type, false) n.List.SetIndex(i, t) a := nod(OAS, m, t) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) post = append(post, a) } } @@ -602,7 +602,7 @@ func (o *Order) stmt(n *Node) { } l = o.copyExpr(l, n.Left.Type, false) n.Right = nod(n.SubOp(), l, n.Right) - n.Right = typecheck(n.Right, Erv) + n.Right = typecheck(n.Right, ctxExpr) n.Right = o.expr(n.Right, nil) n.Op = OAS @@ -657,10 +657,10 @@ func (o *Order) stmt(n *Node) { tmp2 := o.newTemp(types.Types[TBOOL], false) o.out = append(o.out, n) r := nod(OAS, n.List.First(), tmp1) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) o.mapAssign(r) r = okas(n.List.Second(), tmp2) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) o.mapAssign(r) n.List.Set2(tmp1, tmp2) o.cleanTemp(t) @@ -689,7 +689,7 @@ func (o *Order) stmt(n *Node) { o.cleanTemp(t) // Special: order arguments to inner call but not call itself. - case ODEFER, OPROC: + case ODEFER, OGO: t := o.markTemp() o.call(n.Left) o.out = append(o.out, n) @@ -751,8 +751,8 @@ func (o *Order) stmt(n *Node) { // Mark []byte(str) range expression to reuse string backing storage. // It is safe because the storage cannot be mutated. - if n.Right.Op == OSTRARRAYBYTE { - n.Right.Op = OSTRARRAYBYTETMP + if n.Right.Op == OSTR2BYTES { + n.Right.Op = OSTR2BYTESTMP } t := o.markTemp() @@ -779,7 +779,7 @@ func (o *Order) stmt(n *Node) { if r.Type.IsString() && r.Type != types.Types[TSTRING] { r = nod(OCONV, r, nil) r.Type = types.Types[TSTRING] - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) } n.Right = o.copyExpr(r, r.Type, false) @@ -897,13 +897,13 @@ func (o *Order) stmt(n *Node) { if r.Colas() { tmp2 := nod(ODCL, tmp1, nil) - tmp2 = typecheck(tmp2, Etop) + tmp2 = typecheck(tmp2, ctxStmt) n2.Ninit.Append(tmp2) } r.Left = o.newTemp(r.Right.Left.Type.Elem(), types.Haspointers(r.Right.Left.Type.Elem())) tmp2 := nod(OAS, tmp1, r.Left) - tmp2 = typecheck(tmp2, Etop) + tmp2 = typecheck(tmp2, ctxStmt) n2.Ninit.Append(tmp2) } @@ -914,13 +914,13 @@ func (o *Order) stmt(n *Node) { tmp1 := r.List.First() if r.Colas() { tmp2 := nod(ODCL, tmp1, nil) - tmp2 = typecheck(tmp2, Etop) + tmp2 = typecheck(tmp2, ctxStmt) n2.Ninit.Append(tmp2) } r.List.Set1(o.newTemp(types.Types[TBOOL], false)) tmp2 := okas(tmp1, r.List.First()) - tmp2 = typecheck(tmp2, Etop) + tmp2 = typecheck(tmp2, ctxStmt) n2.Ninit.Append(tmp2) } orderBlock(&n2.Ninit, o.free) @@ -1064,14 +1064,14 @@ func (o *Order) expr(n, lhs *Node) *Node { haslit := false for _, n1 := range n.List.Slice() { - hasbyte = hasbyte || n1.Op == OARRAYBYTESTR + hasbyte = hasbyte || n1.Op == OBYTES2STR haslit = haslit || n1.Op == OLITERAL && len(n1.Val().U.(string)) != 0 } if haslit && hasbyte { for _, n2 := range n.List.Slice() { - if n2.Op == OARRAYBYTESTR { - n2.Op = OARRAYBYTESTRTMP + if n2.Op == OBYTES2STR { + n2.Op = OBYTES2STRTMP } } } @@ -1153,9 +1153,9 @@ func (o *Order) expr(n, lhs *Node) *Node { ONEW, OREAL, ORECOVER, - OSTRARRAYBYTE, - OSTRARRAYBYTETMP, - OSTRARRAYRUNE: + OSTR2BYTES, + OSTR2BYTESTMP, + OSTR2RUNES: if isRuneCount(n) { // len([]rune(s)) is rewritten to runtime.countrunes(s) later. @@ -1248,11 +1248,11 @@ func (o *Order) expr(n, lhs *Node) *Node { // Mark string(byteSlice) arguments to reuse byteSlice backing // buffer during conversion. String comparison does not // memorize the strings for later use, so it is safe. - if n.Left.Op == OARRAYBYTESTR { - n.Left.Op = OARRAYBYTESTRTMP + if n.Left.Op == OBYTES2STR { + n.Left.Op = OBYTES2STRTMP } - if n.Right.Op == OARRAYBYTESTR { - n.Right.Op = OARRAYBYTESTRTMP + if n.Right.Op == OBYTES2STR { + n.Right.Op = OBYTES2STRTMP } case t.IsStruct() || t.IsArray(): @@ -1301,7 +1301,7 @@ func (o *Order) as2(n *Node) { as := nod(OAS2, nil, nil) as.List.Set(left) as.Rlist.Set(tmplist) - as = typecheck(as, Etop) + as = typecheck(as, ctxStmt) o.stmt(as) } @@ -1322,13 +1322,13 @@ func (o *Order) okAs2(n *Node) { if tmp1 != nil { r := nod(OAS, n.List.First(), tmp1) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) o.mapAssign(r) n.List.SetFirst(tmp1) } if tmp2 != nil { r := okas(n.List.Second(), tmp2) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) o.mapAssign(r) n.List.SetSecond(tmp2) } diff --git a/src/cmd/compile/internal/gc/range.go b/src/cmd/compile/internal/gc/range.go index ac03cc5ea7dac..bf30d9388ec55 100644 --- a/src/cmd/compile/internal/gc/range.go +++ b/src/cmd/compile/internal/gc/range.go @@ -28,17 +28,17 @@ func typecheckrange(n *Node) { ls := n.List.Slice() for i1, n1 := range ls { if n1.Typecheck() == 0 { - ls[i1] = typecheck(ls[i1], Erv|Easgn) + ls[i1] = typecheck(ls[i1], ctxExpr|ctxAssign) } } decldepth++ - typecheckslice(n.Nbody.Slice(), Etop) + typecheckslice(n.Nbody.Slice(), ctxStmt) decldepth-- } func typecheckrangeExpr(n *Node) { - n.Right = typecheck(n.Right, Erv) + n.Right = typecheck(n.Right, ctxExpr) t := n.Right.Type if t == nil { @@ -48,7 +48,7 @@ func typecheckrangeExpr(n *Node) { ls := n.List.Slice() for i1, n1 := range ls { if n1.Name == nil || n1.Name.Defn != n { - ls[i1] = typecheck(ls[i1], Erv|Easgn) + ls[i1] = typecheck(ls[i1], ctxExpr|ctxAssign) } } @@ -278,7 +278,7 @@ func walkrange(n *Node) *Node { // of the form "v1, a[v1] := range". a := nod(OAS2, nil, nil) a.List.Set2(v1, v2) - a.Rlist.Set2(hv1, nod(OIND, hp, nil)) + a.Rlist.Set2(hv1, nod(ODEREF, hp, nil)) body = append(body, a) // Advance pointer as part of the late increment. @@ -287,7 +287,7 @@ func walkrange(n *Node) *Node { // advancing the pointer is safe and won't go past the // end of the allocation. a = nod(OAS, hp, addptr(hp, t.Elem().Width)) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) n.List.Set1(a) case TMAP: @@ -312,14 +312,14 @@ func walkrange(n *Node) *Node { n.Right = mkcall1(fn, nil, nil, nod(OADDR, hit, nil)) key := nodSym(ODOT, hit, keysym) - key = nod(OIND, key, nil) + key = nod(ODEREF, key, nil) if v1 == nil { body = nil } else if v2 == nil { body = []*Node{nod(OAS, v1, key)} } else { val := nodSym(ODOT, hit, valsym) - val = nod(OIND, val, nil) + val = nod(ODEREF, val, nil) a := nod(OAS2, nil, nil) a.List.Set2(v1, v2) a.Rlist.Set2(key, val) @@ -427,21 +427,21 @@ func walkrange(n *Node) *Node { } n.Op = translatedLoopOp - typecheckslice(init, Etop) + typecheckslice(init, ctxStmt) if ifGuard != nil { ifGuard.Ninit.Append(init...) - ifGuard = typecheck(ifGuard, Etop) + ifGuard = typecheck(ifGuard, ctxStmt) } else { n.Ninit.Append(init...) } - typecheckslice(n.Left.Ninit.Slice(), Etop) + typecheckslice(n.Left.Ninit.Slice(), ctxStmt) - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) - n.Right = typecheck(n.Right, Etop) - typecheckslice(body, Etop) + n.Right = typecheck(n.Right, ctxStmt) + typecheckslice(body, ctxStmt) n.Nbody.Prepend(body...) if ifGuard != nil { @@ -512,7 +512,7 @@ func mapClear(m *Node) *Node { fn = substArgTypes(fn, t.Key(), t.Elem()) n := mkcall1(fn, nil, nil, typename(t), m) - n = typecheck(n, Etop) + n = typecheck(n, ctxStmt) n = walkstmt(n) return n @@ -601,9 +601,9 @@ func arrayClear(n, v1, v2, a *Node) bool { n.Nbody.Append(v1) - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) - typecheckslice(n.Nbody.Slice(), Etop) + typecheckslice(n.Nbody.Slice(), ctxStmt) n = walkstmt(n) return true } diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 130c83036c970..8310b8d2fc8c7 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -333,7 +333,7 @@ func methodfunc(f *types.Type, receiver *types.Type) *types.Type { for _, t := range f.Params().Fields().Slice() { d := anonfield(t.Type) - d.SetIsddd(t.Isddd()) + d.SetIsDDD(t.IsDDD()) in = append(in, d) } @@ -1180,7 +1180,7 @@ func dtypesym(t *types.Type) *obj.LSym { } isddd := false for _, t1 := range t.Params().Fields().Slice() { - isddd = t1.Isddd() + isddd = t1.IsDDD() dtypesym(t1.Type) } for _, t1 := range t.Results().Fields().Slice() { diff --git a/src/cmd/compile/internal/gc/select.go b/src/cmd/compile/internal/gc/select.go index c7f39088880f9..a09d779af6782 100644 --- a/src/cmd/compile/internal/gc/select.go +++ b/src/cmd/compile/internal/gc/select.go @@ -10,7 +10,7 @@ import "cmd/compile/internal/types" func typecheckselect(sel *Node) { var def *Node lno := setlineno(sel) - typecheckslice(sel.Ninit.Slice(), Etop) + typecheckslice(sel.Ninit.Slice(), ctxStmt) for _, ncase := range sel.List.Slice() { if ncase.Op != OXCASE { setlineno(ncase) @@ -27,7 +27,7 @@ func typecheckselect(sel *Node) { } else if ncase.List.Len() > 1 { yyerrorl(ncase.Pos, "select cases cannot be lists") } else { - ncase.List.SetFirst(typecheck(ncase.List.First(), Etop)) + ncase.List.SetFirst(typecheck(ncase.List.First(), ctxStmt)) n := ncase.List.First() ncase.Left = n ncase.List.Set(nil) @@ -83,7 +83,7 @@ func typecheckselect(sel *Node) { } } - typecheckslice(ncase.Nbody.Slice(), Etop) + typecheckslice(ncase.Nbody.Slice(), ctxStmt) } lineno = lno @@ -148,7 +148,7 @@ func walkselectcases(cases *Nodes) []*Node { } if n.Left == nil { - nblank = typecheck(nblank, Erv|Easgn) + nblank = typecheck(nblank, ctxExpr|ctxAssign) n.Left = nblank } @@ -158,7 +158,7 @@ func walkselectcases(cases *Nodes) []*Node { n.Right = nil n.Left = nil n.SetTypecheck(0) - n = typecheck(n, Etop) + n = typecheck(n, ctxStmt) } // if ch == nil { block() }; n; @@ -169,7 +169,7 @@ func walkselectcases(cases *Nodes) []*Node { ln.Set(l) a.Nbody.Set1(mkcall("block", nil, &ln)) l = ln.Slice() - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) l = append(l, a, n) } @@ -189,7 +189,7 @@ func walkselectcases(cases *Nodes) []*Node { switch n.Op { case OSEND: n.Right = nod(OADDR, n.Right, nil) - n.Right = typecheck(n.Right, Erv) + n.Right = typecheck(n.Right, ctxExpr) case OSELRECV, OSELRECV2: if n.Op == OSELRECV2 && n.List.Len() == 0 { @@ -198,7 +198,7 @@ func walkselectcases(cases *Nodes) []*Node { if n.Left != nil { n.Left = nod(OADDR, n.Left, nil) - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) } } } @@ -249,11 +249,11 @@ func walkselectcases(cases *Nodes) []*Node { elem = nodnil() } receivedp := nod(OADDR, n.List.First(), nil) - receivedp = typecheck(receivedp, Erv) + receivedp = typecheck(receivedp, ctxExpr) r.Left = mkcall1(chanfn("selectnbrecv2", 2, ch.Type), types.Types[TBOOL], &r.Ninit, elem, receivedp, ch) } - r.Left = typecheck(r.Left, Erv) + r.Left = typecheck(r.Left, ctxExpr) r.Nbody.Set(cas.Nbody.Slice()) r.Rlist.Set(append(dflt.Ninit.Slice(), dflt.Nbody.Slice()...)) return []*Node{r, nod(OBREAK, nil, nil)} @@ -265,12 +265,12 @@ func walkselectcases(cases *Nodes) []*Node { lineno = sellineno selv := temp(types.NewArray(scasetype(), int64(n))) r := nod(OAS, selv, nil) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) init = append(init, r) order := temp(types.NewArray(types.Types[TUINT16], 2*int64(n))) r = nod(OAS, order, nil) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) init = append(init, r) // register cases @@ -310,7 +310,7 @@ func walkselectcases(cases *Nodes) []*Node { setField := func(f string, val *Node) { r := nod(OAS, nodSym(ODOT, nod(OINDEX, selv, nodintconst(int64(i))), lookup(f)), val) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) init = append(init, r) } @@ -340,7 +340,7 @@ func walkselectcases(cases *Nodes) []*Node { r.List.Set2(chosen, recvOK) fn := syslook("selectgo") r.Rlist.Set1(mkcall1(fn, fn.Type.Results(), nil, bytePtrToIndex(selv, 0), bytePtrToIndex(order, 0), nodintconst(int64(n)))) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) init = append(init, r) // selv and order are no longer alive after selectgo. @@ -352,14 +352,14 @@ func walkselectcases(cases *Nodes) []*Node { setlineno(cas) cond := nod(OEQ, chosen, nodintconst(int64(i))) - cond = typecheck(cond, Erv) + cond = typecheck(cond, ctxExpr) cond = defaultlit(cond, nil) r = nod(OIF, cond, nil) if n := cas.Left; n != nil && n.Op == OSELRECV2 { x := nod(OAS, n.List.First(), recvOK) - x = typecheck(x, Etop) + x = typecheck(x, ctxStmt) r.Nbody.Append(x) } diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index ac8dbf60173f5..28ea72b715a3c 100644 --- a/src/cmd/compile/internal/gc/sinit.go +++ b/src/cmd/compile/internal/gc/sinit.go @@ -411,7 +411,7 @@ func staticassign(l *Node, r *Node, out *[]*Node) bool { } //dump("not static ptrlit", r); - case OSTRARRAYBYTE: + case OSTR2BYTES: if l.Class() == PEXTERN && r.Left.Op == OLITERAL { sval := r.Left.Val().U.(string) slicebytes(l, sval, len(sval)) @@ -585,7 +585,7 @@ func (n *Node) isSimpleName() bool { func litas(l *Node, r *Node, init *Nodes) { a := nod(OAS, l, r) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) init.Append(a) } @@ -746,7 +746,7 @@ func fixedlit(ctxt initContext, kind initKind, n *Node, var_ *Node, init *Nodes) // build list of assignments: var[index] = expr setlineno(value) a = nod(OAS, a, value) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) switch kind { case initKindStatic: genAsStatic(a) @@ -774,7 +774,7 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { fixedlit(ctxt, initKindDynamic, n, vstat, init) // copy static to slice - var_ = typecheck(var_, Erv|Easgn) + var_ = typecheck(var_, ctxExpr|ctxAssign) var nam Node if !stataddr(&nam, var_) || nam.Class() != PEXTERN { Fatalf("slicelit: %v", var_) @@ -839,7 +839,7 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { if vstat == nil { a = nod(OAS, x, nil) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) init.Append(a) // zero new temp } else { // Declare that we're about to initialize all of x. @@ -852,7 +852,7 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { a = temp(t) if vstat == nil { a = nod(OAS, temp(t), nil) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) init.Append(a) // zero new temp a = a.Left } else { @@ -866,16 +866,16 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { } a = nod(OAS, vauto, a) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) init.Append(a) if vstat != nil { // copy static to heap (4) - a = nod(OIND, vauto, nil) + a = nod(ODEREF, vauto, nil) a = nod(OAS, a, vstat) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) init.Append(a) } @@ -910,7 +910,7 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { setlineno(value) a = nod(OAS, a, value) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = orderStmtInPlace(a, map[string][]*Node{}) a = walkstmt(a) init.Append(a) @@ -919,7 +919,7 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { // make slice out of heap (6) a = nod(OAS, var_, nod(OSLICE, vauto, nil)) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = orderStmtInPlace(a, map[string][]*Node{}) a = walkstmt(a) init.Append(a) @@ -993,7 +993,7 @@ func maplit(n *Node, m *Node, init *Nodes) { loop.Nbody.Set1(body) loop.Ninit.Set1(zero) - loop = typecheck(loop, Etop) + loop = typecheck(loop, ctxStmt) loop = walkstmt(loop) init.Append(loop) } else { @@ -1023,19 +1023,19 @@ func addMapEntries(m *Node, dyn []*Node, init *Nodes) { setlineno(index) a := nod(OAS, key, index) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkstmt(a) init.Append(a) setlineno(value) a = nod(OAS, val, value) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkstmt(a) init.Append(a) setlineno(val) a = nod(OAS, nod(OINDEX, m, key), val) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkstmt(a) init.Append(a) @@ -1045,10 +1045,10 @@ func addMapEntries(m *Node, dyn []*Node, init *Nodes) { } a := nod(OVARKILL, key, nil) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) init.Append(a) a = nod(OVARKILL, val, nil) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) init.Append(a) } @@ -1068,7 +1068,7 @@ func anylit(n *Node, var_ *Node, init *Nodes) { // n.Right is stack temporary used as backing store. init.Append(nod(OAS, n.Right, nil)) // zero backing store, just in case (#18410) r = nod(OADDR, n.Right, nil) - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) } else { r = nod(ONEW, nil, nil) r.SetTypecheck(1) @@ -1079,11 +1079,11 @@ func anylit(n *Node, var_ *Node, init *Nodes) { r = walkexpr(r, init) a := nod(OAS, var_, r) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) init.Append(a) - var_ = nod(OIND, var_, nil) - var_ = typecheck(var_, Erv|Easgn) + var_ = nod(ODEREF, var_, nil) + var_ = typecheck(var_, ctxExpr|ctxAssign) anylit(n.Left, var_, init) case OSTRUCTLIT, OARRAYLIT: @@ -1105,7 +1105,7 @@ func anylit(n *Node, var_ *Node, init *Nodes) { // copy static to var a := nod(OAS, var_, vstat) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) init.Append(a) @@ -1123,7 +1123,7 @@ func anylit(n *Node, var_ *Node, init *Nodes) { // initialization of an array or struct with unspecified components (missing fields or arrays) if var_.isSimpleName() || int64(n.List.Len()) < components { a := nod(OAS, var_, nil) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) init.Append(a) } diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 1c64c6437d4b2..7a4152a9e6d48 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -803,7 +803,7 @@ func (s *state) stmt(n *Node) { } case ODEFER: s.call(n.Left, callDefer) - case OPROC: + case OGO: s.call(n.Left, callGo) case OAS2DOTTYPE: @@ -1268,25 +1268,25 @@ var opToSSA = map[opAndType]ssa.Op{ opAndType{ONOT, TBOOL}: ssa.OpNot, - opAndType{OMINUS, TINT8}: ssa.OpNeg8, - opAndType{OMINUS, TUINT8}: ssa.OpNeg8, - opAndType{OMINUS, TINT16}: ssa.OpNeg16, - opAndType{OMINUS, TUINT16}: ssa.OpNeg16, - opAndType{OMINUS, TINT32}: ssa.OpNeg32, - opAndType{OMINUS, TUINT32}: ssa.OpNeg32, - opAndType{OMINUS, TINT64}: ssa.OpNeg64, - opAndType{OMINUS, TUINT64}: ssa.OpNeg64, - opAndType{OMINUS, TFLOAT32}: ssa.OpNeg32F, - opAndType{OMINUS, TFLOAT64}: ssa.OpNeg64F, - - opAndType{OCOM, TINT8}: ssa.OpCom8, - opAndType{OCOM, TUINT8}: ssa.OpCom8, - opAndType{OCOM, TINT16}: ssa.OpCom16, - opAndType{OCOM, TUINT16}: ssa.OpCom16, - opAndType{OCOM, TINT32}: ssa.OpCom32, - opAndType{OCOM, TUINT32}: ssa.OpCom32, - opAndType{OCOM, TINT64}: ssa.OpCom64, - opAndType{OCOM, TUINT64}: ssa.OpCom64, + opAndType{ONEG, TINT8}: ssa.OpNeg8, + opAndType{ONEG, TUINT8}: ssa.OpNeg8, + opAndType{ONEG, TINT16}: ssa.OpNeg16, + opAndType{ONEG, TUINT16}: ssa.OpNeg16, + opAndType{ONEG, TINT32}: ssa.OpNeg32, + opAndType{ONEG, TUINT32}: ssa.OpNeg32, + opAndType{ONEG, TINT64}: ssa.OpNeg64, + opAndType{ONEG, TUINT64}: ssa.OpNeg64, + opAndType{ONEG, TFLOAT32}: ssa.OpNeg32F, + opAndType{ONEG, TFLOAT64}: ssa.OpNeg64F, + + opAndType{OBITNOT, TINT8}: ssa.OpCom8, + opAndType{OBITNOT, TUINT8}: ssa.OpCom8, + opAndType{OBITNOT, TINT16}: ssa.OpCom16, + opAndType{OBITNOT, TUINT16}: ssa.OpCom16, + opAndType{OBITNOT, TINT32}: ssa.OpCom32, + opAndType{OBITNOT, TUINT32}: ssa.OpCom32, + opAndType{OBITNOT, TINT64}: ssa.OpCom64, + opAndType{OBITNOT, TUINT64}: ssa.OpCom64, opAndType{OIMAG, TCOMPLEX64}: ssa.OpComplexImag, opAndType{OIMAG, TCOMPLEX128}: ssa.OpComplexImag, @@ -1655,12 +1655,12 @@ func (s *state) expr(n *Node) *ssa.Value { s.stmtList(n.Ninit) switch n.Op { - case OARRAYBYTESTRTMP: + case OBYTES2STRTMP: slice := s.expr(n.Left) ptr := s.newValue1(ssa.OpSlicePtr, s.f.Config.Types.BytePtr, slice) len := s.newValue1(ssa.OpSliceLen, types.Types[TINT], slice) return s.newValue2(ssa.OpStringMake, n.Type, ptr, len) - case OSTRARRAYBYTETMP: + case OSTR2BYTESTMP: str := s.expr(n.Left) ptr := s.newValue1(ssa.OpStringPtr, s.f.Config.Types.BytePtr, str) len := s.newValue1(ssa.OpStringLen, types.Types[TINT], str) @@ -2174,7 +2174,7 @@ func (s *state) expr(n *Node) *ssa.Value { return s.newValue2(ssa.OpComplexMake, n.Type, r, i) // unary ops - case OMINUS: + case ONEG: a := s.expr(n.Left) if n.Type.IsComplex() { tp := floatForComplex(n.Type) @@ -2184,7 +2184,7 @@ func (s *state) expr(n *Node) *ssa.Value { s.newValue1(negop, tp, s.newValue1(ssa.OpComplexImag, tp, a))) } return s.newValue1(s.ssaOp(n.Op, n.Type), a.Type, a) - case ONOT, OCOM: + case ONOT, OBITNOT: a := s.expr(n.Left) return s.newValue1(s.ssaOp(n.Op, n.Type), a.Type, a) case OIMAG, OREAL: @@ -2200,7 +2200,7 @@ func (s *state) expr(n *Node) *ssa.Value { addr := s.constOffPtrSP(types.NewPtr(n.Type), n.Xoffset) return s.load(n.Type, addr) - case OIND: + case ODEREF: p := s.exprPtr(n.Left, false, n.Pos) return s.load(n.Type, p) @@ -2838,7 +2838,7 @@ func (s *state) sfcall(op ssa.Op, args ...*ssa.Value) (*ssa.Value, bool) { args[0], args[1] = args[1], args[0] case ssa.OpSub32F, ssa.OpSub64F: - args[1] = s.newValue1(s.ssaOp(OMINUS, types.Types[callDef.rtype]), args[1].Type, args[1]) + args[1] = s.newValue1(s.ssaOp(ONEG, types.Types[callDef.rtype]), args[1].Type, args[1]) } result := s.rtcall(callDef.rtfn, true, []*types.Type{types.Types[callDef.rtype]}, args...)[0] @@ -2915,7 +2915,7 @@ func init() { if !instrumenting { add("runtime", "slicebytetostringtmp", func(s *state, n *Node, args []*ssa.Value) *ssa.Value { - // Compiler frontend optimizations emit OARRAYBYTESTRTMP nodes + // Compiler frontend optimizations emit OBYTES2STRTMP nodes // for the backend instead of slicebytetostringtmp calls // when not instrumenting. slice := args[0] @@ -3861,7 +3861,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value { } return s.newValue2(ssa.OpPtrIndex, types.NewPtr(n.Left.Type.Elem()), a, i) } - case OIND: + case ODEREF: return s.exprPtr(n.Left, bounded, n.Pos) case ODOT: p := s.addr(n.Left, bounded) diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index 127e5fdc77997..629186829a5af 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -767,10 +767,10 @@ func convertop(src *types.Type, dst *types.Type, why *string) Op { if src.IsSlice() && dst.IsString() { if src.Elem().Etype == types.Bytetype.Etype { - return OARRAYBYTESTR + return OBYTES2STR } if src.Elem().Etype == types.Runetype.Etype { - return OARRAYRUNESTR + return ORUNES2STR } } @@ -778,10 +778,10 @@ func convertop(src *types.Type, dst *types.Type, why *string) Op { // String to slice. if src.IsString() && dst.IsSlice() { if dst.Elem().Etype == types.Bytetype.Etype { - return OSTRARRAYBYTE + return OSTR2BYTES } if dst.Elem().Etype == types.Runetype.Etype { - return OSTRARRAYRUNE + return OSTR2RUNES } } @@ -999,14 +999,14 @@ func calcHasCall(n *Node) bool { return true } case OINDEX, OSLICE, OSLICEARR, OSLICE3, OSLICE3ARR, OSLICESTR, - OIND, ODOTPTR, ODOTTYPE, ODIV, OMOD: + ODEREF, ODOTPTR, ODOTTYPE, ODIV, OMOD: // These ops might panic, make sure they are done // before we start marshaling args for a call. See issue 16760. return true // When using soft-float, these ops might be rewritten to function calls // so we ensure they are evaluated first. - case OADD, OSUB, OMINUS, OMUL: + case OADD, OSUB, ONEG, OMUL: if thearch.SoftFloat && (isFloat[n.Type.Etype] || isComplex[n.Type.Etype]) { return true } @@ -1116,11 +1116,11 @@ func safeexpr(n *Node, init *Nodes) *Node { } r := n.copy() r.Left = l - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) r = walkexpr(r, init) return r - case ODOTPTR, OIND: + case ODOTPTR, ODEREF: l := safeexpr(n.Left, init) if l == n.Left { return n @@ -1158,7 +1158,7 @@ func safeexpr(n *Node, init *Nodes) *Node { func copyexpr(n *Node, t *types.Type, init *Nodes) *Node { l := temp(t) a := nod(OAS, l, n) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) init.Append(a) return l @@ -1308,7 +1308,7 @@ func dotpath(s *types.Sym, t *types.Type, save **types.Field, ignorecase bool) ( // will give shortest unique addressing. // modify the tree with missing type names. func adddot(n *Node) *Node { - n.Left = typecheck(n.Left, Etype|Erv) + n.Left = typecheck(n.Left, Etype|ctxExpr) if n.Left.Diag() { n.SetDiag(true) } @@ -1478,7 +1478,7 @@ func structargs(tl *types.Type, mustname bool) []*Node { } a := symfield(s, t.Type) a.Pos = t.Pos - a.SetIsddd(t.Isddd()) + a.SetIsDDD(t.IsDDD()) args = append(args, a) } @@ -1571,7 +1571,7 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) { fn.Func.SetWrapper(true) // ignore frame for panic+recover matching call := nod(OCALL, dot, nil) call.List.Set(paramNnames(tfn.Type)) - call.SetIsddd(tfn.Type.IsVariadic()) + call.SetIsDDD(tfn.Type.IsVariadic()) if method.Type.NumResults() > 0 { n := nod(ORETURN, nil, nil) n.List.Set1(call) @@ -1589,10 +1589,10 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) { testdclstack() } - fn = typecheck(fn, Etop) + fn = typecheck(fn, ctxStmt) Curfn = fn - typecheckslice(fn.Nbody.Slice(), Etop) + typecheckslice(fn.Nbody.Slice(), ctxStmt) // Inline calls within (*T).M wrappers. This is safe because we only // generate those wrappers within the same compilation unit as (T).M. @@ -1852,7 +1852,7 @@ func checknil(x *Node, init *Nodes) { x = walkexpr(x, nil) // caller has not done this yet if x.Type.IsInterface() { x = nod(OITAB, x, nil) - x = typecheck(x, Erv) + x = typecheck(x, ctxExpr) } n := nod(OCHECKNIL, x, nil) @@ -1910,7 +1910,7 @@ func ifaceData(n *Node, t *types.Type) *Node { ptr.Type = types.NewPtr(t) ptr.SetBounded(true) ptr.SetTypecheck(1) - ind := nod(OIND, ptr, nil) + ind := nod(ODEREF, ptr, nil) ind.Type = t ind.SetTypecheck(1) return ind diff --git a/src/cmd/compile/internal/gc/swt.go b/src/cmd/compile/internal/gc/swt.go index f1c153937fba5..b475e7adc3d57 100644 --- a/src/cmd/compile/internal/gc/swt.go +++ b/src/cmd/compile/internal/gc/swt.go @@ -56,7 +56,7 @@ type caseClauses struct { // typecheckswitch typechecks a switch statement. func typecheckswitch(n *Node) { - typecheckslice(n.Ninit.Slice(), Etop) + typecheckslice(n.Ninit.Slice(), ctxStmt) var nilonly string var top int @@ -65,7 +65,7 @@ func typecheckswitch(n *Node) { if n.Left != nil && n.Left.Op == OTYPESW { // type switch top = Etype - n.Left.Right = typecheck(n.Left.Right, Erv) + n.Left.Right = typecheck(n.Left.Right, ctxExpr) t = n.Left.Right.Type if t != nil && !t.IsInterface() { yyerrorl(n.Pos, "cannot type switch on non-interface value %L", n.Left.Right) @@ -78,9 +78,9 @@ func typecheckswitch(n *Node) { } } else { // expression switch - top = Erv + top = ctxExpr if n.Left != nil { - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) t = n.Left.Type } else { @@ -122,7 +122,7 @@ func typecheckswitch(n *Node) { ls := ncase.List.Slice() for i1, n1 := range ls { setlineno(n1) - ls[i1] = typecheck(ls[i1], Erv|Etype) + ls[i1] = typecheck(ls[i1], ctxExpr|Etype) n1 = ls[i1] if n1.Type == nil || t == nil { continue @@ -131,7 +131,7 @@ func typecheckswitch(n *Node) { setlineno(ncase) switch top { // expression switch - case Erv: + case ctxExpr: ls[i1] = defaultlit(ls[i1], t) n1 = ls[i1] switch { @@ -203,16 +203,16 @@ func typecheckswitch(n *Node) { nvar.Type = n.Type } - nvar = typecheck(nvar, Erv|Easgn) + nvar = typecheck(nvar, ctxExpr|ctxAssign) ncase.Rlist.SetFirst(nvar) } } - typecheckslice(ncase.Nbody.Slice(), Etop) + typecheckslice(ncase.Nbody.Slice(), ctxStmt) } switch top { // expression switch - case Erv: + case ctxExpr: checkDupExprCases(n.Left, n.List.Slice()) } } @@ -222,7 +222,7 @@ func walkswitch(sw *Node) { // convert switch {...} to switch true {...} if sw.Left == nil { sw.Left = nodbool(true) - sw.Left = typecheck(sw.Left, Erv) + sw.Left = typecheck(sw.Left, ctxExpr) sw.Left = defaultlit(sw.Left, nil) } @@ -271,7 +271,7 @@ func (s *exprSwitch) walk(sw *Node) { // because walkexpr will lower the string // conversion into a runtime call. // See issue 24937 for more discussion. - if cond.Op == OARRAYBYTESTR { + if cond.Op == OBYTES2STR { ok := true for _, cas := range sw.List.Slice() { if cas.Op != OCASE { @@ -283,7 +283,7 @@ func (s *exprSwitch) walk(sw *Node) { } } if ok { - cond.Op = OARRAYBYTESTRTMP + cond.Op = OBYTES2STRTMP } } @@ -303,7 +303,7 @@ func (s *exprSwitch) walk(sw *Node) { } else { s.exprname = temp(cond.Type) cas = []*Node{nod(OAS, s.exprname, cond)} - typecheckslice(cas, Etop) + typecheckslice(cas, ctxStmt) } // Enumerate the cases and prepare the default case. @@ -362,7 +362,7 @@ func (s *exprSwitch) walkCases(cc []caseClause) *Node { // s.kind == switchKindFalse a.Left = nod(ONOT, n.Left, nil) // if !val } - a.Left = typecheck(a.Left, Erv) + a.Left = typecheck(a.Left, ctxExpr) a.Left = defaultlit(a.Left, nil) a.Nbody.Set1(n.Right) // goto l @@ -391,7 +391,7 @@ func (s *exprSwitch) walkCases(cc []caseClause) *Node { } else { a.Left = le } - a.Left = typecheck(a.Left, Erv) + a.Left = typecheck(a.Left, ctxExpr) a.Left = defaultlit(a.Left, nil) a.Nbody.Set1(s.walkCases(cc[:half])) a.Rlist.Set1(s.walkCases(cc[half:])) @@ -493,7 +493,7 @@ func casebody(sw *Node, typeswvar *Node) { nod(ODCL, n.Rlist.First(), nil), nod(OAS, n.Rlist.First(), typeswvar), } - typecheckslice(l, Etop) + typecheckslice(l, ctxStmt) stat = append(stat, l...) } stat = append(stat, n.Nbody.Slice()...) @@ -742,14 +742,14 @@ func (s *typeSwitch) walk(sw *Node) { s.facename = temp(cond.Right.Type) a := nod(OAS, s.facename, cond.Right) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) cas = append(cas, a) s.okname = temp(types.Types[TBOOL]) - s.okname = typecheck(s.okname, Erv) + s.okname = typecheck(s.okname, ctxExpr) s.hashname = temp(types.Types[TUINT32]) - s.hashname = typecheck(s.hashname, Erv) + s.hashname = typecheck(s.hashname, ctxExpr) // set up labels and jumps casebody(sw, s.facename) @@ -785,7 +785,7 @@ func (s *typeSwitch) walk(sw *Node) { blk.List.Set2(nodSym(OLABEL, nil, lbl), def) def = blk } - i.Left = typecheck(i.Left, Erv) + i.Left = typecheck(i.Left, ctxExpr) i.Left = defaultlit(i.Left, nil) cas = append(cas, i) @@ -800,7 +800,7 @@ func (s *typeSwitch) walk(sw *Node) { } h.SetBounded(true) // guaranteed not to fault a = nod(OAS, s.hashname, h) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) cas = append(cas, a) cc := clauses.list @@ -868,12 +868,12 @@ func (s *typeSwitch) typeone(t *Node) *Node { var init Nodes if t.Rlist.Len() == 0 { name = nblank - nblank = typecheck(nblank, Erv|Easgn) + nblank = typecheck(nblank, ctxExpr|ctxAssign) } else { name = t.Rlist.First() init.Append(nod(ODCL, name, nil)) a := nod(OAS, name, nil) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) init.Append(a) } @@ -882,7 +882,7 @@ func (s *typeSwitch) typeone(t *Node) *Node { b := nod(ODOTTYPE, s.facename, nil) b.Type = t.Left.Type // interface.(type) a.Rlist.Set1(b) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, &init) init.Append(a) @@ -905,7 +905,7 @@ func (s *typeSwitch) walkCases(cc []caseClause) *Node { } a := nod(OIF, nil, nil) a.Left = nod(OEQ, s.hashname, nodintconst(int64(c.hash))) - a.Left = typecheck(a.Left, Erv) + a.Left = typecheck(a.Left, ctxExpr) a.Left = defaultlit(a.Left, nil) a.Nbody.Set1(n.Right) cas = append(cas, a) @@ -917,7 +917,7 @@ func (s *typeSwitch) walkCases(cc []caseClause) *Node { half := len(cc) / 2 a := nod(OIF, nil, nil) a.Left = nod(OLE, s.hashname, nodintconst(int64(cc[half-1].hash))) - a.Left = typecheck(a.Left, Erv) + a.Left = typecheck(a.Left, ctxExpr) a.Left = defaultlit(a.Left, nil) a.Nbody.Set1(s.walkCases(cc[:half])) a.Rlist.Set1(s.walkCases(cc[half:])) diff --git a/src/cmd/compile/internal/gc/syntax.go b/src/cmd/compile/internal/gc/syntax.go index e29a3d7657d9b..9ecea8a4c526e 100644 --- a/src/cmd/compile/internal/gc/syntax.go +++ b/src/cmd/compile/internal/gc/syntax.go @@ -144,7 +144,7 @@ const ( _, nodeAssigned // is the variable ever assigned to _, nodeAddrtaken // address taken, even if not moved to heap _, nodeImplicit - _, nodeIsddd // is the argument variadic + _, nodeIsDDD // is the argument variadic _, nodeDiag // already printed error about this _, nodeColas // OAS resulting from := _, nodeNonNil // guaranteed to be non-nil @@ -172,7 +172,7 @@ func (n *Node) IsOutputParamHeapAddr() bool { return n.flags&nodeIsOutputParamHe func (n *Node) Assigned() bool { return n.flags&nodeAssigned != 0 } func (n *Node) Addrtaken() bool { return n.flags&nodeAddrtaken != 0 } func (n *Node) Implicit() bool { return n.flags&nodeImplicit != 0 } -func (n *Node) Isddd() bool { return n.flags&nodeIsddd != 0 } +func (n *Node) IsDDD() bool { return n.flags&nodeIsDDD != 0 } func (n *Node) Diag() bool { return n.flags&nodeDiag != 0 } func (n *Node) Colas() bool { return n.flags&nodeColas != 0 } func (n *Node) NonNil() bool { return n.flags&nodeNonNil != 0 } @@ -199,7 +199,7 @@ func (n *Node) SetIsOutputParamHeapAddr(b bool) { n.flags.set(nodeIsOutputParamH func (n *Node) SetAssigned(b bool) { n.flags.set(nodeAssigned, b) } func (n *Node) SetAddrtaken(b bool) { n.flags.set(nodeAddrtaken, b) } func (n *Node) SetImplicit(b bool) { n.flags.set(nodeImplicit, b) } -func (n *Node) SetIsddd(b bool) { n.flags.set(nodeIsddd, b) } +func (n *Node) SetIsDDD(b bool) { n.flags.set(nodeIsDDD, b) } func (n *Node) SetDiag(b bool) { n.flags.set(nodeDiag, b) } func (n *Node) SetColas(b bool) { n.flags.set(nodeColas, b) } func (n *Node) SetNonNil(b bool) { n.flags.set(nodeNonNil, b) } @@ -477,7 +477,7 @@ type Func struct { FieldTrack map[*types.Sym]struct{} DebugInfo *ssa.FuncDebug Ntype *Node // signature - Top int // top context (Ecall, Eproc, etc) + Top int // top context (ctxCallee, etc) Closure *Node // OCLOSURE <-> ODCLFUNC Nname *Node lsym *obj.LSym @@ -581,28 +581,28 @@ const ( OLITERAL // literal // expressions - OADD // Left + Right - OSUB // Left - Right - OOR // Left | Right - OXOR // Left ^ Right - OADDSTR // +{List} (string addition, list elements are strings) - OADDR // &Left - OANDAND // Left && Right - OAPPEND // append(List); after walk, Left may contain elem type descriptor - OARRAYBYTESTR // Type(Left) (Type is string, Left is a []byte) - OARRAYBYTESTRTMP // Type(Left) (Type is string, Left is a []byte, ephemeral) - OARRAYRUNESTR // Type(Left) (Type is string, Left is a []rune) - OSTRARRAYBYTE // Type(Left) (Type is []byte, Left is a string) - OSTRARRAYBYTETMP // Type(Left) (Type is []byte, Left is a string, ephemeral) - OSTRARRAYRUNE // Type(Left) (Type is []rune, Left is a string) - OAS // Left = Right or (if Colas=true) Left := Right - OAS2 // List = Rlist (x, y, z = a, b, c) - OAS2FUNC // List = Rlist (x, y = f()) - OAS2RECV // List = Rlist (x, ok = <-c) - OAS2MAPR // List = Rlist (x, ok = m["foo"]) - OAS2DOTTYPE // List = Rlist (x, ok = I.(int)) - OASOP // Left Etype= Right (x += y) - OCALL // Left(List) (function call, method call or type conversion) + OADD // Left + Right + OSUB // Left - Right + OOR // Left | Right + OXOR // Left ^ Right + OADDSTR // +{List} (string addition, list elements are strings) + OADDR // &Left + OANDAND // Left && Right + OAPPEND // append(List); after walk, Left may contain elem type descriptor + OBYTES2STR // Type(Left) (Type is string, Left is a []byte) + OBYTES2STRTMP // Type(Left) (Type is string, Left is a []byte, ephemeral) + ORUNES2STR // Type(Left) (Type is string, Left is a []rune) + OSTR2BYTES // Type(Left) (Type is []byte, Left is a string) + OSTR2BYTESTMP // Type(Left) (Type is []byte, Left is a string, ephemeral) + OSTR2RUNES // Type(Left) (Type is []rune, Left is a string) + OAS // Left = Right or (if Colas=true) Left := Right + OAS2 // List = Rlist (x, y, z = a, b, c) + OAS2FUNC // List = Rlist (x, y = f()) + OAS2RECV // List = Rlist (x, ok = <-c) + OAS2MAPR // List = Rlist (x, ok = m["foo"]) + OAS2DOTTYPE // List = Rlist (x, ok = I.(int)) + OASOP // Left Etype= Right (x += y) + OCALL // Left(List) (function call, method call or type conversion) // OCALLFUNC, OCALLMETH, and OCALLINTER have the same structure. // Prior to walk, they are: Left(List), where List is all regular arguments. @@ -650,7 +650,7 @@ const ( OLE // Left <= Right OGE // Left >= Right OGT // Left > Right - OIND // *Left + ODEREF // *Left OINDEX // Left[Right] (index of array or slice) OINDEXMAP // Left[Right] (index of map) OKEY // Left:Right (key:value in struct/array/map literal) @@ -669,9 +669,9 @@ const ( OANDNOT // Left &^ Right ONEW // new(Left) ONOT // !Left - OCOM // ^Left + OBITNOT // ^Left OPLUS // +Left - OMINUS // -Left + ONEG // -Left OOROR // Left || Right OPANIC // panic(Left) OPRINT // print(List) @@ -720,7 +720,7 @@ const ( OGOTO // goto Sym OIF // if Ninit; Left { Nbody } else { Rlist } OLABEL // Sym: - OPROC // go Left (Left must be call) + OGO // go Left (Left must be call) ORANGE // for List = range Right { Nbody } ORETURN // return List OSELECT // select { List } (List is list of OXCASE or OCASE) diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index 371e0924e7155..069a38cbbbe19 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -57,13 +57,13 @@ func tracePrint(title string, n *Node) func(np **Node) { } const ( - Etop = 1 << iota // evaluated at statement level - Erv // evaluated in value context - Etype // evaluated in type context - Ecall // call-only expressions are ok - Efnstruct // multivalue function returns are ok - Easgn // assigning to expression - Ecomplit // type in composite literal + ctxStmt = 1 << iota // evaluated at statement level + ctxExpr // evaluated in value context + Etype // evaluated in type context + ctxCallee // call-only expressions are ok + ctxMultiOK // multivalue function returns are ok + ctxAssign // assigning to expression + ctxCompLit // type in composite literal ) // type checks the whole tree of an expression. @@ -243,7 +243,7 @@ func typecheck(n *Node, top int) (res *Node) { switch n.Op { // We can already diagnose variables used as types. case ONAME: - if top&(Erv|Etype) == Etype { + if top&(ctxExpr|Etype) == Etype { yyerror("%v is not a type", n) } @@ -273,7 +273,7 @@ func typecheck(n *Node, top int) (res *Node) { } case OLITERAL: - if top&(Erv|Etype) == Etype { + if top&(ctxExpr|Etype) == Etype { yyerror("%v is not a type", n) break } @@ -367,7 +367,7 @@ func typecheck1(n *Node, top int) (res *Node) { break } - if n.Op == ONAME && n.SubOp() != 0 && top&Ecall == 0 { + if n.Op == ONAME && n.SubOp() != 0 && top&ctxCallee == 0 { yyerror("use of builtin %v not in function call", n.Sym) n.Type = nil return n @@ -390,25 +390,25 @@ func typecheck1(n *Node, top int) (res *Node) { // names case OLITERAL: - ok |= Erv + ok |= ctxExpr if n.Type == nil && n.Val().Ctype() == CTSTR { n.Type = types.Idealstring } case ONONAME: - ok |= Erv + ok |= ctxExpr case ONAME: if n.Name.Decldepth == 0 { n.Name.Decldepth = decldepth } if n.SubOp() != 0 { - ok |= Ecall + ok |= ctxCallee break } - if top&Easgn == 0 { + if top&ctxAssign == 0 { // not a write to the variable if n.isBlank() { yyerror("cannot use _ as value") @@ -419,7 +419,7 @@ func typecheck1(n *Node, top int) (res *Node) { n.Name.SetUsed(true) } - ok |= Erv + ok |= ctxExpr case OPACK: yyerror("use of package %v without selector", n.Sym) @@ -429,7 +429,7 @@ func typecheck1(n *Node, top int) (res *Node) { case ODDD: break - // types (OIND is with exprs) + // types (ODEREF is with exprs) case OTYPE: ok |= Etype @@ -449,7 +449,7 @@ func typecheck1(n *Node, top int) (res *Node) { if n.Left == nil { t = types.NewSlice(r.Type) } else if n.Left.Op == ODDD { - if top&Ecomplit == 0 { + if top&ctxCompLit == 0 { if !n.Diag() { n.SetDiag(true) yyerror("use of [...] array outside of array literal") @@ -459,7 +459,7 @@ func typecheck1(n *Node, top int) (res *Node) { } t = types.NewDDDArray(r.Type) } else { - n.Left = indexlit(typecheck(n.Left, Erv)) + n.Left = indexlit(typecheck(n.Left, ctxExpr)) l := n.Left if consttype(l) != CTINT { switch { @@ -567,8 +567,8 @@ func typecheck1(n *Node, top int) (res *Node) { n.Rlist.Set(nil) // type or expr - case OIND: - n.Left = typecheck(n.Left, Erv|Etype|top&Ecomplit) + case ODEREF: + n.Left = typecheck(n.Left, ctxExpr|Etype|top&ctxCompLit) l := n.Left t := l.Type if t == nil { @@ -590,7 +590,7 @@ func typecheck1(n *Node, top int) (res *Node) { } if !t.IsPtr() { - if top&(Erv|Etop) != 0 { + if top&(ctxExpr|ctxStmt) != 0 { yyerror("invalid indirect of %L", n.Left) n.Type = nil return n @@ -599,7 +599,7 @@ func typecheck1(n *Node, top int) (res *Node) { break } - ok |= Erv + ok |= ctxExpr n.Type = t.Elem() // arithmetic exprs @@ -627,9 +627,9 @@ func typecheck1(n *Node, top int) (res *Node) { var op Op var r *Node if n.Op == OASOP { - ok |= Etop - n.Left = typecheck(n.Left, Erv) - n.Right = typecheck(n.Right, Erv) + ok |= ctxStmt + n.Left = typecheck(n.Left, ctxExpr) + n.Right = typecheck(n.Right, ctxExpr) l = n.Left r = n.Right checkassign(n, n.Left) @@ -645,9 +645,9 @@ func typecheck1(n *Node, top int) (res *Node) { // TODO(marvin): Fix Node.EType type union. op = n.SubOp() } else { - ok |= Erv - n.Left = typecheck(n.Left, Erv) - n.Right = typecheck(n.Right, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) + n.Right = typecheck(n.Right, ctxExpr) l = n.Left r = n.Right if l.Type == nil || r.Type == nil { @@ -841,9 +841,9 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = t - case OCOM, OMINUS, ONOT, OPLUS: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + case OBITNOT, ONEG, ONOT, OPLUS: + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) l := n.Left t := l.Type if t == nil { @@ -860,9 +860,9 @@ func typecheck1(n *Node, top int) (res *Node) { // exprs case OADDR: - ok |= Erv + ok |= ctxExpr - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) if n.Left.Type == nil { n.Type = nil return n @@ -899,7 +899,7 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = types.NewPtr(t) case OCOMPLIT: - ok |= Erv + ok |= ctxExpr n = typecheckcomplit(n) if n.Type == nil { return n @@ -915,7 +915,7 @@ func typecheck1(n *Node, top int) (res *Node) { } } - n.Left = typecheck(n.Left, Erv|Etype) + n.Left = typecheck(n.Left, ctxExpr|Etype) n.Left = defaultlit(n.Left, nil) @@ -933,7 +933,7 @@ func typecheck1(n *Node, top int) (res *Node) { if n.Type == nil { return n } - ok = Erv + ok = ctxExpr break } @@ -980,20 +980,20 @@ func typecheck1(n *Node, top int) (res *Node) { switch n.Op { case ODOTINTER, ODOTMETH: - if top&Ecall != 0 { - ok |= Ecall + if top&ctxCallee != 0 { + ok |= ctxCallee } else { typecheckpartialcall(n, s) - ok |= Erv + ok |= ctxExpr } default: - ok |= Erv + ok |= ctxExpr } case ODOTTYPE: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) l := n.Left t := l.Type @@ -1037,12 +1037,12 @@ func typecheck1(n *Node, top int) (res *Node) { } case OINDEX: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) n.Left = implicitstar(n.Left) l := n.Left - n.Right = typecheck(n.Right, Erv) + n.Right = typecheck(n.Right, ctxExpr) r := n.Right t := l.Type if t == nil || r.Type == nil { @@ -1098,8 +1098,8 @@ func typecheck1(n *Node, top int) (res *Node) { } case ORECV: - ok |= Etop | Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxStmt | ctxExpr + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) l := n.Left t := l.Type @@ -1122,9 +1122,9 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = t.Elem() case OSEND: - ok |= Etop - n.Left = typecheck(n.Left, Erv) - n.Right = typecheck(n.Right, Erv) + ok |= ctxStmt + n.Left = typecheck(n.Left, ctxExpr) + n.Right = typecheck(n.Right, ctxExpr) n.Left = defaultlit(n.Left, nil) t := n.Left.Type if t == nil { @@ -1157,7 +1157,7 @@ func typecheck1(n *Node, top int) (res *Node) { // can construct an OSLICEHEADER node. // Components used in OSLICEHEADER that are supplied by parsed source code // have already been typechecked in e.g. OMAKESLICE earlier. - ok |= Erv + ok |= ctxExpr t := n.Type if t == nil { @@ -1176,9 +1176,9 @@ func typecheck1(n *Node, top int) (res *Node) { Fatalf("expected 2 params (len, cap) for OSLICEHEADER, got %d", x) } - n.Left = typecheck(n.Left, Erv) - l := typecheck(n.List.First(), Erv) - c := typecheck(n.List.Second(), Erv) + n.Left = typecheck(n.Left, ctxExpr) + l := typecheck(n.List.First(), ctxExpr) + c := typecheck(n.List.Second(), ctxExpr) l = defaultlit(l, types.Types[TINT]) c = defaultlit(c, types.Types[TINT]) @@ -1198,13 +1198,13 @@ func typecheck1(n *Node, top int) (res *Node) { n.List.SetSecond(c) case OSLICE, OSLICE3: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) low, high, max := n.SliceBounds() hasmax := n.Op.IsSlice3() - low = typecheck(low, Erv) - high = typecheck(high, Erv) - max = typecheck(max, Erv) + low = typecheck(low, ctxExpr) + high = typecheck(high, ctxExpr) + max = typecheck(max, ctxExpr) n.Left = defaultlit(n.Left, nil) low = indexlit(low) high = indexlit(high) @@ -1224,7 +1224,7 @@ func typecheck1(n *Node, top int) (res *Node) { n.Left = nod(OADDR, n.Left, nil) n.Left.SetImplicit(true) - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) l = n.Left } t := l.Type @@ -1273,7 +1273,7 @@ func typecheck1(n *Node, top int) (res *Node) { // call and call like case OCALL: - n.Left = typecheck(n.Left, Erv|Etype|Ecall) + n.Left = typecheck(n.Left, ctxExpr|Etype|ctxCallee) if n.Left.Diag() { n.SetDiag(true) } @@ -1281,7 +1281,7 @@ func typecheck1(n *Node, top int) (res *Node) { l := n.Left if l.Op == ONAME && l.SubOp() != 0 { - if n.Isddd() && l.SubOp() != OAPPEND { + if n.IsDDD() && l.SubOp() != OAPPEND { yyerror("invalid use of ... with builtin %v", l) } @@ -1296,7 +1296,7 @@ func typecheck1(n *Node, top int) (res *Node) { n.Left = defaultlit(n.Left, nil) l = n.Left if l.Op == OTYPE { - if n.Isddd() || l.Type.IsDDDArray() { + if n.IsDDD() || l.Type.IsDDDArray() { if !l.Type.Broke() { yyerror("invalid use of ... in type conversion to %v", l.Type) } @@ -1304,7 +1304,7 @@ func typecheck1(n *Node, top int) (res *Node) { } // pick off before type-checking arguments - ok |= Erv + ok |= ctxExpr // turn CALL(type, arg) into CONV(arg) w/ type n.Left = nil @@ -1319,10 +1319,10 @@ func typecheck1(n *Node, top int) (res *Node) { return n } - if n.List.Len() == 1 && !n.Isddd() { - n.List.SetFirst(typecheck(n.List.First(), Erv|Efnstruct)) + if n.List.Len() == 1 && !n.IsDDD() { + n.List.SetFirst(typecheck(n.List.First(), ctxExpr|ctxMultiOK)) } else { - typecheckslice(n.List.Slice(), Erv) + typecheckslice(n.List.Slice(), ctxExpr) } t := l.Type if t == nil { @@ -1365,12 +1365,12 @@ func typecheck1(n *Node, top int) (res *Node) { } } - typecheckaste(OCALL, n.Left, n.Isddd(), t.Params(), n.List, func() string { return fmt.Sprintf("argument to %v", n.Left) }) - ok |= Etop + typecheckaste(OCALL, n.Left, n.IsDDD(), t.Params(), n.List, func() string { return fmt.Sprintf("argument to %v", n.Left) }) + ok |= ctxStmt if t.NumResults() == 0 { break } - ok |= Erv + ok |= ctxExpr if t.NumResults() == 1 { n.Type = l.Type.Results().Field(0).Type @@ -1388,7 +1388,7 @@ func typecheck1(n *Node, top int) (res *Node) { } // multiple return - if top&(Efnstruct|Etop) == 0 { + if top&(ctxMultiOK|ctxStmt) == 0 { yyerror("multiple-value %v() in single-value context", l) break } @@ -1396,7 +1396,7 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = l.Type.Results() case OALIGNOF, OOFFSETOF, OSIZEOF: - ok |= Erv + ok |= ctxExpr if !onearg(n, "%v", n.Op) { n.Type = nil return n @@ -1407,13 +1407,13 @@ func typecheck1(n *Node, top int) (res *Node) { setintconst(n, evalunsafe(n)) case OCAP, OLEN: - ok |= Erv + ok |= ctxExpr if !onearg(n, "%v", n.Op) { n.Type = nil return n } - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) n.Left = implicitstar(n.Left) l := n.Left @@ -1455,13 +1455,13 @@ func typecheck1(n *Node, top int) (res *Node) { } case OREAL, OIMAG: - ok |= Erv + ok |= ctxExpr if !onearg(n, "%v", n.Op) { n.Type = nil return n } - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) l := n.Left t := l.Type if t == nil { @@ -1516,11 +1516,11 @@ func typecheck1(n *Node, top int) (res *Node) { } case OCOMPLEX: - ok |= Erv + ok |= ctxExpr var r *Node var l *Node if n.List.Len() == 1 { - typecheckslice(n.List.Slice(), Efnstruct) + typecheckslice(n.List.Slice(), ctxMultiOK) if n.List.First().Op != OCALLFUNC && n.List.First().Op != OCALLMETH { yyerror("invalid operation: complex expects two arguments") n.Type = nil @@ -1546,8 +1546,8 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = nil return n } - n.Left = typecheck(n.Left, Erv) - n.Right = typecheck(n.Right, Erv) + n.Left = typecheck(n.Left, ctxExpr) + n.Right = typecheck(n.Right, ctxExpr) l = n.Left r = n.Right if l.Type == nil || r.Type == nil { @@ -1600,7 +1600,7 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = nil return n } - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) l := n.Left t := l.Type @@ -1620,7 +1620,7 @@ func typecheck1(n *Node, top int) (res *Node) { return n } - ok |= Etop + ok |= ctxStmt case ODELETE: args := n.List @@ -1642,8 +1642,8 @@ func typecheck1(n *Node, top int) (res *Node) { return n } - ok |= Etop - typecheckslice(args.Slice(), Erv) + ok |= ctxStmt + typecheckslice(args.Slice(), ctxExpr) l := args.First() r := args.Second() if l.Type != nil && !l.Type.IsMap() { @@ -1655,7 +1655,7 @@ func typecheck1(n *Node, top int) (res *Node) { args.SetSecond(assignconv(r, l.Type.Key(), "delete")) case OAPPEND: - ok |= Erv + ok |= ctxExpr args := n.List if args.Len() == 0 { yyerror("missing arguments to append") @@ -1663,10 +1663,10 @@ func typecheck1(n *Node, top int) (res *Node) { return n } - if args.Len() == 1 && !n.Isddd() { - args.SetFirst(typecheck(args.First(), Erv|Efnstruct)) + if args.Len() == 1 && !n.IsDDD() { + args.SetFirst(typecheck(args.First(), ctxExpr|ctxMultiOK)) } else { - typecheckslice(args.Slice(), Erv) + typecheckslice(args.Slice(), ctxExpr) } t := args.First().Type @@ -1695,7 +1695,7 @@ func typecheck1(n *Node, top int) (res *Node) { return n } - if n.Isddd() { + if n.IsDDD() { if args.Len() == 1 { yyerror("cannot use ... on first argument to append") n.Type = nil @@ -1735,7 +1735,7 @@ func typecheck1(n *Node, top int) (res *Node) { } case OCOPY: - ok |= Etop | Erv + ok |= ctxStmt | ctxExpr args := n.List if args.Len() < 2 { yyerror("missing arguments to copy") @@ -1753,8 +1753,8 @@ func typecheck1(n *Node, top int) (res *Node) { n.Right = args.Second() n.List.Set(nil) n.Type = types.Types[TINT] - n.Left = typecheck(n.Left, Erv) - n.Right = typecheck(n.Right, Erv) + n.Left = typecheck(n.Left, ctxExpr) + n.Right = typecheck(n.Right, ctxExpr) if n.Left.Type == nil || n.Right.Type == nil { n.Type = nil return n @@ -1795,9 +1795,9 @@ func typecheck1(n *Node, top int) (res *Node) { } case OCONV: - ok |= Erv + ok |= ctxExpr checkwidth(n.Type) // ensure width is calculated for backend - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = convlit1(n.Left, n.Type, true, noReuse) t := n.Left.Type if t == nil || n.Type == nil { @@ -1832,17 +1832,17 @@ func typecheck1(n *Node, top int) (res *Node) { // do not convert to []byte literal. See CL 125796. // generated code and compiler memory footprint is better without it. - case OSTRARRAYBYTE: + case OSTR2BYTES: break - case OSTRARRAYRUNE: + case OSTR2RUNES: if n.Left.Op == OLITERAL { n = stringtoruneslit(n) } } case OMAKE: - ok |= Erv + ok |= ctxExpr args := n.List.Slice() if len(args) == 0 { yyerror("missing argument to make") @@ -1875,12 +1875,12 @@ func typecheck1(n *Node, top int) (res *Node) { l = args[i] i++ - l = typecheck(l, Erv) + l = typecheck(l, ctxExpr) var r *Node if i < len(args) { r = args[i] i++ - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) } if l.Type == nil || (r != nil && r.Type == nil) { @@ -1905,7 +1905,7 @@ func typecheck1(n *Node, top int) (res *Node) { if i < len(args) { l = args[i] i++ - l = typecheck(l, Erv) + l = typecheck(l, ctxExpr) l = defaultlit(l, types.Types[TINT]) if l.Type == nil { n.Type = nil @@ -1926,7 +1926,7 @@ func typecheck1(n *Node, top int) (res *Node) { if i < len(args) { l = args[i] i++ - l = typecheck(l, Erv) + l = typecheck(l, ctxExpr) l = defaultlit(l, types.Types[TINT]) if l.Type == nil { n.Type = nil @@ -1953,7 +1953,7 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = t case ONEW: - ok |= Erv + ok |= ctxExpr args := n.List if args.Len() == 0 { yyerror("missing argument to new") @@ -1978,8 +1978,8 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = types.NewPtr(t) case OPRINT, OPRINTN: - ok |= Etop - typecheckslice(n.List.Slice(), Erv) + ok |= ctxStmt + typecheckslice(n.List.Slice(), ctxExpr) ls := n.List.Slice() for i1, n1 := range ls { // Special case for print: int constant is int64, not int. @@ -1991,12 +1991,12 @@ func typecheck1(n *Node, top int) (res *Node) { } case OPANIC: - ok |= Etop + ok |= ctxStmt if !onearg(n, "panic") { n.Type = nil return n } - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, types.Types[TINTER]) if n.Left.Type == nil { n.Type = nil @@ -2004,7 +2004,7 @@ func typecheck1(n *Node, top int) (res *Node) { } case ORECOVER: - ok |= Erv | Etop + ok |= ctxExpr | ctxStmt if n.List.Len() != 0 { yyerror("too many arguments to recover") n.Type = nil @@ -2014,15 +2014,15 @@ func typecheck1(n *Node, top int) (res *Node) { n.Type = types.Types[TINTER] case OCLOSURE: - ok |= Erv + ok |= ctxExpr typecheckclosure(n, top) if n.Type == nil { return n } case OITAB: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) t := n.Left.Type if t == nil { n.Type = nil @@ -2039,8 +2039,8 @@ func typecheck1(n *Node, top int) (res *Node) { Fatalf("cannot typecheck interface data %v", n) case OSPTR: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) t := n.Left.Type if t == nil { n.Type = nil @@ -2056,20 +2056,20 @@ func typecheck1(n *Node, top int) (res *Node) { } case OCLOSUREVAR: - ok |= Erv + ok |= ctxExpr case OCFUNC: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) n.Type = types.Types[TUINTPTR] case OCONVNOP: - ok |= Erv - n.Left = typecheck(n.Left, Erv) + ok |= ctxExpr + n.Left = typecheck(n.Left, ctxExpr) // statements case OAS: - ok |= Etop + ok |= ctxStmt typecheckas(n) @@ -2079,7 +2079,7 @@ func typecheck1(n *Node, top int) (res *Node) { } case OAS2: - ok |= Etop + ok |= ctxStmt typecheckas2(n) case OBREAK, @@ -2090,10 +2090,10 @@ func typecheck1(n *Node, top int) (res *Node) { OFALL, OVARKILL, OVARLIVE: - ok |= Etop + ok |= ctxStmt case OLABEL: - ok |= Etop + ok |= ctxStmt decldepth++ if n.Sym.IsBlank() { // Empty identifier is valid but useless. @@ -2104,22 +2104,22 @@ func typecheck1(n *Node, top int) (res *Node) { } case ODEFER: - ok |= Etop - n.Left = typecheck(n.Left, Etop|Erv) + ok |= ctxStmt + n.Left = typecheck(n.Left, ctxStmt|ctxExpr) if !n.Left.Diag() { checkdefergo(n) } - case OPROC: - ok |= Etop - n.Left = typecheck(n.Left, Etop|Erv) + case OGO: + ok |= ctxStmt + n.Left = typecheck(n.Left, ctxStmt|ctxExpr) checkdefergo(n) case OFOR, OFORUNTIL: - ok |= Etop - typecheckslice(n.Ninit.Slice(), Etop) + ok |= ctxStmt + typecheckslice(n.Ninit.Slice(), ctxStmt) decldepth++ - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) if n.Left != nil { t := n.Left.Type @@ -2127,17 +2127,17 @@ func typecheck1(n *Node, top int) (res *Node) { yyerror("non-bool %L used as for condition", n.Left) } } - n.Right = typecheck(n.Right, Etop) + n.Right = typecheck(n.Right, ctxStmt) if n.Op == OFORUNTIL { - typecheckslice(n.List.Slice(), Etop) + typecheckslice(n.List.Slice(), ctxStmt) } - typecheckslice(n.Nbody.Slice(), Etop) + typecheckslice(n.Nbody.Slice(), ctxStmt) decldepth-- case OIF: - ok |= Etop - typecheckslice(n.Ninit.Slice(), Etop) - n.Left = typecheck(n.Left, Erv) + ok |= ctxStmt + typecheckslice(n.Ninit.Slice(), ctxStmt) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) if n.Left != nil { t := n.Left.Type @@ -2145,15 +2145,15 @@ func typecheck1(n *Node, top int) (res *Node) { yyerror("non-bool %L used as if condition", n.Left) } } - typecheckslice(n.Nbody.Slice(), Etop) - typecheckslice(n.Rlist.Slice(), Etop) + typecheckslice(n.Nbody.Slice(), ctxStmt) + typecheckslice(n.Rlist.Slice(), ctxStmt) case ORETURN: - ok |= Etop + ok |= ctxStmt if n.List.Len() == 1 { - typecheckslice(n.List.Slice(), Erv|Efnstruct) + typecheckslice(n.List.Slice(), ctxExpr|ctxMultiOK) } else { - typecheckslice(n.List.Slice(), Erv) + typecheckslice(n.List.Slice(), ctxExpr) } if Curfn == nil { yyerror("return outside function") @@ -2167,18 +2167,18 @@ func typecheck1(n *Node, top int) (res *Node) { typecheckaste(ORETURN, nil, false, Curfn.Type.Results(), n.List, func() string { return "return argument" }) case ORETJMP: - ok |= Etop + ok |= ctxStmt case OSELECT: - ok |= Etop + ok |= ctxStmt typecheckselect(n) case OSWITCH: - ok |= Etop + ok |= ctxStmt typecheckswitch(n) case ORANGE: - ok |= Etop + ok |= ctxStmt typecheckrange(n) case OTYPESW: @@ -2187,20 +2187,20 @@ func typecheck1(n *Node, top int) (res *Node) { return n case OXCASE: - ok |= Etop - typecheckslice(n.List.Slice(), Erv) - typecheckslice(n.Nbody.Slice(), Etop) + ok |= ctxStmt + typecheckslice(n.List.Slice(), ctxExpr) + typecheckslice(n.Nbody.Slice(), ctxStmt) case ODCLFUNC: - ok |= Etop + ok |= ctxStmt typecheckfunc(n) case ODCLCONST: - ok |= Etop - n.Left = typecheck(n.Left, Erv) + ok |= ctxStmt + n.Left = typecheck(n.Left, ctxExpr) case ODCLTYPE: - ok |= Etop + ok |= ctxStmt n.Left = typecheck(n.Left, Etype) checkwidth(n.Left.Type) if n.Left.Type != nil && n.Left.Type.NotInHeap() && n.Left.Name.Param.Pragma&NotInHeap == 0 { @@ -2232,20 +2232,20 @@ func typecheck1(n *Node, top int) (res *Node) { return n } - if top&(Erv|Etype) == Etype && n.Op != OTYPE { + if top&(ctxExpr|Etype) == Etype && n.Op != OTYPE { yyerror("%v is not a type", n) n.Type = nil return n } // TODO(rsc): simplify - if (top&(Ecall|Erv|Etype) != 0) && top&Etop == 0 && ok&(Erv|Etype|Ecall) == 0 { + if (top&(ctxCallee|ctxExpr|Etype) != 0) && top&ctxStmt == 0 && ok&(ctxExpr|Etype|ctxCallee) == 0 { yyerror("%v used as value", n) n.Type = nil return n } - if (top&Etop != 0) && top&(Ecall|Erv|Etype) == 0 && ok&Etop == 0 { + if (top&ctxStmt != 0) && top&(ctxCallee|ctxExpr|Etype) == 0 && ok&ctxStmt == 0 { if !n.Diag() { yyerror("%v evaluated but not used", n) n.SetDiag(true) @@ -2298,7 +2298,7 @@ func checksliceconst(lo *Node, hi *Node) bool { func checkdefergo(n *Node) { what := "defer" - if n.Op == OPROC { + if n.Op == OGO { what = "go" } @@ -2364,9 +2364,9 @@ func implicitstar(n *Node) *Node { if !t.IsArray() { return n } - n = nod(OIND, n, nil) + n = nod(ODEREF, n, nil) n.SetImplicit(true) - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) return n } @@ -2576,9 +2576,9 @@ func lookdot(n *Node, t *types.Type, dostrcmp int) *types.Field { } if t.IsInterface() { if n.Left.Type.IsPtr() { - n.Left = nod(OIND, n.Left, nil) // implicitstar + n.Left = nod(ODEREF, n.Left, nil) // implicitstar n.Left.SetImplicit(true) - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) } n.Op = ODOTINTER @@ -2600,11 +2600,11 @@ func lookdot(n *Node, t *types.Type, dostrcmp int) *types.Field { checklvalue(n.Left, "call pointer method on") n.Left = nod(OADDR, n.Left, nil) n.Left.SetImplicit(true) - n.Left = typecheck(n.Left, Etype|Erv) + n.Left = typecheck(n.Left, Etype|ctxExpr) } else if tt.IsPtr() && !rcvr.IsPtr() && types.Identical(tt.Elem(), rcvr) { - n.Left = nod(OIND, n.Left, nil) + n.Left = nod(ODEREF, n.Left, nil) n.Left.SetImplicit(true) - n.Left = typecheck(n.Left, Etype|Erv) + n.Left = typecheck(n.Left, Etype|ctxExpr) } else if tt.IsPtr() && tt.Elem().IsPtr() && types.Identical(derefall(tt), derefall(rcvr)) { yyerror("calling method %v with receiver %L requires explicit dereference", n.Sym, n.Left) for tt.IsPtr() { @@ -2612,9 +2612,9 @@ func lookdot(n *Node, t *types.Type, dostrcmp int) *types.Field { if rcvr.IsPtr() && !tt.Elem().IsPtr() { break } - n.Left = nod(OIND, n.Left, nil) + n.Left = nod(ODEREF, n.Left, nil) n.Left.SetImplicit(true) - n.Left = typecheck(n.Left, Etype|Erv) + n.Left = typecheck(n.Left, Etype|ctxExpr) tt = tt.Elem() } } else { @@ -2624,7 +2624,7 @@ func lookdot(n *Node, t *types.Type, dostrcmp int) *types.Field { pll := n ll := n.Left - for ll.Left != nil && (ll.Op == ODOT || ll.Op == ODOTPTR || ll.Op == OIND) { + for ll.Left != nil && (ll.Op == ODOT || ll.Op == ODOTPTR || ll.Op == ODEREF) { pll = ll ll = ll.Left } @@ -2657,7 +2657,7 @@ func nokeys(l Nodes) bool { func hasddd(t *types.Type) bool { for _, tl := range t.Fields().Slice() { - if tl.Isddd() { + if tl.IsDDD() { return true } } @@ -2698,7 +2698,7 @@ func typecheckaste(op Op, call *Node, isddd bool, tstruct *types.Type, nl Nodes, rfs := n.Type.FieldSlice() var why string for i, tl := range lfs { - if tl.Isddd() { + if tl.IsDDD() { for _, tn := range rfs[i:] { if assignop(tn.Type, tl.Type.Elem(), &why) == 0 { if call != nil { @@ -2758,7 +2758,7 @@ func typecheckaste(op Op, call *Node, isddd bool, tstruct *types.Type, nl Nodes, i = 0 for _, tl := range tstruct.Fields().Slice() { t = tl.Type - if tl.Isddd() { + if tl.IsDDD() { if isddd { if i >= nl.Len() { goto notenough @@ -3019,7 +3019,7 @@ func typecheckcomplit(n *Node) (res *Node) { norig := n.copy() setlineno(n.Right) - n.Right = typecheck(n.Right, Etype|Ecomplit) + n.Right = typecheck(n.Right, Etype|ctxCompLit) l := n.Right // sic t := l.Type if t == nil { @@ -3031,7 +3031,7 @@ func typecheckcomplit(n *Node) (res *Node) { if t.IsPtr() { // For better or worse, we don't allow pointers as the composite literal type, - // except when using the &T syntax, which sets implicit on the OIND. + // except when using the &T syntax, which sets implicit on the ODEREF. if !n.Right.Implicit() { yyerror("invalid pointer type %v for composite literal (use &%v instead)", t, t.Elem()) n.Type = nil @@ -3071,7 +3071,7 @@ func typecheckcomplit(n *Node) (res *Node) { setlineno(l) vp := &nl[i2] if l.Op == OKEY { - l.Left = typecheck(l.Left, Erv) + l.Left = typecheck(l.Left, ctxExpr) evconst(l.Left) i = nonnegintconst(l.Left) if i < 0 && !l.Left.Diag() { @@ -3092,7 +3092,7 @@ func typecheckcomplit(n *Node) (res *Node) { r := *vp pushtype(r, t.Elem()) - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) r = defaultlit(r, t.Elem()) *vp = assignconv(r, t.Elem(), "array or slice literal") @@ -3123,14 +3123,14 @@ func typecheckcomplit(n *Node) (res *Node) { for i3, l := range n.List.Slice() { setlineno(l) if l.Op != OKEY { - n.List.SetIndex(i3, typecheck(l, Erv)) + n.List.SetIndex(i3, typecheck(l, ctxExpr)) yyerror("missing key in map literal") continue } r := l.Left pushtype(r, t.Key()) - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) r = defaultlit(r, t.Key()) l.Left = assignconv(r, t.Key(), "map key") if l.Left.Op != OCONV { @@ -3139,7 +3139,7 @@ func typecheckcomplit(n *Node) (res *Node) { r = l.Right pushtype(r, t.Elem()) - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) r = defaultlit(r, t.Elem()) l.Right = assignconv(r, t.Elem(), "map value") } @@ -3157,7 +3157,7 @@ func typecheckcomplit(n *Node) (res *Node) { ls := n.List.Slice() for i, n1 := range ls { setlineno(n1) - n1 = typecheck(n1, Erv) + n1 = typecheck(n1, ctxExpr) ls[i] = n1 if i >= t.NumFields() { if !errored { @@ -3202,7 +3202,7 @@ func typecheckcomplit(n *Node) (res *Node) { // is never a valid struct literal key. if key.Sym == nil || key.Op == OXDOT || key.Sym.IsBlank() { yyerror("invalid field name %v in struct initializer", key) - l.Left = typecheck(l.Left, Erv) + l.Left = typecheck(l.Left, ctxExpr) continue } @@ -3224,7 +3224,7 @@ func typecheckcomplit(n *Node) (res *Node) { yyerror("mixture of field:value and value initializers") errored = true } - ls[i] = typecheck(ls[i], Erv) + ls[i] = typecheck(ls[i], ctxExpr) continue } @@ -3256,7 +3256,7 @@ func typecheckcomplit(n *Node) (res *Node) { l.Xoffset = f.Offset // No pushtype allowed here. Tried and rejected. - l.Left = typecheck(l.Left, Erv) + l.Left = typecheck(l.Left, ctxExpr) l.Left = assignconv(l.Left, f.Type, "field value") } } @@ -3298,7 +3298,7 @@ func islvalue(n *Node) bool { return false } fallthrough - case OIND, ODOTPTR, OCLOSUREVAR: + case ODEREF, ODOTPTR, OCLOSUREVAR: return true case ODOT: @@ -3392,8 +3392,8 @@ func samesafeexpr(l *Node, r *Node) bool { case ODOT, ODOTPTR: return l.Sym != nil && r.Sym != nil && l.Sym == r.Sym && samesafeexpr(l.Left, r.Left) - case OIND, OCONVNOP, - ONOT, OCOM, OPLUS, OMINUS: + case ODEREF, OCONVNOP, + ONOT, OBITNOT, OPLUS, ONEG: return samesafeexpr(l.Left, r.Left) case OCONV: @@ -3430,12 +3430,12 @@ func typecheckas(n *Node) { n.Left = resolve(n.Left) if n.Left.Name == nil || n.Left.Name.Defn != n || n.Left.Name.Param.Ntype != nil { - n.Left = typecheck(n.Left, Erv|Easgn) + n.Left = typecheck(n.Left, ctxExpr|ctxAssign) } - // Use Efnstruct so we can emit an "N variables but M values" error + // Use ctxMultiOK so we can emit an "N variables but M values" error // to be consistent with typecheckas2 (#26616). - n.Right = typecheck(n.Right, Erv|Efnstruct) + n.Right = typecheck(n.Right, ctxExpr|ctxMultiOK) checkassign(n, n.Left) if n.Right != nil && n.Right.Type != nil { if n.Right.Type.IsFuncArgStruct() { @@ -3459,7 +3459,7 @@ func typecheckas(n *Node) { n.SetTypecheck(1) if n.Left.Typecheck() == 0 { - n.Left = typecheck(n.Left, Erv|Easgn) + n.Left = typecheck(n.Left, ctxExpr|ctxAssign) } if !n.Left.isBlank() { checkwidth(n.Left.Type) // ensure width is calculated for backend @@ -3487,16 +3487,16 @@ func typecheckas2(n *Node) { ls[i1] = n1 if n1.Name == nil || n1.Name.Defn != n || n1.Name.Param.Ntype != nil { - ls[i1] = typecheck(ls[i1], Erv|Easgn) + ls[i1] = typecheck(ls[i1], ctxExpr|ctxAssign) } } cl := n.List.Len() cr := n.Rlist.Len() if cl > 1 && cr == 1 { - n.Rlist.SetFirst(typecheck(n.Rlist.First(), Erv|Efnstruct)) + n.Rlist.SetFirst(typecheck(n.Rlist.First(), ctxExpr|ctxMultiOK)) } else { - typecheckslice(n.Rlist.Slice(), Erv) + typecheckslice(n.Rlist.Slice(), ctxExpr) } checkassignlist(n, n.List) @@ -3601,7 +3601,7 @@ out: ls = n.List.Slice() for i1, n1 := range ls { if n1.Typecheck() == 0 { - ls[i1] = typecheck(ls[i1], Erv|Easgn) + ls[i1] = typecheck(ls[i1], ctxExpr|ctxAssign) } } } @@ -3618,7 +3618,7 @@ func typecheckfunc(n *Node) { } } - n.Func.Nname = typecheck(n.Func.Nname, Erv|Easgn) + n.Func.Nname = typecheck(n.Func.Nname, ctxExpr|ctxAssign) t := n.Func.Nname.Type if t == nil { return @@ -3658,7 +3658,7 @@ func stringtoruneslit(n *Node) *Node { nn := nod(OCOMPLIT, nil, typenod(n.Type)) nn.List.Set(l) - nn = typecheck(nn, Erv) + nn = typecheck(nn, ctxExpr) return nn } @@ -3810,7 +3810,7 @@ func typecheckdef(n *Node) { yyerrorl(n.Pos, "xxx") } - e = typecheck(e, Erv) + e = typecheck(e, ctxExpr) if Isconst(e, CTNIL) { yyerrorl(n.Pos, "const initializer cannot be nil") goto ret @@ -3872,12 +3872,12 @@ func typecheckdef(n *Node) { } if n.Name.Defn.Op == ONAME { - n.Name.Defn = typecheck(n.Name.Defn, Erv) + n.Name.Defn = typecheck(n.Name.Defn, ctxExpr) n.Type = n.Name.Defn.Type break } - n.Name.Defn = typecheck(n.Name.Defn, Etop) // fills in n.Type + n.Name.Defn = typecheck(n.Name.Defn, ctxStmt) // fills in n.Type case OTYPE: if p := n.Name.Param; p.Alias { diff --git a/src/cmd/compile/internal/gc/universe.go b/src/cmd/compile/internal/gc/universe.go index 760a8e40b0f5b..745ce66bba240 100644 --- a/src/cmd/compile/internal/gc/universe.go +++ b/src/cmd/compile/internal/gc/universe.go @@ -294,8 +294,8 @@ func typeinit() { okfor[ORSH] = okforand[:] // unary - okfor[OCOM] = okforand[:] - okfor[OMINUS] = okforarith[:] + okfor[OBITNOT] = okforand[:] + okfor[ONEG] = okforarith[:] okfor[ONOT] = okforbool[:] okfor[OPLUS] = okforarith[:] diff --git a/src/cmd/compile/internal/gc/unsafe.go b/src/cmd/compile/internal/gc/unsafe.go index 14ab33b0b6c9b..2233961561230 100644 --- a/src/cmd/compile/internal/gc/unsafe.go +++ b/src/cmd/compile/internal/gc/unsafe.go @@ -8,7 +8,7 @@ package gc func evalunsafe(n *Node) int64 { switch n.Op { case OALIGNOF, OSIZEOF: - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) n.Left = defaultlit(n.Left, nil) tr := n.Left.Type if tr == nil { @@ -30,10 +30,10 @@ func evalunsafe(n *Node) int64 { // Remember base of selector to find it back after dot insertion. // Since r->left may be mutated by typechecking, check it explicitly // first to track it correctly. - n.Left.Left = typecheck(n.Left.Left, Erv) + n.Left.Left = typecheck(n.Left.Left, ctxExpr) base := n.Left.Left - n.Left = typecheck(n.Left, Erv) + n.Left = typecheck(n.Left, ctxExpr) if n.Left.Type == nil { return 0 } diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index 5056212984ca8..e3fd71e389938 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -29,7 +29,7 @@ func walk(fn *Node) { // Final typecheck for any unused variables. for i, ln := range fn.Func.Dcl { if ln.Op == ONAME && (ln.Class() == PAUTO || ln.Class() == PAUTOHEAP) { - ln = typecheck(ln, Erv|Easgn) + ln = typecheck(ln, ctxExpr|ctxAssign) fn.Func.Dcl[i] = ln } } @@ -201,7 +201,7 @@ func walkstmt(n *Node) *Node { } nn := nod(OAS, v.Name.Param.Heapaddr, prealloc[v]) nn.SetColas(true) - nn = typecheck(nn, Etop) + nn = typecheck(nn, ctxStmt) return walkstmt(nn) } @@ -219,7 +219,7 @@ func walkstmt(n *Node) *Node { case ODEFER: Curfn.Func.SetHasDefer(true) fallthrough - case OPROC: + case OGO: switch n.Left.Op { case OPRINT, OPRINTN: n.Left = wrapCall(n.Left, &n.Ninit) @@ -274,7 +274,7 @@ func walkstmt(n *Node) *Node { } if cl == PPARAMOUT { if ln.isParamStackCopy() { - ln = walkexpr(typecheck(nod(OIND, ln.Name.Param.Heapaddr, nil), Erv), nil) + ln = walkexpr(typecheck(nod(ODEREF, ln.Name.Param.Heapaddr, nil), ctxExpr), nil) } rl = append(rl, ln) } @@ -461,8 +461,8 @@ func walkexpr(n *Node, init *Nodes) *Node { } if n.Op == ONAME && n.Class() == PAUTOHEAP { - nn := nod(OIND, n.Name.Param.Heapaddr, nil) - nn = typecheck(nn, Erv) + nn := nod(ODEREF, n.Name.Param.Heapaddr, nil) + nn = typecheck(nn, ctxExpr) nn = walkexpr(nn, init) nn.Left.SetNonNil(true) return nn @@ -482,8 +482,8 @@ opswitch: // If these return early, make sure to still call // stringsym for constant strings. - case ONOT, OMINUS, OPLUS, OCOM, OREAL, OIMAG, ODOTMETH, ODOTINTER, - OIND, OSPTR, OITAB, OIDATA, OADDR: + case ONOT, ONEG, OPLUS, OBITNOT, OREAL, OIMAG, ODOTMETH, ODOTINTER, + ODEREF, OSPTR, OITAB, OIDATA, OADDR: n.Left = walkexpr(n.Left, init) case OEFACE, OAND, OSUB, OMUL, OADD, OOR, OXOR, OLSH, ORSH: @@ -623,7 +623,7 @@ opswitch: if n.Op == OASOP { // Rewrite x op= y into x = x op y. n.Right = nod(n.SubOp(), n.Left, n.Right) - n.Right = typecheck(n.Right, Erv) + n.Right = typecheck(n.Right, ctxExpr) n.Op = OAS n.ResetAux() @@ -667,7 +667,7 @@ opswitch: case isAppendOfMake(r): // x = append(y, make([]T, y)...) r = extendslice(r, init) - case r.Isddd(): + case r.IsDDD(): r = appendslice(r, init) // also works for append(slice, string). default: r = walkappend(r, init, n) @@ -731,7 +731,7 @@ opswitch: ok := n.List.Second() call := mkcall1(fn, ok.Type, init, r.Left, n1) n = nod(OAS, ok, call) - n = typecheck(n, Etop) + n = typecheck(n, ctxStmt) // a,b = m[i] case OAS2MAPR: @@ -787,10 +787,10 @@ opswitch: n.List.SetFirst(var_) n = walkexpr(n, init) init.Append(n) - n = nod(OAS, a, nod(OIND, var_, nil)) + n = nod(OAS, a, nod(ODEREF, var_, nil)) } - n = typecheck(n, Etop) + n = typecheck(n, ctxStmt) n = walkexpr(n, init) case ODELETE: @@ -864,13 +864,13 @@ opswitch: case !fromType.IsInterface() && n.Esc == EscNone && fromType.Width <= 1024: // n.Left does not escape. Use a stack temporary initialized to n.Left. value = temp(fromType) - init.Append(typecheck(nod(OAS, value, n.Left), Etop)) + init.Append(typecheck(nod(OAS, value, n.Left), ctxStmt)) } if value != nil { // Value is identical to n.Left. // Construct the interface directly: {type/itab, &value}. - l := nod(OEFACE, typeword(), typecheck(nod(OADDR, value, nil), Erv)) + l := nod(OEFACE, typeword(), typecheck(nod(OADDR, value, nil), ctxExpr)) l.Type = toType l.SetTypecheck(n.Typecheck()) n = l @@ -890,10 +890,10 @@ opswitch: // Get the itab out of the interface. tmp := temp(types.NewPtr(types.Types[TUINT8])) - init.Append(nod(OAS, tmp, typecheck(nod(OITAB, c, nil), Erv))) + init.Append(nod(OAS, tmp, typecheck(nod(OITAB, c, nil), ctxExpr))) // Get the type out of the itab. - nif := nod(OIF, typecheck(nod(ONE, tmp, nodnil()), Erv), nil) + nif := nod(OIF, typecheck(nod(ONE, tmp, nodnil()), ctxExpr), nil) nif.Nbody.Set1(nod(OAS, tmp, itabType(tmp))) init.Append(nif) @@ -917,7 +917,7 @@ opswitch: dowidth(fn.Type) call := nod(OCALL, fn, nil) call.List.Set1(n.Left) - call = typecheck(call, Erv) + call = typecheck(call, ctxExpr) call = walkexpr(call, init) call = safeexpr(call, init) e := nod(OEFACE, typeword(), call) @@ -956,7 +956,7 @@ opswitch: dowidth(fn.Type) n = nod(OCALL, fn, nil) n.List.Set2(tab, v) - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) n = walkexpr(n, init) case OCONV, OCONVNOP: @@ -971,8 +971,8 @@ opswitch: case OANDNOT: n.Left = walkexpr(n.Left, init) n.Op = OAND - n.Right = nod(OCOM, n.Right, nil) - n.Right = typecheck(n.Right, Erv) + n.Right = nod(OBITNOT, n.Right, nil) + n.Right = typecheck(n.Right, ctxExpr) n.Right = walkexpr(n.Right, init) case ODIV, OMOD: @@ -1107,7 +1107,7 @@ opswitch: } n.Type = types.NewPtr(t.Elem()) n.SetNonNil(true) // mapaccess1* and mapassign always return non-nil pointers. - n = nod(OIND, n, nil) + n = nod(ODEREF, n, nil) n.Type = t.Elem() n.SetTypecheck(1) @@ -1151,10 +1151,10 @@ opswitch: } r := temp(n.Type.Elem()) r = nod(OAS, r, nil) // zero temp - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) init.Append(r) r = nod(OADDR, r.Left, nil) - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) n = r } else { n = callnew(n.Type.Elem()) @@ -1207,7 +1207,7 @@ opswitch: // var hv hmap hv := temp(hmapType) zero := nod(OAS, hv, nil) - zero = typecheck(zero, Etop) + zero = typecheck(zero, ctxStmt) init.Append(zero) // h = &hv h = nod(OADDR, hv, nil) @@ -1223,7 +1223,7 @@ opswitch: bv := temp(bmap(t)) zero = nod(OAS, bv, nil) - zero = typecheck(zero, Etop) + zero = typecheck(zero, ctxStmt) init.Append(zero) // b = &bv @@ -1232,7 +1232,7 @@ opswitch: // h.buckets = b bsym := hmapType.Field(5).Sym // hmap.buckets see reflect.go:hmap na := nod(OAS, nodSym(ODOT, h, bsym), b) - na = typecheck(na, Etop) + na = typecheck(na, ctxStmt) init.Append(na) } } @@ -1252,7 +1252,7 @@ opswitch: rand := mkcall("fastrand", types.Types[TUINT32], init) hashsym := hmapType.Field(4).Sym // hmap.hash0 see reflect.go:hmap a := nod(OAS, nodSym(ODOT, h, hashsym), rand) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) init.Append(a) n = convnop(h, t) @@ -1308,12 +1308,12 @@ opswitch: t = types.NewArray(t.Elem(), nonnegintconst(r)) // [r]T var_ := temp(t) a := nod(OAS, var_, nil) // zero temp - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) init.Append(a) r := nod(OSLICE, var_, nil) // arr[:l] r.SetSliceBounds(nil, l, nil) r = conv(r, n.Type) // in case n.Type is named. - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) r = walkexpr(r, init) n = r } else { @@ -1347,7 +1347,7 @@ opswitch: m.Left.SetNonNil(true) m.List.Set2(conv(len, types.Types[TINT]), conv(cap, types.Types[TINT])) - m = typecheck(m, Erv) + m = typecheck(m, ctxExpr) m = walkexpr(m, init) n = m } @@ -1363,7 +1363,7 @@ opswitch: // intstring(*[4]byte, rune) n = mkcall("intstring", n.Type, init, a, conv(n.Left, types.Types[TINT64])) - case OARRAYBYTESTR: + case OBYTES2STR: a := nodnil() if n.Esc == EscNone { // Create temporary buffer for string on stack. @@ -1376,11 +1376,11 @@ opswitch: n = mkcall("slicebytetostring", n.Type, init, a, n.Left) // slicebytetostringtmp([]byte) string; - case OARRAYBYTESTRTMP: + case OBYTES2STRTMP: n.Left = walkexpr(n.Left, init) if !instrumenting { - // Let the backend handle OARRAYBYTESTRTMP directly + // Let the backend handle OBYTES2STRTMP directly // to avoid a function call to slicebytetostringtmp. break } @@ -1388,7 +1388,7 @@ opswitch: n = mkcall("slicebytetostringtmp", n.Type, init, n.Left) // slicerunetostring(*[32]byte, []rune) string; - case OARRAYRUNESTR: + case ORUNES2STR: a := nodnil() if n.Esc == EscNone { @@ -1400,7 +1400,7 @@ opswitch: n = mkcall("slicerunetostring", n.Type, init, a, n.Left) - case OSTRARRAYBYTE: + case OSTR2BYTES: s := n.Left if Isconst(s, CTSTR) { sc := s.Val().U.(string) @@ -1414,14 +1414,14 @@ opswitch: a = callnew(t) } p := temp(t.PtrTo()) // *[n]byte - init.Append(typecheck(nod(OAS, p, a), Etop)) + init.Append(typecheck(nod(OAS, p, a), ctxStmt)) // Copy from the static string data to the [n]byte. if len(sc) > 0 { as := nod(OAS, - nod(OIND, p, nil), - nod(OIND, convnop(nod(OSPTR, s, nil), t.PtrTo()), nil)) - as = typecheck(as, Etop) + nod(ODEREF, p, nil), + nod(ODEREF, convnop(nod(OSPTR, s, nil), t.PtrTo()), nil)) + as = typecheck(as, ctxStmt) as = walkstmt(as) init.Append(as) } @@ -1444,7 +1444,7 @@ opswitch: // stringtoslicebyte(*32[byte], string) []byte; n = mkcall("stringtoslicebyte", n.Type, init, a, conv(s, types.Types[TSTRING])) - case OSTRARRAYBYTETMP: + case OSTR2BYTESTMP: // []byte(string) conversion that creates a slice // referring to the actual string bytes. // This conversion is handled later by the backend and @@ -1455,7 +1455,7 @@ opswitch: n.Left = walkexpr(n.Left, init) // stringtoslicerune(*[32]rune, string) []rune - case OSTRARRAYRUNE: + case OSTR2RUNES: a := nodnil() if n.Esc == EscNone { @@ -1475,7 +1475,7 @@ opswitch: vstat.Name.SetReadonly(true) fixedlit(inInitFunction, initKindStatic, n, vstat, init) n = vstat - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) break } var_ := temp(n.Type) @@ -1507,7 +1507,7 @@ opswitch: Fatalf("evconst changed Type: %v had type %v, now %v", n, t, n.Type) } if n.Op == OLITERAL { - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) // Emit string symbol now to avoid emitting // any concurrently during the backend. if s, ok := n.Val().U.(string); ok { @@ -1668,7 +1668,7 @@ func ascompatet(nl Nodes, nr *types.Type) []*Node { // deferred until all the returned values have been read. if fncall(l, r.Type) { tmp := temp(r.Type) - tmp = typecheck(tmp, Erv) + tmp = typecheck(tmp, ctxExpr) a := nod(OAS, l, tmp) a = convas(a, &mm) mm.Append(a) @@ -1733,7 +1733,7 @@ func mkdotargslice(typ *types.Type, args []*Node, init *Nodes, ddd *Node) *Node } n.List.Set(args) n.Esc = esc - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) if n.Type == nil { Fatalf("mkdotargslice: typecheck failed") } @@ -1754,7 +1754,7 @@ func walkCall(n *Node, init *Nodes) { // parameter) and this is not a ... call expression, // then assign the remaining arguments as a slice. if nf := params.NumFields(); nf > 0 { - if last := params.Field(nf - 1); last.Isddd() && !n.Isddd() { + if last := params.Field(nf - 1); last.IsDDD() && !n.IsDDD() { tail := args[nf-1:] slice := mkdotargslice(last.Type, tail, init, n.Right) // Allow immediate GC. @@ -1930,11 +1930,11 @@ func walkprint(nn *Node, init *Nodes) *Node { calls = append(calls, mkcall("printunlock", nil, init)) - typecheckslice(calls, Etop) + typecheckslice(calls, ctxStmt) walkexprlist(calls, init) r := nod(OEMPTY, nil, nil) - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) r = walkexpr(r, init) r.Ninit.Set(calls) return r @@ -2054,7 +2054,7 @@ func reorder3(all []*Node) []*Node { all[i] = convas(all[i], &mapinit) } - case OIND, ODOTPTR: + case ODEREF, ODOTPTR: l.Left = reorder3save(l.Left, all, i, &early) } @@ -2079,7 +2079,7 @@ func reorder3save(n *Node, all []*Node, i int, early *[]*Node) *Node { q := temp(n.Type) q = nod(OAS, q, n) - q = typecheck(q, Etop) + q = typecheck(q, ctxStmt) *early = append(*early, q) return q.Left } @@ -2210,8 +2210,8 @@ func varexpr(n *Node) bool { OAND, OANDNOT, OPLUS, - OMINUS, - OCOM, + ONEG, + OBITNOT, OPAREN, OANDAND, OOROR, @@ -2315,7 +2315,7 @@ func paramstoheap(params *types.Type) []*Node { if stackcopy := v.Name.Param.Stackcopy; stackcopy != nil { nn = append(nn, walkstmt(nod(ODCL, v, nil))) if stackcopy.Class() == PPARAM { - nn = append(nn, walkstmt(typecheck(nod(OAS, v, stackcopy), Etop))) + nn = append(nn, walkstmt(typecheck(nod(OAS, v, stackcopy), ctxStmt))) } } } @@ -2363,7 +2363,7 @@ func returnsfromheap(params *types.Type) []*Node { continue } if stackcopy := v.Name.Param.Stackcopy; stackcopy != nil && stackcopy.Class() == PPARAMOUT { - nn = append(nn, walkstmt(typecheck(nod(OAS, stackcopy, v), Etop))) + nn = append(nn, walkstmt(typecheck(nod(OAS, stackcopy, v), ctxStmt))) } } @@ -2398,9 +2398,9 @@ func vmkcall(fn *Node, t *types.Type, init *Nodes, va []*Node) *Node { r := nod(OCALL, fn, nil) r.List.Set(va) if fn.Type.NumResults() > 0 { - r = typecheck(r, Erv|Efnstruct) + r = typecheck(r, ctxExpr|ctxMultiOK) } else { - r = typecheck(r, Etop) + r = typecheck(r, ctxStmt) } r = walkexpr(r, init) r.Type = t @@ -2421,16 +2421,16 @@ func conv(n *Node, t *types.Type) *Node { } n = nod(OCONV, n, nil) n.Type = t - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) return n } // convnop converts node n to type t using the OCONVNOP op -// and typechecks the result with Erv. +// and typechecks the result with ctxExpr. func convnop(n *Node, t *types.Type) *Node { n = nod(OCONVNOP, n, nil) n.Type = t - n = typecheck(n, Erv) + n = typecheck(n, ctxExpr) return n } @@ -2591,7 +2591,7 @@ func addstr(n *Node, init *Nodes) *Node { cat := syslook(fn) r := nod(OCALL, cat, nil) r.List.Set(args) - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) r = walkexpr(r, init) r.Type = n.Type @@ -2715,7 +2715,7 @@ func appendslice(n *Node, init *Nodes) *Node { } ln := append(nodes.Slice(), ncopy) - typecheckslice(ln, Etop) + typecheckslice(ln, ctxStmt) walkstmtlist(ln) init.Append(ln...) return s @@ -2732,7 +2732,7 @@ func isAppendOfMake(n *Node) bool { Fatalf("missing typecheck: %+v", n) } - if n.Op != OAPPEND || !n.Isddd() || n.List.Len() != 2 { + if n.Op != OAPPEND || !n.IsDDD() || n.List.Len() != 2 { return false } @@ -2785,7 +2785,7 @@ func isAppendOfMake(n *Node) bool { func extendslice(n *Node, init *Nodes) *Node { // isAppendOfMake made sure l2 fits in an int. l2 := conv(n.List.Second().Left, types.Types[TINT]) - l2 = typecheck(l2, Erv) + l2 = typecheck(l2, ctxExpr) n.List.SetSecond(l2) // walkAppendArgs expects l2 in n.List.Second(). walkAppendArgs(n, init) @@ -2871,7 +2871,7 @@ func extendslice(n *Node, init *Nodes) *Node { nodes = append(nodes, clr.Slice()...) } - typecheckslice(nodes, Etop) + typecheckslice(nodes, ctxStmt) walkstmtlist(nodes) init.Append(nodes...) return s @@ -2970,7 +2970,7 @@ func walkappend(n *Node, init *Nodes, dst *Node) *Node { } } - typecheckslice(l, Etop) + typecheckslice(l, ctxStmt) walkstmtlist(l) init.Append(l...) return ns @@ -3043,7 +3043,7 @@ func copyany(n *Node, init *Nodes, runtimecall bool) *Node { call := mkcall1(fn, nil, init, nto, nfrm, nwid) ne.Nbody.Append(call) - typecheckslice(l, Etop) + typecheckslice(l, ctxStmt) walkstmtlist(l) init.Append(l...) return nlen @@ -3189,12 +3189,12 @@ func walkcompare(n *Node, init *Nodes) *Node { // eq algs take pointers pl := temp(types.NewPtr(t)) al := nod(OAS, pl, nod(OADDR, cmpl, nil)) - al = typecheck(al, Etop) + al = typecheck(al, ctxStmt) init.Append(al) pr := temp(types.NewPtr(t)) ar := nod(OAS, pr, nod(OADDR, cmpr, nil)) - ar = typecheck(ar, Etop) + ar = typecheck(ar, ctxStmt) init.Append(ar) fn, needsize := eqfor(t) @@ -3301,9 +3301,9 @@ func walkcompare(n *Node, init *Nodes) *Node { // an expression which might panic. See issue 23837. t := temp(cmpl.Type) a1 := nod(OAS, t, cmpl) - a1 = typecheck(a1, Etop) + a1 = typecheck(a1, ctxStmt) a2 := nod(OAS, t, cmpr) - a2 = typecheck(a2, Etop) + a2 = typecheck(a2, ctxStmt) init.Append(a1, a2) } n = finishcompare(n, expr, init) @@ -3490,7 +3490,7 @@ func walkcompareString(n *Node, init *Nodes) *Node { // The result of finishcompare MUST be assigned back to n, e.g. // n.Left = finishcompare(n.Left, x, r, init) func finishcompare(n, r *Node, init *Nodes) *Node { - r = typecheck(r, Erv) + r = typecheck(r, ctxExpr) r = conv(r, n.Type) r = walkexpr(r, init) return r @@ -3626,7 +3626,7 @@ func walkinrange(n *Node, init *Nodes) *Node { cmp = addinit(cmp, l.Ninit.Slice()) cmp = addinit(cmp, r.Ninit.Slice()) // Typecheck the AST rooted at cmp... - cmp = typecheck(cmp, Erv) + cmp = typecheck(cmp, ctxExpr) // ...but then reset cmp's type to match n's type. cmp.Type = n.Type cmp = walkexpr(cmp, init) @@ -3816,10 +3816,10 @@ func candiscard(n *Node) bool { OADDSTR, OADDR, OANDAND, - OARRAYBYTESTR, - OARRAYRUNESTR, - OSTRARRAYBYTE, - OSTRARRAYRUNE, + OBYTES2STR, + ORUNES2STR, + OSTR2BYTES, + OSTR2RUNES, OCAP, OCOMPLIT, OMAPLIT, @@ -3847,9 +3847,9 @@ func candiscard(n *Node) bool { OANDNOT, ONEW, ONOT, - OCOM, + OBITNOT, OPLUS, - OMINUS, + ONEG, OOROR, OPAREN, ORUNESTR, @@ -3917,19 +3917,19 @@ func wrapCall(n *Node, init *Nodes) *Node { a := nod(n.Op, nil, nil) a.List.Set(paramNnames(t.Type)) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) fn.Nbody.Set1(a) funcbody() - fn = typecheck(fn, Etop) - typecheckslice(fn.Nbody.Slice(), Etop) + fn = typecheck(fn, ctxStmt) + typecheckslice(fn.Nbody.Slice(), ctxStmt) xtop = append(xtop, fn) a = nod(OCALL, nil, nil) a.Left = fn.Func.Nname a.List.Set(n.List.Slice()) - a = typecheck(a, Etop) + a = typecheck(a, ctxStmt) a = walkexpr(a, init) return a } @@ -3970,5 +3970,5 @@ func canMergeLoads() bool { // isRuneCount reports whether n is of the form len([]rune(string)). // These are optimized into a call to runtime.countrunes. func isRuneCount(n *Node) bool { - return Debug['N'] == 0 && !instrumenting && n.Op == OLEN && n.Left.Op == OSTRARRAYRUNE + return Debug['N'] == 0 && !instrumenting && n.Op == OLEN && n.Left.Op == OSTR2RUNES } diff --git a/src/cmd/compile/internal/types/identity.go b/src/cmd/compile/internal/types/identity.go index 2152485257983..7c14a03ba16dd 100644 --- a/src/cmd/compile/internal/types/identity.go +++ b/src/cmd/compile/internal/types/identity.go @@ -92,7 +92,7 @@ func identical(t1, t2 *Type, cmpTags bool, assumedEqual map[typePair]struct{}) b } for i, f1 := range fs1 { f2 := fs2[i] - if f1.Isddd() != f2.Isddd() || !identical(f1.Type, f2.Type, cmpTags, assumedEqual) { + if f1.IsDDD() != f2.IsDDD() || !identical(f1.Type, f2.Type, cmpTags, assumedEqual) { return false } } diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 45355e5798ce3..46a9b816809b5 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -374,16 +374,16 @@ type Field struct { } const ( - fieldIsddd = 1 << iota // field is ... argument + fieldIsDDD = 1 << iota // field is ... argument fieldBroke // broken field definition fieldNointerface ) -func (f *Field) Isddd() bool { return f.flags&fieldIsddd != 0 } +func (f *Field) IsDDD() bool { return f.flags&fieldIsDDD != 0 } func (f *Field) Broke() bool { return f.flags&fieldBroke != 0 } func (f *Field) Nointerface() bool { return f.flags&fieldNointerface != 0 } -func (f *Field) SetIsddd(b bool) { f.flags.set(fieldIsddd, b) } +func (f *Field) SetIsDDD(b bool) { f.flags.set(fieldIsDDD, b) } func (f *Field) SetBroke(b bool) { f.flags.set(fieldBroke, b) } func (f *Field) SetNointerface(b bool) { f.flags.set(fieldNointerface, b) } @@ -743,7 +743,7 @@ func (t *Type) NumResults() int { return t.FuncType().Results.NumFields() } // IsVariadic reports whether function type t is variadic. func (t *Type) IsVariadic() bool { n := t.NumParams() - return n > 0 && t.Params().Field(n-1).Isddd() + return n > 0 && t.Params().Field(n-1).IsDDD() } // Recv returns the receiver of function type t, if any. @@ -1163,8 +1163,8 @@ func (t *Type) cmp(x *Type) Cmp { for i := 0; i < len(tfs) && i < len(xfs); i++ { ta := tfs[i] tb := xfs[i] - if ta.Isddd() != tb.Isddd() { - return cmpForNe(!ta.Isddd()) + if ta.IsDDD() != tb.IsDDD() { + return cmpForNe(!ta.IsDDD()) } if c := ta.Type.cmp(tb.Type); c != CMPeq { return c From 3c92bdc7db3ebf062adc9287743d74e60ba5bb03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 19 Nov 2018 14:18:04 +0000 Subject: [PATCH 084/594] cmd/vendor: update to golang.org/x/tools@139d099f MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mainly to pull the fix for the regression in #28792. Change-Id: If71ae783fd9a9e3935186b49fdf501ba098235a2 Reviewed-on: https://go-review.googlesource.com/c/150161 Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot Reviewed-by: Alan Donovan --- .../go/analysis/passes/composite/composite.go | 2 +- .../analysis/passes/lostcancel/lostcancel.go | 109 +++++++++--------- .../analysis/passes/stdmethods/stdmethods.go | 8 +- .../go/analysis/passes/unsafeptr/unsafeptr.go | 44 +++---- .../go/analysis/unitchecker/unitchecker.go | 2 +- 5 files changed, 87 insertions(+), 78 deletions(-) diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go index b7cfe8a95d365..9cca7781d0044 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go @@ -16,7 +16,7 @@ import ( "golang.org/x/tools/go/ast/inspector" ) -const Doc = `checked for unkeyed composite literals +const Doc = `check for unkeyed composite literals This analyzer reports a diagnostic for composite literals of struct types imported from another package that do not use the field-keyed diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go index 996ecc4dd1e1e..b5161836a57a2 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go @@ -93,32 +93,32 @@ func runFunc(pass *analysis.Pass, node ast.Node) { // ctx, cancel = context.WithCancel(...) // var ctx, cancel = context.WithCancel(...) // - if isContextWithCancel(pass.TypesInfo, n) && isCall(stack[len(stack)-2]) { - var id *ast.Ident // id of cancel var - stmt := stack[len(stack)-3] - switch stmt := stmt.(type) { - case *ast.ValueSpec: - if len(stmt.Names) > 1 { - id = stmt.Names[1] - } - case *ast.AssignStmt: - if len(stmt.Lhs) > 1 { - id, _ = stmt.Lhs[1].(*ast.Ident) - } + if !isContextWithCancel(pass.TypesInfo, n) || !isCall(stack[len(stack)-2]) { + return true + } + var id *ast.Ident // id of cancel var + stmt := stack[len(stack)-3] + switch stmt := stmt.(type) { + case *ast.ValueSpec: + if len(stmt.Names) > 1 { + id = stmt.Names[1] } - if id != nil { - if id.Name == "_" { - pass.Reportf(id.Pos(), - "the cancel function returned by context.%s should be called, not discarded, to avoid a context leak", - n.(*ast.SelectorExpr).Sel.Name) - } else if v, ok := pass.TypesInfo.Uses[id].(*types.Var); ok { - cancelvars[v] = stmt - } else if v, ok := pass.TypesInfo.Defs[id].(*types.Var); ok { - cancelvars[v] = stmt - } + case *ast.AssignStmt: + if len(stmt.Lhs) > 1 { + id, _ = stmt.Lhs[1].(*ast.Ident) + } + } + if id != nil { + if id.Name == "_" { + pass.Reportf(id.Pos(), + "the cancel function returned by context.%s should be called, not discarded, to avoid a context leak", + n.(*ast.SelectorExpr).Sel.Name) + } else if v, ok := pass.TypesInfo.Uses[id].(*types.Var); ok { + cancelvars[v] = stmt + } else if v, ok := pass.TypesInfo.Defs[id].(*types.Var); ok { + cancelvars[v] = stmt } } - return true }) @@ -179,18 +179,22 @@ func hasImport(pkg *types.Package, path string) bool { // isContextWithCancel reports whether n is one of the qualified identifiers // context.With{Cancel,Timeout,Deadline}. func isContextWithCancel(info *types.Info, n ast.Node) bool { - if sel, ok := n.(*ast.SelectorExpr); ok { - switch sel.Sel.Name { - case "WithCancel", "WithTimeout", "WithDeadline": - if x, ok := sel.X.(*ast.Ident); ok { - if pkgname, ok := info.Uses[x].(*types.PkgName); ok { - return pkgname.Imported().Path() == contextPackage - } - // Import failed, so we can't check package path. - // Just check the local package name (heuristic). - return x.Name == "context" - } + sel, ok := n.(*ast.SelectorExpr) + if !ok { + return false + } + switch sel.Sel.Name { + case "WithCancel", "WithTimeout", "WithDeadline": + default: + return false + } + if x, ok := sel.X.(*ast.Ident); ok { + if pkgname, ok := info.Uses[x].(*types.PkgName); ok { + return pkgname.Imported().Path() == contextPackage } + // Import failed, so we can't check package path. + // Just check the local package name (heuristic). + return x.Name == "context" } return false } @@ -270,29 +274,30 @@ outer: var search func(blocks []*cfg.Block) *ast.ReturnStmt search = func(blocks []*cfg.Block) *ast.ReturnStmt { for _, b := range blocks { - if !seen[b] { - seen[b] = true + if seen[b] { + continue + } + seen[b] = true - // Prune the search if the block uses v. - if blockUses(pass, v, b) { - continue - } + // Prune the search if the block uses v. + if blockUses(pass, v, b) { + continue + } - // Found path to return statement? - if ret := b.Return(); ret != nil { - if debug { - fmt.Printf("found path to return in block %s\n", b) - } - return ret // found + // Found path to return statement? + if ret := b.Return(); ret != nil { + if debug { + fmt.Printf("found path to return in block %s\n", b) } + return ret // found + } - // Recur - if ret := search(b.Succs); ret != nil { - if debug { - fmt.Printf(" from block %s\n", b) - } - return ret + // Recur + if ret := search(b.Succs); ret != nil { + if debug { + fmt.Printf(" from block %s\n", b) } + return ret } } return nil diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go index b61c32208bc24..83495112243a4 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go @@ -131,7 +131,7 @@ func canonicalMethod(pass *analysis.Pass, id *ast.Ident) { expectFmt += " (" + argjoin(expect.results) + ")" } - actual := types.TypeString(sign, (*types.Package).Name) + actual := typeString(sign) actual = strings.TrimPrefix(actual, "func") actual = id.Name + actual @@ -139,6 +139,10 @@ func canonicalMethod(pass *analysis.Pass, id *ast.Ident) { } } +func typeString(typ types.Type) string { + return types.TypeString(typ, (*types.Package).Name) +} + func argjoin(x []string) string { y := make([]string, len(x)) for i, s := range x { @@ -178,5 +182,5 @@ func matchParamType(fset *token.FileSet, pkg *types.Package, expect string, actu } // Overkill but easy. - return actual.String() == expect + return typeString(actual) == expect } diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go index 116d622b362af..308bfc69cb44d 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go @@ -62,28 +62,28 @@ func isSafeUintptr(info *types.Info, x ast.Expr) bool { return isSafeUintptr(info, x.X) case *ast.SelectorExpr: - switch x.Sel.Name { - case "Data": - // reflect.SliceHeader and reflect.StringHeader are okay, - // but only if they are pointing at a real slice or string. - // It's not okay to do: - // var x SliceHeader - // x.Data = uintptr(unsafe.Pointer(...)) - // ... use x ... - // p := unsafe.Pointer(x.Data) - // because in the middle the garbage collector doesn't - // see x.Data as a pointer and so x.Data may be dangling - // by the time we get to the conversion at the end. - // For now approximate by saying that *Header is okay - // but Header is not. - pt, ok := info.Types[x.X].Type.(*types.Pointer) - if ok { - t, ok := pt.Elem().(*types.Named) - if ok && t.Obj().Pkg().Path() == "reflect" { - switch t.Obj().Name() { - case "StringHeader", "SliceHeader": - return true - } + if x.Sel.Name != "Data" { + break + } + // reflect.SliceHeader and reflect.StringHeader are okay, + // but only if they are pointing at a real slice or string. + // It's not okay to do: + // var x SliceHeader + // x.Data = uintptr(unsafe.Pointer(...)) + // ... use x ... + // p := unsafe.Pointer(x.Data) + // because in the middle the garbage collector doesn't + // see x.Data as a pointer and so x.Data may be dangling + // by the time we get to the conversion at the end. + // For now approximate by saying that *Header is okay + // but Header is not. + pt, ok := info.Types[x.X].Type.(*types.Pointer) + if ok { + t, ok := pt.Elem().(*types.Named) + if ok && t.Obj().Pkg().Path() == "reflect" { + switch t.Obj().Name() { + case "StringHeader", "SliceHeader": + return true } } } diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index 7b8fec9db28d5..59489f92da16f 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -95,7 +95,7 @@ func Main(analyzers ...*analysis.Analyzer) { Usage of %[1]s: %.16[1]s unit.cfg # execute analysis specified by config file - %.16[1]s help # general help + %.16[1]s help # general help %.16[1]s help name # help on specific analyzer and its flags `, progname) os.Exit(1) From 42b46585f19a6d6b3819d025e0f4b07b18a6b5b7 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 2 Nov 2018 11:27:53 -0400 Subject: [PATCH 085/594] cmd/go: improve go vet documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - restore and rework cmd/vet/doc.go, which was clobbered during the vet-lite switch. - document go vet -vettool=prog flag and how to run an alternative checker. - make 'go vet -help' show how to list vet tool's flags. Example: $ go vet -help usage: go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages] Run 'go help vet' for details. Run 'go tool vet help' for the vet tool's flags. $ go vet -vettool=~/bin/myvet -help usage: go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages] Run 'go help vet' for details. Run '~/bin/myvet help' for the vet tool's flags. Updates #28840 Change-Id: Ieb79dfe29e1df074f865bc9a9d47b44199675d7d Reviewed-on: https://go-review.googlesource.com/c/147018 Reviewed-by: Daniel Martí Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot --- src/cmd/go/alldocs.go | 11 ++++- src/cmd/go/internal/vet/vet.go | 13 +++++- src/cmd/go/internal/vet/vetflag.go | 18 ++++++++ src/cmd/go/testdata/script/help.txt | 1 + src/cmd/vet/doc.go | 71 +++++++++++++++++++++++++++++ src/cmd/vet/main.go | 20 -------- 6 files changed, 111 insertions(+), 23 deletions(-) create mode 100644 src/cmd/vet/doc.go diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index e7412f9bc7c51..12134b21c02be 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1299,16 +1299,25 @@ // // Usage: // -// go vet [-n] [-x] [build flags] [vet flags] [packages] +// go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages] // // Vet runs the Go vet command on the packages named by the import paths. // // For more about vet and its flags, see 'go doc cmd/vet'. // For more about specifying packages, see 'go help packages'. +// For a list of checkers and their flags, see 'go tool vet help'. +// For details of a specific checker such as 'printf', see 'go tool vet help printf'. // // The -n flag prints commands that would be executed. // The -x flag prints commands as they are executed. // +// The -vettool=prog flag selects a different analysis tool with alternative +// or additional checks. +// For example, the 'shadow' analyzer can be built and run using these commands: +// +// go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow +// go vet -vettool=$(which shadow) +// // The build flags supported by go vet are those that control package resolution // and execution, such as -n, -x, -v, -tags, and -toolexec. // For more about these flags, see 'go help build'. diff --git a/src/cmd/go/internal/vet/vet.go b/src/cmd/go/internal/vet/vet.go index 616f774bf6459..327b761c3cd6b 100644 --- a/src/cmd/go/internal/vet/vet.go +++ b/src/cmd/go/internal/vet/vet.go @@ -16,17 +16,26 @@ import ( var CmdVet = &base.Command{ Run: runVet, CustomFlags: true, - UsageLine: "go vet [-n] [-x] [build flags] [vet flags] [packages]", + UsageLine: "go vet [-n] [-x] [-vettool prog] [build flags] [vet flags] [packages]", Short: "report likely mistakes in packages", Long: ` Vet runs the Go vet command on the packages named by the import paths. For more about vet and its flags, see 'go doc cmd/vet'. For more about specifying packages, see 'go help packages'. +For a list of checkers and their flags, see 'go tool vet help'. +For details of a specific checker such as 'printf', see 'go tool vet help printf'. The -n flag prints commands that would be executed. The -x flag prints commands as they are executed. +The -vettool=prog flag selects a different analysis tool with alternative +or additional checks. +For example, the 'shadow' analyzer can be built and run using these commands: + + go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow + go vet -vettool=$(which shadow) + The build flags supported by go vet are those that control package resolution and execution, such as -n, -x, -v, -tags, and -toolexec. For more about these flags, see 'go help build'. @@ -38,7 +47,7 @@ See also: go fmt, go fix. func runVet(cmd *base.Command, args []string) { modload.LoadTests = true - vetFlags, pkgArgs := vetFlags(cmd.Usage, args) + vetFlags, pkgArgs := vetFlags(vetUsage, args) work.BuildInit() work.VetFlags = vetFlags diff --git a/src/cmd/go/internal/vet/vetflag.go b/src/cmd/go/internal/vet/vetflag.go index 9b5184a4d4ef8..37342f4163342 100644 --- a/src/cmd/go/internal/vet/vetflag.go +++ b/src/cmd/go/internal/vet/vetflag.go @@ -166,3 +166,21 @@ func vetFlags(usage func(), args []string) (passToVet, packageNames []string) { } return args, nil } + +var vetUsage func() + +func init() { vetUsage = usage } // break initialization cycle + +func usage() { + fmt.Fprintf(os.Stderr, "usage: %s\n", CmdVet.UsageLine) + fmt.Fprintf(os.Stderr, "Run 'go help %s' for details.\n", CmdVet.LongName()) + + // This part is additional to what (*Command).Usage does: + cmd := "go tool vet" + if vetTool != "" { + cmd = vetTool + } + fmt.Fprintf(os.Stderr, "Run '%s -help' for the vet tool's flags.\n", cmd) + + os.Exit(2) +} diff --git a/src/cmd/go/testdata/script/help.txt b/src/cmd/go/testdata/script/help.txt index 3d0650880e603..9f455256f72d8 100644 --- a/src/cmd/go/testdata/script/help.txt +++ b/src/cmd/go/testdata/script/help.txt @@ -34,6 +34,7 @@ stderr 'Run ''go help mod'' for usage.' ! go vet -h stderr 'usage: go vet' stderr 'Run ''go help vet'' for details' +stderr 'Run ''go tool vet -help'' for the vet tool''s flags' # Earlier versions of Go printed a large document here, instead of these two # lines. diff --git a/src/cmd/vet/doc.go b/src/cmd/vet/doc.go new file mode 100644 index 0000000000000..279d081be39c9 --- /dev/null +++ b/src/cmd/vet/doc.go @@ -0,0 +1,71 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* + +Vet examines Go source code and reports suspicious constructs, such as Printf +calls whose arguments do not align with the format string. Vet uses heuristics +that do not guarantee all reports are genuine problems, but it can find errors +not caught by the compilers. + +Vet is normally invoked through the go command. +This command vets the package in the current directory: + + go vet + +whereas this one vets the packages whose path is provided: + + go vet my/project/... + +Use "go help packages" to see other ways of specifying which packages to vet. + +Vet's exit code is non-zero for erroneous invocation of the tool or if a +problem was reported, and 0 otherwise. Note that the tool does not +check every possible problem and depends on unreliable heuristics, +so it should be used as guidance only, not as a firm indicator of +program correctness. + +To list the available checks, run "go tool vet help": + + asmdecl report mismatches between assembly files and Go declarations + assign check for useless assignments + atomic check for common mistakes using the sync/atomic package + bools check for common mistakes involving boolean operators + buildtag check that +build tags are well-formed and correctly located + cgocall detect some violations of the cgo pointer passing rules + composites check for unkeyed composite literals + copylocks check for locks erroneously passed by value + httpresponse check for mistakes using HTTP responses + loopclosure check references to loop variables from within nested functions + lostcancel check cancel func returned by context.WithCancel is called + nilfunc check for useless comparisons between functions and nil + printf check consistency of Printf format strings and arguments + shift check for shifts that equal or exceed the width of the integer + stdmethods check signature of methods of well-known interfaces + structtag check that struct field tags conform to reflect.StructTag.Get + tests check for common mistaken usages of tests and examples + unmarshal report passing non-pointer or non-interface values to unmarshal + unreachable check for unreachable code + unsafeptr check for invalid conversions of uintptr to unsafe.Pointer + unusedresult check for unused results of calls to some functions + +For details and flags of a particular check, such as printf, run "go tool vet help printf". + +By default, all checks are performed. +If any flags are explicitly set to true, only those tests are run. +Conversely, if any flag is explicitly set to false, only those tests are disabled. +Thus -printf=true runs the printf check, +and -printf=false runs all checks except the printf check. + +For information on writing a new check, see golang.org/x/tools/go/analysis. + +Core flags: + + -c=N + display offending line plus N lines of surrounding context + -json + emit analysis diagnostics (and errors) in JSON format + +*/ +package main diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go index 3ea781a7d4932..4ec174b3cd1e0 100644 --- a/src/cmd/vet/main.go +++ b/src/cmd/vet/main.go @@ -1,8 +1,3 @@ -// The vet command is a driver for static checkers conforming to -// the golang.org/x/tools/go/analysis API. Run it using 'go vet'. -// -// For a tool capable of running standalone, use a multichecker-based -// tool such as golang.org/x/tools/go/analysis/cmd/vet. package main import ( @@ -31,21 +26,6 @@ import ( "golang.org/x/tools/go/analysis/passes/unusedresult" ) -// Legacy vet had the concept of "experimental" checkers. - -// There was exactly one, shadow, and it had to be explicitly -// enabled by the -shadow flag, which would of course disable -// all the other tristate flags, requiring the -all flag (which -// is now a no-op) to reenable them. -// -// The shadow analyzer has been removed from the suite, -// but can be run using these additional commands: -// $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow -// $ go vet -vettool=$(which shadow) -// Alternatively, one could build a multichecker containing all -// the desired checks (vet's suite + shadow) and run it in a -// single "go vet" command. - func main() { unitchecker.Main( asmdecl.Analyzer, From 8bb3ae18db3ae1457ad56fc32a6380159589aa70 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Mon, 19 Nov 2018 12:25:37 -0500 Subject: [PATCH 086/594] cmd/vendor: eliminate vet-lite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cmd/vet, now simplified to a single function call is now authoritative, not a copy of vet-lite. The update-xtools.sh script now uses the imports of cmd/vet as the roots for vendoring. Change-Id: I4faef3fcf3db10b3a3930726e8d0720a3c8395da Reviewed-on: https://go-review.googlesource.com/c/150297 Run-TryBot: Alan Donovan Reviewed-by: Daniel Martí --- .../x/tools/go/analysis/cmd/vet-lite/main.go | 74 ------------------- src/cmd/vendor/update-xtools.sh | 12 ++- 2 files changed, 8 insertions(+), 78 deletions(-) delete mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go deleted file mode 100644 index 259d3976b4e50..0000000000000 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go +++ /dev/null @@ -1,74 +0,0 @@ -// The vet-lite command is a driver for static checkers conforming to -// the golang.org/x/tools/go/analysis API. It must be run by go vet: -// -// $ go vet -vettool=$(which vet-lite) -// -// For a checker also capable of running standalone, use multichecker. -package main - -import ( - "golang.org/x/tools/go/analysis/unitchecker" - - "golang.org/x/tools/go/analysis/passes/asmdecl" - "golang.org/x/tools/go/analysis/passes/assign" - "golang.org/x/tools/go/analysis/passes/atomic" - "golang.org/x/tools/go/analysis/passes/bools" - "golang.org/x/tools/go/analysis/passes/buildtag" - "golang.org/x/tools/go/analysis/passes/cgocall" - "golang.org/x/tools/go/analysis/passes/composite" - "golang.org/x/tools/go/analysis/passes/copylock" - "golang.org/x/tools/go/analysis/passes/httpresponse" - "golang.org/x/tools/go/analysis/passes/loopclosure" - "golang.org/x/tools/go/analysis/passes/lostcancel" - "golang.org/x/tools/go/analysis/passes/nilfunc" - "golang.org/x/tools/go/analysis/passes/printf" - "golang.org/x/tools/go/analysis/passes/shift" - "golang.org/x/tools/go/analysis/passes/stdmethods" - "golang.org/x/tools/go/analysis/passes/structtag" - "golang.org/x/tools/go/analysis/passes/tests" - "golang.org/x/tools/go/analysis/passes/unmarshal" - "golang.org/x/tools/go/analysis/passes/unreachable" - "golang.org/x/tools/go/analysis/passes/unsafeptr" - "golang.org/x/tools/go/analysis/passes/unusedresult" -) - -// Legacy vet had the concept of "experimental" checkers. There -// was exactly one, shadow, and it had to be explicitly enabled -// by the -shadow flag, which would of course disable all the -// other tristate flags, requiring the -all flag to reenable them. -// (By itself, -all did not enable all checkers.) -// The -all flag is no longer needed, so it is a no-op. -// -// The shadow analyzer has been removed from the suite, -// but can be run using these additional commands: -// $ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow -// $ go vet -vettool=$(which shadow) -// Alternatively, one could build a multichecker containing all -// the desired checks (vet's suite + shadow) and run it in a -// single "go vet" command. - -func main() { - unitchecker.Main( - asmdecl.Analyzer, - assign.Analyzer, - atomic.Analyzer, - bools.Analyzer, - buildtag.Analyzer, - cgocall.Analyzer, - composite.Analyzer, - copylock.Analyzer, - httpresponse.Analyzer, - loopclosure.Analyzer, - lostcancel.Analyzer, - nilfunc.Analyzer, - printf.Analyzer, - shift.Analyzer, - stdmethods.Analyzer, - structtag.Analyzer, - tests.Analyzer, - unmarshal.Analyzer, - unreachable.Analyzer, - unsafeptr.Analyzer, - unusedresult.Analyzer, - ) -} diff --git a/src/cmd/vendor/update-xtools.sh b/src/cmd/vendor/update-xtools.sh index 0097a729918a3..8cf5ac165df4a 100755 --- a/src/cmd/vendor/update-xtools.sh +++ b/src/cmd/vendor/update-xtools.sh @@ -1,7 +1,7 @@ #!/bin/sh # # update-xtools.sh: idempotently update the vendored -# copy of the x/tools repository used by vet-lite. +# copy of the x/tools repository used by cmd/vet. set -u @@ -11,7 +11,11 @@ xtools=$(dirname $(dirname $analysis)) vendor=$(dirname $0) -go list -f '{{.ImportPath}} {{.Dir}}' -deps golang.org/x/tools/go/analysis/cmd/vet-lite | +# Find the x/tools packages directly imported by cmd/vet. +go list -f '{{range $k, $v := .ImportMap}}{{$k}} {{end}}' cmd/vet | + grep golang.org/x/tools | + # Vendor their transitive closure of dependencies. + xargs go list -f '{{.ImportPath}} {{.Dir}}' -deps | grep golang.org/x/tools | while read path dir do @@ -23,5 +27,5 @@ go list -f '{{.ImportPath}} {{.Dir}}' -deps golang.org/x/tools/go/analysis/cmd/v echo "Copied $xtools@$(cd $analysis && git rev-parse --short HEAD) to $vendor" >&2 -go build -o /dev/null ./golang.org/x/tools/go/analysis/cmd/vet-lite || - { echo "Failed to build vet-lite"; exit 1; } >&2 +go build -o /dev/null cmd/vet || + { echo "Failed to build cmd/vet"; exit 1; } >&2 From dcb1363a1fc3e02085f17533052dfab35e426143 Mon Sep 17 00:00:00 2001 From: Michael Ellis Date: Wed, 7 Nov 2018 15:14:20 -0800 Subject: [PATCH 087/594] cmd/go: parse dot-separated identifiers in build metadata Per https://semver.org/#spec-item-10, build metadata may include a series of dot separated identifiers. Fixes #28647 Change-Id: I98655c62584a822953df71fba32b4a2cafe7a04b Reviewed-on: https://go-review.googlesource.com/c/148835 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/semver/semver.go | 2 +- src/cmd/go/internal/semver/semver_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/internal/semver/semver.go b/src/cmd/go/internal/semver/semver.go index 4af7118e55d2e..122e612dd4b8f 100644 --- a/src/cmd/go/internal/semver/semver.go +++ b/src/cmd/go/internal/semver/semver.go @@ -263,7 +263,7 @@ func parseBuild(v string) (t, rest string, ok bool) { i := 1 start := 1 for i < len(v) { - if !isIdentChar(v[i]) { + if !isIdentChar(v[i]) && v[i] != '.' { return } if v[i] == '.' { diff --git a/src/cmd/go/internal/semver/semver_test.go b/src/cmd/go/internal/semver/semver_test.go index 96b64a5807549..77025a44abd60 100644 --- a/src/cmd/go/internal/semver/semver_test.go +++ b/src/cmd/go/internal/semver/semver_test.go @@ -44,6 +44,7 @@ var tests = []struct { {"v1.2.3", "v1.2.3"}, {"v1.2.3+meta", "v1.2.3"}, {"v1.2.3+meta-pre", "v1.2.3"}, + {"v1.2.3+meta-pre.sha.256a", "v1.2.3"}, } func TestIsValid(t *testing.T) { From 3d72ca9908ba2696e1acafa7d7f8fee21131fe5e Mon Sep 17 00:00:00 2001 From: Xia Bin Date: Mon, 19 Nov 2018 11:24:12 +0800 Subject: [PATCH 088/594] cmd/link: directly get max pc value in findfunctab Change-Id: I70afd2f7b6783926174c4e66565b711cffeb97c5 Reviewed-on: https://go-review.googlesource.com/c/150141 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/pcln.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cmd/link/internal/ld/pcln.go b/src/cmd/link/internal/ld/pcln.go index 3eb3d058824f7..ba098611c084e 100644 --- a/src/cmd/link/internal/ld/pcln.go +++ b/src/cmd/link/internal/ld/pcln.go @@ -520,10 +520,8 @@ func (ctxt *Link) findfunctab() { // find min and max address min := ctxt.Textp[0].Value - max := int64(0) - for _, s := range ctxt.Textp { - max = s.Value + s.Size - } + lastp := ctxt.Textp[len(ctxt.Textp)-1] + max := lastp.Value + lastp.Size // for each subbucket, compute the minimum of all symbol indexes // that map to that subbucket. From 108414946ee29d9c997354494a808b86bdd0c209 Mon Sep 17 00:00:00 2001 From: Vladimir Kovpak Date: Mon, 19 Nov 2018 22:11:33 +0000 Subject: [PATCH 089/594] regexp: add matching and finding examples This commit adds examples for Match, Find, FindAllSubmatch, FindSubmatch and Match functions. Change-Id: I2bdf8c3cee6e89d618109397378c1fc91aaf1dfb GitHub-Last-Rev: 33f34b7adca2911a4fff9638c93e846fb0021465 GitHub-Pull-Request: golang/go#28837 Reviewed-on: https://go-review.googlesource.com/c/150020 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/regexp/example_test.go | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/regexp/example_test.go b/src/regexp/example_test.go index d65464665f779..d134a6ba282db 100644 --- a/src/regexp/example_test.go +++ b/src/regexp/example_test.go @@ -25,6 +25,20 @@ func Example() { // false } +func ExampleMatch() { + matched, err := regexp.Match(`foo.*`, []byte(`seafood`)) + fmt.Println(matched, err) + matched, err = regexp.Match(`bar.*`, []byte(`seafood`)) + fmt.Println(matched, err) + matched, err = regexp.Match(`a(b`, []byte(`seafood`)) + fmt.Println(matched, err) + + // Output: + // true + // false + // false error parsing regexp: missing closing ): `a(b` +} + func ExampleMatchString() { matched, err := regexp.MatchString("foo.*", "seafood") fmt.Println(matched, err) @@ -44,6 +58,46 @@ func ExampleQuoteMeta() { // Escaping symbols like: \.\+\*\?\(\)\|\[\]\{\}\^\$ } +func ExampleRegexp_Find() { + re := regexp.MustCompile("foo.?") + fmt.Printf("%q\n", re.Find([]byte(`seafood fool`))) + + // Output: + // "food" +} + +func ExampleRegexp_FindAll() { + re := regexp.MustCompile("foo.?") + fmt.Printf("%q\n", re.FindAll([]byte(`seafood fool`), -1)) + + // Output: + // ["food" "fool"] +} + +func ExampleRegexp_FindAllSubmatch() { + re := regexp.MustCompile("foo(.?)") + fmt.Printf("%q\n", re.FindAllSubmatch([]byte(`seafood fool`), -1)) + + // Output: + // [["food" "d"] ["fool" "l"]] +} + +func ExampleRegexp_FindSubmatch() { + re := regexp.MustCompile("foo(.?)") + fmt.Printf("%q\n", re.FindSubmatch([]byte(`seafood fool`))) + + // Output: + // ["food" "d"] +} + +func ExampleRegexp_Match() { + re := regexp.MustCompile("foo.?") + fmt.Println(re.Match([]byte(`seafood fool`))) + + // Output: + // true +} + func ExampleRegexp_FindString() { re := regexp.MustCompile("foo.?") fmt.Printf("%q\n", re.FindString("seafood fool")) From 552d7b918697e0a5ab1ff22f91abf3e1cfde2e1d Mon Sep 17 00:00:00 2001 From: Santhosh Kumar Tekuri Date: Tue, 6 Feb 2018 12:00:13 +0530 Subject: [PATCH 090/594] encoding/pem: test getLine does not include trailing whitespace Change-Id: I7a1046f5e0aedbbdd1106a616de410fe4e0cb7d8 Reviewed-on: https://go-review.googlesource.com/c/92295 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/encoding/pem/pem_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/encoding/pem/pem_test.go b/src/encoding/pem/pem_test.go index a1b5afac0866d..204611bda02d7 100644 --- a/src/encoding/pem/pem_test.go +++ b/src/encoding/pem/pem_test.go @@ -26,6 +26,10 @@ var getLineTests = []GetLineTest{ {"abc\r\nd", "abc", "d"}, {"\nabc", "", "abc"}, {"\r\nabc", "", "abc"}, + {"abc\t \nd", "abc", "d"}, + {"\t abc\nd", "\t abc", "d"}, + {"abc\n\t d", "abc", "\t d"}, + {"abc\nd\t ", "abc", "d\t "}, } func TestGetLine(t *testing.T) { From 485218482b3fcfced2ed73c35137f37b1ba9a9a1 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 18 Nov 2018 14:52:22 +0100 Subject: [PATCH 091/594] doc/go1.12: announce deprecation of support for FreeBSD 10.x Fixes #27619 Change-Id: If18df696c0778efe894a4a249d4964db1b02e5d6 Reviewed-on: https://go-review.googlesource.com/c/150159 Reviewed-by: Yuval Pavel Zholkover Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index f4920f4670392..79f8eceb47e72 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -37,6 +37,16 @@

Changes to the language

There are no changes to the language specification.

+

Ports

+ +

FreeBSD

+ +

+ Go 1.12 is the last release that is supported on FreeBSD 10.x, which has + already reached end-of-life. Go 1.13 will require FreeBSD 11.2+ or FreeBSD + 12.0+. +

+

Tools

Build cache requirement

From 55c55dda1fa8f9351d992e4a05e94f8cb38f59a0 Mon Sep 17 00:00:00 2001 From: Vladimir Kovpak Date: Tue, 20 Nov 2018 09:08:11 +0000 Subject: [PATCH 092/594] regexp: use backquotes for all regular expression examples This commit performs replace double quote to backquote, so now all examples looks consistent. Change-Id: I8cf760ce1bdeff9619a88e531161b9516385241b GitHub-Last-Rev: e3e636cebbf41528b8a73f9a3fe5afa10876f964 GitHub-Pull-Request: golang/go#28879 Reviewed-on: https://go-review.googlesource.com/c/150397 Reviewed-by: Rob Pike Run-TryBot: Rob Pike TryBot-Result: Gobot Gobot --- src/regexp/example_test.go | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/regexp/example_test.go b/src/regexp/example_test.go index d134a6ba282db..3008c56b6bea9 100644 --- a/src/regexp/example_test.go +++ b/src/regexp/example_test.go @@ -40,11 +40,11 @@ func ExampleMatch() { } func ExampleMatchString() { - matched, err := regexp.MatchString("foo.*", "seafood") + matched, err := regexp.MatchString(`foo.*`, "seafood") fmt.Println(matched, err) - matched, err = regexp.MatchString("bar.*", "seafood") + matched, err = regexp.MatchString(`bar.*`, "seafood") fmt.Println(matched, err) - matched, err = regexp.MatchString("a(b", "seafood") + matched, err = regexp.MatchString(`a(b`, "seafood") fmt.Println(matched, err) // Output: // true @@ -53,13 +53,13 @@ func ExampleMatchString() { } func ExampleQuoteMeta() { - fmt.Println(regexp.QuoteMeta("Escaping symbols like: .+*?()|[]{}^$")) + fmt.Println(regexp.QuoteMeta(`Escaping symbols like: .+*?()|[]{}^$`)) // Output: // Escaping symbols like: \.\+\*\?\(\)\|\[\]\{\}\^\$ } func ExampleRegexp_Find() { - re := regexp.MustCompile("foo.?") + re := regexp.MustCompile(`foo.?`) fmt.Printf("%q\n", re.Find([]byte(`seafood fool`))) // Output: @@ -67,7 +67,7 @@ func ExampleRegexp_Find() { } func ExampleRegexp_FindAll() { - re := regexp.MustCompile("foo.?") + re := regexp.MustCompile(`foo.?`) fmt.Printf("%q\n", re.FindAll([]byte(`seafood fool`), -1)) // Output: @@ -75,7 +75,7 @@ func ExampleRegexp_FindAll() { } func ExampleRegexp_FindAllSubmatch() { - re := regexp.MustCompile("foo(.?)") + re := regexp.MustCompile(`foo(.?)`) fmt.Printf("%q\n", re.FindAllSubmatch([]byte(`seafood fool`), -1)) // Output: @@ -83,7 +83,7 @@ func ExampleRegexp_FindAllSubmatch() { } func ExampleRegexp_FindSubmatch() { - re := regexp.MustCompile("foo(.?)") + re := regexp.MustCompile(`foo(.?)`) fmt.Printf("%q\n", re.FindSubmatch([]byte(`seafood fool`))) // Output: @@ -91,7 +91,7 @@ func ExampleRegexp_FindSubmatch() { } func ExampleRegexp_Match() { - re := regexp.MustCompile("foo.?") + re := regexp.MustCompile(`foo.?`) fmt.Println(re.Match([]byte(`seafood fool`))) // Output: @@ -99,7 +99,7 @@ func ExampleRegexp_Match() { } func ExampleRegexp_FindString() { - re := regexp.MustCompile("foo.?") + re := regexp.MustCompile(`foo.?`) fmt.Printf("%q\n", re.FindString("seafood fool")) fmt.Printf("%q\n", re.FindString("meat")) // Output: @@ -108,7 +108,7 @@ func ExampleRegexp_FindString() { } func ExampleRegexp_FindStringIndex() { - re := regexp.MustCompile("ab?") + re := regexp.MustCompile(`ab?`) fmt.Println(re.FindStringIndex("tablett")) fmt.Println(re.FindStringIndex("foo") == nil) // Output: @@ -117,7 +117,7 @@ func ExampleRegexp_FindStringIndex() { } func ExampleRegexp_FindStringSubmatch() { - re := regexp.MustCompile("a(x*)b(y|z)c") + re := regexp.MustCompile(`a(x*)b(y|z)c`) fmt.Printf("%q\n", re.FindStringSubmatch("-axxxbyc-")) fmt.Printf("%q\n", re.FindStringSubmatch("-abzc-")) // Output: @@ -126,7 +126,7 @@ func ExampleRegexp_FindStringSubmatch() { } func ExampleRegexp_FindAllString() { - re := regexp.MustCompile("a.") + re := regexp.MustCompile(`a.`) fmt.Println(re.FindAllString("paranormal", -1)) fmt.Println(re.FindAllString("paranormal", 2)) fmt.Println(re.FindAllString("graal", -1)) @@ -139,7 +139,7 @@ func ExampleRegexp_FindAllString() { } func ExampleRegexp_FindAllStringSubmatch() { - re := regexp.MustCompile("a(x*)b") + re := regexp.MustCompile(`a(x*)b`) fmt.Printf("%q\n", re.FindAllStringSubmatch("-ab-", -1)) fmt.Printf("%q\n", re.FindAllStringSubmatch("-axxb-", -1)) fmt.Printf("%q\n", re.FindAllStringSubmatch("-ab-axb-", -1)) @@ -152,7 +152,7 @@ func ExampleRegexp_FindAllStringSubmatch() { } func ExampleRegexp_FindAllStringSubmatchIndex() { - re := regexp.MustCompile("a(x*)b") + re := regexp.MustCompile(`a(x*)b`) // Indices: // 01234567 012345678 // -ab-axb- -axxb-ab- @@ -170,7 +170,7 @@ func ExampleRegexp_FindAllStringSubmatchIndex() { } func ExampleRegexp_MatchString() { - re := regexp.MustCompile("(gopher){2}") + re := regexp.MustCompile(`(gopher){2}`) fmt.Println(re.MatchString("gopher")) fmt.Println(re.MatchString("gophergopher")) fmt.Println(re.MatchString("gophergophergopher")) @@ -181,7 +181,7 @@ func ExampleRegexp_MatchString() { } func ExampleRegexp_ReplaceAllLiteralString() { - re := regexp.MustCompile("a(x*)b") + re := regexp.MustCompile(`a(x*)b`) fmt.Println(re.ReplaceAllLiteralString("-ab-axxb-", "T")) fmt.Println(re.ReplaceAllLiteralString("-ab-axxb-", "$1")) fmt.Println(re.ReplaceAllLiteralString("-ab-axxb-", "${1}")) @@ -192,7 +192,7 @@ func ExampleRegexp_ReplaceAllLiteralString() { } func ExampleRegexp_ReplaceAllString() { - re := regexp.MustCompile("a(x*)b") + re := regexp.MustCompile(`a(x*)b`) fmt.Println(re.ReplaceAllString("-ab-axxb-", "T")) fmt.Println(re.ReplaceAllString("-ab-axxb-", "$1")) fmt.Println(re.ReplaceAllString("-ab-axxb-", "$1W")) @@ -205,7 +205,7 @@ func ExampleRegexp_ReplaceAllString() { } func ExampleRegexp_SubexpNames() { - re := regexp.MustCompile("(?P[a-zA-Z]+) (?P[a-zA-Z]+)") + re := regexp.MustCompile(`(?P[a-zA-Z]+) (?P[a-zA-Z]+)`) fmt.Println(re.MatchString("Alan Turing")) fmt.Printf("%q\n", re.SubexpNames()) reversed := fmt.Sprintf("${%s} ${%s}", re.SubexpNames()[2], re.SubexpNames()[1]) @@ -219,12 +219,12 @@ func ExampleRegexp_SubexpNames() { } func ExampleRegexp_Split() { - a := regexp.MustCompile("a") + a := regexp.MustCompile(`a`) fmt.Println(a.Split("banana", -1)) fmt.Println(a.Split("banana", 0)) fmt.Println(a.Split("banana", 1)) fmt.Println(a.Split("banana", 2)) - zp := regexp.MustCompile("z+") + zp := regexp.MustCompile(`z+`) fmt.Println(zp.Split("pizza", -1)) fmt.Println(zp.Split("pizza", 0)) fmt.Println(zp.Split("pizza", 1)) From 399fec28e22ac01b7a4fe56028c3016a0df6d2e6 Mon Sep 17 00:00:00 2001 From: Markus Date: Sat, 17 Nov 2018 19:21:32 +0000 Subject: [PATCH 093/594] syscall/js: document ValueOf() panic ValueOf() panics if x is not one of the expected types. Change-Id: I1105e46bd09a5ab13c162b77c1c50cc45bce27a2 GitHub-Last-Rev: 34a88ce8206954d94f0a884ab7f6494116c54a2d GitHub-Pull-Request: golang/go#28846 Reviewed-on: https://go-review.googlesource.com/c/150138 Reviewed-by: Richard Musiol --- src/syscall/js/js.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/syscall/js/js.go b/src/syscall/js/js.go index 19cdedc309ad6..885723f87d690 100644 --- a/src/syscall/js/js.go +++ b/src/syscall/js/js.go @@ -114,6 +114,8 @@ func Global() Value { // | string | string | // | []interface{} | new array | // | map[string]interface{} | new object | +// +// Panics if x is not one of the expected types. func ValueOf(x interface{}) Value { switch x := x.(type) { case Value: // should precede Wrapper to avoid a loop From 2cc6d62d666f49d91c6d088bcba3ef18072d093f Mon Sep 17 00:00:00 2001 From: David Heuschmann Date: Tue, 20 Nov 2018 11:11:59 +0100 Subject: [PATCH 094/594] mime: correctly detect non-ASCII characters in FormatMediaType MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FormatMediaType used rune&0x80==0 to check if parameter values consisted of valid ascii charaters. Comparing strings using their runes instead of their bytes leads to some non-ascii strings to pass as valid. E.g. the rune for 'Ą' is 0x104, 0x104 & 0x80 => 0. Its byte representation is 0xc4 0x84, both of which result in non zero values when masked with 0x80 Fixes #28849 Change-Id: Ib9fb4968bcbbec0197d81136f380d40a2a56c14b Reviewed-on: https://go-review.googlesource.com/c/150417 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/mime/mediatype.go | 2 +- src/mime/mediatype_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mime/mediatype.go b/src/mime/mediatype.go index 3d480a9d7e7c4..fc6e0d0673d54 100644 --- a/src/mime/mediatype.go +++ b/src/mime/mediatype.go @@ -56,7 +56,7 @@ func FormatMediaType(t string, param map[string]string) string { b.WriteByte('"') offset := 0 - for index, character := range value { + for index, character := range []byte(value) { if character == '"' || character == '\\' { b.WriteString(value[offset:index]) offset = index diff --git a/src/mime/mediatype_test.go b/src/mime/mediatype_test.go index 35b311a4a58b1..945a8189e171c 100644 --- a/src/mime/mediatype_test.go +++ b/src/mime/mediatype_test.go @@ -481,6 +481,8 @@ var formatTests = []formatTest{ {"noslash", map[string]string{"X": "Y"}, "noslash; x=Y"}, // e.g. Content-Disposition values (RFC 2183); issue 11289 {"foo bar/baz", nil, ""}, {"foo/bar baz", nil, ""}, + {"attachment", map[string]string{"filename": "ĄĄŽŽČČŠŠ"}, ""}, + {"attachment", map[string]string{"filename": "ÁÁÊÊÇÇÎÎ"}, ""}, {"foo/BAR", nil, "foo/bar"}, {"foo/BAR", map[string]string{"X": "Y"}, "foo/bar; x=Y"}, {"foo/BAR", map[string]string{"space": "With space"}, `foo/bar; space="With space"`}, From 1135071b47b1c9c0069d384c136e94d2883282bc Mon Sep 17 00:00:00 2001 From: majiang Date: Fri, 16 Nov 2018 15:39:59 +0000 Subject: [PATCH 095/594] cmd/link, runtime: add initial cgo support for ppc64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should be able to build docker after this get applied. Updates #13192 Change-Id: I5378d3518fac52d6bd4c97828884c1b382b7ace5 GitHub-Last-Rev: 210b7bc2e172f641f1102982e04542bf73a1aa46 GitHub-Pull-Request: golang/go#28546 Reviewed-on: https://go-review.googlesource.com/c/146898 Reviewed-by: Jiang Ma Reviewed-by: Clément Chigot Reviewed-by: Lynn Boger Run-TryBot: Tobias Klauser Run-TryBot: Lynn Boger TryBot-Result: Gobot Gobot --- src/cmd/link/internal/ppc64/asm.go | 7 +++++++ src/cmd/link/internal/ppc64/obj.go | 3 --- src/runtime/asm_ppc64x.s | 27 +++++++++++++++++++++++++++ src/runtime/rt0_linux_ppc64.s | 17 ++++++++++++----- src/runtime/sys_linux_ppc64x.s | 2 +- 5 files changed, 47 insertions(+), 9 deletions(-) diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 11a7aa2164311..2ec5a2b18b10f 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -374,6 +374,13 @@ func adddynrel(ctxt *ld.Link, s *sym.Symbol, r *sym.Reloc) bool { } func elfreloc1(ctxt *ld.Link, r *sym.Reloc, sectoff int64) bool { + // Beware that bit0~bit15 start from the third byte of a instruction in Big-Endian machines. + if r.Type == objabi.R_ADDR || r.Type == objabi.R_POWER_TLS || r.Type == objabi.R_CALLPOWER { + } else { + if ctxt.Arch.ByteOrder == binary.BigEndian { + sectoff += 2 + } + } ctxt.Out.Write64(uint64(sectoff)) elfsym := r.Xsym.ElfsymForReloc() diff --git a/src/cmd/link/internal/ppc64/obj.go b/src/cmd/link/internal/ppc64/obj.go index e630f8c062b6b..fbedc728d9bae 100644 --- a/src/cmd/link/internal/ppc64/obj.go +++ b/src/cmd/link/internal/ppc64/obj.go @@ -93,9 +93,6 @@ func archinit(ctxt *ld.Link) { } case objabi.Hlinux: /* ppc64 elf */ - if ctxt.Arch == sys.ArchPPC64 { - *ld.FlagD = true // TODO(austin): ELF ABI v1 not supported yet - } ld.Elfinit(ctxt) ld.HEADR = ld.ELFRESERVE if *ld.FlagTextAddr == -1 { diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s index fb0003c9b2f92..0a89b57cd81ba 100644 --- a/src/runtime/asm_ppc64x.s +++ b/src/runtime/asm_ppc64x.s @@ -36,6 +36,12 @@ TEXT runtime·rt0_go(SB),NOSPLIT,$0 MOVD _cgo_init(SB), R12 CMP R0, R12 BEQ nocgo +#ifdef GOARCH_ppc64 + // ppc64 use elf ABI v1. we must get the real entry address from + // first slot of the function descriptor before call. + MOVD 8(R12), R2 + MOVD (R12), R12 +#endif MOVD R12, CTR // r12 = "global function entry point" MOVD R13, R5 // arg 2: TLS base pointer MOVD $setg_gcc<>(SB), R4 // arg 1: setg @@ -597,6 +603,16 @@ g0: #endif // This is a "global call", so put the global entry point in r12 MOVD R3, R12 + +#ifdef GOARCH_ppc64 + // ppc64 use elf ABI v1. we must get the real entry address from + // first slot of the function descriptor before call. +#ifndef GOOS_aix + // aix just passes the function pointer for the moment, see golang.org/cl/146898 for details. + MOVD 8(R12), R2 + MOVD (R12), R12 +#endif +#endif MOVD R12, CTR MOVD R4, R3 // arg in r3 BL (CTR) @@ -754,9 +770,20 @@ TEXT runtime·setg(SB), NOSPLIT, $0-8 BL runtime·save_g(SB) RET +#ifdef GOARCH_ppc64 +TEXT setg_gcc<>(SB),NOSPLIT|NOFRAME,$0-0 + DWORD $_setg_gcc<>(SB) + DWORD $0 + DWORD $0 +#endif + // void setg_gcc(G*); set g in C TLS. // Must obey the gcc calling convention. +#ifdef GOARCH_ppc64le TEXT setg_gcc<>(SB),NOSPLIT|NOFRAME,$0-0 +#else +TEXT _setg_gcc<>(SB),NOSPLIT|NOFRAME,$0-0 +#endif // The standard prologue clobbers R31, which is callee-save in // the C ABI, so we have to use $-8-0 and save LR ourselves. MOVD LR, R4 diff --git a/src/runtime/rt0_linux_ppc64.s b/src/runtime/rt0_linux_ppc64.s index f81451543830d..1265b158532f8 100644 --- a/src/runtime/rt0_linux_ppc64.s +++ b/src/runtime/rt0_linux_ppc64.s @@ -6,6 +6,11 @@ TEXT _rt0_ppc64_linux(SB),NOSPLIT,$0 DWORD $0 DWORD $0 +TEXT main(SB),NOSPLIT,$0 + DWORD $_main<>(SB) + DWORD $0 + DWORD $0 + TEXT _main<>(SB),NOSPLIT,$-8 // In a statically linked binary, the stack contains argc, // argv as argc string pointers followed by a NULL, envv as a @@ -13,11 +18,13 @@ TEXT _main<>(SB),NOSPLIT,$-8 // There is no TLS base pointer. // // TODO(austin): Support ABI v1 dynamic linking entry point - MOVD 0(R1), R3 // argc - ADD $8, R1, R4 // argv - BR main(SB) - -TEXT main(SB),NOSPLIT,$-8 MOVD $runtime·rt0_go(SB), R12 MOVD R12, CTR + MOVBZ runtime·iscgo(SB), R5 + CMP R5, $0 + BEQ nocgo + BR (CTR) +nocgo: + MOVD 0(R1), R3 // argc + ADD $8, R1, R4 // argv BR (CTR) diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s index bf01099830799..6835f434de4fc 100644 --- a/src/runtime/sys_linux_ppc64x.s +++ b/src/runtime/sys_linux_ppc64x.s @@ -414,7 +414,7 @@ TEXT runtime·cgoSigtramp(SB),NOSPLIT|NOFRAME,$0 DWORD $0 DWORD $0 TEXT runtime·_cgoSigtramp(SB),NOSPLIT,$0 - JMP runtime·sigtramp(SB) + JMP runtime·_sigtramp(SB) #endif TEXT runtime·sigprofNonGoWrapper<>(SB),NOSPLIT,$0 From d7183ca40360bd5f8f1fcc199461344b6ee4de05 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Tue, 20 Nov 2018 14:47:58 +0100 Subject: [PATCH 096/594] misc/wasm: use temporary directory provided by Node.js os.TempDir() did not return a proper directory on Windows with js/wasm, because js/wasm only uses the Unix variant of TempDir. This commit passes the temporary directory provided by Node.js to the Go runtime by adding it as a default value for the TMPDIR environment variable. It makes TempDir compatible with all platforms. Fixes #27306. Change-Id: I8b17e44cfb2ca41939ab2a4f918698fe330cb8bc Reviewed-on: https://go-review.googlesource.com/c/150437 Run-TryBot: Richard Musiol TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/wasm/wasm_exec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index 440bba104c01d..83704a054f012 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -442,7 +442,7 @@ const go = new Go(); go.argv = process.argv.slice(2); - go.env = process.env; + go.env = Object.assign({ TMPDIR: require("os").tmpdir() }, process.env); go.exit = process.exit; WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => { process.on("exit", (code) => { // Node.js exits if no callback is pending From 9ef145532420409a60542ec69ae3ed20a7d7c401 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Tue, 20 Nov 2018 16:37:50 +0100 Subject: [PATCH 097/594] syscall: add dummy SIGTERM constant to js/wasm The js/wasm architecture does not support signals at all, but there are already some signal constants defined because of stdlib dependencies. This change adds a dummy constant for syscall.SIGTERM as well, to make js/wasm compatible with more existing Go code. There is the Go proverb "Syscall must always be guarded with build tags.", so code should not expect syscall.SIGTERM to exist. Still, adding SIGTERM should do more good than harm. Fixes #28719. Change-Id: I3554b484f96a21427491c04eb1dd57e7af5bd62f Reviewed-on: https://go-review.googlesource.com/c/150477 Run-TryBot: Richard Musiol Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/syscall/syscall_js.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/syscall/syscall_js.go b/src/syscall/syscall_js.go index 6822eec8359ca..2e1a9ec9f1fef 100644 --- a/src/syscall/syscall_js.go +++ b/src/syscall/syscall_js.go @@ -74,6 +74,7 @@ const ( SIGKILL SIGTRAP SIGQUIT + SIGTERM ) func (s Signal) Signal() {} From aadffd5b675254ce6235b74353ac260d2a5848e1 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 20 Nov 2018 18:35:56 +0000 Subject: [PATCH 098/594] mime: remove allocation introduced in recent fix CL 150417 was submitted before I could recommend this change to remove an unnecessary allocation. Updates #28849 Change-Id: I4cd655f62bb3d00eda6c997f074785385bceee0c Reviewed-on: https://go-review.googlesource.com/c/150498 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/mime/mediatype.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mime/mediatype.go b/src/mime/mediatype.go index fc6e0d0673d54..05390773a8afa 100644 --- a/src/mime/mediatype.go +++ b/src/mime/mediatype.go @@ -56,7 +56,8 @@ func FormatMediaType(t string, param map[string]string) string { b.WriteByte('"') offset := 0 - for index, character := range []byte(value) { + for index := 0; index < len(value); index++ { + character := value[index] if character == '"' || character == '\\' { b.WriteString(value[offset:index]) offset = index From 50c3465fad946caa545c4835ffccc6f89c762905 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 20 Nov 2018 10:15:14 -0800 Subject: [PATCH 099/594] os: permit RemoveAll with paths that end in ".." Prohibiting RemoveAll with paths that end in ".." was added with CL 137442 in this release cycle, but it worked before and it should continue to work. Also run TestRemoveAllDot on all systems; the test is not specific to the use of unlinkat and friends. Change-Id: I277784c8915cd748fec318d2936062440d5d1fde Reviewed-on: https://go-review.googlesource.com/c/150497 Reviewed-by: Tobias Klauser --- src/os/removeall_at.go | 12 +++++------- src/os/removeall_test.go | 36 ++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index 5aa1b46117158..5eea770a3e715 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -19,7 +19,8 @@ func RemoveAll(path string) error { return nil } - // Not allowed in unix + // The rmdir system call does not permit removing ".", + // so we don't permit it either. if endsWithDot(path) { return syscall.EINVAL } @@ -130,16 +131,13 @@ func openFdAt(fd int, path string) (*File, error) { return NewFile(uintptr(fd), path), nil } +// endsWithDot returns whether the final component of path is ".". func endsWithDot(path string) bool { - if path == "." || path == ".." { + if path == "." { return true } - if len(path) >= 2 && path[len(path)-2:] == "/." { + if len(path) >= 2 && path[len(path)-1] == '.' && IsPathSeparator(path[len(path)-2]) { return true } - if len(path) >= 3 && path[len(path)-3:] == "/.." { - return true - } - return false } diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go index fd3b8d22f980d..1c9f16322547a 100644 --- a/src/os/removeall_test.go +++ b/src/os/removeall_test.go @@ -215,13 +215,6 @@ func TestRemoveAllLongPath(t *testing.T) { } func TestRemoveAllDot(t *testing.T) { - switch runtime.GOOS { - case "aix", "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": - break - default: - t.Skip("skipping for not implemented platforms") - } - prevDir, err := Getwd() if err != nil { t.Fatalf("Could not get wd: %s", err) @@ -242,13 +235,32 @@ func TestRemoveAllDot(t *testing.T) { t.Errorf("RemoveAll succeed to remove .") } - err = RemoveAll("..") - if err == nil { - t.Errorf("RemoveAll succeed to remove ..") - } - err = Chdir(prevDir) if err != nil { t.Fatalf("Could not chdir %s: %s", prevDir, err) } } + +func TestRemoveAllDotDot(t *testing.T) { + t.Parallel() + + tempDir, err := ioutil.TempDir("", "TestRemoveAllDotDot-") + if err != nil { + t.Fatal(err) + } + defer RemoveAll(tempDir) + + subdir := filepath.Join(tempDir, "x") + subsubdir := filepath.Join(subdir, "y") + if err := MkdirAll(subsubdir, 0777); err != nil { + t.Fatal(err) + } + if err := RemoveAll(filepath.Join(subsubdir, "..")); err != nil { + t.Error(err) + } + for _, dir := range []string{subsubdir, subdir} { + if _, err := Stat(dir); err == nil { + t.Errorf("%s: exists after RemoveAll", dir) + } + } +} From 77807093692070801b66960b6918fb59c9b470cd Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 18 Nov 2018 17:18:37 +0100 Subject: [PATCH 100/594] os: return PathError on RemoveAll with trailing dots Return a PathError instead of an unwrapped syscall.EINVAL if the path ends with dots. As suggested by Roger Peppe in CL 150158. Change-Id: I4d82a6ff64a979b67a843a1cc4fea58ed9326aed Reviewed-on: https://go-review.googlesource.com/c/150160 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/os/removeall_at.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index 5eea770a3e715..777690ec66105 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -22,7 +22,7 @@ func RemoveAll(path string) error { // The rmdir system call does not permit removing ".", // so we don't permit it either. if endsWithDot(path) { - return syscall.EINVAL + return &PathError{"RemoveAll", path, syscall.EINVAL} } // RemoveAll recurses by deleting the path base from From f8c2f4f111f40551eafd12dadbfbc6c4bc4d37c0 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Sat, 10 Nov 2018 15:31:32 +0100 Subject: [PATCH 101/594] go/doc: disable playground for examples that use syscall/js The playground is not using GOOS=js, so it is not able to use the package syscall/js. Examples that depend on syscall/js should not show a "Run" button. Fixes #28526. Change-Id: I8b2fcdd0c0ee517a5c3864bf459f813129542389 Reviewed-on: https://go-review.googlesource.com/c/148918 Reviewed-by: Brad Fitzpatrick --- src/go/doc/example.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/go/doc/example.go b/src/go/doc/example.go index cf3547810ad1b..45350f8fd3532 100644 --- a/src/go/doc/example.go +++ b/src/go/doc/example.go @@ -268,6 +268,11 @@ func playExample(file *ast.File, f *ast.FuncDecl) *ast.File { if err != nil { continue } + if p == "syscall/js" { + // We don't support examples that import syscall/js, + // because the package syscall/js is not available in the playground. + return nil + } n := path.Base(p) if s.Name != nil { n = s.Name.Name From aff2f6ece896e0fe76a2c8853abf868f689006f0 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Tue, 20 Nov 2018 21:49:41 +0100 Subject: [PATCH 102/594] misc/wasm: add stub for fs.read on browsers Using fmt.Scanln in a browser environment caused a panic, since there was no stub for fs.read. This commit adds a stub that returns ENOSYS. Fixes #27773. Change-Id: I79b019039e4bc90da51d71a4edddf3bd7809ff45 Reviewed-on: https://go-review.googlesource.com/c/150617 Run-TryBot: Richard Musiol Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- misc/wasm/wasm_exec.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index 83704a054f012..743eaf70b2ced 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -61,6 +61,11 @@ err.code = "ENOSYS"; callback(err); }, + read(fd, buffer, offset, length, position, callback) { + const err = new Error("not implemented"); + err.code = "ENOSYS"; + callback(err); + }, fsync(fd, callback) { callback(null); }, From c6e698d5dd0d3a309c2d93368dcc451820deb66d Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Tue, 20 Nov 2018 10:20:06 -0500 Subject: [PATCH 103/594] runtime: add arg maps for sync/atomic functions in ARM64 race mode In race mode, these functions are defined and declared in different packages, which therefore don't have implicit arg maps. When they are defer'd, and the stack needs to move, the runtime fails with missing stack maps. This CL adds arg maps (FUNCDATA) to them. Updates #28848 Change-Id: I0271563b7e78e7797ce2990c303dced957efaa86 Reviewed-on: https://go-review.googlesource.com/c/150457 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/runtime/race_arm64.s | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/runtime/race_arm64.s b/src/runtime/race_arm64.s index 7223be3d68a60..48b119f8c4b76 100644 --- a/src/runtime/race_arm64.s +++ b/src/runtime/race_arm64.s @@ -192,69 +192,86 @@ TEXT runtime·racefuncexit(SB), NOSPLIT, $0-0 // Load TEXT sync∕atomic·LoadInt32(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic32_load(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·LoadInt64(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic64_load(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·LoadUint32(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·LoadInt32(SB) TEXT sync∕atomic·LoadUint64(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·LoadInt64(SB) TEXT sync∕atomic·LoadUintptr(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·LoadInt64(SB) TEXT sync∕atomic·LoadPointer(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·LoadInt64(SB) // Store TEXT sync∕atomic·StoreInt32(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic32_store(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·StoreInt64(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic64_store(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·StoreUint32(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·StoreInt32(SB) TEXT sync∕atomic·StoreUint64(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·StoreInt64(SB) TEXT sync∕atomic·StoreUintptr(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·StoreInt64(SB) // Swap TEXT sync∕atomic·SwapInt32(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic32_exchange(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·SwapInt64(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic64_exchange(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·SwapUint32(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·SwapInt32(SB) TEXT sync∕atomic·SwapUint64(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·SwapInt64(SB) TEXT sync∕atomic·SwapUintptr(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·SwapInt64(SB) // Add TEXT sync∕atomic·AddInt32(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic32_fetch_add(SB), R9 BL racecallatomic<>(SB) MOVW add+8(FP), R0 // convert fetch_add to add_fetch @@ -264,6 +281,7 @@ TEXT sync∕atomic·AddInt32(SB), NOSPLIT, $0 RET TEXT sync∕atomic·AddInt64(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic64_fetch_add(SB), R9 BL racecallatomic<>(SB) MOVD add+8(FP), R0 // convert fetch_add to add_fetch @@ -273,32 +291,40 @@ TEXT sync∕atomic·AddInt64(SB), NOSPLIT, $0 RET TEXT sync∕atomic·AddUint32(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·AddInt32(SB) TEXT sync∕atomic·AddUint64(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·AddInt64(SB) TEXT sync∕atomic·AddUintptr(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·AddInt64(SB) // CompareAndSwap TEXT sync∕atomic·CompareAndSwapInt32(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic32_compare_exchange(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·CompareAndSwapInt64(SB), NOSPLIT, $0 + GO_ARGS MOVD $__tsan_go_atomic64_compare_exchange(SB), R9 BL racecallatomic<>(SB) RET TEXT sync∕atomic·CompareAndSwapUint32(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·CompareAndSwapInt32(SB) TEXT sync∕atomic·CompareAndSwapUint64(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·CompareAndSwapInt64(SB) TEXT sync∕atomic·CompareAndSwapUintptr(SB), NOSPLIT, $0 + GO_ARGS JMP sync∕atomic·CompareAndSwapInt64(SB) // Generic atomic operation implementation. From 3068fcfa0d6535d081a6fe3fb3dc8dd30bff370f Mon Sep 17 00:00:00 2001 From: Yury Smolsky Date: Tue, 16 Oct 2018 13:03:35 +0300 Subject: [PATCH 104/594] cmd/compile: add control flow graphs to ssa.html This CL adds CFGs to ssa.html. It execs dot to generate SVG, which then gets inlined into the html. Some standard naming and javascript hacks enable integration with the rest of ssa.html. Clicking on blocks highlights the relevant part of the CFG, and vice versa. Sample output and screenshots can be seen in #28177. CFGs can be turned on with the suffix mask: :* - dump CFG for every phase :lower - just the lower phase :lower-layout - lower through layout :w,x-y - phases w and x through y Calling dot after every pass is noticeably slow, instead use the range of phases. Dead blocks are not displayed on CFG. User can zoom and pan individual CFG when the automatic adjustment has failed. Dot-related errors are reported without bringing down the process. Fixes #28177 Change-Id: Id52c42d86c4559ca737288aa10561b67a119c63d Reviewed-on: https://go-review.googlesource.com/c/142517 Run-TryBot: Yury Smolsky Reviewed-by: David Chase --- src/cmd/compile/internal/gc/main.go | 13 +- src/cmd/compile/internal/gc/ssa.go | 3 +- src/cmd/compile/internal/ssa/func.go | 1 + src/cmd/compile/internal/ssa/html.go | 344 ++++++++++++++++++++++++- src/cmd/compile/internal/ssa/layout.go | 2 + 5 files changed, 348 insertions(+), 15 deletions(-) diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index b843ebf437047..9dd28e38c3bf1 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -438,9 +438,16 @@ func Main(archInit func(*Arch)) { } ssaDump = os.Getenv("GOSSAFUNC") - if strings.HasSuffix(ssaDump, "+") { - ssaDump = ssaDump[:len(ssaDump)-1] - ssaDumpStdout = true + if ssaDump != "" { + if strings.HasSuffix(ssaDump, "+") { + ssaDump = ssaDump[:len(ssaDump)-1] + ssaDumpStdout = true + } + spl := strings.Split(ssaDump, ":") + if len(spl) > 1 { + ssaDump = spl[0] + ssaDumpCFG = spl[1] + } } trackScopes = flagDWARF diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 7a4152a9e6d48..27af607d6f0e5 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -26,6 +26,7 @@ var ssaCaches []ssa.Cache var ssaDump string // early copy of $GOSSAFUNC; the func name to dump output for var ssaDumpStdout bool // whether to dump to stdout +var ssaDumpCFG string // generate CFGs for these phases const ssaDumpFile = "ssa.html" // ssaDumpInlined holds all inlined functions when ssaDump contains a function name. @@ -155,7 +156,7 @@ func buildssa(fn *Node, worker int) *ssa.Func { s.softFloat = s.config.SoftFloat if printssa { - s.f.HTMLWriter = ssa.NewHTMLWriter(ssaDumpFile, s.f.Frontend(), name) + s.f.HTMLWriter = ssa.NewHTMLWriter(ssaDumpFile, s.f.Frontend(), name, ssaDumpCFG) // TODO: generate and print a mapping from nodes to values and blocks dumpSourcesColumn(s.f.HTMLWriter, fn) s.f.HTMLWriter.WriteAST("AST", astBuf) diff --git a/src/cmd/compile/internal/ssa/func.go b/src/cmd/compile/internal/ssa/func.go index d73d39ce288f5..7e7e2042d9da5 100644 --- a/src/cmd/compile/internal/ssa/func.go +++ b/src/cmd/compile/internal/ssa/func.go @@ -43,6 +43,7 @@ type Func struct { PrintOrHtmlSSA bool // true if GOSSAFUNC matches, true even if fe.Log() (spew phase results to stdout) is false. scheduled bool // Values in Blocks are in final order + laidout bool // Blocks are ordered NoSplit bool // true if function is marked as nosplit. Used by schedule check pass. // when register allocation is done, maps value ids to locations diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go index d76d7c7b33465..3ea83f90a271c 100644 --- a/src/cmd/compile/internal/ssa/html.go +++ b/src/cmd/compile/internal/ssa/html.go @@ -11,6 +11,7 @@ import ( "html" "io" "os" + "os/exec" "path/filepath" "strconv" "strings" @@ -20,9 +21,10 @@ type HTMLWriter struct { Logger w io.WriteCloser path string + dot *dotWriter } -func NewHTMLWriter(path string, logger Logger, funcname string) *HTMLWriter { +func NewHTMLWriter(path string, logger Logger, funcname, cfgMask string) *HTMLWriter { out, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) if err != nil { logger.Fatalf(src.NoXPos, "%v", err) @@ -32,6 +34,7 @@ func NewHTMLWriter(path string, logger Logger, funcname string) *HTMLWriter { logger.Fatalf(src.NoXPos, "%v", err) } html := HTMLWriter{w: out, Logger: logger, path: filepath.Join(pwd, path)} + html.dot = newDotWriter(cfgMask) html.start(funcname) return &html } @@ -211,6 +214,25 @@ dd.ssa-prog { color: gray; } +.zoom { + position: absolute; + float: left; + white-space: nowrap; + background-color: #eee; +} + +.zoom a:link, .zoom a:visited { + text-decoration: none; + color: blue; + font-size: 16px; + padding: 4px 2px; +} + +svg { + cursor: default; + outline: 1px solid #eee; +} + .highlight-aquamarine { background-color: aquamarine; } .highlight-coral { background-color: coral; } .highlight-lightpink { background-color: lightpink; } @@ -236,6 +258,18 @@ dd.ssa-prog { .outline-maroon { outline: maroon solid 2px; } .outline-black { outline: black solid 2px; } +ellipse.outline-blue { stroke-width: 2px; stroke: blue; } +ellipse.outline-red { stroke-width: 2px; stroke: red; } +ellipse.outline-blueviolet { stroke-width: 2px; stroke: blueviolet; } +ellipse.outline-darkolivegreen { stroke-width: 2px; stroke: darkolivegreen; } +ellipse.outline-fuchsia { stroke-width: 2px; stroke: fuchsia; } +ellipse.outline-sienna { stroke-width: 2px; stroke: sienna; } +ellipse.outline-gold { stroke-width: 2px; stroke: gold; } +ellipse.outline-orangered { stroke-width: 2px; stroke: orangered; } +ellipse.outline-teal { stroke-width: 2px; stroke: teal; } +ellipse.outline-maroon { stroke-width: 2px; stroke: maroon; } +ellipse.outline-black { stroke-width: 2px; stroke: black; } + + +// TODO: scale the graph with the viewBox attribute. +function graphReduce(id) { + var node = document.getElementById(id); + if (node) { + node.width.baseVal.value *= 0.9; + node.height.baseVal.value *= 0.9; + } + return false; +} + +function graphEnlarge(id) { + var node = document.getElementById(id); + if (node) { + node.width.baseVal.value *= 1.1; + node.height.baseVal.value *= 1.1; + } + return false; +} + +function makeDraggable(event) { + var svg = event.target; + if (window.PointerEvent) { + svg.addEventListener('pointerdown', startDrag); + svg.addEventListener('pointermove', drag); + svg.addEventListener('pointerup', endDrag); + svg.addEventListener('pointerleave', endDrag); + } else { + svg.addEventListener('mousedown', startDrag); + svg.addEventListener('mousemove', drag); + svg.addEventListener('mouseup', endDrag); + svg.addEventListener('mouseleave', endDrag); + } + + var point = svg.createSVGPoint(); + var isPointerDown = false; + var pointerOrigin; + var viewBox = svg.viewBox.baseVal; + + function getPointFromEvent (event) { + point.x = event.clientX; + point.y = event.clientY; + + // We get the current transformation matrix of the SVG and we inverse it + var invertedSVGMatrix = svg.getScreenCTM().inverse(); + return point.matrixTransform(invertedSVGMatrix); + } + + function startDrag(event) { + isPointerDown = true; + pointerOrigin = getPointFromEvent(event); + } + + function drag(event) { + if (!isPointerDown) { + return; + } + event.preventDefault(); + + var pointerPosition = getPointFromEvent(event); + viewBox.x -= (pointerPosition.x - pointerOrigin.x); + viewBox.y -= (pointerPosition.y - pointerOrigin.y); + } + + function endDrag(event) { + isPointerDown = false; + } +} `) w.WriteString("") @@ -431,7 +564,7 @@ function toggle_visibility(id) { w.WriteString(html.EscapeString(name)) w.WriteString("

") w.WriteString(` -help +help

@@ -449,6 +582,11 @@ Faded out values and blocks are dead code that has not been eliminated. Values printed in italics have a dependency cycle.

+

+CFG: Dashed edge is for unlikely branches. Blue color is for backward edges. +Edge with a dot means that this edge follows the order in which blocks were laidout. +

+
`) w.WriteString("") @@ -473,8 +611,8 @@ func (w *HTMLWriter) WriteFunc(phase, title string, f *Func) { if w == nil { return // avoid generating HTML just to discard it } - w.WriteColumn(phase, title, "", f.HTML()) - // TODO: Add visual representation of f's CFG. + //w.WriteColumn(phase, title, "", f.HTML()) + w.WriteColumn(phase, title, "", f.HTML(phase, w.dot)) } // FuncLines contains source code for a function to be displayed @@ -704,17 +842,142 @@ func (b *Block) LongHTML() string { return s } -func (f *Func) HTML() string { - var buf bytes.Buffer - fmt.Fprint(&buf, "") - p := htmlFuncPrinter{w: &buf} +func (f *Func) HTML(phase string, dot *dotWriter) string { + buf := new(bytes.Buffer) + if dot != nil { + dot.writeFuncSVG(buf, phase, f) + } + fmt.Fprint(buf, "") + p := htmlFuncPrinter{w: buf} fprintFunc(p, f) // fprintFunc(&buf, f) // TODO: HTML, not text,
for line breaks, etc. - fmt.Fprint(&buf, "
") + fmt.Fprint(buf, "
") return buf.String() } +func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) { + if d.broken { + return + } + if _, ok := d.phases[phase]; !ok { + return + } + cmd := exec.Command(d.path, "-Tsvg") + pipe, err := cmd.StdinPipe() + if err != nil { + d.broken = true + fmt.Println(err) + return + } + buf := new(bytes.Buffer) + cmd.Stdout = buf + bufErr := new(bytes.Buffer) + cmd.Stderr = bufErr + err = cmd.Start() + if err != nil { + d.broken = true + fmt.Println(err) + return + } + fmt.Fprint(pipe, `digraph "" { margin=0; size="4,40"; ranksep=.2; `) + id := strings.Replace(phase, " ", "-", -1) + fmt.Fprintf(pipe, `id="g_graph_%s";`, id) + fmt.Fprintf(pipe, `node [style=filled,fillcolor=white,fontsize=16,fontname="Menlo,Times,serif",margin="0.01,0.03"];`) + fmt.Fprintf(pipe, `edge [fontsize=16,fontname="Menlo,Times,serif"];`) + for i, b := range f.Blocks { + if b.Kind == BlockInvalid { + continue + } + layout := "" + if f.laidout { + layout = fmt.Sprintf(" #%d", i) + } + fmt.Fprintf(pipe, `%v [label="%v%s\n%v",id="graph_node_%v_%v",tooltip="%v"];`, b, b, layout, b.Kind, id, b, b.LongString()) + } + indexOf := make([]int, f.NumBlocks()) + for i, b := range f.Blocks { + indexOf[b.ID] = i + } + layoutDrawn := make([]bool, f.NumBlocks()) + + ponums := make([]int32, f.NumBlocks()) + _ = postorderWithNumbering(f, ponums) + isBackEdge := func(from, to ID) bool { + return ponums[from] <= ponums[to] + } + + for _, b := range f.Blocks { + for i, s := range b.Succs { + style := "solid" + color := "black" + arrow := "vee" + if b.unlikelyIndex() == i { + style = "dashed" + } + if f.laidout && indexOf[s.b.ID] == indexOf[b.ID]+1 { + // Red color means ordered edge. It overrides other colors. + arrow = "dotvee" + layoutDrawn[s.b.ID] = true + } else if isBackEdge(b.ID, s.b.ID) { + color = "blue" + } + fmt.Fprintf(pipe, `%v -> %v [label=" %d ",style="%s",color="%s",arrowhead="%s"];`, b, s.b, i, style, color, arrow) + } + } + if f.laidout { + fmt.Fprintln(pipe, `edge[constraint=false,color=gray,style=solid,arrowhead=dot];`) + colors := [...]string{"#eea24f", "#f38385", "#f4d164", "#ca89fc", "gray"} + ci := 0 + for i := 1; i < len(f.Blocks); i++ { + if layoutDrawn[f.Blocks[i].ID] { + continue + } + fmt.Fprintf(pipe, `%s -> %s [color="%s"];`, f.Blocks[i-1], f.Blocks[i], colors[ci]) + ci = (ci + 1) % len(colors) + } + } + fmt.Fprint(pipe, "}") + pipe.Close() + err = cmd.Wait() + if err != nil { + d.broken = true + fmt.Printf("dot: %s\n%v\n", err, bufErr.String()) + return + } + + svgID := "svg_graph_" + id + fmt.Fprintf(w, `
`, svgID, svgID) + // For now, an awful hack: edit the html as it passes through + // our fingers, finding '") io.WriteString(p.w, "") - // io.WriteString(p.w, "") } func (p htmlFuncPrinter) value(v *Value, live bool) { @@ -780,3 +1042,63 @@ func (p htmlFuncPrinter) named(n LocalSlot, vals []*Value) { } fmt.Fprintf(p.w, "") } + +type dotWriter struct { + path string + broken bool + phases map[string]bool // keys specify phases with CFGs +} + +// newDotWriter returns non-nil value when mask is valid. +// dotWriter will generate SVGs only for the phases specifed in the mask. +// mask can contain following patterns and combinations of them: +// * - all of them; +// x-y - x through y, inclusive; +// x,y - x and y, but not the passes between. +func newDotWriter(mask string) *dotWriter { + if mask == "" { + return nil + } + // User can specify phase name with _ instead of spaces. + mask = strings.Replace(mask, "_", " ", -1) + ph := make(map[string]bool) + ranges := strings.Split(mask, ",") + for _, r := range ranges { + spl := strings.Split(r, "-") + if len(spl) > 2 { + fmt.Printf("range is not valid: %v\n", mask) + return nil + } + var first, last int + if mask == "*" { + first = 0 + last = len(passes) - 1 + } else { + first = passIdxByName(spl[0]) + last = passIdxByName(spl[len(spl)-1]) + } + if first < 0 || last < 0 || first > last { + fmt.Printf("range is not valid: %v\n", r) + return nil + } + for p := first; p <= last; p++ { + ph[passes[p].name] = true + } + } + + path, err := exec.LookPath("dot") + if err != nil { + fmt.Println(err) + return nil + } + return &dotWriter{path: path, phases: ph} +} + +func passIdxByName(name string) int { + for i, p := range passes { + if p.name == name { + return i + } + } + return -1 +} diff --git a/src/cmd/compile/internal/ssa/layout.go b/src/cmd/compile/internal/ssa/layout.go index 78d5dc77fed23..338cd91c47feb 100644 --- a/src/cmd/compile/internal/ssa/layout.go +++ b/src/cmd/compile/internal/ssa/layout.go @@ -143,5 +143,7 @@ blockloop: } } } + f.laidout = true return order + //f.Blocks = order } From 4a8ce14af9941e3efbeb88b564bde76cc0b2e121 Mon Sep 17 00:00:00 2001 From: haormj Date: Wed, 21 Nov 2018 12:18:56 +0000 Subject: [PATCH 105/594] net/http: fix spelling mistake in a comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #28904 Change-Id: I8d416c47479a266735a39c926fd2f0f2bb25d57b GitHub-Last-Rev: 3a7865a5be27937833cf4f65c242c639e51665c4 GitHub-Pull-Request: golang/go#28907 Reviewed-on: https://go-review.googlesource.com/c/150737 Reviewed-by: Daniel Martí Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot --- src/net/http/transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/http/transport.go b/src/net/http/transport.go index aa76e4f537637..e1cfc668ea84f 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -2416,7 +2416,7 @@ type fakeLocker struct{} func (fakeLocker) Lock() {} func (fakeLocker) Unlock() {} -// clneTLSConfig returns a shallow clone of cfg, or a new zero tls.Config if +// cloneTLSConfig returns a shallow clone of cfg, or a new zero tls.Config if // cfg is nil. This is safe to call even if cfg is in active use by a TLS // client or server. func cloneTLSConfig(cfg *tls.Config) *tls.Config { From b8fad4b33d20224f2965a1e9cdbd931fda0ed636 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 19 Nov 2018 10:36:45 -0500 Subject: [PATCH 106/594] runtime: improve "P has cached GC work" debug info For #27993. Change-Id: I20127e8a9844c2c488f38e1ab1f8f5a27a5df03e Reviewed-on: https://go-review.googlesource.com/c/149968 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/runtime/mgc.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 2c7dd85b243c2..d4e5d055ded6f 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1934,6 +1934,19 @@ func gcMark(start_time int64) { gcw := &p.gcw if !gcw.empty() { + printlock() + print("runtime: P ", p.id, " flushedWork ", gcw.flushedWork) + if gcw.wbuf1 == nil { + print(" wbuf1=") + } else { + print(" wbuf1.n=", gcw.wbuf1.nobj) + } + if gcw.wbuf2 == nil { + print(" wbuf2=") + } else { + print(" wbuf2.n=", gcw.wbuf2.nobj) + } + print("\n") throw("P has cached GC work at end of mark termination") } // There may still be cached empty buffers, which we From 9098d1d85494810a21c6342c8f501dae8fc757d6 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 19 Nov 2018 10:37:14 -0500 Subject: [PATCH 107/594] runtime: debug code to catch bad gcWork.puts This adds a debug check to throw immediately if any pointers are added to the gcWork buffer after the mark completion barrier. The intent is to catch the source of the cached GC work that occasionally produces "P has cached GC work at end of mark termination" failures. The result should be that we get "throwOnGCWork" throws instead of "P has cached GC work at end of mark termination" throws, but with useful stack traces. This should be reverted before the release. I've been unable to reproduce this issue locally, but this issue appears fairly regularly on the builders, so the intent is to catch it on the builders. This probably slows down the GC slightly. For #27993. Change-Id: I5035e14058ad313bfbd3d68c41ec05179147a85c Reviewed-on: https://go-review.googlesource.com/c/149969 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/inl_test.go | 2 +- src/runtime/mgc.go | 6 +++++- src/runtime/mgcwork.go | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/gc/inl_test.go b/src/cmd/compile/internal/gc/inl_test.go index 5a8c19e2cb447..ba74981e9afbe 100644 --- a/src/cmd/compile/internal/gc/inl_test.go +++ b/src/cmd/compile/internal/gc/inl_test.go @@ -85,7 +85,7 @@ func TestIntendedInlining(t *testing.T) { "puintptr.ptr", "spanOf", "spanOfUnchecked", - "(*gcWork).putFast", + //"(*gcWork).putFast", // TODO(austin): For debugging #27993 "(*gcWork).tryGetFast", "(*guintptr).set", "(*markBits).advance", diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index d4e5d055ded6f..db589c3f8fae6 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1431,6 +1431,8 @@ top: goto top } + throwOnGCWork = true + // There was no global work, no local work, and no Ps // communicated work since we took markDoneSema. Therefore // there are no grey objects and no more objects can be @@ -1924,7 +1926,7 @@ func gcMark(start_time int64) { // ensured all reachable objects were marked, all of // these must be pointers to black objects. Hence we // can just discard the write barrier buffer. - if debug.gccheckmark > 0 { + if debug.gccheckmark > 0 || throwOnGCWork { // For debugging, flush the buffer and make // sure it really was all marked. wbBufFlush1(p) @@ -1956,6 +1958,8 @@ func gcMark(start_time int64) { gcw.dispose() } + throwOnGCWork = false + cachestats() // Update the marked heap stat. diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go index f2f20fcdac626..da2129ee508dd 100644 --- a/src/runtime/mgcwork.go +++ b/src/runtime/mgcwork.go @@ -22,6 +22,13 @@ const ( workbufAlloc = 32 << 10 ) +// throwOnGCWork causes any operations that add pointers to a gcWork +// buffer to throw. +// +// TODO(austin): This is a temporary debugging measure for issue +// #27993. To be removed before release. +var throwOnGCWork bool + func init() { if workbufAlloc%pageSize != 0 || workbufAlloc%_WorkbufSize != 0 { throw("bad workbufAlloc") @@ -108,6 +115,10 @@ func (w *gcWork) init() { // obj must point to the beginning of a heap object or an oblet. //go:nowritebarrierrec func (w *gcWork) put(obj uintptr) { + if throwOnGCWork { + throw("throwOnGCWork") + } + flushed := false wbuf := w.wbuf1 if wbuf == nil { @@ -142,6 +153,10 @@ func (w *gcWork) put(obj uintptr) { // otherwise it returns false and the caller needs to call put. //go:nowritebarrierrec func (w *gcWork) putFast(obj uintptr) bool { + if throwOnGCWork { + throw("throwOnGCWork") + } + wbuf := w.wbuf1 if wbuf == nil { return false @@ -163,6 +178,10 @@ func (w *gcWork) putBatch(obj []uintptr) { return } + if throwOnGCWork { + throw("throwOnGCWork") + } + flushed := false wbuf := w.wbuf1 if wbuf == nil { @@ -284,10 +303,16 @@ func (w *gcWork) balance() { return } if wbuf := w.wbuf2; wbuf.nobj != 0 { + if throwOnGCWork { + throw("throwOnGCWork") + } putfull(wbuf) w.flushedWork = true w.wbuf2 = getempty() } else if wbuf := w.wbuf1; wbuf.nobj > 4 { + if throwOnGCWork { + throw("throwOnGCWork") + } w.wbuf1 = handoff(wbuf) w.flushedWork = true // handoff did putfull } else { From 8c5c2b71f4124eb5e72cde327d740a8dbdd4eeb8 Mon Sep 17 00:00:00 2001 From: Yury Smolsky Date: Wed, 21 Nov 2018 19:06:28 +0200 Subject: [PATCH 108/594] cmd/compile: fix TestFormats by using valid formats CL 142517 has used some formats incorrectly. This change fixes it by using %v for errors and invoking Block.Kind.String(). Format map stays intact. Updates #28177 Change-Id: If53b6cc54ba3c1ffc17b005225787e3b546de404 Reviewed-on: https://go-review.googlesource.com/c/150798 Run-TryBot: Yury Smolsky TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- src/cmd/compile/internal/ssa/html.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go index 3ea83f90a271c..6b8748bdb5a95 100644 --- a/src/cmd/compile/internal/ssa/html.go +++ b/src/cmd/compile/internal/ssa/html.go @@ -893,7 +893,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) { if f.laidout { layout = fmt.Sprintf(" #%d", i) } - fmt.Fprintf(pipe, `%v [label="%v%s\n%v",id="graph_node_%v_%v",tooltip="%v"];`, b, b, layout, b.Kind, id, b, b.LongString()) + fmt.Fprintf(pipe, `%v [label="%v%s\n%v",id="graph_node_%v_%v",tooltip="%v"];`, b, b, layout, b.Kind.String(), id, b, b.LongString()) } indexOf := make([]int, f.NumBlocks()) for i, b := range f.Blocks { @@ -942,7 +942,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) { err = cmd.Wait() if err != nil { d.broken = true - fmt.Printf("dot: %s\n%v\n", err, bufErr.String()) + fmt.Printf("dot: %v\n%v\n", err, bufErr.String()) return } @@ -952,7 +952,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) { // our fingers, finding ' Date: Tue, 20 Nov 2018 16:33:33 -0500 Subject: [PATCH 109/594] cmd/compile: for non-SSA-typed params, emit simple vars. This case was missed entirely and caused such params to be unprintable. This change gives them stack addresses for the entire function (which is correct). Change-Id: Ia4f706450219e48bce65b6395d3d9792df142fb5 Reviewed-on: https://go-review.googlesource.com/c/150657 Run-TryBot: David Chase Reviewed-by: Heschi Kreinick --- src/cmd/compile/internal/gc/pgen.go | 106 +++++++++++++++++----------- 1 file changed, 63 insertions(+), 43 deletions(-) diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index d567cfe14989b..bdc66f3e275a0 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -441,55 +441,60 @@ func createSimpleVars(automDecls []*Node) ([]*Node, []*dwarf.Var, map[*Node]bool if n.IsAutoTmp() { continue } - var abbrev int - offs := n.Xoffset - switch n.Class() { - case PAUTO: - abbrev = dwarf.DW_ABRV_AUTO - if Ctxt.FixedFrameSize() == 0 { - offs -= int64(Widthptr) - } - if objabi.Framepointer_enabled(objabi.GOOS, objabi.GOARCH) || objabi.GOARCH == "arm64" { - // There is a word space for FP on ARM64 even if the frame pointer is disabled - offs -= int64(Widthptr) - } + decls = append(decls, n) + vars = append(vars, createSimpleVar(n)) + selected[n] = true + } + return decls, vars, selected +} - case PPARAM, PPARAMOUT: - abbrev = dwarf.DW_ABRV_PARAM - offs += Ctxt.FixedFrameSize() - default: - Fatalf("createSimpleVars unexpected type %v for node %v", n.Class(), n) +func createSimpleVar(n *Node) *dwarf.Var { + var abbrev int + offs := n.Xoffset + + switch n.Class() { + case PAUTO: + abbrev = dwarf.DW_ABRV_AUTO + if Ctxt.FixedFrameSize() == 0 { + offs -= int64(Widthptr) + } + if objabi.Framepointer_enabled(objabi.GOOS, objabi.GOARCH) || objabi.GOARCH == "arm64" { + // There is a word space for FP on ARM64 even if the frame pointer is disabled + offs -= int64(Widthptr) } - selected[n] = true - typename := dwarf.InfoPrefix + typesymname(n.Type) - decls = append(decls, n) - inlIndex := 0 - if genDwarfInline > 1 { - if n.InlFormal() || n.InlLocal() { - inlIndex = posInlIndex(n.Pos) + 1 - if n.InlFormal() { - abbrev = dwarf.DW_ABRV_PARAM - } + case PPARAM, PPARAMOUT: + abbrev = dwarf.DW_ABRV_PARAM + offs += Ctxt.FixedFrameSize() + default: + Fatalf("createSimpleVar unexpected class %v for node %v", n.Class(), n) + } + + typename := dwarf.InfoPrefix + typesymname(n.Type) + inlIndex := 0 + if genDwarfInline > 1 { + if n.InlFormal() || n.InlLocal() { + inlIndex = posInlIndex(n.Pos) + 1 + if n.InlFormal() { + abbrev = dwarf.DW_ABRV_PARAM } } - declpos := Ctxt.InnermostPos(n.Pos) - vars = append(vars, &dwarf.Var{ - Name: n.Sym.Name, - IsReturnValue: n.Class() == PPARAMOUT, - IsInlFormal: n.InlFormal(), - Abbrev: abbrev, - StackOffset: int32(offs), - Type: Ctxt.Lookup(typename), - DeclFile: declpos.RelFilename(), - DeclLine: declpos.RelLine(), - DeclCol: declpos.Col(), - InlIndex: int32(inlIndex), - ChildIndex: -1, - }) } - return decls, vars, selected + declpos := Ctxt.InnermostPos(n.Pos) + return &dwarf.Var{ + Name: n.Sym.Name, + IsReturnValue: n.Class() == PPARAMOUT, + IsInlFormal: n.InlFormal(), + Abbrev: abbrev, + StackOffset: int32(offs), + Type: Ctxt.Lookup(typename), + DeclFile: declpos.RelFilename(), + DeclLine: declpos.RelLine(), + DeclCol: declpos.Col(), + InlIndex: int32(inlIndex), + ChildIndex: -1, + } } // createComplexVars creates recomposed DWARF vars with location lists, @@ -541,12 +546,15 @@ func createDwarfVars(fnsym *obj.LSym, fn *Func, automDecls []*Node) ([]*Node, [] // If optimization is enabled, the list above will typically be // missing some of the original pre-optimization variables in the // function (they may have been promoted to registers, folded into - // constants, dead-coded away, etc). Here we add back in entries + // constants, dead-coded away, etc). Input arguments not eligible + // for SSA optimization are also missing. Here we add back in entries // for selected missing vars. Note that the recipe below creates a // conservative location. The idea here is that we want to // communicate to the user that "yes, there is a variable named X // in this function, but no, I don't have enough information to // reliably report its contents." + // For non-SSA-able arguments, however, the correct information + // is known -- they have a single home on the stack. for _, n := range dcl { if _, found := selected[n]; found { continue @@ -555,6 +563,18 @@ func createDwarfVars(fnsym *obj.LSym, fn *Func, automDecls []*Node) ([]*Node, [] if c == '.' || n.Type.IsUntyped() { continue } + if n.Class() == PPARAM && !canSSAType(n.Type) { + // SSA-able args get location lists, and may move in and + // out of registers, so those are handled elsewhere. + // Autos and named output params seem to get handled + // with VARDEF, which creates location lists. + // Args not of SSA-able type are treated here; they + // are homed on the stack in a single place for the + // entire call. + vars = append(vars, createSimpleVar(n)) + decls = append(decls, n) + continue + } typename := dwarf.InfoPrefix + typesymname(n.Type) decls = append(decls, n) abbrev := dwarf.DW_ABRV_AUTO_LOCLIST From 47df645473210267fd7512c5b92de00908198974 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Thu, 22 Nov 2018 00:06:42 +0100 Subject: [PATCH 110/594] os: prevent RemoveAll to remove "." on Plan 9 CL 150497 enabled TestRemoveAllDot on "noat" systems. However, this test is failing on Plan 9 because the rmdir system call allows to remove "." on Plan 9. This change prevents the "noat" implementation of RemoveAll to remove ".", so it remains consistent with the "at" implementation. Fixes #28903. Change-Id: Ifc8fe36bdd8053a4e416f0590663c844c97ce72a Reviewed-on: https://go-review.googlesource.com/c/150621 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/os/path.go | 11 +++++++++++ src/os/removeall_at.go | 11 ----------- src/os/removeall_noat.go | 7 +++++++ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/os/path.go b/src/os/path.go index e31f64c750ef2..30cc6c8b9841e 100644 --- a/src/os/path.go +++ b/src/os/path.go @@ -57,3 +57,14 @@ func MkdirAll(path string, perm FileMode) error { } return nil } + +// endsWithDot reports whether the final component of path is ".". +func endsWithDot(path string) bool { + if path == "." { + return true + } + if len(path) >= 2 && path[len(path)-1] == '.' && IsPathSeparator(path[len(path)-2]) { + return true + } + return false +} diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index 777690ec66105..c42319a831282 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -130,14 +130,3 @@ func openFdAt(fd int, path string) (*File, error) { return NewFile(uintptr(fd), path), nil } - -// endsWithDot returns whether the final component of path is ".". -func endsWithDot(path string) bool { - if path == "." { - return true - } - if len(path) >= 2 && path[len(path)-1] == '.' && IsPathSeparator(path[len(path)-2]) { - return true - } - return false -} diff --git a/src/os/removeall_noat.go b/src/os/removeall_noat.go index d382b42af33f9..80527e227c996 100644 --- a/src/os/removeall_noat.go +++ b/src/os/removeall_noat.go @@ -22,6 +22,13 @@ func RemoveAll(path string) error { return nil } + // The rmdir system call permits removing "." on Plan 9, + // so we don't permit it to remain consistent with the + // "at" implementation of RemoveAll. + if endsWithDot(path) { + return &PathError{"RemoveAll", path, syscall.EINVAL} + } + // Simple case: if Remove works, we're done. err := Remove(path) if err == nil || IsNotExist(err) { From 6d5caf38e37bf9aeba3291f1f0b0081f934b1187 Mon Sep 17 00:00:00 2001 From: Hana Kim Date: Mon, 19 Nov 2018 12:30:56 -0500 Subject: [PATCH 111/594] cmd/trace: revert internal/traceparser The performance improvement is not as big as we hoped. Until the API is feature complete, we postpone the release and avoid added complexity. This change was prepared by reverting all the changes affected src/cmd/trace and src/internal/traceparser packages after golang.org/cl/137635, and then bringing back MMU computation APIs (originally in src/internal/traceparser) to the src/internal/trace package. Revert "cmd/trace: use new traceparser to parse the raw trace files" This reverts https://golang.org/cl/145457 (commit 08816cb8d7ed16b9c804587ff02c1ad1c3af6cd5). Revert "internal/traceparser: provide parser that uses less space and parses segments of runtime trace files" This reverts https://golang.org/cl/137635 (commit daaf361f74c3665bcb364356c5a9dd9f536c78c3). Change-Id: Ic2a068a7dbaf4053cd9674ca7bde9c58e74385b4 Reviewed-on: https://go-review.googlesource.com/c/150517 Run-TryBot: Hyang-Ah Hana Kim TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- misc/nacl/testzip.proto | 3 - src/cmd/trace/annotations.go | 7 +- src/cmd/trace/annotations_test.go | 14 +- src/cmd/trace/goroutines.go | 11 +- src/cmd/trace/main.go | 49 +- src/cmd/trace/mmu.go | 6 +- src/cmd/trace/pprof.go | 64 +- src/cmd/trace/trace.go | 168 +++-- src/cmd/trace/trace_test.go | 46 +- src/cmd/trace/trace_unix_test.go | 12 +- src/go/build/deps_test.go | 4 +- src/internal/{traceparser => trace}/gc.go | 6 +- .../{traceparser => trace}/gc_test.go | 22 +- src/internal/{traceparser => trace}/mud.go | 2 +- .../{traceparser => trace}/mud_test.go | 2 +- src/internal/traceparser/consistent.go | 313 ---------- src/internal/traceparser/events.go | 312 ---------- src/internal/traceparser/file.go | 247 -------- src/internal/traceparser/filebuf/filebuf.go | 165 ----- .../traceparser/filebuf/filebuf_test.go | 204 ------ .../traceparser/filebuf/fromreader.go | 71 --- src/internal/traceparser/fuzz.go | 49 -- src/internal/traceparser/goroutines.go | 341 ---------- src/internal/traceparser/parser_test.go | 111 ---- src/internal/traceparser/raw.go | 106 ---- src/internal/traceparser/robust.go | 585 ------------------ ...ecf6e5dfb78e954e7892120b56bfca50af65-6.bad | Bin 79 -> 0 bytes ...d1787a6339366dac733a2f957a05d7aa3ac7-3.bad | Bin 50 -> 0 bytes ...24ef6753d71953e20d10638705bdccc3ba-2.weird | Bin 62 -> 0 bytes ...41b33e1bb93669f79cf3584755cc3ef7e8-2.weird | Bin 70 -> 0 bytes ...f452e473ded814ea880c602488637fc27e549.good | Bin 1982 -> 0 bytes ...d2ae08f558c494b2ef79e80b574c9f096c-8.weird | Bin 60 -> 0 bytes ...f81f6aae617eeec8dd920997ea27b3dda12b.weird | Bin 2199 -> 0 bytes ...b6e35ad7566869c887aa823fcbf69c0b80-1.weird | Bin 27 -> 0 bytes ...688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad | Bin 23 -> 0 bytes ...bfc9d27851fb054ce03002e7e25f307e2f-5.weird | Bin 65 -> 0 bytes ...a69b265c3092972a2a81e77fbcaa87061735-4.bad | Bin 41 -> 0 bytes ...e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad | Bin 36 -> 0 bytes ...c6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird | Bin 59 -> 0 bytes ...88557e64b0714b8849aacf713d17ff928e-2.weird | Bin 1683 -> 0 bytes ...5aaf1cb69fb5fae50ba8546a7cdefade57-2.weird | Bin 36 -> 0 bytes ...f078c7dc722867d781b1fd7f37ca965372-7.weird | Bin 62 -> 0 bytes ...8a3813df03f2aed0d47f6d9bc844b8cb57-4.weird | Bin 40 -> 0 bytes ...26700dda2c2ac3b8743e9f319cb313042a-1.weird | Bin 32 -> 0 bytes src/internal/traceparser/tr.go | 498 --------------- src/internal/traceparser/writer.go | 52 -- 46 files changed, 197 insertions(+), 3273 deletions(-) rename src/internal/{traceparser => trace}/gc.go (99%) rename src/internal/{traceparser => trace}/gc_test.go (89%) rename src/internal/{traceparser => trace}/mud.go (99%) rename src/internal/{traceparser => trace}/mud_test.go (99%) delete mode 100644 src/internal/traceparser/consistent.go delete mode 100644 src/internal/traceparser/events.go delete mode 100644 src/internal/traceparser/file.go delete mode 100755 src/internal/traceparser/filebuf/filebuf.go delete mode 100755 src/internal/traceparser/filebuf/filebuf_test.go delete mode 100644 src/internal/traceparser/filebuf/fromreader.go delete mode 100644 src/internal/traceparser/fuzz.go delete mode 100644 src/internal/traceparser/goroutines.go delete mode 100644 src/internal/traceparser/parser_test.go delete mode 100644 src/internal/traceparser/raw.go delete mode 100644 src/internal/traceparser/robust.go delete mode 100644 src/internal/traceparser/testdata/06dfecf6e5dfb78e954e7892120b56bfca50af65-6.bad delete mode 100644 src/internal/traceparser/testdata/0e6dd1787a6339366dac733a2f957a05d7aa3ac7-3.bad delete mode 100644 src/internal/traceparser/testdata/16970d24ef6753d71953e20d10638705bdccc3ba-2.weird delete mode 100644 src/internal/traceparser/testdata/26492441b33e1bb93669f79cf3584755cc3ef7e8-2.weird delete mode 100644 src/internal/traceparser/testdata/2ccf452e473ded814ea880c602488637fc27e549.good delete mode 100644 src/internal/traceparser/testdata/34f92cd2ae08f558c494b2ef79e80b574c9f096c-8.weird delete mode 100644 src/internal/traceparser/testdata/4557f81f6aae617eeec8dd920997ea27b3dda12b.weird delete mode 100644 src/internal/traceparser/testdata/495712b6e35ad7566869c887aa823fcbf69c0b80-1.weird delete mode 100644 src/internal/traceparser/testdata/63cd688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad delete mode 100644 src/internal/traceparser/testdata/63df44bfc9d27851fb054ce03002e7e25f307e2f-5.weird delete mode 100644 src/internal/traceparser/testdata/6aa1a69b265c3092972a2a81e77fbcaa87061735-4.bad delete mode 100644 src/internal/traceparser/testdata/7b82e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad delete mode 100644 src/internal/traceparser/testdata/94347dc6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird delete mode 100644 src/internal/traceparser/testdata/9fa93c88557e64b0714b8849aacf713d17ff928e-2.weird delete mode 100644 src/internal/traceparser/testdata/abf7185aaf1cb69fb5fae50ba8546a7cdefade57-2.weird delete mode 100644 src/internal/traceparser/testdata/d28fcef078c7dc722867d781b1fd7f37ca965372-7.weird delete mode 100644 src/internal/traceparser/testdata/d70f178a3813df03f2aed0d47f6d9bc844b8cb57-4.weird delete mode 100644 src/internal/traceparser/testdata/e68c3126700dda2c2ac3b8743e9f319cb313042a-1.weird delete mode 100644 src/internal/traceparser/tr.go delete mode 100644 src/internal/traceparser/writer.go diff --git a/misc/nacl/testzip.proto b/misc/nacl/testzip.proto index c2afa1020aae1..720663db9b463 100644 --- a/misc/nacl/testzip.proto +++ b/misc/nacl/testzip.proto @@ -157,9 +157,6 @@ go src=.. trace testdata + - traceparser - testdata - + io + mime diff --git a/src/cmd/trace/annotations.go b/src/cmd/trace/annotations.go index a4933b51bf00d..2fb1198cf6c0f 100644 --- a/src/cmd/trace/annotations.go +++ b/src/cmd/trace/annotations.go @@ -8,6 +8,7 @@ import ( "bytes" "fmt" "html/template" + "internal/trace" "log" "math" "net/http" @@ -16,8 +17,6 @@ import ( "strconv" "strings" "time" - - trace "internal/traceparser" ) func init() { @@ -309,7 +308,7 @@ func analyzeAnnotations() (annotationAnalysisResult, error) { } } // combine region info. - analyzeGoroutines(res) + analyzeGoroutines(events) for goid, stats := range gs { // gs is a global var defined in goroutines.go as a result // of analyzeGoroutines. TODO(hyangah): fix this not to depend @@ -322,7 +321,7 @@ func analyzeAnnotations() (annotationAnalysisResult, error) { } var frame trace.Frame if s.Start != nil { - frame = *res.Stacks[s.Start.StkID][0] + frame = *s.Start.Stk[0] } id := regionTypeID{Frame: frame, Type: s.Name} regions[id] = append(regions[id], regionDesc{UserRegionDesc: s, G: goid}) diff --git a/src/cmd/trace/annotations_test.go b/src/cmd/trace/annotations_test.go index 8b9daabcdb268..a9068d53c1ba2 100644 --- a/src/cmd/trace/annotations_test.go +++ b/src/cmd/trace/annotations_test.go @@ -11,7 +11,7 @@ import ( "context" "flag" "fmt" - "internal/traceparser" + traceparser "internal/trace" "io/ioutil" "reflect" "runtime/debug" @@ -338,8 +338,10 @@ func traceProgram(t *testing.T, f func(), name string) error { trace.Stop() saveTrace(buf, name) - res, err := traceparser.ParseBuffer(buf) - if err != nil { + res, err := traceparser.Parse(buf, name+".faketrace") + if err == traceparser.ErrTimeOrder { + t.Skipf("skipping due to golang.org/issue/16755: %v", err) + } else if err != nil { return err } @@ -368,15 +370,15 @@ func childrenNames(task *taskDesc) (ret []string) { return ret } -func swapLoaderData(res *traceparser.Parsed, err error) { +func swapLoaderData(res traceparser.ParseResult, err error) { // swap loader's data. parseTrace() // fool loader.once. loader.res = res loader.err = err - analyzeGoroutines(res) // fool gsInit once. - gs = res.GoroutineStats() + analyzeGoroutines(nil) // fool gsInit once. + gs = traceparser.GoroutineStats(res.Events) } diff --git a/src/cmd/trace/goroutines.go b/src/cmd/trace/goroutines.go index c954704a47170..548871a82c20a 100644 --- a/src/cmd/trace/goroutines.go +++ b/src/cmd/trace/goroutines.go @@ -9,6 +9,7 @@ package main import ( "fmt" "html/template" + "internal/trace" "log" "net/http" "reflect" @@ -16,8 +17,6 @@ import ( "strconv" "sync" "time" - - trace "internal/traceparser" ) func init() { @@ -39,15 +38,15 @@ var ( ) // analyzeGoroutines generates statistics about execution of all goroutines and stores them in gs. -func analyzeGoroutines(res *trace.Parsed) { +func analyzeGoroutines(events []*trace.Event) { gsInit.Do(func() { - gs = res.GoroutineStats() + gs = trace.GoroutineStats(events) }) } // httpGoroutines serves list of goroutine groups. func httpGoroutines(w http.ResponseWriter, r *http.Request) { - events, err := parseTrace() + events, err := parseEvents() if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return @@ -90,7 +89,7 @@ Goroutines:
func httpGoroutine(w http.ResponseWriter, r *http.Request) { // TODO(hyangah): support format=csv (raw data) - events, err := parseTrace() + events, err := parseEvents() if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return diff --git a/src/cmd/trace/main.go b/src/cmd/trace/main.go index 2f71a3d4bd4cf..f94586abf3da6 100644 --- a/src/cmd/trace/main.go +++ b/src/cmd/trace/main.go @@ -5,12 +5,12 @@ package main import ( - "bytes" + "bufio" "cmd/internal/browser" "flag" "fmt" "html/template" - trace "internal/traceparser" + "internal/trace" "io" "log" "net" @@ -115,22 +115,8 @@ func main() { dief("%v\n", err) } - if *debugFlag { // match go tool trace -d (except for Offset and Seq) - f := func(ev *trace.Event) { - desc := trace.EventDescriptions[ev.Type] - w := new(bytes.Buffer) - fmt.Fprintf(w, "%v %v p=%v g=%v", ev.Ts, desc.Name, ev.P, ev.G) - for i, a := range desc.Args { - fmt.Fprintf(w, " %v=%v", a, ev.Args[i]) - } - for i, a := range desc.SArgs { - fmt.Fprintf(w, " %v=%v", a, ev.SArgs[i]) - } - fmt.Println(w.String()) - } - for i := 0; i < len(res.Events); i++ { - f(res.Events[i]) - } + if *debugFlag { + trace.Print(res.Events) os.Exit(0) } reportMemoryUsage("after parsing trace") @@ -155,23 +141,36 @@ var ranges []Range var loader struct { once sync.Once - res *trace.Parsed + res trace.ParseResult err error } -func parseTrace() (*trace.Parsed, error) { +// parseEvents is a compatibility wrapper that returns only +// the Events part of trace.ParseResult returned by parseTrace. +func parseEvents() ([]*trace.Event, error) { + res, err := parseTrace() + if err != nil { + return nil, err + } + return res.Events, err +} + +func parseTrace() (trace.ParseResult, error) { loader.once.Do(func() { - x, err := trace.New(traceFile) + tracef, err := os.Open(traceFile) if err != nil { - loader.err = err + loader.err = fmt.Errorf("failed to open trace file: %v", err) return } - err = x.Parse(0, x.MaxTs, nil) + defer tracef.Close() + + // Parse and symbolize. + res, err := trace.Parse(bufio.NewReader(tracef), programBinary) if err != nil { - loader.err = err + loader.err = fmt.Errorf("failed to parse trace: %v", err) return } - loader.res = x + loader.res = res }) return loader.res, loader.err } diff --git a/src/cmd/trace/mmu.go b/src/cmd/trace/mmu.go index 6a7d28e61de64..b92fac652cce8 100644 --- a/src/cmd/trace/mmu.go +++ b/src/cmd/trace/mmu.go @@ -28,7 +28,7 @@ package main import ( "encoding/json" "fmt" - trace "internal/traceparser" + "internal/trace" "log" "math" "net/http" @@ -83,11 +83,11 @@ func getMMUCurve(r *http.Request) ([][]trace.MutatorUtil, *trace.MMUCurve, error mmuCache.lock.Unlock() c.init.Do(func() { - tr, err := parseTrace() + events, err := parseEvents() if err != nil { c.err = err } else { - c.util = tr.MutatorUtilization(flags) + c.util = trace.MutatorUtilization(events, flags) c.mmuCurve = trace.NewMMUCurve(c.util) } }) diff --git a/src/cmd/trace/pprof.go b/src/cmd/trace/pprof.go index cf74fe56ae3fa..3389d2799bee2 100644 --- a/src/cmd/trace/pprof.go +++ b/src/cmd/trace/pprof.go @@ -9,6 +9,7 @@ package main import ( "bufio" "fmt" + "internal/trace" "io" "io/ioutil" "net/http" @@ -20,8 +21,6 @@ import ( "strconv" "time" - trace "internal/traceparser" - "github.com/google/pprof/profile" ) @@ -61,22 +60,22 @@ type interval struct { begin, end int64 // nanoseconds. } -func pprofByGoroutine(compute func(io.Writer, map[uint64][]interval, *trace.Parsed) error) func(w io.Writer, r *http.Request) error { +func pprofByGoroutine(compute func(io.Writer, map[uint64][]interval, []*trace.Event) error) func(w io.Writer, r *http.Request) error { return func(w io.Writer, r *http.Request) error { id := r.FormValue("id") - res, err := parseTrace() + events, err := parseEvents() if err != nil { return err } - gToIntervals, err := pprofMatchingGoroutines(id, res) + gToIntervals, err := pprofMatchingGoroutines(id, events) if err != nil { return err } - return compute(w, gToIntervals, res) + return compute(w, gToIntervals, events) } } -func pprofByRegion(compute func(io.Writer, map[uint64][]interval, *trace.Parsed) error) func(w io.Writer, r *http.Request) error { +func pprofByRegion(compute func(io.Writer, map[uint64][]interval, []*trace.Event) error) func(w io.Writer, r *http.Request) error { return func(w io.Writer, r *http.Request) error { filter, err := newRegionFilter(r) if err != nil { @@ -86,7 +85,7 @@ func pprofByRegion(compute func(io.Writer, map[uint64][]interval, *trace.Parsed) if err != nil { return err } - events, _ := parseTrace() + events, _ := parseEvents() return compute(w, gToIntervals, events) } @@ -95,7 +94,7 @@ func pprofByRegion(compute func(io.Writer, map[uint64][]interval, *trace.Parsed) // pprofMatchingGoroutines parses the goroutine type id string (i.e. pc) // and returns the ids of goroutines of the matching type and its interval. // If the id string is empty, returns nil without an error. -func pprofMatchingGoroutines(id string, p *trace.Parsed) (map[uint64][]interval, error) { +func pprofMatchingGoroutines(id string, events []*trace.Event) (map[uint64][]interval, error) { if id == "" { return nil, nil } @@ -103,7 +102,7 @@ func pprofMatchingGoroutines(id string, p *trace.Parsed) (map[uint64][]interval, if err != nil { return nil, fmt.Errorf("invalid goroutine type: %v", id) } - analyzeGoroutines(p) + analyzeGoroutines(events) var res map[uint64][]interval for _, g := range gs { if g.PC != pc { @@ -172,25 +171,17 @@ func pprofMatchingRegions(filter *regionFilter) (map[uint64][]interval, error) { return gToIntervals, nil } -func stklen(p *trace.Parsed, ev *trace.Event) int { - if ev.StkID == 0 { - return 0 - } - return len(p.Stacks[ev.StkID]) -} - // computePprofIO generates IO pprof-like profile (time spent in IO wait, currently only network blocking event). -func computePprofIO(w io.Writer, gToIntervals map[uint64][]interval, res *trace.Parsed) error { - events := res.Events - prof := make(map[uint32]Record) +func computePprofIO(w io.Writer, gToIntervals map[uint64][]interval, events []*trace.Event) error { + prof := make(map[uint64]Record) for _, ev := range events { - if ev.Type != trace.EvGoBlockNet || ev.Link == nil || ev.StkID == 0 || stklen(res, ev) == 0 { + if ev.Type != trace.EvGoBlockNet || ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { continue } overlapping := pprofOverlappingDuration(gToIntervals, ev) if overlapping > 0 { rec := prof[ev.StkID] - rec.stk = res.Stacks[ev.StkID] + rec.stk = ev.Stk rec.n++ rec.time += overlapping.Nanoseconds() prof[ev.StkID] = rec @@ -200,9 +191,8 @@ func computePprofIO(w io.Writer, gToIntervals map[uint64][]interval, res *trace. } // computePprofBlock generates blocking pprof-like profile (time spent blocked on synchronization primitives). -func computePprofBlock(w io.Writer, gToIntervals map[uint64][]interval, res *trace.Parsed) error { - events := res.Events - prof := make(map[uint32]Record) +func computePprofBlock(w io.Writer, gToIntervals map[uint64][]interval, events []*trace.Event) error { + prof := make(map[uint64]Record) for _, ev := range events { switch ev.Type { case trace.EvGoBlockSend, trace.EvGoBlockRecv, trace.EvGoBlockSelect, @@ -213,13 +203,13 @@ func computePprofBlock(w io.Writer, gToIntervals map[uint64][]interval, res *tra default: continue } - if ev.Link == nil || ev.StkID == 0 || stklen(res, ev) == 0 { + if ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { continue } overlapping := pprofOverlappingDuration(gToIntervals, ev) if overlapping > 0 { rec := prof[ev.StkID] - rec.stk = res.Stacks[ev.StkID] + rec.stk = ev.Stk rec.n++ rec.time += overlapping.Nanoseconds() prof[ev.StkID] = rec @@ -229,17 +219,16 @@ func computePprofBlock(w io.Writer, gToIntervals map[uint64][]interval, res *tra } // computePprofSyscall generates syscall pprof-like profile (time spent blocked in syscalls). -func computePprofSyscall(w io.Writer, gToIntervals map[uint64][]interval, res *trace.Parsed) error { - events := res.Events - prof := make(map[uint32]Record) +func computePprofSyscall(w io.Writer, gToIntervals map[uint64][]interval, events []*trace.Event) error { + prof := make(map[uint64]Record) for _, ev := range events { - if ev.Type != trace.EvGoSysCall || ev.Link == nil || ev.StkID == 0 || stklen(res, ev) == 0 { + if ev.Type != trace.EvGoSysCall || ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { continue } overlapping := pprofOverlappingDuration(gToIntervals, ev) if overlapping > 0 { rec := prof[ev.StkID] - rec.stk = res.Stacks[ev.StkID] + rec.stk = ev.Stk rec.n++ rec.time += overlapping.Nanoseconds() prof[ev.StkID] = rec @@ -250,18 +239,17 @@ func computePprofSyscall(w io.Writer, gToIntervals map[uint64][]interval, res *t // computePprofSched generates scheduler latency pprof-like profile // (time between a goroutine become runnable and actually scheduled for execution). -func computePprofSched(w io.Writer, gToIntervals map[uint64][]interval, res *trace.Parsed) error { - events := res.Events - prof := make(map[uint32]Record) +func computePprofSched(w io.Writer, gToIntervals map[uint64][]interval, events []*trace.Event) error { + prof := make(map[uint64]Record) for _, ev := range events { if (ev.Type != trace.EvGoUnblock && ev.Type != trace.EvGoCreate) || - ev.Link == nil || ev.StkID == 0 || stklen(res, ev) == 0 { + ev.Link == nil || ev.StkID == 0 || len(ev.Stk) == 0 { continue } overlapping := pprofOverlappingDuration(gToIntervals, ev) if overlapping > 0 { rec := prof[ev.StkID] - rec.stk = res.Stacks[ev.StkID] + rec.stk = ev.Stk rec.n++ rec.time += overlapping.Nanoseconds() prof[ev.StkID] = rec @@ -339,7 +327,7 @@ func serveSVGProfile(prof func(w io.Writer, r *http.Request) error) http.Handler } } -func buildProfile(prof map[uint32]Record) *profile.Profile { +func buildProfile(prof map[uint64]Record) *profile.Profile { p := &profile.Profile{ PeriodType: &profile.ValueType{Type: "trace", Unit: "count"}, Period: 1, diff --git a/src/cmd/trace/trace.go b/src/cmd/trace/trace.go index d467f371fa604..f39a397d0d650 100644 --- a/src/cmd/trace/trace.go +++ b/src/cmd/trace/trace.go @@ -7,7 +7,7 @@ package main import ( "encoding/json" "fmt" - trace "internal/traceparser" + "internal/trace" "io" "log" "math" @@ -23,7 +23,7 @@ import ( func init() { http.HandleFunc("/trace", httpTrace) - http.HandleFunc("/jsontrace", httpJSONTrace) + http.HandleFunc("/jsontrace", httpJsonTrace) http.HandleFunc("/trace_viewer_html", httpTraceViewerHTML) } @@ -38,7 +38,7 @@ func httpTrace(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), http.StatusInternalServerError) return } - html := strings.Replace(templTrace, "{{PARAMS}}", r.Form.Encode(), -1) + html := strings.ReplaceAll(templTrace, "{{PARAMS}}", r.Form.Encode()) w.Write([]byte(html)) } @@ -165,8 +165,8 @@ func httpTraceViewerHTML(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, filepath.Join(runtime.GOROOT(), "misc", "trace", "trace_viewer_full.html")) } -// httpJSONTrace serves json trace, requested from within templTrace HTML. -func httpJSONTrace(w http.ResponseWriter, r *http.Request) { +// httpJsonTrace serves json trace, requested from within templTrace HTML. +func httpJsonTrace(w http.ResponseWriter, r *http.Request) { defer debug.FreeOSMemory() defer reportMemoryUsage("after httpJsonTrace") // This is an AJAX handler, so instead of http.Error we use log.Printf to log errors. @@ -188,7 +188,7 @@ func httpJSONTrace(w http.ResponseWriter, r *http.Request) { log.Printf("failed to parse goid parameter %q: %v", goids, err) return } - analyzeGoroutines(res) + analyzeGoroutines(res.Events) g, ok := gs[goid] if !ok { log.Printf("failed to find goroutine %d", goid) @@ -202,7 +202,7 @@ func httpJSONTrace(w http.ResponseWriter, r *http.Request) { params.endTime = lastTimestamp() } params.maing = goid - params.gs = res.RelatedGoroutines(goid) + params.gs = trace.RelatedGoroutines(res.Events, goid) } else if taskids := r.FormValue("taskid"); taskids != "" { taskid, err := strconv.ParseUint(taskids, 10, 64) if err != nil { @@ -264,13 +264,12 @@ func httpJSONTrace(w http.ResponseWriter, r *http.Request) { } c := viewerDataTraceConsumer(w, start, end) - if err := generateTrace(res, params, c); err != nil { + if err := generateTrace(params, c); err != nil { log.Printf("failed to generate trace: %v", err) return } } -// Range is a named range type Range struct { Name string Start int @@ -286,13 +285,13 @@ func (r Range) URL() string { // splitTrace splits the trace into a number of ranges, // each resulting in approx 100MB of json output // (trace viewer can hardly handle more). -func splitTrace(res *trace.Parsed) []Range { +func splitTrace(res trace.ParseResult) []Range { params := &traceParams{ parsed: res, endTime: math.MaxInt64, } s, c := splittingTraceConsumer(100 << 20) // 100M - if err := generateTrace(res, params, c); err != nil { + if err := generateTrace(params, c); err != nil { dief("%v\n", err) } return s.Ranges @@ -309,7 +308,7 @@ func splittingTraceConsumer(max int) (*splitter, traceConsumer) { } var ( - data = viewerData{Frames: make(map[string]viewerFrame)} + data = ViewerData{Frames: make(map[string]ViewerFrame)} sizes []eventSz cw countingWriter @@ -321,7 +320,7 @@ func splittingTraceConsumer(max int) (*splitter, traceConsumer) { consumeTimeUnit: func(unit string) { data.TimeUnit = unit }, - consumeViewerEvent: func(v *viewerEvent, required bool) { + consumeViewerEvent: func(v *ViewerEvent, required bool) { if required { // Store required events inside data // so flush can include them in the required @@ -334,7 +333,7 @@ func splittingTraceConsumer(max int) (*splitter, traceConsumer) { sizes = append(sizes, eventSz{v.Time, cw.size + 1}) // +1 for ",". cw.size = 0 }, - consumeViewerFrame: func(k string, v viewerFrame) { + consumeViewerFrame: func(k string, v ViewerFrame) { data.Frames[k] = v }, flush: func() { @@ -395,7 +394,7 @@ func (cw *countingWriter) Write(data []byte) (int, error) { } type traceParams struct { - parsed *trace.Parsed + parsed trace.ParseResult mode traceviewMode startTime int64 endTime int64 @@ -412,7 +411,6 @@ const ( ) type traceContext struct { - res *trace.Parsed *traceParams consumer traceConsumer frameTree frameNode @@ -463,16 +461,16 @@ type gInfo struct { markAssist *trace.Event // if non-nil, the mark assist currently running. } -type viewerData struct { - Events []*viewerEvent `json:"traceEvents"` - Frames map[string]viewerFrame `json:"stackFrames"` +type ViewerData struct { + Events []*ViewerEvent `json:"traceEvents"` + Frames map[string]ViewerFrame `json:"stackFrames"` TimeUnit string `json:"displayTimeUnit"` // This is where mandatory part of the trace starts (e.g. thread names) footer int } -type viewerEvent struct { +type ViewerEvent struct { Name string `json:"name,omitempty"` Phase string `json:"ph"` Scope string `json:"s,omitempty"` @@ -488,33 +486,33 @@ type viewerEvent struct { Category string `json:"cat,omitempty"` } -type viewerFrame struct { +type ViewerFrame struct { Name string `json:"name"` Parent int `json:"parent,omitempty"` } -type nameArg struct { +type NameArg struct { Name string `json:"name"` } -type taskArg struct { +type TaskArg struct { ID uint64 `json:"id"` StartG uint64 `json:"start_g,omitempty"` EndG uint64 `json:"end_g,omitempty"` } -type regionArg struct { +type RegionArg struct { TaskID uint64 `json:"taskid,omitempty"` } -type sortIndexArg struct { +type SortIndexArg struct { Index int `json:"sort_index"` } type traceConsumer struct { consumeTimeUnit func(unit string) - consumeViewerEvent func(v *viewerEvent, required bool) - consumeViewerFrame func(key string, f viewerFrame) + consumeViewerEvent func(v *ViewerEvent, required bool) + consumeViewerFrame func(key string, f ViewerFrame) flush func() } @@ -531,15 +529,15 @@ const ( // If mode==goroutineMode, generate trace for goroutine goid, otherwise whole trace. // startTime, endTime determine part of the trace that we are interested in. // gset restricts goroutines that are included in the resulting trace. -func generateTrace(res *trace.Parsed, params *traceParams, consumer traceConsumer) error { +func generateTrace(params *traceParams, consumer traceConsumer) error { defer consumer.flush() - ctx := &traceContext{res: res, traceParams: params} + ctx := &traceContext{traceParams: params} ctx.frameTree.children = make(map[uint64]frameNode) ctx.consumer = consumer ctx.consumer.consumeTimeUnit("ns") - maxProc := int32(0) + maxProc := 0 ginfos := make(map[uint64]*gInfo) stacks := params.parsed.Stacks @@ -584,12 +582,12 @@ func generateTrace(res *trace.Parsed, params *traceParams, consumer traceConsume newG := ev.Args[0] info := getGInfo(newG) if info.name != "" { - return fmt.Errorf("duplicate go create event for go id=%d detected at time %d", newG, ev.Ts) + return fmt.Errorf("duplicate go create event for go id=%d detected at offset %d", newG, ev.Off) } - stk, ok := stacks[uint32(ev.Args[1])] + stk, ok := stacks[ev.Args[1]] if !ok || len(stk) == 0 { - return fmt.Errorf("invalid go create event: missing stack information for go id=%d at time %d", newG, ev.Ts) + return fmt.Errorf("invalid go create event: missing stack information for go id=%d at offset %d", newG, ev.Off) } fname := stk[0].Fn @@ -760,23 +758,23 @@ func generateTrace(res *trace.Parsed, params *traceParams, consumer traceConsume ctx.emitSectionFooter(procsSection, "PROCS", 2) } - ctx.emitFooter(&viewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.GCP, Arg: &nameArg{"GC"}}) - ctx.emitFooter(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.GCP, Arg: &sortIndexArg{-6}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.GCP, Arg: &NameArg{"GC"}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.GCP, Arg: &SortIndexArg{-6}}) - ctx.emitFooter(&viewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.NetpollP, Arg: &nameArg{"Network"}}) - ctx.emitFooter(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.NetpollP, Arg: &sortIndexArg{-5}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.NetpollP, Arg: &NameArg{"Network"}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.NetpollP, Arg: &SortIndexArg{-5}}) - ctx.emitFooter(&viewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.TimerP, Arg: &nameArg{"Timers"}}) - ctx.emitFooter(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.TimerP, Arg: &sortIndexArg{-4}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.TimerP, Arg: &NameArg{"Timers"}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.TimerP, Arg: &SortIndexArg{-4}}) - ctx.emitFooter(&viewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.SyscallP, Arg: &nameArg{"Syscalls"}}) - ctx.emitFooter(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.SyscallP, Arg: &sortIndexArg{-3}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: trace.SyscallP, Arg: &NameArg{"Syscalls"}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: trace.SyscallP, Arg: &SortIndexArg{-3}}) // Display rows for Ps if we are in the default trace view mode (not goroutine-oriented presentation) if ctx.mode&modeGoroutineOriented == 0 { - for i := 0; i <= int(maxProc); i++ { - ctx.emitFooter(&viewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: uint64(i), Arg: &nameArg{fmt.Sprintf("Proc %v", i)}}) - ctx.emitFooter(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: uint64(i), Arg: &sortIndexArg{i}}) + for i := 0; i <= maxProc; i++ { + ctx.emitFooter(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: uint64(i), Arg: &NameArg{fmt.Sprintf("Proc %v", i)}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: uint64(i), Arg: &SortIndexArg{i}}) } } @@ -814,27 +812,27 @@ func generateTrace(res *trace.Parsed, params *traceParams, consumer traceConsume if !ctx.gs[k] { continue } - ctx.emitFooter(&viewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: k, Arg: &nameArg{v.name}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: procsSection, Tid: k, Arg: &NameArg{v.name}}) } // Row for the main goroutine (maing) - ctx.emitFooter(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: ctx.maing, Arg: &sortIndexArg{-2}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: ctx.maing, Arg: &SortIndexArg{-2}}) // Row for GC or global state (specified with G=0) - ctx.emitFooter(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: 0, Arg: &sortIndexArg{-1}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: procsSection, Tid: 0, Arg: &SortIndexArg{-1}}) } return nil } -func (ctx *traceContext) emit(e *viewerEvent) { +func (ctx *traceContext) emit(e *ViewerEvent) { ctx.consumer.consumeViewerEvent(e, false) } -func (ctx *traceContext) emitFooter(e *viewerEvent) { +func (ctx *traceContext) emitFooter(e *ViewerEvent) { ctx.consumer.consumeViewerEvent(e, true) } func (ctx *traceContext) emitSectionFooter(sectionID uint64, name string, priority int) { - ctx.emitFooter(&viewerEvent{Name: "process_name", Phase: "M", Pid: sectionID, Arg: &nameArg{name}}) - ctx.emitFooter(&viewerEvent{Name: "process_sort_index", Phase: "M", Pid: sectionID, Arg: &sortIndexArg{priority}}) + ctx.emitFooter(&ViewerEvent{Name: "process_name", Phase: "M", Pid: sectionID, Arg: &NameArg{name}}) + ctx.emitFooter(&ViewerEvent{Name: "process_sort_index", Phase: "M", Pid: sectionID, Arg: &SortIndexArg{priority}}) } func (ctx *traceContext) time(ev *trace.Event) float64 { @@ -856,30 +854,31 @@ func tsWithinRange(ts, s, e int64) bool { func (ctx *traceContext) proc(ev *trace.Event) uint64 { if ctx.mode&modeGoroutineOriented != 0 && ev.P < trace.FakeP { return ev.G + } else { + return uint64(ev.P) } - return uint64(ev.P) } func (ctx *traceContext) emitSlice(ev *trace.Event, name string) { ctx.emit(ctx.makeSlice(ev, name)) } -func (ctx *traceContext) makeSlice(ev *trace.Event, name string) *viewerEvent { - // If viewerEvent.Dur is not a positive value, +func (ctx *traceContext) makeSlice(ev *trace.Event, name string) *ViewerEvent { + // If ViewerEvent.Dur is not a positive value, // trace viewer handles it as a non-terminating time interval. // Avoid it by setting the field with a small value. durationUsec := ctx.time(ev.Link) - ctx.time(ev) - if ev.Link == nil || ev.Link.Ts-ev.Ts <= 0 { + if ev.Link.Ts-ev.Ts <= 0 { durationUsec = 0.0001 // 0.1 nanoseconds } - sl := &viewerEvent{ + sl := &ViewerEvent{ Name: name, Phase: "X", Time: ctx.time(ev), Dur: durationUsec, Tid: ctx.proc(ev), - Stack: ctx.stack(ctx.res.Stacks[ev.StkID]), - EndStack: ctx.stack(ctx.res.Stacks[ev.Link.StkID]), + Stack: ctx.stack(ev.Stk), + EndStack: ctx.stack(ev.Link.Stk), } // grey out non-overlapping events if the event is not a global event (ev.G == 0) @@ -889,7 +888,7 @@ func (ctx *traceContext) makeSlice(ev *trace.Event, name string) *viewerEvent { type Arg struct { P int } - sl.Arg = &Arg{P: int(ev.P)} + sl.Arg = &Arg{P: ev.P} } // grey out non-overlapping events. overlapping := false @@ -911,10 +910,10 @@ func (ctx *traceContext) emitTask(task *taskDesc, sortIndex int) { taskName := task.name durationUsec := float64(task.lastTimestamp()-task.firstTimestamp()) / 1e3 - ctx.emitFooter(&viewerEvent{Name: "thread_name", Phase: "M", Pid: tasksSection, Tid: taskRow, Arg: &nameArg{fmt.Sprintf("T%d %s", task.id, taskName)}}) - ctx.emit(&viewerEvent{Name: "thread_sort_index", Phase: "M", Pid: tasksSection, Tid: taskRow, Arg: &sortIndexArg{sortIndex}}) + ctx.emitFooter(&ViewerEvent{Name: "thread_name", Phase: "M", Pid: tasksSection, Tid: taskRow, Arg: &NameArg{fmt.Sprintf("T%d %s", task.id, taskName)}}) + ctx.emit(&ViewerEvent{Name: "thread_sort_index", Phase: "M", Pid: tasksSection, Tid: taskRow, Arg: &SortIndexArg{sortIndex}}) ts := float64(task.firstTimestamp()) / 1e3 - sl := &viewerEvent{ + sl := &ViewerEvent{ Name: taskName, Phase: "X", Time: ts, @@ -923,13 +922,13 @@ func (ctx *traceContext) emitTask(task *taskDesc, sortIndex int) { Tid: taskRow, Cname: pickTaskColor(task.id), } - targ := taskArg{ID: task.id} + targ := TaskArg{ID: task.id} if task.create != nil { - sl.Stack = ctx.stack(ctx.res.Stacks[task.create.StkID]) + sl.Stack = ctx.stack(task.create.Stk) targ.StartG = task.create.G } if task.end != nil { - sl.EndStack = ctx.stack(ctx.res.Stacks[task.end.StkID]) + sl.EndStack = ctx.stack(task.end.Stk) targ.EndG = task.end.G } sl.Arg = targ @@ -937,8 +936,8 @@ func (ctx *traceContext) emitTask(task *taskDesc, sortIndex int) { if task.create != nil && task.create.Type == trace.EvUserTaskCreate && task.create.Args[1] != 0 { ctx.arrowSeq++ - ctx.emit(&viewerEvent{Name: "newTask", Phase: "s", Tid: task.create.Args[1], ID: ctx.arrowSeq, Time: ts, Pid: tasksSection}) - ctx.emit(&viewerEvent{Name: "newTask", Phase: "t", Tid: taskRow, ID: ctx.arrowSeq, Time: ts, Pid: tasksSection}) + ctx.emit(&ViewerEvent{Name: "newTask", Phase: "s", Tid: task.create.Args[1], ID: ctx.arrowSeq, Time: ts, Pid: tasksSection}) + ctx.emit(&ViewerEvent{Name: "newTask", Phase: "t", Tid: taskRow, ID: ctx.arrowSeq, Time: ts, Pid: tasksSection}) } } @@ -959,7 +958,7 @@ func (ctx *traceContext) emitRegion(s regionDesc) { scopeID := fmt.Sprintf("%x", id) name := s.Name - sl0 := &viewerEvent{ + sl0 := &ViewerEvent{ Category: "Region", Name: name, Phase: "b", @@ -970,11 +969,11 @@ func (ctx *traceContext) emitRegion(s regionDesc) { Cname: pickTaskColor(s.TaskID), } if s.Start != nil { - sl0.Stack = ctx.stack(ctx.res.Stacks[s.Start.StkID]) + sl0.Stack = ctx.stack(s.Start.Stk) } ctx.emit(sl0) - sl1 := &viewerEvent{ + sl1 := &ViewerEvent{ Category: "Region", Name: name, Phase: "e", @@ -983,10 +982,10 @@ func (ctx *traceContext) emitRegion(s regionDesc) { ID: uint64(regionID), Scope: scopeID, Cname: pickTaskColor(s.TaskID), - Arg: regionArg{TaskID: s.TaskID}, + Arg: RegionArg{TaskID: s.TaskID}, } if s.End != nil { - sl1.Stack = ctx.stack(ctx.res.Stacks[s.End.StkID]) + sl1.Stack = ctx.stack(s.End.Stk) } ctx.emit(sl1) } @@ -1005,7 +1004,7 @@ func (ctx *traceContext) emitHeapCounters(ev *trace.Event) { diff = ctx.heapStats.nextGC - ctx.heapStats.heapAlloc } if tsWithinRange(ev.Ts, ctx.startTime, ctx.endTime) { - ctx.emit(&viewerEvent{Name: "Heap", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &heapCountersArg{ctx.heapStats.heapAlloc, diff}}) + ctx.emit(&ViewerEvent{Name: "Heap", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &heapCountersArg{ctx.heapStats.heapAlloc, diff}}) } ctx.prevHeapStats = ctx.heapStats } @@ -1021,7 +1020,7 @@ func (ctx *traceContext) emitGoroutineCounters(ev *trace.Event) { return } if tsWithinRange(ev.Ts, ctx.startTime, ctx.endTime) { - ctx.emit(&viewerEvent{Name: "Goroutines", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &goroutineCountersArg{uint64(ctx.gstates[gRunning]), uint64(ctx.gstates[gRunnable]), uint64(ctx.gstates[gWaitingGC])}}) + ctx.emit(&ViewerEvent{Name: "Goroutines", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &goroutineCountersArg{uint64(ctx.gstates[gRunning]), uint64(ctx.gstates[gRunnable]), uint64(ctx.gstates[gWaitingGC])}}) } ctx.prevGstates = ctx.gstates } @@ -1036,7 +1035,7 @@ func (ctx *traceContext) emitThreadCounters(ev *trace.Event) { return } if tsWithinRange(ev.Ts, ctx.startTime, ctx.endTime) { - ctx.emit(&viewerEvent{Name: "Threads", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &threadCountersArg{ + ctx.emit(&ViewerEvent{Name: "Threads", Phase: "C", Time: ctx.time(ev), Pid: 1, Arg: &threadCountersArg{ Running: ctx.threadStats.prunning, InSyscall: ctx.threadStats.insyscall}}) } @@ -1074,14 +1073,14 @@ func (ctx *traceContext) emitInstant(ev *trace.Event, name, category string) { } arg = &Arg{ev.Args[0]} } - ctx.emit(&viewerEvent{ + ctx.emit(&ViewerEvent{ Name: name, Category: category, Phase: "I", Scope: "t", Time: ctx.time(ev), Tid: ctx.proc(ev), - Stack: ctx.stack(ctx.res.Stacks[ev.StkID]), + Stack: ctx.stack(ev.Stk), Cname: cname, Arg: arg}) } @@ -1118,11 +1117,8 @@ func (ctx *traceContext) emitArrow(ev *trace.Event, name string) { } ctx.arrowSeq++ - ctx.emit(&viewerEvent{Name: name, Phase: "s", Tid: ctx.proc(ev), - ID: ctx.arrowSeq, Time: ctx.time(ev), - Stack: ctx.stack(ctx.res.Stacks[ev.StkID]), Cname: color}) - ctx.emit(&viewerEvent{Name: name, Phase: "t", Tid: ctx.proc(ev.Link), - ID: ctx.arrowSeq, Time: ctx.time(ev.Link), Cname: color}) + ctx.emit(&ViewerEvent{Name: name, Phase: "s", Tid: ctx.proc(ev), ID: ctx.arrowSeq, Time: ctx.time(ev), Stack: ctx.stack(ev.Stk), Cname: color}) + ctx.emit(&ViewerEvent{Name: name, Phase: "t", Tid: ctx.proc(ev.Link), ID: ctx.arrowSeq, Time: ctx.time(ev.Link), Cname: color}) } func (ctx *traceContext) stack(stk []*trace.Frame) int { @@ -1144,7 +1140,7 @@ func (ctx *traceContext) buildBranch(parent frameNode, stk []*trace.Frame) int { node.id = ctx.frameSeq node.children = make(map[uint64]frameNode) parent.children[frame.PC] = node - ctx.consumer.consumeViewerFrame(strconv.Itoa(node.id), viewerFrame{fmt.Sprintf("%v:%v", frame.Fn, frame.Line), parent.id}) + ctx.consumer.consumeViewerFrame(strconv.Itoa(node.id), ViewerFrame{fmt.Sprintf("%v:%v", frame.Fn, frame.Line), parent.id}) } return ctx.buildBranch(node, stk) } @@ -1179,7 +1175,7 @@ type jsonWriter struct { } func viewerDataTraceConsumer(w io.Writer, start, end int64) traceConsumer { - frames := make(map[string]viewerFrame) + frames := make(map[string]ViewerFrame) enc := json.NewEncoder(w) written := 0 index := int64(-1) @@ -1191,7 +1187,7 @@ func viewerDataTraceConsumer(w io.Writer, start, end int64) traceConsumer { enc.Encode(unit) io.WriteString(w, ",") }, - consumeViewerEvent: func(v *viewerEvent, required bool) { + consumeViewerEvent: func(v *ViewerEvent, required bool) { index++ if !required && (index < start || index > end) { // not in the range. Skip! @@ -1208,7 +1204,7 @@ func viewerDataTraceConsumer(w io.Writer, start, end int64) traceConsumer { // Same should be applied to splittingTraceConsumer. written++ }, - consumeViewerFrame: func(k string, v viewerFrame) { + consumeViewerFrame: func(k string, v ViewerFrame) { frames[k] = v }, flush: func() { diff --git a/src/cmd/trace/trace_test.go b/src/cmd/trace/trace_test.go index abeb330924d35..9e90f50d4ba91 100644 --- a/src/cmd/trace/trace_test.go +++ b/src/cmd/trace/trace_test.go @@ -8,27 +8,26 @@ package main import ( "context" + "internal/trace" "io/ioutil" rtrace "runtime/trace" "strings" "testing" - - trace "internal/traceparser" ) // stacks is a fake stack map populated for test. -type stacks map[uint32][]*trace.Frame +type stacks map[uint64][]*trace.Frame // add adds a stack with a single frame whose Fn field is // set to the provided fname and returns a unique stack id. func (s *stacks) add(fname string) uint64 { if *s == nil { - *s = make(map[uint32][]*trace.Frame) + *s = make(map[uint64][]*trace.Frame) } - id := uint32(len(*s)) + id := uint64(len(*s)) (*s)[id] = []*trace.Frame{{Fn: fname}} - return uint64(id) + return id } // TestGoroutineCount tests runnable/running goroutine counts computed by generateTrace @@ -37,7 +36,8 @@ func (s *stacks) add(fname string) uint64 { // - the counts must not include goroutines blocked waiting on channels or in syscall. func TestGoroutineCount(t *testing.T) { w := trace.NewWriter() - w.Emit(trace.EvBatch, 0, 0) // start of per-P batch event [pid, timestamp] + w.Emit(trace.EvBatch, 0, 0) // start of per-P batch event [pid, timestamp] + w.Emit(trace.EvFrequency, 1) // [ticks per second] var s stacks @@ -61,9 +61,8 @@ func TestGoroutineCount(t *testing.T) { w.Emit(trace.EvGoCreate, 1, 40, s.add("pkg.f4"), s.add("main.f4")) w.Emit(trace.EvGoStartLocal, 1, 40) // [timestamp, goroutine id] w.Emit(trace.EvGoSched, 1, s.add("main.f4")) // [timestamp, stack] - w.Emit(trace.EvFrequency, 1) // [ticks per second] - res, err := trace.ParseBuffer(w) + res, err := trace.Parse(w, "") if err != nil { t.Fatalf("failed to parse test trace: %v", err) } @@ -75,9 +74,9 @@ func TestGoroutineCount(t *testing.T) { } // Use the default viewerDataTraceConsumer but replace - // consumeViewerEvent to intercept the viewerEvents for testing. + // consumeViewerEvent to intercept the ViewerEvents for testing. c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1) - c.consumeViewerEvent = func(ev *viewerEvent, _ bool) { + c.consumeViewerEvent = func(ev *ViewerEvent, _ bool) { if ev.Name == "Goroutines" { cnt := ev.Arg.(*goroutineCountersArg) if cnt.Runnable+cnt.Running > 2 { @@ -88,7 +87,7 @@ func TestGoroutineCount(t *testing.T) { } // If the counts drop below 0, generateTrace will return an error. - if err := generateTrace(res, params, c); err != nil { + if err := generateTrace(params, c); err != nil { t.Fatalf("generateTrace failed: %v", err) } } @@ -100,7 +99,8 @@ func TestGoroutineFilter(t *testing.T) { var s stacks w := trace.NewWriter() - w.Emit(trace.EvBatch, 0, 0) // start of per-P batch event [pid, timestamp] + w.Emit(trace.EvBatch, 0, 0) // start of per-P batch event [pid, timestamp] + w.Emit(trace.EvFrequency, 1) // [ticks per second] // goroutine 10: blocked w.Emit(trace.EvGoCreate, 1, 10, s.add("pkg.f1"), s.add("main.f1")) // [timestamp, new goroutine id, new stack id, stack id] @@ -115,9 +115,8 @@ func TestGoroutineFilter(t *testing.T) { // goroutine 10: runnable->running->block w.Emit(trace.EvGoStartLocal, 1, 10) // [timestamp, goroutine id] w.Emit(trace.EvGoBlock, 1, s.add("pkg.f3")) // [timestamp, stack] - w.Emit(trace.EvFrequency, 1) // [ticks per second] - res, err := trace.ParseBuffer(w) + res, err := trace.Parse(w, "") if err != nil { t.Fatalf("failed to parse test trace: %v", err) } @@ -130,14 +129,15 @@ func TestGoroutineFilter(t *testing.T) { } c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1) - if err := generateTrace(res, params, c); err != nil { + if err := generateTrace(params, c); err != nil { t.Fatalf("generateTrace failed: %v", err) } } func TestPreemptedMarkAssist(t *testing.T) { w := trace.NewWriter() - w.Emit(trace.EvBatch, 0, 0) // start of per-P batch event [pid, timestamp] + w.Emit(trace.EvBatch, 0, 0) // start of per-P batch event [pid, timestamp] + w.Emit(trace.EvFrequency, 1) // [ticks per second] var s stacks // goroutine 9999: running -> mark assisting -> preempted -> assisting -> running -> block @@ -148,13 +148,11 @@ func TestPreemptedMarkAssist(t *testing.T) { w.Emit(trace.EvGoStartLocal, 1, 9999) // [timestamp, goroutine id] w.Emit(trace.EvGCMarkAssistDone, 1) // [timestamp] w.Emit(trace.EvGoBlock, 1, s.add("main.f2")) // [timestamp, stack] - w.Emit(trace.EvFrequency, 1) // [ticks per second] - res, err := trace.ParseBuffer(w) + res, err := trace.Parse(w, "") if err != nil { t.Fatalf("failed to parse test trace: %v", err) } - t.Logf("%+v", *res) res.Stacks = s // use fake stacks params := &traceParams{ @@ -165,12 +163,12 @@ func TestPreemptedMarkAssist(t *testing.T) { c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1) marks := 0 - c.consumeViewerEvent = func(ev *viewerEvent, _ bool) { + c.consumeViewerEvent = func(ev *ViewerEvent, _ bool) { if strings.Contains(ev.Name, "MARK ASSIST") { marks++ } } - if err := generateTrace(res, params, c); err != nil { + if err := generateTrace(params, c); err != nil { t.Fatalf("generateTrace failed: %v", err) } @@ -216,7 +214,7 @@ func TestFoo(t *testing.T) { c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1) var logBeforeTaskEnd, logAfterTaskEnd bool - c.consumeViewerEvent = func(ev *viewerEvent, _ bool) { + c.consumeViewerEvent = func(ev *ViewerEvent, _ bool) { if ev.Name == "log before task ends" { logBeforeTaskEnd = true } @@ -224,7 +222,7 @@ func TestFoo(t *testing.T) { logAfterTaskEnd = true } } - if err := generateTrace(res, params, c); err != nil { + if err := generateTrace(params, c); err != nil { t.Fatalf("generateTrace failed: %v", err) } if !logBeforeTaskEnd { diff --git a/src/cmd/trace/trace_unix_test.go b/src/cmd/trace/trace_unix_test.go index 144642ad9e926..fec060e121aef 100644 --- a/src/cmd/trace/trace_unix_test.go +++ b/src/cmd/trace/trace_unix_test.go @@ -8,7 +8,7 @@ package main import ( "bytes" - "internal/traceparser" + traceparser "internal/trace" "io/ioutil" "runtime" "runtime/trace" @@ -73,15 +73,17 @@ func TestGoroutineInSyscall(t *testing.T) { } trace.Stop() - res, err := traceparser.ParseBuffer(buf) - if err != nil { + res, err := traceparser.Parse(buf, "") + if err == traceparser.ErrTimeOrder { + t.Skipf("skipping due to golang.org/issue/16755 (timestamps are unreliable): %v", err) + } else if err != nil { t.Fatalf("failed to parse trace: %v", err) } // Check only one thread for the pipe read goroutine is // considered in-syscall. c := viewerDataTraceConsumer(ioutil.Discard, 0, 1<<63-1) - c.consumeViewerEvent = func(ev *viewerEvent, _ bool) { + c.consumeViewerEvent = func(ev *ViewerEvent, _ bool) { if ev.Name == "Threads" { arg := ev.Arg.(*threadCountersArg) if arg.InSyscall > 1 { @@ -94,7 +96,7 @@ func TestGoroutineInSyscall(t *testing.T) { parsed: res, endTime: int64(1<<63 - 1), } - if err := generateTrace(res, param, c); err != nil { + if err := generateTrace(param, c); err != nil { t.Fatalf("failed to generate ViewerData: %v", err) } } diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index 0ecf38c567df1..bf447029b887b 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -272,9 +272,7 @@ var pkgDeps = map[string][]string{ "index/suffixarray": {"L4", "regexp"}, "internal/goroot": {"L4", "OS"}, "internal/singleflight": {"sync"}, - "internal/trace": {"L4", "OS"}, - "internal/traceparser": {"L4", "internal/traceparser/filebuf", "container/heap"}, - "internal/traceparser/filebuf": {"L4", "OS"}, + "internal/trace": {"L4", "OS", "container/heap"}, "math/big": {"L4"}, "mime": {"L4", "OS", "syscall", "internal/syscall/windows/registry"}, "mime/quotedprintable": {"L4"}, diff --git a/src/internal/traceparser/gc.go b/src/internal/trace/gc.go similarity index 99% rename from src/internal/traceparser/gc.go rename to src/internal/trace/gc.go index a5b29112b35dc..cc19fdf8912d2 100644 --- a/src/internal/traceparser/gc.go +++ b/src/internal/trace/gc.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package traceparser +package trace import ( "container/heap" @@ -50,8 +50,7 @@ const ( // // If the UtilPerProc flag is not given, this always returns a single // utilization function. Otherwise, it returns one function per P. -func (p *Parsed) MutatorUtilization(flags UtilFlags) [][]MutatorUtil { - events := p.Events +func MutatorUtilization(events []*Event, flags UtilFlags) [][]MutatorUtil { if len(events) == 0 { return nil } @@ -474,6 +473,7 @@ func (acc *accumulator) addMU(time int64, mu float64, window time.Duration) bool } keep: } + if len(acc.wHeap) < acc.nWorst { // We don't have N windows yet, so keep accumulating. acc.bound = 1.0 diff --git a/src/internal/traceparser/gc_test.go b/src/internal/trace/gc_test.go similarity index 89% rename from src/internal/traceparser/gc_test.go rename to src/internal/trace/gc_test.go index 0b07f735f826e..da1cb90f5cdf3 100644 --- a/src/internal/traceparser/gc_test.go +++ b/src/internal/trace/gc_test.go @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package traceparser +package trace import ( + "bytes" + "io/ioutil" "math" - "runtime" "testing" "time" ) @@ -76,20 +77,18 @@ func TestMMU(t *testing.T) { } func TestMMUTrace(t *testing.T) { - if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { - t.Skipf("files from outside the package are not available on %s/%s", runtime.GOOS, runtime.GOARCH) - } // Can't be t.Parallel() because it modifies the // testingOneBand package variable. - p, err := New("../trace/testdata/stress_1_10_good") + data, err := ioutil.ReadFile("testdata/stress_1_10_good") if err != nil { t.Fatalf("failed to read input file: %v", err) } - if err := p.Parse(0, 1<<62, nil); err != nil { + _, events, err := parse(bytes.NewReader(data), "") + if err != nil { t.Fatalf("failed to parse trace: %s", err) } - mu := p.MutatorUtilization(UtilSTW | UtilBackground | UtilAssist) + mu := MutatorUtilization(events.Events, UtilSTW|UtilBackground|UtilAssist) mmuCurve := NewMMUCurve(mu) // Test the optimized implementation against the "obviously @@ -123,14 +122,15 @@ func TestMMUTrace(t *testing.T) { } func BenchmarkMMU(b *testing.B) { - p, err := New("../trace/testdata/stress_1_10_good") + data, err := ioutil.ReadFile("testdata/stress_1_10_good") if err != nil { b.Fatalf("failed to read input file: %v", err) } - if err := p.Parse(0, 1<<62, nil); err != nil { + _, events, err := parse(bytes.NewReader(data), "") + if err != nil { b.Fatalf("failed to parse trace: %s", err) } - mu := p.MutatorUtilization(UtilSTW | UtilBackground | UtilAssist | UtilSweep) + mu := MutatorUtilization(events.Events, UtilSTW|UtilBackground|UtilAssist|UtilSweep) b.ResetTimer() for i := 0; i < b.N; i++ { diff --git a/src/internal/traceparser/mud.go b/src/internal/trace/mud.go similarity index 99% rename from src/internal/traceparser/mud.go rename to src/internal/trace/mud.go index 8eed89ff36319..88263060a0b1d 100644 --- a/src/internal/traceparser/mud.go +++ b/src/internal/trace/mud.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package traceparser +package trace import ( "math" diff --git a/src/internal/traceparser/mud_test.go b/src/internal/trace/mud_test.go similarity index 99% rename from src/internal/traceparser/mud_test.go rename to src/internal/trace/mud_test.go index 6e048fcf19c65..b3d74dcf342e5 100644 --- a/src/internal/traceparser/mud_test.go +++ b/src/internal/trace/mud_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package traceparser +package trace import ( "math/rand" diff --git a/src/internal/traceparser/consistent.go b/src/internal/traceparser/consistent.go deleted file mode 100644 index 70fbd04b3faa7..0000000000000 --- a/src/internal/traceparser/consistent.go +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -// postProcess is a final check of consistency, and if all is well, -// adds links to Events - -import ( - "fmt" -) - -type gStatus int - -const ( - gDead gStatus = iota - gRunnable - gRunning - gWaiting -) - -// This code is copied from internal/trace/parser.go. With greater understanding it could be -// simplified. Sets ev.P for GCStart, and set various Link fields -func (p *Parsed) postProcess(events []*Event) error { - type gdesc struct { - state gStatus - ev *Event - evStart *Event - evCreate *Event - evMarkAssist *Event - } - type pdesc struct { - running bool - g uint64 - evSTW *Event - evSweep *Event - } - - gs := make(map[uint64]gdesc) - ps := make(map[int]pdesc) - tasks := make(map[uint64]*Event) // task id to task creation events - activeRegions := make(map[uint64][]*Event) // goroutine id to stack of spans - gs[0] = gdesc{state: gRunning} - var evGC, evSTW *Event - - checkRunning := func(pd pdesc, g gdesc, ev *Event, allowG0 bool) error { - if g.state != gRunning { - return fmt.Errorf("saw %v, but g %d is not running", ev, ev.G) - } - if pd.g != ev.G { - return fmt.Errorf("saw %v, but it's P is running %d, not %d", ev, pd.g, ev.G) - } - if !allowG0 && ev.G == 0 { - return fmt.Errorf("saw %v with unexpected g==0", ev) - } - return nil - } - for i, ev := range events { - g := gs[ev.G] - px := ps[int(ev.P)] - switch ev.Type { - case EvProcStart: - if px.running { - return fmt.Errorf("%d: running before start %s", i, ev) - } - px.running = true - case EvProcStop: - if !px.running { - return fmt.Errorf("%d: p %d not running %s", i, ev.P, ev) - } - if px.g != 0 { - return fmt.Errorf("p %d is running a goroutine %s", ev.P, ev) - } - px.running = false - case EvGCStart: - if evGC != nil { - return fmt.Errorf("GC already running %s, was %s", ev, evGC) - } - evGC = ev - // Attribute this to the global GC state. - ev.P = GCP - case EvGCDone: - if evGC == nil { - return fmt.Errorf("%d:%s bogus GC end", i, ev) - } - evGC.Link = ev - evGC = nil - case EvGCSTWStart: - evp := &evSTW - if p.Version < 1010 { - // Before 1.10, EvGCSTWStart was per-P. - evp = &px.evSTW - } - if *evp != nil { - return fmt.Errorf("STW %s still running at %s", *evp, ev) - } - *evp = ev - case EvGCSTWDone: - evp := &evSTW - if p.Version < 1010 { - // Before 1.10, EvGCSTWDone was per-P. - evp = &px.evSTW - } - if *evp == nil { - return fmt.Errorf("%d: no STW running %s", i, ev) - } - (*evp).Link = ev - *evp = nil - case EvGCMarkAssistStart: - if g.evMarkAssist != nil { - return fmt.Errorf("%d: MarkAssist %s is still running at %s", - i, g.evMarkAssist, ev) - } - g.evMarkAssist = ev - case EvGCMarkAssistDone: - // Unlike most events, mark assists can be in progress when a - // goroutine starts tracing, so we can't report an error here. - if g.evMarkAssist != nil { - g.evMarkAssist.Link = ev - g.evMarkAssist = nil - } - case EvGCSweepStart: - if px.evSweep != nil { - return fmt.Errorf("sweep not done %d: %s", i, ev) - } - px.evSweep = ev - case EvGCSweepDone: - if px.evSweep == nil { - return fmt.Errorf("%d: no sweep happening %s", i, ev) - } - px.evSweep.Link = ev - px.evSweep = nil - case EvGoWaiting: - if g.state != gRunnable { - return fmt.Errorf("not runnable before %d:%s", i, ev) - } - g.state = gWaiting - g.ev = ev - case EvGoInSyscall: - if g.state != gRunnable { - return fmt.Errorf("not runnable before %d:%s", i, ev) - } - g.state = gWaiting - g.ev = ev - case EvGoCreate: - if err := checkRunning(px, g, ev, true); err != nil { - return err - } - if _, ok := gs[ev.Args[0]]; ok { - return fmt.Errorf("%d: already exists %s", i, ev) - } - gs[ev.Args[0]] = gdesc{state: gRunnable, ev: ev, evCreate: ev} - case EvGoStart, EvGoStartLabel: - if g.state != gRunnable { - return fmt.Errorf("not runnable before start %d:%s %+v", i, ev, g) - } - if px.g != 0 { - return fmt.Errorf("%d: %s has p running %d already %v", i, ev, px.g, px) - } - g.state = gRunning - g.evStart = ev - px.g = ev.G - if g.evCreate != nil { - if p.Version < 1007 { - // +1 because symbolizer expects return pc. - //PJW: aren't doing < 1007. ev.stk = []*Frame{{PC: g.evCreate.args[1] + 1}} - } else { - ev.StkID = uint32(g.evCreate.Args[1]) - } - g.evCreate = nil - } - - if g.ev != nil { - g.ev.Link = ev - g.ev = nil - } - case EvGoEnd, EvGoStop: - if err := checkRunning(px, g, ev, false); err != nil { - return fmt.Errorf("%d: %s", i, err) - } - g.evStart.Link = ev - g.evStart = nil - g.state = gDead - px.g = 0 - - if ev.Type == EvGoEnd { // flush all active Regions - spans := activeRegions[ev.G] - for _, s := range spans { - s.Link = ev - } - delete(activeRegions, ev.G) - } - case EvGoSched, EvGoPreempt: - if err := checkRunning(px, g, ev, false); err != nil { - return err - } - g.state = gRunnable - g.evStart.Link = ev - g.evStart = nil - px.g = 0 - g.ev = ev - case EvGoUnblock: - if g.state != gRunning { // PJW, error message - return fmt.Errorf("Event %d (%s) is not running at unblock %s", i, ev, g.state) - - } - if ev.P != TimerP && px.g != ev.G { - // PJW: do better here. - return fmt.Errorf("%d: %s p %d is not running g", i, ev, px.g) - } - g1 := gs[ev.Args[0]] - if g1.state != gWaiting { - return fmt.Errorf("g %v is not waiting before unpark i=%d g1=%v %s", - ev.Args[0], i, g1, ev) - } - if g1.ev != nil && g1.ev.Type == EvGoBlockNet && ev.P != TimerP { - ev.P = NetpollP - } - if g1.ev != nil { - g1.ev.Link = ev - } - g1.state = gRunnable - g1.ev = ev - gs[ev.Args[0]] = g1 - case EvGoSysCall: - if err := checkRunning(px, g, ev, false); err != nil { - return err - } - g.ev = ev - case EvGoSysBlock: - if err := checkRunning(px, g, ev, false); err != nil { - return err - } - g.state = gWaiting - g.evStart.Link = ev - g.evStart = nil - px.g = 0 - case EvGoSysExit: - if g.state != gWaiting { - return fmt.Errorf("not waiting when %s", ev) - } - if g.ev != nil && g.ev.Type == EvGoSysCall { - g.ev.Link = ev - } - g.state = gRunnable - g.ev = ev - case EvGoSleep, EvGoBlock, EvGoBlockSend, EvGoBlockRecv, - EvGoBlockSelect, EvGoBlockSync, EvGoBlockCond, EvGoBlockNet, EvGoBlockGC: - if err := checkRunning(px, g, ev, false); err != nil { - return err - } - g.state = gWaiting - g.ev = ev - g.evStart.Link = ev - g.evStart = nil - px.g = 0 - case EvUserTaskCreate: - taskid := ev.Args[0] - if prevEv, ok := tasks[taskid]; ok { - return fmt.Errorf("task id conflicts (id:%d), %q vs %q", taskid, ev, prevEv) - } - tasks[ev.Args[0]] = ev - case EvUserTaskEnd: - if prevEv, ok := tasks[ev.Args[0]]; ok { - prevEv.Link = ev - ev.Link = prevEv - } - case EvUserRegion: - mode := ev.Args[1] - spans := activeRegions[ev.G] - if mode == 0 { // span start - activeRegions[ev.G] = append(spans, ev) // push - } else if mode == 1 { // span end - n := len(spans) - if n > 0 { // matching span start event is in the trace. - s := spans[n-1] - if s.Args[0] != ev.Args[0] || s.SArgs[0] != ev.SArgs[0] { // task id, span name mismatch - return fmt.Errorf("misuse of span in goroutine %d: span end %q when the inner-most active span start event is %q", - ev.G, ev, s) - } - // Link span start event with span end event - s.Link = ev - ev.Link = s - - if n > 1 { - activeRegions[ev.G] = spans[:n-1] - } else { - delete(activeRegions, ev.G) - } - } - } else { - return fmt.Errorf("invalid user region, mode: %q", ev) - } - } - gs[ev.G] = g - ps[int(ev.P)] = px - } - return nil -} -func (g gStatus) String() string { - switch g { - case gDead: - return "gDead" - case gRunnable: - return "gRunnable" - case gRunning: - return "gRunning" - case gWaiting: - return "gWaiting" - } - return fmt.Sprintf("gStatus?%d", g) -} diff --git a/src/internal/traceparser/events.go b/src/internal/traceparser/events.go deleted file mode 100644 index 00451f37b5ad7..0000000000000 --- a/src/internal/traceparser/events.go +++ /dev/null @@ -1,312 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -import ( - "fmt" - "sort" -) - -// convert raw events into Events - -func (p *Parsed) createEvents(f func(string)) error { - // multiple passes: - // create some Events - // sort them by time (and adjust their times to be nanonseconds) - // remove events not in the desired time interval - // make the events consistent (adding initializing events at the beginning) - // remove the futile events - // add links (and do final checking) - - // shared by firstEvents - p.byproc = make(map[int][]*Event) - p.lastGs = make(map[int]uint64) - - // p.batches are always sorted by time. otherwise a batch for one p that is totally - // later than another batch might be done first, confusing us about g's - for i, b := range p.batches { - if b.raws == nil { - continue - } - if err := p.firstEvents(b); err != nil { - return fmt.Errorf("%v", err) // PJW: this is not useful - } - // we done with b.raws now - p.batches[i].raws = nil - } - f("firstEvents finished") - sorted := []*Event{} - for _, v := range p.byproc { - sorted = append(sorted, v...) - } - // PJW: are we done with p.byproc now? Yes. This shrinks a little. - p.byproc = nil - // Why wasn't this done earlier? Or, why do it at all? - for _, ev := range sorted { - switch ev.Type { - case EvGoStartLocal: - ev.Type = EvGoStart - case EvGoUnblockLocal: - ev.Type = EvGoUnblock - case EvGoSysExitLocal: - ev.Type = EvGoSysExit - } - } - // change to nanoseconds - freq := 1e9 / float64(p.TicksPerSec) - for i, ev := range sorted { - // Move timers and syscalls to separate fake Ps. - // This could be done in the loop at line 38 - // or maybe after robust fixes things. - if p.timerGoids[ev.G] && ev.Type == EvGoUnblock { - ev.Args[2] = uint64(ev.P) // save for robust() to use - ev.P = TimerP - } - // sometimes the ts is not what it should be - if ev.Type == EvGoSysExit { - ev.P = SyscallP - if ev.Args[2] != 0 { - // PJW: test for this being safe. There might be no preceding - // EvSysBlock, EvGoInSyscall, or its time might be later than this - ev.Ts = int64(ev.Args[2]) - } - } - if ev.Type == EvGCStart { - ev.P = GCP - } - t := ev.Ts - p.minticks - if t < 0 { - return fmt.Errorf("event %d %s would be %d mints=%x", i, ev, t, p.minticks) - } - ev.Ts = int64(float64(ev.Ts-p.minticks) * freq) - } - // Stable for the case of equal Ts's. - sort.SliceStable(sorted, func(i, j int) bool { return sorted[i].Ts < sorted[j].Ts }) - f("sorted") - // and ignore the ones with times out of bounds - firstwant, lastwant := 0, len(sorted) - for i, ev := range sorted { - if ev.Ts < p.MinWant { - firstwant = i + 1 - } else if ev.Ts > p.MaxWant { // closed interval [minwant, maxwant] - lastwant = i - break // sorted by Ts - } - } - f("nanoseconds") - var err error - sorted, _, err = p.robust(sorted[firstwant:lastwant]) // PJW: copy info from aux - f("consistent") - if err != nil { - return err - } - events, cnt := p.removeFutile(sorted) // err is always nil here. - f(fmt.Sprintf("removed %d futiles", cnt)) - // and finally, do some checks and put in links - err = p.postProcess(events) - f("post processed") - if err != nil { - return err // PJW: is this enough? NO - } - p.Events = events - return nil -} - -// Special P identifiers. -const ( - FakeP = 1000000 + iota - TimerP // depicts timer unblocks - NetpollP // depicts network unblocks - SyscallP // depicts returns from syscalls - GCP // depicts GC state -) - -// convert the raw events for a batch into Events, and keep track of -// which G is running on the P that is common to the batch. -func (p *Parsed) firstEvents(b batch) error { - for _, raw := range b.raws { - desc := EventDescriptions[raw.typ] - narg := p.rawArgNum(&raw) - if p.Err != nil { - return p.Err - } - if raw.typ == EvBatch { - // first event, record information about P, G, and Ts - p.lastGs[p.lastP] = p.lastG // 0 the first time through - p.lastP = int(raw.Arg(0)) - p.lastG = p.lastGs[p.lastP] - p.lastTs = int64(raw.Arg(1)) - continue - } - e := &Event{Type: raw.typ, P: int32(p.lastP), G: p.lastG} - var argoffset int - if p.Version < 1007 { // can't happen. - e.Ts = p.lastTs + int64(raw.Arg(1)) - argoffset = 2 - } else { - e.Ts = p.lastTs + int64(raw.Arg(0)) - argoffset = 1 - } - p.lastTs = e.Ts - // collect the args for the raw event e - for i := argoffset; i < narg; i++ { - // evade one byte of corruption (from fuzzing typically) - if raw.args == nil { - return fmt.Errorf("raw.args is nil %s", evname(raw.typ)) - } - if i > 0 && i-1 >= len(*raw.args) { - return fmt.Errorf("%s wants arg %d of %d", evname(raw.typ), i, len(*raw.args)) - } - if i == narg-1 && desc.Stack { - e.StkID = uint32(raw.Arg(i)) - } else { - e.Args[i-argoffset] = raw.Arg(i) - } - } - switch raw.typ { - case EvGoSysCall, EvGCSweepDone, EvGCSweepStart: - if e.G == 0 { - // missing some earlier G's from this P - continue // so we don't know which G is doing it - } - case EvGoStart, EvGoStartLocal, EvGoStartLabel: - p.lastG = e.Args[0] - e.G = p.lastG - if raw.typ == EvGoStartLabel { - e.SArgs = []string{p.Strings[e.Args[2]]} - } - case EvGCSTWStart: - e.G = 0 - switch e.Args[0] { - case 0: - e.SArgs = []string{"mark termination"} - case 1: - e.SArgs = []string{"sweep termination"} - default: - return fmt.Errorf("unknown STW kind %d!=0,1 %s", e.Args[0], e) - } - case EvGCStart, EvGCDone, EvGCSTWDone: - e.G = 0 - case EvGoEnd, EvGoStop, EvGoSched, EvGoPreempt, - EvGoSleep, EvGoBlock, EvGoBlockSend, EvGoBlockRecv, - EvGoBlockSelect, EvGoBlockSync, EvGoBlockCond, EvGoBlockNet, - EvGoSysBlock, EvGoBlockGC: - p.lastG = 0 - if e.G == 0 { - // missing some earlier G's from this P - continue // so we don't know which G is doing it - } - case EvGoSysExit, EvGoWaiting, EvGoInSyscall: - e.G = e.Args[0] - case EvUserTaskCreate: - // e.Args 0: taskID, 1:parentID, 2:nameID - e.SArgs = []string{p.Strings[e.Args[2]]} - case EvUserRegion: - if e.G == 0 { - continue // don't know its G - } - // e.Args 0: taskID, 1: mode, 2:nameID - e.SArgs = []string{p.Strings[e.Args[2]]} - case EvUserLog: - // e.Args 0: taskID, 1:keyID, 2: stackID - e.SArgs = []string{p.Strings[e.Args[1]], raw.sarg} - } - p.byproc[p.lastP] = append(p.byproc[p.lastP], e) - } - return nil -} - -func (p *Parsed) removeFutile(events []*Event) ([]*Event, int) { - // Phase 1: determine futile wakeup sequences. - type G struct { - futile bool - wakeup []*Event // wakeup sequence (subject for removal) - } - gs := make(map[uint64]G) - futile := make(map[*Event]bool) - cnt := 0 - for _, ev := range events { - switch ev.Type { - case EvGoUnblock: - g := gs[ev.Args[0]] - g.wakeup = []*Event{ev} - gs[ev.Args[0]] = g - case EvGoStart, EvGoPreempt, EvFutileWakeup: - g := gs[ev.G] - g.wakeup = append(g.wakeup, ev) - if ev.Type == EvFutileWakeup { - g.futile = true - } - gs[ev.G] = g - case EvGoBlock, EvGoBlockSend, EvGoBlockRecv, EvGoBlockSelect, - EvGoBlockSync, EvGoBlockCond: - g := gs[ev.G] - if g.futile { - futile[ev] = true - for _, ev1 := range g.wakeup { - futile[ev1] = true - } - } - delete(gs, ev.G) - cnt++ - } - } - // Phase 2: remove futile wakeup sequences. - newEvents := events[:0] // overwrite the original slice - for _, ev := range events { - if !futile[ev] { - newEvents = append(newEvents, ev) - } - } - return newEvents, cnt // PJW: cnt doesn't count the futile[]s -} - -// Arg gets the n-th arg from a raw event -func (r *rawEvent) Arg(n int) uint64 { - if n == 0 { - return r.arg0 - } - return (*r.args)[n-1] -} - -// report the number of arguments. (historical differences) -func (p *Parsed) rawArgNum(ev *rawEvent) int { - desc := EventDescriptions[ev.typ] - switch ev.typ { - case EvStack, EvFrequency, EvTimerGoroutine: - p.Err = fmt.Errorf("%s unexpected in rawArgNum", evname(ev.typ)) - return 0 - } - narg := len(desc.Args) - if desc.Stack { - narg++ - } - if ev.typ == EvBatch { - if p.Version < 1007 { - narg++ // used to be an extra unused arg - } - return narg - } - narg++ // timestamp - if p.Version < 1007 { - narg++ // sequence - } - // various special historical cases - switch ev.typ { - case EvGCSweepDone: - if p.Version < 1009 { - narg -= 2 // 1.9 added 2 args - } - case EvGCStart, EvGoStart, EvGoUnblock: - if p.Version < 1007 { - narg-- // one more since 1.7 - } - case EvGCSTWStart: - if p.Version < 1010 { - narg-- // 1.10 added an argument - } - } - return narg -} diff --git a/src/internal/traceparser/file.go b/src/internal/traceparser/file.go deleted file mode 100644 index 4671edafb274f..0000000000000 --- a/src/internal/traceparser/file.go +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -import ( - "bytes" - "fmt" - "io" -) - -// scan the trace file finding the header, starts of batches, and the trailer. -// the trailer contains strings, stacks, and the clock frequency - -// There are two ways of thinking about the raw trace file. It starts with a 16 -// byte header "go 1.11 trace\0\0\0" -// From the point of -// view of the runtime, there is a collection of initializations for each goroutine. -// These consist of an EvGoCreate, possibly followed by one of EvGoWaiting or -// EvGoInSyscall if the go routine is waiting or in a syscall. -// Then there is an EvProcStart for the first running goroutine, so there's a running P, -// and then an EvGoStart for the first running goroutine. Then as the program runs, the -// runtime emits trace events. Finally when the tracing stops, the runtime emits a footer -// consisting of an EvFrequency (to convert ticks to nanoseconds) and some EvTimerGoroutines, -// followed by EvStacks for all the stack frames. -// -// In the file, the header and footer are as described, but all the events in between come -// in batches headed by EvBatch with the same P, and have to be rearranged into timestamp order. - -// New() scans once through the file to find the beginnings of all the batches (EvBatch) and -// processes the footer extracting the strings and stacks. -// Parse() finds the batches that overlap the desired time interval, and processes them into -// events, dropping those outside the desired time interval. But it has to derive the missing -// initializations from the events it sees, as it has no other access to the state of the runtime. -// This is done in robust.go. - -// In more detail, scanFile() is called by commonInit() which is called by either New() or ParseBuffer(). -// It extracts the strings, the stacks, and remembers the locations of the Batches (all saved in *Parsed). - -// Parse first computes the rawEvents for the batches that overlap the requested interval. -// It then calls createEvents() (events.go) which produces Events. - -func (p *Parsed) parseHeader() error { - p.r.Seek(0, 0) - var buf [16]byte - n, err := p.r.Read(buf[:]) - if n != 16 || err != nil { - return fmt.Errorf("failed to red header: read %d bytes, not 16 %v", n, err) - } - // by hand. there are only 6 or so legitimate values; we could search for a match - if buf[0] != 'g' || buf[1] != 'o' || buf[2] != ' ' || - buf[3] < '1' || buf[3] > '9' || - buf[4] != '.' || - buf[5] < '1' || buf[5] > '9' { - return fmt.Errorf("not a trace file") - } - ver := int(buf[5] - '0') - i := 0 - for ; buf[6+i] >= '0' && buf[6+i] <= '9' && i < 2; i++ { - ver = ver*10 + int(buf[6+i]-'0') - } - ver += int(buf[3]-'0') * 1000 - if !bytes.Equal(buf[6+i:], []byte(" trace\x00\x00\x00\x00")[:10-i]) { - return fmt.Errorf("not a trace file") - } - p.Version = ver - // PJW: reject 1005 and 1007? They need symbolization, which we don't do. - // Further, doing these would require 1.7 or earlier binaries. - switch ver { - case 1005, 1007: - break // no longer supported - case 1008, 1009: - return nil - case 1010, 1011: - return nil - } - return fmt.Errorf("%d unsupported version", ver) -} - -func (p *Parsed) scanFile() error { - r := p.r - // fill in the following values for sure - strings := make(map[uint64]string) - p.Strings = strings // ok to save maps immediately - timerGoIDs := make(map[uint64]bool) - p.timerGoids = timerGoIDs - stacks := make(map[uint32][]*Frame) - framer := make(map[Frame]*Frame) // uniqify *Frame - p.Stacks = stacks - footerLoc := 0 - - var buf [1]byte - off := 16 // skip the header - n, err := r.Seek(int64(off), 0) - if err != nil || n != int64(off) { - return fmt.Errorf("Seek to %d got %d, err=%v", off, n, err) - } - var batchts int64 // from preceding batch - var lastEv byte - for { - off0 := off - n, err := r.Read(buf[:1]) - if err == io.EOF { - break - } else if err != nil || n != 1 { - return fmt.Errorf("read failed at 0x%x, n=%d, %v", - off, n, err) - } - off += n - typ := buf[0] << 2 >> 2 - if typ == EvNone || typ >= EvCount || - EventDescriptions[typ].MinVersion > p.Version { - err = fmt.Errorf("unknown event type %v at offset 0x%x, pass 1", typ, off0) - return err - } - // extract and save the strings - if typ == EvString { - // String dictionary entry [ID, length, string]. - var id uint64 - id, off, err = readVal(r, off) - if err != nil { - return err - } - if id == 0 { - err = fmt.Errorf("string at offset %d has invalid id 0", off) - return err - } - if strings[id] != "" { - err = fmt.Errorf("string at offset %d has duplicate id %v", off, id) - return err - } - var ln uint64 - ln, off, err = readVal(r, off) - if err != nil { - return err - } - if ln == 0 { - err = fmt.Errorf("string at offset %d has invalid length 0", off) - return err - } - if ln > 1e6 { - err = fmt.Errorf("string at offset %d has too large length %v", off, ln) - return err - } - buf := make([]byte, ln) - var n int - n, err = io.ReadFull(r, buf) - if err != nil { - err = fmt.Errorf("failed to read trace at offset %d: read %v, want %v, error %v", off, n, ln, err) - return err - } - off += n - strings[id] = string(buf) - lastEv = EvString - continue - } - p.Count++ - if typ == EvFrequency { - // found footer, remember location, save value - footerLoc = off0 - } - var args []uint64 - off, args, err = p.argsAt(off0, typ) - if err != nil { - err = fmt.Errorf("argsAt error %v; off=%d off0=%d %s", - err, off, off0, evname(typ)) - return err - } - r.Seek(int64(off), 0) - if typ == EvUserLog { - _, off, err = readStr(r, off) - if err != nil { - return err - } - } - if len(args) == 0 { // can't happen in well-formed trace file - return fmt.Errorf("len(args)==0 off=0x%x typ=%s", off, evname(typ)) - } - switch typ { - case EvBatch: - if footerLoc == 0 { - // EvBatch in footer is just to have a header for stacks - locp := int64(args[0]) - p.batches = append(p.batches, - batch{Off: off0, P: locp, Cycles: int64(args[1])}) - // at this point we know when the previous batch ended!! - batchts = int64(args[1]) - if batchts > p.maxticks { - p.maxticks = batchts - } - } - case EvFrequency: - p.TicksPerSec = int64(args[0]) - case EvTimerGoroutine: - timerGoIDs[args[0]] = true - case EvStack: - if len(args) < 2 { - return fmt.Errorf("EvStack has too few args %d at 0x%x", - len(args), off0) - } - size := args[1] - if size > 1000 { - return fmt.Errorf("EvStack has %d frames at 0x%x", - size, off0) - } - want := 2 + 4*size - if uint64(len(args)) != want { - return fmt.Errorf("EvStack wants %d args, got %d, at 0x%x", - len(args), want, off0) - } - id := args[0] - if id != 0 && size > 0 { - stk := make([]*Frame, size) - for i := 0; i < int(size); i++ { - pc := args[2+i*4+0] - fn := args[2+i*4+1] - file := args[2+i*4+2] - line := args[2+i*4+3] - stk[i] = &Frame{PC: pc, Fn: strings[fn], File: strings[file], Line: int(line)} - if _, ok := framer[*stk[i]]; !ok { - framer[*stk[i]] = stk[i] - } - stk[i] = framer[*stk[i]] - } - stacks[uint32(id)] = stk - } - default: - if lastEv == EvBatch { - // p.MinTsVal is set by the first real event, not the first EvBatch - x := batchts + int64(args[0]) - if x < p.minticks { - p.minticks = x - } - } - batchts += int64(args[0]) - if batchts > p.maxticks { - p.maxticks = batchts - } - } - lastEv = typ - } - if footerLoc <= 0 { - return fmt.Errorf("malformed trace file, no EvFrequency") - } - return nil -} diff --git a/src/internal/traceparser/filebuf/filebuf.go b/src/internal/traceparser/filebuf/filebuf.go deleted file mode 100755 index 32d5a92c5b167..0000000000000 --- a/src/internal/traceparser/filebuf/filebuf.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package filebuf implements io.SeekReader for os files. -// This is useful only for very large files with lots of -// seeking. (otherwise use ioutil.ReadFile or bufio) -package filebuf - -import ( - "fmt" - "io" - "os" -) - -// Buf is the implemented interface -type Buf interface { - io.ReadCloser - io.Seeker - Size() int64 - Stats() Stat -} - -// Buflen is the size of the internal buffer. -// The code is designed to never need to reread unnecessarily -const Buflen = 1 << 20 - -// fbuf is a buffered file with seeking. -// fixed is an internal buffer. buf is the slice fixed[:fixedLen]. bufloc is the file -// location of the beginning of fixed (and buf). The seek pointer is at bufloc+bufpos, -// so the file's contents there start with buf[bufpos:] -type fbuf struct { - Name string - fd *os.File - size int64 // file size - bufloc int64 // file loc of beginning of fixed - bufpos int32 // seekptr is at bufloc+bufpos. bufpos <= Buflen, fixedLen - fixed [Buflen]byte // backing store for buf - fixedlen int // how much of fixed is valid file contents - buf []byte // buf is fixed[0:fixedlen] - // statistics - seeks int // number of calls to fd.Seek - reads int // number of calls to fd.Read - bytes int64 // number of bytes read by fd.Read -} - -// Stat returns the number of underlying seeks and reads, and bytes read -type Stat struct { - Seeks int - Reads int - Bytes int64 -} - -// Stats returns the stats so far -func (fb *fbuf) Stats() Stat { - return Stat{fb.seeks, fb.reads, fb.bytes} -} - -// Size returns the file size -func (fb *fbuf) Size() int64 { - return fb.size -} - -// New returns an initialized *fbuf or an error -func New(fname string) (Buf, error) { - fd, err := os.Open(fname) - if err != nil { - return nil, err - } - fi, err := fd.Stat() - if err != nil || fi.Mode().IsDir() { - return nil, fmt.Errorf("not readable: %s", fname) - } - return &fbuf{Name: fname, fd: fd, size: fi.Size()}, nil -} - -// Read implements io.Reader. It may return a positive -// number of bytes read with io.EOF -func (fb *fbuf) Read(p []byte) (int, error) { - // If there are enough valid bytes remaining in buf, just use them - if len(fb.buf[fb.bufpos:]) >= len(p) { - copy(p, fb.buf[fb.bufpos:]) - fb.bufpos += int32(len(p)) - return len(p), nil - } - done := 0 // done counts how many bytes have been transferred - // If there are any valid bytes left in buf, use them first - if len(fb.buf[fb.bufpos:]) > 0 { - m := copy(p, fb.buf[fb.bufpos:]) - done = m - fb.bufpos += int32(done) // at end of the valid bytes in buf - } - // used up buffered data. logical seek pointer is at bufloc+bufpos. - // loop until p has been filled up or EOF - for done < len(p) { - loc, err := fb.fd.Seek(0, io.SeekCurrent) // make sure of the os's file location - if loc != fb.bufloc+int64(fb.bufpos) { - panic(fmt.Sprintf("%v loc=%d bufloc=%d bufpos=%d", err, loc, - fb.bufloc, fb.bufpos)) - } - fb.seeks++ // did a file system seek - if loc >= fb.size { - // at EOF - fb.bufpos = int32(len(fb.buf)) - fb.bufloc = loc - int64(fb.fixedlen) - return done, io.EOF - } - n, err := fb.fd.Read(fb.fixed[:]) - if n != 0 { - fb.fixedlen = n - } - fb.reads++ // did a file system read - m := copy(p[done:], fb.fixed[:n]) - done += m - if err != nil { - if err == io.EOF { - fb.bufpos = int32(len(fb.buf)) - fb.bufloc = loc - int64(fb.fixedlen) - return done, io.EOF - } - return 0, err - } - fb.bytes += int64(n) - fb.bufpos = int32(m) // used m byes of the buffer - fb.bufloc = loc - fb.buf = fb.fixed[:n] - } - return len(p), nil -} - -// Seek implements io.Seeker. (, io.EOF) is returned for seeks off the end. -func (fb *fbuf) Seek(offset int64, whence int) (int64, error) { - seekpos := offset - switch whence { - case io.SeekCurrent: - seekpos += fb.bufloc + int64(fb.bufpos) - case io.SeekEnd: - seekpos += fb.size - } - if seekpos < 0 || seekpos > fb.size { - return fb.bufloc + int64(fb.bufpos), io.EOF - } - // if seekpos is inside fixed, just adjust buf and bufpos - if seekpos >= fb.bufloc && seekpos <= int64(fb.fixedlen)+fb.bufloc { - fb.bufpos = int32(seekpos - fb.bufloc) - return seekpos, nil - } - // need to refresh the internal buffer. Seek does no reading, mark buf - // as empty, set bufpos and bufloc. - fb.buf, fb.bufpos, fb.bufloc = nil, 0, seekpos - n, err := fb.fd.Seek(seekpos, io.SeekStart) - fb.seeks++ - if n != seekpos || err != nil { - return -1, fmt.Errorf("seek failed (%d!= %d) %v", n, seekpos, err) - } - return seekpos, nil -} - -// Close closes the underlying file -func (fb *fbuf) Close() error { - if fb.fd != nil { - return fb.fd.Close() - } - return nil -} diff --git a/src/internal/traceparser/filebuf/filebuf_test.go b/src/internal/traceparser/filebuf/filebuf_test.go deleted file mode 100755 index 7a735715eda04..0000000000000 --- a/src/internal/traceparser/filebuf/filebuf_test.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package filebuf - -import ( - "bytes" - "io" - "io/ioutil" - "log" - "os" - "testing" -) - -var ( - inited bool - small, large string // files - dir string // in this dir - contents []byte // contents of the large file -) - -func TestMain(m *testing.M) { - create() - n := m.Run() - - os.RemoveAll(dir) - os.Exit(n) -} - -func create() { - if inited { - return - } - log.SetFlags(log.Lshortfile) - d, erra := ioutil.TempDir("", "filebuf") - s, errb := ioutil.TempFile(dir, "small") - l, errc := ioutil.TempFile(dir, "large") - if erra != nil || errb != nil || errc != nil { - log.Fatal(erra, errb, errc) - } - dir, small, large = d, s.Name(), l.Name() - buf := make([]byte, 2*Buflen+3) - for i := 0; i < len(buf); i++ { - buf[i] = byte(i) - } - err := ioutil.WriteFile(small, buf[:7], 0666) - if err != nil { - log.Fatal(err) - } - err = ioutil.WriteFile(large, buf, 0666) - if err != nil { - log.Fatal(err) - } - contents = buf - inited = true -} - -func get(n int) io.Reader { - if n <= len(contents) { - return bytes.NewReader(contents[:n]) - } - return bytes.NewReader(contents) -} - -func TestSmall(t *testing.T) { - var f Buf - var err error - f, err = New(small) - small := func(t *testing.T) { - if err != nil { - t.Fatal(err) - } - buf := make([]byte, 23) - n, err := f.Read(buf) - if n != 7 || err != io.EOF { - t.Errorf("got %d, expected 7, %v", n, err) - } - m, err := f.Seek(0, io.SeekCurrent) - if m != 7 || err != nil { - t.Errorf("got %d, expected 7, %v", m, err) - } - m, err = f.Seek(1, io.SeekStart) - if m != 1 || err != nil { - t.Errorf("got %d expected 1, %v", m, err) - } - n, err = f.Read(buf) - if n != 6 || err != io.EOF { - t.Errorf("got %d, expected 6, %v", n, err) - } - for i := 0; i < 6; i++ { - if buf[i] != byte(i+1) { - t.Fatalf("byte %d is %d, not %d, %v", i, buf[i], i+1, buf) - } - } - } - t.Run("New", small) - f, err = FromReader(get(7)) - t.Run("Rdr", small) -} - -func TestLarge(t *testing.T) { - var f Buf - var err error - big := func(t *testing.T) { - if err != nil { - t.Fatal(err) - } - x := Buflen - 7 - n, err := f.Seek(int64(x), io.SeekStart) - if n != Buflen-7 || err != nil { - t.Fatalf("expected %d, got %d, %v", x, n, err) - } - buf := make([]byte, 23) - m, err := f.Read(buf) - if m != len(buf) || err != nil { - t.Fatalf("expected %d, got %d, %v", len(buf), m, err) - } - for i := 0; i < 23; i++ { - if buf[i] != byte(x+i) { - t.Fatalf("byte %d, got %d, wanted %d", i, buf[i], - byte(x+i)) - } - } - m, err = f.Read(buf) - if m != len(buf) || err != nil { - t.Fatalf("got %d, expected %d, %v", m, len(buf), err) - } - x += len(buf) - for i := 0; i < 23; i++ { - if buf[i] != byte(x+i) { - t.Fatalf("byte %d, got %d, wanted %d", i, buf[i], - byte(x+i)) - } - } - } - f, err = New(large) - t.Run("New", big) - f, err = FromReader(get(1 << 30)) - t.Run("Rdr", big) -} - -func TestMore(t *testing.T) { - f, err := New(large) - if err != nil { - t.Fatal(err) - } - var a, b [4]byte - f.Seek(16, 0) - f.Read(a[:]) - f.Seek(16, 0) - f.Read(b[:]) - if a != b { - t.Errorf("oops %v %v", a, b) - } -} - -func TestSeek(t *testing.T) { - f, err := New(small) - if err != nil { - log.Fatal(err) - } - n, err := f.Seek(f.Size(), 0) - if n != f.Size() || err != nil { - t.Errorf("seek got %d, expected %d, %v", n, f.Size(), err) - } - n, err = f.Seek(1, io.SeekCurrent) - if n != f.Size() || err != io.EOF { - t.Errorf("n=%d, expected 0. %v", n, err) - } - n, err = f.Seek(f.Size(), 0) - if n != f.Size() || err != nil { - t.Errorf("seek got %d, expected %d, %v", n, f.Size(), err) - } -} - -func TestReread(t *testing.T) { - f, err := New(small) - if err != nil { - t.Fatal(err) - } - var buf [1]byte - f.Seek(0, 0) - for i := 0; i < int(f.Size()); i++ { - n, err := f.Read(buf[:]) - if n != 1 || err != nil { - t.Fatalf("n=%d, err=%v", n, err) - } - } - stats := f.Stats() - if stats.Bytes != f.Size() || stats.Reads != 1 || stats.Seeks != 1 { - t.Errorf("%v %d %d", stats, f.(*fbuf).bufloc, f.(*fbuf).bufpos) - } - n, err := f.Read(buf[:]) - if n != 0 || err != io.EOF { - t.Fatalf("expected 0 and io.EOF, got %d %v", n, err) - } - f.Seek(0, 0) - xstats := f.Stats() - if xstats.Bytes != f.Size() || xstats.Reads != 1 || xstats.Seeks != 2 { - t.Errorf("%v %v %d %d", stats, xstats, f.(*fbuf).bufloc, f.(*fbuf).bufpos) - } - f.Close() -} diff --git a/src/internal/traceparser/filebuf/fromreader.go b/src/internal/traceparser/filebuf/fromreader.go deleted file mode 100644 index 736cbf5e42617..0000000000000 --- a/src/internal/traceparser/filebuf/fromreader.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package filebuf - -import ( - "bytes" - "io" -) - -// implement a Buf version from an io.Reader - -type rbuf struct { - buf []byte // contents - pos int64 - seeks, reads int // number of calls. 0 seems right. -} - -func (r *rbuf) Stats() Stat { - return Stat{r.seeks, r.reads, int64(len(r.buf))} -} - -func (r *rbuf) Size() int64 { - return int64(len(r.buf)) -} - -// FromReader creates a Buf by copying the contents of an io.Reader -func FromReader(rd io.Reader) (Buf, error) { - r := &rbuf{} - x := bytes.NewBuffer(r.buf) - _, err := io.Copy(x, rd) - r.buf = x.Bytes() - if err != nil { - return nil, err - } - return r, nil -} - -func (r *rbuf) Close() error { - return nil -} - -func (r *rbuf) Read(p []byte) (int, error) { - n := copy(p, r.buf[r.pos:]) - r.pos += int64(n) - if n == 0 || n < len(p) { - return n, io.EOF - } - return n, nil -} - -func (r *rbuf) Seek(offset int64, whence int) (int64, error) { - seekpos := offset - switch whence { - case io.SeekCurrent: - seekpos += int64(r.pos) - case io.SeekEnd: - seekpos += int64(len(r.buf)) - } - if seekpos < 0 || seekpos > int64(len(r.buf)) { - if seekpos < 0 { - r.pos = 0 - return 0, nil - } - r.pos = int64(len(r.buf)) - return r.pos, nil - } - r.pos = seekpos - return seekpos, nil -} diff --git a/src/internal/traceparser/fuzz.go b/src/internal/traceparser/fuzz.go deleted file mode 100644 index 666ee945fbec1..0000000000000 --- a/src/internal/traceparser/fuzz.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build gofuzz - -package traceparser - -import ( - "bytes" - "fmt" - "log" -) - -// at first we ran the old parser, and return 0 if it failed, on the theory that we don't have -// to do better. But that leads to very few crashes to look at. -// Maybe better just to make it so that the new parser doesn't misbehave, and if it doesn't get -// an error, that the old parser gets the same results. (up to whatever) -// perhaps even better would be to seed corpus with examples from which the 16-byte header -// has been stripped, and add it in Fuzz, so the fuzzer doesn't spend a lot of time making -// changes we reject in the header. (this may not be necessary) - -func Fuzz(data []byte) int { - if len(data) < 16 { - return 0 - } - switch x := string(data[:16]); x { - default: - return 0 - case "go 1.9 trace\000\000\000\000": - break - case "go 1.10 trace\000\000\000": - break - case "go 1.11 trace\000\000\000": - break - } - p, errp := ParseBuffer(bytes.NewBuffer(data)) - if errp != nil { - if p != nil { - panic(fmt.Sprintf("p not nil on error %s", errp)) - } - } - // TODO(pjw): if no errors, compare parses? - return 1 -} - -func init() { - log.SetFlags(log.Lshortfile) -} diff --git a/src/internal/traceparser/goroutines.go b/src/internal/traceparser/goroutines.go deleted file mode 100644 index 5fe22f4f29b85..0000000000000 --- a/src/internal/traceparser/goroutines.go +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -import "sort" - -// GDesc contains statistics and execution details of a single goroutine. -type GDesc struct { - ID uint64 - Name string - PC uint64 - CreationTime int64 - StartTime int64 - EndTime int64 - - // List of regions in the goroutine, sorted based on the start time. - Regions []*UserRegionDesc - - // Statistics of execution time during the goroutine execution. - GExecutionStat - - *gDesc // private part. -} - -// UserRegionDesc represents a region and goroutine execution stats -// while the region was active. -type UserRegionDesc struct { - TaskID uint64 - Name string - - // Region start event. Normally EvUserRegion start event or nil, - // but can be EvGoCreate event if the region is a synthetic - // region representing task inheritance from the parent goroutine. - Start *Event - - // Region end event. Normally EvUserRegion end event or nil, - // but can be EvGoStop or EvGoEnd event if the goroutine - // terminated without explicitely ending the region. - End *Event - - GExecutionStat -} - -// GExecutionStat contains statistics about a goroutine's execution -// during a period of time. -type GExecutionStat struct { - ExecTime int64 - SchedWaitTime int64 - IOTime int64 - BlockTime int64 - SyscallTime int64 - GCTime int64 - SweepTime int64 - TotalTime int64 -} - -// sub returns the stats v-s. -func (s GExecutionStat) sub(v GExecutionStat) (r GExecutionStat) { - r = s - r.ExecTime -= v.ExecTime - r.SchedWaitTime -= v.SchedWaitTime - r.IOTime -= v.IOTime - r.BlockTime -= v.BlockTime - r.SyscallTime -= v.SyscallTime - r.GCTime -= v.GCTime - r.SweepTime -= v.SweepTime - r.TotalTime -= v.TotalTime - return r -} - -// snapshotStat returns the snapshot of the goroutine execution statistics. -// This is called as we process the ordered trace event stream. lastTs and -// activeGCStartTime are used to process pending statistics if this is called -// before any goroutine end event. -func (g *GDesc) snapshotStat(lastTs, activeGCStartTime int64) (ret GExecutionStat) { - ret = g.GExecutionStat - - if g.gDesc == nil { - return ret // finalized GDesc. No pending state. - } - - if activeGCStartTime != 0 { // terminating while GC is active - if g.CreationTime < activeGCStartTime { - ret.GCTime += lastTs - activeGCStartTime - } else { - // The goroutine's lifetime completely overlaps - // with a GC. - ret.GCTime += lastTs - g.CreationTime - } - } - - if g.TotalTime == 0 { - ret.TotalTime = lastTs - g.CreationTime - } - - if g.lastStartTime != 0 { - ret.ExecTime += lastTs - g.lastStartTime - } - if g.blockNetTime != 0 { - ret.IOTime += lastTs - g.blockNetTime - } - if g.blockSyncTime != 0 { - ret.BlockTime += lastTs - g.blockSyncTime - } - if g.blockSyscallTime != 0 { - ret.SyscallTime += lastTs - g.blockSyscallTime - } - if g.blockSchedTime != 0 { - ret.SchedWaitTime += lastTs - g.blockSchedTime - } - if g.blockSweepTime != 0 { - ret.SweepTime += lastTs - g.blockSweepTime - } - return ret -} - -// finalize is called when processing a goroutine end event or at -// the end of trace processing. This finalizes the execution stat -// and any active regions in the goroutine, in which case trigger is nil. -func (g *GDesc) finalize(lastTs, activeGCStartTime int64, trigger *Event) { - if trigger != nil { - g.EndTime = trigger.Ts - } - finalStat := g.snapshotStat(lastTs, activeGCStartTime) - - g.GExecutionStat = finalStat - for _, s := range g.activeRegions { - s.End = trigger - s.GExecutionStat = finalStat.sub(s.GExecutionStat) - g.Regions = append(g.Regions, s) - } - *(g.gDesc) = gDesc{} -} - -// gDesc is a private part of GDesc that is required only during analysis. -type gDesc struct { - lastStartTime int64 - blockNetTime int64 - blockSyncTime int64 - blockSyscallTime int64 - blockSweepTime int64 - blockGCTime int64 - blockSchedTime int64 - - activeRegions []*UserRegionDesc // stack of active regions -} - -// GoroutineStats generates statistics for all goroutines in the trace segment. -func (p *Parsed) GoroutineStats() map[uint64]*GDesc { - events := p.Events - gs := make(map[uint64]*GDesc) - var lastTs int64 - var gcStartTime int64 // gcStartTime == 0 indicates gc is inactive. - for _, ev := range events { - lastTs = ev.Ts - switch ev.Type { - case EvGoCreate: - g := &GDesc{ID: ev.Args[0], CreationTime: ev.Ts, gDesc: new(gDesc)} - g.blockSchedTime = ev.Ts - // When a goroutine is newly created, inherit the - // task of the active region. For ease handling of - // this case, we create a fake region description with - // the task id. - if creatorG := gs[ev.G]; creatorG != nil && len(creatorG.gDesc.activeRegions) > 0 { - regions := creatorG.gDesc.activeRegions - s := regions[len(regions)-1] - if s.TaskID != 0 { - g.gDesc.activeRegions = []*UserRegionDesc{ - {TaskID: s.TaskID, Start: ev}, - } - } - } - gs[g.ID] = g - case EvGoStart, EvGoStartLabel: - g := gs[ev.G] - if g.PC == 0 { - stk := p.Stacks[ev.StkID] - g.PC = stk[0].PC - g.Name = stk[0].Fn - } - g.lastStartTime = ev.Ts - if g.StartTime == 0 { - g.StartTime = ev.Ts - } - if g.blockSchedTime != 0 { - g.SchedWaitTime += ev.Ts - g.blockSchedTime - g.blockSchedTime = 0 - } - case EvGoEnd, EvGoStop: - g := gs[ev.G] - g.finalize(ev.Ts, gcStartTime, ev) - case EvGoBlockSend, EvGoBlockRecv, EvGoBlockSelect, - EvGoBlockSync, EvGoBlockCond: - g := gs[ev.G] - g.ExecTime += ev.Ts - g.lastStartTime - g.lastStartTime = 0 - g.blockSyncTime = ev.Ts - case EvGoSched, EvGoPreempt: - g := gs[ev.G] - g.ExecTime += ev.Ts - g.lastStartTime - g.lastStartTime = 0 - g.blockSchedTime = ev.Ts - case EvGoSleep, EvGoBlock: - g := gs[ev.G] - g.ExecTime += ev.Ts - g.lastStartTime - g.lastStartTime = 0 - case EvGoBlockNet: - g := gs[ev.G] - g.ExecTime += ev.Ts - g.lastStartTime - g.lastStartTime = 0 - g.blockNetTime = ev.Ts - case EvGoBlockGC: - g := gs[ev.G] - g.ExecTime += ev.Ts - g.lastStartTime - g.lastStartTime = 0 - g.blockGCTime = ev.Ts - case EvGoUnblock: - g := gs[ev.Args[0]] - if g.blockNetTime != 0 { - g.IOTime += ev.Ts - g.blockNetTime - g.blockNetTime = 0 - } - if g.blockSyncTime != 0 { - g.BlockTime += ev.Ts - g.blockSyncTime - g.blockSyncTime = 0 - } - g.blockSchedTime = ev.Ts - case EvGoSysBlock: - g := gs[ev.G] - g.ExecTime += ev.Ts - g.lastStartTime - g.lastStartTime = 0 - g.blockSyscallTime = ev.Ts - case EvGoSysExit: - g := gs[ev.G] - if g.blockSyscallTime != 0 { - g.SyscallTime += ev.Ts - g.blockSyscallTime - g.blockSyscallTime = 0 - } - g.blockSchedTime = ev.Ts - case EvGCSweepStart: - g := gs[ev.G] - if g != nil { - // Sweep can happen during GC on system goroutine. - g.blockSweepTime = ev.Ts - } - case EvGCSweepDone: - g := gs[ev.G] - if g != nil && g.blockSweepTime != 0 { - g.SweepTime += ev.Ts - g.blockSweepTime - g.blockSweepTime = 0 - } - case EvGCStart: - gcStartTime = ev.Ts - case EvGCDone: - for _, g := range gs { - if g.EndTime != 0 { - continue - } - if gcStartTime < g.CreationTime { - g.GCTime += ev.Ts - g.CreationTime - } else { - g.GCTime += ev.Ts - gcStartTime - } - } - gcStartTime = 0 // indicates gc is inactive. - case EvUserRegion: - g := gs[ev.G] - switch mode := ev.Args[1]; mode { - case 0: // region start - g.activeRegions = append(g.activeRegions, &UserRegionDesc{ - Name: ev.SArgs[0], - TaskID: ev.Args[0], - Start: ev, - GExecutionStat: g.snapshotStat(lastTs, gcStartTime), - }) - case 1: // region end - var sd *UserRegionDesc - if regionStk := g.activeRegions; len(regionStk) > 0 { - n := len(regionStk) - sd = regionStk[n-1] - regionStk = regionStk[:n-1] // pop - g.activeRegions = regionStk - } else { - sd = &UserRegionDesc{ - Name: ev.SArgs[0], - TaskID: ev.Args[0], - } - } - sd.GExecutionStat = g.snapshotStat(lastTs, gcStartTime).sub(sd.GExecutionStat) - sd.End = ev - g.Regions = append(g.Regions, sd) - } - } - } - - for _, g := range gs { - g.finalize(lastTs, gcStartTime, nil) - - // sort based on region start time - sort.Slice(g.Regions, func(i, j int) bool { - x := g.Regions[i].Start - y := g.Regions[j].Start - if x == nil { - return true - } - if y == nil { - return false - } - return x.Ts < y.Ts - }) - - g.gDesc = nil - } - - return gs -} - -// RelatedGoroutines finds a set of goroutines related to goroutine goid. -func (p *Parsed) RelatedGoroutines(goid uint64) map[uint64]bool { - events := p.Events - // BFS of depth 2 over "unblock" edges - // (what goroutines unblock goroutine goid?). - gmap := make(map[uint64]bool) - gmap[goid] = true - for i := 0; i < 2; i++ { - gmap1 := make(map[uint64]bool) - for g := range gmap { - gmap1[g] = true - } - for _, ev := range events { - if ev.Type == EvGoUnblock && gmap[ev.Args[0]] { - gmap1[ev.G] = true - } - } - gmap = gmap1 - } - gmap[0] = true // for GC events - return gmap -} diff --git a/src/internal/traceparser/parser_test.go b/src/internal/traceparser/parser_test.go deleted file mode 100644 index 68cc69e375e61..0000000000000 --- a/src/internal/traceparser/parser_test.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -import ( - "io/ioutil" - "os" - "path/filepath" - "runtime" - "strings" - "testing" -) - -var ( - // testfiles from the old trace parser - otherDir = "../trace/testdata/" - want = map[string]bool{"http_1_9_good": true, "http_1_10_good": true, "http_1_11_good": true, - "stress_1_9_good": true, "stress_1_10_good": true, "stress_1_11_good": true, - "stress_start_stop_1_9_good": true, "stress_start_stop_1_10_good": true, - "stress_start_stop_1_11_good": true, "user_task_span_1_11_good": true, - - "http_1_5_good": false, "http_1_7_good": false, - "stress_1_5_good": false, "stress_1_5_unordered": false, "stress_1_7_good": false, - "stress_start_stop_1_5_good": false, "stress_start_stop_1_7_good": false, - } -) - -func TestRemoteFiles(t *testing.T) { - if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { - t.Skipf("files from outside the package are not available on %s/%s", runtime.GOOS, runtime.GOARCH) - } - files, err := ioutil.ReadDir(otherDir) - if err != nil { - t.Fatal(err) - } - for _, f := range files { - fname := filepath.Join(otherDir, f.Name()) - p, err := New(fname) - if err == nil { - err = p.Parse(0, 1<<62, nil) - } - if err == nil != want[f.Name()] { - t.Errorf("%s: got %v expected %v, err=%v", - f.Name(), err == nil, want[f.Name()], err) - } - } -} - -func TestLocalFiles(t *testing.T) { - - files, err := ioutil.ReadDir("./testdata") - if err != nil { - t.Fatalf("failed to read ./testdata: %v", err) - } - for _, f := range files { - fname := filepath.Join("./testdata", f.Name()) - p, err := New(fname) - if err == nil { - err = p.Parse(0, 1<<62, nil) - } - switch { - case strings.Contains(f.Name(), "good"), - strings.Contains(f.Name(), "weird"): - if err != nil { - t.Errorf("unexpected failure %v %s", err, f.Name()) - } - case strings.Contains(f.Name(), "bad"): - if err == nil { - t.Errorf("bad file did not fail %s", f.Name()) - } - default: - t.Errorf("untyped file %v %s", err, f.Name()) - } - } -} - -func TestStats(t *testing.T) { - // Need just one good file to see that OSStats work properly, - files, err := ioutil.ReadDir("./testdata") - if err != nil { - t.Fatal(err) - } - for _, f := range files { - if !strings.HasPrefix(f.Name(), "good") { - continue - } - fname := filepath.Join("./testdata", f.Name()) - p, err := New(fname) - if err != nil { - t.Fatal(err) - } - stat := p.OSStats() - if stat.Bytes == 0 || stat.Seeks == 0 || stat.Reads == 0 { - t.Errorf("OSStats impossible %v", stat) - } - fd, err := os.Open(fname) - if err != nil { - t.Fatal(err) - } - pb, err := ParseBuffer(fd) - if err != nil { - t.Fatal(err) - } - stat = pb.OSStats() - if stat.Seeks != 0 || stat.Reads != 0 { - t.Errorf("unexpected positive results %v", stat) - } - } -} diff --git a/src/internal/traceparser/raw.go b/src/internal/traceparser/raw.go deleted file mode 100644 index e36a95147580e..0000000000000 --- a/src/internal/traceparser/raw.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -import ( - "encoding/binary" - "fmt" - "hash/fnv" - "io" - "log" -) - -// convert batches into their raw events. For small intervals (1 or 10 seconds) -// this takes about 40% of the total Parse time. - -func (p *Parsed) batchify(b *batch) error { - evs := make([]rawEvent, 0) - p.seenArgs = make(map[uint64]*[]uint64) - hasher := fnv.New64() - r := p.r - r.Seek(int64(b.Off), 0) - var buf [1]byte - seenBatch := false // to terminate the loop on the second EvBatch - - for off := b.Off; ; { - off0 := off // remember the beginning of the event - n, err := r.Read(buf[:]) - if err != nil { - return err - } - off += n - typ := buf[0] << 2 >> 2 // event type is bottom 6 bits - if typ == EvFrequency || (typ == EvBatch && seenBatch) { - break // found trailer, or next batch - } - if typ == EvBatch { - seenBatch = true - } - if typ == EvString { - // skip over it. error checking was done in file.go - _, off, _ = readVal(r, off) - var ln uint64 - ln, off, _ = readVal(r, off) - // PJW: why not just seek ahead ln bytes? - if false { - buf := make([]byte, ln) - var n int - n, _ = io.ReadFull(r, buf) - off += n - } else { - n, _ := r.Seek(int64(ln), 1) - off = int(n) - } - continue - } - // build the raw event and collect its arguments - ev := rawEvent{typ: typ, off: uint32(off0 - b.Off)} - var args []uint64 - off, args, err = p.argsAt(off0, typ) - if err != nil { - // PJW: make sure this is useful - return fmt.Errorf("parsing %s failed at P=%d off=%d %v", evname(typ), - b.P, off0, err) - } - - // have we seen the args before? - if len(args) > 0 { - ev.arg0 = args[0] - if len(args) > 1 { - hasher.Reset() - for i := 1; i < len(args); i++ { - var x [8]byte - binary.LittleEndian.PutUint64(x[:], args[i]) - _, err := hasher.Write(x[:]) - if err != nil { - log.Fatal(err) - } - } - hc := hasher.Sum64() - old, ok := p.seenArgs[hc] - if !ok { - final := make([]uint64, len(args)-1) - copy(final, args[1:]) - p.seenArgs[hc] = &final - } else { - // is this a collision? PJW: make this precisely right - if len(*old) != len(args[1:]) { - log.Fatalf("COLLISION old:%v this:%v", *old, args[1:]) - } - } - ev.args = p.seenArgs[hc] - } - } - if typ == EvUserLog { - // argsAt didn't read the string argument - var s string - s, off, err = readStr(r, off) - ev.sarg = s - } - evs = append(evs, ev) - } - b.raws = evs - return nil -} diff --git a/src/internal/traceparser/robust.go b/src/internal/traceparser/robust.go deleted file mode 100644 index 91748c592fc9e..0000000000000 --- a/src/internal/traceparser/robust.go +++ /dev/null @@ -1,585 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -// there are panics for impossible situations. probably an error would be better -// (if only it were certain these are impossible) - -import ( - "fmt" - "log" -) - -// repair an incomplete or possibly damaged interval of Events -// so that postProcess is happy - -// errors returned by checkRunning() -const ( - ok = 0 - badRunning = 1 << iota - badP - badG0 -) - -// states of g's and p's -type gdesc struct { - state gStatus - ev, evStart, evCreate, evMarkAssist *Event -} - -type pdesc struct { - running bool - g uint64 - evSTW, evSweep *Event -} - -func locstr(ev *Event) string { - if ev == nil { - return "" - } - return fmt.Sprintf("%s:%x", evname(ev.Type), ev.Ts) -} -func (p pdesc) String() string { - return fmt.Sprintf("[%v %d %s %s]", p.running, p.g, locstr(p.evSTW), locstr(p.evSweep)) -} - -func (g gdesc) String() string { - var nm string - switch g.state { - case gDead: - nm = "dead" - case gWaiting: - nm = "waiting" - case gRunnable: - nm = "runnable" - case gRunning: - nm = "running" - } - f := locstr - return fmt.Sprintf("[%s %s,%s,%s,%s]", nm, f(g.ev), f(g.evStart), - f(g.evCreate), f(g.evMarkAssist)) -} - -func checkRunning(pd pdesc, gd gdesc, ev *Event, okG0 bool) int { - ret := ok - if gd.state != gRunning { - ret |= badRunning - } - if pd.g != ev.G { - ret |= badP - } - if !okG0 && ev.G == 0 { - ret |= badG0 - } - return ret -} - -type aux struct { - pref []*Event // prefix - evs []*Event // copies and inserted - deleted map[byte]int // count by Type - inserted map[byte]int // count by Type - gs map[uint64]gdesc - ps map[int32]pdesc - g gdesc - px pdesc - my *Parsed - input []*Event // events in call to robust() - last int // last index handled by reorder - err error // report inconsistent trace files -} - -func (a *aux) preftime() int64 { - ts := a.my.MinWant - 1000 - if ts < 0 { - ts = 0 - } - if len(a.pref) > 0 { - ts = a.pref[len(a.pref)-1].Ts + 1 - } - return ts -} -func (a *aux) delete(i int, ev *Event) { - a.deleted[ev.Type]++ -} -func (a *aux) prefix(typ byte, g uint64, p int32) { - ts := a.preftime() - ev := &Event{Type: typ, G: g, P: p, Ts: ts, - Args: [3]uint64{0, 0, 1}} - a.pref = append(a.pref, ev) -} -func (a *aux) procstart(p int32) { - if p >= FakeP || a.px.running { - return - } - a.prefix(EvProcStart, 0, p) - a.px.running = true -} -func (a *aux) makewaiting(i int, g uint64, typ byte) { - // GoCreate, g=0 args[0]=g; maybe it exists already? - // GoWaiting or GoInSysCall - p := int32(a.my.batches[0].P) - ev := &Event{Type: EvGoCreate, P: p, - Ts: a.preftime(), Args: [3]uint64{g, 0, 2}} - a.pref = append(a.pref, ev) - a.gs[g] = gdesc{state: gRunnable, ev: ev, evCreate: ev} - ev = &Event{Type: typ, G: g, P: p, - Ts: a.preftime(), Args: [3]uint64{g, 0, 3}} - a.pref = append(a.pref, ev) - switch typ { - default: - panic(fmt.Sprintf("weird typ %s in makewaiting", evname(typ))) - case EvGoWaiting, EvGoInSyscall: - // ok - } -} - -func (a *aux) makerunnable(i int, ev *Event) { - // Create, Sched, Preempt, or Unblock - switch a.gs[ev.G].state { - case gDead: - p := int32(a.my.batches[0].P) - ev := &Event{Type: EvGoCreate, P: p, - Ts: a.preftime(), Args: [3]uint64{ev.G, 0, 4}} - a.pref = append(a.pref, ev) - a.gs[ev.Args[0]] = gdesc{state: gRunnable, ev: ev, evCreate: ev} - case gRunnable: - return - case gRunning: - //a.prevs(i) - a.err = fmt.Errorf("gRunning %d:%s", i, ev) - case gWaiting: - //a.prevs(i) - a.err = fmt.Errorf("no consistent ordering possible %d:%s", i, ev) - } -} -func (a *aux) makerunning(i int, ev *Event) { - // GoStart once it is runnable - switch a.g.state { - case gDead: - a.makerunnable(i, ev) - case gRunnable: - break - case gRunning: - return - case gWaiting: - a.err = fmt.Errorf("gWaiting in makerunnable %d:%s %+v", i, ev, a.g) - } - // PJW: which P? Probably need a ProcStart once - if !a.px.running { - a.procstart(ev.P) - } - p := ev.P - if p == TimerP { - p = int32(ev.Args[2]) // from events.go:71 - ev.Args[2] = 0 - } - x := &Event{Type: EvGoStart, G: ev.G, P: p, Args: [3]uint64{ev.G, 0, 5}} - x.Ts = ev.Ts - 1 - a.evs = append(a.evs, x) - a.g.state = gRunning - a.g.evStart = x - a.px.g = x.G - a.inserted[EvGoStart]++ -} - -func (p *Parsed) robust(events []*Event) ([]*Event, *aux, error) { // *aux for debugging (CheckRobust) - a := new(aux) - a.gs = make(map[uint64]gdesc) - a.ps = make(map[int32]pdesc) - var evGC, evSTW *Event - tasks := make(map[uint64]*Event) // task id to create - activeSpans := make(map[uint64][]*Event) - a.gs[0] = gdesc{state: gRunning} // bootstrap - a.deleted = make(map[byte]int) - a.inserted = make(map[byte]int) - a.my = p - a.input = events - - for i, ev := range events { - if a.err != nil { - break - } - if i < len(events)-1 && ev.Ts == events[i+1].Ts && - i > a.last { - // sigh. dragonfly, or similar trouble. - // a.last is to avoid overlapping calls - // This is a placeholder if needed. - //a.reorder(i, events) - ev = events[i] - } - var gok, pok bool - a.g, gok = a.gs[ev.G] - a.px, pok = a.ps[ev.P] - switch ev.Type { - case EvProcStart: - if a.px.running { // This doesn't happen, but to be safe - a.delete(i, ev) // already started - continue - } - a.px.running = true - case EvProcStop: - if !pok { // Ok to delete, as we've never heard of it - a.delete(i, ev) - continue - } - if !a.px.running { - a.procstart(ev.P) - } - if a.px.g != 0 { - // p is running a g! Stop the g? Ignore the Stop? - // Ignore the Stop. I don't think this happens. - // (unless there are equal Ts's or the file is corrupt) - a.err = fmt.Errorf("unexpected %d:%s %v", i, ev, a.px) - // a.delete(i, ev) // PJW - continue - } - a.px.running = false - case EvGCStart: - if evGC != nil { - // already running; doesn't happen - a.delete(i, ev) - continue - } - evGC = ev - case EvGCDone: - if evGC == nil { - // no GCStart to link it to: choice is lying about - // the duration or the existence. Do the latter - a.delete(i, ev) - continue - } - evGC = nil - case EvGCSTWStart: - evp := &evSTW - if p.Version < 1010 { - // Before 1.10, EvGCSTWStart was per-P. - evp = &a.px.evSTW - } - if *evp != nil { - // still running; doesn't happen - a.delete(i, ev) - continue - } - *evp = ev - case EvGCSTWDone: - evp := &evSTW - if p.Version < 1010 { - // Before 1.10, EvGCSTWDone was per-P. - evp = &a.px.evSTW - } - if *evp == nil { - // no STWStart to link to: choice is lying about - // duration or the existence. Do the latter. - a.delete(i, ev) - continue - } - *evp = nil - case EvGCMarkAssistStart: - if a.g.evMarkAssist != nil { - // already running; doesn't happen - a.delete(i, ev) - continue - } - a.g.evMarkAssist = ev - case EvGCMarkAssistDone: - // ok to be in progress - a.g.evMarkAssist = nil - case EvGCSweepStart: - if a.px.evSweep != nil { - // older one still running; doesn't happen - a.delete(i, ev) - continue - } - a.px.evSweep = ev - case EvGCSweepDone: - if a.px.evSweep == nil { - // no Start to link to: choice is lying about - // duration or existence. Do the latter. - a.delete(i, ev) - continue - } - a.px.evSweep = nil - case EvGoWaiting: - if a.g.state != gRunnable { - a.makerunnable(i, ev) - } - a.g.state = gWaiting - a.g.ev = ev - case EvGoInSyscall: // PJW: same as GoWaiting - if a.g.state != gRunnable { - a.makerunnable(i, ev) - } - a.g.state = gWaiting - a.g.ev = ev - case EvGoCreate: - if _, ok := a.gs[ev.Args[0]]; ok { - // this g already exists; doesn't happen - a.delete(i, ev) - continue - } - ret := checkRunning(a.px, a.g, ev, true) - if ret&badRunning != 0 { - a.makerunning(i, ev) - a.g.state = gRunning - } - if ret&badP != 0 { - a.procstart(ev.P) - } - a.gs[ev.Args[0]] = gdesc{state: gRunnable, ev: ev, - evCreate: ev} - case EvGoStart, EvGoStartLabel: - if a.g.state != gRunnable { - a.makerunnable(i, ev) - } - if a.px.g != 0 { - //a.prevs(i) - a.err = fmt.Errorf("p already running %d, %d:%s", - a.px.g, i, ev) - } - a.g.state = gRunning - a.g.evStart = ev // PJW: do we need g.evStart? - a.px.g = ev.G - a.g.evCreate = nil // PJW: do we need g.evCreate? - case EvGoEnd, EvGoStop: - if !gok { - // never heard of it; act as if it never existed - a.delete(i, ev) - continue - } - ret := checkRunning(a.px, a.g, ev, false) - if ret&badRunning != 0 { - a.makerunning(i, ev) - a.g.state = gRunning - } - if ret&badP != 0 { - a.procstart(ev.P) - } - if ret&badG0 != 0 { - // gok should have been false - panic(fmt.Sprintf("badG0 %d:%s", i, ev)) - } - a.g.evStart = nil - a.g.state = gDead - a.px.g = 0 - case EvGoSched, EvGoPreempt: - ret := checkRunning(a.px, a.g, ev, false) - if ret&badG0 != 0 { - // hopeless, we think. Don't know g - a.delete(i, ev) - } - if ret&badRunning != 0 { - a.makerunning(i, ev) - a.g.state = gRunning - } - if ret&badP != 0 { - a.procstart(ev.P) - } - a.g.state = gRunnable - a.g.evStart = nil - a.px.g = 0 - a.g.ev = ev - case EvGoUnblock: - // g == 0 is ok here (PJW) and elsewhere? - if a.g.state != gRunning { - a.makerunning(i, ev) - a.g.state = gRunning - } - if ev.P != TimerP && a.px.g != ev.G { - //a.prevs(i) - a.err = fmt.Errorf("%v not running %d:%s", - a.px, i, ev) - continue - } - g1, _ := a.gs[ev.Args[0]] - if g1.state != gWaiting { - a.makewaiting(i, ev.Args[0], EvGoWaiting) - g1.state = gWaiting - } - g1.state = gRunnable - g1.ev = ev - a.gs[ev.Args[0]] = g1 - // if p == TimerP, clean up from events.go:71 - ev.Args[2] = 0 // no point in checking p - case EvGoSysCall: - if ev.G == 0 { - // hopeless; don't know how to repair - a.delete(i, ev) - continue - } - ret := checkRunning(a.px, a.g, ev, false) - if ret&badRunning != 0 { - a.makerunning(i, ev) - a.g.state = gRunning - } - if ret&badP != 0 { - a.procstart(ev.P) - } - a.g.ev = ev - case EvGoSysBlock: - if ev.G == 0 { - // hopeless to repair - a.delete(i, ev) - } - ret := checkRunning(a.px, a.g, ev, false) - if ret&badRunning != 0 { - a.makerunning(i, ev) - a.g.state = gRunning - } - if ret&badP != 0 { - a.procstart(ev.P) - } - a.g.state = gWaiting - a.g.evStart = nil - a.px.g = 0 - case EvGoSysExit: - if ev.G == 0 { - // don't know how to repair - a.delete(i, ev) - continue - } - if a.g.state != gWaiting { - a.makewaiting(i, ev.G, EvGoInSyscall) - } - a.g.state = gRunnable - a.g.ev = ev - case EvGoSleep, EvGoBlock, EvGoBlockSend, EvGoBlockRecv, - EvGoBlockSelect, EvGoBlockSync, EvGoBlockCond, - EvGoBlockNet, EvGoBlockGC: - if ev.G == 0 { // don't know how to repair - a.delete(i, ev) - continue - } - ret := checkRunning(a.px, a.g, ev, false) - if ret&badRunning != 0 { - a.makerunning(i, ev) - a.g.state = gRunning - } - if ret&badP != 0 { - a.procstart(ev.P) - } - a.g.state = gWaiting - a.g.ev = ev - a.g.evStart = nil - a.px.g = 0 - case EvHeapAlloc, EvGomaxprocs, EvNextGC, EvUserLog: - a.makerunning(i, ev) - a.g.state = gRunning - a.px.g = ev.G - default: - return nil, nil, fmt.Errorf("robust: unexpected %d:%s", i, ev) - case EvUserTaskCreate: - taskid := ev.Args[0] - if _, ok := tasks[taskid]; ok { - // task id conflict, kill this one, believe the earlier one - a.delete(i, ev) - continue - } - tasks[ev.Args[0]] = ev - case EvUserTaskEnd: // nothing to do - case EvUserRegion: - mode := ev.Args[1] - spans := activeSpans[ev.G] - if mode == 0 { - activeSpans[ev.G] = append(spans, ev) - } else if mode == 1 { // span end - n := len(spans) - if n > 0 { - // check that spans match up; clean up if not - s := spans[n-1] - if s.Args[0] != ev.Args[0] || - s.SArgs[0] != ev.SArgs[0] { - // try to fix it - var ok bool - spans, ok = fixSpan(spans, ev) - if !ok { - // unfixed, toss this event - a.delete(i, ev) - continue - } - } - n = len(spans) - if n > 1 { - activeSpans[ev.G] = spans[:n-1] - } else { - delete(activeSpans, ev.G) - } - } - } else { - // invalid mode, toss it - a.delete(i, ev) - continue - } - } - a.gs[ev.G] = a.g - a.ps[ev.P] = a.px - a.evs = append(a.evs, ev) - } - ans := a.pref - ans = append(ans, a.evs...) - p.Preflen = len(a.pref) - p.Added = len(a.inserted) - p.Ignored = len(a.deleted) - return ans, a, a.err -} - -func fixSpan(spans []*Event, ev *Event) ([]*Event, bool) { - // probably indicates a corrupt trace file - panic("implement") -} - -type same struct { - ev *Event - g gdesc - p pdesc -} - -// This is a placeholder, to organize intervals with equal time stamps -func (a *aux) reorder(n int, events []*Event) { - // bunch of Events with equal time stamps - // We care about GoCreate, GoWaiting, GoInSyscall, - // GoStart (StartLocal, StartLabel), GoBlock*, - // GosSched, GoPreempt, GoUnblock, GoSysExit, - // (UnblockLocal, SysExitLocal), GCStart. - // maybe ProcStart and ProcStop? - repair := []same{} - i := n - for ; i < len(events) && events[i].Ts == events[n].Ts; i++ { - ev := events[i] - repair = append(repair, same{ev, a.gs[ev.G], - a.ps[ev.P]}) - } - a.last = i - 1 - log.Println("BEFORE:") - for i, r := range repair { - log.Printf("x%d:%s %v %v", i+n, r.ev, r.g, r.p) - } - if true { // PJW - return // we're not doing anything yet - } - // sorting is not going to be enough. - log.Println("DID NOTHING!") - log.Println("after") - for i, r := range repair { - log.Printf("y%d:%s %v %v", i+n, r.ev, r.g, r.p) - } - for i, r := range repair { - events[n+i] = r.ev - } -} - -// printing for debugging -func (a *aux) prevs(n int) { - for i := 0; i < len(a.pref); i++ { - log.Printf("p%3d %s", i, a.pref[i]) - } - start := 0 - if n > 50 { - start = n - 50 - } - for i := start; i <= n+1 && i < len(a.input); i++ { - log.Printf("%4d %s", i, a.input[i]) - } -} diff --git a/src/internal/traceparser/testdata/06dfecf6e5dfb78e954e7892120b56bfca50af65-6.bad b/src/internal/traceparser/testdata/06dfecf6e5dfb78e954e7892120b56bfca50af65-6.bad deleted file mode 100644 index 6e9e23ee8dce4ac87559a2bee6272184341f7d61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 79 zcmYe#S1{BwG*l=lN=!~=U|?`$RskV414lMjN980(1};Zs2v-@KAV`f<0}L=S0swxt B5nTWP diff --git a/src/internal/traceparser/testdata/0e6dd1787a6339366dac733a2f957a05d7aa3ac7-3.bad b/src/internal/traceparser/testdata/0e6dd1787a6339366dac733a2f957a05d7aa3ac7-3.bad deleted file mode 100644 index 7b723f889f85b16410ef8c29b5d8767f270d1321..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50 zcmYe#S1{BwG*l=lN=!~=U|?`$Wl0kef5E2eDxSdR`hwY&k@*F8ZmM2zNq#{HPz{qg E06{VhYybcN diff --git a/src/internal/traceparser/testdata/16970d24ef6753d71953e20d10638705bdccc3ba-2.weird b/src/internal/traceparser/testdata/16970d24ef6753d71953e20d10638705bdccc3ba-2.weird deleted file mode 100644 index 6b4b06c6efd4299a846eacefa6ddf292f9575063..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62 zcmYe#S1{BwG*l=lN=!~=U|?`$m~!Li@~b~5w)~c6GjU|&a#U7vWHWGNQwNi-j><`n P3|x+EsZ1NcHi`fMTt^Zj diff --git a/src/internal/traceparser/testdata/26492441b33e1bb93669f79cf3584755cc3ef7e8-2.weird b/src/internal/traceparser/testdata/26492441b33e1bb93669f79cf3584755cc3ef7e8-2.weird deleted file mode 100644 index 565a8b2fbcdef5d795772337d09bd1d93532de0e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70 zcmYe#S1{BwG*l=lN=!~=U|?_z;7v{~guH6~sazXPdG@D2nQ*Zk_&X?&|8xpvJHOg3*NgVM7{>(y+!PXayPJcvl3%TTh@A z4@%7lhlQ$1_L3u-Wox>c^Rg_XHVT9rFqf(tmc8j8dlFC-mwq~#?FX-%TdUGQh-UW< zT#d4)Z#1z$HoE1`p5fO)#;sjTKLv0kV@~R}Rw1Hg%cea%PDTu~T*T4+(xhcdWkZq6 zl4=-gnMmVC#eK*VTE*Qd%ev~mB+FE!bqJ|y8j7eIIF<@PhkQ`4cR2pgHW2-`dyt8S zAj#U64~+T#?P5xGxM0RBesU^s!8!) z7PqOQeP~kGiHRE?*#iE0uoQr(hSM8D=l`6Bk!US6e{BZF;?wZbHw!SqKmXIuS71^| zfBfcqFx7C9#c3gE&LJWfhyC7Unm5!y^s6hDCUvFYq%!dLn=>#SpQf)}Uw|3@IKbJg zbyQcx-rXazW)GUiWHm2(pSbbiEy(aNq$xK{^$^@HJI!(WliRZ}+jty&_KQb5AJBH1 zIC}0|PtdVVf*dXk&iKTRIYJtqxaq~+6~y5tK9K9aOPc;1Zr%#Vpe_|RR4#iQBM5wP z`9;{&{06`+b@!AEQz5D{PRdncIuRP2S)7I~(G}nb4e(1}%bq%?9d%A)sx?JO6}KMP zLfz_|RK<_>SaA$k{PhIf(JDGZ3|{mTw$>Bw+#AIBV}IuvU+cH%Ubna{yWzYzqS@oV z4cZ^u22Vey^p6cZKj-#r$nf8ca7X@spLTkZ==!-OxKrr*{Hq1n)_w|HI==*SLT9jC zeRT@vZgy61dDG^!_H{M5dhpYWVkCG9QM@=8bfZci+ESvOhdL&T{9C7 zZolyW$CKt}mEf8JS;j=Vs~!m*f|OfJG7*V;2Z8g(Lta J6BwD9%mMBY5KI67 diff --git a/src/internal/traceparser/testdata/4557f81f6aae617eeec8dd920997ea27b3dda12b.weird b/src/internal/traceparser/testdata/4557f81f6aae617eeec8dd920997ea27b3dda12b.weird deleted file mode 100644 index ae93a0e35c8078a445f5d47a6e86f8001170e74a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2199 zcma)7eP|nH7|;9OT`rgAyWd}1`thzwyWTY*TXFlRXg5R$uB~oJA>5M7ha`8|<+4rv zCzW+mIt#V417Vx(AFFf-IuT}#GcyP(gpTP@3o^wabY-qnnft?u_g-?rSVH#CliWSe z^Lu{3=Y8Ji!jjv^`Uc#J%m)O6!7yaF`Qyp2KPU5~0YH$az5FneDL2T%BdKdp~dpfY>!shJjIjpg}o zfHgD+jf>5|W`8AA55^<*@jHZL|7ELl2)w?A6$~4Q=>-=B_!lrjT{^pqzd~Z`P_f3J zX2xzXX5$PTUT7zbKi3Yy<$nrUl<^t3xOBe`k+q7DRH9;-_4MxZvWJ9_Bnyb@!4`Y#)nkkL^FF_IDy-5?4I7g3aiAN$xb)$HS=A~N+?0@f3_ zxEfc;Qn48ZKeE^$b89I^^K+Wj{9!5A0m!@WWgtntX}UO>fkx^Kef#el1Z`?uU4KY0 z=2aTiIOUY6MB@S*i14B;1djNSrKb|1Vl0Pau}o`IQKss^dXj7?B?i>F%DHUt_T>p! zV>wQ&-pfEM^*fDh^?EI}p#dQrhzPNSAR~L#dI?zysP%GY0&ILY1#R|U0CL!Mv_s+K zQ9(!`XJ0km@o+#3#aIjpveU0Yhm%FFhN29%TnDPP>kefkC5kH7y3)bwp*f$$IP*sa zx>SiP4?cml)H-!$F$3$Ub^6)~-1WCNb-mu2d?^{=V=?xq990C=u(J~LVjTB!@sB?i z6;sFjd_1`0F?<4zC8PryQWIAVNe4=a(PJ2)xj8B-f~;OxE+MImJiU9K^s)uCmVruW zWjS0Z=-1&|9a0iwMAb`QRM%GVe5E88QUgoL?f*?KP}tI0i9#_MYuIWD#T9l>LRM+T zMC9(Sl%s}mS`?mur|itFzs|$@hDp=+SI)!6rjNk%*$c3_WfgpS_FdT8wg%>}FT(aM zr@+$2CAii704%(L5A@uo1MRTr!-(%*j)7ofWeRrKUqqeFMGvQKT6R?7Wu&d^+6qbBnz4v*K$2rYq_az>V2}NM`sN3-(Bpj-&TBFotH?yXHF%nyEeum`zr*~fJ=dq? z{=G}E*F6ERPT^^}uxVQQ%9d_Y5Q9Fnz5aizrZ6M9K`Xs*ZUXjM4zK=}f!nEHsUNf@ zbEoQ(>95lpsP$y8G^#G#AYx0!M-?eiXe+1px-_Ix0u8uyM%rhP52;%sH|V5q&76k) z-aqMwAI?J7I|n~gM}q6}etb0p2dImt>ze4rO`?6Jx+4M~)avG(W_b3CS?KegAm+4r GZTlCy?*;Av diff --git a/src/internal/traceparser/testdata/495712b6e35ad7566869c887aa823fcbf69c0b80-1.weird b/src/internal/traceparser/testdata/495712b6e35ad7566869c887aa823fcbf69c0b80-1.weird deleted file mode 100644 index 072bc93960482286c5e4ed25a8c53ef6f9e67233..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27 icmYe#S1{BwG*l=lN=!~=U|?`$WsK)gicd^tvIGEI#s(Dt diff --git a/src/internal/traceparser/testdata/63cd688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad b/src/internal/traceparser/testdata/63cd688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad deleted file mode 100644 index 5506aa0e6172e554c381cb35e374f665416d3eb7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23 ecmYe#S1{BwG*l=lN=!~=U|?{RPg6-|vIGD|*adF@ diff --git a/src/internal/traceparser/testdata/63df44bfc9d27851fb054ce03002e7e25f307e2f-5.weird b/src/internal/traceparser/testdata/63df44bfc9d27851fb054ce03002e7e25f307e2f-5.weird deleted file mode 100644 index 74ea28cd8ec9e758cba62b139170e6dce995f8ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 scmYe#S1{BwG*l=lN=!~=U|?`$X6fT&Q}1!~Rqnw?Ba6i+CNo(A00Bb}xc~qF diff --git a/src/internal/traceparser/testdata/6aa1a69b265c3092972a2a81e77fbcaa87061735-4.bad b/src/internal/traceparser/testdata/6aa1a69b265c3092972a2a81e77fbcaa87061735-4.bad deleted file mode 100644 index af0307958e88231883eab6d59a26f6c3ecfb917d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41 scmYe#S1{BwG*l=lN=!~=U|?{}^zI7+5hku|5^SPC%)pk%mdC^j0NW1<1ONa4 diff --git a/src/internal/traceparser/testdata/7b82e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad b/src/internal/traceparser/testdata/7b82e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad deleted file mode 100644 index 5353946cf82be6cefeed31b824336223cf31fb0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 rcmYe#S1{BwG*l=lN=!~=U|?`$U_8shX5z}tCc&m2!YIm?$HWQ%lpY4O diff --git a/src/internal/traceparser/testdata/94347dc6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird b/src/internal/traceparser/testdata/94347dc6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird deleted file mode 100644 index 3141a88aba1f99770c2437418d04ced5ff8ba28b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmYe#S1{DGR46G*OipD00!Iz5yDZx5ObmC$6WCl|FuO7`zu?Zz)C(@jF9-pPBrwJ< K5MW|vG6w+15)VuO diff --git a/src/internal/traceparser/testdata/9fa93c88557e64b0714b8849aacf713d17ff928e-2.weird b/src/internal/traceparser/testdata/9fa93c88557e64b0714b8849aacf713d17ff928e-2.weird deleted file mode 100644 index c33f6cac577e1b5cc4819d1b33fe83b3bc3f55b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1683 zcmbVMOK1~O6wSLaX_GXaOqySRHvPP&^)q9^m7hY;+JzuuBi#rxolK^o$-Fq3Pz6C; zh)7UGH!W5~D59%W1O+!D&*DM_rJ~}eilQ!D=uQ+D&P+2Stwn4%^Jd<>d+s^+-t%M< z@8kOV;+iUmlEdLh?)7JsOR zCnqSfzVJm=UxK!;3FgCzEET?L}4&w#9Nu#zlnnZTGyt`?KGkprEJ zkPm87QR7njV}DUnQ$lfUs30hq-M#8ef}#*j(6U5Xz}D3S86!(pkvVN&Nl_#fH*8-4 zel?i4Kx9IDYFtyl%HZ`qs+oRv4(j}6n0;A+dgkc+4^JS#hVERs4#9>~ZX9B*=IoP% zbjs{axUpIfv#eaEq=@iM|qwqG(t6(w05m2zo^O1(~W zcBTwXzHf-K4e->|vfk#@Y;zisi{p||z%BhNsGH467WHV!tej^Jn)z}Pnp-%^*1=6P zVT+xxb)ywy4*K#_z0hb*ze(`g$fEPya8?^N2fuCCDtMYX`9FhiICv5Mzxm+y-v2&L z69L!!g*j+tJ0Co+z}mLcXm)B2;%tZY3GHkgchpr8xxA27s0Yx@)iQMW@{~oeWWI1` z$U1Ba86-n`o71?UU4h!kjV#C7}DdFb>{*PecH4!Zo8;NI&BVCFoU zG>4V9`_#QiD7Qx%-$4{jI;>Sq7+_)YO$EB!*8RLVrz=U&7~@N4XX0ikTqlXBT diff --git a/src/internal/traceparser/testdata/d28fcef078c7dc722867d781b1fd7f37ca965372-7.weird b/src/internal/traceparser/testdata/d28fcef078c7dc722867d781b1fd7f37ca965372-7.weird deleted file mode 100644 index 7d724caddcd88ea4d219ec116da3fe6cc5fdde1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62 zcmYe#S1{DGR46G*OipD00!IQ? diff --git a/src/internal/traceparser/tr.go b/src/internal/traceparser/tr.go deleted file mode 100644 index 770f280607f61..0000000000000 --- a/src/internal/traceparser/tr.go +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package traceparser parses the trace files produced by runtime.StartTrace -package traceparser - -import ( - "fmt" - "internal/traceparser/filebuf" - "io" - "strings" -) - -// Parsed is the result of parsing a trace file -type Parsed struct { - // Set by New - Name string // File's name - Size int64 // File's size - Count int64 // approximate number of all events - MaxTs int64 // range of all events, in nanoseconds - Strings map[uint64]string - Stacks map[uint32][]*Frame - Version int // version of the trace file from header - TicksPerSec int64 // from EvFrequency in trailer - minticks, maxticks int64 // from Init - r filebuf.Buf // implements io.Seek and io.Read - batches []batch // location of each Batch and time of start - timerGoids map[uint64]bool - // the following are per Parse - MinWant, MaxWant int64 // range wanted, from the arguments to Parse() - Err error // set by internal functions to stop further processing - Events []*Event // after Parse, the events from MinWant to MaxWant - Preflen int // how long a prefix we added - Ignored int // how many events we elided - Added int // how many events we added, not including the prefix - // internal processing variables - seenArgs map[uint64]*[]uint64 - byproc map[int][]*Event - lastGs map[int]uint64 - lastG uint64 - lastP int - lastTs int64 -} - -func (p *Parsed) String() string { - ans := []string{} - ans = append(ans, fmt.Sprintf("%s Sz:%d Count:%d MaxTs:%d #strs:%d #stks:%d", - p.Name, p.Size, p.Count, p.MaxTs, len(p.Strings), len(p.Stacks))) - ans = append(ans, fmt.Sprintf("%d clock:%d ticks:(%d,%d) #b:%d", - p.Version, p.TicksPerSec, p.minticks, p.maxticks, len(p.batches))) - return strings.Join(ans, "\n\t") -} - -// clean up after previous call to Parse -func (p *Parsed) clean() { - // some of these are redundant - p.Err = nil - p.Events = nil - p.Preflen = 0 - p.Ignored = 0 - p.Added = 0 - p.seenArgs = nil // redundant, but safe - p.byproc = nil - p.lastGs = nil - p.lastG = 0 - p.lastTs = 0 -} - -// Frame is a frame in a stack traces -type Frame struct { - PC uint64 - Fn string - File string - Line int -} - -// An Event is the parsed form of a single trace event -type Event struct { - Type byte - P int32 - Ts int64 - G uint64 - StkID uint32 // key to Parsed.Stacks - Args [3]uint64 - SArgs []string // EvUserLog has 2. Others are 1 or none - Link *Event -} - -// Batch remembers the EvBatch events. PJW: keep an index of User events? -type batch struct { - Off int - P int64 - Cycles int64 // as read from EvBatch - Nano int64 // start time of batch, set in commonInit() - raws []rawEvent // filled in during Parse() for those batches that overlap the desired interval -} - -// rawEvent is a raw event parsed from batches that overlap the time interval -type rawEvent struct { // about 75 bytes - // the choice of what to share (args) and what to make unique per rawEvent - // (arg0, sarg) was done by measuring the space impact of various choices. - off uint32 // offset in batch (at batch.Off + off in file) - typ byte - arg0 uint64 - args *[]uint64 // remainder of the args (frequently nil), shared - sarg string -} - -func (r rawEvent) String() string { - if r.args != nil && len(*r.args) > 0 { - return fmt.Sprintf("[%s %d %v %s]", evname(r.typ), r.arg0, *r.args, r.sarg) - } - return fmt.Sprintf("[%s, %d, [], %s]", evname(r.typ), r.arg0, r.sarg) -} - -// New scans the trace file, finding the number of events, the earliest and latest -// timestamps, and the stacks and strings referenced in the file. -func New(fname string) (*Parsed, error) { - fd, err := filebuf.New(fname) - if err != nil { - return nil, err - } - return commonInit(fd, fname) -} - -// ParseError may be returned by New() or ParseBuffer() to make available -// some information in the case that the raw trace file seems to contain -// negative time stamps. (In P, Name, Size, count, Strings, Stacks, Versions are valid, -// and MaxTs or TicksPerSec is negative.) -type ParseError struct { - P *Parsed - Err error -} - -func (pe ParseError) Error() string { - return pe.Err.Error() -} - -func commonInit(fd filebuf.Buf, fname string) (*Parsed, error) { - ans := &Parsed{Name: fname, minticks: 1 << 62} // minticks can only decrease - var err error - defer func() { - if err != nil { - fd.Close() // try to clean up after error - } - }() - ans.Size = fd.Size() - ans.r = fd - // parseRaw here for header, trailer: clock, stacks, strings, - if err = ans.parseHeader(); err != nil { - return nil, err - } - if err = ans.scanFile(); err != nil { - return nil, err - } - // done with seenArgs - ans.seenArgs = nil - // convert the clicks in batches to nanoseconds - ans.toNanoseconds() - if ans.MaxTs <= 0 || ans.TicksPerSec <= 0 { - err := ParseError{ - P: ans, - Err: fmt.Errorf("corrupt trace file: negative time: (max TS=%d, ticks per sec=%d", - ans.MaxTs, ans.TicksPerSec), - } - return nil, err - } - return ans, nil -} - -// Parse parses the events in the interval: start <= ts <= start+length. -// f, if not nil, will be called at various stages of the parse, each identified by the string -// argument. It could report on elapsed time, or memory usage, or whatever the user wants. -// The number of times it is called and the contents of the string argument are both -// changeable details of the implementation. Parse is not safe for concurrent use. -func (p *Parsed) Parse(start, length int64, f func(string)) error { - p.clean() - if f == nil { - f = func(string) {} // avoid any further testing for nil - } - - p.MinWant = start - p.MaxWant = start + length - // arrange the slice of batches by P - byp := map[int64][]*batch{} - // PJW: keep track of the order the Ps occur and use that for batchify - for i, b := range p.batches { - byp[b.P] = append(byp[b.P], &p.batches[i]) - p.batches[i].raws = nil // reset from last call to Parse - } - // batchify the ones that overlap the time range - for _, v := range byp { - for i := 0; i < len(v); i++ { - b := v[i] - var bnext *batch - if i < len(v)-1 { - bnext = v[i+1] - } - if b.Nano >= p.MaxWant { - // starts too late - continue - } else if b.Nano <= p.MinWant && (bnext != nil && bnext.Nano <= p.MinWant) { - // entirely too early - continue - } - err := p.batchify(b) - if err != nil { - return err - } - } - } - f("batchify done") - return p.createEvents(f) -} - -// ParseBuffer treats its argument as a trace file, and returns the -// result of parsing it -func ParseBuffer(rd io.Reader) (*Parsed, error) { - pr, err := filebuf.FromReader(rd) - if err != nil { - return nil, err - } - p, err := commonInit(pr, "") - if err != nil { - return nil, err - } - // need the version and the initial scan - err = p.Parse(0, 1<<62, nil) - if err != nil { - return nil, err - } - return p, nil -} - -// called from commonInit to compute the nanosecond when batches start -func (p *Parsed) toNanoseconds() { - minCycles := p.minticks - freq := 1e9 / float64(p.TicksPerSec) - // Batches, and more to come. Don't call this twice! - for i, ex := range p.batches { - p.batches[i].Nano = int64(float64(ex.Cycles-minCycles) * freq) - } - p.MaxTs = int64(float64(p.maxticks-minCycles) * freq) -} - -// argsAt returns the args of an event in the file and the offset for the next event. -// -// For EvString it returns off, nil, nil, and -// for EvUserLog it ignores the string argument, which must be read by the -// caller. -func (p *Parsed) argsAt(off int, check byte) (int, []uint64, error) { - off0 := off - r := p.r - loc, err := r.Seek(int64(off), 0) - if err != nil { - panic(err) - } - var buf [1]byte - n, err := r.Read(buf[:]) - if err != nil || n != 1 { - return 0, nil, fmt.Errorf("read failed at 0x%x, %d %v, loc=%d", - off, n, err, loc) - } - off += n - typ := buf[0] << 2 >> 2 - narg := buf[0]>>6 + 1 - inlineArgs := byte(4) - - if typ == EvNone || typ >= EvCount || - EventDescriptions[typ].MinVersion > p.Version { - return 0, nil, fmt.Errorf("unk type %v at offset 0x%x", typ, off0) - } - if typ == EvString { // skip, wihtout error checking - _, off, err = readVal(r, off) - var ln uint64 - ln, off, err = readVal(r, off) - off += int(ln) - return off, nil, nil - } - args := []uint64{} - if narg < inlineArgs { - for i := 0; i < int(narg); i++ { - var v uint64 - v, off, err = readVal(r, off) - if err != nil { - err = fmt.Errorf("failed to read event %v argument at offset %v (%v)", typ, off, err) - return 0, nil, err - } - args = append(args, v) - } - } else { - // More than inlineArgs args, the first value is length of the event in bytes. - var v uint64 - v, off, err = readVal(r, off) - if err != nil { - err = fmt.Errorf("failed to read event %v argument at offset %v (%v)", typ, off, err) - return 0, nil, err - } - evLen := v - off1 := off - for evLen > uint64(off-off1) { - v, off, err = readVal(r, off) - if err != nil { - err = fmt.Errorf("failed to read event %v argument at offset %v (%v)", typ, off, err) - return 0, nil, err - } - args = append(args, v) - } - if evLen != uint64(off-off1) { - err = fmt.Errorf("event has wrong length at offset 0x%x: want %v, got %v", off0, evLen, off-off1) - return 0, nil, err - } - } - // This routine does not read the string argument. Callers must tread EvUserLog specially. - return off, args, nil -} - -// read a string from r -func readStr(r io.Reader, off0 int) (s string, off int, err error) { - var sz uint64 - sz, off, err = readVal(r, off0) - if err != nil || sz == 0 { - return "", off, err - } - if sz > 1e6 { - return "", off, fmt.Errorf("string at offset %d is too large (len=%d)", off, sz) - } - buf := make([]byte, sz) - n, err := io.ReadFull(r, buf) - if err != nil || sz != uint64(n) { - return "", off + n, fmt.Errorf("failed to read trace at offset %d: read %v, want %v, error %v", off, n, sz, err) - } - return string(buf), off + n, nil -} - -// readVal reads unsigned base-128 value from r. -func readVal(r io.Reader, off0 int) (v uint64, off int, err error) { - off = off0 - for i := 0; i < 10; i++ { - var buf [1]byte - var n int - n, err = r.Read(buf[:]) - if err != nil || n != 1 { - return 0, 0, fmt.Errorf("failed to read trace at offset %d: read %v, error %v", off0, n, err) - } - off++ - v |= uint64(buf[0]&0x7f) << (uint(i) * 7) - if buf[0]&0x80 == 0 { - return - } - } - return 0, 0, fmt.Errorf("bad value at offset 0x%x", off0) -} - -// OSStats reports on the underlying i/o. If p was created by New, -// the fields report filesystem activity. If p was created by ParseBuffer, -// only Size is set. -func (p *Parsed) OSStats() filebuf.Stat { - return p.r.Stats() -} - -func (ev *Event) String() string { - var tslink int64 - if ev.Link != nil { - tslink = ev.Link.Ts - } - return fmt.Sprintf("[g:%d p:%d %s/%d %v %v %x ->%x]", - ev.G, ev.P, evname(ev.Type), ev.Type, - ev.Args, ev.SArgs, ev.Ts, tslink) - -} - -func evname(t byte) string { - if t >= EvCount || t < 0 { - return fmt.Sprintf("typ%d?", t) - } - return EventDescriptions[t].Name -} - -// Close the underlying file. -func (p *Parsed) Close() error { - return p.r.Close() -} - -// Event types in the trace. -// Verbatim copy from src/runtime/trace.go with the "trace" prefix removed. -const ( - EvNone = 0 // unused - EvBatch = 1 // start of per-P batch of events [pid, timestamp] - EvFrequency = 2 // contains tracer timer frequency [frequency (ticks per second)] - EvStack = 3 // stack [stack id, number of PCs, array of {PC, func string ID, file string ID, line}] - EvGomaxprocs = 4 // current value of GOMAXPROCS [timestamp, GOMAXPROCS, stack id] - EvProcStart = 5 // start of P [timestamp, thread id] - EvProcStop = 6 // stop of P [timestamp] - EvGCStart = 7 // GC start [timestamp, seq, stack id] - EvGCDone = 8 // GC done [timestamp] - EvGCSTWStart = 9 // GC mark termination start [timestamp, kind] - EvGCSTWDone = 10 // GC mark termination done [timestamp] - EvGCSweepStart = 11 // GC sweep start [timestamp, stack id] - EvGCSweepDone = 12 // GC sweep done [timestamp, swept, reclaimed] - EvGoCreate = 13 // goroutine creation [timestamp, new goroutine id, new stack id, stack id] - EvGoStart = 14 // goroutine starts running [timestamp, goroutine id, seq] - EvGoEnd = 15 // goroutine ends [timestamp] - EvGoStop = 16 // goroutine stops (like in select{}) [timestamp, stack] - EvGoSched = 17 // goroutine calls Gosched [timestamp, stack] - EvGoPreempt = 18 // goroutine is preempted [timestamp, stack] - EvGoSleep = 19 // goroutine calls Sleep [timestamp, stack] - EvGoBlock = 20 // goroutine blocks [timestamp, stack] - EvGoUnblock = 21 // goroutine is unblocked [timestamp, goroutine id, seq, stack] - EvGoBlockSend = 22 // goroutine blocks on chan send [timestamp, stack] - EvGoBlockRecv = 23 // goroutine blocks on chan recv [timestamp, stack] - EvGoBlockSelect = 24 // goroutine blocks on select [timestamp, stack] - EvGoBlockSync = 25 // goroutine blocks on Mutex/RWMutex [timestamp, stack] - EvGoBlockCond = 26 // goroutine blocks on Cond [timestamp, stack] - EvGoBlockNet = 27 // goroutine blocks on network [timestamp, stack] - EvGoSysCall = 28 // syscall enter [timestamp, stack] - EvGoSysExit = 29 // syscall exit [timestamp, goroutine id, seq, real timestamp] - EvGoSysBlock = 30 // syscall blocks [timestamp] - EvGoWaiting = 31 // denotes that goroutine is blocked when tracing starts [timestamp, goroutine id] - EvGoInSyscall = 32 // denotes that goroutine is in syscall when tracing starts [timestamp, goroutine id] - EvHeapAlloc = 33 // memstats.heap_live change [timestamp, heap_alloc] - EvNextGC = 34 // memstats.next_gc change [timestamp, next_gc] - EvTimerGoroutine = 35 // denotes timer goroutine [timer goroutine id] - EvFutileWakeup = 36 // denotes that the previous wakeup of this goroutine was futile [timestamp] - EvString = 37 // string dictionary entry [ID, length, string] - EvGoStartLocal = 38 // goroutine starts running on the same P as the last event [timestamp, goroutine id] - EvGoUnblockLocal = 39 // goroutine is unblocked on the same P as the last event [timestamp, goroutine id, stack] - EvGoSysExitLocal = 40 // syscall exit on the same P as the last event [timestamp, goroutine id, real timestamp] - EvGoStartLabel = 41 // goroutine starts running with label [timestamp, goroutine id, seq, label string id] - EvGoBlockGC = 42 // goroutine blocks on GC assist [timestamp, stack] - EvGCMarkAssistStart = 43 // GC mark assist start [timestamp, stack] - EvGCMarkAssistDone = 44 // GC mark assist done [timestamp] - EvUserTaskCreate = 45 // trace.NewContext [timestamp, internal task id, internal parent id, stack, name string] - EvUserTaskEnd = 46 // end of task [timestamp, internal task id, stack] - EvUserRegion = 47 // trace.WithSpan [timestamp, internal task id, mode(0:start, 1:end), stack, name string] - EvUserLog = 48 // trace.Log [timestamp, internal id, key string id, stack, value string] - EvCount = 49 -) - -// EventDescriptions describe the Events -var EventDescriptions = [EvCount]struct { - Name string - MinVersion int - Stack bool - Args []string - SArgs []string // string arguments -}{ - EvNone: {"None", 1005, false, []string{}, nil}, - EvBatch: {"Batch", 1005, false, []string{"p", "ticks"}, nil}, // in 1.5 format it was {"p", "seq", "ticks"} - EvFrequency: {"Frequency", 1005, false, []string{"freq"}, nil}, // in 1.5 format it was {"freq", "unused"} - EvStack: {"Stack", 1005, false, []string{"id", "siz"}, nil}, - EvGomaxprocs: {"Gomaxprocs", 1005, true, []string{"procs"}, nil}, - EvProcStart: {"ProcStart", 1005, false, []string{"thread"}, nil}, - EvProcStop: {"ProcStop", 1005, false, []string{}, nil}, - EvGCStart: {"GCStart", 1005, true, []string{"seq"}, nil}, // in 1.5 format it was {} - EvGCDone: {"GCDone", 1005, false, []string{}, nil}, - EvGCSTWStart: {"GCSTWStart", 1005, false, []string{"kindid"}, []string{"kind"}}, // <= 1.9, args was {} (implicitly {0}) - EvGCSTWDone: {"GCSTWDone", 1005, false, []string{}, nil}, - EvGCSweepStart: {"GCSweepStart", 1005, true, []string{}, nil}, - EvGCSweepDone: {"GCSweepDone", 1005, false, []string{"swept", "reclaimed"}, nil}, // before 1.9, format was {} - EvGoCreate: {"GoCreate", 1005, true, []string{"g", "stack"}, nil}, - EvGoStart: {"GoStart", 1005, false, []string{"g", "seq"}, nil}, // in 1.5 format it was {"g"} - EvGoEnd: {"GoEnd", 1005, false, []string{}, nil}, - EvGoStop: {"GoStop", 1005, true, []string{}, nil}, - EvGoSched: {"GoSched", 1005, true, []string{}, nil}, - EvGoPreempt: {"GoPreempt", 1005, true, []string{}, nil}, - EvGoSleep: {"GoSleep", 1005, true, []string{}, nil}, - EvGoBlock: {"GoBlock", 1005, true, []string{}, nil}, - EvGoUnblock: {"GoUnblock", 1005, true, []string{"g", "seq"}, nil}, // in 1.5 format it was {"g"} - EvGoBlockSend: {"GoBlockSend", 1005, true, []string{}, nil}, - EvGoBlockRecv: {"GoBlockRecv", 1005, true, []string{}, nil}, - EvGoBlockSelect: {"GoBlockSelect", 1005, true, []string{}, nil}, - EvGoBlockSync: {"GoBlockSync", 1005, true, []string{}, nil}, - EvGoBlockCond: {"GoBlockCond", 1005, true, []string{}, nil}, - EvGoBlockNet: {"GoBlockNet", 1005, true, []string{}, nil}, - EvGoSysCall: {"GoSysCall", 1005, true, []string{}, nil}, - EvGoSysExit: {"GoSysExit", 1005, false, []string{"g", "seq", "ts"}, nil}, - EvGoSysBlock: {"GoSysBlock", 1005, false, []string{}, nil}, - EvGoWaiting: {"GoWaiting", 1005, false, []string{"g"}, nil}, - EvGoInSyscall: {"GoInSyscall", 1005, false, []string{"g"}, nil}, - EvHeapAlloc: {"HeapAlloc", 1005, false, []string{"mem"}, nil}, - EvNextGC: {"NextGC", 1005, false, []string{"mem"}, nil}, - EvTimerGoroutine: {"TimerGoroutine", 1005, false, []string{"g"}, nil}, // in 1.5 format it was {"g", "unused"} - EvFutileWakeup: {"FutileWakeup", 1005, false, []string{}, nil}, - EvString: {"String", 1007, false, []string{}, nil}, - EvGoStartLocal: {"GoStartLocal", 1007, false, []string{"g"}, nil}, - EvGoUnblockLocal: {"GoUnblockLocal", 1007, true, []string{"g"}, nil}, - EvGoSysExitLocal: {"GoSysExitLocal", 1007, false, []string{"g", "ts"}, nil}, - EvGoStartLabel: {"GoStartLabel", 1008, false, []string{"g", "seq", "labelid"}, []string{"label"}}, - EvGoBlockGC: {"GoBlockGC", 1008, true, []string{}, nil}, - EvGCMarkAssistStart: {"GCMarkAssistStart", 1009, true, []string{}, nil}, - EvGCMarkAssistDone: {"GCMarkAssistDone", 1009, false, []string{}, nil}, - EvUserTaskCreate: {"UserTaskCreate", 1011, true, []string{"taskid", "pid", "typeid"}, []string{"name"}}, - EvUserTaskEnd: {"UserTaskEnd", 1011, true, []string{"taskid"}, nil}, - EvUserRegion: {"UserRegion", 1011, true, []string{"taskid", "mode", "typeid"}, []string{"name"}}, - EvUserLog: {"UserLog", 1011, true, []string{"id", "keyid"}, []string{"category", "message"}}, -} diff --git a/src/internal/traceparser/writer.go b/src/internal/traceparser/writer.go deleted file mode 100644 index 498bed72f36d6..0000000000000 --- a/src/internal/traceparser/writer.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traceparser - -// test routines used by tests in the trace commands - -import "bytes" - -// Writer is a test trace writer. -type Writer struct { - bytes.Buffer -} - -// NewWriter provides the test Writer -func NewWriter() *Writer { - w := new(Writer) - w.Write([]byte("go 1.9 trace\x00\x00\x00\x00")) - return w -} - -// Emit writes an event record to the trace. -// See Event types for valid types and required arguments. -func (w *Writer) Emit(typ byte, args ...uint64) { - nargs := byte(len(args)) - 1 - if nargs > 3 { - nargs = 3 - } - buf := []byte{typ | nargs<<6} - if nargs == 3 { - buf = append(buf, 0) - } - for _, a := range args { - buf = appendVarint(buf, a) - } - if nargs == 3 { - buf[1] = byte(len(buf) - 2) - } - n, err := w.Write(buf) - if n != len(buf) || err != nil { - panic("failed to write") - } -} - -func appendVarint(buf []byte, v uint64) []byte { - for ; v >= 0x80; v >>= 7 { - buf = append(buf, 0x80|byte(v)) - } - buf = append(buf, byte(v)) - return buf -} From 649b89377e91ad6dbe710784f9e662082d31a1ff Mon Sep 17 00:00:00 2001 From: David Heuschmann Date: Tue, 20 Nov 2018 12:30:14 +0100 Subject: [PATCH 112/594] os: return an error from UserHomeDir to match UserCacheDir UserHomeDir used to return an empty string if the corresponding environment variable was not set. Changed it to return an error if the variable is not set, to have the same signature and behaviour as UserCacheDir. Fixes #28562 Change-Id: I42c497e8011ecfbbadebe7de1751575273be221c Reviewed-on: https://go-review.googlesource.com/c/150418 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/crypto/x509/root_darwin.go | 6 +++--- src/os/file.go | 18 ++++++++++-------- src/os/os_test.go | 9 ++++++--- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go index ae69a2faddd84..4a02c075960c3 100644 --- a/src/crypto/x509/root_darwin.go +++ b/src/crypto/x509/root_darwin.go @@ -66,10 +66,10 @@ func execSecurityRoots() (*CertPool, error) { "/Library/Keychains/System.keychain", } - home := os.UserHomeDir() - if home == "" { + home, err := os.UserHomeDir() + if err != nil { if debugExecDarwinRoots { - println("crypto/x509: can't get user home directory") + println("crypto/x509: can't get user home directory: %v", err) } } else { args = append(args, diff --git a/src/os/file.go b/src/os/file.go index d9c5c57c17354..9b7863e9b6b84 100644 --- a/src/os/file.go +++ b/src/os/file.go @@ -386,22 +386,24 @@ func UserCacheDir() (string, error) { // On Unix, including macOS, it returns the $HOME environment variable. // On Windows, it returns %USERPROFILE%. // On Plan 9, it returns the $home environment variable. -func UserHomeDir() string { +func UserHomeDir() (string, error) { + env, enverr := "HOME", "$HOME" switch runtime.GOOS { case "windows": - return Getenv("USERPROFILE") + env, enverr = "USERPROFILE", "%userprofile%" case "plan9": - return Getenv("home") + env, enverr = "home", "$home" case "nacl", "android": - return "/" + return "/", nil case "darwin": if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { - return "/" + return "/", nil } - fallthrough - default: - return Getenv("HOME") } + if v := Getenv(env); v != "" { + return v, nil + } + return "", errors.New(enverr + " is not defined") } // Chmod changes the mode of the named file to mode. diff --git a/src/os/os_test.go b/src/os/os_test.go index d838272215594..9c4d5dada9a10 100644 --- a/src/os/os_test.go +++ b/src/os/os_test.go @@ -2300,9 +2300,12 @@ func TestDoubleCloseError(t *testing.T) { } func TestUserHomeDir(t *testing.T) { - dir := UserHomeDir() - if dir == "" { - t.Fatal("UserHomeDir returned an empty string") + dir, err := UserHomeDir() + if dir == "" && err == nil { + t.Fatal("UserHomeDir returned an empty string but no error") + } + if err != nil { + t.Skipf("UserHomeDir failed: %v", err) } fi, err := Stat(dir) if err != nil { From 63a3993a336714f95400e3e614064d4ae72995de Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Fri, 16 Nov 2018 22:53:04 -0500 Subject: [PATCH 113/594] cmd/compile: use correct store types in softfloat When using softfloat, floating point ops are rewritten to integer ops. The types of store ops were not rewritten. This may lower to floating point stores, which are problematic. This CL fixes this by rewriting the store types as well. This fixes test/fixedbugs/issue28688.go on Wasm. Softfloat mode is not used by default on Wasm, and it is not needed as Wasm spec supports floating points. But it is nice to have the correct types. Change-Id: Ib5e19e19fa9491b15c2f60320f8724cace5cefb5 Reviewed-on: https://go-review.googlesource.com/c/149965 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/softfloat.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/softfloat.go b/src/cmd/compile/internal/ssa/softfloat.go index b41819c6ad50a..4b578b133b567 100644 --- a/src/cmd/compile/internal/ssa/softfloat.go +++ b/src/cmd/compile/internal/ssa/softfloat.go @@ -4,7 +4,10 @@ package ssa -import "math" +import ( + "cmd/compile/internal/types" + "math" +) func softfloat(f *Func) { if !f.Config.SoftFloat { @@ -53,6 +56,15 @@ func softfloat(f *Func) { v.Type = f.Config.Types.UInt64 } newInt64 = newInt64 || v.Type.Size() == 8 + } else if (v.Op == OpStore || v.Op == OpZero || v.Op == OpMove) && v.Aux.(*types.Type).IsFloat() { + switch size := v.Aux.(*types.Type).Size(); size { + case 4: + v.Aux = f.Config.Types.UInt32 + case 8: + v.Aux = f.Config.Types.UInt64 + default: + v.Fatalf("bad float type with size %d", size) + } } } } From c6d493937e7047057a9833661d6d20ce72f904b4 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 13 Nov 2018 18:38:49 -0500 Subject: [PATCH 114/594] cmd/go: more cross-package references from internal/syscall/unix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some platforms, assembly in internal/syscall/unix references unexported runtime symbols. Catch these references so the compiler can generate the necessary ABI wrappers. Fixes #28769. Updates #27539. Change-Id: I118eebfb8b3d907b4c3562198e6afb49854f5827 Reviewed-on: https://go-review.googlesource.com/c/149817 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser Reviewed-by: Clément Chigot Reviewed-by: Keith Randall --- src/cmd/go/internal/work/gc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index a14a970ffbd3c..c0c457cbad3fb 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -295,9 +295,9 @@ func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, erro // Gather known cross-package references from assembly code. var otherPkgs []string if p.ImportPath == "runtime" { - // Assembly in syscall and runtime/cgo references + // Assembly in the following packages references // symbols in runtime. - otherPkgs = []string{"syscall", "runtime/cgo"} + otherPkgs = []string{"syscall", "internal/syscall/unix", "runtime/cgo"} } else if p.ImportPath == "runtime/internal/atomic" { // sync/atomic is an assembly wrapper around // runtime/internal/atomic. From 1ac84999b93876bb06887e483ae45b27e03d7423 Mon Sep 17 00:00:00 2001 From: Yury Smolsky Date: Thu, 25 Oct 2018 13:33:09 +0300 Subject: [PATCH 115/594] cmd/compile: make ssa blocks collapsable in ssa.html This CL adds a button that collapses values list of a block. Button is displayed for every block with non-empty values. Change-Id: I4b65af81e25349f38341df487d42698c9d006a00 Reviewed-on: https://go-review.googlesource.com/c/144557 Run-TryBot: Yury Smolsky TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/html.go | 32 +++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go index 6b8748bdb5a95..1202987acc4a5 100644 --- a/src/cmd/compile/internal/ssa/html.go +++ b/src/cmd/compile/internal/ssa/html.go @@ -176,6 +176,20 @@ ul.ssa-print-func { padding-left: 0; } +li.ssa-start-block button { + padding: 0 1em; + margin: 0; + border: none; + display: inline; + font-size: 14px; + float: right; +} + +button:hover { + background-color: #eee; + cursor: pointer; +} + dl.ssa-gen { padding-left: 0; } @@ -490,6 +504,20 @@ function toggle_visibility(id) { } } +function hideBlock(el) { + var es = el.parentNode.parentNode.getElementsByClassName("ssa-value-list"); + if (es.length===0) + return; + var e = es[0]; + if (e.style.display === 'block' || e.style.display === '') { + e.style.display = 'none'; + el.innerHTML = '+'; + } else { + e.style.display = 'block'; + el.innerHTML = '-'; + } +} + // TODO: scale the graph with the viewBox attribute. function graphReduce(id) { var node = document.getElementById(id); @@ -985,7 +1013,6 @@ type htmlFuncPrinter struct { func (p htmlFuncPrinter) header(f *Func) {} func (p htmlFuncPrinter) startBlock(b *Block, reachable bool) { - // TODO: Make blocks collapsable? var dead string if !reachable { dead = "dead-block" @@ -999,6 +1026,9 @@ func (p htmlFuncPrinter) startBlock(b *Block, reachable bool) { fmt.Fprintf(p.w, " %s", pred.HTML()) } } + if len(b.Values) > 0 { + io.WriteString(p.w, ``) + } io.WriteString(p.w, "") if len(b.Values) > 0 { // start list of values io.WriteString(p.w, "
  • ") From 04105ef1da9e23dc78d0a68b089ea8bdcb120d20 Mon Sep 17 00:00:00 2001 From: David Chase Date: Fri, 16 Nov 2018 16:20:28 -0500 Subject: [PATCH 116/594] cmd/compile: decompose composite OpArg before decomposeUser This makes it easier to track names of function arguments for debugging purposes. Change-Id: Ic34856fe0b910005e1c7bc051d769d489a4b158e Reviewed-on: https://go-review.googlesource.com/c/150098 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/compile.go | 1 + src/cmd/compile/internal/ssa/decompose.go | 4 + .../compile/internal/ssa/gen/decArgs.rules | 58 ++++ .../compile/internal/ssa/gen/decArgsOps.go | 20 ++ .../compile/internal/ssa/gen/generic.rules | 53 ---- .../compile/internal/ssa/rewritedecArgs.go | 288 ++++++++++++++++++ .../compile/internal/ssa/rewritegeneric.go | 255 ---------------- 7 files changed, 371 insertions(+), 308 deletions(-) create mode 100644 src/cmd/compile/internal/ssa/gen/decArgs.rules create mode 100644 src/cmd/compile/internal/ssa/gen/decArgsOps.go create mode 100644 src/cmd/compile/internal/ssa/rewritedecArgs.go diff --git a/src/cmd/compile/internal/ssa/compile.go b/src/cmd/compile/internal/ssa/compile.go index 7f933cb66e0ea..96bc5f03c1c5c 100644 --- a/src/cmd/compile/internal/ssa/compile.go +++ b/src/cmd/compile/internal/ssa/compile.go @@ -365,6 +365,7 @@ var passes = [...]pass{ {name: "early copyelim", fn: copyelim}, {name: "early deadcode", fn: deadcode}, // remove generated dead code to avoid doing pointless work during opt {name: "short circuit", fn: shortcircuit}, + {name: "decompose args", fn: decomposeArgs, required: true}, {name: "decompose user", fn: decomposeUser, required: true}, {name: "opt", fn: opt, required: true}, // TODO: split required rules and optimizing rules {name: "zero arg cse", fn: zcse, required: true}, // required to merge OpSB values diff --git a/src/cmd/compile/internal/ssa/decompose.go b/src/cmd/compile/internal/ssa/decompose.go index 4dc2eabb0cd83..c59ec4c77d764 100644 --- a/src/cmd/compile/internal/ssa/decompose.go +++ b/src/cmd/compile/internal/ssa/decompose.go @@ -214,6 +214,10 @@ func decomposeInterfacePhi(v *Value) { v.AddArg(data) } +func decomposeArgs(f *Func) { + applyRewrite(f, rewriteBlockdecArgs, rewriteValuedecArgs) +} + func decomposeUser(f *Func) { for _, b := range f.Blocks { for _, v := range b.Values { diff --git a/src/cmd/compile/internal/ssa/gen/decArgs.rules b/src/cmd/compile/internal/ssa/gen/decArgs.rules new file mode 100644 index 0000000000000..e9322b0789a39 --- /dev/null +++ b/src/cmd/compile/internal/ssa/gen/decArgs.rules @@ -0,0 +1,58 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Decompose compound argument values +// Do this early to simplify tracking names for debugging. + +(Arg {n} [off]) && v.Type.IsString() -> + (StringMake + (Arg {n} [off]) + (Arg {n} [off+config.PtrSize])) + +(Arg {n} [off]) && v.Type.IsSlice() -> + (SliceMake + (Arg {n} [off]) + (Arg {n} [off+config.PtrSize]) + (Arg {n} [off+2*config.PtrSize])) + +(Arg {n} [off]) && v.Type.IsInterface() -> + (IMake + (Arg {n} [off]) + (Arg {n} [off+config.PtrSize])) + +(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 16 -> + (ComplexMake + (Arg {n} [off]) + (Arg {n} [off+8])) + +(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 8 -> + (ComplexMake + (Arg {n} [off]) + (Arg {n} [off+4])) + +(Arg ) && t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t) -> + (StructMake0) +(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t) -> + (StructMake1 + (Arg {n} [off+t.FieldOff(0)])) +(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t) -> + (StructMake2 + (Arg {n} [off+t.FieldOff(0)]) + (Arg {n} [off+t.FieldOff(1)])) +(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t) -> + (StructMake3 + (Arg {n} [off+t.FieldOff(0)]) + (Arg {n} [off+t.FieldOff(1)]) + (Arg {n} [off+t.FieldOff(2)])) +(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t) -> + (StructMake4 + (Arg {n} [off+t.FieldOff(0)]) + (Arg {n} [off+t.FieldOff(1)]) + (Arg {n} [off+t.FieldOff(2)]) + (Arg {n} [off+t.FieldOff(3)])) + +(Arg ) && t.IsArray() && t.NumElem() == 0 -> + (ArrayMake0) +(Arg {n} [off]) && t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t) -> + (ArrayMake1 (Arg {n} [off])) diff --git a/src/cmd/compile/internal/ssa/gen/decArgsOps.go b/src/cmd/compile/internal/ssa/gen/decArgsOps.go new file mode 100644 index 0000000000000..b73d9d3976102 --- /dev/null +++ b/src/cmd/compile/internal/ssa/gen/decArgsOps.go @@ -0,0 +1,20 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build ignore + +package main + +var decArgsOps = []opData{} + +var decArgsBlocks = []blockData{} + +func init() { + archs = append(archs, arch{ + name: "decArgs", + ops: decArgsOps, + blocks: decArgsBlocks, + generic: true, + }) +} diff --git a/src/cmd/compile/internal/ssa/gen/generic.rules b/src/cmd/compile/internal/ssa/gen/generic.rules index 5a1bee0fa2469..89fbfdc6bd76f 100644 --- a/src/cmd/compile/internal/ssa/gen/generic.rules +++ b/src/cmd/compile/internal/ssa/gen/generic.rules @@ -871,59 +871,6 @@ (Convert (Add(64|32) (Convert ptr mem) off) mem) -> (Add(64|32) ptr off) (Convert (Convert ptr mem) mem) -> ptr -// Decompose compound argument values -(Arg {n} [off]) && v.Type.IsString() -> - (StringMake - (Arg {n} [off]) - (Arg {n} [off+config.PtrSize])) - -(Arg {n} [off]) && v.Type.IsSlice() -> - (SliceMake - (Arg {n} [off]) - (Arg {n} [off+config.PtrSize]) - (Arg {n} [off+2*config.PtrSize])) - -(Arg {n} [off]) && v.Type.IsInterface() -> - (IMake - (Arg {n} [off]) - (Arg {n} [off+config.PtrSize])) - -(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 16 -> - (ComplexMake - (Arg {n} [off]) - (Arg {n} [off+8])) - -(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 8 -> - (ComplexMake - (Arg {n} [off]) - (Arg {n} [off+4])) - -(Arg ) && t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t) -> - (StructMake0) -(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t) -> - (StructMake1 - (Arg {n} [off+t.FieldOff(0)])) -(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t) -> - (StructMake2 - (Arg {n} [off+t.FieldOff(0)]) - (Arg {n} [off+t.FieldOff(1)])) -(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t) -> - (StructMake3 - (Arg {n} [off+t.FieldOff(0)]) - (Arg {n} [off+t.FieldOff(1)]) - (Arg {n} [off+t.FieldOff(2)])) -(Arg {n} [off]) && t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t) -> - (StructMake4 - (Arg {n} [off+t.FieldOff(0)]) - (Arg {n} [off+t.FieldOff(1)]) - (Arg {n} [off+t.FieldOff(2)]) - (Arg {n} [off+t.FieldOff(3)])) - -(Arg ) && t.IsArray() && t.NumElem() == 0 -> - (ArrayMake0) -(Arg {n} [off]) && t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t) -> - (ArrayMake1 (Arg {n} [off])) - // strength reduction of divide by a constant. // See ../magic.go for a detailed description of these algorithms. diff --git a/src/cmd/compile/internal/ssa/rewritedecArgs.go b/src/cmd/compile/internal/ssa/rewritedecArgs.go new file mode 100644 index 0000000000000..6b823252ea9e9 --- /dev/null +++ b/src/cmd/compile/internal/ssa/rewritedecArgs.go @@ -0,0 +1,288 @@ +// Code generated from gen/decArgs.rules; DO NOT EDIT. +// generated with: cd gen; go run *.go + +package ssa + +import "fmt" +import "math" +import "cmd/internal/obj" +import "cmd/internal/objabi" +import "cmd/compile/internal/types" + +var _ = fmt.Println // in case not otherwise used +var _ = math.MinInt8 // in case not otherwise used +var _ = obj.ANOP // in case not otherwise used +var _ = objabi.GOROOT // in case not otherwise used +var _ = types.TypeMem // in case not otherwise used + +func rewriteValuedecArgs(v *Value) bool { + switch v.Op { + case OpArg: + return rewriteValuedecArgs_OpArg_0(v) || rewriteValuedecArgs_OpArg_10(v) + } + return false +} +func rewriteValuedecArgs_OpArg_0(v *Value) bool { + b := v.Block + _ = b + config := b.Func.Config + _ = config + fe := b.Func.fe + _ = fe + typ := &b.Func.Config.Types + _ = typ + // match: (Arg {n} [off]) + // cond: v.Type.IsString() + // result: (StringMake (Arg {n} [off]) (Arg {n} [off+config.PtrSize])) + for { + off := v.AuxInt + n := v.Aux + if !(v.Type.IsString()) { + break + } + v.reset(OpStringMake) + v0 := b.NewValue0(v.Pos, OpArg, typ.BytePtr) + v0.AuxInt = off + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, typ.Int) + v1.AuxInt = off + config.PtrSize + v1.Aux = n + v.AddArg(v1) + return true + } + // match: (Arg {n} [off]) + // cond: v.Type.IsSlice() + // result: (SliceMake (Arg {n} [off]) (Arg {n} [off+config.PtrSize]) (Arg {n} [off+2*config.PtrSize])) + for { + off := v.AuxInt + n := v.Aux + if !(v.Type.IsSlice()) { + break + } + v.reset(OpSliceMake) + v0 := b.NewValue0(v.Pos, OpArg, v.Type.Elem().PtrTo()) + v0.AuxInt = off + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, typ.Int) + v1.AuxInt = off + config.PtrSize + v1.Aux = n + v.AddArg(v1) + v2 := b.NewValue0(v.Pos, OpArg, typ.Int) + v2.AuxInt = off + 2*config.PtrSize + v2.Aux = n + v.AddArg(v2) + return true + } + // match: (Arg {n} [off]) + // cond: v.Type.IsInterface() + // result: (IMake (Arg {n} [off]) (Arg {n} [off+config.PtrSize])) + for { + off := v.AuxInt + n := v.Aux + if !(v.Type.IsInterface()) { + break + } + v.reset(OpIMake) + v0 := b.NewValue0(v.Pos, OpArg, typ.Uintptr) + v0.AuxInt = off + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, typ.BytePtr) + v1.AuxInt = off + config.PtrSize + v1.Aux = n + v.AddArg(v1) + return true + } + // match: (Arg {n} [off]) + // cond: v.Type.IsComplex() && v.Type.Size() == 16 + // result: (ComplexMake (Arg {n} [off]) (Arg {n} [off+8])) + for { + off := v.AuxInt + n := v.Aux + if !(v.Type.IsComplex() && v.Type.Size() == 16) { + break + } + v.reset(OpComplexMake) + v0 := b.NewValue0(v.Pos, OpArg, typ.Float64) + v0.AuxInt = off + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, typ.Float64) + v1.AuxInt = off + 8 + v1.Aux = n + v.AddArg(v1) + return true + } + // match: (Arg {n} [off]) + // cond: v.Type.IsComplex() && v.Type.Size() == 8 + // result: (ComplexMake (Arg {n} [off]) (Arg {n} [off+4])) + for { + off := v.AuxInt + n := v.Aux + if !(v.Type.IsComplex() && v.Type.Size() == 8) { + break + } + v.reset(OpComplexMake) + v0 := b.NewValue0(v.Pos, OpArg, typ.Float32) + v0.AuxInt = off + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, typ.Float32) + v1.AuxInt = off + 4 + v1.Aux = n + v.AddArg(v1) + return true + } + // match: (Arg ) + // cond: t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t) + // result: (StructMake0) + for { + t := v.Type + if !(t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t)) { + break + } + v.reset(OpStructMake0) + return true + } + // match: (Arg {n} [off]) + // cond: t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t) + // result: (StructMake1 (Arg {n} [off+t.FieldOff(0)])) + for { + t := v.Type + off := v.AuxInt + n := v.Aux + if !(t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t)) { + break + } + v.reset(OpStructMake1) + v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) + v0.AuxInt = off + t.FieldOff(0) + v0.Aux = n + v.AddArg(v0) + return true + } + // match: (Arg {n} [off]) + // cond: t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t) + // result: (StructMake2 (Arg {n} [off+t.FieldOff(0)]) (Arg {n} [off+t.FieldOff(1)])) + for { + t := v.Type + off := v.AuxInt + n := v.Aux + if !(t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t)) { + break + } + v.reset(OpStructMake2) + v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) + v0.AuxInt = off + t.FieldOff(0) + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, t.FieldType(1)) + v1.AuxInt = off + t.FieldOff(1) + v1.Aux = n + v.AddArg(v1) + return true + } + // match: (Arg {n} [off]) + // cond: t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t) + // result: (StructMake3 (Arg {n} [off+t.FieldOff(0)]) (Arg {n} [off+t.FieldOff(1)]) (Arg {n} [off+t.FieldOff(2)])) + for { + t := v.Type + off := v.AuxInt + n := v.Aux + if !(t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t)) { + break + } + v.reset(OpStructMake3) + v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) + v0.AuxInt = off + t.FieldOff(0) + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, t.FieldType(1)) + v1.AuxInt = off + t.FieldOff(1) + v1.Aux = n + v.AddArg(v1) + v2 := b.NewValue0(v.Pos, OpArg, t.FieldType(2)) + v2.AuxInt = off + t.FieldOff(2) + v2.Aux = n + v.AddArg(v2) + return true + } + // match: (Arg {n} [off]) + // cond: t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t) + // result: (StructMake4 (Arg {n} [off+t.FieldOff(0)]) (Arg {n} [off+t.FieldOff(1)]) (Arg {n} [off+t.FieldOff(2)]) (Arg {n} [off+t.FieldOff(3)])) + for { + t := v.Type + off := v.AuxInt + n := v.Aux + if !(t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t)) { + break + } + v.reset(OpStructMake4) + v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) + v0.AuxInt = off + t.FieldOff(0) + v0.Aux = n + v.AddArg(v0) + v1 := b.NewValue0(v.Pos, OpArg, t.FieldType(1)) + v1.AuxInt = off + t.FieldOff(1) + v1.Aux = n + v.AddArg(v1) + v2 := b.NewValue0(v.Pos, OpArg, t.FieldType(2)) + v2.AuxInt = off + t.FieldOff(2) + v2.Aux = n + v.AddArg(v2) + v3 := b.NewValue0(v.Pos, OpArg, t.FieldType(3)) + v3.AuxInt = off + t.FieldOff(3) + v3.Aux = n + v.AddArg(v3) + return true + } + return false +} +func rewriteValuedecArgs_OpArg_10(v *Value) bool { + b := v.Block + _ = b + fe := b.Func.fe + _ = fe + // match: (Arg ) + // cond: t.IsArray() && t.NumElem() == 0 + // result: (ArrayMake0) + for { + t := v.Type + if !(t.IsArray() && t.NumElem() == 0) { + break + } + v.reset(OpArrayMake0) + return true + } + // match: (Arg {n} [off]) + // cond: t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t) + // result: (ArrayMake1 (Arg {n} [off])) + for { + t := v.Type + off := v.AuxInt + n := v.Aux + if !(t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t)) { + break + } + v.reset(OpArrayMake1) + v0 := b.NewValue0(v.Pos, OpArg, t.Elem()) + v0.AuxInt = off + v0.Aux = n + v.AddArg(v0) + return true + } + return false +} +func rewriteBlockdecArgs(b *Block) bool { + config := b.Func.Config + _ = config + fe := b.Func.fe + _ = fe + typ := &config.Types + _ = typ + switch b.Kind { + } + return false +} diff --git a/src/cmd/compile/internal/ssa/rewritegeneric.go b/src/cmd/compile/internal/ssa/rewritegeneric.go index f16b571b2a0a4..79f0fd434aee2 100644 --- a/src/cmd/compile/internal/ssa/rewritegeneric.go +++ b/src/cmd/compile/internal/ssa/rewritegeneric.go @@ -39,8 +39,6 @@ func rewriteValuegeneric(v *Value) bool { return rewriteValuegeneric_OpAnd64_0(v) || rewriteValuegeneric_OpAnd64_10(v) || rewriteValuegeneric_OpAnd64_20(v) case OpAnd8: return rewriteValuegeneric_OpAnd8_0(v) || rewriteValuegeneric_OpAnd8_10(v) || rewriteValuegeneric_OpAnd8_20(v) - case OpArg: - return rewriteValuegeneric_OpArg_0(v) || rewriteValuegeneric_OpArg_10(v) case OpArraySelect: return rewriteValuegeneric_OpArraySelect_0(v) case OpCom16: @@ -6817,259 +6815,6 @@ func rewriteValuegeneric_OpAnd8_20(v *Value) bool { } return false } -func rewriteValuegeneric_OpArg_0(v *Value) bool { - b := v.Block - _ = b - config := b.Func.Config - _ = config - fe := b.Func.fe - _ = fe - typ := &b.Func.Config.Types - _ = typ - // match: (Arg {n} [off]) - // cond: v.Type.IsString() - // result: (StringMake (Arg {n} [off]) (Arg {n} [off+config.PtrSize])) - for { - off := v.AuxInt - n := v.Aux - if !(v.Type.IsString()) { - break - } - v.reset(OpStringMake) - v0 := b.NewValue0(v.Pos, OpArg, typ.BytePtr) - v0.AuxInt = off - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, typ.Int) - v1.AuxInt = off + config.PtrSize - v1.Aux = n - v.AddArg(v1) - return true - } - // match: (Arg {n} [off]) - // cond: v.Type.IsSlice() - // result: (SliceMake (Arg {n} [off]) (Arg {n} [off+config.PtrSize]) (Arg {n} [off+2*config.PtrSize])) - for { - off := v.AuxInt - n := v.Aux - if !(v.Type.IsSlice()) { - break - } - v.reset(OpSliceMake) - v0 := b.NewValue0(v.Pos, OpArg, v.Type.Elem().PtrTo()) - v0.AuxInt = off - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, typ.Int) - v1.AuxInt = off + config.PtrSize - v1.Aux = n - v.AddArg(v1) - v2 := b.NewValue0(v.Pos, OpArg, typ.Int) - v2.AuxInt = off + 2*config.PtrSize - v2.Aux = n - v.AddArg(v2) - return true - } - // match: (Arg {n} [off]) - // cond: v.Type.IsInterface() - // result: (IMake (Arg {n} [off]) (Arg {n} [off+config.PtrSize])) - for { - off := v.AuxInt - n := v.Aux - if !(v.Type.IsInterface()) { - break - } - v.reset(OpIMake) - v0 := b.NewValue0(v.Pos, OpArg, typ.Uintptr) - v0.AuxInt = off - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, typ.BytePtr) - v1.AuxInt = off + config.PtrSize - v1.Aux = n - v.AddArg(v1) - return true - } - // match: (Arg {n} [off]) - // cond: v.Type.IsComplex() && v.Type.Size() == 16 - // result: (ComplexMake (Arg {n} [off]) (Arg {n} [off+8])) - for { - off := v.AuxInt - n := v.Aux - if !(v.Type.IsComplex() && v.Type.Size() == 16) { - break - } - v.reset(OpComplexMake) - v0 := b.NewValue0(v.Pos, OpArg, typ.Float64) - v0.AuxInt = off - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, typ.Float64) - v1.AuxInt = off + 8 - v1.Aux = n - v.AddArg(v1) - return true - } - // match: (Arg {n} [off]) - // cond: v.Type.IsComplex() && v.Type.Size() == 8 - // result: (ComplexMake (Arg {n} [off]) (Arg {n} [off+4])) - for { - off := v.AuxInt - n := v.Aux - if !(v.Type.IsComplex() && v.Type.Size() == 8) { - break - } - v.reset(OpComplexMake) - v0 := b.NewValue0(v.Pos, OpArg, typ.Float32) - v0.AuxInt = off - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, typ.Float32) - v1.AuxInt = off + 4 - v1.Aux = n - v.AddArg(v1) - return true - } - // match: (Arg ) - // cond: t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t) - // result: (StructMake0) - for { - t := v.Type - if !(t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t)) { - break - } - v.reset(OpStructMake0) - return true - } - // match: (Arg {n} [off]) - // cond: t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t) - // result: (StructMake1 (Arg {n} [off+t.FieldOff(0)])) - for { - t := v.Type - off := v.AuxInt - n := v.Aux - if !(t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t)) { - break - } - v.reset(OpStructMake1) - v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) - v0.AuxInt = off + t.FieldOff(0) - v0.Aux = n - v.AddArg(v0) - return true - } - // match: (Arg {n} [off]) - // cond: t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t) - // result: (StructMake2 (Arg {n} [off+t.FieldOff(0)]) (Arg {n} [off+t.FieldOff(1)])) - for { - t := v.Type - off := v.AuxInt - n := v.Aux - if !(t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t)) { - break - } - v.reset(OpStructMake2) - v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) - v0.AuxInt = off + t.FieldOff(0) - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, t.FieldType(1)) - v1.AuxInt = off + t.FieldOff(1) - v1.Aux = n - v.AddArg(v1) - return true - } - // match: (Arg {n} [off]) - // cond: t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t) - // result: (StructMake3 (Arg {n} [off+t.FieldOff(0)]) (Arg {n} [off+t.FieldOff(1)]) (Arg {n} [off+t.FieldOff(2)])) - for { - t := v.Type - off := v.AuxInt - n := v.Aux - if !(t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t)) { - break - } - v.reset(OpStructMake3) - v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) - v0.AuxInt = off + t.FieldOff(0) - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, t.FieldType(1)) - v1.AuxInt = off + t.FieldOff(1) - v1.Aux = n - v.AddArg(v1) - v2 := b.NewValue0(v.Pos, OpArg, t.FieldType(2)) - v2.AuxInt = off + t.FieldOff(2) - v2.Aux = n - v.AddArg(v2) - return true - } - // match: (Arg {n} [off]) - // cond: t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t) - // result: (StructMake4 (Arg {n} [off+t.FieldOff(0)]) (Arg {n} [off+t.FieldOff(1)]) (Arg {n} [off+t.FieldOff(2)]) (Arg {n} [off+t.FieldOff(3)])) - for { - t := v.Type - off := v.AuxInt - n := v.Aux - if !(t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t)) { - break - } - v.reset(OpStructMake4) - v0 := b.NewValue0(v.Pos, OpArg, t.FieldType(0)) - v0.AuxInt = off + t.FieldOff(0) - v0.Aux = n - v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpArg, t.FieldType(1)) - v1.AuxInt = off + t.FieldOff(1) - v1.Aux = n - v.AddArg(v1) - v2 := b.NewValue0(v.Pos, OpArg, t.FieldType(2)) - v2.AuxInt = off + t.FieldOff(2) - v2.Aux = n - v.AddArg(v2) - v3 := b.NewValue0(v.Pos, OpArg, t.FieldType(3)) - v3.AuxInt = off + t.FieldOff(3) - v3.Aux = n - v.AddArg(v3) - return true - } - return false -} -func rewriteValuegeneric_OpArg_10(v *Value) bool { - b := v.Block - _ = b - fe := b.Func.fe - _ = fe - // match: (Arg ) - // cond: t.IsArray() && t.NumElem() == 0 - // result: (ArrayMake0) - for { - t := v.Type - if !(t.IsArray() && t.NumElem() == 0) { - break - } - v.reset(OpArrayMake0) - return true - } - // match: (Arg {n} [off]) - // cond: t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t) - // result: (ArrayMake1 (Arg {n} [off])) - for { - t := v.Type - off := v.AuxInt - n := v.Aux - if !(t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t)) { - break - } - v.reset(OpArrayMake1) - v0 := b.NewValue0(v.Pos, OpArg, t.Elem()) - v0.AuxInt = off - v0.Aux = n - v.AddArg(v0) - return true - } - return false -} func rewriteValuegeneric_OpArraySelect_0(v *Value) bool { // match: (ArraySelect (ArrayMake1 x)) // cond: From 048c9164a0c5572df18325e377473e7893dbfb07 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 24 Nov 2018 16:54:01 +1100 Subject: [PATCH 117/594] debug/pe: use kernel32.dll in TestImportTableInUnknownSection TestImportTableInUnknownSection was introduced in CL 110555 to test PE executable with import table located in section other than ".idata". We used atmfd.dll for that purpose, but it seems atmfd.dll is not present on some systems. Use kernel32.dll instead. kernel32.dll import table is located in ".rdata" section, so it should do the job. And every Windows system has kernel32.dll file. Also make TestImportTableInUnknownSection run on windows-arm, since windows-arm should also have kernel32.dll file. Updates #27904 Change-Id: Ie005ee10e46ae0c06e83929d581e89f86c051eea Reviewed-on: https://go-review.googlesource.com/c/151137 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/debug/pe/file_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/debug/pe/file_test.go b/src/debug/pe/file_test.go index 4f0510200fecb..79c2241eb7dd2 100644 --- a/src/debug/pe/file_test.go +++ b/src/debug/pe/file_test.go @@ -602,13 +602,10 @@ func TestImportTableInUnknownSection(t *testing.T) { if runtime.GOOS != "windows" { t.Skip("skipping Windows-only test") } - if runtime.GOARCH == "arm" { - // Issue 27904 - t.Skip("skipping test on arm; no atmfd.dll available") - } - // first we need to find this font driver - path, err := exec.LookPath("atmfd.dll") + // kernel32.dll import table is located in ".rdata" section, + // so it is good enough to test issue #16103. + path, err := exec.LookPath("kernel32.dll") if err != nil { t.Fatalf("unable to locate required file %q in search path: %s", "atmfd.dll", err) } From cf2054088099ca90535f2baf6af02bb495a7439c Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 26 Nov 2018 14:51:08 +1100 Subject: [PATCH 118/594] doc: improve the interface example in Effective Go The String method is n-squared and overwrites its receiver. Fix both issues, with only a slight loss of clarity. Fixes #28773 Change-Id: I588f69d4cbd72931b28b984671512834473bd466 Reviewed-on: https://go-review.googlesource.com/c/151217 Reviewed-by: Brad Fitzpatrick --- doc/effective_go.html | 7 +++++-- doc/progs/eff_sequence.go | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/effective_go.html b/doc/effective_go.html index 1743d0fa11282..ddfea76d433ef 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -2106,12 +2106,14 @@

    Conversions

    The String method of Sequence is recreating the -work that Sprint already does for slices. We can share the -effort if we convert the Sequence to a plain +work that Sprint already does for slices. +(It also has complexity O(N²), which is poor.) We can share the +effort (and also speed it up) if we convert the Sequence to a plain []int before calling Sprint.

     func (s Sequence) String() string {
    +    s = s.Copy()
         sort.Sort(s)
         return fmt.Sprint([]int(s))
     }
    @@ -2138,6 +2140,7 @@ 

    Conversions

    // Method for printing - sorts the elements before printing func (s Sequence) String() string { + s = s.Copy() sort.IntSlice(s).Sort() return fmt.Sprint([]int(s)) } diff --git a/doc/progs/eff_sequence.go b/doc/progs/eff_sequence.go index 11c885abf82a3..ab1826b6ee3b9 100644 --- a/doc/progs/eff_sequence.go +++ b/doc/progs/eff_sequence.go @@ -28,11 +28,18 @@ func (s Sequence) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +// Copy returns a copy of the Sequence. +func (s Sequence) Copy() Sequence { + copy := make(Sequence, 0, len(s)) + return append(copy, s...) +} + // Method for printing - sorts the elements before printing. func (s Sequence) String() string { + s = s.Copy() // Make a copy; don't overwrite argument. sort.Sort(s) str := "[" - for i, elem := range s { + for i, elem := range s { // Loop is O(N²); will fix that in next example. if i > 0 { str += " " } From bb3b24bffc4f50c64504c1c5f899aad0281a449a Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Mon, 26 Nov 2018 15:58:56 +1100 Subject: [PATCH 119/594] fmt: update formatting example for maps Now that maps are printed in deterministic order, the map example can have multiple keys without breaking the build. Change-Id: Iccec0cd76a3d41c75d8d4eb768ec0ac09ad9f2ad Reviewed-on: https://go-review.googlesource.com/c/151218 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick --- src/fmt/example_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/fmt/example_test.go b/src/fmt/example_test.go index c2851759769b1..56ce47f83639a 100644 --- a/src/fmt/example_test.go +++ b/src/fmt/example_test.go @@ -290,15 +290,14 @@ func Example_formats() { // Maps formatted with %v show keys and values in their default formats. // The %#v form (the # is called a "flag" in this context) shows the map in - // the Go source format. + // the Go source format. Maps are printed in a consistent order, sorted + // by the values of the keys. isLegume := map[string]bool{ - "peanut": true, - // TODO: Include this line when maps are printed in deterministic order. - // See Issue #21095 - // "dachshund": false, + "peanut": true, + "dachshund": false, } fmt.Printf("%v %#v\n", isLegume, isLegume) - // Result: map[peanut:true] map[string]bool{"peanut":true} + // Result: map[dachshund:false peanut:true] map[string]bool{"dachshund":false, "peanut":true} // Structs formatted with %v show field values in their default formats. // The %+v form shows the fields by name, while %#v formats the struct in @@ -356,7 +355,7 @@ func Example_formats() { // (110.7+22.5i) (110.7+22.5i) (110.70+22.50i) (1.11e+02+2.25e+01i) // 128512 128512 😀 '😀' U+1F600 U+1F600 '😀' // foo "bar" foo "bar" "foo \"bar\"" `foo "bar"` - // map[peanut:true] map[string]bool{"peanut":true} + // map[dachshund:false peanut:true] map[string]bool{"dachshund":false, "peanut":true} // {Kim 22} {Name:Kim Age:22} struct { Name string; Age int }{Name:"Kim", Age:22} // &{Kim 22} 0x0 // [Katano Kobayashi Kurosawa Miyazaki Ozu] ["Katano" "Kobayashi" "Kurosawa" "Miyazaki" "Ozu"] From 041526c6ef669743afc6c4b757b95011f1475d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Mon, 1 Oct 2018 09:58:40 +0200 Subject: [PATCH 120/594] runtime: handle 64bits addresses for AIX This commit allows the runtime to handle 64bits addresses returned by mmap syscall on AIX. Mmap syscall returns addresses on 59bits on AIX. But the Arena implementation only allows addresses with less than 48 bits. This commit increases the arena size up to 1<<60 for aix/ppc64. Update: #25893 Change-Id: Iea72e8a944d10d4f00be915785e33ae82dd6329e Reviewed-on: https://go-review.googlesource.com/c/138736 Reviewed-by: Austin Clements --- src/cmd/compile/internal/ppc64/galign.go | 2 +- src/runtime/lfstack_64bit.go | 14 ++++++++++ src/runtime/malloc.go | 34 +++++++++++++++++------- test/chancap.go | 4 ++- test/fixedbugs/bug273.go | 2 +- test/fixedbugs/issue4085b.go | 4 ++- 6 files changed, 47 insertions(+), 13 deletions(-) diff --git a/src/cmd/compile/internal/ppc64/galign.go b/src/cmd/compile/internal/ppc64/galign.go index ce805f4e0cf83..da971d864dbe7 100644 --- a/src/cmd/compile/internal/ppc64/galign.go +++ b/src/cmd/compile/internal/ppc64/galign.go @@ -16,7 +16,7 @@ func Init(arch *gc.Arch) { arch.LinkArch = &ppc64.Linkppc64le } arch.REGSP = ppc64.REGSP - arch.MAXWIDTH = 1 << 50 + arch.MAXWIDTH = 1 << 60 arch.ZeroRange = zerorange arch.ZeroAuto = zeroAuto diff --git a/src/runtime/lfstack_64bit.go b/src/runtime/lfstack_64bit.go index 4ce7d2a098827..ea3455a8c4c93 100644 --- a/src/runtime/lfstack_64bit.go +++ b/src/runtime/lfstack_64bit.go @@ -28,9 +28,20 @@ const ( // bottom, because node must be pointer-aligned, giving a total of 19 bits // of count. cntBits = 64 - addrBits + 3 + + // On AIX, 64-bit addresses are split into 36-bit segment number and 28-bit + // offset in segment. Segment numbers in the range 0x0A0000000-0x0AFFFFFFF(LSA) + // are available for mmap. + // We assume all lfnode addresses are from memory allocated with mmap. + // We use one bit to distinguish between the two ranges. + aixAddrBits = 57 + aixCntBits = 64 - aixAddrBits + 3 ) func lfstackPack(node *lfnode, cnt uintptr) uint64 { + if GOARCH == "ppc64" && GOOS == "aix" { + return uint64(uintptr(unsafe.Pointer(node)))<<(64-aixAddrBits) | uint64(cnt&(1<> cntBits << 3))) } + if GOARCH == "ppc64" && GOOS == "aix" { + return (*lfnode)(unsafe.Pointer(uintptr((val >> aixCntBits << 3) | 0xa<<56))) + } return (*lfnode)(unsafe.Pointer(uintptr(val >> cntBits << 3))) } diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index e827dbae93d5b..678e68931150b 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -160,7 +160,7 @@ const ( // amd64, addresses are sign-extended beyond heapAddrBits. On // other arches, they are zero-extended. // - // On 64-bit platforms, we limit this to 48 bits based on a + // On most 64-bit platforms, we limit this to 48 bits based on a // combination of hardware and OS limitations. // // amd64 hardware limits addresses to 48 bits, sign-extended @@ -178,10 +178,9 @@ const ( // bits, in the range [0, 1<<48). // // ppc64, mips64, and s390x support arbitrary 64 bit addresses - // in hardware. However, since Go only supports Linux on - // these, we lean on OS limits. Based on Linux's processor.h, - // the user address space is limited as follows on 64-bit - // architectures: + // in hardware. On Linux, Go leans on stricter OS limits. Based + // on Linux's processor.h, the user address space is limited as + // follows on 64-bit architectures: // // Architecture Name Maximum Value (exclusive) // --------------------------------------------------------------------- @@ -198,13 +197,17 @@ const ( // exceed Go's 48 bit limit, it's extremely unlikely in // practice. // + // On aix/ppc64, the limits is increased to 1<<60 to accept addresses + // returned by mmap syscall. These are in range: + // 0x0a00000000000000 - 0x0afffffffffffff + // // On 32-bit platforms, we accept the full 32-bit address // space because doing so is cheap. // mips32 only has access to the low 2GB of virtual memory, so // we further limit it to 31 bits. // // WebAssembly currently has a limit of 4GB linear memory. - heapAddrBits = (_64bit*(1-sys.GoarchWasm))*48 + (1-_64bit+sys.GoarchWasm)*(32-(sys.GoarchMips+sys.GoarchMipsle)) + heapAddrBits = (_64bit*(1-sys.GoarchWasm)*(1-sys.GoosAix))*48 + (1-_64bit+sys.GoarchWasm)*(32-(sys.GoarchMips+sys.GoarchMipsle)) + 60*sys.GoosAix // maxAlloc is the maximum size of an allocation. On 64-bit, // it's theoretically possible to allocate 1<= 0; i-- { var p uintptr switch { @@ -425,6 +434,13 @@ func mallocinit() { p = uintptr(i)<<40 | uintptrMask&(0x0013<<28) case GOARCH == "arm64": p = uintptr(i)<<40 | uintptrMask&(0x0040<<32) + case GOOS == "aix": + if i == 0 { + // We don't use addresses directly after 0x0A00000000000000 + // to avoid collisions with others mmaps done by non-go programs. + continue + } + p = uintptr(i)<<40 | uintptrMask&(0xa0<<52) case raceenabled: // The TSAN runtime requires the heap // to be in the range [0x00c000000000, @@ -458,7 +474,7 @@ func mallocinit() { // 3. We try to stake out a reasonably large initial // heap reservation. - const arenaMetaSize = unsafe.Sizeof([1 << arenaBits]heapArena{}) + const arenaMetaSize = (1 << arenaBits) * unsafe.Sizeof(heapArena{}) meta := uintptr(sysReserve(nil, arenaMetaSize)) if meta != 0 { mheap_.heapArenaAlloc.init(meta, arenaMetaSize) diff --git a/test/chancap.go b/test/chancap.go index 9675e38bdb1a7..8dce9247cd45e 100644 --- a/test/chancap.go +++ b/test/chancap.go @@ -42,8 +42,10 @@ func main() { shouldPanic("makechan: size out of range", func() { _ = make(T, n) }) shouldPanic("makechan: size out of range", func() { _ = make(T, int64(n)) }) if ptrSize == 8 { - var n2 int64 = 1 << 50 + // Test mem > maxAlloc + var n2 int64 = 1 << 59 shouldPanic("makechan: size out of range", func() { _ = make(T, int(n2)) }) + // Test elem.size*cap overflow n2 = 1<<63 - 1 shouldPanic("makechan: size out of range", func() { _ = make(T, int(n2)) }) } else { diff --git a/test/fixedbugs/bug273.go b/test/fixedbugs/bug273.go index 7305c6063ccdc..2af8800171ed4 100644 --- a/test/fixedbugs/bug273.go +++ b/test/fixedbugs/bug273.go @@ -14,7 +14,7 @@ var bug = false var minus1 = -1 var five = 5 -var big int64 = 10 | 1<<40 +var big int64 = 10 | 1<<46 type block [1 << 19]byte diff --git a/test/fixedbugs/issue4085b.go b/test/fixedbugs/issue4085b.go index 6bf315fcc2f06..6304ce073aa9e 100644 --- a/test/fixedbugs/issue4085b.go +++ b/test/fixedbugs/issue4085b.go @@ -21,9 +21,11 @@ func main() { shouldPanic("cap out of range", func() { _ = make(T, 0, int64(n)) }) var t *byte if unsafe.Sizeof(t) == 8 { - var n2 int64 = 1 << 50 + // Test mem > maxAlloc + var n2 int64 = 1 << 59 shouldPanic("len out of range", func() { _ = make(T, int(n2)) }) shouldPanic("cap out of range", func() { _ = make(T, 0, int(n2)) }) + // Test elem.size*cap overflow n2 = 1<<63 - 1 shouldPanic("len out of range", func() { _ = make(T, int(n2)) }) shouldPanic("cap out of range", func() { _ = make(T, 0, int(n2)) }) From 9fe9853ae5641eda4cfa58015bd0bcedb99c12cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Tue, 16 Oct 2018 15:59:43 +0200 Subject: [PATCH 121/594] cmd/compile: fix nilcheck for AIX This commit adapts compile tool to create correct nilchecks for AIX. AIX allows to load a nil pointer. Therefore, the default nilcheck which issues a load must be replaced by a CMP instruction followed by a store at 0x0 if the value is nil. The store will trigger a SIGSEGV as on others OS. The nilcheck algorithm must be adapted to do not remove nilcheck if it's only a read. Stores are detected with v.Type.IsMemory(). Tests related to nilptr must be adapted to the previous changements. nilptr.go cannot be used as it's because the AIX address space starts at 1<<32. Change-Id: I9f5aaf0b7e185d736a9b119c0ed2fe4e5bd1e7af Reviewed-on: https://go-review.googlesource.com/c/144538 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/ssa.go | 3 +- src/cmd/compile/internal/ppc64/ssa.go | 46 +++- src/cmd/compile/internal/ssa/nilcheck.go | 12 +- test/nilptr.go | 3 + test/nilptr3.go | 21 +- test/nilptr3_wasm.go | 270 ----------------------- test/nilptr5.go | 33 +++ test/nilptr5_aix.go | 32 +++ test/nilptr5_wasm.go | 32 +++ test/nilptr_aix.go | 185 ++++++++++++++++ 10 files changed, 337 insertions(+), 300 deletions(-) delete mode 100644 test/nilptr3_wasm.go create mode 100644 test/nilptr5.go create mode 100644 test/nilptr5_aix.go create mode 100644 test/nilptr5_wasm.go create mode 100644 test/nilptr_aix.go diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 27af607d6f0e5..e0b4b40323215 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -3651,7 +3651,8 @@ func (s *state) call(n *Node, k callKind) *ssa.Value { break } closure = s.expr(fn) - if thearch.LinkArch.Family == sys.Wasm { + if thearch.LinkArch.Family == sys.Wasm || objabi.GOOS == "aix" && k != callGo { + // On AIX, the closure needs to be verified as fn can be nil, except if it's a call go. This needs to be handled by the runtime to have the "go of nil func value" error. // TODO(neelance): On other architectures this should be eliminated by the optimization steps s.nilCheck(closure) } diff --git a/src/cmd/compile/internal/ppc64/ssa.go b/src/cmd/compile/internal/ppc64/ssa.go index a6dd8cab5f502..3b37c797a99d5 100644 --- a/src/cmd/compile/internal/ppc64/ssa.go +++ b/src/cmd/compile/internal/ppc64/ssa.go @@ -10,6 +10,7 @@ import ( "cmd/compile/internal/types" "cmd/internal/obj" "cmd/internal/obj/ppc64" + "cmd/internal/objabi" "math" "strings" ) @@ -1183,13 +1184,44 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) { p.To.Sym = v.Aux.(*obj.LSym) case ssa.OpPPC64LoweredNilCheck: - // Issue a load which will fault if arg is nil. - p := s.Prog(ppc64.AMOVBZ) - p.From.Type = obj.TYPE_MEM - p.From.Reg = v.Args[0].Reg() - gc.AddAux(&p.From, v) - p.To.Type = obj.TYPE_REG - p.To.Reg = ppc64.REGTMP + if objabi.GOOS == "aix" { + // CMP Rarg0, R0 + // BNE 2(PC) + // STW R0, 0(R0) + // NOP (so the BNE has somewhere to land) + + // CMP Rarg0, R0 + p := s.Prog(ppc64.ACMP) + p.From.Type = obj.TYPE_REG + p.From.Reg = v.Args[0].Reg() + p.To.Type = obj.TYPE_REG + p.To.Reg = ppc64.REG_R0 + + // BNE 2(PC) + p2 := s.Prog(ppc64.ABNE) + p2.To.Type = obj.TYPE_BRANCH + + // STW R0, 0(R0) + // Write at 0 is forbidden and will trigger a SIGSEGV + p = s.Prog(ppc64.AMOVW) + p.From.Type = obj.TYPE_REG + p.From.Reg = ppc64.REG_R0 + p.To.Type = obj.TYPE_MEM + p.To.Reg = ppc64.REG_R0 + + // NOP (so the BNE has somewhere to land) + nop := s.Prog(obj.ANOP) + gc.Patch(p2, nop) + + } else { + // Issue a load which will fault if arg is nil. + p := s.Prog(ppc64.AMOVBZ) + p.From.Type = obj.TYPE_MEM + p.From.Reg = v.Args[0].Reg() + gc.AddAux(&p.From, v) + p.To.Type = obj.TYPE_REG + p.To.Reg = ppc64.REGTMP + } if gc.Debug_checknil != 0 && v.Pos.Line() > 1 { // v.Pos.Line()==1 in generated wrappers gc.Warnl(v.Pos, "generated nil check") } diff --git a/src/cmd/compile/internal/ssa/nilcheck.go b/src/cmd/compile/internal/ssa/nilcheck.go index fca4f0bfc4076..e0669cf80c845 100644 --- a/src/cmd/compile/internal/ssa/nilcheck.go +++ b/src/cmd/compile/internal/ssa/nilcheck.go @@ -5,6 +5,7 @@ package ssa import ( + "cmd/internal/objabi" "cmd/internal/src" ) @@ -183,6 +184,9 @@ func nilcheckelim(f *Func) { // This should agree with minLegalPointer in the runtime. const minZeroPage = 4096 +// faultOnLoad is true if a load to an address below minZeroPage will trigger a SIGSEGV. +var faultOnLoad = objabi.GOOS != "aix" + // nilcheckelim2 eliminates unnecessary nil checks. // Runs after lowering and scheduling. func nilcheckelim2(f *Func) { @@ -225,12 +229,16 @@ func nilcheckelim2(f *Func) { // Find any pointers that this op is guaranteed to fault on if nil. var ptrstore [2]*Value ptrs := ptrstore[:0] - if opcodeTable[v.Op].faultOnNilArg0 { + if opcodeTable[v.Op].faultOnNilArg0 && (faultOnLoad || v.Type.IsMemory()) { + // On AIX, only writing will fault. ptrs = append(ptrs, v.Args[0]) } - if opcodeTable[v.Op].faultOnNilArg1 { + if opcodeTable[v.Op].faultOnNilArg1 && (faultOnLoad || (v.Type.IsMemory() && v.Op != OpPPC64LoweredMove)) { + // On AIX, only writing will fault. + // LoweredMove is a special case because it's considered as a "mem" as it stores on arg0 but arg1 is accessed as a load and should be checked. ptrs = append(ptrs, v.Args[1]) } + for _, ptr := range ptrs { // Check to make sure the offset is small. switch opcodeTable[v.Op].auxType { diff --git a/test/nilptr.go b/test/nilptr.go index 8d674a7098212..90f57c54b6c9c 100644 --- a/test/nilptr.go +++ b/test/nilptr.go @@ -7,6 +7,9 @@ // Test that the implementation catches nil ptr indirection // in a large address space. +// +build !aix +// Address space starts at 1<<32 on AIX, so dummy is too far. + package main import "unsafe" diff --git a/test/nilptr3.go b/test/nilptr3.go index 6aa718e027cda..e0f2ed9767659 100644 --- a/test/nilptr3.go +++ b/test/nilptr3.go @@ -1,6 +1,7 @@ // errorcheck -0 -d=nil // +build !wasm +// +build !aix // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style @@ -192,21 +193,6 @@ func f4(x *[10]int) { _ = &x[9] // ERROR "removed[a-z ]* nil check" } -func f5(p *float32, q *float64, r *float32, s *float64) float64 { - x := float64(*p) // ERROR "removed nil check" - y := *q // ERROR "removed nil check" - *r = 7 // ERROR "removed nil check" - *s = 9 // ERROR "removed nil check" - return x + y -} - -type T [29]byte - -func f6(p, q *T) { - x := *p // ERROR "removed nil check" - *q = x // ERROR "removed nil check" -} - func m1(m map[int][80]byte) byte { v := m[3] // ERROR "removed nil check" return v[5] @@ -257,11 +243,6 @@ func f7() (*Struct, float64) { return t, *p // ERROR "removed nil check" } -// make sure to remove nil check for memory move (issue #18003) -func f8(t *[8]int) [8]int { - return *t // ERROR "removed nil check" -} - func f9() []int { x := new([1]int) x[0] = 1 // ERROR "removed nil check" diff --git a/test/nilptr3_wasm.go b/test/nilptr3_wasm.go deleted file mode 100644 index df29cdc5dc5a6..0000000000000 --- a/test/nilptr3_wasm.go +++ /dev/null @@ -1,270 +0,0 @@ -// errorcheck -0 -d=nil - -// +build wasm - -// Copyright 2013 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. - -// Test that nil checks are removed. -// Optimization is enabled. - -package p - -type Struct struct { - X int - Y float64 -} - -type BigStruct struct { - X int - Y float64 - A [1 << 20]int - Z string -} - -type Empty struct { -} - -type Empty1 struct { - Empty -} - -var ( - intp *int - arrayp *[10]int - array0p *[0]int - bigarrayp *[1 << 26]int - structp *Struct - bigstructp *BigStruct - emptyp *Empty - empty1p *Empty1 -) - -func f1() { - _ = *intp // ERROR "generated nil check" - - // This one should be removed but the block copy needs - // to be turned into its own pseudo-op in order to see - // the indirect. - _ = *arrayp // ERROR "generated nil check" - - // 0-byte indirect doesn't suffice. - // we don't registerize globals, so there are no removed.* nil checks. - _ = *array0p // ERROR "generated nil check" - _ = *array0p // ERROR "removed nil check" - - _ = *intp // ERROR "removed nil check" - _ = *arrayp // ERROR "removed nil check" - _ = *structp // ERROR "generated nil check" - _ = *emptyp // ERROR "generated nil check" - _ = *arrayp // ERROR "removed nil check" -} - -func f2() { - var ( - intp *int - arrayp *[10]int - array0p *[0]int - bigarrayp *[1 << 20]int - structp *Struct - bigstructp *BigStruct - emptyp *Empty - empty1p *Empty1 - ) - - _ = *intp // ERROR "generated nil check" - _ = *arrayp // ERROR "generated nil check" - _ = *array0p // ERROR "generated nil check" - _ = *array0p // ERROR "removed.* nil check" - _ = *intp // ERROR "removed.* nil check" - _ = *arrayp // ERROR "removed.* nil check" - _ = *structp // ERROR "generated nil check" - _ = *emptyp // ERROR "generated nil check" - _ = *arrayp // ERROR "removed.* nil check" - _ = *bigarrayp // ERROR "generated nil check" ARM removed nil check before indirect!! - _ = *bigstructp // ERROR "generated nil check" - _ = *empty1p // ERROR "generated nil check" -} - -func fx10k() *[10000]int - -var b bool - -func f3(x *[10000]int) { - // Using a huge type and huge offsets so the compiler - // does not expect the memory hardware to fault. - _ = x[9999] // ERROR "generated nil check" - - for { - if x[9999] != 0 { // ERROR "removed nil check" - break - } - } - - x = fx10k() - _ = x[9999] // ERROR "generated nil check" - if b { - _ = x[9999] // ERROR "removed.* nil check" - } else { - _ = x[9999] // ERROR "removed.* nil check" - } - _ = x[9999] // ERROR "removed nil check" - - x = fx10k() - if b { - _ = x[9999] // ERROR "generated nil check" - } else { - _ = x[9999] // ERROR "generated nil check" - } - _ = x[9999] // ERROR "generated nil check" - - fx10k() - // This one is a bit redundant, if we figured out that - // x wasn't going to change across the function call. - // But it's a little complex to do and in practice doesn't - // matter enough. - _ = x[9999] // ERROR "removed nil check" -} - -func f3a() { - x := fx10k() - y := fx10k() - z := fx10k() - _ = &x[9] // ERROR "generated nil check" - y = z - _ = &x[9] // ERROR "removed.* nil check" - x = y - _ = &x[9] // ERROR "generated nil check" -} - -func f3b() { - x := fx10k() - y := fx10k() - _ = &x[9] // ERROR "generated nil check" - y = x - _ = &x[9] // ERROR "removed.* nil check" - x = y - _ = &x[9] // ERROR "removed.* nil check" -} - -func fx10() *[10]int - -func f4(x *[10]int) { - // Most of these have no checks because a real memory reference follows, - // and the offset is small enough that if x is nil, the address will still be - // in the first unmapped page of memory. - - _ = x[9] // ERROR "generated nil check" // bug: would like to remove this check (but nilcheck and load are in different blocks) - - for { - if x[9] != 0 { // ERROR "removed nil check" - break - } - } - - x = fx10() - _ = x[9] // ERROR "generated nil check" // bug would like to remove before indirect - if b { - _ = x[9] // ERROR "removed nil check" - } else { - _ = x[9] // ERROR "removed nil check" - } - _ = x[9] // ERROR "removed nil check" - - x = fx10() - if b { - _ = x[9] // ERROR "generated nil check" // bug would like to remove before indirect - } else { - _ = &x[9] // ERROR "generated nil check" - } - _ = x[9] // ERROR "generated nil check" // bug would like to remove before indirect - - fx10() - _ = x[9] // ERROR "removed nil check" - - x = fx10() - y := fx10() - _ = &x[9] // ERROR "generated nil check" - y = x - _ = &x[9] // ERROR "removed[a-z ]* nil check" - x = y - _ = &x[9] // ERROR "removed[a-z ]* nil check" -} - -func f5(p *float32, q *float64, r *float32, s *float64) float64 { - x := float64(*p) // ERROR "generated nil check" - y := *q // ERROR "generated nil check" - *r = 7 // ERROR "generated nil check" - *s = 9 // ERROR "generated nil check" - return x + y -} - -type T [29]byte - -func f6(p, q *T) { - x := *p // ERROR "generated nil check" - *q = x // ERROR "generated nil check" -} - -func m1(m map[int][80]byte) byte { - v := m[3] // ERROR "removed nil check" - return v[5] -} -func m2(m map[int][800]byte) byte { - v := m[3] // ERROR "removed nil check" - return v[5] -} -func m3(m map[int][80]byte) (byte, bool) { - v, ok := m[3] // ERROR "removed nil check" - return v[5], ok -} -func m4(m map[int][800]byte) (byte, bool) { - v, ok := m[3] // ERROR "removed nil check" - return v[5], ok -} -func p1() byte { - p := new([100]byte) - return p[5] // ERROR "removed nil check" -} - -// make sure not to do nil check for access of PAUTOHEAP -//go:noinline -func (p *Struct) m() {} -func c1() { - var x Struct - func() { x.m() }() // ERROR "removed nil check" -} - -type SS struct { - x byte -} - -type TT struct { - SS -} - -func f(t *TT) *byte { - // See issue 17242. - s := &t.SS // ERROR "generated nil check" - return &s.x // ERROR "removed nil check" -} - -// make sure not to do nil check for newobject -func f7() (*Struct, float64) { - t := new(Struct) - p := &t.Y // ERROR "removed nil check" - return t, *p // ERROR "removed nil check" -} - -// make sure to remove nil check for memory move (issue #18003) -func f8(t *[8]int) [8]int { - return *t // ERROR "generated nil check" -} - -func f9() []int { - x := new([1]int) - x[0] = 1 // ERROR "removed nil check" - y := x[:] // ERROR "removed nil check" - return y -} diff --git a/test/nilptr5.go b/test/nilptr5.go new file mode 100644 index 0000000000000..2c48c0b261019 --- /dev/null +++ b/test/nilptr5.go @@ -0,0 +1,33 @@ +// errorcheck -0 -d=nil + +// +build !wasm +// +build !aix + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that nil checks are removed. +// Optimization is enabled. + +package p + +func f5(p *float32, q *float64, r *float32, s *float64) float64 { + x := float64(*p) // ERROR "removed nil check" + y := *q // ERROR "removed nil check" + *r = 7 // ERROR "removed nil check" + *s = 9 // ERROR "removed nil check" + return x + y +} + +type T [29]byte + +func f6(p, q *T) { + x := *p // ERROR "removed nil check" + *q = x // ERROR "removed nil check" +} + +// make sure to remove nil check for memory move (issue #18003) +func f8(t *[8]int) [8]int { + return *t // ERROR "removed nil check" +} diff --git a/test/nilptr5_aix.go b/test/nilptr5_aix.go new file mode 100644 index 0000000000000..ff6900593b8a3 --- /dev/null +++ b/test/nilptr5_aix.go @@ -0,0 +1,32 @@ +// errorcheck -0 -d=nil + +// +build aix + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that nil checks are removed. +// Optimization is enabled. + +package p + +func f5(p *float32, q *float64, r *float32, s *float64) float64 { + x := float64(*p) // ERROR "generated nil check" + y := *q // ERROR "generated nil check" + *r = 7 // ERROR "removed nil check" + *s = 9 // ERROR "removed nil check" + return x + y +} + +type T [29]byte + +func f6(p, q *T) { + x := *p // ERROR "generated nil check" + *q = x // ERROR "generated nil check" +} + +// make sure to remove nil check for memory move (issue #18003) +func f8(t *[8]int) [8]int { + return *t // ERROR "generated nil check" +} diff --git a/test/nilptr5_wasm.go b/test/nilptr5_wasm.go new file mode 100644 index 0000000000000..6ef8a02e90820 --- /dev/null +++ b/test/nilptr5_wasm.go @@ -0,0 +1,32 @@ +// errorcheck -0 -d=nil + +// +build wasm + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that nil checks are removed. +// Optimization is enabled. + +package p + +func f5(p *float32, q *float64, r *float32, s *float64) float64 { + x := float64(*p) // ERROR "generated nil check" + y := *q // ERROR "generated nil check" + *r = 7 // ERROR "generated nil check" + *s = 9 // ERROR "generated nil check" + return x + y +} + +type T [29]byte + +func f6(p, q *T) { + x := *p // ERROR "generated nil check" + *q = x // ERROR "generated nil check" +} + +// make sure to remove nil check for memory move (issue #18003) +func f8(t *[8]int) [8]int { + return *t // ERROR "generated nil check" +} diff --git a/test/nilptr_aix.go b/test/nilptr_aix.go new file mode 100644 index 0000000000000..ea5fcc3f4e823 --- /dev/null +++ b/test/nilptr_aix.go @@ -0,0 +1,185 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that the implementation catches nil ptr indirection +// in a large address space. + +// +build aix + +package main + +import "unsafe" + +// Having a big address space means that indexing +// at a 1G + 256 MB offset from a nil pointer might not +// cause a memory access fault. This test checks +// that Go is doing the correct explicit checks to catch +// these nil pointer accesses, not just relying on the hardware. +// The reason of the 1G offset is because AIX addresses start after 1G. +var dummy [256 << 20]byte // give us a big address space + +func main() { + // the test only tests what we intend to test + // if dummy starts in the first 256 MB of memory. + // otherwise there might not be anything mapped + // at the address that might be accidentally + // dereferenced below. + if uintptr(unsafe.Pointer(&dummy)) < 1<<32 { + panic("dummy not far enough") + } + + shouldPanic(p1) + shouldPanic(p2) + shouldPanic(p3) + shouldPanic(p4) + shouldPanic(p5) + shouldPanic(p6) + shouldPanic(p7) + shouldPanic(p8) + shouldPanic(p9) + shouldPanic(p10) + shouldPanic(p11) + shouldPanic(p12) + shouldPanic(p13) + shouldPanic(p14) + shouldPanic(p15) + shouldPanic(p16) +} + +func shouldPanic(f func()) { + defer func() { + if recover() == nil { + panic("memory reference did not panic") + } + }() + f() +} + +func p1() { + // Array index. + var p *[1 << 33]byte = nil + println(p[1<<32+256<<20]) // very likely to be inside dummy, but should panic +} + +var xb byte + +func p2() { + var p *[1 << 33]byte = nil + xb = 123 + + // Array index. + println(p[uintptr(unsafe.Pointer(&xb))]) // should panic +} + +func p3() { + // Array to slice. + var p *[1 << 33]byte = nil + var x []byte = p[0:] // should panic + _ = x +} + +var q *[1 << 33]byte + +func p4() { + // Array to slice. + var x []byte + var y = &x + *y = q[0:] // should crash (uses arraytoslice runtime routine) +} + +func fb([]byte) { + panic("unreachable") +} + +func p5() { + // Array to slice. + var p *[1 << 33]byte = nil + fb(p[0:]) // should crash +} + +func p6() { + // Array to slice. + var p *[1 << 33]byte = nil + var _ []byte = p[10 : len(p)-10] // should crash +} + +type T struct { + x [1<<32 + 256<<20]byte + i int +} + +func f() *T { + return nil +} + +var y *T +var x = &y + +func p7() { + // Struct field access with large offset. + println(f().i) // should crash +} + +func p8() { + // Struct field access with large offset. + println((*x).i) // should crash +} + +func p9() { + // Struct field access with large offset. + var t *T + println(&t.i) // should crash +} + +func p10() { + // Struct field access with large offset. + var t *T + println(t.i) // should crash +} + +type T1 struct { + T +} + +type T2 struct { + *T1 +} + +func p11() { + t := &T2{} + p := &t.i + println(*p) +} + +// ADDR(DOT(IND(p))) needs a check also +func p12() { + var p *T = nil + println(*(&((*p).i))) +} + +// Tests suggested in golang.org/issue/6080. + +func p13() { + var x *[10]int + y := x[:] + _ = y +} + +func p14() { + println((*[1]int)(nil)[:]) +} + +func p15() { + for i := range (*[1]int)(nil)[:] { + _ = i + } +} + +func p16() { + for i, v := range (*[1]int)(nil)[:] { + _ = i + v + } +} From 9ab2ffe8e92f9660cbde1a18921ae864c64f280b Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Wed, 21 Nov 2018 14:04:29 -0800 Subject: [PATCH 122/594] runtime: windows/arm fix tracebacks printed from sigpanic The exception handler modifies the stack and continuation context so it looks like the faulting code calls sigpanic() directly. The call was not set up correctly on ARM, because it did not handle the link register correctly. This change handles the link register correctly for ARM. Updates #28854 Change-Id: I7ccf838adfc05cd968a5edd7d19ebba6a2478360 Reviewed-on: https://go-review.googlesource.com/c/150957 Run-TryBot: Brad Fitzpatrick Reviewed-by: Austin Clements TryBot-Result: Gobot Gobot --- src/runtime/defs_windows_386.go | 7 ++++--- src/runtime/defs_windows_amd64.go | 7 ++++--- src/runtime/defs_windows_arm.go | 5 +++-- src/runtime/signal_windows.go | 14 +++++++++++--- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/runtime/defs_windows_386.go b/src/runtime/defs_windows_386.go index 38b30b70e3409..8c0d6d8b98fdc 100644 --- a/src/runtime/defs_windows_386.go +++ b/src/runtime/defs_windows_386.go @@ -105,10 +105,11 @@ func (c *context) ip() uintptr { return uintptr(c.eip) } func (c *context) sp() uintptr { return uintptr(c.esp) } // 386 does not have link register, so this returns 0. -func (c *context) lr() uintptr { return 0 } +func (c *context) lr() uintptr { return 0 } +func (c *context) set_lr(x uintptr) {} -func (c *context) setip(x uintptr) { c.eip = uint32(x) } -func (c *context) setsp(x uintptr) { c.esp = uint32(x) } +func (c *context) set_ip(x uintptr) { c.eip = uint32(x) } +func (c *context) set_sp(x uintptr) { c.esp = uint32(x) } func dumpregs(r *context) { print("eax ", hex(r.eax), "\n") diff --git a/src/runtime/defs_windows_amd64.go b/src/runtime/defs_windows_amd64.go index 37508c09becdc..42a446d3cdfc7 100644 --- a/src/runtime/defs_windows_amd64.go +++ b/src/runtime/defs_windows_amd64.go @@ -120,10 +120,11 @@ func (c *context) ip() uintptr { return uintptr(c.rip) } func (c *context) sp() uintptr { return uintptr(c.rsp) } // Amd64 does not have link register, so this returns 0. -func (c *context) lr() uintptr { return 0 } +func (c *context) lr() uintptr { return 0 } +func (c *context) set_lr(x uintptr) {} -func (c *context) setip(x uintptr) { c.rip = uint64(x) } -func (c *context) setsp(x uintptr) { c.rsp = uint64(x) } +func (c *context) set_ip(x uintptr) { c.rip = uint64(x) } +func (c *context) set_sp(x uintptr) { c.rsp = uint64(x) } func dumpregs(r *context) { print("rax ", hex(r.rax), "\n") diff --git a/src/runtime/defs_windows_arm.go b/src/runtime/defs_windows_arm.go index 1140f61651f38..049f5b613a74d 100644 --- a/src/runtime/defs_windows_arm.go +++ b/src/runtime/defs_windows_arm.go @@ -104,8 +104,9 @@ func (c *context) ip() uintptr { return uintptr(c.pc) } func (c *context) sp() uintptr { return uintptr(c.spr) } func (c *context) lr() uintptr { return uintptr(c.lrr) } -func (c *context) setip(x uintptr) { c.pc = uint32(x) } -func (c *context) setsp(x uintptr) { c.spr = uint32(x) } +func (c *context) set_ip(x uintptr) { c.pc = uint32(x) } +func (c *context) set_sp(x uintptr) { c.spr = uint32(x) } +func (c *context) set_lr(x uintptr) { c.lrr = uint32(x) } func dumpregs(r *context) { print("r0 ", hex(r.r0), "\n") diff --git a/src/runtime/signal_windows.go b/src/runtime/signal_windows.go index e8a64da657961..e6a75a160f2a5 100644 --- a/src/runtime/signal_windows.go +++ b/src/runtime/signal_windows.go @@ -117,10 +117,18 @@ func exceptionhandler(info *exceptionrecord, r *context, gp *g) int32 { if r.ip() != 0 { sp := unsafe.Pointer(r.sp()) sp = add(sp, ^(unsafe.Sizeof(uintptr(0)) - 1)) // sp-- - *((*uintptr)(sp)) = r.ip() - r.setsp(uintptr(sp)) + r.set_sp(uintptr(sp)) + switch GOARCH { + default: + panic("unsupported architecture") + case "386", "amd64": + *((*uintptr)(sp)) = r.ip() + case "arm": + *((*uintptr)(sp)) = r.lr() + r.set_lr(r.ip()) + } } - r.setip(funcPC(sigpanic)) + r.set_ip(funcPC(sigpanic)) return _EXCEPTION_CONTINUE_EXECUTION } From ca3749230b5a7d43b3292226fdb2b6f3de5d653b Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 26 Nov 2018 10:48:56 -0800 Subject: [PATCH 123/594] cmd/compile: allow bodyless function if it is linkname'd In assembly free packages (aka "complete" or "pure go"), allow bodyless functions if they are linkname'd to something else. Presumably the thing the function is linkname'd to has a definition. If not, the linker will complain. And linkname is unsafe, so we expect users to know what they are doing. Note this handles only one direction, where the linkname directive is in the local package. If the linkname directive is in the remote package, this CL won't help. (See os/signal/sig.s for an example.) Fixes #23311 Change-Id: I824361b4b582ee05976d94812e5b0e8b0f7a18a6 Reviewed-on: https://go-review.googlesource.com/c/151318 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/gc/noder.go | 13 ++++++++++++- .../fixedbugs/issue23311.dir/main.go | 11 ++++++++++- .../unix/empty.s => test/fixedbugs/issue23311.go | 4 +++- 3 files changed, 25 insertions(+), 3 deletions(-) rename src/runtime/testdata/testprog/empty.s => test/fixedbugs/issue23311.dir/main.go (59%) rename src/internal/syscall/unix/empty.s => test/fixedbugs/issue23311.go (70%) diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go index b9849e7a8491b..23c9539b0a1ae 100644 --- a/src/cmd/compile/internal/gc/noder.go +++ b/src/cmd/compile/internal/gc/noder.go @@ -497,7 +497,18 @@ func (p *noder) funcDecl(fun *syntax.FuncDecl) *Node { } } else { if pure_go || strings.HasPrefix(f.funcname(), "init.") { - yyerrorl(f.Pos, "missing function body") + // Linknamed functions are allowed to have no body. Hopefully + // the linkname target has a body. See issue 23311. + isLinknamed := false + for _, n := range p.linknames { + if f.funcname() == n.local { + isLinknamed = true + break + } + } + if !isLinknamed { + yyerrorl(f.Pos, "missing function body") + } } } diff --git a/src/runtime/testdata/testprog/empty.s b/test/fixedbugs/issue23311.dir/main.go similarity index 59% rename from src/runtime/testdata/testprog/empty.s rename to test/fixedbugs/issue23311.dir/main.go index c5aa6f8a54661..fa4cf76b89a7a 100644 --- a/src/runtime/testdata/testprog/empty.s +++ b/test/fixedbugs/issue23311.dir/main.go @@ -2,4 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This exists solely so we can linkname in symbols from runtime. +package main + +import _ "unsafe" // for linkname + +//go:linkname f runtime.GC +func f() + +func main() { + f() +} diff --git a/src/internal/syscall/unix/empty.s b/test/fixedbugs/issue23311.go similarity index 70% rename from src/internal/syscall/unix/empty.s rename to test/fixedbugs/issue23311.go index 717189c658512..128cf9d06ad6e 100644 --- a/src/internal/syscall/unix/empty.s +++ b/test/fixedbugs/issue23311.go @@ -1,5 +1,7 @@ +// compiledir + // Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This exists solely so we can linkname in symbols from syscall. +package ignored From 984be3b0f8388161e166039de8b7ac5383a76d10 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Fri, 16 Nov 2018 10:11:47 -0500 Subject: [PATCH 124/594] go/internal/gccgoimporter: enhance for new export data, fix test issues This patch merges in support for reading indexed type export data, from the gofrontend CL https://golang.org/cl/143022 (which includes a change in the export data version number from V2 to V3). Also fixes the key tests to insure that they run both in gccgo builds and main Go repo builds if "gccgo" is present (prior to this the tests were not running in either scenario); this required fixing up some of the expected results. Fixes #28961. Change-Id: I644d171f2a46be9160f89dada06ab3c20468bab7 Reviewed-on: https://go-review.googlesource.com/c/149957 Run-TryBot: Than McIntosh Reviewed-by: Ian Lance Taylor --- .../gccgoimporter/gccgoinstallation_test.go | 13 +- src/go/internal/gccgoimporter/importer.go | 5 +- .../internal/gccgoimporter/importer_test.go | 62 +++-- src/go/internal/gccgoimporter/parser.go | 218 ++++++++++++++---- src/go/internal/gccgoimporter/parser_test.go | 3 +- 5 files changed, 214 insertions(+), 87 deletions(-) diff --git a/src/go/internal/gccgoimporter/gccgoinstallation_test.go b/src/go/internal/gccgoimporter/gccgoinstallation_test.go index da4931ef1e722..732159ca63200 100644 --- a/src/go/internal/gccgoimporter/gccgoinstallation_test.go +++ b/src/go/internal/gccgoimporter/gccgoinstallation_test.go @@ -6,7 +6,6 @@ package gccgoimporter import ( "go/types" - "runtime" "testing" ) @@ -144,14 +143,14 @@ var importablePackages = [...]string{ } func TestInstallationImporter(t *testing.T) { - // This test relies on gccgo being around, which it most likely will be if we - // were compiled with gccgo. - if runtime.Compiler != "gccgo" { + // This test relies on gccgo being around. + gpath := gccgoPath() + if gpath == "" { t.Skip("This test needs gccgo") } var inst GccgoInstallation - err := inst.InitFromDriver("gccgo") + err := inst.InitFromDriver(gpath) if err != nil { t.Fatal(err) } @@ -176,12 +175,12 @@ func TestInstallationImporter(t *testing.T) { // Test for certain specific entities in the imported data. for _, test := range [...]importerTest{ - {pkgpath: "io", name: "Reader", want: "type Reader interface{Read(p []uint8) (n int, err error)}"}, + {pkgpath: "io", name: "Reader", want: "type Reader interface{Read(p []byte) (n int, err error)}"}, {pkgpath: "io", name: "ReadWriter", want: "type ReadWriter interface{Reader; Writer}"}, {pkgpath: "math", name: "Pi", want: "const Pi untyped float"}, {pkgpath: "math", name: "Sin", want: "func Sin(x float64) float64"}, {pkgpath: "sort", name: "Ints", want: "func Ints(a []int)"}, - {pkgpath: "unsafe", name: "Pointer", want: "type Pointer unsafe.Pointer"}, + {pkgpath: "unsafe", name: "Pointer", want: "type Pointer"}, } { runImporterTest(t, imp, nil, &test) } diff --git a/src/go/internal/gccgoimporter/importer.go b/src/go/internal/gccgoimporter/importer.go index 159cc50719f50..ea111136cdadb 100644 --- a/src/go/internal/gccgoimporter/importer.go +++ b/src/go/internal/gccgoimporter/importer.go @@ -62,6 +62,7 @@ func findExportFile(searchpaths []string, pkgpath string) (string, error) { const ( gccgov1Magic = "v1;\n" gccgov2Magic = "v2;\n" + gccgov3Magic = "v3;\n" goimporterMagic = "\n$$ " archiveMagic = "! package object typeList []types.Type // type number -> type + typeData []string // unparsed type data (v3 and later) initdata InitData // package init priority data } func (p *parser) init(filename string, src io.Reader, imports map[string]*types.Package) { + p.scanner = new(scanner.Scanner) + p.initScanner(filename, src) + p.imports = imports + p.typeList = make([]types.Type, 1 /* type numbers start at 1 */, 16) +} + +func (p *parser) initScanner(filename string, src io.Reader) { p.scanner.Init(src) p.scanner.Error = func(_ *scanner.Scanner, msg string) { p.error(msg) } p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanFloats | scanner.ScanStrings | scanner.ScanComments | scanner.SkipComments - p.scanner.Whitespace = 1<<'\t' | 1<<'\n' | 1<<' ' + p.scanner.Whitespace = 1<<'\t' | 1<<' ' p.scanner.Filename = filename // for good error messages p.next() - p.imports = imports - p.typeList = make([]types.Type, 1 /* type numbers start at 1 */, 16) } type importError struct { @@ -71,6 +77,13 @@ func (p *parser) expect(tok rune) string { return lit } +func (p *parser) expectEOL() { + if p.version == "v1" || p.version == "v2" { + p.expect(';') + } + p.expect('\n') +} + func (p *parser) expectKeyword(keyword string) { lit := p.expect(scanner.Ident) if lit != keyword { @@ -96,7 +109,7 @@ func (p *parser) parseUnquotedString() string { buf.WriteString(p.scanner.TokenText()) // This loop needs to examine each character before deciding whether to consume it. If we see a semicolon, // we need to let it be consumed by p.next(). - for ch := p.scanner.Peek(); ch != ';' && ch != scanner.EOF && p.scanner.Whitespace&(1<' { + if len(p.typeData) > 0 && p.typeList[n1] == nil { + p.parseSavedType(pkg, n1, n) + } t = p.typeList[n1] - if t == reserved { - p.errorf("invalid type cycle, type %d not yet defined", n1) + if len(p.typeData) == 0 && t == reserved { + p.errorf("invalid type cycle, type %d not yet defined (nlist=%v)", n1, n) } p.update(t, n) } else { @@ -808,12 +852,86 @@ func (p *parser) parseType(pkg *types.Package, n ...int) (t types.Type) { default: p.errorf("expected type number, got %s (%q)", scanner.TokenString(p.tok), p.lit) + return nil + } + + if t == nil || t == reserved { + p.errorf("internal error: bad return from parseType(%v)", n) } p.expect('>') return } +// Types = "types" maxp1 exportedp1 (offset length)* . +func (p *parser) parseTypes(pkg *types.Package) { + maxp1 := p.parseInt() + exportedp1 := p.parseInt() + p.typeList = make([]types.Type, maxp1, maxp1) + + type typeOffset struct { + offset int + length int + } + var typeOffsets []typeOffset + + total := 0 + for i := 1; i < maxp1; i++ { + len := p.parseInt() + typeOffsets = append(typeOffsets, typeOffset{total, len}) + total += len + } + + // We should now have p.tok pointing to the final newline. + // The next runes from the scanner should be the type data. + + var sb strings.Builder + for sb.Len() < total { + r := p.scanner.Next() + if r == scanner.EOF { + p.error("unexpected EOF") + } + sb.WriteRune(r) + } + allTypeData := sb.String() + + p.typeData = []string{""} // type 0, unused + for _, to := range typeOffsets { + p.typeData = append(p.typeData, allTypeData[to.offset:to.offset+to.length]) + } + + for i := 1; i < int(exportedp1); i++ { + p.parseSavedType(pkg, i, []int{}) + } +} + +// parseSavedType parses one saved type definition. +func (p *parser) parseSavedType(pkg *types.Package, i int, nlist []int) { + defer func(s *scanner.Scanner, tok rune, lit string) { + p.scanner = s + p.tok = tok + p.lit = lit + }(p.scanner, p.tok, p.lit) + + p.scanner = new(scanner.Scanner) + p.initScanner(p.scanner.Filename, strings.NewReader(p.typeData[i])) + p.expectKeyword("type") + id := p.parseInt() + if id != i { + p.errorf("type ID mismatch: got %d, want %d", id, i) + } + if p.typeList[i] == reserved { + p.errorf("internal error: %d already reserved in parseSavedType", i) + } + if p.typeList[i] == nil { + p.reserve(i) + p.parseTypeSpec(pkg, append(nlist, i)) + } + if p.typeList[i] == nil || p.typeList[i] == reserved { + p.errorf("internal error: parseSavedType(%d,%v) reserved/nil", i, nlist) + } +} + // PackageInit = unquotedString unquotedString int . func (p *parser) parsePackageInit() PackageInit { name := p.parseUnquotedString() @@ -829,7 +947,7 @@ func (p *parser) parsePackageInit() PackageInit { func (p *parser) discardDirectiveWhileParsingTypes(pkg *types.Package) { for { switch p.tok { - case ';': + case '\n', ';': return case '<': p.parseType(pkg) @@ -848,7 +966,7 @@ func (p *parser) maybeCreatePackage() { } } -// InitDataDirective = ( "v1" | "v2" ) ";" | +// InitDataDirective = ( "v1" | "v2" | "v3" ) ";" | // "priority" int ";" | // "init" { PackageInit } ";" | // "checksum" unquotedString ";" . @@ -859,31 +977,32 @@ func (p *parser) parseInitDataDirective() { } switch p.lit { - case "v1", "v2": + case "v1", "v2", "v3": p.version = p.lit p.next() p.expect(';') + p.expect('\n') case "priority": p.next() p.initdata.Priority = p.parseInt() - p.expect(';') + p.expectEOL() case "init": p.next() - for p.tok != ';' && p.tok != scanner.EOF { + for p.tok != '\n' && p.tok != ';' && p.tok != scanner.EOF { p.initdata.Inits = append(p.initdata.Inits, p.parsePackageInit()) } - p.expect(';') + p.expectEOL() case "init_graph": p.next() // The graph data is thrown away for now. - for p.tok != ';' && p.tok != scanner.EOF { + for p.tok != '\n' && p.tok != ';' && p.tok != scanner.EOF { p.parseInt64() p.parseInt64() } - p.expect(';') + p.expectEOL() case "checksum": // Don't let the scanner try to parse the checksum as a number. @@ -893,7 +1012,7 @@ func (p *parser) parseInitDataDirective() { p.scanner.Mode &^= scanner.ScanInts | scanner.ScanFloats p.next() p.parseUnquotedString() - p.expect(';') + p.expectEOL() default: p.errorf("unexpected identifier: %q", p.lit) @@ -905,6 +1024,7 @@ func (p *parser) parseInitDataDirective() { // "pkgpath" unquotedString ";" | // "prefix" unquotedString ";" | // "import" unquotedString unquotedString string ";" | +// "indirectimport" unquotedString unquotedstring ";" | // "func" Func ";" | // "type" Type ";" | // "var" Var ";" | @@ -916,29 +1036,29 @@ func (p *parser) parseDirective() { } switch p.lit { - case "v1", "v2", "priority", "init", "init_graph", "checksum": + case "v1", "v2", "v3", "priority", "init", "init_graph", "checksum": p.parseInitDataDirective() case "package": p.next() p.pkgname = p.parseUnquotedString() p.maybeCreatePackage() - if p.version == "v2" && p.tok != ';' { + if p.version != "v1" && p.tok != '\n' && p.tok != ';' { p.parseUnquotedString() p.parseUnquotedString() } - p.expect(';') + p.expectEOL() case "pkgpath": p.next() p.pkgpath = p.parseUnquotedString() p.maybeCreatePackage() - p.expect(';') + p.expectEOL() case "prefix": p.next() p.pkgpath = p.parseUnquotedString() - p.expect(';') + p.expectEOL() case "import": p.next() @@ -946,7 +1066,19 @@ func (p *parser) parseDirective() { pkgpath := p.parseUnquotedString() p.getPkg(pkgpath, pkgname) p.parseString() - p.expect(';') + p.expectEOL() + + case "indirectimport": + p.next() + pkgname := p.parseUnquotedString() + pkgpath := p.parseUnquotedString() + p.getPkg(pkgpath, pkgname) + p.expectEOL() + + case "types": + p.next() + p.parseTypes(p.pkg) + p.expectEOL() case "func": p.next() @@ -954,24 +1086,24 @@ func (p *parser) parseDirective() { if fun != nil { p.pkg.Scope().Insert(fun) } - p.expect(';') + p.expectEOL() case "type": p.next() p.parseType(p.pkg) - p.expect(';') + p.expectEOL() case "var": p.next() v := p.parseVar(p.pkg) p.pkg.Scope().Insert(v) - p.expect(';') + p.expectEOL() case "const": p.next() c := p.parseConst(p.pkg) p.pkg.Scope().Insert(c) - p.expect(';') + p.expectEOL() default: p.errorf("unexpected identifier: %q", p.lit) diff --git a/src/go/internal/gccgoimporter/parser_test.go b/src/go/internal/gccgoimporter/parser_test.go index 4a103dc462af8..00128b44d2687 100644 --- a/src/go/internal/gccgoimporter/parser_test.go +++ b/src/go/internal/gccgoimporter/parser_test.go @@ -19,7 +19,7 @@ var typeParserTests = []struct { {id: "foo", typ: ">", want: "*error"}, {id: "foo", typ: "", want: "unsafe.Pointer"}, {id: "foo", typ: ">>", want: "foo.Bar", underlying: "*foo.Bar"}, - {id: "foo", typ: " func (? ) M (); >", want: "bar.Foo", underlying: "int8", methods: "func (bar.Foo).M()"}, + {id: "foo", typ: "\nfunc (? ) M ();\n>", want: "bar.Foo", underlying: "int8", methods: "func (bar.Foo).M()"}, {id: "foo", typ: ">", want: "bar.foo", underlying: "int8"}, {id: "foo", typ: ">", want: "[]int8"}, {id: "foo", typ: ">", want: "[42]int8"}, @@ -36,6 +36,7 @@ func TestTypeParser(t *testing.T) { for _, test := range typeParserTests { var p parser p.init("test.gox", strings.NewReader(test.typ), make(map[string]*types.Package)) + p.version = "v2" p.pkgname = test.id p.pkgpath = test.id p.maybeCreatePackage() From 57c8eb92b78785d2bb8303b0ee7a7771d5df1be6 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 26 Nov 2018 10:28:44 -0800 Subject: [PATCH 125/594] cmd/compile: remove CLOBBERDEAD experiment This experiment is less effective and less needed since the introduction of stack objects. We can't clobber stack objects because we don't know statically whether they are live or not. We don't really need this experiment that much any more, as it was primarily used to test the complicated ambiguously-live logic in the liveness analysis, which has been removed in favor of stack objects. It is also ~infeasible to maintain once we have safepoints everywhere. Fixes #27326 Change-Id: I3bdde480b93dd508d048703055d4586b496176af Reviewed-on: https://go-review.googlesource.com/c/151317 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/main.go | 4 +- src/cmd/compile/internal/gc/plive.go | 163 +-------------------------- src/cmd/go/internal/work/gc.go | 2 +- src/cmd/internal/objabi/util.go | 2 - 4 files changed, 5 insertions(+), 166 deletions(-) diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index 9dd28e38c3bf1..adfdd7cb376f6 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -1345,8 +1345,8 @@ func concurrentBackendAllowed() bool { if Debug_vlog || debugstr != "" || debuglive > 0 { return false } - // TODO: Test and delete these conditions. - if objabi.Fieldtrack_enabled != 0 || objabi.Clobberdead_enabled != 0 { + // TODO: Test and delete this condition. + if objabi.Fieldtrack_enabled != 0 { return false } // TODO: fix races and enable the following flags diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index 2c31d5feb91ea..61a749ba0dcda 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -19,11 +19,8 @@ import ( "cmd/compile/internal/types" "cmd/internal/obj" "cmd/internal/objabi" - "cmd/internal/src" "crypto/md5" - "crypto/sha1" "fmt" - "os" "strings" ) @@ -632,7 +629,7 @@ func (lv *Liveness) pointerMap(liveout bvec, vars []*Node, args, locals bvec) { // markUnsafePoints finds unsafe points and computes lv.unsafePoints. func (lv *Liveness) markUnsafePoints() { - if compiling_runtime || lv.f.NoSplit || objabi.Clobberdead_enabled != 0 { + if compiling_runtime || lv.f.NoSplit { // No complex analysis necessary. Do this on the fly // in issafepoint. return @@ -791,7 +788,7 @@ func (lv *Liveness) issafepoint(v *ssa.Value) bool { // go:nosplit functions are similar. Since safe points used to // be coupled with stack checks, go:nosplit often actually // means "no safe points in this function". - if compiling_runtime || lv.f.NoSplit || objabi.Clobberdead_enabled != 0 { + if compiling_runtime || lv.f.NoSplit { return v.Op.IsCall() } switch v.Op { @@ -1051,161 +1048,6 @@ func (lv *Liveness) epilogue() { } } -func (lv *Liveness) clobber() { - // The clobberdead experiment inserts code to clobber all the dead variables (locals and args) - // before and after every safepoint. This experiment is useful for debugging the generation - // of live pointer bitmaps. - if objabi.Clobberdead_enabled == 0 { - return - } - var varSize int64 - for _, n := range lv.vars { - varSize += n.Type.Size() - } - if len(lv.stackMaps) > 1000 || varSize > 10000 { - // Be careful to avoid doing too much work. - // Bail if >1000 safepoints or >10000 bytes of variables. - // Otherwise, giant functions make this experiment generate too much code. - return - } - if h := os.Getenv("GOCLOBBERDEADHASH"); h != "" { - // Clobber only functions where the hash of the function name matches a pattern. - // Useful for binary searching for a miscompiled function. - hstr := "" - for _, b := range sha1.Sum([]byte(lv.fn.funcname())) { - hstr += fmt.Sprintf("%08b", b) - } - if !strings.HasSuffix(hstr, h) { - return - } - fmt.Printf("\t\t\tCLOBBERDEAD %s\n", lv.fn.funcname()) - } - if lv.f.Name == "forkAndExecInChild" || lv.f.Name == "wbBufFlush" { - // forkAndExecInChild calls vfork (on linux/amd64, anyway). - // The code we add here clobbers parts of the stack in the child. - // When the parent resumes, it is using the same stack frame. But the - // child has clobbered stack variables that the parent needs. Boom! - // In particular, the sys argument gets clobbered. - // Note to self: GOCLOBBERDEADHASH=011100101110 - // - // runtime.wbBufFlush must not modify its arguments. See the comments - // in runtime/mwbbuf.go:wbBufFlush. - return - } - - var oldSched []*ssa.Value - for _, b := range lv.f.Blocks { - // Copy block's values to a temporary. - oldSched = append(oldSched[:0], b.Values...) - b.Values = b.Values[:0] - - // Clobber all dead variables at entry. - if b == lv.f.Entry { - for len(oldSched) > 0 && len(oldSched[0].Args) == 0 { - // Skip argless ops. We need to skip at least - // the lowered ClosurePtr op, because it - // really wants to be first. This will also - // skip ops like InitMem and SP, which are ok. - b.Values = append(b.Values, oldSched[0]) - oldSched = oldSched[1:] - } - clobber(lv, b, lv.stackMaps[0]) - } - - // Copy values into schedule, adding clobbering around safepoints. - for _, v := range oldSched { - if !lv.issafepoint(v) { - b.Values = append(b.Values, v) - continue - } - before := true - if v.Op.IsCall() && v.Aux != nil && v.Aux.(*obj.LSym) == typedmemmove { - // Can't put clobber code before the call to typedmemmove. - // The variable to-be-copied is marked as dead - // at the callsite. That is ok, though, as typedmemmove - // is marked as nosplit, and the first thing it does - // is to call memmove (also nosplit), after which - // the source value is dead. - // See issue 16026. - before = false - } - if before { - clobber(lv, b, lv.stackMaps[lv.livenessMap.Get(v).stackMapIndex]) - } - b.Values = append(b.Values, v) - clobber(lv, b, lv.stackMaps[lv.livenessMap.Get(v).stackMapIndex]) - } - } -} - -// clobber generates code to clobber all dead variables (those not marked in live). -// Clobbering instructions are added to the end of b.Values. -func clobber(lv *Liveness, b *ssa.Block, live bvec) { - for i, n := range lv.vars { - if !live.Get(int32(i)) { - clobberVar(b, n) - } - } -} - -// clobberVar generates code to trash the pointers in v. -// Clobbering instructions are added to the end of b.Values. -func clobberVar(b *ssa.Block, v *Node) { - clobberWalk(b, v, 0, v.Type) -} - -// b = block to which we append instructions -// v = variable -// offset = offset of (sub-portion of) variable to clobber (in bytes) -// t = type of sub-portion of v. -func clobberWalk(b *ssa.Block, v *Node, offset int64, t *types.Type) { - if !types.Haspointers(t) { - return - } - switch t.Etype { - case TPTR, - TUNSAFEPTR, - TFUNC, - TCHAN, - TMAP: - clobberPtr(b, v, offset) - - case TSTRING: - // struct { byte *str; int len; } - clobberPtr(b, v, offset) - - case TINTER: - // struct { Itab *tab; void *data; } - // or, when isnilinter(t)==true: - // struct { Type *type; void *data; } - // Note: the first word isn't a pointer. See comment in plive.go:onebitwalktype1. - clobberPtr(b, v, offset+int64(Widthptr)) - - case TSLICE: - // struct { byte *array; int len; int cap; } - clobberPtr(b, v, offset) - - case TARRAY: - for i := int64(0); i < t.NumElem(); i++ { - clobberWalk(b, v, offset+i*t.Elem().Size(), t.Elem()) - } - - case TSTRUCT: - for _, t1 := range t.Fields().Slice() { - clobberWalk(b, v, offset+t1.Offset, t1.Type) - } - - default: - Fatalf("clobberWalk: unexpected type, %v", t) - } -} - -// clobberPtr generates a clobber of the pointer at offset offset in v. -// The clobber instruction is added at the end of b. -func clobberPtr(b *ssa.Block, v *Node, offset int64) { - b.NewValue0IA(src.NoXPos, ssa.OpClobber, types.TypeVoid, offset, v) -} - // Compact coalesces identical bitmaps from lv.livevars into the sets // lv.stackMapSet and lv.regMaps. // @@ -1553,7 +1395,6 @@ func liveness(e *ssafn, f *ssa.Func, pp *Progs) LivenessMap { lv.prologue() lv.solve() lv.epilogue() - lv.clobber() if debuglive > 0 { lv.showlive(nil, lv.stackMaps[0]) for _, b := range f.Blocks { diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index c0c457cbad3fb..0df6629f410fb 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -174,7 +174,7 @@ CheckFlags: } // TODO: Test and delete these conditions. - if objabi.Fieldtrack_enabled != 0 || objabi.Preemptibleloops_enabled != 0 || objabi.Clobberdead_enabled != 0 { + if objabi.Fieldtrack_enabled != 0 || objabi.Preemptibleloops_enabled != 0 { canDashC = false } diff --git a/src/cmd/internal/objabi/util.go b/src/cmd/internal/objabi/util.go index d1017322f0086..da49f706f6033 100644 --- a/src/cmd/internal/objabi/util.go +++ b/src/cmd/internal/objabi/util.go @@ -104,7 +104,6 @@ var ( framepointer_enabled int = 1 Fieldtrack_enabled int Preemptibleloops_enabled int - Clobberdead_enabled int ) // Toolchain experiments. @@ -118,7 +117,6 @@ var exper = []struct { {"fieldtrack", &Fieldtrack_enabled}, {"framepointer", &framepointer_enabled}, {"preemptibleloops", &Preemptibleloops_enabled}, - {"clobberdead", &Clobberdead_enabled}, } var defaultExpstring = Expstring() From 1602e497012a27071e200d54ebfe13ca23d1f8af Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 26 Nov 2018 12:59:54 -0800 Subject: [PATCH 126/594] cmd/compile: don't constant-fold non-Go constants in the frontend Abort evconst if its argument isn't a Go constant. The SSA backend will do the optimizations in question later. They tend to be weird cases, like uintptr(unsafe.Pointer(uintptr(1))). Fix OADDSTR and OCOMPLEX cases in isGoConst. OADDSTR has its arguments in n.List, not n.Left and n.Right. OCOMPLEX might have a 2-result function as its arg in List[0] (in which case it isn't a Go constant). Fixes #24760 Change-Id: Iab312d994240d99b3f69bfb33a443607e872b01d Reviewed-on: https://go-review.googlesource.com/c/151338 Run-TryBot: Keith Randall Reviewed-by: Matthew Dempsky TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/const.go | 25 ++++++++++++++++++++++--- src/cmd/compile/internal/gc/fmt.go | 9 ++++++++- src/cmd/compile/internal/gc/syntax.go | 2 +- test/fixedbugs/issue17038.go | 2 +- test/fixedbugs/issue24760.go | 12 ++++++++++++ 5 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 test/fixedbugs/issue24760.go diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index 9f5afadd70dfa..afcdb95443a0b 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -584,6 +584,14 @@ func Isconst(n *Node, ct Ctype) bool { // evconst rewrites constant expressions into OLITERAL nodes. func evconst(n *Node) { + if !n.isGoConst() { + // Avoid constant evaluation of things that aren't actually constants + // according to the spec. See issue 24760. + // The SSA backend has a more robust optimizer that will catch + // all of these weird cases (like uintptr(unsafe.Pointer(uintptr(1)))). + return + } + nl, nr := n.Left, n.Right // Pick off just the opcodes that can be constant evaluated. @@ -1268,7 +1276,7 @@ func nonnegintconst(n *Node) int64 { // // Expressions derived from nil, like string([]byte(nil)), while they // may be known at compile time, are not Go language constants. -// Only called for expressions known to evaluated to compile-time +// Only called for expressions known to evaluate to compile-time // constants. func (n *Node) isGoConst() bool { if n.Orig != nil { @@ -1277,7 +1285,6 @@ func (n *Node) isGoConst() bool { switch n.Op { case OADD, - OADDSTR, OAND, OANDAND, OANDNOT, @@ -1301,13 +1308,25 @@ func (n *Node) isGoConst() bool { OSUB, OXOR, OIOTA, - OCOMPLEX, OREAL, OIMAG: if n.Left.isGoConst() && (n.Right == nil || n.Right.isGoConst()) { return true } + case OCOMPLEX: + if n.List.Len() == 0 && n.Left.isGoConst() && n.Right.isGoConst() { + return true + } + + case OADDSTR: + for _, n1 := range n.List.Slice() { + if !n1.isGoConst() { + return false + } + } + return true + case OCONV: if okforconst[n.Type.Etype] && n.Left.isGoConst() { return true diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go index 36f7545b3ca0f..f128872dbba3b 100644 --- a/src/cmd/compile/internal/gc/fmt.go +++ b/src/cmd/compile/internal/gc/fmt.go @@ -1400,9 +1400,16 @@ func (n *Node) exprfmt(s fmt.State, prec int, mode fmtMode) { } mode.Fprintf(s, "sliceheader{%v,%v,%v}", n.Left, n.List.First(), n.List.Second()) - case OCOPY, OCOMPLEX: + case OCOPY: mode.Fprintf(s, "%#v(%v, %v)", n.Op, n.Left, n.Right) + case OCOMPLEX: + if n.List.Len() == 1 { + mode.Fprintf(s, "%#v(%v)", n.Op, n.List.First()) + } else { + mode.Fprintf(s, "%#v(%v, %v)", n.Op, n.Left, n.Right) + } + case OCONV, OCONVIFACE, OCONVNOP, diff --git a/src/cmd/compile/internal/gc/syntax.go b/src/cmd/compile/internal/gc/syntax.go index 9ecea8a4c526e..0be52f12719e4 100644 --- a/src/cmd/compile/internal/gc/syntax.go +++ b/src/cmd/compile/internal/gc/syntax.go @@ -692,7 +692,7 @@ const ( OIOTA // iota OREAL // real(Left) OIMAG // imag(Left) - OCOMPLEX // complex(Left, Right) + OCOMPLEX // complex(Left, Right) or complex(List[0]) where List[0] is a 2-result function call OALIGNOF // unsafe.Alignof(Left) OOFFSETOF // unsafe.Offsetof(Left) OSIZEOF // unsafe.Sizeof(Left) diff --git a/test/fixedbugs/issue17038.go b/test/fixedbugs/issue17038.go index 1b65ffc1f0eec..e07a4b22ce25d 100644 --- a/test/fixedbugs/issue17038.go +++ b/test/fixedbugs/issue17038.go @@ -6,4 +6,4 @@ package main -const A = complex(0()) // ERROR "cannot call non-function" +const A = complex(0()) // ERROR "cannot call non-function" "const initializer .* is not a constant" diff --git a/test/fixedbugs/issue24760.go b/test/fixedbugs/issue24760.go new file mode 100644 index 0000000000000..cd6f124517a5c --- /dev/null +++ b/test/fixedbugs/issue24760.go @@ -0,0 +1,12 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +import "unsafe" + +var _ = string([]byte(nil))[0] +var _ = uintptr(unsafe.Pointer(uintptr(1))) << 100 From 6fff980cf1f9af9f4b11e7fc7ead4987cc5fc560 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 26 Nov 2018 14:33:32 -0800 Subject: [PATCH 127/594] cmd/compile: initialize sparse slice literals dynamically When a slice composite literal is sparse, initialize it dynamically instead of statically. s := []int{5:5, 20:20} To initialize the backing store for s, use 2 constant writes instead of copying from a static array with 21 entries. This CL also fixes pathologies in the compiler when the slice is *very* sparse. Fixes #23780 Change-Id: Iae95c6e6f6a0e2994675cbc750d7a4dd6436b13b Reviewed-on: https://go-review.googlesource.com/c/151319 Run-TryBot: Keith Randall Reviewed-by: Robert Griesemer TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/sinit.go | 11 ++++++++++- src/cmd/compile/internal/gc/syntax.go | 2 +- test/fixedbugs/issue23780.go | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 test/fixedbugs/issue23780.go diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index 28ea72b715a3c..acd8550ee3608 100644 --- a/src/cmd/compile/internal/gc/sinit.go +++ b/src/cmd/compile/internal/gc/sinit.go @@ -612,6 +612,15 @@ func getdyn(n *Node, top bool) initGenType { if !top { return initDynamic } + if n.Right.Int64()/4 > int64(n.List.Len()) { + // <25% of entries have explicit values. + // Very rough estimation, it takes 4 bytes of instructions + // to initialize 1 byte of result. So don't use a static + // initializer if the dynamic initialization code would be + // smaller than the static value. + // See issue 23780. + return initDynamic + } case OARRAYLIT, OSTRUCTLIT: } @@ -902,7 +911,7 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { continue } - if isLiteral(value) { + if vstat != nil && isLiteral(value) { // already set by copy from static value continue } diff --git a/src/cmd/compile/internal/gc/syntax.go b/src/cmd/compile/internal/gc/syntax.go index 0be52f12719e4..c7becf53e5615 100644 --- a/src/cmd/compile/internal/gc/syntax.go +++ b/src/cmd/compile/internal/gc/syntax.go @@ -622,7 +622,7 @@ const ( OMAPLIT // Type{List} (composite literal, Type is map) OSTRUCTLIT // Type{List} (composite literal, Type is struct) OARRAYLIT // Type{List} (composite literal, Type is array) - OSLICELIT // Type{List} (composite literal, Type is slice) + OSLICELIT // Type{List} (composite literal, Type is slice) Right.Int64() = slice length. OPTRLIT // &Left (left is composite literal) OCONV // Type(Left) (type conversion) OCONVIFACE // Type(Left) (type conversion, to interface) diff --git a/test/fixedbugs/issue23780.go b/test/fixedbugs/issue23780.go new file mode 100644 index 0000000000000..71fc2d9ed6f3a --- /dev/null +++ b/test/fixedbugs/issue23780.go @@ -0,0 +1,17 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +func f() { + _ = []byte{1 << 30: 1} +} + +func g() { + sink = []byte{1 << 30: 1} +} + +var sink []byte From 63ac89bfb15b2036741e40b2167d1d2f70af3e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 2 Nov 2018 13:50:59 +0100 Subject: [PATCH 128/594] cmd/link/internal/ld: remove R_ADDR relocations inside XCOFF text sections On XCOFF, it is forbidden relocation of a DATA pointer to a text section. It happens when a RODATA symbol needs a DATA symbol's address. This commit moves every RODATA symbols with a R_ADDR on a data symbol to .data sections to avoid these relocations. Change-Id: I7f34d8e0ebdc8352a74e6b40e4c893d8d9419f4d Reviewed-on: https://go-review.googlesource.com/c/146977 Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/data.go | 3 +-- src/cmd/link/internal/ld/xcoff.go | 32 +++++++++++++++++++++++++++++++ src/runtime/alg.go | 4 ++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index f424f1d17b279..ef796b623aa09 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -318,8 +318,7 @@ func relocsym(ctxt *Link, s *sym.Symbol) { // must be done by the loader, as the section .data will be moved. // The "default" symbol address is still needed by the loader so // the current relocation can't be skipped. - // runtime.algarray is different because it will end up in .rodata section - if ctxt.HeadType == objabi.Haix && r.Sym.Sect.Seg == &Segdata && r.Sym.Name != "runtime.algarray" { + if ctxt.HeadType == objabi.Haix && r.Sym.Sect.Seg == &Segdata { // It's not possible to make a loader relocation to a DWARF section. // FIXME if s.Sect.Seg != &Segdwarf { diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index f06b498594493..e39f1bb9f0667 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -878,6 +878,38 @@ func (ctxt *Link) doxcoff() { toc := ctxt.Syms.Lookup("TOC", 0) toc.Type = sym.SXCOFFTOC toc.Attr |= sym.AttrReachable + + // XCOFF does not allow relocations of data symbol address to a text symbol. + // Such case occurs when a RODATA symbol retrieves a data symbol address. + // When it happens, this RODATA symbol is moved to .data section. + // runtime.algarray is a readonly symbol but stored inside .data section. + // If it stays in .data, all type symbols will be moved to .data which + // cannot be done. + algarray := ctxt.Syms.Lookup("runtime.algarray", 0) + algarray.Type = sym.SRODATA + for { + again := false + for _, s := range ctxt.Syms.Allsym { + if s.Type != sym.SRODATA { + continue + } + for ri := range s.R { + r := &s.R[ri] + if r.Type != objabi.R_ADDR { + continue + } + if r.Sym.Type != sym.Sxxx && r.Sym.Type != sym.STEXT && r.Sym.Type != sym.SRODATA { + s.Type = sym.SDATA + again = true + break + } + } + + } + if !again { + break + } + } } // Loader section diff --git a/src/runtime/alg.go b/src/runtime/alg.go index 8e931fd7658c6..887dbebdeb074 100644 --- a/src/runtime/alg.go +++ b/src/runtime/alg.go @@ -301,6 +301,10 @@ func alginit() { } func initAlgAES() { + if GOOS == "aix" { + // runtime.algarray is immutable on AIX: see cmd/link/internal/ld/xcoff.go + return + } useAeshash = true algarray[alg_MEM32].hash = aeshash32 algarray[alg_MEM64].hash = aeshash64 From 9e849dcee4a7049325e483bddef27c22b19dd88b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 26 Nov 2018 12:11:34 -0800 Subject: [PATCH 129/594] runtime: improve godoc formatting of memclrNoHeapPointers comment Fixes #28955 Change-Id: I738ad0c76f7bf8fc504a48cf55d3becd5ed7a9d6 Reviewed-on: https://go-review.googlesource.com/c/151337 Reviewed-by: Brad Fitzpatrick --- src/runtime/stubs.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index bb4fd2cc832c6..0d5503a6f52a7 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -68,12 +68,12 @@ func badsystemstack() { // used only when the caller knows that *ptr contains no heap pointers // because either: // -// 1. *ptr is initialized memory and its type is pointer-free. +// *ptr is initialized memory and its type is pointer-free, or // -// 2. *ptr is uninitialized memory (e.g., memory that's being reused -// for a new allocation) and hence contains only "junk". +// *ptr is uninitialized memory (e.g., memory that's being reused +// for a new allocation) and hence contains only "junk". // -// in memclr_*.s +// The (CPU-specific) implementations of this function are in memclr_*.s. //go:noescape func memclrNoHeapPointers(ptr unsafe.Pointer, n uintptr) From 3f9efe750058308bc499c5eb22bc84193fedb6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 23 Nov 2018 11:17:36 +0100 Subject: [PATCH 130/594] cmd/link: fix XCOFF sections XCOFF files can't have multiples text or data sections. The name of each type section must be .text, .data and .bss. This commit also updates cmd/internal/objfile/xcoff.go to retrieve Go sections using runtime symbols. Change-Id: Ib6315f19dad2d154a4531fc6508e7cbd8bc94743 Reviewed-on: https://go-review.googlesource.com/c/151037 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/cmd/internal/objfile/xcoff.go | 48 +++++- src/cmd/link/internal/ld/data.go | 4 - src/cmd/link/internal/ld/xcoff.go | 259 +++++++++++++---------------- src/cmd/link/internal/ppc64/asm.go | 22 +-- 4 files changed, 162 insertions(+), 171 deletions(-) diff --git a/src/cmd/internal/objfile/xcoff.go b/src/cmd/internal/objfile/xcoff.go index c36b4362ba834..f62a7edf89fa5 100644 --- a/src/cmd/internal/objfile/xcoff.go +++ b/src/cmd/internal/objfile/xcoff.go @@ -91,15 +91,11 @@ func (f *xcoffFile) pcln() (textStart uint64, symtab, pclntab []byte, err error) if sect := f.xcoff.Section(".text"); sect != nil { textStart = sect.VirtualAddress } - if sect := f.xcoff.Section(".gosymtab"); sect != nil { - if symtab, err = sect.Data(); err != nil { - return 0, nil, nil, err - } + if pclntab, err = loadXCOFFTable(f.xcoff, "runtime.pclntab", "runtime.epclntab"); err != nil { + return 0, nil, nil, err } - if sect := f.xcoff.Section(".gopclntab"); sect != nil { - if pclntab, err = sect.Data(); err != nil { - return 0, nil, nil, err - } + if symtab, err = loadXCOFFTable(f.xcoff, "runtime.symtab", "runtime.esymtab"); err != nil { + return 0, nil, nil, err } return textStart, symtab, pclntab, nil } @@ -114,6 +110,42 @@ func (f *xcoffFile) text() (textStart uint64, text []byte, err error) { return } +func findXCOFFSymbol(f *xcoff.File, name string) (*xcoff.Symbol, error) { + for _, s := range f.Symbols { + if s.Name != name { + continue + } + if s.SectionNumber <= 0 { + return nil, fmt.Errorf("symbol %s: invalid section number %d", name, s.SectionNumber) + } + if len(f.Sections) < int(s.SectionNumber) { + return nil, fmt.Errorf("symbol %s: section number %d is larger than max %d", name, s.SectionNumber, len(f.Sections)) + } + return s, nil + } + return nil, fmt.Errorf("no %s symbol found", name) +} + +func loadXCOFFTable(f *xcoff.File, sname, ename string) ([]byte, error) { + ssym, err := findXCOFFSymbol(f, sname) + if err != nil { + return nil, err + } + esym, err := findXCOFFSymbol(f, ename) + if err != nil { + return nil, err + } + if ssym.SectionNumber != esym.SectionNumber { + return nil, fmt.Errorf("%s and %s symbols must be in the same section", sname, ename) + } + sect := f.Sections[ssym.SectionNumber-1] + data, err := sect.Data() + if err != nil { + return nil, err + } + return data[ssym.Value:esym.Value], nil +} + func (f *xcoffFile) goarch() string { switch f.xcoff.TargetMachine { case xcoff.U802TOCMAGIC: diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index ef796b623aa09..367842e0c6e65 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -1708,10 +1708,6 @@ func (ctxt *Link) dodata() { } for _, sect := range Segdata.Sections { sect.Extnum = int16(n) - if ctxt.HeadType == objabi.Haix && (sect.Name == ".noptrdata" || sect.Name == ".bss") { - // On AIX, "noptr" sections are merged with their "ptr" section - continue - } n++ } for _, sect := range Segdwarf.Sections { diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index e39f1bb9f0667..d04065851d358 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -329,6 +329,14 @@ type XcoffLdRel64 struct { Lsymndx int32 // Loader-Section symbol table index } +// xcoffLoaderReloc holds information about a relocation made by the loader. +type xcoffLoaderReloc struct { + sym *sym.Symbol + rel *sym.Reloc + rtype uint16 + symndx int32 +} + const ( XCOFF_R_POS = 0x00 // A(sym) Positive Relocation ) @@ -340,19 +348,17 @@ type XcoffLdStr64 struct { // xcoffFile is used to build XCOFF file. type xcoffFile struct { - xfhdr XcoffFileHdr64 - xahdr XcoffAoutHdr64 - sections []*XcoffScnHdr64 - stringTable xcoffStringTable - textSect *XcoffScnHdr64 - dataSect *XcoffScnHdr64 - bssSect *XcoffScnHdr64 - loaderSect *XcoffScnHdr64 - symtabOffset int64 // offset to the start of symbol table - symbolCount uint32 // number of symbol table records written - dynLibraries map[string]int // Dynamic libraries in .loader section. The integer represents its import file number (- 1) - dynSymbols []*sym.Symbol // Dynamic symbols in .loader section - loaderReloc []*XcoffLdRel64 // Reloc that must be made inside loader + xfhdr XcoffFileHdr64 + xahdr XcoffAoutHdr64 + sections []*XcoffScnHdr64 + stringTable xcoffStringTable + sectNameToScnum map[string]int16 + loaderSize uint64 + symtabOffset int64 // offset to the start of symbol table + symbolCount uint32 // number of symbol table records written + dynLibraries map[string]int // Dynamic libraries in .loader section. The integer represents its import file number (- 1) + dynSymbols []*sym.Symbol // Dynamic symbols in .loader section + loaderReloc []*xcoffLoaderReloc // Reloc that must be made inside loader } // Those values will latter be computed in XcoffInit @@ -363,9 +369,7 @@ var ( // Var used by XCOFF Generation algorithms var ( - xfile xcoffFile - loaderOff uint64 - loaderSize uint64 + xfile xcoffFile ) // xcoffStringTable is a XCOFF string table. @@ -404,29 +408,17 @@ func (sect *XcoffScnHdr64) write(ctxt *Link) { } // addSection adds section to the XCOFF file f. -func (f *xcoffFile) addSection(s *sym.Section) *XcoffScnHdr64 { - sect := &XcoffScnHdr64{ - Spaddr: s.Vaddr, - Svaddr: s.Vaddr, - Ssize: s.Length, - Sscnptr: s.Seg.Fileoff + s.Vaddr - s.Seg.Vaddr, - } - copy(sect.Sname[:], s.Name) // copy string to [8]byte ( pb if len(name) > 8 ) - f.sections = append(f.sections, sect) - return sect -} - -// addLoaderSection adds the loader section to the XCOFF file f. -func (f *xcoffFile) addLoaderSection(size uint64, off uint64) *XcoffScnHdr64 { +func (f *xcoffFile) addSection(name string, addr uint64, size uint64, fileoff uint64, flags uint32) *XcoffScnHdr64 { sect := &XcoffScnHdr64{ + Spaddr: addr, + Svaddr: addr, Ssize: size, - Sscnptr: off, - Sflags: STYP_LOADER, + Sscnptr: fileoff, + Sflags: flags, } - copy(sect.Sname[:], ".loader") // copy string to [8]byte ( pb if len(name) > 8 - f.xahdr.Osnloader = int16(len(f.sections) + 1) + copy(sect.Sname[:], name) // copy string to [8]byte f.sections = append(f.sections, sect) - f.loaderSect = sect + f.sectNameToScnum[name] = int16(len(f.sections)) return sect } @@ -434,16 +426,8 @@ func (f *xcoffFile) addLoaderSection(size uint64, off uint64) *XcoffScnHdr64 { // This function is similar to addSection, but Dwarf section names // must be modified to conventional names and they are various subtypes. func (f *xcoffFile) addDwarfSection(s *sym.Section) *XcoffScnHdr64 { - sect := &XcoffScnHdr64{ - Ssize: s.Length, - Sscnptr: s.Seg.Fileoff + s.Vaddr - s.Seg.Vaddr, - Sflags: STYP_DWARF, - } newName, subtype := xcoffGetDwarfSubtype(s.Name) - copy(sect.Sname[:], newName) - sect.Sflags |= subtype - f.sections = append(f.sections, sect) - return sect + return f.addSection(newName, 0, s.Length, s.Seg.Fileoff+s.Vaddr-s.Seg.Vaddr, STYP_DWARF|subtype) } // xcoffGetDwarfSubtype returns the XCOFF name of the DWARF section str @@ -473,6 +457,27 @@ func xcoffGetDwarfSubtype(str string) (string, uint32) { return "", 0 } +// getXCOFFscnum returns the XCOFF section number of a Go section. +func (f *xcoffFile) getXCOFFscnum(sect *sym.Section) int16 { + switch sect.Seg { + case &Segtext: + return f.sectNameToScnum[".text"] + case &Segdata: + if sect.Name == ".noptrdata" || sect.Name == ".data" { + return f.sectNameToScnum[".data"] + } + if sect.Name == ".noptrbss" || sect.Name == ".bss" { + return f.sectNameToScnum[".bss"] + } + Errorf(nil, "unknown XCOFF segment data section: %s", sect.Name) + case &Segdwarf: + name, _ := xcoffGetDwarfSubtype(sect.Name) + return f.sectNameToScnum[name] + } + Errorf(nil, "getXCOFFscnum not implemented for section %s", sect.Name) + return -1 +} + // Xcoffinit initialised some internal value and setups // already known header information func Xcoffinit(ctxt *Link) { @@ -561,7 +566,7 @@ func (f *xcoffFile) writeSymbolNewFile(ctxt *Link, name string, firstEntry uint6 Nvalue: currDwscnoff[sect.Name], Noffset: uint32(f.stringTable.add(name)), Nsclass: C_DWARF, - Nscnum: sect.Extnum, + Nscnum: f.getXCOFFscnum(sect), Nnumaux: 1, } f.writeSymbol(ctxt.Out, ctxt.Arch.ByteOrder, s) @@ -660,7 +665,7 @@ func (f *xcoffFile) writeSymbolFunc(ctxt *Link, x *sym.Symbol) []interface{} { xfile.updatePreviousFile(ctxt, false) currSymSrcFile.name = x.File currSymSrcFile.fileSymNb = f.symbolCount - f.writeSymbolNewFile(ctxt, x.File, uint64(x.Value), x.Sect.Extnum) + f.writeSymbolNewFile(ctxt, x.File, uint64(x.Value), xfile.getXCOFFscnum(x.Sect)) } } @@ -668,7 +673,7 @@ func (f *xcoffFile) writeSymbolFunc(ctxt *Link, x *sym.Symbol) []interface{} { Nsclass: C_EXT, Noffset: uint32(xfile.stringTable.add(x.Name)), Nvalue: uint64(x.Value), - Nscnum: x.Sect.Extnum, + Nscnum: f.getXCOFFscnum(x.Sect), Ntype: SYM_TYPE_FUNC, Nnumaux: 2, } @@ -726,7 +731,7 @@ func putaixsym(ctxt *Link, x *sym.Symbol, str string, t SymbolType, addr int64, Nsclass: C_HIDEXT, Noffset: uint32(xfile.stringTable.add(str)), Nvalue: uint64(x.Value), - Nscnum: x.Sect.Extnum, + Nscnum: xfile.getXCOFFscnum(x.Sect), Ntype: SYM_TYPE_FUNC, Nnumaux: 1, } @@ -749,7 +754,7 @@ func putaixsym(ctxt *Link, x *sym.Symbol, str string, t SymbolType, addr int64, Nsclass: C_EXT, Noffset: uint32(xfile.stringTable.add(str)), Nvalue: uint64(x.Value), - Nscnum: x.Sect.Extnum, + Nscnum: xfile.getXCOFFscnum(x.Sect), Nnumaux: 1, } @@ -798,9 +803,8 @@ func putaixsym(ctxt *Link, x *sym.Symbol, str string, t SymbolType, addr int64, } // Generate XCOFF Symbol table and XCOFF String table -func Asmaixsym(ctxt *Link) { +func (f *xcoffFile) asmaixsym(ctxt *Link) { // write symbol table - xfile.symtabOffset = ctxt.Out.Offset() genasmsym(ctxt, putaixsym) // update last file Svalue @@ -852,16 +856,16 @@ func xcoffaddloaderreloc(ctxt *Link, s *sym.Symbol, r *sym.Reloc) { Errorf(s, "cannot have a relocation in a text section with a data symbol: %s ", r.Sym.Name) } - ldr := &XcoffLdRel64{ - Lvaddr: uint64(s.Value + int64(r.Off)), - Lrsecnm: s.Sect.Extnum, + ldr := &xcoffLoaderReloc{ + sym: s, + rel: r, } switch r.Type { case objabi.R_ADDR: // Relocation of a .data symbol - ldr.Lrtype = 0x3F<<8 + XCOFF_R_POS - ldr.Lsymndx = 1 // .data + ldr.rtype = 0x3F<<8 + XCOFF_R_POS + ldr.symndx = 1 // .data default: Errorf(s, "unexpected .loader relocation to symbol: %s (type: %s)", r.Sym.Name, r.Type.String()) } @@ -917,9 +921,8 @@ func (ctxt *Link) doxcoff() { // according to information retrieved in xfile object. // Create loader section and returns its size -func Loaderblk(ctxt *Link, off uint64) uint64 { +func Loaderblk(ctxt *Link, off uint64) { xfile.writeLdrScn(ctxt, off) - return loaderSize } func (f *xcoffFile) writeLdrScn(ctxt *Link, globalOff uint64) { @@ -948,7 +951,7 @@ func (f *xcoffFile) writeLdrScn(ctxt *Link, globalOff uint64) { lds := &XcoffLdSym64{ Lvalue: uint64(ep.Value), Loffset: uint32(stlen + 2), // +2 because it must have the first byte of the symbol not its size field - Lscnum: ep.Sect.Extnum, + Lscnum: f.getXCOFFscnum(ep.Sect), Lsmtype: XTY_ENT | XTY_SD, Lsmclas: XMC_DS, Lifile: 0, @@ -984,7 +987,7 @@ func (f *xcoffFile) writeLdrScn(ctxt *Link, globalOff uint64) { ldr := &XcoffLdRel64{ Lvaddr: uint64(s.Value), Lrtype: 0x3F00, - Lrsecnm: s.Sect.Extnum, + Lrsecnm: f.getXCOFFscnum(s.Sect), Lsymndx: int32(nbldsym), } dynimpreloc = append(dynimpreloc, ldr) @@ -1000,14 +1003,26 @@ func (f *xcoffFile) writeLdrScn(ctxt *Link, globalOff uint64) { ldr := &XcoffLdRel64{ Lvaddr: uint64(ep.Value), Lrtype: 0x3F00, - Lrsecnm: ep.Sect.Extnum, + Lrsecnm: f.getXCOFFscnum(ep.Sect), Lsymndx: 0, } off += 16 reloctab = append(reloctab, ldr) off += uint64(16 * len(f.loaderReloc)) - reloctab = append(reloctab, (f.loaderReloc)...) + for _, r := range f.loaderReloc { + ldr = &XcoffLdRel64{ + Lvaddr: uint64(r.sym.Value + int64(r.rel.Off)), + Lrtype: r.rtype, + Lsymndx: r.symndx, + } + + if r.sym.Sect != nil { + ldr.Lrsecnm = f.getXCOFFscnum(r.sym.Sect) + } + + reloctab = append(reloctab, ldr) + } off += uint64(16 * len(dynimpreloc)) reloctab = append(reloctab, dynimpreloc...) @@ -1083,8 +1098,7 @@ func (f *xcoffFile) writeLdrScn(ctxt *Link, globalOff uint64) { ctxt.Out.Write8(0) // null terminator } - loaderOff = globalOff - loaderSize = off + uint64(stlen) + f.loaderSize = off + uint64(stlen) ctxt.Out.Flush() /* again for printing */ @@ -1148,8 +1162,12 @@ func (f *xcoffFile) writeFileHeader(ctxt *Link) { f.xahdr.Ovstamp = 1 // based on dump -o f.xahdr.Omagic = 0x10b copy(f.xahdr.Omodtype[:], "1L") - f.xahdr.Oentry = uint64(Entryvalue(ctxt)) - f.xahdr.Otoc = uint64(ctxt.Syms.ROLookup("TOC", 0).Value) + entry := ctxt.Syms.ROLookup(*flagEntrySymbol, 0) + f.xahdr.Oentry = uint64(entry.Value) + f.xahdr.Osnentry = f.getXCOFFscnum(entry.Sect) + toc := ctxt.Syms.ROLookup("TOC", 0) + f.xahdr.Otoc = uint64(toc.Value) + f.xahdr.Osntoc = f.getXCOFFscnum(toc.Sect) // Based on dump -o f.xahdr.Oalgntext = 0x5 @@ -1175,90 +1193,47 @@ func xcoffwrite(ctxt *Link) { } // Generate XCOFF assembly file -func Asmbxcoff(ctxt *Link) { - // initial offset for sections - if ctxt.BuildMode == BuildModeExe { - // search entry section number - eaddr := uint64(Entryvalue(ctxt)) - for _, sect := range append(Segtext.Sections, Segdata.Sections...) { - if eaddr-sect.Vaddr <= sect.Length { - xfile.xahdr.Osnentry = int16(sect.Extnum) - } - } - - // check - if xfile.xahdr.Osnentry == 0 { - Exitf("internal error: Section number for entry point (addr = 0x%x) not found", eaddr) - } - - } - - // add text sections - for _, sect := range Segtext.Sections { - // ctxt.Logf(".text: %s \n", sect.Name) - s := xfile.addSection(sect) - s.Sflags = STYP_TEXT - - // use sect.Name because of convertion inside scnhdr - if sect.Name == ".text" { - xfile.xahdr.Otextstart = s.Spaddr - xfile.xahdr.Otsize = s.Ssize - xfile.xahdr.Osntext = sect.Extnum - } - } - - // add data sections - var ( - snoptrdata, - sdata, - sbss, - snoptrbss *sym.Section - ) - for _, sect := range Segdata.Sections { - if sect.Name == ".noptrdata" { - snoptrdata = sect - } - if sect.Name == ".noptrbss" { - snoptrbss = sect - } - if sect.Name == ".data" { - sdata = sect - } - if sect.Name == ".bss" { - sbss = sect - } - } - - // On AIX, there must be only one data and one bss section. - // Therefore, their noptr section is merged within them. - // The length of the new section must be recomputed to handle defautl gap - // between GO sections as AIX doesn't allow it. - - // Merge .noptrdata inside .data - sdata.Vaddr = snoptrdata.Vaddr - sdata.Length = sbss.Vaddr - sdata.Vaddr - s := xfile.addSection(sdata) - s.Sflags = STYP_DATA - xfile.xahdr.Odatastart = s.Spaddr +func Asmbxcoff(ctxt *Link, fileoff int64) { + xfile.sectNameToScnum = make(map[string]int16) + + // Add sections + s := xfile.addSection(".text", Segtext.Vaddr, Segtext.Length, Segtext.Fileoff, STYP_TEXT) + xfile.xahdr.Otextstart = s.Svaddr + xfile.xahdr.Osntext = xfile.sectNameToScnum[".text"] + xfile.xahdr.Otsize = s.Ssize + + s = xfile.addSection(".data", Segdata.Vaddr, Segdata.Filelen, Segdata.Fileoff, STYP_DATA) + xfile.xahdr.Odatastart = s.Svaddr + xfile.xahdr.Osndata = xfile.sectNameToScnum[".data"] xfile.xahdr.Odsize = s.Ssize - xfile.xahdr.Osndata = sdata.Extnum - // Merge .noptrbss inside .bss - sbss.Length = snoptrbss.Vaddr + snoptrbss.Length - sbss.Vaddr - s = xfile.addSection(sbss) - s.Sflags = STYP_BSS + s = xfile.addSection(".bss", Segdata.Vaddr+Segdata.Filelen, Segdata.Length-Segdata.Filelen, 0, STYP_BSS) + xfile.xahdr.Osnbss = xfile.sectNameToScnum[".bss"] xfile.xahdr.Obsize = s.Ssize - xfile.xahdr.Osnbss = sbss.Extnum - s.Sscnptr = 0 - // add dwarf section + // add dwarf sections for _, sect := range Segdwarf.Sections { xfile.addDwarfSection(sect) } - // Loader section must be add at the end because of sect.Extnum - // in others sections - xfile.addLoaderSection(loaderSize, loaderOff) + // add and write remaining sections + if ctxt.LinkMode == LinkInternal { + // Loader section + if ctxt.BuildMode == BuildModeExe { + Loaderblk(ctxt, uint64(fileoff)) + s = xfile.addSection(".loader", 0, xfile.loaderSize, uint64(fileoff), STYP_LOADER) + xfile.xahdr.Osnloader = xfile.sectNameToScnum[".loader"] + } + } else { + // TODO: Relocation + } + + // Write symbol table + symo := Rnd(ctxt.Out.Offset(), int64(*FlagRound)) + xfile.symtabOffset = symo + ctxt.Out.SeekSet(int64(symo)) + xfile.asmaixsym(ctxt) + // write headers xcoffwrite(ctxt) } diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 2ec5a2b18b10f..a5784bc640556 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -953,13 +953,6 @@ func asmb(ctxt *ld.Link) { ctxt.Out.SeekSet(int64(ld.Segdwarf.Fileoff)) ld.Dwarfblk(ctxt, int64(ld.Segdwarf.Vaddr), int64(ld.Segdwarf.Filelen)) - loadersize := uint64(0) - if ctxt.HeadType == objabi.Haix && ctxt.BuildMode == ld.BuildModeExe { - loadero := uint64(ld.Rnd(int64(ld.Segdwarf.Fileoff+ld.Segdwarf.Filelen), int64(*ld.FlagRound))) - ctxt.Out.SeekSet(int64(loadero)) - loadersize = ld.Loaderblk(ctxt, loadero) - } - /* output symbol table */ ld.Symsize = 0 @@ -981,14 +974,7 @@ func asmb(ctxt *ld.Link) { symo = uint32(ld.Segdata.Fileoff + ld.Segdata.Filelen) case objabi.Haix: - symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen) - - // Add loader size if needed - if ctxt.BuildMode == ld.BuildModeExe { - symo = uint32(ld.Rnd(int64(symo), int64(*ld.FlagRound))) - symo += uint32(loadersize) - } - symo = uint32(ld.Rnd(int64(symo), int64(*ld.FlagRound))) + // Nothing to do } ctxt.Out.SeekSet(int64(symo)) @@ -1019,7 +1005,7 @@ func asmb(ctxt *ld.Link) { } case objabi.Haix: - ld.Asmaixsym(ctxt) + // symtab must be added once sections have been created in ld.Asmbxcoff ctxt.Out.Flush() } } @@ -1048,7 +1034,9 @@ func asmb(ctxt *ld.Link) { ld.Asmbelf(ctxt, int64(symo)) case objabi.Haix: - ld.Asmbxcoff(ctxt) + fileoff := uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen) + fileoff = uint32(ld.Rnd(int64(fileoff), int64(*ld.FlagRound))) + ld.Asmbxcoff(ctxt, int64(fileoff)) } ctxt.Out.Flush() From eb6c433eb38d9a0e9ecfcc1604f9ff8e035768f6 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 26 Nov 2018 15:58:03 -0800 Subject: [PATCH 131/594] cmd/compile: don't convert non-Go-constants to OLITERALs Don't convert values that aren't Go constants, like uintptr(unsafe.Pointer(nil)), to a literal constant. This avoids assuming they are constants for things like indexing, array sizes, case duplication, etc. Also, nil is an allowed duplicate in switches. CTNILs aren't Go constants. Fixes #28078 Fixes #28079 Change-Id: I9ab8af47098651ea09ef10481787eae2ae2fb445 Reviewed-on: https://go-review.googlesource.com/c/151320 Run-TryBot: Keith Randall Reviewed-by: Matthew Dempsky TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/const.go | 2 +- src/cmd/compile/internal/gc/swt.go | 2 +- src/cmd/compile/internal/gc/typecheck.go | 6 ++--- test/fixedbugs/issue28078.go | 34 ++++++++++++++++++++++++ test/fixedbugs/issue28079a.go | 20 ++++++++++++++ test/fixedbugs/issue28079b.go | 17 ++++++++++++ test/fixedbugs/issue28079c.go | 15 +++++++++++ 7 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 test/fixedbugs/issue28078.go create mode 100644 test/fixedbugs/issue28079a.go create mode 100644 test/fixedbugs/issue28079b.go create mode 100644 test/fixedbugs/issue28079c.go diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index afcdb95443a0b..c01820506deb6 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -1327,7 +1327,7 @@ func (n *Node) isGoConst() bool { } return true - case OCONV: + case OCONV, OCONVNOP: if okforconst[n.Type.Etype] && n.Left.isGoConst() { return true } diff --git a/src/cmd/compile/internal/gc/swt.go b/src/cmd/compile/internal/gc/swt.go index b475e7adc3d57..a985626a02e26 100644 --- a/src/cmd/compile/internal/gc/swt.go +++ b/src/cmd/compile/internal/gc/swt.go @@ -679,7 +679,7 @@ func checkDupExprCases(exprname *Node, clauses []*Node) { seen := make(map[typeVal]*Node) for _, ncase := range clauses { for _, n := range ncase.List.Slice() { - if ct := consttype(n); ct == 0 || ct == CTBOOL { + if ct := consttype(n); ct == 0 || ct == CTBOOL || ct == CTNIL { continue } tv := typeVal{ diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index 069a38cbbbe19..cbca68541577e 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -1818,9 +1818,9 @@ func typecheck1(n *Node, top int) (res *Node) { switch n.Op { case OCONVNOP: - if n.Left.Op == OLITERAL { - n.Op = OCONV - setconst(n, n.Left.Val()) + if n.Left.Op == OLITERAL && n.isGoConst() { + n.Op = OCONV // set so n.Orig gets OCONV instead of OCONVNOP + setconst(n, n.Left.Val()) // convert n to OLITERAL with the given value } else if t.Etype == n.Type.Etype { switch t.Etype { case TFLOAT32, TFLOAT64, TCOMPLEX64, TCOMPLEX128: diff --git a/test/fixedbugs/issue28078.go b/test/fixedbugs/issue28078.go new file mode 100644 index 0000000000000..2e4c4b55164e7 --- /dev/null +++ b/test/fixedbugs/issue28078.go @@ -0,0 +1,34 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Non-constant duplicate keys/cases should not be reported +// as errors by the compiler. + +package p + +import "unsafe" + +func f() { + _ = map[uintptr]int{ + 0: 0, + uintptr(unsafe.Pointer(nil)): 0, + } + + switch uintptr(0) { + case 0: + case uintptr(unsafe.Pointer(nil)): + } + + switch interface{}(nil) { + case nil: + case nil: + } + + _ = map[interface{}]int{ + nil: 0, + nil: 0, + } +} diff --git a/test/fixedbugs/issue28079a.go b/test/fixedbugs/issue28079a.go new file mode 100644 index 0000000000000..b0631bbd86b8e --- /dev/null +++ b/test/fixedbugs/issue28079a.go @@ -0,0 +1,20 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Non-Go-constant but constant indexes are ok at compile time. + +package p + +import "unsafe" + +func f() { + var x [0]int + x[uintptr(unsafe.Pointer(nil))] = 0 +} +func g() { + var x [10]int + _ = x[3:uintptr(unsafe.Pointer(nil))] +} diff --git a/test/fixedbugs/issue28079b.go b/test/fixedbugs/issue28079b.go new file mode 100644 index 0000000000000..47cc16dfb2f6c --- /dev/null +++ b/test/fixedbugs/issue28079b.go @@ -0,0 +1,17 @@ +// errorcheck + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Non-Go-constant but constant values aren't ok for array sizes. + +package p + +import "unsafe" + +type T [uintptr(unsafe.Pointer(nil))]int // ERROR "non-constant array bound" + +func f() { + _ = complex(1< Date: Tue, 23 Oct 2018 20:20:44 -0600 Subject: [PATCH 132/594] math/bits: panic when y<=hi in Div MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Explicitly check for divide-by-zero/overflow and panic with the appropriate runtime error. The additional checks have basically no effect on performance since the branch is easily predicted. name old time/op new time/op delta Div-4 53.9ns ± 1% 53.0ns ± 1% -1.59% (p=0.016 n=4+5) Div32-4 17.9ns ± 0% 18.4ns ± 0% +2.56% (p=0.008 n=5+5) Div64-4 53.5ns ± 0% 53.3ns ± 0% ~ (p=0.095 n=5+5) Updates #28316 Change-Id: I36297ee9946cbbc57fefb44d1730283b049ecf57 Reviewed-on: https://go-review.googlesource.com/c/144377 Run-TryBot: Keith Randall Reviewed-by: Keith Randall --- src/go/build/deps_test.go | 2 +- src/math/bits/bits.go | 18 +++++++- src/math/bits/bits_test.go | 84 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 3 deletions(-) diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index bf447029b887b..4654a8d9ed6f9 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -62,7 +62,7 @@ var pkgDeps = map[string][]string{ // L1 adds simple functions and strings processing, // but not Unicode tables. "math": {"internal/cpu", "unsafe"}, - "math/bits": {}, + "math/bits": {"unsafe"}, "math/cmplx": {"math"}, "math/rand": {"L0", "math"}, "strconv": {"L0", "unicode/utf8", "math", "math/bits"}, diff --git a/src/math/bits/bits.go b/src/math/bits/bits.go index 58cf52d2a7458..fbf4966157391 100644 --- a/src/math/bits/bits.go +++ b/src/math/bits/bits.go @@ -8,6 +8,8 @@ // functions for the predeclared unsigned integer types. package bits +import _ "unsafe" // for go:linkname + const uintSize = 32 << (^uint(0) >> 32 & 1) // 32 or 64 // UintSize is the size of a uint in bits. @@ -469,6 +471,9 @@ func Div(hi, lo, y uint) (quo, rem uint) { // hi must be < y otherwise the behavior is undefined (the quotient // won't fit into quo). func Div32(hi, lo, y uint32) (quo, rem uint32) { + if y != 0 && y <= hi { + panic(overflowError) + } z := uint64(hi)<<32 | uint64(lo) quo, rem = uint32(z/uint64(y)), uint32(z%uint64(y)) return @@ -484,8 +489,11 @@ func Div64(hi, lo, y uint64) (quo, rem uint64) { two32 = 1 << 32 mask32 = two32 - 1 ) - if hi >= y { - return 1<<64 - 1, 1<<64 - 1 + if y == 0 { + panic(divideError) + } + if y <= hi { + panic(overflowError) } s := uint(LeadingZeros64(y)) @@ -522,3 +530,9 @@ func Div64(hi, lo, y uint64) (quo, rem uint64) { return q1*two32 + q0, (un21*two32 + un0 - q0*y) >> s } + +//go:linkname overflowError runtime.overflowError +var overflowError error + +//go:linkname divideError runtime.divideError +var divideError error diff --git a/src/math/bits/bits_test.go b/src/math/bits/bits_test.go index 0bd52bee773b0..1ec5107ae1294 100644 --- a/src/math/bits/bits_test.go +++ b/src/math/bits/bits_test.go @@ -6,6 +6,7 @@ package bits_test import ( . "math/bits" + "runtime" "testing" "unsafe" ) @@ -875,6 +876,89 @@ func TestMulDiv64(t *testing.T) { } } +const ( + divZeroError = "runtime error: integer divide by zero" + overflowError = "runtime error: integer overflow" +) + +func TestDivPanicOverflow(t *testing.T) { + // Expect a panic + defer func() { + if err := recover(); err == nil { + t.Error("Div should have panicked when y<=hi") + } else if e, ok := err.(runtime.Error); !ok || e.Error() != overflowError { + t.Errorf("Div expected panic: %q, got: %q ", overflowError, e.Error()) + } + }() + q, r := Div(1, 0, 1) + t.Errorf("undefined q, r = %v, %v calculated when Div should have panicked", q, r) +} + +func TestDiv32PanicOverflow(t *testing.T) { + // Expect a panic + defer func() { + if err := recover(); err == nil { + t.Error("Div32 should have panicked when y<=hi") + } else if e, ok := err.(runtime.Error); !ok || e.Error() != overflowError { + t.Errorf("Div32 expected panic: %q, got: %q ", overflowError, e.Error()) + } + }() + q, r := Div32(1, 0, 1) + t.Errorf("undefined q, r = %v, %v calculated when Div32 should have panicked", q, r) +} + +func TestDiv64PanicOverflow(t *testing.T) { + // Expect a panic + defer func() { + if err := recover(); err == nil { + t.Error("Div64 should have panicked when y<=hi") + } else if e, ok := err.(runtime.Error); !ok || e.Error() != overflowError { + t.Errorf("Div64 expected panic: %q, got: %q ", overflowError, e.Error()) + } + }() + q, r := Div64(1, 0, 1) + t.Errorf("undefined q, r = %v, %v calculated when Div64 should have panicked", q, r) +} + +func TestDivPanicZero(t *testing.T) { + // Expect a panic + defer func() { + if err := recover(); err == nil { + t.Error("Div should have panicked when y==0") + } else if e, ok := err.(runtime.Error); !ok || e.Error() != divZeroError { + t.Errorf("Div expected panic: %q, got: %q ", divZeroError, e.Error()) + } + }() + q, r := Div(1, 1, 0) + t.Errorf("undefined q, r = %v, %v calculated when Div should have panicked", q, r) +} + +func TestDiv32PanicZero(t *testing.T) { + // Expect a panic + defer func() { + if err := recover(); err == nil { + t.Error("Div32 should have panicked when y==0") + } else if e, ok := err.(runtime.Error); !ok || e.Error() != divZeroError { + t.Errorf("Div32 expected panic: %q, got: %q ", divZeroError, e.Error()) + } + }() + q, r := Div32(1, 1, 0) + t.Errorf("undefined q, r = %v, %v calculated when Div32 should have panicked", q, r) +} + +func TestDiv64PanicZero(t *testing.T) { + // Expect a panic + defer func() { + if err := recover(); err == nil { + t.Error("Div64 should have panicked when y==0") + } else if e, ok := err.(runtime.Error); !ok || e.Error() != divZeroError { + t.Errorf("Div64 expected panic: %q, got: %q ", divZeroError, e.Error()) + } + }() + q, r := Div64(1, 1, 0) + t.Errorf("undefined q, r = %v, %v calculated when Div64 should have panicked", q, r) +} + func BenchmarkAdd(b *testing.B) { var z, c uint for i := 0; i < b.N; i++ { From 319787a528284aefe23424056a19bda71f7cc2b1 Mon Sep 17 00:00:00 2001 From: Brian Kessler Date: Tue, 23 Oct 2018 20:54:56 -0600 Subject: [PATCH 133/594] cmd/compile: intrinsify math/bits.Div on amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that the intrinsic implementation panics separately for overflow and divide by zero, which matches the behavior of the pure go implementation. There is a modest performance improvement after intrinsic implementation. name old time/op new time/op delta Div-4 53.0ns ± 1% 47.0ns ± 0% -11.28% (p=0.008 n=5+5) Div32-4 18.4ns ± 0% 18.5ns ± 1% ~ (p=0.444 n=5+5) Div64-4 53.3ns ± 0% 47.5ns ± 4% -10.77% (p=0.008 n=5+5) Updates #28273 Change-Id: Ic1688ecc0964acace2e91bf44ef16f5fb6b6bc82 Reviewed-on: https://go-review.googlesource.com/c/144378 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/go.go | 1 + src/cmd/compile/internal/gc/ssa.go | 14 ++++++++++++-- test/codegen/mathbits.go | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go index cb76398629742..c5ff8b6dbe865 100644 --- a/src/cmd/compile/internal/gc/go.go +++ b/src/cmd/compile/internal/gc/go.go @@ -300,6 +300,7 @@ var ( panicdottypeI, panicindex, panicnildottype, + panicoverflow, panicslice, raceread, racereadrange, diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index e0b4b40323215..51fd589db99f3 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -82,6 +82,7 @@ func initssaconfig() { panicdottypeI = sysfunc("panicdottypeI") panicindex = sysfunc("panicindex") panicnildottype = sysfunc("panicnildottype") + panicoverflow = sysfunc("panicoverflow") panicslice = sysfunc("panicslice") raceread = sysfunc("raceread") racereadrange = sysfunc("racereadrange") @@ -3487,20 +3488,29 @@ func init() { }, sys.AMD64, sys.ARM64, sys.PPC64) alias("math/bits", "Mul", "math/bits", "Mul64", sys.ArchAMD64, sys.ArchARM64, sys.ArchPPC64) - addF("math/bits", "Add64", func(s *state, n *Node, args []*ssa.Value) *ssa.Value { return s.newValue3(ssa.OpAdd64carry, types.NewTuple(types.Types[TUINT64], types.Types[TUINT64]), args[0], args[1], args[2]) }, sys.AMD64) alias("math/bits", "Add", "math/bits", "Add64", sys.ArchAMD64) - addF("math/bits", "Sub64", func(s *state, n *Node, args []*ssa.Value) *ssa.Value { return s.newValue3(ssa.OpSub64borrow, types.NewTuple(types.Types[TUINT64], types.Types[TUINT64]), args[0], args[1], args[2]) }, sys.AMD64) alias("math/bits", "Sub", "math/bits", "Sub64", sys.ArchAMD64) + addF("math/bits", "Div64", + func(s *state, n *Node, args []*ssa.Value) *ssa.Value { + // check for divide-by-zero/overflow and panic with appropriate message + cmpZero := s.newValue2(s.ssaOp(ONE, types.Types[TUINT64]), types.Types[TBOOL], args[2], s.zeroVal(types.Types[TUINT64])) + s.check(cmpZero, panicdivide) + cmpOverflow := s.newValue2(s.ssaOp(OLT, types.Types[TUINT64]), types.Types[TBOOL], args[0], args[2]) + s.check(cmpOverflow, panicoverflow) + return s.newValue3(ssa.OpDiv128u, types.NewTuple(types.Types[TUINT64], types.Types[TUINT64]), args[0], args[1], args[2]) + }, + sys.AMD64) + alias("math/bits", "Div", "math/bits", "Div64", sys.ArchAMD64) /******** sync/atomic ********/ diff --git a/test/codegen/mathbits.go b/test/codegen/mathbits.go index 85d5bdea331bf..44ab2c02b7578 100644 --- a/test/codegen/mathbits.go +++ b/test/codegen/mathbits.go @@ -465,3 +465,17 @@ func Mul64(x, y uint64) (hi, lo uint64) { // ppc64le:"MULHDU","MULLD" return bits.Mul64(x, y) } + +// --------------- // +// bits.Div* // +// --------------- // + +func Div(hi, lo, x uint) (q, r uint) { + // amd64:"DIVQ" + return bits.Div(hi, lo, x) +} + +func Div64(hi, lo, x uint64) (q, r uint64) { + // amd64:"DIVQ" + return bits.Div64(hi, lo, x) +} From 979d9027aecf265214a6dcc27fe037bfd70355f2 Mon Sep 17 00:00:00 2001 From: Brian Kessler Date: Tue, 13 Nov 2018 22:51:21 -0700 Subject: [PATCH 134/594] math/bits: define Div to panic when y<=hi Div panics when y<=hi because either the quotient overflows the size of the output or division by zero occurs when y==0. This provides a uniform behavior for all implementations. Fixes #28316 Change-Id: If23aeb10e0709ee1a60b7d614afc9103d674a980 Reviewed-on: https://go-review.googlesource.com/c/149517 Reviewed-by: Robert Griesemer --- src/math/bits/bits.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/math/bits/bits.go b/src/math/bits/bits.go index fbf4966157391..9da1c6e580a99 100644 --- a/src/math/bits/bits.go +++ b/src/math/bits/bits.go @@ -454,8 +454,7 @@ func Mul64(x, y uint64) (hi, lo uint64) { // Div returns the quotient and remainder of (hi, lo) divided by y: // quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper // half in parameter hi and the lower half in parameter lo. -// hi must be < y otherwise the behavior is undefined (the quotient -// won't fit into quo). +// Div panics for y == 0 (division by zero) or y <= hi (quotient overflow). func Div(hi, lo, y uint) (quo, rem uint) { if UintSize == 32 { q, r := Div32(uint32(hi), uint32(lo), uint32(y)) @@ -468,8 +467,7 @@ func Div(hi, lo, y uint) (quo, rem uint) { // Div32 returns the quotient and remainder of (hi, lo) divided by y: // quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper // half in parameter hi and the lower half in parameter lo. -// hi must be < y otherwise the behavior is undefined (the quotient -// won't fit into quo). +// Div32 panics for y == 0 (division by zero) or y <= hi (quotient overflow). func Div32(hi, lo, y uint32) (quo, rem uint32) { if y != 0 && y <= hi { panic(overflowError) @@ -482,8 +480,7 @@ func Div32(hi, lo, y uint32) (quo, rem uint32) { // Div64 returns the quotient and remainder of (hi, lo) divided by y: // quo = (hi, lo)/y, rem = (hi, lo)%y with the dividend bits' upper // half in parameter hi and the lower half in parameter lo. -// hi must be < y otherwise the behavior is undefined (the quotient -// won't fit into quo). +// Div64 panics for y == 0 (division by zero) or y <= hi (quotient overflow). func Div64(hi, lo, y uint64) (quo, rem uint64) { const ( two32 = 1 << 32 From 440368da526b69fe9a500e29ce9cd84aa7cc6c35 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 10 Oct 2018 10:03:27 -0400 Subject: [PATCH 135/594] cmd/go/internal/imports: resolve symlinks in ScanDir We were using the mode reported by ReadDir to decide whether each entry is a file, but in the case of symlinks that isn't sufficient: a symlink could point to either a file or a directory, and if it is a file we should treat it as such. Fixes #28107 Change-Id: Icf6e495dce427a7b1124c9cc9f085e40a215c169 Reviewed-on: https://go-review.googlesource.com/c/141097 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/imports/scan.go | 10 ++++++++++ src/cmd/go/testdata/script/mod_symlink.txt | 23 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/cmd/go/testdata/script/mod_symlink.txt diff --git a/src/cmd/go/internal/imports/scan.go b/src/cmd/go/internal/imports/scan.go index d944e95724e54..966a38cfef3ad 100644 --- a/src/cmd/go/internal/imports/scan.go +++ b/src/cmd/go/internal/imports/scan.go @@ -22,6 +22,16 @@ func ScanDir(dir string, tags map[string]bool) ([]string, []string, error) { var files []string for _, info := range infos { name := info.Name() + + // If the directory entry is a symlink, stat it to obtain the info for the + // link target instead of the link itself. + if info.Mode()&os.ModeSymlink != 0 { + info, err = os.Stat(name) + if err != nil { + continue // Ignore broken symlinks. + } + } + if info.Mode().IsRegular() && !strings.HasPrefix(name, "_") && strings.HasSuffix(name, ".go") && MatchFile(name, tags) { files = append(files, filepath.Join(dir, name)) } diff --git a/src/cmd/go/testdata/script/mod_symlink.txt b/src/cmd/go/testdata/script/mod_symlink.txt new file mode 100644 index 0000000000000..61da3cc35580b --- /dev/null +++ b/src/cmd/go/testdata/script/mod_symlink.txt @@ -0,0 +1,23 @@ +env GO111MODULE=on +[!symlink] skip + +# 'go list' should resolve modules of imported packages. +go list -deps -f '{{.Module}}' +stdout golang.org/x/text + +# They should continue to resolve if the importing file is a symlink. +mkdir links +cd links +symlink go.mod -> ../go.mod +symlink issue.go -> ../issue.go + +go list -deps -f '{{.Module}}' +stdout golang.org/x/text + +-- go.mod -- +module golang.org/issue/28107 + +-- issue.go -- +package issue + +import _ "golang.org/x/text/language" From 41fd4c88ad900765716d17c14eb1b48b553589e2 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 24 Nov 2018 18:02:29 +1100 Subject: [PATCH 136/594] cmd/link: do not use _GLOBAL_OFFSET_TABLE_ on windows/386 When building windows/386 executable that imports "plugin" package, cmd/link adds reference to DLL with blank name. Running objdump -x a.exe reports ... The Import Tables (interpreted .idata section contents) ... DLL Name: vma: Hint/Ord Member-Name Bound-To 25308a 0 _GLOBAL_OFFSET_TABLE_ ... So, obviously, executable cannot run, because Windows complains that it cannot find DLL when trying to run it. Stop using _GLOBAL_OFFSET_TABLE_ on windows/386. Fixes #28789 Change-Id: Idd489eafd998f6e329f40c5d90a2a8965ab1d873 Reviewed-on: https://go-review.googlesource.com/c/151139 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/lib.go | 4 ++-- src/plugin/plugin_test.go | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/plugin/plugin_test.go diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 3038b7957444b..458d7a43175d0 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -588,8 +588,8 @@ func (ctxt *Link) loadlib() { } } - if ctxt.Arch == sys.Arch386 { - if (ctxt.BuildMode == BuildModeCArchive && ctxt.IsELF) || (ctxt.BuildMode == BuildModeCShared && ctxt.HeadType != objabi.Hwindows) || ctxt.BuildMode == BuildModePIE || ctxt.DynlinkingGo() { + if ctxt.Arch == sys.Arch386 && ctxt.HeadType != objabi.Hwindows { + if (ctxt.BuildMode == BuildModeCArchive && ctxt.IsELF) || ctxt.BuildMode == BuildModeCShared || ctxt.BuildMode == BuildModePIE || ctxt.DynlinkingGo() { got := ctxt.Syms.Lookup("_GLOBAL_OFFSET_TABLE_", 0) got.Type = sym.SDYNIMPORT got.Attr |= sym.AttrReachable diff --git a/src/plugin/plugin_test.go b/src/plugin/plugin_test.go new file mode 100644 index 0000000000000..6dfe14854c30f --- /dev/null +++ b/src/plugin/plugin_test.go @@ -0,0 +1,17 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !nacl + +package plugin_test + +import ( + _ "plugin" + "testing" +) + +func TestPlugin(t *testing.T) { + // This test makes sure that executable that imports plugin + // package can actually run. See issue #28789 for details. +} From 22dbc96d8a004bb78a0efd329d0f48b6f0a8b9e5 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Tue, 27 Nov 2018 20:01:50 +1100 Subject: [PATCH 137/594] debug/pe: correct TestImportTableInUnknownSection error message TestImportTableInUnknownSection uses kernel32.dll file, but the error message mentions atmfd.dll. Adjust error message to match the test. This change should have been part of CL 151137. Updates #27904 Change-Id: Ifc31a12134b328472191122f8426ab6ed234fbd4 Reviewed-on: https://go-review.googlesource.com/c/151477 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- src/debug/pe/file_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/debug/pe/file_test.go b/src/debug/pe/file_test.go index 79c2241eb7dd2..5b9fe521d2579 100644 --- a/src/debug/pe/file_test.go +++ b/src/debug/pe/file_test.go @@ -605,9 +605,10 @@ func TestImportTableInUnknownSection(t *testing.T) { // kernel32.dll import table is located in ".rdata" section, // so it is good enough to test issue #16103. - path, err := exec.LookPath("kernel32.dll") + const filename = "kernel32.dll" + path, err := exec.LookPath(filename) if err != nil { - t.Fatalf("unable to locate required file %q in search path: %s", "atmfd.dll", err) + t.Fatalf("unable to locate required file %q in search path: %s", filename, err) } f, err := Open(path) From cfac65bf2fc103411aab9d6913c777f5e78e065a Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 27 Nov 2018 16:07:14 +0100 Subject: [PATCH 138/594] cmd/link/internal/ld: omit deprecated linker argument for iOS builds After CL 151139 introduced a plugin test, the macOS linker for iOS outputs: ld: warning: -flat_namespace is deprecated on iOS Omit the -flat_namespace flag on iOS; plugins are not supported on iOS, and unlikely to ever be. Change-Id: I2d08f8b984efcfd442d572b4a0f3a2c95c551b9f Reviewed-on: https://go-review.googlesource.com/c/151300 Run-TryBot: Elias Naur Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/lib.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 458d7a43175d0..9b04e3ce11113 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1122,7 +1122,7 @@ func (ctxt *Link) hostlink() { switch ctxt.HeadType { case objabi.Hdarwin: argv = append(argv, "-Wl,-headerpad,1144") - if ctxt.DynlinkingGo() { + if ctxt.DynlinkingGo() && !ctxt.Arch.InFamily(sys.ARM, sys.ARM64) { argv = append(argv, "-Wl,-flat_namespace") } if ctxt.BuildMode == BuildModeExe && !ctxt.Arch.InFamily(sys.ARM64) { From 5680874e0c633e368b40ccc9534e5125375d89cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Mon, 26 Nov 2018 16:11:18 +0100 Subject: [PATCH 139/594] test: fix nilptr5 for AIX This commit fixes a mistake made in CL 144538. This nilcheck can be removed because OpPPC64LoweredMove will fault if arg0 is nil, as it's used to store. Further information can be found in cmd/compile/internal/ssa/nilcheck.go. Change-Id: Ifec0080c00eb1f94a8c02f8bf60b93308e71b119 Reviewed-on: https://go-review.googlesource.com/c/151298 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- test/nilptr5_aix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/nilptr5_aix.go b/test/nilptr5_aix.go index ff6900593b8a3..142780718b528 100644 --- a/test/nilptr5_aix.go +++ b/test/nilptr5_aix.go @@ -23,7 +23,7 @@ type T [29]byte func f6(p, q *T) { x := *p // ERROR "generated nil check" - *q = x // ERROR "generated nil check" + *q = x // ERROR "removed nil check" } // make sure to remove nil check for memory move (issue #18003) From 0b79dde1128462963db740efd3c9ed98eda2735e Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 29 Oct 2018 15:14:39 -0700 Subject: [PATCH 140/594] cmd/compile: don't use CMOV ops to compute load addresses We want to issue loads as soon as possible, especially when they are going to miss in the cache. Using a conditional move (CMOV) here: i := ... if cond { i++ } ... = a[i] means that we have to wait for cond to be computed before the load is issued. Without a CMOV, if the branch is predicted correctly the load can be issued in parallel with computing cond. Even if the branch is predicted incorrectly, maybe the speculative load is close to the real load, and we get a prefetch for free. In the worst case, when the prediction is wrong and the address is way off, we only lose by the time difference between the CMOV latency (~2 cycles) and the mispredict restart latency (~15 cycles). We only squash CMOVs that affect load addresses. Results of CMOVs that are used for other things (store addresses, store values) we use as before. Fixes #26306 Change-Id: I82ca14b664bf05e1d45e58de8c4d9c775a127ca1 Reviewed-on: https://go-review.googlesource.com/c/145717 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Josh Bleecher Snyder --- src/cmd/compile/internal/ssa/branchelim.go | 63 +++++++++++++++++++--- test/codegen/condmove.go | 17 ++++++ 2 files changed, 74 insertions(+), 6 deletions(-) diff --git a/src/cmd/compile/internal/ssa/branchelim.go b/src/cmd/compile/internal/ssa/branchelim.go index d9dcaf844430d..55430e8afc563 100644 --- a/src/cmd/compile/internal/ssa/branchelim.go +++ b/src/cmd/compile/internal/ssa/branchelim.go @@ -26,16 +26,61 @@ func branchelim(f *Func) { return } + // Find all the values used in computing the address of any load. + // Typically these values have operations like AddPtr, Lsh64x64, etc. + loadAddr := f.newSparseSet(f.NumValues()) + defer f.retSparseSet(loadAddr) + for _, b := range f.Blocks { + for _, v := range b.Values { + switch v.Op { + case OpLoad, OpAtomicLoad32, OpAtomicLoad64, OpAtomicLoadPtr, OpAtomicLoadAcq32: + loadAddr.add(v.Args[0].ID) + case OpMove: + loadAddr.add(v.Args[1].ID) + } + } + } + po := f.postorder() + for { + n := loadAddr.size() + for _, b := range po { + for i := len(b.Values) - 1; i >= 0; i-- { + v := b.Values[i] + if !loadAddr.contains(v.ID) { + continue + } + for _, a := range v.Args { + if a.Type.IsInteger() || a.Type.IsPtr() || a.Type.IsUnsafePtr() { + loadAddr.add(a.ID) + } + } + } + } + if loadAddr.size() == n { + break + } + } + change := true for change { change = false for _, b := range f.Blocks { - change = elimIf(f, b) || elimIfElse(f, b) || change + change = elimIf(f, loadAddr, b) || elimIfElse(f, loadAddr, b) || change } } } -func canCondSelect(v *Value, arch string) bool { +func canCondSelect(v *Value, arch string, loadAddr *sparseSet) bool { + if loadAddr.contains(v.ID) { + // The result of the soon-to-be conditional move is used to compute a load address. + // We want to avoid generating a conditional move in this case + // because the load address would now be data-dependent on the condition. + // Previously it would only be control-dependent on the condition, which is faster + // if the branch predicts well (or possibly even if it doesn't, if the load will + // be an expensive cache miss). + // See issue #26306. + return false + } // For now, stick to simple scalars that fit in registers switch { case v.Type.Size() > v.Block.Func.Config.RegSize: @@ -53,7 +98,10 @@ func canCondSelect(v *Value, arch string) bool { } } -func elimIf(f *Func, dom *Block) bool { +// elimIf converts the one-way branch starting at dom in f to a conditional move if possible. +// loadAddr is a set of values which are used to compute the address of a load. +// Those values are exempt from CMOV generation. +func elimIf(f *Func, loadAddr *sparseSet, dom *Block) bool { // See if dom is an If with one arm that // is trivial and succeeded by the other // successor of dom. @@ -83,7 +131,7 @@ func elimIf(f *Func, dom *Block) bool { for _, v := range post.Values { if v.Op == OpPhi { hasphis = true - if !canCondSelect(v, f.Config.arch) { + if !canCondSelect(v, f.Config.arch, loadAddr) { return false } } @@ -158,7 +206,10 @@ func clobberBlock(b *Block) { b.Kind = BlockInvalid } -func elimIfElse(f *Func, b *Block) bool { +// elimIfElse converts the two-way branch starting at dom in f to a conditional move if possible. +// loadAddr is a set of values which are used to compute the address of a load. +// Those values are exempt from CMOV generation. +func elimIfElse(f *Func, loadAddr *sparseSet, b *Block) bool { // See if 'b' ends in an if/else: it should // have two successors, both of which are BlockPlain // and succeeded by the same block. @@ -184,7 +235,7 @@ func elimIfElse(f *Func, b *Block) bool { for _, v := range post.Values { if v.Op == OpPhi { hasphis = true - if !canCondSelect(v, f.Config.arch) { + if !canCondSelect(v, f.Config.arch, loadAddr) { return false } } diff --git a/test/codegen/condmove.go b/test/codegen/condmove.go index 32039c16ae3f6..aa82d43f4981e 100644 --- a/test/codegen/condmove.go +++ b/test/codegen/condmove.go @@ -180,3 +180,20 @@ func cmovinvert6(x, y uint64) uint64 { // amd64:"CMOVQLS" return y } + +func cmovload(a []int, i int, b bool) int { + if b { + i++ + } + // See issue 26306 + // amd64:-"CMOVQNE" + return a[i] +} + +func cmovstore(a []int, i int, b bool) { + if b { + i++ + } + // amd64:"CMOVQNE" + a[i] = 7 +} From 7d7e839a76227db321761ca7ca882429f30f39f9 Mon Sep 17 00:00:00 2001 From: David Tolpin Date: Tue, 27 Nov 2018 00:17:32 +0000 Subject: [PATCH 141/594] go/printer: print parenthesized declarations if len(d.Specs) > 1 Parenthesized declaration must be printed if len(d.Specs) > 1 even if d.Lparen==token.NoPos. This happens if the node tree is created programmatically. Otherwise, all but the first specifications just silently disappear from the output. Change-Id: I17ab24bb1cd56fe1e611199698535ca60a97f5ea GitHub-Last-Rev: 2f168dc7ad4a29149685efc70f180987523271e4 GitHub-Pull-Request: golang/go#28533 Reviewed-on: https://go-review.googlesource.com/c/146657 Run-TryBot: Robert Griesemer Reviewed-by: Robert Griesemer --- src/go/printer/nodes.go | 2 +- src/go/printer/printer_test.go | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/go/printer/nodes.go b/src/go/printer/nodes.go index a307d8395e9d9..d22f865652246 100644 --- a/src/go/printer/nodes.go +++ b/src/go/printer/nodes.go @@ -1537,7 +1537,7 @@ func (p *printer) genDecl(d *ast.GenDecl) { p.setComment(d.Doc) p.print(d.Pos(), d.Tok, blank) - if d.Lparen.IsValid() { + if d.Lparen.IsValid() || len(d.Specs) > 1 { // group of parenthesized declarations p.print(d.Lparen, token.LPAREN) if n := len(d.Specs); n > 0 { diff --git a/src/go/printer/printer_test.go b/src/go/printer/printer_test.go index 27d46df6b186b..91eca585c0956 100644 --- a/src/go/printer/printer_test.go +++ b/src/go/printer/printer_test.go @@ -736,3 +736,35 @@ func TestIssue11151(t *testing.T) { t.Errorf("%v\norig: %q\ngot : %q", err, src, got) } } + +// If a declaration has multiple specifications, a parenthesized +// declaration must be printed even if Lparen is token.NoPos. +func TestParenthesizedDecl(t *testing.T) { + // a package with multiple specs in a single declaration + const src = "package p; var ( a float64; b int )" + fset := token.NewFileSet() + f, err := parser.ParseFile(fset, "", src, 0) + + // print the original package + var buf bytes.Buffer + err = Fprint(&buf, fset, f) + if err != nil { + t.Fatal(err) + } + original := buf.String() + + // now remove parentheses from the declaration + for i := 0; i != len(f.Decls); i++ { + f.Decls[i].(*ast.GenDecl).Lparen = token.NoPos + } + buf.Reset() + err = Fprint(&buf, fset, f) + if err != nil { + t.Fatal(err) + } + noparen := buf.String() + + if noparen != original { + t.Errorf("got %q, want %q", noparen, original) + } +} From b41cdc4a591b19e09c09f062e785f2b7af06863d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 23 Nov 2018 13:29:59 +0100 Subject: [PATCH 142/594] cmd/link: improve XCOFF dynamic symbols generation This commit fixes and improves the generation of dynamic symbols for XCOFF files. This mainly adds for every dynamic symbols a new symbol named s.Extname(). Change-Id: I5b788f076d9a05e5d42f08eb1a74fd3e3efa9a86 Reviewed-on: https://go-review.googlesource.com/c/151038 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/data.go | 8 +- src/cmd/link/internal/ld/go.go | 3 - src/cmd/link/internal/ld/xcoff.go | 215 +++++++++++++++++++---------- src/cmd/link/internal/ppc64/asm.go | 8 ++ 4 files changed, 154 insertions(+), 80 deletions(-) diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index 367842e0c6e65..39746f5a4f0ec 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -175,8 +175,8 @@ func relocsym(ctxt *Link, s *sym.Symbol) { } // We need to be able to reference dynimport symbols when linking against - // shared libraries, and Solaris and Darwin need it always - if ctxt.HeadType != objabi.Hsolaris && ctxt.HeadType != objabi.Hdarwin && r.Sym != nil && r.Sym.Type == sym.SDYNIMPORT && !ctxt.DynlinkingGo() && !r.Sym.Attr.SubSymbol() { + // shared libraries, and Solaris, Darwin and AIX need it always + if ctxt.HeadType != objabi.Hsolaris && ctxt.HeadType != objabi.Hdarwin && ctxt.HeadType != objabi.Haix && r.Sym != nil && r.Sym.Type == sym.SDYNIMPORT && !ctxt.DynlinkingGo() && !r.Sym.Attr.SubSymbol() { if !(ctxt.Arch.Family == sys.PPC64 && ctxt.LinkMode == LinkExternal && r.Sym.Name == ".TOC.") { Errorf(s, "unhandled relocation for %s (type %d (%s) rtype %d (%s))", r.Sym.Name, r.Sym.Type, r.Sym.Type, r.Type, sym.RelocName(ctxt.Arch, r.Type)) } @@ -318,11 +318,11 @@ func relocsym(ctxt *Link, s *sym.Symbol) { // must be done by the loader, as the section .data will be moved. // The "default" symbol address is still needed by the loader so // the current relocation can't be skipped. - if ctxt.HeadType == objabi.Haix && r.Sym.Sect.Seg == &Segdata { + if ctxt.HeadType == objabi.Haix && r.Sym.Type != sym.SDYNIMPORT && r.Sym.Sect.Seg == &Segdata { // It's not possible to make a loader relocation to a DWARF section. // FIXME if s.Sect.Seg != &Segdwarf { - xcoffaddloaderreloc(ctxt, s, r) + Xcoffadddynrel(ctxt, s, r) } } diff --git a/src/cmd/link/internal/ld/go.go b/src/cmd/link/internal/ld/go.go index c942956cc47e3..80d7ac32f524b 100644 --- a/src/cmd/link/internal/ld/go.go +++ b/src/cmd/link/internal/ld/go.go @@ -174,9 +174,6 @@ func loadcgo(ctxt *Link, file string, pkg string, p string) { } havedynamic = 1 } - if ctxt.HeadType == objabi.Haix { - xcoffadddynimpsym(ctxt, s) - } continue diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index d04065851d358..e77e2d8b80876 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -316,6 +316,12 @@ type XcoffLdSym64 struct { Lparm uint32 // Parameter type-check field } +type xcoffLoaderSymbol struct { + sym *sym.Symbol + smtype int8 + smclas int8 +} + type XcoffLdImportFile64 struct { Limpidpath string Limpidbase string @@ -354,11 +360,11 @@ type xcoffFile struct { stringTable xcoffStringTable sectNameToScnum map[string]int16 loaderSize uint64 - symtabOffset int64 // offset to the start of symbol table - symbolCount uint32 // number of symbol table records written - dynLibraries map[string]int // Dynamic libraries in .loader section. The integer represents its import file number (- 1) - dynSymbols []*sym.Symbol // Dynamic symbols in .loader section - loaderReloc []*xcoffLoaderReloc // Reloc that must be made inside loader + symtabOffset int64 // offset to the start of symbol table + symbolCount uint32 // number of symbol table records written + dynLibraries map[string]int // Dynamic libraries in .loader section. The integer represents its import file number (- 1) + loaderSymbols []*xcoffLoaderSymbol // symbols inside .loader symbol table + loaderReloc []*xcoffLoaderReloc // Reloc that must be made inside loader } // Those values will latter be computed in XcoffInit @@ -796,7 +802,33 @@ func putaixsym(ctxt *Link, x *sym.Symbol, str string, t SymbolType, addr int64, syms = append(syms, a4) + case UndefinedSym: + if x.Type != sym.SDYNIMPORT && x.Type != sym.SHOSTOBJ { + return + } + s := &XcoffSymEnt64{ + Nsclass: C_EXT, + Noffset: uint32(xfile.stringTable.add(str)), + Nnumaux: 1, + } + syms = append(syms, s) + + a4 := &XcoffAuxCSect64{ + Xauxtype: _AUX_CSECT, + Xsmclas: XMC_DS, + Xsmtyp: XTY_ER | XTY_IMP, + } + + if x.Name == "__n_pthreads" { + // Currently, all imported symbols made by cgo_import_dynamic are + // syscall functions, except __n_pthreads which is a variable. + // TODO(aix): Find a way to detect variables imported by cgo. + a4.Xsmclas = XMC_RW + } + + syms = append(syms, a4) } + for _, s := range syms { xfile.writeSymbol(ctxt.Out, ctxt.Arch.ByteOrder, s) } @@ -814,18 +846,32 @@ func (f *xcoffFile) asmaixsym(ctxt *Link) { xfile.stringTable.write(ctxt.Out) } -// xcoffadddynimpsym adds a dynamic symbol to a XCOFF file -func xcoffadddynimpsym(ctxt *Link, s *sym.Symbol) { - xfile.adddynimpsym(ctxt, s) +func (f *xcoffFile) genDynSym(ctxt *Link) { + var dynsyms []*sym.Symbol + for _, s := range ctxt.Syms.Allsym { + if s.Type != sym.SHOSTOBJ && s.Type != sym.SDYNIMPORT { + continue + } + dynsyms = append(dynsyms, s) + } + + for _, s := range dynsyms { + f.adddynimpsym(ctxt, s) + + if _, ok := f.dynLibraries[s.Dynimplib()]; !ok { + f.dynLibraries[s.Dynimplib()] = len(f.dynLibraries) + } + + } + } -// Add a new imported symbol and a new library if needed. -// Currently, dynamic symbols are considered as .data symbols which will receive -// their value by the loader. Their relocation is created during the creation -// of the .loader section, because it needs its symbol index. +// (*xcoffFile)adddynimpsym adds the dynamic symbol "s" to a XCOFF file. +// A new symbol named s.Extname() is created to be the actual dynamic symbol +// in the .loader section and in the symbol table as an External Reference. +// The symbol "s" is transformed to SXCOFFTOC to end up in .data section. // However, there is no writing protection on those symbols and // it might need to be added. -// TODO(aix): Add writing protection. // TODO(aix): Handles dynamic symbols without library. func (f *xcoffFile) adddynimpsym(ctxt *Link, s *sym.Symbol) { // Check that library name is given. @@ -834,26 +880,42 @@ func (f *xcoffFile) adddynimpsym(ctxt *Link, s *sym.Symbol) { Errorf(s, "imported symbol must have a given library") } - for _, sf := range f.dynSymbols { - if sf == s { - return - } - } - - f.dynSymbols = append(f.dynSymbols, s) s.Type = sym.SXCOFFTOC - // Function descriptor value - s.AddUint64(ctxt.Arch, 0) - if _, ok := f.dynLibraries[s.Dynimplib()]; !ok { - f.dynLibraries[s.Dynimplib()] = len(f.dynLibraries) + // Create new dynamic symbol + extsym := ctxt.Syms.Lookup(s.Extname(), 0) + extsym.Type = sym.SDYNIMPORT + extsym.Attr |= sym.AttrReachable + extsym.SetDynimplib(s.Dynimplib()) + extsym.SetExtname(s.Extname()) + extsym.SetDynimpvers(s.Dynimpvers()) + + // Add loader symbol + lds := &xcoffLoaderSymbol{ + sym: extsym, + smtype: XTY_IMP, + smclas: XMC_DS, + } + if s.Name == "__n_pthreads" { + // Currently, all imported symbols made by cgo_import_dynamic are + // syscall functions, except __n_pthreads which is a variable. + // TODO(aix): Find a way to detect variables imported by cgo. + lds.smclas = XMC_RW } + f.loaderSymbols = append(f.loaderSymbols, lds) + + // Relocation to retrieve the external address + s.AddBytes(make([]byte, 8)) + s.SetAddr(ctxt.Arch, 0, extsym) + } -// Add a relocation to .loader relocation section -func xcoffaddloaderreloc(ctxt *Link, s *sym.Symbol, r *sym.Reloc) { +// Xcoffadddynrel adds a dynamic relocation in a XCOFF file. +// This relocation will be made by the loader. +func Xcoffadddynrel(ctxt *Link, s *sym.Symbol, r *sym.Reloc) bool { if s.Type <= sym.SPCLNTAB && r.Sym.Type >= sym.SELFSECT && r.Sym.Type <= sym.SXREF { Errorf(s, "cannot have a relocation in a text section with a data symbol: %s ", r.Sym.Name) + return false } ldr := &xcoffLoaderReloc{ @@ -862,19 +924,39 @@ func xcoffaddloaderreloc(ctxt *Link, s *sym.Symbol, r *sym.Reloc) { } switch r.Type { - case objabi.R_ADDR: - // Relocation of a .data symbol - ldr.rtype = 0x3F<<8 + XCOFF_R_POS - ldr.symndx = 1 // .data default: Errorf(s, "unexpected .loader relocation to symbol: %s (type: %s)", r.Sym.Name, r.Type.String()) + return false + case objabi.R_ADDR: + if s.Type == sym.SXCOFFTOC && r.Sym.Type == sym.SDYNIMPORT { + // Imported symbol relocation + for i, dynsym := range xfile.loaderSymbols { + if dynsym.sym.Name == r.Sym.Name { + ldr.symndx = int32(i + 3) // +3 because of 3 section symbols + break + } + } + } else if s.Type == sym.SDATA && r.Sym.Type >= sym.SELFSECT && r.Sym.Type <= sym.SXREF { + // .data to .data relocation + ldr.symndx = 1 // .data + } else { + Errorf(s, "unexpected type for .loader relocation R_ADDR for symbol %s: %s to %s", r.Sym.Name, s.Type, r.Sym.Type) + return false + } + + ldr.rtype = 0x3F<<8 + XCOFF_R_POS } xfile.loaderReloc = append(xfile.loaderReloc, ldr) - + return true } func (ctxt *Link) doxcoff() { + if *FlagD { + // All XCOFF files have dynamic symbols because of the syscalls. + Exitf("-d is not available on AIX") + } + // Initial map used to store compilation unit size for each DWARF section (see dwarf.go). dwsectCUSize = make(map[string]uint64) @@ -914,6 +996,19 @@ func (ctxt *Link) doxcoff() { break } } + + // Add entry point to .loader symbols. + ep := ctxt.Syms.ROLookup(*flagEntrySymbol, 0) + if !ep.Attr.Reachable() { + Exitf("wrong entry point") + } + xfile.loaderSymbols = append(xfile.loaderSymbols, &xcoffLoaderSymbol{ + sym: ep, + smtype: XTY_ENT | XTY_SD, + smclas: XMC_DS, + }) + + xfile.genDynSym(ctxt) } // Loader section @@ -943,56 +1038,29 @@ func (f *xcoffFile) writeLdrScn(ctxt *Link, globalOff uint64) { } /* Symbol table */ - // Entry point symbol - ep := ctxt.Syms.ROLookup(*flagEntrySymbol, 0) - if !ep.Attr.Reachable() { - Exitf("wrong entry point") - } - lds := &XcoffLdSym64{ - Lvalue: uint64(ep.Value), - Loffset: uint32(stlen + 2), // +2 because it must have the first byte of the symbol not its size field - Lscnum: f.getXCOFFscnum(ep.Sect), - Lsmtype: XTY_ENT | XTY_SD, - Lsmclas: XMC_DS, - Lifile: 0, - Lparm: 0, - } - ldstr := &XcoffLdStr64{ - size: uint16(len(ep.String()) + 1), // + null terminator - name: ep.String(), - } - stlen += uint32(2 + ldstr.size) // 2 = sizeof ldstr.size - symtab = append(symtab, lds) - strtab = append(strtab, ldstr) - - nbldsym := int32(4) - - // dynamic import - for _, s := range f.dynSymbols { - lds = &XcoffLdSym64{ + for _, s := range f.loaderSymbols { + lds := &XcoffLdSym64{ Loffset: uint32(stlen + 2), - Lsmtype: XTY_IMP, - Lsmclas: XMC_DS, - Lifile: int32(f.dynLibraries[s.Dynimplib()] + 1), + Lsmtype: s.smtype, + Lsmclas: s.smclas, + } + switch s.smtype { + default: + Errorf(s.sym, "unexpected loader symbol type: 0x%x", s.smtype) + case XTY_ENT | XTY_SD: + lds.Lvalue = uint64(s.sym.Value) + lds.Lscnum = f.getXCOFFscnum(s.sym.Sect) + case XTY_IMP: + lds.Lifile = int32(f.dynLibraries[s.sym.Dynimplib()] + 1) } ldstr := &XcoffLdStr64{ - size: uint16(len(s.Extname()) + 1), // + null terminator - name: s.Extname(), + size: uint16(len(s.sym.Name) + 1), // + null terminator + name: s.sym.Name, } stlen += uint32(2 + ldstr.size) // 2 = sizeof ldstr.size symtab = append(symtab, lds) strtab = append(strtab, ldstr) - // Create relocation entry at the same moment to get symndx - ldr := &XcoffLdRel64{ - Lvaddr: uint64(s.Value), - Lrtype: 0x3F00, - Lrsecnm: f.getXCOFFscnum(s.Sect), - Lsymndx: int32(nbldsym), - } - dynimpreloc = append(dynimpreloc, ldr) - nbldsym++ - } hdr.Lnsyms = int32(len(symtab)) @@ -1000,6 +1068,7 @@ func (f *xcoffFile) writeLdrScn(ctxt *Link, globalOff uint64) { off := hdr.Lrldoff // current offset is the same of reloc offset /* Reloc */ + ep := ctxt.Syms.ROLookup(*flagEntrySymbol, 0) ldr := &XcoffLdRel64{ Lvaddr: uint64(ep.Value), Lrtype: 0x3F00, diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index a5784bc640556..4a974a546b287 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -262,6 +262,14 @@ func gencallstub(ctxt *ld.Link, abicase int, stub *sym.Symbol, targ *sym.Symbol) } func adddynrel(ctxt *ld.Link, s *sym.Symbol, r *sym.Reloc) bool { + if ctxt.IsELF { + return addelfdynrel(ctxt, s, r) + } else if ctxt.HeadType == objabi.Haix { + return ld.Xcoffadddynrel(ctxt, s, r) + } + return false +} +func addelfdynrel(ctxt *ld.Link, s *sym.Symbol, r *sym.Reloc) bool { targ := r.Sym switch r.Type { From 4295ed9bef1f2b15837bdeb52766952c464f225d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 23 Nov 2018 14:20:19 +0100 Subject: [PATCH 143/594] cmd: fix symbols addressing for aix/ppc64 This commit changes the code generated for addressing symbols on AIX operating system. On AIX, every symbol accesses must be done via another symbol near the TOC, named TOC anchor or TOC entry. This TOC anchor is a pointer to the symbol address. During Progedit function, when a symbol access is detected, its instructions are modified to create a load on its TOC anchor and retrieve the symbol. Change-Id: I00cf8f49c13004bc99fa8af13d549a709320f797 Reviewed-on: https://go-review.googlesource.com/c/151039 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/internal/obj/link.go | 2 + src/cmd/internal/obj/objfile.go | 11 ++ src/cmd/internal/obj/ppc64/a.out.go | 1 + src/cmd/internal/obj/ppc64/anames9.go | 2 + src/cmd/internal/obj/ppc64/asm9.go | 28 ++++- src/cmd/internal/obj/ppc64/obj9.go | 113 ++++++++++++++++++++ src/cmd/internal/obj/util.go | 11 ++ src/cmd/link/internal/ld/data.go | 16 +-- src/cmd/link/internal/ld/xcoff.go | 29 ++++- src/cmd/link/internal/ppc64/asm.go | 37 ++++++- src/cmd/link/internal/sym/symkind.go | 2 +- src/cmd/link/internal/sym/symkind_string.go | 4 +- 12 files changed, 240 insertions(+), 16 deletions(-) diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index 2989831a0a63b..6cff335ddfab2 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -214,6 +214,8 @@ const ( // Indicates auto that was optimized away, but whose type // we want to preserve in the DWARF debug info. NAME_DELETED_AUTO + // Indicates that this is a reference to a TOC anchor. + NAME_TOCREF ) //go:generate stringer -type AddrType diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 94334d8361b5e..4fbaafe3474fc 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -98,6 +98,17 @@ func WriteObjFile(ctxt *Link, b *bufio.Writer) { w.writeRefs(s) w.addLengths(s) } + + if ctxt.Headtype == objabi.Haix { + // Data must be sorted to keep a constant order in TOC symbols. + // As they are created during Progedit, two symbols can be switched between + // two different compilations. Therefore, BuildID will be different. + // TODO: find a better place and optimize to only sort TOC symbols + SortSlice(ctxt.Data, func(i, j int) bool { + return ctxt.Data[i].Name < ctxt.Data[j].Name + }) + } + for _, s := range ctxt.Data { w.writeRefs(s) w.addLengths(s) diff --git a/src/cmd/internal/obj/ppc64/a.out.go b/src/cmd/internal/obj/ppc64/a.out.go index 3c374579ec6a9..0fd9c81039140 100644 --- a/src/cmd/internal/obj/ppc64/a.out.go +++ b/src/cmd/internal/obj/ppc64/a.out.go @@ -391,6 +391,7 @@ const ( C_GOK C_ADDR C_GOTADDR + C_TOCADDR C_TLS_LE C_TLS_IE C_TEXTSIZE diff --git a/src/cmd/internal/obj/ppc64/anames9.go b/src/cmd/internal/obj/ppc64/anames9.go index 6ec7b7b518326..4699a15d3bec9 100644 --- a/src/cmd/internal/obj/ppc64/anames9.go +++ b/src/cmd/internal/obj/ppc64/anames9.go @@ -26,6 +26,7 @@ var cnames9 = []string{ "DACON", "SBRA", "LBRA", + "LBRAPIC", "SAUTO", "LAUTO", "SEXT", @@ -42,6 +43,7 @@ var cnames9 = []string{ "GOK", "ADDR", "GOTADDR", + "TOCADDR", "TLS_LE", "TLS_IE", "TEXTSIZE", diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go index a36565c9fd463..51a9a18601347 100644 --- a/src/cmd/internal/obj/ppc64/asm9.go +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -287,6 +287,7 @@ var optab = []Optab{ {AMOVD, C_TLS_IE, C_NONE, C_NONE, C_REG, 80, 8, 0}, {AMOVD, C_GOTADDR, C_NONE, C_NONE, C_REG, 81, 8, 0}, + {AMOVD, C_TOCADDR, C_NONE, C_NONE, C_REG, 95, 8, 0}, /* load constant */ {AMOVD, C_SECON, C_NONE, C_NONE, C_REG, 3, 4, REGSB}, @@ -846,6 +847,9 @@ func (c *ctxt9) aclass(a *obj.Addr) int { case obj.NAME_GOTREF: return C_GOTADDR + case obj.NAME_TOCREF: + return C_TOCADDR + case obj.NAME_AUTO: c.instoffset = int64(c.autosize) + a.Offset if c.instoffset >= -BIG && c.instoffset < BIG { @@ -1019,7 +1023,7 @@ func (c *ctxt9) oplook(p *obj.Prog) *Optab { } } - //print("oplook %v %d %d %d %d\n", p, a1, a2, a3, a4); + // c.ctxt.Logf("oplook %v %d %d %d %d\n", p, a1, a2, a3, a4) ops := oprange[p.As&obj.AMask] c1 := &xcmp[a1] c3 := &xcmp[a3] @@ -2207,6 +2211,10 @@ func (c *ctxt9) opform(insn uint32) int { // Encode instructions and create relocation for accessing s+d according to the // instruction op with source or destination (as appropriate) register reg. func (c *ctxt9) symbolAccess(s *obj.LSym, d int64, reg int16, op uint32) (o1, o2 uint32) { + if c.ctxt.Headtype == objabi.Haix { + // Every symbol accesses must be made via a TOC anchor. + c.ctxt.Diag("symbolAccess called for %s", s.Name) + } var base uint32 form := c.opform(op) if c.ctxt.Flag_shared { @@ -3647,6 +3655,24 @@ func (c *ctxt9) asmout(p *obj.Prog, o *Optab, out []uint32) { /* operand order: RA, RB, CY, RT */ cy := int(c.regoff(p.GetFrom3())) o1 = AOP_Z23I(c.oprrr(p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), uint32(cy)) + + case 95: /* Retrieve TOC symbol */ + v := c.vregoff(&p.To) + if v != 0 { + c.ctxt.Diag("invalid offset against TOC slot %v", p) + } + + if c.opform(c.opload(p.As)) != DS_FORM { + c.ctxt.Diag("invalid form for a TOC access in %v", p) + } + + o1 = AOP_IRR(OP_ADDIS, uint32(p.To.Reg), REG_R2, 0) + o2 = AOP_IRR(c.opload(AMOVD), uint32(p.To.Reg), uint32(p.To.Reg), 0) + rel := obj.Addrel(c.cursym) + rel.Off = int32(c.pc) + rel.Siz = 8 + rel.Sym = p.From.Sym + rel.Type = objabi.R_ADDRPOWER_TOCREL_DS } out[0] = o1 diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 7a07b5058c3c1..a9928742deaa6 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -108,9 +108,122 @@ func progedit(ctxt *obj.Link, p *obj.Prog, newprog obj.ProgAlloc) { } if c.ctxt.Flag_dynlink { c.rewriteToUseGot(p) + } else if c.ctxt.Headtype == objabi.Haix { + c.rewriteToUseTOC(p) } } +// Rewrite p, if necessary, to access a symbol using its TOC anchor. +func (c *ctxt9) rewriteToUseTOC(p *obj.Prog) { + if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { + return + } + + var source *obj.Addr + if p.From.Name == obj.NAME_EXTERN || p.From.Name == obj.NAME_STATIC { + if p.From.Type == obj.TYPE_ADDR { + if p.As == ADWORD { + // ADWORD $sym doesn't need TOC anchor + return + } + if p.As != AMOVD { + c.ctxt.Diag("do not know how to handle TYPE_ADDR in %v", p) + return + } + if p.To.Type != obj.TYPE_REG { + c.ctxt.Diag("do not know how to handle LEAQ-type insn to non-register in %v", p) + return + } + } else if p.From.Type != obj.TYPE_MEM { + c.ctxt.Diag("do not know how to handle %v without TYPE_MEM", p) + return + } + source = &p.From + + } else if p.To.Name == obj.NAME_EXTERN || p.To.Name == obj.NAME_STATIC { + if p.To.Type != obj.TYPE_MEM { + c.ctxt.Diag("do not know how to handle %v without TYPE_MEM", p) + return + } + if source != nil { + c.ctxt.Diag("cannot handle symbols on both sides in %v", p) + return + } + source = &p.To + } else { + return + + } + + if source.Sym == nil { + c.ctxt.Diag("do not know how to handle nil symbol in %v", p) + return + } + + if source.Sym.Type == objabi.STLSBSS { + return + } + + // Retrieve or create the TOC anchor. + symtoc := c.ctxt.LookupInit("TOC."+source.Sym.Name, func(s *obj.LSym) { + s.Type = objabi.SDATA + s.Set(obj.AttrDuplicateOK, true) + c.ctxt.Data = append(c.ctxt.Data, s) + s.WriteAddr(c.ctxt, 0, 8, source.Sym, 0) + }) + + if source.Type == obj.TYPE_ADDR { + // MOVD $sym, Rx becomes MOVD symtoc, Rx + // MOVD $sym+, Rx becomes MOVD symtoc, Rx; ADD , Rx + p.From.Type = obj.TYPE_MEM + p.From.Sym = symtoc + p.From.Name = obj.NAME_TOCREF + + if p.From.Offset != 0 { + q := obj.Appendp(p, c.newprog) + q.As = AADD + q.From.Type = obj.TYPE_CONST + q.From.Offset = p.From.Offset + p.From.Offset = 0 + q.To = p.To + } + return + + } + + // MOVx sym, Ry becomes MOVD symtoc, REGTMP; MOVx (REGTMP), Ry + // MOVx Ry, sym becomes MOVD symtoc, REGTMP; MOVx Ry, (REGTMP) + // An addition may be inserted between the two MOVs if there is an offset. + + q := obj.Appendp(p, c.newprog) + q.As = AMOVD + q.From.Type = obj.TYPE_MEM + q.From.Sym = symtoc + q.From.Name = obj.NAME_TOCREF + q.To.Type = obj.TYPE_REG + q.To.Reg = REGTMP + + q = obj.Appendp(q, c.newprog) + q.As = p.As + q.From = p.From + q.To = p.To + if p.From.Name != obj.NAME_NONE { + q.From.Type = obj.TYPE_MEM + q.From.Reg = REGTMP + q.From.Name = obj.NAME_NONE + q.From.Sym = nil + } else if p.To.Name != obj.NAME_NONE { + q.To.Type = obj.TYPE_MEM + q.To.Reg = REGTMP + q.To.Name = obj.NAME_NONE + q.To.Sym = nil + } else { + c.ctxt.Diag("unreachable case in rewriteToUseTOC with %v", p) + } + + obj.Nopout(p) +} + // Rewrite p, if necessary, to access global data via the global offset table. func (c *ctxt9) rewriteToUseGot(p *obj.Prog) { if p.As == obj.ADUFFCOPY || p.As == obj.ADUFFZERO { diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go index da938c998a2dd..46c3d7b17bbd1 100644 --- a/src/cmd/internal/obj/util.go +++ b/src/cmd/internal/obj/util.go @@ -372,6 +372,17 @@ func Mconv(a *Addr) string { } else { str = fmt.Sprintf("%s(%s)", offConv(a.Offset), reg) } + case NAME_TOCREF: + reg := "SB" + if a.Reg != REG_NONE { + reg = Rconv(int(a.Reg)) + } + if a.Sym != nil { + str = fmt.Sprintf("%s%s(%s)", a.Sym.Name, offConv(a.Offset), reg) + } else { + str = fmt.Sprintf("%s(%s)", offConv(a.Offset), reg) + } + } return str } diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index 39746f5a4f0ec..ffa20bb637574 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -314,14 +314,18 @@ func relocsym(ctxt *Link, s *sym.Symbol) { break } - // On AIX, if a relocated symbol is in .data, a second relocation - // must be done by the loader, as the section .data will be moved. + + // On AIX, a second relocation must be done by the loader, + // as section addresses can change once loaded. // The "default" symbol address is still needed by the loader so // the current relocation can't be skipped. - if ctxt.HeadType == objabi.Haix && r.Sym.Type != sym.SDYNIMPORT && r.Sym.Sect.Seg == &Segdata { - // It's not possible to make a loader relocation to a DWARF section. - // FIXME - if s.Sect.Seg != &Segdwarf { + if ctxt.HeadType == objabi.Haix && r.Sym.Type != sym.SDYNIMPORT { + // It's not possible to make a loader relocation in a + // symbol which is not inside .data section. + // FIXME: It should be forbidden to have R_ADDR from a + // symbol which isn't in .data. However, as .text has the + // same address once loaded, this is possible. + if s.Sect.Seg == &Segdata { Xcoffadddynrel(ctxt, s, r) } } diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index e77e2d8b80876..a82bbb65dfa47 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -913,8 +913,8 @@ func (f *xcoffFile) adddynimpsym(ctxt *Link, s *sym.Symbol) { // Xcoffadddynrel adds a dynamic relocation in a XCOFF file. // This relocation will be made by the loader. func Xcoffadddynrel(ctxt *Link, s *sym.Symbol, r *sym.Reloc) bool { - if s.Type <= sym.SPCLNTAB && r.Sym.Type >= sym.SELFSECT && r.Sym.Type <= sym.SXREF { - Errorf(s, "cannot have a relocation in a text section with a data symbol: %s ", r.Sym.Name) + if s.Type <= sym.SPCLNTAB { + Errorf(s, "cannot have a relocation to %s in a text section symbol", r.Sym.Name) return false } @@ -936,9 +936,22 @@ func Xcoffadddynrel(ctxt *Link, s *sym.Symbol, r *sym.Reloc) bool { break } } - } else if s.Type == sym.SDATA && r.Sym.Type >= sym.SELFSECT && r.Sym.Type <= sym.SXREF { - // .data to .data relocation - ldr.symndx = 1 // .data + } else if s.Type == sym.SDATA { + switch r.Sym.Sect.Seg { + default: + Errorf(s, "unknown segment for .loader relocation with symbol %s", r.Sym.Name) + case &Segtext: + case &Segrodata: + ldr.symndx = 0 // .text + case &Segdata: + if r.Sym.Type == sym.SBSS || r.Sym.Type == sym.SNOPTRBSS { + ldr.symndx = 2 // .bss + } else { + ldr.symndx = 1 // .data + } + + } + } else { Errorf(s, "unexpected type for .loader relocation R_ADDR for symbol %s: %s to %s", r.Sym.Name, s.Type, r.Sym.Type) return false @@ -1009,6 +1022,12 @@ func (ctxt *Link) doxcoff() { }) xfile.genDynSym(ctxt) + + for _, s := range ctxt.Syms.Allsym { + if strings.HasPrefix(s.Name, "TOC.") { + s.Type = sym.SXCOFFTOC + } + } } // Loader section diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 4a974a546b287..4f5d8b55398bc 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -489,7 +489,40 @@ func symtoc(ctxt *ld.Link, s *sym.Symbol) int64 { return toc.Value } +func archreloctoc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { + var o1, o2 uint32 + + o1 = uint32(val >> 32) + o2 = uint32(val) + + t := ld.Symaddr(r.Sym) + r.Add - ctxt.Syms.ROLookup("TOC", 0).Value // sym addr + if t != int64(int32(t)) { + ld.Errorf(s, "TOC relocation for %s is too big to relocate %s: 0x%x", s.Name, r.Sym, t) + } + + if t&0x8000 != 0 { + t += 0x10000 + } + + o1 |= uint32((t >> 16) & 0xFFFF) + + switch r.Type { + case objabi.R_ADDRPOWER_TOCREL_DS: + if t&3 != 0 { + ld.Errorf(s, "bad DS reloc for %s: %d", s.Name, ld.Symaddr(r.Sym)) + } + o2 |= uint32(t) & 0xFFFC + default: + return -1 + } + + return int64(o1)<<32 | int64(o2) +} + func archrelocaddr(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { + if ctxt.HeadType == objabi.Haix { + ld.Errorf(s, "archrelocaddr called for %s relocation\n", r.Sym.Name) + } var o1, o2 uint32 if ctxt.Arch.ByteOrder == binary.BigEndian { o1 = uint32(val >> 32) @@ -508,7 +541,7 @@ func archrelocaddr(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 t := ld.Symaddr(r.Sym) + r.Add if t < 0 || t >= 1<<31 { - ld.Errorf(s, "relocation for %s is too big (>=2G): %d", s.Name, ld.Symaddr(r.Sym)) + ld.Errorf(s, "relocation for %s is too big (>=2G): 0x%x", s.Name, ld.Symaddr(r.Sym)) } if t&0x8000 != 0 { t += 0x10000 @@ -682,6 +715,8 @@ func archreloc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) (int64, bo return r.Add, true case objabi.R_GOTOFF: return ld.Symaddr(r.Sym) + r.Add - ld.Symaddr(ctxt.Syms.Lookup(".got", 0)), true + case objabi.R_ADDRPOWER_TOCREL, objabi.R_ADDRPOWER_TOCREL_DS: + return archreloctoc(ctxt, r, s, val), true case objabi.R_ADDRPOWER, objabi.R_ADDRPOWER_DS: return archrelocaddr(ctxt, r, s, val), true case objabi.R_CALLPOWER: diff --git a/src/cmd/link/internal/sym/symkind.go b/src/cmd/link/internal/sym/symkind.go index 6e1e1b58a1f71..82e4b9eda48c4 100644 --- a/src/cmd/link/internal/sym/symkind.go +++ b/src/cmd/link/internal/sym/symkind.go @@ -89,10 +89,10 @@ const ( SNOPTRDATA SINITARR SDATA + SXCOFFTOC SBSS SNOPTRBSS STLSBSS - SXCOFFTOC SXREF SMACHOSYMSTR SMACHOSYMTAB diff --git a/src/cmd/link/internal/sym/symkind_string.go b/src/cmd/link/internal/sym/symkind_string.go index 4da6c656f7bab..9c8e1569f6bd1 100644 --- a/src/cmd/link/internal/sym/symkind_string.go +++ b/src/cmd/link/internal/sym/symkind_string.go @@ -4,9 +4,9 @@ package sym import "strconv" -const _SymKind_name = "SxxxSTEXTSELFRXSECTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASFUNCTABSELFROSECTSMACHOPLTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSTYPELINKSITABLINKSSYMTABSPCLNTABSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASINITARRSDATASBSSSNOPTRBSSSTLSBSSSXCOFFTOCSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILEPATHSCONSTSDYNIMPORTSHOSTOBJSDWARFSECTSDWARFINFOSDWARFRANGESDWARFLOCSDWARFMISCSABIALIAS" +const _SymKind_name = "SxxxSTEXTSELFRXSECTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASFUNCTABSELFROSECTSMACHOPLTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSTYPELINKSITABLINKSSYMTABSPCLNTABSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASINITARRSDATASXCOFFTOCSBSSSNOPTRBSSSTLSBSSSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILEPATHSCONSTSDYNIMPORTSHOSTOBJSDWARFSECTSDWARFINFOSDWARFRANGESDWARFLOCSDWARFMISCSABIALIAS" -var _SymKind_index = [...]uint16{0, 4, 9, 19, 24, 31, 40, 47, 54, 61, 69, 79, 88, 98, 110, 124, 136, 148, 160, 173, 182, 191, 198, 206, 214, 220, 229, 237, 244, 254, 262, 267, 271, 280, 287, 296, 301, 313, 325, 342, 359, 368, 374, 384, 392, 402, 412, 423, 432, 442, 451} +var _SymKind_index = [...]uint16{0, 4, 9, 19, 24, 31, 40, 47, 54, 61, 69, 79, 88, 98, 110, 124, 136, 148, 160, 173, 182, 191, 198, 206, 214, 220, 229, 237, 244, 254, 262, 267, 276, 280, 289, 296, 301, 313, 325, 342, 359, 368, 374, 384, 392, 402, 412, 423, 432, 442, 451} func (i SymKind) String() string { if i >= SymKind(len(_SymKind_index)-1) { From 3a60629a6d1aaf2962bd118994246463412ffbff Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 27 Nov 2018 17:04:47 -0800 Subject: [PATCH 144/594] net: use .invalid for an invalid domain name Fixes #25370 Change-Id: I12da0cc17f433ca12c85fb986d65ac9ecb2c3f20 Reviewed-on: https://go-review.googlesource.com/c/151359 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/lookup_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go index 65daa76467dd9..35b2a635b2c95 100644 --- a/src/net/lookup_test.go +++ b/src/net/lookup_test.go @@ -925,8 +925,8 @@ func TestLookupHostCancel(t *testing.T) { const ( google = "www.google.com" - invalidDomain = "nonexistentdomain.golang.org" - n = 600 // this needs to be larger than threadLimit size + invalidDomain = "invalid.invalid" // RFC 2606 reserves .invalid + n = 600 // this needs to be larger than threadLimit size ) _, err := LookupHost(google) From 6bf531384dd233d7620181d5086a52571d64c5c0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 27 Nov 2018 17:09:58 -0800 Subject: [PATCH 145/594] doc: preannounce dropping macOS 10.10 support Updates #23011 Change-Id: I0eccea5d08a8758585f183540787b78fb80aa36a Reviewed-on: https://go-review.googlesource.com/c/151360 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 79f8eceb47e72..d2aa2f6cdaddd 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -47,6 +47,11 @@

    FreeBSD

    12.0+.

    +

    +Go 1.12 is the last release that will run on macOS 10.10 Yosemite. +Go 1.13 will require macOS 10.11 El Capitan or later. +

    +

    Tools

    Build cache requirement

    From d704b5c956f431e618904d15643e9fee97840253 Mon Sep 17 00:00:00 2001 From: Wil Selwood Date: Mon, 26 Nov 2018 15:11:45 +0000 Subject: [PATCH 146/594] unicode: improve generated comments for categories The comments on the category range tables in the unicode package are fairly redundent and require an external source to translate into human readable category names. This adds a look up table with the category descriptions and uses it if available when generating the comments for the range tables. Fixes #28954 Change-Id: I853e2d270def6492c2c1dd2ad0ec761a74c04e5d Reviewed-on: https://go-review.googlesource.com/c/151297 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick --- src/unicode/maketables.go | 46 +++++++++++++++++++++++++++++-- src/unicode/tables.go | 58 +++++++++++++++++++-------------------- 2 files changed, 72 insertions(+), 32 deletions(-) diff --git a/src/unicode/maketables.go b/src/unicode/maketables.go index b11b77c634418..a1f15869ea8d3 100644 --- a/src/unicode/maketables.go +++ b/src/unicode/maketables.go @@ -458,6 +458,39 @@ package unicode ` +var categoryMapping = map[string]string{ + "Lu": "Letter, uppercase", + "Ll": "Letter, lowercase", + "Lt": "Letter, titlecase", + "Lm": "Letter, modifier", + "Lo": "Letter, other", + "Mn": "Mark, nonspacing", + "Mc": "Mark, spacing combining", + "Me": "Mark, enclosing", + "Nd": "Number, decimal digit", + "Nl": "Number, letter", + "No": "Number, other", + "Pc": "Punctuation, connector", + "Pd": "Punctuation, dash", + "Ps": "Punctuation, open", + "Pe": "Punctuation, close", + "Pi": "Punctuation, initial quote", + "Pf": "Punctuation, final quote", + "Po": "Punctuation, other", + "Sm": "Symbol, math", + "Sc": "Symbol, currency", + "Sk": "Symbol, modifier", + "So": "Symbol, other", + "Zs": "Separator, space", + "Zl": "Separator, line", + "Zp": "Separator, paragraph", + "Cc": "Other, control", + "Cf": "Other, format", + "Cs": "Other, surrogate", + "Co": "Other, private use", + "Cn": "Other, not assigned", +} + func printCategories() { if *tablelist == "" { return @@ -528,9 +561,16 @@ func printCategories() { varDecl = "\tTitle = _Lt; // Title is the set of Unicode title case letters.\n" } if len(name) > 1 { - varDecl += fmt.Sprintf( - "\t%s = _%s; // %s is the set of Unicode characters in category %s.\n", - name, name, name, name) + desc, ok := categoryMapping[name] + if ok { + varDecl += fmt.Sprintf( + "\t%s = _%s; // %s is the set of Unicode characters in category %s (%s).\n", + name, name, name, name, desc) + } else { + varDecl += fmt.Sprintf( + "\t%s = _%s; // %s is the set of Unicode characters in category %s.\n", + name, name, name, name) + } } decl[ndecl] = varDecl ndecl++ diff --git a/src/unicode/tables.go b/src/unicode/tables.go index dd2f70b651958..ce85b128ca4dc 100644 --- a/src/unicode/tables.go +++ b/src/unicode/tables.go @@ -3380,53 +3380,53 @@ var _Zs = &RangeTable{ // These variables have type *RangeTable. var ( - Cc = _Cc // Cc is the set of Unicode characters in category Cc. - Cf = _Cf // Cf is the set of Unicode characters in category Cf. - Co = _Co // Co is the set of Unicode characters in category Co. - Cs = _Cs // Cs is the set of Unicode characters in category Cs. + Cc = _Cc // Cc is the set of Unicode characters in category Cc (Other, control). + Cf = _Cf // Cf is the set of Unicode characters in category Cf (Other, format). + Co = _Co // Co is the set of Unicode characters in category Co (Other, private use). + Cs = _Cs // Cs is the set of Unicode characters in category Cs (Other, surrogate). Digit = _Nd // Digit is the set of Unicode characters with the "decimal digit" property. - Nd = _Nd // Nd is the set of Unicode characters in category Nd. + Nd = _Nd // Nd is the set of Unicode characters in category Nd (Number, decimal digit). Letter = _L // Letter/L is the set of Unicode letters, category L. L = _L - Lm = _Lm // Lm is the set of Unicode characters in category Lm. - Lo = _Lo // Lo is the set of Unicode characters in category Lo. + Lm = _Lm // Lm is the set of Unicode characters in category Lm (Letter, modifier). + Lo = _Lo // Lo is the set of Unicode characters in category Lo (Letter, other). Lower = _Ll // Lower is the set of Unicode lower case letters. - Ll = _Ll // Ll is the set of Unicode characters in category Ll. + Ll = _Ll // Ll is the set of Unicode characters in category Ll (Letter, lowercase). Mark = _M // Mark/M is the set of Unicode mark characters, category M. M = _M - Mc = _Mc // Mc is the set of Unicode characters in category Mc. - Me = _Me // Me is the set of Unicode characters in category Me. - Mn = _Mn // Mn is the set of Unicode characters in category Mn. - Nl = _Nl // Nl is the set of Unicode characters in category Nl. - No = _No // No is the set of Unicode characters in category No. + Mc = _Mc // Mc is the set of Unicode characters in category Mc (Mark, spacing combining). + Me = _Me // Me is the set of Unicode characters in category Me (Mark, enclosing). + Mn = _Mn // Mn is the set of Unicode characters in category Mn (Mark, nonspacing). + Nl = _Nl // Nl is the set of Unicode characters in category Nl (Number, letter). + No = _No // No is the set of Unicode characters in category No (Number, other). Number = _N // Number/N is the set of Unicode number characters, category N. N = _N Other = _C // Other/C is the set of Unicode control and special characters, category C. C = _C - Pc = _Pc // Pc is the set of Unicode characters in category Pc. - Pd = _Pd // Pd is the set of Unicode characters in category Pd. - Pe = _Pe // Pe is the set of Unicode characters in category Pe. - Pf = _Pf // Pf is the set of Unicode characters in category Pf. - Pi = _Pi // Pi is the set of Unicode characters in category Pi. - Po = _Po // Po is the set of Unicode characters in category Po. - Ps = _Ps // Ps is the set of Unicode characters in category Ps. + Pc = _Pc // Pc is the set of Unicode characters in category Pc (Punctuation, connector). + Pd = _Pd // Pd is the set of Unicode characters in category Pd (Punctuation, dash). + Pe = _Pe // Pe is the set of Unicode characters in category Pe (Punctuation, close). + Pf = _Pf // Pf is the set of Unicode characters in category Pf (Punctuation, final quote). + Pi = _Pi // Pi is the set of Unicode characters in category Pi (Punctuation, initial quote). + Po = _Po // Po is the set of Unicode characters in category Po (Punctuation, other). + Ps = _Ps // Ps is the set of Unicode characters in category Ps (Punctuation, open). Punct = _P // Punct/P is the set of Unicode punctuation characters, category P. P = _P - Sc = _Sc // Sc is the set of Unicode characters in category Sc. - Sk = _Sk // Sk is the set of Unicode characters in category Sk. - Sm = _Sm // Sm is the set of Unicode characters in category Sm. - So = _So // So is the set of Unicode characters in category So. + Sc = _Sc // Sc is the set of Unicode characters in category Sc (Symbol, currency). + Sk = _Sk // Sk is the set of Unicode characters in category Sk (Symbol, modifier). + Sm = _Sm // Sm is the set of Unicode characters in category Sm (Symbol, math). + So = _So // So is the set of Unicode characters in category So (Symbol, other). Space = _Z // Space/Z is the set of Unicode space characters, category Z. Z = _Z Symbol = _S // Symbol/S is the set of Unicode symbol characters, category S. S = _S Title = _Lt // Title is the set of Unicode title case letters. - Lt = _Lt // Lt is the set of Unicode characters in category Lt. + Lt = _Lt // Lt is the set of Unicode characters in category Lt (Letter, titlecase). Upper = _Lu // Upper is the set of Unicode upper case letters. - Lu = _Lu // Lu is the set of Unicode characters in category Lu. - Zl = _Zl // Zl is the set of Unicode characters in category Zl. - Zp = _Zp // Zp is the set of Unicode characters in category Zp. - Zs = _Zs // Zs is the set of Unicode characters in category Zs. + Lu = _Lu // Lu is the set of Unicode characters in category Lu (Letter, uppercase). + Zl = _Zl // Zl is the set of Unicode characters in category Zl (Separator, line). + Zp = _Zp // Zp is the set of Unicode characters in category Zp (Separator, paragraph). + Zs = _Zs // Zs is the set of Unicode characters in category Zs (Separator, space). ) // Generated by running From 3dd509d23d2118c3b4eb093707e184c1a1d330d6 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 27 Nov 2018 10:47:02 +0100 Subject: [PATCH 147/594] lib/time: update tzdata to 2018g Now that the tree has been frozen for some time, update the tzdata database to version 2018g (released 2018-10-26) for Go 1.12. Updates #22487 Change-Id: I9e82bcdaef28d308643c08c9fd3472e4c14a196e Reviewed-on: https://go-review.googlesource.com/c/151299 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- lib/time/update.bash | 4 ++-- lib/time/zoneinfo.zip | Bin 365101 -> 363811 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/time/update.bash b/lib/time/update.bash index 629e74fce84f8..8b1f453fb5cd5 100755 --- a/lib/time/update.bash +++ b/lib/time/update.bash @@ -8,8 +8,8 @@ # Consult https://www.iana.org/time-zones for the latest versions. # Versions to use. -CODE=2018e -DATA=2018e +CODE=2018g +DATA=2018g set -e rm -rf work diff --git a/lib/time/zoneinfo.zip b/lib/time/zoneinfo.zip index 08dca214181a8488412a66176752d9acd78a367e..99d5ee1213b1706896a96b1c0a5e722b1a193c23 100644 GIT binary patch delta 86240 zcmdqK349G__c(rM?pzWQf`}v%Vqde_ciE7LMC`kmBv*1}x!EpaOM$xgA{8KbKCuT`Cp8&6=4@P0IOs=Y9xRnbS9hU_EtbA~HYU6@9{I|l+hIMO~ z`-;F}Sd0Q+cfzZM^7Smd5H18hd9Ojk)GY8Cr4Ls3iP7y6fwvvw*@`!rChJ z%4e03<=VuHgJ%o??z`?@dj9F5)u;Zmq|b#rf!BW!PE{Jvr7U$W4(cLcwAud^X%5jJ zFualI%M9!uM^n2B2UbP}FE{h0ut=f6N)>djMpeP>Op}tNYLD5@n19Wy|9!a{7y*W= z4*vDEB&cW$QDf(ZAQ&v58bYzpTw%b!4TY}0VMJx*N+?sAurxj+H!s_$RW3F)6pdVGxocH?*3Y z3>cGz*hVy(f_pSUAyXMASJ$OC3X*D$&&sUT^y)ZaU!%^%tmTBs97PPD#wTcY6bhmo zCV1T0yL`r0Y=Ye|)9jdFh}9fSi{{fafjkvqS7->L;A^&MTt0nhz#68FFug@2QM#_V zt1HKX7GsbpU9YtGP~K!w^HV^Fvp*1zJ&l{Nr^yce*)^FcWEB_Kk>g&ydbmNSd-dvm zDOUDsZj2K=rPI0KKkJcnaqu@7WP%Gb<>c@d z72aTd7?;X9IlC;qv8LELnRgSi^c_ToTx{K_e1??N@DFE*%GoVY_@c2-`45*L{s_@> ziOPr$%}F+ia-lhZb zYw|op=GS6@rqsj~b8fDRCMxJsL~*-Q5>8a6(WQ9X=77}HAlj77r!-RTQrZx#vkI({!Cl@UR{tn2AMyLPT{k2&6ac( z4uL-t%s)9XHH5kK-iE;3Na$3*ujo3SHlpaT=u3@_`;_6NiwiAcmCFk$R69|U4`L}_ zIvL73sdw6Fl9xi-b|)q90e%##s4&8i(K;|4bEnav4UuX;w1{F&*;*%NNrzPqsi<>+OYJbmyW%%BD3n9T7S#o1Zd;|F80zY8dUJ zh2wAL0j+tAu-=mrWe9D;Pph057lHM1WS@^``a)&S(4q) zoUS>cv^g7*>VUSsP0Fnd%a+0Dd{u^K@wgU6Uv=TEBF^F)o_^tcUOKOqD%sK!;h!5l ziQk+3N7E?Vo}YOalDELcHnsBQi5hpV<2F~3pqu-iG(lzddHU( z#;AWTqsapa9ov40Hnd?{lzG3(CPtGtSH9opWbXqLU`P{C>&Z<0@-+mjm~#TqPbyUF z{RnO@gX&IU4iE}X&hNel|6>CBV+xf58#|q=3H1URJz9A?Qke2bC-VM~lh4jsfIAl9 z{Yf0`a`;9i08eYdLS`^4oLu}$$pPWJ1#iXxq7KM&4OMX92Z&jf(5R1SMMvq0{ zf^Jt~3WVS`z9{HC8%2<~ZC|{t6y#WnUhQFMYy>H|761aGiz~KIX(tSro+&JRGTAzC zFXPUj0h5@S=+-`_A3>^YEzQmEnI#JXW1Q(5nX9e&;TTbqTBM=5nU6ck>_ z^*lKG?%_@)?;JhNfmJm;6mm5f0?x{kvReK#m`LZM_ zTA%J2*GXXyC`pPY(FtzUn317ECP7NdeU~MFw<>=2b^8N2Dx$;hF`bE$SuR;_-vO+5 zkhKOw(=u%Sb>Jal{-}OUW;B}l4&#BA)?`MADsZNl;`~V>7PMprN5=7=(q}hog7#yO zk0UCJPqUcRivusT{(Z*9IS=T-ZQ2Ib&);W$W2|epGA?44=TP{+p1qkTCpxFwSzLfVT`B2d>N{`szOz=KVblj{t-pnRO zFhsT#f|~U}1wPC$f~sfNg@b+pRKKA4MKqs9h??p7aCGU?6#^ z-5e85<15f|*XDp!a;(Xp3s>3}pt)X*4|wTj=$IGNQ4~_c^-ZV^;Yi8( z^@(~BWsmn%AKd!h6H)A4qgo!g2MoH079>$4J?799i9=r2`$^0nj6o0F=Fs)=Opee! ztSOqD%=8hzTsV*7!}Xt-i$JxrfwPbr=2xgWTbT8Pkkvp=?L0r2Wd22`hj(}e zk37=}cMB;-EoysxcnXu|BE-#{hGVnv=gbhInf3$+`7Wec40co04ChOin}t50l0L#u zBWR%=-mlRRK95z~?VW-sU9FgDacI|BW?H47o3TL*hc>Qa{DiwB;|NW^_Fi)QAUt|d zn6s6ZG+~meODIKa5sr;&EHvMiD2jH+Hm0REWk%1pF%%`Wf^%9b2Hl^l4sl+wooRqB z?P98yulx9EKgQ}^!ep}|5$AU>ZRyWWW~}IA#+xM$_UkI2no+Oyv?znXM!isRea^+Y zVLfw~$={Z|b4>2E17qh!?TjBh_P{t(tDStikOK)(t~(Rm8y-k%es5>e-`s)mHC=+n zUuh7MeE)7x%07LF>GY|f32S~2N!|5HP};QrgrqN77L+l1TZnne&YhXv7KCJtT)H#6 z$(92-U2=Ek8s;6acn{ra`91Z(#HXEhPWmS1z~oEbJM%UN9`Ky0PYg*P#Qlu`v%-y)3IZp<@;J{hi z>eP|B#-QsTvy&0unTaPPET2G24vA;q{Vh{Z9C@#G4VJeAvu`P^Jxz<#z+4iii3<~6 zp56+@WeefdnT~{alf&j^je!x25gzB#tQ_aEB(WI=6l4F|v}BBBG{Z71y5EVZBb=Rh zgjmnmDqG(c4i?cut1Tri=^lO&r^6roB6#+UHBKZ^3Xyjv# z2}OHOpbhEFKJj70SXy09+{peloHIuZdf1j-(Kmp<7~}>WZZYv{Gr+ijah(DDmXd_2 z%W%zHvhc}l+{c+A6hDh4ln7PN(v;6$@)5<0d)DqY$x~5P4{E~)hhAl(DjdnkLXSL{ zpCMTtjoNrJNg@L}uB7_W0iQe+hJO7YrMe3}M^Mrj%=-{zWm@$FYAF><& z`3XO;;Q7u@6{{2B>+~rinZ>(lPLIgx-fl)OieKQ4Q51zp|LRs(!F+538I!$lB4o{{ z`IU;=CWXI^=tMGpG(CZ;*VxJ0vwL(sf!RQ^`fZ6!M^aTbeDNsg6zCNOc~#lRoRpiw zC(xsXm~!~FWn60D3J1pwmv;(MNbY8Z-0c{Hf<|z8=nP_b(l4;PQg~9{FBp^?-_Me0 zQk$|=^JSMaDLhvOe_}}YVo!C$6#@piA@#B3@fj)vh)o;llR3MsyqGt)%JfgWHOq&D z26qF-8<NF<=IctVtK@eP`nv{8v0?&M=XK8qgH92nAEF!!W1h7j)WIZuU;RRw5L za=zznS-IL=xF33lpen6)hcUwwX5r3wnh%5T`(gtmB6#oI`+k0_f4bIS^gD44r|iGh zsN3{7AthOCS^e;6MAyF|#rYe#nyDTfJD%SF9Y*PHHJh1YJ;aM(RBba?f?Th%V~IU4 zTk)Utneasna(nKTly1(*HLFcf;18^}f1q<)CWS@JW^Og=)`1x-3is<|YH-BSy-5nw zTGY`aA50$1LZ->0PK9c6b!}*4(2DK(*Ki<2ZZjEo@P-Xg={c4|eP=Rl#cv;SV_KG< z_sE(9PiE1Y11NYlGfz~R{@W=o0Y?tuWZ&u~d$&Imlc;N>Kl!mHjH9OD^%JF!fL|gD zx`?wCru{S*sIQOv=mw$1l?Wo0wkKz<8UZGYK`xaTehQxpOS|X}9h*MM&>S5msF`O9 z-OQJ8lJ+&x#^GL%YK;aeN2BeV)VS^3&cN*>*tfKvIO_OL?!xiM>B1$3ZeCp!1DE$urPn zoYEnZjivghlwOa>=*)e+g^zbj?QrK$=+Ew9hyWM-_|1GF=tw=Zrj)BfZ(x8ul+5^S zwfIg#uTe9E$ZNDt1g=PhkGeROY`=C4m%%3rg(<&I6gh!@qtvlvgv2$l)w&vIfz{6v zHoT%$SvXMMUc-E;NoqR$ZSvC#0gH}$+m%HJZS%H zy7l21cQPm1tcV#Z4xgDu@#EwJLj1G>5$)m5OcQOkivH@w(3H!by$tHj%$0hDJ-Ra# zTM&!TP2HK9(xandX@#-)D49(W=^YiVj`d(PvqHjJtqY@O+15#2n6ITre~zTaPpo6s z@F>PzdbDK-6I{O8ivGghjzFZf zl0F`(8`@qp?H>T{AA`JZh~+C@AnJ-E0K5my^^Rflt*88%8LZ$IlPtIz#Z?sJmwr_5 zG5q^u;r29|^5YogXTyWy&anmP^f`7Y@dQ$HtF~_vuh!hNDV4IxMTXaP*V?E_5Y#cq zhX->IrYR~@N8;o`N1zM51tc!FR{ewnz3^mpZ_#WvCsX=N4&f345)=O_nFSxmASYm; zG1;V6myrnD9==T`SB1(^KL`zc>)<@qS8(eqO|RBEPH|nNdOvoR^%Yx|w|tY@lGK2?~pq`_QR)VFIOpuvC}%sgYDH<(djZ@oBa z1xuB6Ev%!O+9$1q)1mdPDa{#%A&WzG^>4xwaB0S>Ko}|pxkkjm!lfjYN*&9z zHXbV$klW_ZE{*e;b8ehxzvwvO`uP?@*FPg|)u~W8e3v--^uDxW7?72m>{~@FH0(hN zO~|0l!%+HAWrEy`Un%~H@;XUF!#`yI>I^!CL7s+27<04Ds?+~Cub&6(AVy+6XyqES z!lS|Ska-U`fl!uI>vIp%ND`PHw0s=vkfV=u>pV;PNJ6Wg9mzCiz-0Z7MPR)c6w{b| zifU&EqwN8-!JxoFUTpgq97uPedV6WgxzkOG?cy4%jj;LVFyaFFzqdpSnfGW}ht2ho zB`+uMktHvmWk8R=p>X6univZ@?`QntHLccL-r4MqH4Fo(urhM_?8IEWo^DW{d6JrP z@|6ReZtfbcBaNe3Uo-xM{fy~q=ukj56xI8l+7-gDy0ZS_t8ahLv?i~*+-mY!3cQ+v z{ya_fS-@j)*NV$8er*c+UTPRZzCY>=(}f_}dvZx@tRM4G+A&%;Np$s2@Dz6SF6iVj z#t)SqWBL&1^v=Idf7)0=oRfnkL(Mt4X7#uf;B;&FyaGZ~n`4Z>D37T})svX3N13)# z4)OM3nrE^GpI|-|t@qW=d7V#ya-Kj>52z0^!Zt|jn1hTPgLXCIS}$!_2kkl}E!aW- z9H%9ZvJd(;I@3M@P$i&<4&`&3$C^sH|}OPR^-OP<4h2dP)Xs# zWuk=keXUNsLqdLsK|-O2nLZ>cCAl5A(FneR0VISnJq+$DRfB&M*Fl&h0Jldgcj$yA zeS)m@zhXQY)ad}TTNKf%GmMYMWcSh;S~o{b-ZE=)U8HH9DL*pa+IEk|Y)jEy1q!bs z-!W{R^0P=h1=6H0JVYE!0sP_Uh_MCVIzP$$_Uu00_lEhU-%ktCo$1=66m1hY-?pLC zO6%QkeP;PJsX5K9X)~i=(+6YSnpf`Q*ZfR~ z8}wl6qGMy&_99mdeOQ`z&vNxg_1)OCj(8%vrknc`6N|21z!4(l?OwAA(0zs-QTe;Y zaRmP^7uFMP>B}aO)zNZt$?9nQk%6W>J}E^d^LUM5vK{pC=lusi1x3U_wu53^v8F^b z{8t4T&b{)1UL4w8tsOe*pEGD&dwmevJBRJKqJZ&4epjUi`GV*Bo7@C;+(g%(Q4Iz+ zU|qui8E(M3ZG7VT0QDHpPD6e!Y$tT}JQId`ykM#!;6nh)?8JJYB`=t~PFQv;m#83XyHk3z=eDgkAEO4%xri!* zJf9fGb$aqodrxF;&JE`nJ*yXLJn#%;Drx>7th&xdHSRH4)0YX2oclF>#vNy~1n_=>j(4Vs zh&Tgh?0B&=sE-1=uzsk27dBIjAzPo&mXwm3b(z4`XNXr$9Q$LX3|Qz2n2@bH z{eqk1zSo!`dV<5lnqK`K@WdGGI0hS2vehOF$N&)ZT%4^fGTCJe+MmV#PNeUS*5xDt zIT-BH?*p?BDxMt^G_5TQhe%-WigG+@A(Yh1))SuW&tm5lRZ5|X2d|s)U%_o7G18tZ z0K4rPKL{dZatg1u^Y4FS`ao2A>S3o(wgHV8>?$3RqJAs{uD?gUVv314zbmXi@~Rbma}eTV5r>_yk~qu=g;1>ZsUMzE9}s>DAa|6Z)KHFhNH0!cXz z$~*h9wa}VT>h56#RiU@iu`J`Faj zI%Bd$gt*8E;1qF@)(urzTnf3cR>JFlkpF_~fbu$8m(J35W7^7Y=WwDpcrN*6x+J_t zD8S4X6VqHb$@nq>oCOBEX-2@|DmjUkin>||FvDw*4)%S>jAn(xQwa5V#KaIHhxn~L zyb6e1g%-xr9I<_@sDCO(GLffdOg7| zd{ILK+Zy#ZuqHMCXURxT{lClq#aJKRB(r(bl0QJ9FpzE~R;r3wxH5O56&K^EW(Cf1{B7zxuPm~R;DJpc%l^LRAyHb$9AoqW!qX{ zF$TM1>z~c5X|bFLXQ%C6!cV(5RgFV0?=ij6*Cuu*>OFz|fQ)IlbIZLGfZ-ER@g=GN zB_=z&oV!sww*em`>e=&4QWj?y913_=5e_F;ilF30w>@_ql5I)PQu9(+P>PycWbP=Q z#$4+X9!eJRsl{%zr^>1C#8;;KQ(uv44kvWYpIt|IYrW#~@kWr^Mzp^LO>Dgvv0M%4i`&&H6A4eEYJ_=niA+3}mpZQT)<3Ni1bT zhir3za;*~@V`Q_$r$4?)TTM?mW(`D~kLW5LO`oa3^b8Cp|D9<~AHv{Ag9>Ndh5=%* zGdMiOl&ccmWu=KFT3(tI6P_gv9q_UU*k6QPhEaJ2GP0kdS9{}wF~xg4&J}+@*SFxz z(7Tyv`Y?77!Q}`DtpcgI?9TA@fFN=;FqEZiv9Q7}vLvYn|0;-8S#63#jw@;s%tonH zt$bpl3g5`AF|Jw(27BrXtg>@H0``1YWcZ3ymTY_MF(I+?3lQK72Bp=d6@vDB$%*l_ zeqR^M?Sc<`QsmGFzBB{3LeF@w*m~*3)~U1-sKsFSRWW>qsiM==oN?xitziZ7s9tT&R8vaG;-@D&UK~p-j;%c6GU%KybhLY47RU1o7 z+QeFL27CtBf;Ft>vFu~VR7PX8cO3f;p~exIua`2kWP=`3NBXAeG-28DH&w1p~)m_bY>-Ta%p%b+F8@ zyoMSQT30-8fOXz&yH`<1;Y#i*ftKtu*najDUU=Q0B7c-6iE ziNvx=gv)=9-I5p0GV-YdJdIcV9+OARE4yPeXe8@&Kcn^CD)us=KsWI+))(EN>EVQD z%{W}az>GnA)UyXWjUZj$GWD&=@aSYTqYBjl!0HwMdM*pj-(R!zhR5SGfqdqW6Kv+l z+m=iS1`N0l%WtSgP1YUNsLD1W6ZpQT5?|TsIA{)_tUyC;>I6RFgtMb`>)cUZx=9DU zJolru&c!@{l#kP1yd7?H^Y-#F7TP#DrUX-Vgv-PwsA{fy7lL3Vwu0r&31~ub>EVwot@wt7& zvE^(0&g4#Wt6JyZ5K?32<+IU5?Do^c(15q7pRl-G%pR zz?!1K-n=o}tTKyFOx86AMgTd3&UHchrs3Am>H4D#Iaa51aTHo^VWmaSe_5#E5XWWQ zqOwL!WSynWte-4mDQ9Gm&`Tb#v6$tg$A?a3DcjRYII+ssc(^QLDI1FslL95c>_x12 z#J8O-=>A(&W5SDiE93wXQbDz<|J(r%-$5@6sm&XRr_NX-a9`QQ%EPK^=qo1`qMNg& z5MRq_Tk4O1ipL4q=#WD@qoyK1bm2EE7bXGw^VlSe{?oxBJ>dy+|QJ=1?jA2DUSVxs>0Y1JBG z`~QeOe!r9IIkC>S*u_eF`kg;jQ(Td2B7gU8R7L6iE-Q6sz!toHV+ReR=T;8&lG((c zyJ+E^JdW`bMh=}l>}(`hcO<%bkm`BxAZ^A`*&2I@J;XLIysgwDRkJShDd$yG$N9hf zDUrPy->6v^8I0V6j9I4YK^#W@V6*CjHYO=N$n0%u?}(NzQvK;3wI^SrI^#6!Gg6Zu zx9@(2xP@yLe5$M|EwC4#qqg1$hr$AoG6{u_?a;*R?Tf}CYGJdNFh&@`DVZ};)H**H zZF3u1BwtHT+V%DgG4P0t)?vm9Y4x)swQrFj811Jm0If2Np^2*39DpV|V~n_0Q|8!8 zQChbzus&lovERP!8bTm;;o-1xGzpemNm-t{X{+zWCYEL2K!Z;GL(O7w`cT1U83bG8 zX#osglexS@4a9t^hVT2`BeQ}KKd`)rCTmPbcjwD*-5F}F1H`@1P9m;&hx|csqL{fL_ z{%33p7MAa#>x-E=a1a|@SO7mhemGkaf8)Oi?*+>$dksR1Ua~=vI6mWtY(JIoP*O~3 z#z49vl|6Hq94J=l6)jqcr+fUrbf8$13J(+ud9PZ1R8y~~tmhMl9O4QZZr1D9{oi|r z8a`L00a`zf`*xr-<~H_2)Y_C;SKDJ>+ofYb+c8weYBFeW2S~T+dP0;EnZ5N@t!|a| z1KCQ9j?uAtl;y0Sg9_aA&h=is`d|aTYvYTZ3`c%Dk>4(O)o*wNs$E6jPPCJlDtgM& zAo2LbV64ZdU^UG*5R@?Jfxuq9REV>Ne$9EXh+oQ0frT(We%Jt7!uf#k61+GF-E-3i zh~I8dLr+;9D_R}7-AR13t2>QMdxzP&$X)LumAUJ@^ppiUh;OYAKu^5%KE(Q~ZfgD% z`Fc~I#$~G&7(J$39)GbD^Y}jpFpuFk@ECr(^a39Dia`0k`gZwcy#R-~mz($oK47y~ z_|Y(6AqG6@g5T~FGuS^kn64kBk2$`LPKPG6);B{gP4)FioB1eO^nNJd!63ucD!2_D zm&mZye){^PVYxUjZHNs8ZdlsLX{(MQ2*m{HeF=uU?{;cg9)=2N2tuXx^itVV+*n`7 zr&W;pC;O7GWwnedD(`C@)L#xlUj^!Y3De#R-Z-FK0aQrv8h?E~Ld3kYg-=6(=NM#6 zYt>PmhyZk|p(MF6x0e51E)f;-J)^O{9!Wn+)?AxPIDy7B*Vm>*JFt$R%AJ7DRzdC1 zq9=?8VL@ckj}OcJdOP(21fg94`g)=TXMp_aA8m)89^yO*v;OGv$85|f402{wAh7_{ zteM2_x9%QIEe}H{b!r39XANxBf`-v{IRK0LibMLiwVt+j0UnYK>Fl1PkIEyceMJOa zX(0{iVQS(#<*9LJbqqns)lX96U%v75v|&)#zKS0aZGU=w$@W|R(RFfp!>B+D0+3T{ zeZBVB6~-+cF}erH6$6fRlJ`&_gv9Or{(8!kI3`oZ?c|h^cgrKQ!hud}B3av(Q;U4c z6f!OLuYiak)Utu(CrAG=Wled*sKD(6pg5b-IA4pqP#z5x z*g+6VuzT8;t<{*`mw1Qcbv`UD*E>|etsr!_rOn==nyGn*zQlobXKMXI7=o@hP;+1b z&aYmbJEeo$#M%nM?Q4s+TG&Y4R(GzJ+>hIR->2mycEfLcbvYO9+_%$uE;q_-$fkpmJB^@ z`4UveD?B)NYjv|;TE6+>vt7f*ty;J9Xh|U1gNX$SOFduHq`ojYtfSHW??}V|20vK5M9f1yZIE~et##Bx{T)5pvrJzDjrdm|Dzf{RY8++m z&^q7?{UeFX+oEZM5c$XT(;t*6&iiL+LMf{_A`#Kg^cslx@jMMH5eS~bwzj#TkC9aU zcM}b%NJPX0eLN>_Y_S$T!8?R8;OzpEWs$`aD(z8m83Xpw;=W|bDGWz$`}AAU7yI;i zO*@6)3oap-Cac0)1+~RFHTKT1&lYdBB|kb;c-B_c1O`*bh@IV<`doJdp}B$Y2p13V z1Q=vA4>rMWK$Tf&Jf+}_mpS5IsjGF;NWD8N+;8BGyjQZFQ9)i*-3v`$ zLrWhV>hZ%G{T!C9{Sz9!Uf&6}f)8JN^20tJ&bT2y85?Ozt(J2~GtzY%0S>pahI$kZK zJui19nTu$BJwollMfxG4Cn3S#zbZ#b_{$6ajxcn3B2^i*g`vg;G>=ELiL9x}FVM$I z(gM4!gFA2Gyz#dk8n9s z0QLNWHXPA5h~|={D|!%h6y!`kN75y!(o(9#LDQ|1mg;9qG!*TpQ7YQ=_5J$x;wt@> zK?|RXNzkR)G-`DWn5{@sdUu)wkg})!HsTc zQ&-RekXkzfnsT*#{53yIn>28A=1w%_)Y^9)FtzqmIv^W!0%{{+V>nDPs_fq+2~;l- z4^E)Up4mYrN*euD`Qx7Oj~MVoN#r1vi4w89_E`(gmx#!|x(w*SB8o~h!tz3u)wOG36TVVVJTv6uU`{+U#D2LkI^CM16vtRa?2BLB zcip}8{L@3LPyJ^}p9^;aum2#Nsx(0KI^6ouYnF10>K`(&B&zProR zg`-U`kSk&Fg~KFwAX^eZ_z8TPQEmN)I3I1h zqIN`E>|W(pa2o(kKT|@UT0xD8BrAEK3e(jPh`A@ z6gF+~K3q|@_Xl#6JzCoTrwQ63`d?u zTDeVz%FcU?x~Fi>$=bRHGuyoN2_#V%@Y=dK9`2pR8(2&eRJO$t6%h`!b#V@XFM|IC z+E1r&yuR~;YpA`68>0Wq_ZnJg;{5Bh-862xwfndkJ_oMlqx$3WpTBzzvk49i?ulwl z;6mNo1O~ThTc)l-tD*5uj~Y#*^#<)R$Q3P_#tkJh`MUkyPemrRN~Y;Q z$q$$HZ~Hb8=jvomTAVa~0B zJ6Z^gE<|I;)6zbCyfPfo{oc)1-1nb;6?rNwF0;l0?kE|@+3{R7Nr}cB&uV8&x^YTm zllWjb^Ep>V<|13-hL97#(bWvjpD57k@2+Mi0bLm63e?BKS8x$7xgiR@n8H;BSKgr= z3dylK?`Byv&X5f{_-q@rIEz~(a{K-yb?2Bk+2$Ponnv>h!u2iwXux#NBBGqfQy-L< z0^$u~=vcCvy@^wRK39`_;($E{walh@72vSHbCqRr{UV9PP&U_=h`wlhLUca7n~(Y? zQNM&w)<(OMxH@%~T!3eFZ*LIK_QZ3Pt9R<)tj%jlTq`m8|HJj!QFsIcPX28g&}%%L zS)`Ku;|1Uz@Q!Hjy(e+QQSeN-6Mgq2t`i}2;;s+-ibrCvo=gqDxcXWa7b#Ab8uGZ- zBFj6EqWL<}x^|4RN%4Z2W?kZwk(rVw|M1n`=+!{)YBY5uEqddtq5K=W7r+kl`+41uo@w-V<{3V!)47E?k+8`hX7dc_U;^jfYYH4&`sx+@c6;?IXPl11+i;+! z*G0l+sK{Xeaf1OBnb0A>tH3`7mu=gi@21lRE6+JTGpacpF_vTVLu;l`eVLR;IF)N> z6EkU+V~a0R#d|H23m3(7E|1E5lDq{?;gZBBi!G|i9m$PnF3sBQ9^45PfOR%;h3 zuoq{wHsyt8jXBMdrnWu)|A?r$RGJV8j~#6Iw2f@xd@Mn(Avg#MntoF4jIes3^i-|Msq*Rcfw}?xHxPjs7?&W{inct+nR`>MsIr2r; za2`h|II4qAp~ziQo*0TL<;mg#T%N3jvp~piC{N(eF8K71xCm55;Mx(!cptg>YbVIK zFkr?E?61ZcEPir$EO}RcHk$ZuG@WG95v&cSLN=c|4n-sDDtq?aH0u!j8wOn04}wGB z_)K#}O<;07tEgI+R;VkCY}%;*YHHO-7VF{VRwB~xR;#sY#btfHa6owW z%}jj%4hnpq78f8Ei~DAj7w?D^8rM+$EtVCz0$6&dB6iKUC%Oigop%uzd@B$atkg|hPv^$HqU{`jsYtJ5D=Qi=cKB1XzV;9 zH*~ynl-$s9__2`ry>wQ=N84#17w4E{S1`|ghyEz^f$&{jgiN{nm&lCd;Yc`@#P$D7 zh@bx{&7G66mpHD-`g}h<{%wcN2IS%|GC`r+U#%BOB0=1Ef&yd&%Tmm0BC_=ni0iof z$6qt$t(zf(Rosqa4J~>1TmIK|hgfhH0NB`usdd|AJ3i{zOthLC!@*1NA~-_^uBczg zHX}{cRWJI~Oa`nNa1(Wy|DYjsk0#Eek{9K}!7q+f5C6o?cz?@zik88TG`rZ55QqOBpgJlBB>8>#1iWPu5@v%= zuK~qiUFLcl3Rj&c#!P-T6<&h>hK|q1SJA|p_;e#o3090!9K_fkIPd%{h$7Pa;k*g= z?<;;C56XV{1$^t^ z1dKmhE2(tN`4VHaGZp3rH8WK{{OTy^IOiD?F~J0jn{W$&Hd5t4VIFZ1_pqks)7nPII~y6*cXnZQ%4w2v2_K; zL|DirVGP3uz2xCkNgJ8y01R@-a|ePLKF631)rz*)<-Atf!2ar};0))H|Arn&DX?K~ z_JP5yOtx{NDJ@O&&>}aqnwyN>d@_KNxCd^i!MQglPU$$_tzjoFhED^ptCeYX9mmIS zS5ru`b4|45I9FQ>*X&qcL&5=GNgbm3^h}^lD`g!!-kO;K_)Pehl4U0yNC)xecsTT3 zvmmw0owmPAF`y z*-=+N1EO66_i{;N8)nK#N--PZh8S(Km3uKI$5MRlNF&S^HA~7blbHqnHmOTEC_Dyb zxP9fo8Jd`=U9R!~u4LC-*yxYyUwU(grX;MPpM9|X_+)$ss5bUF6b`zi+uu~bvXH3B7gW6H%t0v2GoXXVdcL&b?7CxCzGFy_(|3wh2S$6yd z4biFdoVyl({%6|S_v(VOU{HF=I*sfjhU)>cbIlf*!LW~6b;viG&iOVSl!HIV)fzUn zu^ms0IV0OV5#Nud4Ue34O5%c>pyCtSG|%|%*M;?9bQqMH_iYn9WrHmlrvF0ojAc3R z-^`9OlF#O~XGC(3?5=S1hnu0yi(FkT!jvOXs_*jVcDlf=17&Y4g4eT#_!cPel(wuv zzSu?S$RD+^6E-;8lxfy(t2XzUkIP7XrKs)>Uy+OhTVzm9BQJ1;u0}_G&k90+}Rwi?Q&f9hh&|pxyj7>p0wDSd5 zyO9Piqx&x*w(kped_SDeBS+M0b6m6kX!;}^8aNn~hG>LSCv0OHoMKU{E6P;T_N$v; z8`-^fGMuoM$*eu~mLpZ#&|B@{I3Kr7Ozm)OL$)vVf*~svvtb7vs^?^#ZaYD9u7y{Bd0L>Ei$UpM-|CDm|IXD7(V!M|ZuRZ16HYCt z-BKH`rjGV$hsNSk@b~VHQH5v2;b8a-Cv8aH^Qsj-5!i%5$?$iet7+4*IExV!B7PvO zbt?yPn{wNGt883t=-j49^q9L;RU^DXG)L$C;Ae+Qn>j6}e~Cu>F%JGs%k6=2~Ql+5lh$boiH ziYYVOoLH{&$S<$o-EL%Y<)1*+FeuS_z}g|3sSPydz??f?GosBp*55_o0HrowI` z9cV+dD{R*}x^;cJXI#gPr`MZLzspcUFf(S9Uor=mH-5_{%k4XW6@$_!mXFe*eKi9d#xBB}^X1cS^>MuS4nfO62r z#~4!?3|^PXK74*CU9Vo*B!m`oiiE@J9vOi^4Oy&cgPkYG?I_S188LR^NsMwkA< zdqYq90pBnvc~=vHv2B;llxl{%8Ol@d@*LL17Nhf)0Yfk-CFD2Tfi;q!2uGMwaQeT- z>7nP-=Pv^(VUVdeX!rBC(2K`h9W4RWJ*38}yMO?L-RZ-hVcv7DgR(H#K&H9dQgnKF zhi8D|87|S4gjJu9uHV!~m~wxFd_s2c0taEeGIEUg)K?1AUgO!9E;kE(7-)a{fUPKv zx7K2G@S3*1#;?7X96tzy!=TJMrWZSCi!^4Z!<7zcY2{_Q<>rxqPKVCbGI;3cFVUg9 zwG4GNB~7i}4c_{T;u{_)-rZ1D(`)zfYo9LHp=z}a4K%&65Wlf_6(P+79dI{P(_)AC zRMdl@_!yMxkiJ%jde$^}X!`iHN1V5Q@AvI^@!hCF!QL{?nm2ES?5-=#+zhm}0@P_6}D=@V9aCy3@B(=dI2TEA- zp9E=+B~x<_(Co{DeuLtHP7KNfWv>izj4{KUZptuf#tR2kLOdOR#6epGKPg9h0wy1? z(xIIAR)!N31*>)_p`pfWu>qyt1cOfg&VeEhAEX^0nhhaFb0v&MT?aok=eSO&I@U{L zBDk~djR{83GYlSzoXPo=P8cxCOJgF~@>brc1t2R7%3!|#jAK+`W|Q_p*!M}wfi(Is}WmohK5H$v+ zzqjjv7&9gsH7{+7d)Dr@tw2%o{^4H^oc$-5 zGGMk)w6pw*SL@9-z4zoJ5CjG#);W-c+R7F1DoN%kH0yoMcx}pNf_6gG z)}AiD=-{z09~g?E3{&r;!e2Q}kvs0+G}Z^S7lYDW{q(mEnQI$7w3I|2e6=D4Jf;qV zl51g4QIEg1*#W%)Ish_u8|&k6&puwf$U$4tSNPkAPQz>^sM6LqKX)MR4Tzyru3f4P zUpxvzS?SQTaC_-M)5n~Y3pZ|396MDtux2Rv-vSP(unihIp8YI|w7FoI(k{E`6yfAD z|BwttxH&t?T+vcCM{n$2?5S>3fF=w|<@!SJpsSB1k6sk&^2<_nzvcGnvjHInrJ79T z97w}q#x+rUOf$aE@5%uaz@T)W`H=<()HRTq3Q2Bq@0az*?r&QnW%F7KWy8NZ}Dg93lo<||%S zFWx=~`~(K2u6Bca$u>@9YH3UbhF@uU@P!?uweHnD}7j0#X@&*}s zkKvxLV|BDv?w3b2BoSEG7D*3p& zgPgQ%;3I9$;Bk!Yd|q^y6Kdhj@JYe*_BdubO2 z9W*c=8a<%Afv6nj@vaW?2Ad{WRN`w{>TqM))7F_**4hhtqTuQVFHOCyMRy@c-3o{C z+~aDs*6LaAH|RYFWtMUt`t}jxtH|#G$D#EPIp<~?Lhh%1a=t^m9>DwEdW-J|4#`Qe z@U*0-oSeu1J`mnLQu_Ls`&<=G<1NLnwdw01+EvqQ^YLq;{iN6S+~;a(dM)k&ycQKJ zy;kr*Bau7sYdzwm*RDL^T(mItttB&l7n#~~p!jOw8|Hz?>E6<-s2d|p*!x1mbVb#Gh!RZr1vh#fA`(5aNGp(W}0%e8Uq@=*;QNl-P`G?Fwt zl98jOkFP1^T(x{Wq1UJx$q)-LC=Hw+%b@#@v}IfudS?7?8-miM)<}Si>tAiN6>PPx z##xYyU{GSIlH_nU(1Ob~rmL-=F0*`^xN1BFkF#WDjc`GRcc>{l8K3v1tynue@=nxb zz=uJJ(`U|J#h^^@YfeV@4F(@Ay^af87HoM75Mc08P_t+XI?WjxX+bjS z-j3uYfB=J1jH%NxCAIQR8Hsq=iRRYsEl<>LH|Q4zW$V6wfkS2cnKTwddgvl9e+N?H zzJ-prVf{&Nwvm@F=T}|Y-u9wt{{V1+7?j4magGCPEU&Uh==JS5^2#*V?E_kO^Z@lG$T1gNpy++%-j?s=spHRbCX^ zXh7FF&kzZqA4ucg68$M|CS zT-Z6Et$p(iNkq`;e_*NjTkkpWgjry23bqKt(aD+>wbJq84`8-Lhe7GVW^Hz09t0aq z&G8XWd`zE?T#QFpgF-XF-DGV);U?i(ncyx3H7bL1+#Jm2A< z4!5o2&Ew+-WdfO6IT!BpA^TTn&}aa&1D8m z*6&!v==$m4SDC(RQHcX<7#t0!*}pi`SYkU=H>l$KDN`x842%P{J&1c496*fk7*c%R8IhVJWN*gCh~d%bJ4s zFuK7qjDzyblQeUWFKZ34%X;Tm1MrYb5fJ8AU^VSyMF{tlx#z$iVtfcVavhvmA z>UWAk!rn1$r<&k-?D6wqKhK&w-gQ&-y zKv&?un$kP(x{#UZ&cK&)OxhiY{BSgfN5T%IrwtWss7%lpX!3z^Gwy%AWg*BEgVJp# zoRx?h$U`!ry;WM%&HaVVP@NTJQu`kyjG;;R;D1BDrZaGAH(mC#ZN@-3&3Dp3?8^T!FTm-U~VN~A{z2N!&CO5$o zU{HF4zb{HO!Va&T409fzouk>`tz5op5x%7iLw*&7c$)kqp@lVRyyhhDi?gNk=YaBH zP>Lt|s)R3`PfN7qzCNXrPdhm&W8y#yG?H`}ltcIYS;9FajR%SIkdbR%H*)Ur%uzPQ zBr>WBB;%h=g-5QT!baNaEBSbpl1{uX(H3n^gS`uKNvjsijw?i3kJ13^s0LEvje z;-ksEBHFUFi!mv?s{{KmD8K$}J?Eqm$j63+hV z+EuZ`-IRc3KpqBB6LC+G$YU>jhKxHjE0@>2*FWjU6P;}-jFOMbZb|rtnvAeNg?11I z{(jlHm3n>d^Pj-qV^AWE_)|g}2i+0Csl7!YKgv<=emZX|?D3a`bTDtqG-^JQ0S)kl zc=F|K>E%dc0vt0Yb2X|8D8G?HPR^#nj8Ypl#uRc*g{tz2;=|$C9j(hrf^-9eQd43d zN*MdVB%@XWa}4>X$qikgDN39B=aGaiDm&HEDp$Mmp;w)NVQrsCugi|HR2?EHfq1x^ zJQ6GItNT+MPKZg#DZGjd6O^mvrXF_sWE0y@Lf7=8-|m16F_e*`4POjC;Y0h> zbHkWx&2SxxL5Zu-?o4dPQ%V2z0OL~Gq7lPXI% zBcKD6lc>GDI>c|~;Z=;zq=R2&yr*AP3Fm;kDS2tIMoqIfXxF0I(jvfzLD|({T#-2l z)LlcH^!BvsM}7je#Gq81lhq``qAhTis%9C-Fj+ocVtN7Uu5_dKt4k#ZMrcl~iQ$iYRo@h?BOvy05 zfj^zbRgbz0C^6(KeZ@EK65cRARdXz#ylU-y&}1D3r7}M9u#Fx3Yf_$ViLY#hZ$9Nf zPOr)-23r_W7Q$g(63!7u$lRbGnE?ldX|?W{lSAh2vw|LBz`7*HLHIwL3gsx$+d0Hh%dj&`Kw?%~wJ?$Y@p^+N7E{;P~<(3=@Mq zP0!y{_-#E2VWc@eJjE0rW6IE6O9fQQXcz=O2!qm&zN#-_4Ku>ZCt2dEw4>H#;~2la zq(>GIi9u;d?HZx#T@1CgOf+ORZ(8yPXg3D=Xg3w!X@sh^F=*P@SX8zB_Dg^OgVOEP zZz_##gb~hC)E)u%_0HHUCcU6`N~!j2E}uofYfGjaMxCrClRA_7^VeE@fOVwV4U2A9Awif8a zpmbkjTT2-G!+9!d0bg;Z?QrLodnW*S7#t*G3VQ@d_y(t#(lb*udqjtz%VNAMV$A2^ zo-Rn!HFkd>ACp(aO2MpwIUC})hGbjPv$VM_+)nCxWkm8^U?B$Ousa1w7{mDFlq4Q* zq|}yZ%ZoZC#!7AM81bE(sm-;bMBe_8`+sVCJ=~mThAXM$so_C;HX zAgEf+6?LPa`GS9NT5PCY@Aq#Z&S6km@cQ;PjOlN1u9Cc`r=;-1P7=Nmd=NDCG*^h} zABQEN(l(G<&FCy)7|iEDR-N&h7ohcYEVKH#9)ba5P&R0fb&*g;<3k)_ze9Sah1S#w zc&$F4-Nosh_7EvBC=-Q?U0KA})7I6Icbt?t<&d5db@@P=u45-NS zb?~ct19F)s<#>Cu~CWhr445^p9|WT zq}fyLSbFo_;UEqSfD(NaY^d7#vj~a8!N#=s(21srTDgeE1%R~*-#r*zm<9Z7y!iT-0p2nW$N%G9=eoHrOFTqV_XXCQjU)^YR`_N7k_mp7i5D$sWD&LkoJYC^L+53 znk(vgU%Kyb24lsbl+eVX5~01J@=vyC-;t3YBhP@8{QS=d2`SEi5;VIN`P79nOimmr zA;dEmB0eoWfIYMQXV`KyC53B7O9;d81`Ex$gRjt)j)coE4;e*RT_-r^traYwO;=FuT z_sljc;4np!j63rZ(h*Skzd&YPe1 z;_YyoJ5<)DcT=U|;igWGDZ%sxbA@8MF;L7mlp}1AA)y^I0lE;dCL6Ai(9SvZR~Lv- z4=@hA&j{AgXr5^w(EF1Cg`m9{l*|3vn`P+2`AlQ{P-C{rk%nat1(%=HsvN97Q-&FK zoq&q=L__eN+7exAddpwHx;gvBks)`v(1{Pu+ieK2Jhjkb7Yi-PJwH7Y9XMmln zo+}||tkQCJ&6KgFH~$7~EvQ!YpF8OwsXG8lwtQG5LmCFBC|R_(tZO-KOZ^crVvy^= zrovz6BEE;gL(2-SMKitE9RZJsLCI+LZ5D+Tv9&cytl#WsZ~qENFeu09z6kB=W~ifS z1xvr42JeBP#lRFu3!pXf2FqABe-`Qz1L}f7x#+5>7`cUL+)eO7gu%PB-!eG?q2Yry zmlg57Vad)8gr@e^sH3iZ4BkD@tdxH*#+U}z-(;76NMsVYsIr|%^fDa2YFvZ7BMh1j zD_=2wR;}K^CJahh<*b!c5^l+UgQaQhcPxp_&_j&Qcnz%{Hkddh8VM%{WNWVR8+ZQp z!h9Gt2Bn&Rxk-){UnLLiV2vxrx*W)zavlr^gVNskHAa}N`^MvfwIE2O?Aon zr>q!4KavyJFEUCiVOKx;rR%pq)3^9AJtblByU>A9jfbZZ3(opPPDJdWVOohm+rgHG zzT7Q;eHa`Lt@Zt(vxl9H1pUXL^rzLW=y)$}r{>6!C>inI9ywuy;Fc`SGa${P(n`VL z`f_u z@V18;yn7@ZkrM+wMQAiB*2tAf>y@))=p}@J9zNg6alm1$3C3*gwJ*YJKJ!01&g$?b z2&Od6nW+3M3uTdV&w;ELuSp;CNpnfQTwm#q8lSe47h!zE_4@K{Q%X7)ov~rf4}25D zk)PM2#Q6PL8^*vlIjBd65=Mf#d7fi+AU;_Cp;-v@voc0FklBii3LHZd@MU6`Pripr z8F5xzLVUEwCBC=&LcTB__Ag3fiZxCeZ?FVkVhGHLy zbnFK?^+V~NX2UsO63!T)DpzIN=(UXzU(3#pRA%1&|FmPps&CBJJjEbCGu_cfz!PSh z^6%M^jTpG^1vfmmgfJoJgtvj72qGvF;i-0*Aa;t^N=g1qP)nZ}o~r z&-)oXwVX82V_(~)sOJ<&MUJt0UHG8E9m4T_*xGm?KY^H2FmpmBK=uYlx}Re68>4R^ zL&TtzOSdX|T`%o&@n}@3*=0b2!Jwe2hbtgT&dV%6!x#fbS2o=r`13{2CQx8wP>yf7 z8{mQsfLb|)K8%H}318NRw+3luZ`DoBpNg{S0H>h9i|u=9mkseD(k}83`yW6Gf5_Gl1YY;D2$;`fOzq9Jn(kb&Rz$k0FJlfIeVbf=I+darXQ#A`S;w* z@%`1w8%G`N&EmYx-nZTf6)t?D8=S*ulk%&_diGTCuqaK2ie_BO^P@%=&BK}>S>U<0 zF#fG||JDGKx3YF|@nU2Q6#Ti3)^o4}bS}eQyR_I9^2tEjgGaA?UURdnVn^V^bf*pIs_ckJsuO~W2XcKvLvTcYBHlLfES zPn6tYIIv>3Sl$v0<-&r>X=`S9!w9c`)0#*(tYBUYaz zAZCFBo9+|RzEjow{;Ik&5lP=md;OETD%LgFLRqO7r}f}kNQ z5C(ZJQ?Qj%1?~6>ttI51N5Q%8PuUa9J~B&P)Awf!9Pl?)LiHzd;MM0z*YYyJhsFs@ zuzfPSR7`yADJz2~{`CA{*3wB&try+z<@^!nV9RpCr~WC67>+?Mp@-169t76kB6SJg zQ5wt|&IFTt+4CVdE>(#CoNP70DfHdV!^4!axBKgrd>9KSEO5Kn1!`nfp}EXw9EWFZ z@o95`t3wOK_pz2-aA*dQ7{BGMx?gxb08W^z#R~qP+8{Dt=qxXT!O2-Ma6t_%38ZD5M>`ybzL)Xris#0J18t^z_%xxFJfHZp{aruNGI98l6PiNK&&~zy9AXoe3$vu#1@!{UxGC+=S!hYS* z^#U`2r-nlEn2jED`}5j_Xt12PHHHqOerw$!##-`dk@kj{XN2a%XgOg6Vf1Ff-7Nb8 zGo)k$kb`G9IeTXoyD=BE_SNSE4%97_=?!xqt4@eW15Yg{JaNmm3ds1%5;L#o1wqi> zR|Kw5?l-8S9vg2I!mM$^N@vJ+0X*B{C6&=fCS%O0GYfc^D^6HleDs=njM_7DfjWSQzkejrF#TMO0l)P$lu9D2X}4# zjtRLib)2yAvgIuSnPw>|v-rzQcJqNM#xJ*h@mS;D7NGDXTxF>&fewh?*V=Qa+(=Rs zIo4Q?b_WG+nryN=tJso?*mnAHL;;)@P8hPsVSxzM`PwL^b+5)|VO%;-Jo=vae5M)N z5R>!on6*F(nIxYOpGTJRw?30hwoKS%85rnzS|H4@=ely$Ni~7ke{&%8qvm7rIkbYz zr#-bhZGUaj5VmM~TwtBEX}xcxRj=;v2M3T7UYGTkSj8Nv3)!gVy=2mVy`qlB4)&SP z1LnEuwBi5{r`s27UJh+IrLUg9resHBnKHhaT`8d1v6H`ju2G5X!yq-Fc3Vw>>5y12 z^EU3(L$&cv>;nZs7B~Vh)mTk-zAj)5*2+AqZ#C&w#5%ihasoV7>p0;#d-r>`HlG$+ zrM*^R!QOIH@HN{{%|UlbIeqHeYap&q2gJV2mF|z|^RvK-1OqCNz?M)rqz?UU@jb77 zLl0YicGT0iykBcJ{-#1&OA4(1YzR-g(5VXc!fR;jX2_HaY-V!Tr0A1#>Z(CvbHW?p z%U}Ts!MXlrNiI?^zIVdb4gxa;^7o6(^R3h^%Wln)LLT|#9sv+*hhT_+WNa}k-~7%3 zz$ll%sC+10Pni%j{?psjz}3MC`}(?f)$3wp=qGM#Q{X4V$4-H%HI0IhkD38m>~!+9 z+_g#}ALPo#k z`ilO109vg zjztO}Hhm-hpa8N5E2WMUAL`~==LReF(Xh%pE5JsAH^l^{lzsXi+%;BH!;!&D_zN@q zaSP90HB@17Brk1S2ER57U4+ITtX{8-9j{U5FaaD@2zD=|Cp*XtmrgvoSeXT^LT+ne z zV%P0bh;dxFfQYg}SxPEXt&8m(C*F={!`bhvq;92z(o5QMb829bGtzGau+?^*IhYZb zR$`auOCe(xj)t!)ZL*o}LmplYy0zOly>2FCI|kst(zjCye3al&D1yCD8?mL<2w?GBr#_bH=`y3{W4 z9^=?DL9a8=W9eMM)v=S{Bl7~Ne@d3mu_t2=6@eYh32(F&Dp;(!4ASD;T=jv7e1HgBgHVM!{YHI7qXmxXi(9~DLVE>qSW=_P0@hkp;3J<){OJz z7FUp8w;1P#;|=s6KczwM2C%2wBfIX+c)czW93Mqwi52InH0>%hjg7>W1^~;XN*NaV z7{of7|HQuukBW;V+j=bdygp=XlToj04U;DCH+FZK6cTw)s`_OzC;-T7#cdS)bx~MT zH)tr^wG=LnZ)jn_14(btS9&tz{S4TyoUlt_cACnX(PsBo?{_G=-DsnH@uvSijh%j6 zBGta)V^jFTmc!GT?9@WqWqCxzk<&FWFizOxHe!xCxLBwGQyz%&{UZMD>Su}p^BEvK z!W$agM612j>?Q(zOTbY*zd8&42B=)6sX__6a`H$s z-+Sj3mn@FAXkfsHL+`5b^|5_(H^87cVVQSLg9%zbAIg3EQf+4U>(Xm4ekdz~1*0|< zshq|@6(?&xS@W_^a4L+o#VWv~a=9;-+&K!pSTL36E^xvdxJQYejk4*f`6SD>=O*y@ zK~7lQ9R#3c6Z9;k#mqJ}cf8#MAe`{tuP;@H7@ZH5I;n%4->`FL8t+$_2AFu>HWjQ05SG5Ip6O8_-IehJ!u^WDMAsSo(me(bh+5~NQb*Qws+ob zOxOgY+HyUs%hY$F_V+Wagjb%N3Uzdm_PpYN+%xxsSa-zPRRkzn>eqHbri)gz zV0rbG1~LT-rTe>fxxM>+u)6=J$^pcnf1a=MX^@K`%8$Aa>hq4pFNEplgjaD!wSJtC ztcezS939&M25Cfx1sawtrfRuOk1cTEbl9@rmcrEU)O;UZW-{BLtSuSB_eQFyQP~1d zqP4_c;#D+{;!43?-ss-#6s^b`e7aL>S>HOTE5(@5$Nx69KipY3;p6;EEjzf97?QNB z4(8ajNF7XqmHQE>%g(m*Iqt7f$LZWhPxhv0gFo=)>oCW(l8zdewmh7%@$biTdP3j= zC+zRlFXdpiDtkfOcV%V!XzLGSe{ar8K${&U=4e10VZFUhuYb~YJ*`;gcrrK20HC zt+g#Su}?h11r%9g294=Ygrk=dhhfrz(ADsUq2q*eR(fr6vKC;HwAKlNIjq~_#6t@6*Q1g6a)U{;4D=6izmfdu6$E+nk62rd#)#du`j3AUru? z?_`gyElR~;)L-W)q7kF z+AOu;T%n#@tv160Htu!e#lhXc;`iR;;;+9;-fFu6V+}NVA3M2*sDZYxg#*=Yzmoyi z6P6sF0->9J>^(PgPpeL`+`roBgoVIOtKV6=Pdo3d-8%5S)x86s8p+c2AM$5gSR%Z! zI(~%@)9L>+&%_qQnqs2HL``CBv3*93Ew;qi|L5MBot;7MFy{T<`@e_ZnUCnqnRCxQ{hoX0 zy;Ti1uWR6u9IxkU>G03SaR(EYdIYrlI3{Qe2FtYCI)=NV*XhVbd87OCgf+w9p<%Y& zetz|t&TXUS@rT*XC)7joJwC3eMT0JcF6Xdkcr>hW|E#l3@Ec5c71p-L88WAEmyA~l7T%P>Ya(y$;Je8> z+hC@3CGxh122{-~jpPw@68~(E8wXX5PR4tQQ#~;6+qpP%_^VLzVL##hWHsay4;9VzQcmrx^3n zEICDL+C~#_i9%cNn!Z&tys9ZDqmz_FIl9Qgyvza>Y1YUH^S&pSk+J zR9oqsJqe32>e=mD(nnoMqCaX$AyVUnbg#_B+D;}WnDa7UjDrIG8yhyOntpWtBpX`c z8IZ;h!IxMKq9(KK@kUc&HeaYBY%<}MSl1U19T?HrR zmpgWM*y0O*aah|E)?a*s$Cfn;9{WRd+1SU~!Q-|)3?5(11do5KylnjbUxHKLJRLkC z^}oRr3PuJ`D4SKr&;F+@ZECaN^l>N4GGdknXZGGzHnCy1vaG;0Wm&h+1!q4gE;D}j zTG^!E(#mo^G?wM=vj*pt#+R8s;DgQCp=J56Mh8zGJTSOmVn}ddc-!FaMg40ATf97i zr?hWcHs#i>;AwRXWz!BH4W54Ua@maXZNW2t*k3kl<>9i~?@tb%GyRh?Yr&ad>!P>H zb+*Lc0&Umz{Ug|C&;GdxW72teGT7%sbbx;cS4DnLNKDa<=rKzp|>j-%Iw%+2wr`G zG&}^iVz?~dm=jRdAm_Df8r%V@t0{wvIRMGK6=Vt5OD$)m( zal*|9zNFktB7SseJmX?3JyG9QmhFbD1&m9@n6K*ViF+J(CBhy8^kX3I5%LgRib%rV zF>y$g)227oUfBC2zW{h9EM^F>QeumLD(88b?t_VEUWmaITPZ6Cjp zsih~1p87UFz7O!Z58Aqgp++U}>iP0l+v|MHG-Ki2x7TrZg*T2XRtv1q=f%w1!i^hT zsiXn(?6qq#tp(EFo8(zVNO0WfSqvBZwe`$cMz3R7Ge>8BIigN0whlMdeGJ z!2t!CCSGG{$=0>wM>>?8$+RL8-`4Wp`;9>$FnEK+GnY6Yy2JyUNUV(|fzWGveQ_zP zW6WovZgBx)SVHMa#F z-AHE5_U55Bv?+iR(St+&EP3g?`H9Q#0PC`jcbQiT21964!V7Ue{LN zaVjCv>r19~uV%rhFvwk6w55Pg=T(e8Drw1vdI&K_P`jpouectoLy$6bBT_P_?1#>2 z!00sF!JYInrysJ`X5EMx!s{2!i{Vnyc9&pAP+{K-8dIlF;bfmYfJq--!*o^*lF{1ABk+td3xaG(k+I4Nv+=ztc&eN)5|_(W zk;LWVG(;AtR-vehNc3A$9AK(kzf+8pU`?nxn@3Y8!9AWGt77IVdXJmK5vD|si?E)D zsXuSCe59hgUekcFSa<6e!{zcqldfXPh~qH*sPR`!fbH;>FNv^9N(?tCgtaI&-dI$m zZ7Im9+QjjW-+JxwESP=_a>pB$nQNS(k`j@+Q$kx8LtRWV`eZS4ny7F`w08;9Utm&5 zHib!oV>6qW*?Qs5(y7hcSGkg@(@Y9~J@K(jTNUJABr!jr;sK1SZPEKdw(Dm*q4IP{F#j9p$o&Q-FrDeo z%ik0+kTwiKBR33W-em}DTSu>2fCj}fLCf+DHPtx_^eqq`nrnRTfglE^WX6q75&{vV+4%yc3 z4y`yf=m?IO3#Zx2hb$ok*^(bp?3SpEn+3WzEn_Iv6l@*rwU;x29I>&pZJ43Z5YG(kkyRB@m?d&R$-}DN_FxYR$aqkK? zZfE0-eFVo8I)buFfCuZYa7+~oN1T>9r2t#ms1F2IEPIcZ!w_L7%10dH_ovdseSi%< zsCGC*dogg&t0@dy3OAN-EG2b^6kg-n3XV9 z7~~;I6km|WXQ*|j5HAIpgS)Muv?WaGs?vdkq~mq}i4BI3DHwHI%TPjHl0)DMj-(j& z6>Fh_18BTrMxglj91%#-K8h-kN<4DE#fDd~-yUO0-TBPaQCH^zMhv9xEC!)Ts_XCA zh}dnPF~o{w+{6{cCTRY4CRdQnCMPJiLWVSH|05&`b8JU0C#hDeB27icEVWFZE~U2RA5#?&?~y|Z%To_Qq(v@ zb?R`&D@`3L$zYm6sQZ2f(_7%#kDpSK7J+B&J_{0}Yww@On=n7D=&+ueZi+(h(tt#2 zD^5%=tu=dFuNKxvVM3JFn`49o=J3=Ke^Saq8+xc!ca*g(RJ$i57PC-UPo^uWx8!|( z_CzEM5QDtlG9VW$ergo2(h!4Phx_X=D5(TxU$%+~!?o8VQA{IS@o#x(@M>l}5gKRi zHYh?RP$lWMWK5O0o51l;!YEQo!hFwgyKvk0M=73En3$G76$qg=`n?U)x@waQ5+mfD zXO8dQa0kYD$M(?}is>O9$QSOB${IG$v10{JG_buiR;Yd34u(^d9LxkUjATyE9ckBv z*cDJR`J5!0O+}dn1(|Adf)!6;ZV;H8*{G2Rg9~8TwcJxX7c1A(`pMiE5b{Q0t{wa9O@F>vJ(`2(sY^mbzLaGwM-gqs0KX}aQG-Z~s3+@8y3 zzmY$J$PF4_i2F>S)(xOlFwL|h&#NZ11*McH7SWnY8961tx2sdu%LtEBSBzZR9 zzRAQQNF@T>(&H58S*4vPL;kJaJJGKJ12M>l+%F>!ltfhyu+@4ChU>Ii4=%CU*lO{A zu>TNwuGc%R(-~kU2Dv=PnJiO`DywtEB2E`^lLASFcf~m@V@H;=(`>n)rV2uKA&UtK z(Uh*DTSe-5&?pP@m6!wv=g^WfJ2XkI7w>v|1`}Sjy(5-UsNoA_PM=N7cF@*aOgsD4 z*^F7l+BTbZD+C=O_BXScQU{gOX!cfk|J-Sew|MKV$&s7$CKP0cY?;}>2I@xqo5nkK7;!1vinC7}|VESp~_t0E!r)K_}X zegGZ`gFMZP<#UY_`DrSa8=JA;fiq4s_QNmi5XS1I3Q$bYA8+W8mE>tEvI|A__8e{pR%$*EVcVo;1FKz7oxLo^YOBR?VW-v0);F4(%wm)u8@l2(qf7& zX92Bl13FAyg%tSKq`%4tZ7=tqB~TU7l_n#^PQ25Vc_K9J4(&WR@E70$2Du&%FlQ8H z^Jyw``zVI>TRukb?LyYG-YU+vEm>S*KR1s}W@?bckaSlREj!Ba0_ktwq=jtQ#3?G8 zwl&9S;sN(oFu%SmRHAKnd(&`&c#y8%@qGr6z<6L&k2bc?GASNVn5%jd-(;YYIrjqy zi>HvM8s{&WZ?mqZq*n;@06km6x!GTT#NK4Azb*_LH|UK$StCZOan-gjw4 zT5)c9+CPO6855GqGma07m>3aOKJoLe5!u0Y%d=PbMHrvmE1xv=QAEz!W97NL&z`*R z?uMBn9_%rH_)A!R@TonMOYLC=x-a$=X0Hq@JonBXOYF=r%l=&vQ^QgD)D3GQrh82< zpFXcR!e_?qG37IjX%VxI^e&$r7ZWjOYol^&tLApEr)*88b+>jM+I4B)p;Oz$&f;&i zlxst4FW$-%`mG<2rlwx9erq!GOYgN=^60D1d&r#ICXVT@^gp&WooQyyxo^a|q(&b8 z^6saeJQyz?)#|Kfyu3Qgjo0#xMPc&NZUQl69Z_BvrYrGkX{N5eK4ADU$YnilGM{TP zsuVB5CW+k!GvI}|_R_c*E)~twE;6jnfXcfwZERgK&Ixk9Vrgq_QMB#yQpy4c5l36w z<&RMQ0B%XeY1;)+-dC@rEW9Y57+EpyEq|foc;w)W7pUIA;w#)Ox zAn@uvN)U(*bVb}>dIRYssj=#IP2zOHe&9Z=z*DMySddsNyzlajGdjVd|CNe6QQp|B zf)}>E8j~a#v4`84;7*$I5%1#A?^*%{7@#zP!s;8msVf{Ls`g5O33LG6Er)fntLOS?cBJLMn~j0by=86dDcW)Ce6B?4yuXdm;M z7_x5sLOsE8-_3Lss+y;tmG;8bnlb2)9kjxP?YSYlv!UXUhwNn965c)ObE=8JJFhRO zcHuche~g@0Ebwmn7fdKYbhh(1sf2f^&o1gDNL*UIi*V_SU5v0nWYuM#2-5b1A`Vd9 zERaF=-AYsV^R6kyXF5%oaJd&NlJofiCQM*^{65tnLSQ?gynpNQ{qumAd1%2-Dhr@~ zCGCkJ;&>srL-D|qO(Fy~+~3Lc5Z)X50~4UlRw2_5w1h^GjKe=LJw(ayILi2I>*+2D zczXF)P_AFmf9kTd^bj(2_b3>$D;D%(xY!%jV>zs(#Y5O&v?huTL=(JOb61?;alJ+c z837{(SDfG#8u|9I<|!F;%STFZodB;?fK8TU6F(FtV^=%27ePO0);Y^FkQNLQ`XpmI z^f#!4*rc|DvEqcw9sgoq9HxJaZRvS^7~0uE{}I`vHgda{ov04nLH4L&;)fMj@+Pb7 zGkIPq%b)JZ5a^CLFY3}?>zBp|O40dp_|*jg)QAbThPtp15?X7%X{fOUk$qDH6=(_*W5F|UTTkG z??Hk2#O<|&wWUe3fE?YNC3wqbeld2r_=-1$MaKZZeogp+A?lb~@E@VwDutx85>p@I z1Pp_u&oRba6{&?27DgKu+l&uognRWT4QQ zQ7lapHJBq}FpTSNc{{9~WH6!%ET&8q)<19THqU2cc4Q4G6?ENi9NUXvmy8AsPr@E= znaZn%;m^5tr4=De=+k=bJ<_3o7S&|cnnhQ@t8t7asO{C7>{wg|8oUXi-)gamWa=tv zho*i6w_uQ_E;`$6%9>n_r5PQP=q2JO4*0vVO!0RQTjcNm#iRJZsnNHBc68A-GFtP4 z=VTW*j^p#2j2~Fsv{iI|vjJJUkh-b2nzxA4HNO*it7XkLx|ThSY=2_=4t|j{ z3f9bY7$n;_DzhMSN;O7G%wVE`ES$l37Q@B9w7KL-ebMF?thnPO;Tp{n+e@x7F$|$( z@aBV^Nhkt{Bub+A>;m4Xy0#7)MVrCPR(tM&-0jx@o!2gE16Fgl0Bc=gr8^^j*+$1i9nB&+bgj&gE zqu-v=?#{K4HHFrgNX&ohE1l~d^O7azkw5kB=1_+6Wp)_14tyL@P*kq zkfy5GMBIDsj%_0N5kZ8}?e1*05DWUE$vxOi!n=ME|Ix1j+-uO9R#a2y$m&TMLDGqh zelt%mTf>e*<1aC0gCLZSK(iit)S4|KZ|L~Z@8@;_5xdaphEz|1BMvvX2}c}(#c)CY zG-TTXwao%pBSEw8alNU~kEQcQy9ZH45=X#z(5?VPZ_&pW8EMe%e`oRp@hWV?(kfLr zyGI{igMW3QDXY0EZ0~u?7Pdb52Cz)+%AjgiBr6C^Z zFvrd#ysh`^x>su9AQHLz(7X^jU&sn&19!kmmburSx_Av)d3Fy9^(B$1L-4%NMql<_ zVU~AvV`*VBgrex+PfU?;qjv|YIKc5%f*9}E-RPV1@cQ$xpNefjH%smf;3h1_g8caf zu_-X}ydZWWNxOD6J$vsia1?_SrbR(hpvv@1>enC8%G7UJ3`$C5$Dw8Q*$RhZPiVlF zk%Fv;@846=xHHr;g1F7efKHre0-3|;+!<(hj74r2#B3$!T5{@qc;9@~&BRg)lQ^f6 z°~-zfXctIELFMa=Ulc-7UjTo^`{qZ=D48M-muZLc_+FgCJm#0)vz^ z2-*wP+>OJR+j}Rnh#^!;))6pCR7MtNXYpxj&8B#9Uz5Qco6S-d1nf}S&k$DKBe$34 zKLG-spizD_kx}wRXj$3eC-5aG2^I;?`mgE(SNQC z!gxu+o3jj31I5;5CkcY^?jN+(Ga?AYQjPe*C-MWJ|vOANI)7O&(7>h!4-U0c3~wT#2^{i$jL=&$L*1n3bymr=ZXP2YI}wG9`H^|fyz$( zKbUz$svch1l=dI^R}7L=MVoWYd8+4A;D`aOc>s?(^)9Jc049mT7}zJJ zCY{d(T5IpD6iYaH1KCg_uJ5dT=iMoQ6oVwL@q7`~4>Hs&p*$xeoLzfo_S_)fFcJUk z7&e;B)%gcWTi*iQZ=v%^DsvU$imfRw2)Uu2gV<(WaS%gRqw$(FDE#Dn_%}sPK4%H` z@cCk9-X^TOu1#1s)aU^dL^w7g@Xhxf$)Loscs@<_m^i%06MY@a3QOwFXd|~TOIuv3 zKH3ljd+c4R1AvgrzU?j(FX-;$v!;hPKoD=B@QF0tRp#@=#c%ZMcyWEsQ--M&{{^Fy zS?nA#*QA7^Jx#$WQ089P$VDE~{w{T*F-%%l-vr54WA zRPg_@!dc}1a^Vbp9Yd=&3cig*FW-;zD<}E^6DUP5!*lrzBLpx-=IUbNN>#A*W|ga8 zn?l$*g39LqM2lZ=xJ9B?A_3N$UvGL3sCjQ$Uus(Ah#bl39#Z7EY!y^q$)bQy08>Ny z;{xRX#UHemVcU83PsSE6WdZ|%Ov(hXlz;xh1fwf)tPfFdzx%I6k^UJVMN;n=3!LX? zN>gba7SH?;T;$x%L=Co6sg$| zN2KJ112M@RuRZmkY&|3ojO*~fe+X74u4_ouP44)ls#~I^FkLm6s>bt?_+MVnlj8r# zj7+sc&~tc|)jSd{ZGL4WL!uL4j}$Epo<3uGuDL+%;1J2CliXfn(MG>l%Wwg8Jo>vf zYl6wZp^Ltz!POS&=Eu6aq7`mz2Q;BG>w>;_W1FBhE!o=WS{&;w%J3svS2XF;!<8H1 z#zT#$DH`~Cdy8P!M^E@Rw;Z*+4r9Y0@oiA`$!I0TV=h&$dBt63W)ne{5*`p0Nstry z9DFQ@T5_&22O_idN>06j2Vevkq*;oEGHGf&TvVJPyu=-6e>hh0Du#=_tO@7M7<4#V zL4*HhqS4d;in~kVPv4EZ124FP+@4a)VGhl3S7?Sk>nTH06h}JU7;SsT%pp1SHZIgv?ScqWdBsga3TI@cRaY7P-%xKOR`unkE0=gcwc7)|KAcuU5qv)0 z4upNaFdbKivt)mixR%%qbs6PINc)G;staVbZfzKA7V5+}Wq%bgVvqv&cyn$Jl!sJg zLnV_Zm4H`0&)h`g#;L`UxXGcOfBd=Q|2)h;aVYfMshYZ5r#9C)cly$WTfZ&5eGZ)+ z#|k^`(a9bxWh*K%={SSvh6;MJlSwWTpVi<&Va52*Q?BaPW0lw0nXxV;OyfWc`t3V4-Mo5{<`i7B1o<=ANoQQe`oB!^oa z%5EZ}`}c~l?yCVU21#@yi>4Q7$=|#U0@5`@SuugzNW@P{j8J@2n)oTofs`zWShUhB zd%Ir(>M%$aZ783U4b91F{sxKy^|4vNAu}QK)mw)?KN|MQEo6Sm%tt9T*cpO*4n{X? zur|Vt=KowgR0bIn28kOfnXty8@+Lu%CcD ztXTT=J1l^()94$)Z+%!us~p*(SlP}X+%;nkOKCzSBe#=Q5Hj!4`Dh(ceUxBkRT`W#2D*JNRhPEYI3L_r;EtFU@Sc@a`sySV~_Sc{loPH0x@gzlhx{>_OVL z_-U&k0xzu}|0|1^2`B$ng4UO^{Yej8 za=_&9gCL9;@M%h0yBp}IWn<&$j(f#w01z>^&sZoJf{#1sqtT()S>ZG?=|D;3pHE9& zWewKS36R7i%O!<)WXHJs^Z$#2Lgw{Jes<9*VCgCJu#{?mVW74jKXP#=p5y~=?5&?8 z?+4olhw9;oD;)}3z@8SS)bAyha#ET!yjp1KOKfZ5_IlH)5`YWp_JZjwCkpDIC2S*& z?M+AbQe}GU+wAvb)O)7+uZRP2h(m8Lp~ZLT$PzY`sbyz2vWM7aP*#B-+lLU*=w87K z&a&SlaqmN9bPRIY%?clv@Z4lP6$AKV(2gBcuHt0r+-k_PY9V;XH2adBZ1M}dhzRV; z?MJQ>wFH7dE70EFhI-U?Nod__+wJ*l*_;L| zVVhOQxo9){g)mOH&uE44N(?D{o27K-BdjL^wn1BHr3W(eGOoek=q*u1(4QYv>jP@6 z!^$Clrjq8a-aw05|7SF}xt(UK9b)irHCJG5)NVDUsyuk%nVm?LVF4@HJ;IG%Yt@j; zh4S1AHN7BY$fbSPAvR#NrVvNk#0B032V7AF{0w7m`+j_(N?QOnQSK#R%p_l3c~=(+ z=A^^*;7%Ft5t-HEZY;-L`LsQPTRKPpVgMQL$aJ++k+Dd)W89=xUktw}j}{=ZE1esR zdLE&dM1cXV6hz972u{MSjqs1sPfcKKG#ucT0WF}^Pasu3I853Ti1L3?^G?-m{}V*b z`+}Om5sv;5?i_bj^-i+YnzQhC`PTj71acWLh<5oQHG zJVUs%=rm0UWE=6M(~HsOlhhCx$An#AdT>lg7FDZ0shG%vw8tF1bxCy|@JbODERyTk z<-5tlu|Raa+UuSlunL17v#Xz)i-G#M{g3->D+qpZzEEh3=;qxBk{j4Q096G~{37S? z(fBhQ(f!c&hpgD(e&ZqAP}@mpc*hkAe?)T&|8H%%3aNI>)vvdI+KPHVqlz5fVP*?n z?q(k|f?M-{?FKWncocWdG1v~${<030nt4ao9x)P~VfD0THY{Xedi^*S5@kr0^(gXn zZc!uV*|Y7?O7QI2rZOEzes>{PH=%(TMbyxD>VPHsM60pW-vnvKz+s72J^B(SVr0`h z(T3!d(Qe;>&%uDTp`WTYKlg-ky`>j( zmIQY_t=$lhnS4Wq3}MLG6TTs!OBnDF`WdV7AHuSleY>aL%|Hh7ZQ-@zK0pixGLWGv zYK?9O>ca+YFNZUoNh5YG_`lATCM`eox72aKQ4H8|;9L5|s366~1_aYs+x~t7{gCJ8 z^4mRlF5#Upm+(8xC0yMABVa}w{q&uzmE9F#L{a(+_^O0gHq40!24KMTv3~IMfJEpn zS95ocu5t7zP~Wf~$N>l;%tA3-$YP2Poou0RMCxywzTLa9D*PSj_%W+Ps>JFUpl?Lh zg4UOv-|fJP*MdZ<+k}Vz8?<|xio|~Av8uNNt(+O%{|(ljfR(tR*Y8Xv?2Shs`|Bx< zWArh*G!%(@f6TJDs)(y@$N^Q%4{=1$xDamhYS4hpQwi^iZhe0;@<%Iu5Fxtl?TY_YMReDH zGhdB@^g;{Ag-@sMa4=dSTw(tP?V#rRMnVu&yS1LOPLC!x<~pJL*7^oSx?8;e${ieq zVvrFK8s4!Q0;-I&rH~aSw)w zygfT?=nqv6tva+-4{a6LV^De&na%nTs)xOKajawRWMUlpuO#AHYf<$QeNXPKiWgm~ znUBs@DhD`cP!1f#V&&-4r%NR_f?QhZDLed})6?UpiGuqRG zZ9r_+-w*tLBk0lLAXNpe8eg{vjIR?a@f7hrI1qb6Q21xfRq<6RJ|kM_g9uquRy?c_ z&`fBeil!>Eh${uocea&8)+f@E{KlxUjtD>|Ep5~k9V-aYQu~-)e^)8WYENU=Ruye< z0yIcPoA5AnEf9Bf@yiu zLQg4E5!n@PI^I~_5+;Y}1u=Xwd+P|oV-y+q;;wU5pgvf5;qT4VsOp693(2H**uU?u zDkrr%{!}Tqn;YqaJL4ElE@&h&6rwB@o=bMP)1dOERVjLPwx?<-gZ>>*%r0oj7mVQd z4+Jc`TNV21TuqhZT?ny?!0;oD)J&Mb@P3t}SHc-ffjK|(1p-*K-AbEV`w?$0%|KRp z)yME(v@JcRt=6GFR()H4yqCL8SVtTh0pRWu$eiH^`jMCR z()$S#(C~=bT#--t2t^EH*oL|Wb|mLQ01}yD8wy_;EHY1_PZ`P`LE%qyI=C=Oa5!Y>DVRvFjbnZ=wIF+!I@E7p=*6ee{%Vb%Nn((pT>*-unG58dBLzlU}7&T<Z|P1sI^1=$V2yBIE5ka;wGjvkt$(Steq=^T_BJyE_@AAnM>>e~ww zTK5r+eF9~sNBYjWR4pz>|pmBqaVz29zobW>N)Qkuz1D|?T1Ro>3a%u)_NJu zu#q_f^5TVPjo4$43$(#h8NUdx7~Ym97Q&FWwbf4+*i0hA(L1TL{Cq?R?D9dgCh9#X z1<=YC|3M0E00J$tgQfaJQOU;f4uaUw#l9{|@1-aC>H7MA?silKa2D2|PcJeTs2o#I zinBZfiIpq=@Hg-i8WsjuT;2-n6IQ9bHFIiwkKquEV_@N31ET0ril7>VMEPTw!~s#E z>PtRywfdnEM_EZDRSB}7B+t?DItr|Us8w=sg5I%mZf_8t3;nkbR$F-zgz`U)Ikoz2 z7fhCXr-2KQg*O?%^8Ww89s{y?*7RD9zd9dP_c`}05R zY!m#1o>nKmy=^#^)K=PkuNmL1Q0j2C(I;>^yER8kR2`?4b|#z|I5V=>Ea1#6w4g0V zSpdOpNzHK!IA%6!A)aS7tnfA5i10mC5EiFjelG5Z#fOFHfeqz)lbQoJar!F9=44!R zh%;pvc~kpDK3lE7`?)DC&A2pIn$nJs$&?C1yxfu+J;3Pz9ng?gToj32Q!hVm;yB+2 z$F3qJ(b;^K>Su{y)Y5@>!l>ume>?2bZ{@;BXSCtO(+8tNIcjyO1s94w0G^OtinS*8 z@^SD4cX5l9#Ag;{!RIwzY?IkZK24ByG!x!IY^1!&AKS>d|H=?LYGkgNRvP zF}S_Eyj3YtwK)S&YHw9a#ElP${ZQjxTv(NTa*3JKjOpeVDBVh*Jwb!}Qf(4$_!qZ#LhOrl0zG=C7ZnRG0;ZEWcO;4U%hGB`&=Yl%P9g`pgw;tLViZ4#PlDt3 z)$9zWd$~xrZ!!EL`%E&Ks-TcbKROnlum??4^`NkD)Csxv=Nb?tXfR`2n7q>jp6!~b zt&D?vh5+qdOsLB?sjSsvY;VZxeV916J*%(V@|?k!t-jFs=6egE?3IApCA% zvh;&Po@5@rUIcr7=oD1$+0+UW$MI7O{vy0`kc?u@>h87N z%yki_WlB2LH;@G4NILfkLu!S%gKik`76YyoI{1TIhE)%|{(q>ouCdrhNN=q}$0n(} z^~fAfI7GxL4W&>+syaynv;2QR8r~XBCD{>dxgn1+oY+J+VK`MJoVOny&b1~6v_0=K zpctgF7#+*yD1|-Zzu2F^ z@u7k_)Iyke_c#G zb**B!`_1HpSYbTNbGeSB4A^|YoBNSHi;4rw#^@s58Vmg;1yy4_ns{bXYHARl&Vud^FPovRNNwj^3QK@j~0I^v&1ESeO zz%LAPo7Hb3uO4y2&K4hd#;Nkp@;Eqk5j43z$~AG_1$svqY4pl0&VD1;nw*RD=fbzU zjRB+>@Qy==0Uf~Sr5V+N2F3il6vN|hCdYEZ{QH`@wgNGGhG`%MJ2tX9y)gZoI1-)# zHoUy&ASTIZQ47VTIsSAiH`Xb44=hvz{=D3g04n34*^J=b7~}y|lG&1%sg}Fp^aC%n z;vNJNI--eVxnS@sua4!C1y1Df9A%M?_+FAb{>*b@guCw>X#oK)GT}|)Xxt>uBHWxi znJUX9LX>@~qUKCByh5xkAU$lQWdqIy1+p+ps*$_)9vJTnqsKr(bI6`7S!$;+2yH7Q zQ<9$%f-|M$A<^`Z9+#5-H=GSZ5|r6lw-e-PSMt!5Zpqrxt}F8^rCoTl#_AVP{pKn&%b|IYzvY``B(B}4Vd8;#+Ck!e7u*8YT(iG`55(F=F88z~On!M0PE!_FxGFmwXSN(-1H1e%O7?AXXIW=tP z3*?OGm2Ffzf-Mhxcf44jr`0Ozji9vTOOV2iSKe2>5r0yMn6Z5G(PT7fIW0G-SiAcv z3!*hT4Sy-Tl(f7`ISmXLPa+I8mWRXS)edz0Ka%2jeM}oODHBxSua^tlxwT6*Ucj*= z;f_z6x*;fG6E%#3kEvIj8brROUO3HGK14i`s_$ns6DZUxOiLLPOA64bZ}a2(fGA_Y z1!&-9q7go=k)>Kv#D$^xz=sR}u-=$cY8`BTBFd zr?t|6Juj~toe3miP!9Mu%!@eSC?gzs2I(;cXC;(!9@bINxmvHYN;vTWJkznW(1uky z)CCAtV(kgpfJkWng3Qb!^Hexth=$avoNsAa?K!N+omgWg8Pm*`B05tmF(9mMk26&Z z(FVg%iPi)QtZ_n+NTZZasHcLd{c0eOUpSw>8bndf!@3G2J~h$K!+3;zwfl)Ca6#N8s1NxZSZoF<=E ztEzF33yYF{uYv^;kw#`@7z5&Xqjp`66L(S;U>`)11BQFafsT;a@`$DlNiSw1(l6~xZ1FQH5zTNE&n*6PEB zS#!TLzYLZOgVHGlLhd9Ee}vJLk!{X|6M?l2-7z)Z*oP>w{^5h>?ANBd7Z3dW*>rH> z7`zmNeGR6`A&7h-p9YQ?e~MZgaYTW^OzTPklmZ^#P{IqR^5?&RFy@D3&8!D3#Gss* zh5-`Jf#ggALZ!9ZI8Hv*N-7HjC5(}2#*9fgHrF=v_1p5lgBp!4n1Kya%6X|1Bq5E@ z=HWZ+mOQOkQR8nof9teH5`t*#m9#!hkF{1dkuVP6)64~CwLmjnX&jQ0^!IaNelaKq z+O?^KH3@i^mub>0Iq01uFwpBx1c_!-fq4pU#Mj1u`B;@9(7Vkfs-i5DEO}sPC|KL! z6<+0FU&`6is0Szs2IXKQVSV8s*PyS4$jYI!SY?&k_H_$%`diLdi!qfCP>Cd?r8K|< zOBxIizV{@LTU5iAu3i6l$%N7ma`mlTD+$j~-kb^_@6jB8(?__|i4=NP;B#um+}x_s zTESmeX1^S-(zlIiEfEW`PnJdVfT<|0CHI{;lZ+s~Dn3{#B~+Xxwl)%(iD2{aCpBpD z%qwxq=UX}S_H8Ac@lZZc$>%BwGaBiPODECKgIwp4vN}i7ilL(7~9xaG_<2z02b5kYZy{PG+yp$a?j5rvZ()wTR?L-UBU1n2u)uI|!1=bI*`85xP zzsFEtp++P7>d@GKxQ1H%0WRmx0Sp+Fa`khRleWkVUUO*q+R{0{Z-J3+VIXf%4tGU= zbpDFA&{8^>4KOK#tHrTSx`t$C8MQ|Top&uc&=hkEUzC|d>OdWu;9>BK&>#`=60CB3 zKPKvsxsIW}Cb>H20;)26uyZg8#=NR$AE>SD(Y#mxbtfAB9)ofugNHaVres@88JPvC zQ9Q*5ft{?3`MpWrC5|QnCFb+PbhgwF8fdi6zuqeh?*!ov2IT~PG~7vHB3KFS1*#oc zejQWrax*s1O4hd=wfv5@FsiNPz4se~RAErMpKnGjzr;1v5{eC|F)@4+3=Bg9h3<74 zgA#9Yfm)DkJkf4WM?ioN{- zjRk##OC{3I7wK$AcGi#5hDhGVtrWP$Q&FuG+Pt%zPfF1m0n0s(Ar3bdfE&~(uL&pe znwGBwmRa#d$+x>Qq{&cDG8w07#VS9&S4rtFvz(MB!m+j%QA#wFzU0GKQtA&b$}#*z zz5u=lQ>2yBU$562egq~Ly?leKYqiS|C0k5Id}?F?6dW{5^1R)B#zHW?q=dhp5BfB}PY@P+dbb5UD)SAI6L(iV)K?<6Z3ns>~p!hy}&h{M8T#Rlei zBU7=!iFjyH>TsheoqX6@8)CWLQO?cKg-*PY1yD;w5ob7qmM~myEtHbZyza!AVw?mE zdYX;>`RTb^5C_YlaH*u}UoUZDg&G;`ywz+!qQ^y8&x2TEP#U&%%bZAu@TMH2DK*ZN zo7qpZYRdIpDNjGGKu1n#lc(`puRWdx+K54Ei6(=^a~O@N%v|FP%^6&?sCs*sgHEBT z=eW8fI=|(_6K^t4ON~p?YJ5N(r5~qX_tf2p^nM2|zMwHBJ#c~ZXH(xnmo9KkH02s? z{tFL;y@v+;musRW?CLevYca?&*|Mh8Nwi*v_I|+B*O&z~FVGe314I~F zGCY%;H|x;k(M-LTnrYenl=Ig=5FbM~pK@+3G~}T;mRq*g&_Mt2W8sC!JcMy=u8n+T zWexuNM_b90jkP}15I@9h6JIxHB;ygS?R5)|eKWrT6cU5KB4MienTT!vSf-X%I(9HX zhsWpQlQV}iwY5GO_zYO>wL^R|@flZ3lLDQ@kJZ>EJhrTsp`NCvX5gnhc8f3D_>6Pc z^4PKn7+l~U@m=`_O%yI$4G-1*Qhb#uS-T*N!Mv>ZwfJOyiuNbRW3dg|CqB98Dd(;w z?Zqu}uYxVb;530a3<>!Twfl|p)q-Txf0k!E?26J~{(TTVgGzuFE0;d&@Ubr78Zjs- zF&xsNwY3eJ8eV4KE=_9>VvRxRZ(couBCf%Thz4Cwn$~n4b}$%}NS+*Zny8pe(-hqQ zu1)85Hs06=JLw#JQM%Jp$DBxqWEPrpEx5~H8`^8`&Dsj}y~_T-#z`G|=4SBM!u#(} zrHA_f$1o^qV^8alS2$Bot48Nt;rz#>|K=P}e+U&*NAT0t79*9__1=N)+h+miF({>} z%Q>hE>J6IaP#(P~3$mB~>!c0`vZ>~YsYCO5?K#`=;eAbFQMIzD&b#Qu9Sz@Xgk}Zp zEA8moea^qfOP8D|k|Dm-UWP=2JfVo$`m*!+0T%ek_GF7ua}$v~npSe{jtp&rc`DQ~ zlM8U9UO6|jQadfb{dgXOvs?^HA^Y%(lVtcZWE!7=4^7af0LSb86B`UFg#nw50gg~$ zUCDw!oM;pAWI#<{GhTEAuQdF9&50t0pIWFrFh4VO)YZ8l!5EaK{PBM}aVDv+$GR(8 zRngKvfuxpDTy(_EP;yF#zB{eFniCMV_!{sDgVL_8{YQq>VpM5mYg;*!l`EQ3U4MRr z&Yaa&2Hw2yL*{#+3WG8-o%|T}xvH%M^@=Y1n^Ks53`!3&@0oLWpc6%zc`wkbGA3eM zLRa+DRq!2Sp|IfKJv8~4jQN?G`N~zml+ld#B20>pO<6N}_dg%3=oPYNVZqBEp%*H~^ju<6D z3d3&mM3WwJ0a|?Snd7@R+yPm@pft5*UJN>UhHI#aYV0$HpRenrI+~xJr@h7L+>v%& zwG|$rAzPH!S2OEPy>4P5lIdLW$C&O7ef~}9xYX}&>3g5le-2hS!phSBp z042E^G<8<;Ti?512k{~+N5)MnJ zv^>YO)K*Ty68RZC{&K2TXC&|p)(i2<(kBJ20fdsok5#{ zt88Kt+F!$<&AaS44H0Mf5T^i*$Tk*bW}6GNJ4ShYsFe5B!<=|QjS?*BRkjn=uX0TW z^}GnA^&IX*5z9}ZhfdE$PVyXINtVxOC(fbS#{2?vI!$A&&!O$LBVbVzs9<1Fnxp&U zoM;owuwlfM1?RD8&PRe?Yq|`3LJX2Masi{au4G~wgErsgG}TAwvvDjPJ^M>rQGf9) zmznoK7%?aZS(M=%D75Y)D<|}Kv>~Y>iSR<`rN}1pv7QFUk(NN zQ98xHO{mTTZS7j}Nme51R^%LA3SPw1zJEmg+H8H@Uoh*E1QG%Kr3jVZ=X|w9z0z52 z&xua`X^gFJ7p)y6@1;zi0^uEf<#jI2-02gEG>%2D@S$>2Z`9x&Sl>`*E!&zdRN2p}#pp-7)2J zop_+1pa=#80lC(|?Zf@HK9@nfFesNq3twT-g7X^9%9bZk$^5X?NlAj)Vl1S$x>qq{ z@^xh8jMaFZu}xl}xvE+l+_3(@62=zZzrNOBXyap;&P_|5^hXw2OzB4L6|AA12M7KF zJj9^1BDI$}u?{e26lL>iRZmXc=cO1ezRmgfY_-CP0Xldy%ri8L3OWaQx;}UngPy=I znmk0=30PgM^|tes(FO1wYwesE*wmv<3*Z6hqoxEz|`vVNYJw6ZQN&$$f}&%y(r-pJ&WyK4AD(9F>gxlX#Go8@-w&L_j+@NqT8x^h0~YH1 z@CE-ky*OS;erE$?JF={S_J!ozmpFek&conlJGso==Jtk*#^u?1#&N}tHMt-~yuW`l zApu>w%z0?>wr6V(b9G>9sKB&-E5;P0)tJ0~hw~rx(x*{n~7x?K|o z4j7b1`N|Fk1)kF8dW2~auFh?PcyijnH)|qsTUUA!KCnTnFnSk1|`-Hlvtx-8}#&H(Hhrblp$xS?Wi14gTZuzEg}Y zkx!p&fv!T$rt9>x(q3a=bQqMTtL8xl{kenD+BN#5Mu`52U@YRf^ir>-{PINSM~ z)T;SC?0dyHWB4hW`)(2Of4@B78U`ijemcUynNWzPcM^C=sf55HaSownWva@EHg}* zMTONFR=kQN?5pB>jSMmZP7JOJK{#|=Br(=J1-`AIEg$ID?8agVtuxd8;U^X6VOB7>Srs## z{a=yBcnh39g+KA3jgQCb>|gK$xIYZF6c`s@6fs8TRk@nfpz2O(biNJf#@fr`!*P(` zn$onNVG?Q2xDHi&9R?*mf!9Qo;0^d{?2xqT*QG_BSI zxe_a7@4zh)DOTb%%_?kMcgx#h6_g0)+!hf=6~LYvqHk8ch9xt)!gaVKVvM)Iv2>av z_dc!H-V@q}CRVQL{p7$H1Kl)*>5e@Q)t~kuKX+0&IVFEXt`cm}ba>6dFLFkK%Ih#F zrN(k!9O|e{*hQ~>?aX-~B=`a4e5`ulm|z~d6Exeu!J7|ub~tP$jXsYY6U=89Jl7@F zm433?>Ow1D47CQhX$|;P9(wYKf=Dfg;i+&OR(XRn~7?iTNpA~UN=H~H58Y}14g9#l!`u*H4 zu!k6wy!?n0F~;L9ZQ4)3*!Q^JR5-O=he4^hTMP~wVboB#;;ouPqtAoZ8Y+N93`#O< z)fABq#7ARkFMEC-abTy_5xgmN1U?om#+SJ~_)s4D*EIK<%9UB^Mn7{Eu@08-X<3!% zRrBs=RhN9TYN0`$v~^^9Tv<8dCd>y0B~@)}i&Vk!B-KW~z^A)L))%9yUb>159BuhzpB9~}mzY=2xwL^%pH@VTJPkJ|MJUju`PsKirz8lP*D zW3Dc`$3rC1f&2ttCC}P>i5Q1wnyU@4oHk}x)3f*P!USMY21F@!B@%Nq#|0j~e@}fC zXvLtMg8AMex@bN(9U>y_N|AFdITiMr=`bjh(h>DVoWmx8xrYrVaGathli!#yb49)A z25OCUmh87da5l z?kj|4zvs7iQg(MnZZFLz-|U3}D&=iaGZv-#v0BUf7xI0^K+3JdpmaLFHW!J5W75*I z`4{NmBEo@68iI+v4@F8c!r?~n*6^V_%>}U$KlnsKNnD3PY1P)Za&UigkvUBjp;dlr z?%?mrF02G>7?gJDjW$k<+IQGLys|0nKcE8`ltN~P))_KtYqUAnoTql!l5!gXbK%vy zj*MPOVo^I0WejWz)f`G$-&y(2yN*sXr3`zw7ZJwuMUX9LXf~hcA0%ys?Tb1L%85DR zKna_)jbxGDs_E?E5rJ>M??}{?quv@O5%~fcIgU_-00q|al&dTm;V8MSLDR9K-e^r> z2IwjVrPpZy=WUSb9RTfvTFVxX&zc@WzOBPhH%n2s_@ax5Z)ibghAA`0oICvmLWD;=jA0;Bal}-qcpBpV|Qd2BjJJth-2DGAx^c0&73Uhpjl2I3Gr9#TVr? zdcLtt4t2s?O$lT-PRv0%1 zrHkF#2StQvbFuU)&_{hmvTzkhvzAGo0;CTu2sLBc~XrXqCM0$N7~z zBu_cMJuxE6;kkTGwE7D<5 zS|%o*ptSPsVLyxZI8kokmD1ZKQKT`^QkbqeqOc~&Yf?%x^{WG8WQOWWfnvYT=2u2C z4!5f`1XGek0tZi@F+JB@Kn`6B(PZFJYLLOdOGdI|7P4R9Ks_`g1jKCcVDZ_gOk;sX zbA4@YIcn)B=O~%8FGWN+NQlE zLPQyBwnF9*Pd#yJKKt6XG@qqaEW<)$l_c!0empzyHw9T@vVF*VCV>0qm>fvx9nqq0gF zG^`c)(L`RPD~iv`&fqoIVB`s>ayA;Kix}h0xj9hXP@RoBGFykg2#nTtFf{0L*?}U( zoHMf)W{Z5vA<&J=#=Z*ZmT=cR>v>C`|xsHHt_FLCd8o>t&q(dqr6H)qo3wQfx0z z646D%7bCQIdax?ksK{e<<*4_=_gG1o1TlK{3kB(=SN3+l1QcRW8miaw9Gv8>P)p3! zzJ*x+8Exgrx0ywpDVb1i*Jx7?CZO}3K?qkCz{7YG4m81NUMb(V<;s-LphkAlNi zEZWapOb(dr7k&@~5reW=(exEm-d)?7neroXl}LKL#-iYSR%?TdTy&J`cJei}wVSrO z@RR)PqEo;n3`$8k3ET7}agK(3N$m>?%Ix3eKl{Und5q5~ z8T2NL&hOPceS4<)uZRODk3rd#H)a{y(!-$X%v#S)##1qX0E2S+?yQgxg>YJ{XIQ!Y z$W_qW`lPU|R3GcxXism0kEV9AfxTd!2CbHp0Vfc?Kr5L@2O&c_xU*$)toU2-lqzji zJy?F7@lv=Me)52{$uvMD@Tw3X+&x)oXnt=$F)wRzTF=t4TI7O zTzntpM;iPzvG}7%kh>`xSY+MDYVJ+H-oxNOENru!{K)7Ot%U#e$?>(vKz%SMC*_NB zG`WvK)A{{pwp{4B9}r+rny%AZ(cZoqj}5-n6a3MQPmo(LgSHKI8)4?VKdO+AJRvqt z>&OvdoS$9(c+$`jS|4u_mwT(~8UJ7h3XU>p`WlqnXeb*!yX}_K6;)t{Rpr!JI7mz@ zeV$`vwnQnChxf{HLl&OP8#6SEIvzMm>IJ8BP56dIgLku38}g&D?N%>kjf(~IjE4cuYcw&!_CC6{GxEc%{QJ|H`7s zBicoVbgZ5^&gyW)lA*mpl)m+^(FqBeBOIz`SmVH|2^o?6SS_WU<6*0~NTT=|h zIMJW|z^|UYAU%(TA+tbpveIpF(r3ZobucK?-A-2|oTDr`swL1?idq{vqy_d&b_Gxl zbJaDpwZBGlej^6ls^2Y%hX1d#E02n@T;n6m=ayS8sJNsUatlYrT?7?L5n+^ISOgUZ z7-3*!Xkb848*yn-uiI5$*V0>>%dzy7S!S*`w=zqw*K1{Eo256sc-2nc)cbp9`M&QR zhvDIJ&NF{-&inhG_j&hcMU=xdE3&rZMMc(7sB`6u>-YUTY&SkYv6rfo1c*o6lHX+R z^kA**5s$3e9kK>ri@M#B7i7c_N_(nncTM>(P`7NHT&y|2Clwv#B%CF&)tbOSHRGGs&u8uSE&wZ|t4tCXIJQ5JnqV4E zq9*LB8!Aq3&<&w>Yv+k0i+#h{ySg~zaQ#$p{_9r0vFXY|51#V8Cwt)UEd@|V?r+E^_j->50w-~Jqr1EKb8rU9 zamY7bdWa&w!Bo8O_EzloNKYJ&A5?G=eN}jMR37SLz%Eyc$}Y}TMSt3bZCP+D5kluA za&pTJ#uq{aNm8z2(1#Pi$=oMpsp!k|A;YRad+ z`?gHM)6o}Y>dGG`c}7i~q}_VT{OR~4pqYI19lki?yT5NLc;SOolfbX|l2%NdG#tYS zVvACwmX2XzGFRj=h&=zpPrm#3fr6$RNa4xB?E`mz?|9iaUi_bA?sNkvcpUEc(_=6B z7THAwF5I<^QLcUEYwo@68!zuEnZ0mQcR72iA<#5oXA-35jv5sXc@*|#9k}az=GvZ? z+0qI7LoHLoZKj!di+CK>Aq#%4YkGGN2AW)(WvZVt{w0}5_Z7d z?#8LbW+W|!eBc(BwlK~TU_wc=TpXsA; zLffB`u{ut7UiBZ}c;{4jq@#u}Huf*Q6g*%mio@|i%CuX^{z;5$4Ele|TiR{b5k7nV`td7eR-^>RG$&htMX0}k~n^O#3P2fq2lmYbSV!BWN zYh|h1uHnJPNwl?Eq7+199_p0&n>I$Z5U_0%s3}9q% za#vgZy7CtwauRiFLlH#n?q;(8gvG-AV%IWY8^})&WUcgp)T|zz=KW#m1P(ZfGeDCm zb76p~jqd(D=CkuNE(HW>G*F{?$t!0vyJC`p!UzG27sj{xls%g!1*OiPDl?K~g9{8< z4XvJu;({BR$Cl?w?IB%%(-WOq(w z%EL-0j>wNQS#}1^fF0lBZtr}I1}BlPpgA&MNyuP9_H$UVJNR#|p5nqJ4)U@2GGv<7 zl5fqo(VeH%3LJ55U3@`Cg;TuBk;Rc!htFL~lP>)|X$?dP#x9mIQxLsZMjw`Ci+2vm z!TJZWfjLsk$eblIRGQgRY^F!>vP1b&aAdO;a{CyZkT$xZo*gK_K3}s^Zl6+QEh!|g zc=p8WZF?xn0zgsTo9dbEr1;@fbKD9s{&%ox0!0mANHu_d+q(W*6?4`a1!~7 z+b%=ut);nEe?s>1ov6m%7I0@L+c=eI~>R|ZHh zo5-7%OOCiBK?LII-}HSM5EZrf&fssNI)uY|oi;k&6BsB8Hu`{!>dZtyc5?ar(Bz-S zW9D)aAuA37a)9fy%cGg-Rn*ugxsY75qcTe|)4Ay>&qxmUx^O*Yh9}%h+*;o|E~BPe zkcQt{UdzR`5FPUNw;XAlrYXV!z)7@XJUl7GCfaA15W-})k>k`^OEWf*y=PD{%J=h?$7;ss*aBq=!UjA*PO&1=jJUL6Zt<% zOHGzq?>I*96;s%L?X3c=Bu?UcW7%&qYOH;Q8hC9zjEUwYhJ#U7rv*SwzvwNexnFb|jT{-{mi%Vjyr57e%MX6y9*-GsCW0P8Pm% ziL;SeVB+sBWSqo8+(!%HNkJV$b>c5^S~YGhqfRLGSKZKCrE!Cw)|=YNty8NCFt4nB zRS;?o#2f8y9`xuZ8wrNfP93$HF-8>ptkbi#iK0N;#aHuIw2T`?6^i=hDRMC6367(y zkM)+Tm7UhxK4+gqV?Eh=%N7+$!F|VtIvbI-&#aq83XVALYDG8SxSGZGbbc(H{xzq; z=rC_qU%jt7{HU=o%rRkF%~-@7!J~zA@;hx6J+3!;YXnA}lW6qUKLt3t(Hu_Wvd_3U z_@@9Ap9^0)FZY&C4QlryacV0a7sAmJnYE3@wL5xvX)9x1d#$%8AX|JX2KAD`l1=tv zLXKiQi(T5}Un0+K_tbn6y>0d@pgb{XF?SzFTqbqJsDZ`H>rx%6_`3TZYvo17{vS+H z0#ka+63`nftz~r;0BoV?)8h|StYSB(OF;p>`>@?ssXZkz?6{dRQL`XIPU5}rY#%LK z-b+h;Cu*lvuJa74xZAGktLjpLzlVtM4q2c0MNgg$!@+;VGip$T3ekcfTYBI~_SHW^ zJn5~((Y&gF#ugy!vgiI%cY?oj%?zuifJsi`<9vNTnbBBlt_)eHn@`heQSCj#bcn+; zqQ4B8V6s8yh`jdHX{Qc0Qv6=H^Tv-H)pwMU!?^=^-`Uim)QaO5hdPG3o$;kMqls); zQkU=&x23E|tT5E>GS=hj#-sQaVtvg_vS+K zxx!APo#Xptw9BM!3flMwBSJ8#IEkz8P#VY4#g2_3U+l2vG%UAV3Q7ve)N0(`#N-*a zV94usPj)eJ*UQUfhvyJ28h<$ON)FFbK0n4@Y@B8&XfaF8@;Mn6Ue^F^)5hO8YU0fVWN~PlVbfsmoD7aT7(2;o9uezT%Z0RDiGB zDu^T$M5#x1$?0b^PGn$?a1xKoRk;dZ2Akbah6*o_zdpvsadQC2NsL|VpQk{MvfA_E zAziPk9bNlA*f9~PoK(mX4!H&92pHF}Ctpd3R6Xs(4|E zV^7SYSqgW*s_()B0XT_w;ba6k zye30dfr2>3Tu5HI8C$MhOh+d=9ADuMuO`9+**%9&r-S$ZU%W*2*tkzJ>2&DX*@QIyIQiI#*Ppug(wm+e zsmR0RVuc5T5qVq4qou#{O7G{Ury{wOHBKMV0-9iLO$8=wO~dWsTpD*AbFcWAut zNDlboB#NtzjU9Sk>Oi^B^o(11ioG>U3L0|QrtpGV$aJmdy7{oA7M3cl)43Me^Iod+ zal>lnLigUZj5VJ}RGUATf%EumnexFTb6Kv@Oph~S8}Z4=xpoCXZ_cYQ(w%&Em1FS2 z%9Zv>cp)P1B)#PJjn1(FXE1P_#I5OUIV*8UZ7GA7dHlm|?3MX=;(uSkN@mlvv^N)T z7~-jdA-<#M!F9y5E5#Y7=a^08L?uhBL!ZK`W1HtoZ34n7S+@$J;UxhhVK`B#e0aQ> z?l;3HZyp55NnDr<@lLCz$s_M$tCazOlL#_sriv}AeY%Of%m4C^;UQdw;^03*kWqEJ zSqdn8Qm{WFB{F%By!O$%*{gxcNgTY(DqKXJPeZbsR0B04^xhn-r~|VV&SLDjMUQCz z{Om=n2B+e%tE84_yPc+_Mn&A(cgz77vMZid6~DfmElrHeio{8 zBZ)8QT}yzLO!my3ogYw>=z80&UW%3}h9ODyc-wV-0Ua3d7p*3F0{N5b^uHqS+gEa+ z1nM#5&IZKxy&$z2cw&`SQ}5hA>>>E?_sMFl#$dM<)x%LT;YB#N#;nt7P)dl(uG53s zYJms!0p75_KFe4%@}D9$9_SUl9&jn-m+2*zy-?~nsLItU#%8X9*BiAHZ1zjY)Rw-% z`9=4BOKxj@87J3=o1AUy8C_dqJ(tA#z69ZQ+3IW`V=>_wOxJ&@Uy)*9$+z2`fMbm) z%ux4U)(C^(bO~;;5L18C4rkj~1aa0wsiQgAVzlQCBidBj?sno)Z{-FjEA7Kuhr-oO z!%6Jg+b*~mi?OtbKE(HV&t|>jSu9gISkycE782JtKsl9M$H?YOumdylU<^$ch)yuA0up%Y!=|i;jW|dgw#um#uz1 z3a2Jc%ChCk<%Y+!nsmCZ)9oY{=kyX2HQv&3An8(4sSDBBnWaTY4!7f^R^#8RUuwvA ToxFg&fSQvUP0v&CmeBkUuQ(|u From 1cac3e84f5dabe211a32538e2e60ebd31da19661 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Tue, 27 Nov 2018 20:46:29 +1100 Subject: [PATCH 148/594] plugin: skip building tests on linux/arm64 It appears that linux/arm64 https://build.golang.org/log/6808dbded6aebadf68cb65a0e30e4d1a62cd687b fails with /workdir/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1 /usr/bin/ld.gold: internal error in global, at ../../gold/aarch64.cc:4973 collect2: error: ld returned 1 exit status FAIL plugin [build failed] error. So stop building these tests on linux/arm64. Fixes linux/arm64 build Change-Id: I41eb3d9659f7967d80136513899a5203bbf03fb1 Reviewed-on: https://go-review.googlesource.com/c/151478 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/plugin/plugin_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin/plugin_test.go b/src/plugin/plugin_test.go index 6dfe14854c30f..be742b8c6df5e 100644 --- a/src/plugin/plugin_test.go +++ b/src/plugin/plugin_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !nacl +// +build !nacl !linux,arm64 package plugin_test From 5966c2f4ec35c0f1ad53331c552a35f5f6cb3eea Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 28 Nov 2018 07:17:40 -0800 Subject: [PATCH 149/594] doc: fix formatting for Darwin entry Updates #23011 Change-Id: I38360501c772ddf7cc4bd1b5d7b0225387ead535 Reviewed-on: https://go-review.googlesource.com/c/151361 Reviewed-by: Tobias Klauser --- doc/go1.12.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index d2aa2f6cdaddd..821d9086d4963 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -47,7 +47,9 @@

    FreeBSD

    12.0+.

    -

    +

    Darwin

    + +

    Go 1.12 is the last release that will run on macOS 10.10 Yosemite. Go 1.13 will require macOS 10.11 El Capitan or later.

    From 71f9f4b84b2974acf723ea78c1c6eb82d6755794 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 28 Nov 2018 09:33:19 +0100 Subject: [PATCH 150/594] vendor: update x/net/internal/nettest for aix support Update golang.org/x/net/internal/nettest to x/net git rev 9b4f9f5ad519 for: internal/nettest: add AIX operating system https://golang.org/cl/144077 This fixes the build failure of the vendored x/net/internal/nettest on aix/ppc64. Additionally this also pulls in: all: re-adjust build constraints for JS and NaCl https://golang.org/cl/122539 Updates #25893 Change-Id: I9abefc7d4ad158e9e68913362f7f1320321d6f5f Reviewed-on: https://go-review.googlesource.com/c/151301 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go | 2 +- src/vendor/golang_org/x/net/internal/nettest/helper_posix.go | 2 +- src/vendor/golang_org/x/net/internal/nettest/helper_stub.go | 2 +- src/vendor/golang_org/x/net/internal/nettest/helper_unix.go | 2 +- src/vendor/golang_org/x/net/internal/nettest/stack.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go b/src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go index bc7da5e0d574a..1611a907f00bb 100644 --- a/src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go +++ b/src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build linux solaris +// +build aix linux solaris package nettest diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_posix.go b/src/vendor/golang_org/x/net/internal/nettest/helper_posix.go index 963ed99655bab..efc67a8eba975 100644 --- a/src/vendor/golang_org/x/net/internal/nettest/helper_posix.go +++ b/src/vendor/golang_org/x/net/internal/nettest/helper_posix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris windows +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris windows package nettest diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_stub.go b/src/vendor/golang_org/x/net/internal/nettest/helper_stub.go index d729156de67fd..d89cf29962903 100644 --- a/src/vendor/golang_org/x/net/internal/nettest/helper_stub.go +++ b/src/vendor/golang_org/x/net/internal/nettest/helper_stub.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build js,wasm nacl plan9 +// +build js nacl plan9 package nettest diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_unix.go b/src/vendor/golang_org/x/net/internal/nettest/helper_unix.go index ed13e448b7b4c..b6839dcd8fd72 100644 --- a/src/vendor/golang_org/x/net/internal/nettest/helper_unix.go +++ b/src/vendor/golang_org/x/net/internal/nettest/helper_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package nettest diff --git a/src/vendor/golang_org/x/net/internal/nettest/stack.go b/src/vendor/golang_org/x/net/internal/nettest/stack.go index 46d2fccab588c..3b8a01e9bb0ed 100644 --- a/src/vendor/golang_org/x/net/internal/nettest/stack.go +++ b/src/vendor/golang_org/x/net/internal/nettest/stack.go @@ -72,7 +72,7 @@ func TestableNetwork(network string) bool { } case "unixpacket": switch runtime.GOOS { - case "android", "darwin", "freebsd", "js", "nacl", "plan9", "windows": + case "aix", "android", "darwin", "freebsd", "js", "nacl", "plan9", "windows": return false case "netbsd": // It passes on amd64 at least. 386 fails (Issue 22927). arm is unknown. From ff9481ec0d684b4f00670d40e869b5d40c54f162 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 27 Nov 2018 14:15:51 -0800 Subject: [PATCH 151/594] cmd/compile: order nil checks by source position There's nothing enforcing ordering between redundant nil checks when they may occur during the same memory state. Commit to using the earliest one in source order. Otherwise the choice of which to remove depends on the ordering of values in a block (before scheduling). That's unfortunate when trying to ensure that the compiler doesn't depend on that ordering for anything. Update #20178 Change-Id: I2cdd5be10618accd9d91fa07406c90cbd023ffba Reviewed-on: https://go-review.googlesource.com/c/151517 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: David Chase Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/ssa/schedule.go | 33 +++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go index e7ad5ac900e2c..1f9edb1937d03 100644 --- a/src/cmd/compile/internal/ssa/schedule.go +++ b/src/cmd/compile/internal/ssa/schedule.go @@ -4,7 +4,10 @@ package ssa -import "container/heap" +import ( + "container/heap" + "sort" +) const ( ScorePhi = iota // towards top of block @@ -447,5 +450,33 @@ func storeOrder(values []*Value, sset *sparseSet, storeNumber []int32) []*Value count[s-1]++ } + // Order nil checks in source order. We want the first in source order to trigger. + // If two are on the same line, we don't really care which happens first. + // See issue 18169. + if hasNilCheck { + start := -1 + for i, v := range order { + if v.Op == OpNilCheck { + if start == -1 { + start = i + } + } else { + if start != -1 { + sort.Sort(bySourcePos(order[start:i])) + start = -1 + } + } + } + if start != -1 { + sort.Sort(bySourcePos(order[start:])) + } + } + return order } + +type bySourcePos []*Value + +func (s bySourcePos) Len() int { return len(s) } +func (s bySourcePos) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s bySourcePos) Less(i, j int) bool { return s[i].Pos.Before(s[j].Pos) } From 2b4f24a2d2cbdefe3cb578ef37804cf05c1f5b00 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 5 Dec 2016 15:41:04 -0800 Subject: [PATCH 152/594] cmd/compile: randomize value order in block for testing A little bit of compiler stress testing. Randomize the order of the values in a block before every phase. This randomization makes sure that we're not implicitly depending on that order. Currently the random seed is a hash of the function name. It provides determinism, but sacrifices some coverage. Other arrangements are possible (env var, ...) but require more setup. Fixes #20178 Change-Id: Idae792a23264bd9a3507db6ba49b6d591a608e83 Reviewed-on: https://go-review.googlesource.com/c/33909 Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/ssa/compile.go | 18 ++++++++++++++++++ src/cmd/compile/internal/ssa/nilcheck.go | 2 +- test/run.go | 13 +++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/compile.go b/src/cmd/compile/internal/ssa/compile.go index 96bc5f03c1c5c..29618e29c37fc 100644 --- a/src/cmd/compile/internal/ssa/compile.go +++ b/src/cmd/compile/internal/ssa/compile.go @@ -8,7 +8,9 @@ import ( "cmd/internal/objabi" "cmd/internal/src" "fmt" + "hash/crc32" "log" + "math/rand" "os" "regexp" "runtime" @@ -29,6 +31,11 @@ func Compile(f *Func) { f.Logf("compiling %s\n", f.Name) } + var rnd *rand.Rand + if checkEnabled { + rnd = rand.New(rand.NewSource(int64(crc32.ChecksumIEEE(([]byte)(f.Name))))) + } + // hook to print function & phase if panic happens phaseName := "init" defer func() { @@ -68,6 +75,17 @@ func Compile(f *Func) { runtime.ReadMemStats(&mStart) } + if checkEnabled && !f.scheduled { + // Test that we don't depend on the value order, by randomizing + // the order of values in each block. See issue 18169. + for _, b := range f.Blocks { + for i := 0; i < len(b.Values)-1; i++ { + j := i + rnd.Intn(len(b.Values)-i) + b.Values[i], b.Values[j] = b.Values[j], b.Values[i] + } + } + } + tStart := time.Now() p.fn(f) tEnd := time.Now() diff --git a/src/cmd/compile/internal/ssa/nilcheck.go b/src/cmd/compile/internal/ssa/nilcheck.go index e0669cf80c845..5f58e2d7ec1ef 100644 --- a/src/cmd/compile/internal/ssa/nilcheck.go +++ b/src/cmd/compile/internal/ssa/nilcheck.go @@ -290,6 +290,6 @@ func nilcheckelim2(f *Func) { b.Values = b.Values[:i] // TODO: if b.Kind == BlockPlain, start the analysis in the subsequent block to find - // more unnecessary nil checks. Would fix test/nilptr3_ssa.go:157. + // more unnecessary nil checks. Would fix test/nilptr3.go:159. } } diff --git a/test/run.go b/test/run.go index 39647d7252d15..e7976657dedd2 100644 --- a/test/run.go +++ b/test/run.go @@ -559,6 +559,19 @@ func (t *test) run() { } args = args[1:] } + if action == "errorcheck" { + found := false + for i, f := range flags { + if strings.HasPrefix(f, "-d=") { + flags[i] = f + ",ssa/check/on" + found = true + break + } + } + if !found { + flags = append(flags, "-d=ssa/check/on") + } + } t.makeTempDir() if !*keep { From 7f3c6f64bdf5ed03e0a6308520958c88d244e522 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Wed, 28 Nov 2018 11:35:39 -0500 Subject: [PATCH 153/594] doc: update go1.12.html using latest output from relnote tool Change-Id: I6b20c3fd7f15f35d2288d9a0fd6512c541a62c92 Reviewed-on: https://go-review.googlesource.com/c/151558 Reviewed-by: Bryan C. Mills --- doc/go1.12.html | 146 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 821d9086d4963..7a2a50bacc301 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -88,11 +88,25 @@

    Minor changes to the library

    in mind.

    + + + + + + +
    bufio
    +
    +

    + TODO: https://golang.org/cl/149297: make Reader.Peek invalidate Unreads +

    + +
    +
    build

    @@ -113,6 +127,34 @@

    Minor changes to the library

    +
    cmd,runtime
    +
    +

    + TODO: https://golang.org/cl/138675: enable race detector on arm64 +

    + +
    + +
    crypto/rand
    +
    +

    + TODO: https://golang.org/cl/120055: use the new getrandom syscall on FreeBSD +

    + +

    + TODO: https://golang.org/cl/139419: warn to stderr if blocked 60+ sec on first Reader.Read call +

    + +
    + +
    crypto/rc4
    +
    +

    + TODO: https://golang.org/cl/130397: remove assembler implementations +

    + +
    +
    crypto/tls, net/http

    @@ -121,6 +163,14 @@

    Minor changes to the library

    +
    database/sql
    +
    +

    + TODO: https://golang.org/cl/145738: add support for returning cursors to client +

    + +
    +
    expvar

    @@ -131,6 +181,10 @@

    Minor changes to the library

    fmt
    +

    + TODO: https://golang.org/cl/129777: print values for map keys with non-reflexive equality +

    +

    TODO: https://golang.org/cl/142737: print maps in key-sorted order

    @@ -153,6 +207,14 @@

    Minor changes to the library

    +
    go/token
    +
    +

    + TODO: https://golang.org/cl/134075: add (*File).LineStart, which returns Pos for a given line +

    + +
    +
    godoc, cmd/godoc

    @@ -177,6 +239,14 @@

    Minor changes to the library

    +
    internal/cpu
    +
    +

    + TODO: https://golang.org/cl/149578: move GODEBUGCPU options into GODEBUG +

    + +
    +
    internal/poll

    @@ -193,6 +263,14 @@

    Minor changes to the library

    +
    lib/time
    +
    +

    + TODO: https://golang.org/cl/151299: update tzdata to 2018g +

    + +
    +
    math/bits

    @@ -207,6 +285,10 @@

    Minor changes to the library

    TODO: https://golang.org/cl/113997: use splice(2) on Linux when reading from UnixConn, rework splice tests

    +

    + TODO: https://golang.org/cl/146659: enable RFC 6555 Fast Fallback by default +

    +
    net/http
    @@ -221,6 +303,14 @@

    Minor changes to the library

    +
    net/http/httputil
    +
    +

    + TODO: https://golang.org/cl/146437: make ReverseProxy automatically proxy WebSocket requests +

    + +
    +
    os

    @@ -235,8 +325,20 @@

    Minor changes to the library

    TODO: https://golang.org/cl/139418: add UserHomeDir

    +

    + TODO: https://golang.org/cl/146020: add support for long path names on unix RemoveAll +

    +
    +
    path/filepath
    +
    +

    + TODO: https://golang.org/cl/145220: change IsAbs("NUL") to return true +

    + +
    +
    reflect

    @@ -245,6 +347,18 @@

    Minor changes to the library

    +
    regexp
    +
    +

    + TODO: https://golang.org/cl/139783: add DeepEqual test +

    + +

    + TODO: https://golang.org/cl/139784: add partial Deprecation comment to Copy +

    + +
    +
    runtime

    @@ -253,12 +367,24 @@

    Minor changes to the library

    +
    runtime/debug
    +
    +

    + TODO: https://golang.org/cl/144220: add API to read module info in binary +

    + +
    +
    strings

    TODO: https://golang.org/cl/122835: add Builder.Cap

    +

    + TODO: https://golang.org/cl/131495: correctly handle invalid utf8 sequences in Map +

    +
    syscall
    @@ -271,6 +397,14 @@

    Minor changes to the library

    TODO: https://golang.org/cl/138595: FreeBSD 12 ino64 support

    +

    + TODO: https://golang.org/cl/141639: implement syscalls on Darwin using libSystem +

    + +

    + TODO: https://golang.org/cl/147117: add Syscall18 on Windows +

    +
    syscall/js
    @@ -291,9 +425,21 @@

    Minor changes to the library

    testing
    +

    + TODO: https://golang.org/cl/121936: exit with error if testing.Short is called before flag.Parse +

    +

    TODO: https://golang.org/cl/139258: implement -benchtime=100x

    +
    text/template
    +
    +

    + TODO: https://golang.org/cl/142217: removed truncation of context in error message +

    + +
    + From bfc54bb6f3971346e184fcf3915dd17486db51c7 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Thu, 22 Nov 2018 09:51:36 -0800 Subject: [PATCH 154/594] math/big: allocate less for single-Word nats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For many uses of math/big, most numbers are small in practice. Prior to this change, big.NewInt allocated a minimum of five Words: one to hold the value, and four as extra capacity. In most cases, this extra capacity is waste. Worse, allocating a single Word uses a fast malloc path for tiny allocs; allocating five Words is more expensive in CPU as well as memory. This change is a simple fix: Treat a request for one Word at its word. I experimented with more complicated fixes and did not find anything that outperformed this easy fix. On some real world programs, this is a clear win. The compiler: name old alloc/op new alloc/op delta Template 37.1MB ± 0% 37.0MB ± 0% -0.23% (p=0.008 n=5+5) Unicode 29.2MB ± 0% 28.5MB ± 0% -2.48% (p=0.008 n=5+5) GoTypes 133MB ± 0% 133MB ± 0% -0.05% (p=0.008 n=5+5) Compiler 628MB ± 0% 628MB ± 0% -0.06% (p=0.008 n=5+5) SSA 2.04GB ± 0% 2.03GB ± 0% -0.14% (p=0.008 n=5+5) Flate 24.7MB ± 0% 24.6MB ± 0% -0.23% (p=0.008 n=5+5) GoParser 29.6MB ± 0% 29.6MB ± 0% -0.07% (p=0.008 n=5+5) Reflect 82.3MB ± 0% 82.2MB ± 0% -0.05% (p=0.008 n=5+5) Tar 36.2MB ± 0% 36.2MB ± 0% -0.12% (p=0.008 n=5+5) XML 49.5MB ± 0% 49.4MB ± 0% -0.23% (p=0.008 n=5+5) [Geo mean] 85.1MB 84.8MB -0.37% name old allocs/op new allocs/op delta Template 364k ± 0% 364k ± 0% ~ (p=0.476 n=5+5) Unicode 341k ± 0% 341k ± 0% ~ (p=0.690 n=5+5) GoTypes 1.37M ± 0% 1.37M ± 0% ~ (p=0.444 n=5+5) Compiler 5.50M ± 0% 5.50M ± 0% +0.02% (p=0.008 n=5+5) SSA 16.0M ± 0% 16.0M ± 0% +0.01% (p=0.008 n=5+5) Flate 238k ± 0% 238k ± 0% ~ (p=0.222 n=5+5) GoParser 305k ± 0% 305k ± 0% ~ (p=0.841 n=5+5) Reflect 976k ± 0% 976k ± 0% ~ (p=0.222 n=5+5) Tar 354k ± 0% 354k ± 0% ~ (p=0.103 n=5+5) XML 450k ± 0% 450k ± 0% ~ (p=0.151 n=5+5) [Geo mean] 837k 837k +0.01% go.skylark.net (at ea6d2813de75ded8d157b9540bc3d3ad0b688623): name old alloc/op new alloc/op delta Hashtable-8 456kB ± 0% 299kB ± 0% -34.33% (p=0.000 n=9+9) /bench_builtin_method-8 220kB ± 0% 190kB ± 0% -13.55% (p=0.000 n=9+10) name old allocs/op new allocs/op delta Hashtable-8 7.84k ± 0% 7.84k ± 0% ~ (all equal) /bench_builtin_method-8 7.49k ± 0% 7.49k ± 0% ~ (all equal) The math/big benchmarks are messy, which is predictable, since they naturally exercise the bigger-than-one-word code more. Also worth noting is that many of the benchmarks have very high variance. I've omitted the opVV and opVW benchmarks, as they are unrelated. name old time/op new time/op delta DecimalConversion-8 92.5µs ± 1% 90.6µs ± 0% -2.12% (p=0.000 n=17+19) FloatString/100-8 867ns ± 0% 871ns ± 0% +0.50% (p=0.000 n=18+18) FloatString/1000-8 26.4µs ± 1% 26.5µs ± 1% ~ (p=0.396 n=20+19) FloatString/10000-8 2.15ms ± 2% 2.16ms ± 2% ~ (p=0.089 n=19+20) FloatString/100000-8 209ms ± 1% 209ms ± 1% ~ (p=0.583 n=19+19) FloatAdd/10-8 63.5ns ± 2% 64.1ns ± 6% ~ (p=0.389 n=19+19) FloatAdd/100-8 66.0ns ± 2% 65.8ns ± 2% ~ (p=0.825 n=20+20) FloatAdd/1000-8 93.9ns ± 1% 94.3ns ± 1% ~ (p=0.273 n=19+20) FloatAdd/10000-8 347ns ± 2% 342ns ± 1% -1.50% (p=0.000 n=18+18) FloatAdd/100000-8 2.78µs ± 1% 2.78µs ± 2% ~ (p=0.961 n=20+19) FloatSub/10-8 56.9ns ± 2% 57.8ns ± 3% +1.59% (p=0.001 n=19+19) FloatSub/100-8 58.2ns ± 2% 58.9ns ± 2% +1.25% (p=0.004 n=20+20) FloatSub/1000-8 74.9ns ± 1% 74.4ns ± 1% -0.76% (p=0.000 n=19+20) FloatSub/10000-8 223ns ± 1% 220ns ± 2% -1.29% (p=0.000 n=16+20) FloatSub/100000-8 1.66µs ± 1% 1.66µs ± 2% ~ (p=0.147 n=20+20) ParseFloatSmallExp-8 8.38µs ± 0% 8.59µs ± 0% +2.48% (p=0.000 n=19+19) ParseFloatLargeExp-8 31.1µs ± 0% 32.0µs ± 0% +3.04% (p=0.000 n=16+17) GCD10x10/WithoutXY-8 115ns ± 1% 99ns ± 3% -14.07% (p=0.000 n=20+20) GCD10x10/WithXY-8 322ns ± 0% 312ns ± 0% -3.11% (p=0.000 n=18+13) GCD10x100/WithoutXY-8 233ns ± 1% 219ns ± 1% -5.73% (p=0.000 n=19+17) GCD10x100/WithXY-8 709ns ± 0% 759ns ± 0% +7.04% (p=0.000 n=19+19) GCD10x1000/WithoutXY-8 653ns ± 1% 642ns ± 1% -1.69% (p=0.000 n=17+20) GCD10x1000/WithXY-8 1.35µs ± 0% 1.35µs ± 1% ~ (p=0.255 n=20+16) GCD10x10000/WithoutXY-8 4.57µs ± 1% 4.61µs ± 1% +0.95% (p=0.000 n=18+17) GCD10x10000/WithXY-8 6.82µs ± 0% 6.84µs ± 0% +0.27% (p=0.000 n=16+17) GCD10x100000/WithoutXY-8 43.9µs ± 1% 44.0µs ± 1% +0.28% (p=0.000 n=18+17) GCD10x100000/WithXY-8 60.6µs ± 0% 60.6µs ± 0% ~ (p=0.907 n=18+18) GCD100x100/WithoutXY-8 1.13µs ± 0% 1.21µs ± 0% +6.39% (p=0.000 n=19+19) GCD100x100/WithXY-8 1.82µs ± 0% 1.92µs ± 0% +5.24% (p=0.000 n=19+17) GCD100x1000/WithoutXY-8 2.00µs ± 0% 2.03µs ± 1% +1.61% (p=0.000 n=18+16) GCD100x1000/WithXY-8 3.22µs ± 0% 3.20µs ± 1% -0.83% (p=0.000 n=19+19) GCD100x10000/WithoutXY-8 9.28µs ± 1% 9.17µs ± 1% -1.25% (p=0.000 n=18+19) GCD100x10000/WithXY-8 13.5µs ± 0% 13.3µs ± 0% -1.12% (p=0.000 n=18+19) GCD100x100000/WithoutXY-8 80.4µs ± 0% 78.6µs ± 0% -2.25% (p=0.000 n=19+19) GCD100x100000/WithXY-8 114µs ± 0% 112µs ± 0% -1.46% (p=0.000 n=19+17) GCD1000x1000/WithoutXY-8 12.9µs ± 1% 12.9µs ± 2% -0.50% (p=0.014 n=20+19) GCD1000x1000/WithXY-8 19.6µs ± 1% 19.6µs ± 2% -0.28% (p=0.040 n=17+18) GCD1000x10000/WithoutXY-8 22.4µs ± 0% 22.4µs ± 2% ~ (p=0.220 n=19+19) GCD1000x10000/WithXY-8 57.0µs ± 0% 56.5µs ± 0% -0.87% (p=0.000 n=20+20) GCD1000x100000/WithoutXY-8 116µs ± 0% 115µs ± 0% -0.49% (p=0.000 n=18+19) GCD1000x100000/WithXY-8 410µs ± 0% 411µs ± 0% ~ (p=0.052 n=19+19) GCD10000x10000/WithoutXY-8 247µs ± 1% 244µs ± 1% -0.92% (p=0.000 n=19+19) GCD10000x10000/WithXY-8 476µs ± 1% 473µs ± 1% -0.48% (p=0.009 n=19+19) GCD10000x100000/WithoutXY-8 573µs ± 1% 571µs ± 1% -0.45% (p=0.012 n=20+20) GCD10000x100000/WithXY-8 3.35ms ± 1% 3.35ms ± 1% ~ (p=0.444 n=20+19) GCD100000x100000/WithoutXY-8 12.0ms ± 2% 11.9ms ± 2% ~ (p=0.276 n=18+20) GCD100000x100000/WithXY-8 27.3ms ± 1% 27.3ms ± 1% ~ (p=0.792 n=20+19) Hilbert-8 672µs ± 0% 611µs ± 0% -9.02% (p=0.000 n=19+19) Binomial-8 1.40µs ± 0% 1.18µs ± 0% -15.69% (p=0.000 n=16+14) QuoRem-8 2.20µs ± 1% 2.17µs ± 1% -1.13% (p=0.000 n=19+19) Exp-8 4.10ms ± 1% 4.11ms ± 1% ~ (p=0.296 n=20+19) Exp2-8 4.11ms ± 1% 4.12ms ± 1% ~ (p=0.429 n=20+20) Bitset-8 8.67ns ± 6% 8.74ns ± 4% ~ (p=0.139 n=19+17) BitsetNeg-8 43.6ns ± 1% 43.8ns ± 2% +0.61% (p=0.036 n=20+20) BitsetOrig-8 77.5ns ± 1% 68.4ns ± 1% -11.77% (p=0.000 n=19+20) BitsetNegOrig-8 145ns ± 1% 141ns ± 1% -2.87% (p=0.000 n=19+20) ModSqrt225_Tonelli-8 324µs ± 1% 324µs ± 1% ~ (p=0.409 n=18+20) ModSqrt225_3Mod4-8 98.9µs ± 1% 99.1µs ± 1% ~ (p=0.298 n=19+18) ModSqrt231_Tonelli-8 337µs ± 1% 337µs ± 1% ~ (p=0.718 n=20+18) ModSqrt231_5Mod8-8 115µs ± 1% 114µs ± 1% -0.22% (p=0.050 n=20+20) ModInverse-8 895ns ± 0% 869ns ± 1% -2.83% (p=0.000 n=17+17) Sqrt-8 28.1µs ± 1% 28.1µs ± 0% -0.28% (p=0.000 n=16+20) IntSqr/1-8 10.8ns ± 3% 10.5ns ± 3% -2.51% (p=0.000 n=19+17) IntSqr/2-8 30.5ns ± 2% 30.3ns ± 4% -0.71% (p=0.035 n=18+18) IntSqr/3-8 40.1ns ± 1% 40.1ns ± 1% ~ (p=0.710 n=20+17) IntSqr/5-8 65.3ns ± 1% 65.4ns ± 2% ~ (p=0.744 n=19+19) IntSqr/8-8 101ns ± 1% 102ns ± 0% ~ (p=0.234 n=19+20) IntSqr/10-8 138ns ± 0% 138ns ± 2% ~ (p=0.827 n=18+18) IntSqr/20-8 378ns ± 1% 378ns ± 1% ~ (p=0.479 n=18+18) IntSqr/30-8 637ns ± 0% 638ns ± 1% ~ (p=0.051 n=18+20) IntSqr/50-8 1.34µs ± 2% 1.34µs ± 1% ~ (p=0.970 n=18+19) IntSqr/80-8 2.78µs ± 0% 2.78µs ± 1% -0.18% (p=0.006 n=19+17) IntSqr/100-8 3.98µs ± 0% 3.98µs ± 0% ~ (p=0.057 n=17+19) IntSqr/200-8 13.5µs ± 0% 13.5µs ± 1% -0.33% (p=0.000 n=19+17) IntSqr/300-8 25.3µs ± 1% 25.3µs ± 1% ~ (p=0.361 n=19+20) IntSqr/500-8 62.9µs ± 0% 62.9µs ± 1% ~ (p=0.899 n=17+17) IntSqr/800-8 128µs ± 1% 127µs ± 1% -0.32% (p=0.016 n=18+20) IntSqr/1000-8 192µs ± 0% 192µs ± 1% ~ (p=0.916 n=17+18) Div/20/10-8 34.9ns ± 2% 35.6ns ± 1% +2.01% (p=0.000 n=20+20) Div/200/100-8 218ns ± 1% 215ns ± 2% -1.43% (p=0.000 n=18+18) Div/2000/1000-8 1.16µs ± 1% 1.15µs ± 1% -1.04% (p=0.000 n=19+20) Div/20000/10000-8 35.7µs ± 1% 35.4µs ± 1% -0.69% (p=0.000 n=19+18) Div/200000/100000-8 2.89ms ± 1% 2.88ms ± 1% -0.62% (p=0.007 n=19+20) Mul-8 9.28ms ± 1% 9.27ms ± 1% ~ (p=0.563 n=18+18) ZeroShifts/Shl-8 712ns ± 6% 716ns ± 7% ~ (p=0.597 n=20+20) ZeroShifts/ShlSame-8 4.00ns ± 1% 4.06ns ± 5% ~ (p=0.162 n=18+20) ZeroShifts/Shr-8 714ns ±10% 1285ns ±156% ~ (p=0.250 n=20+20) ZeroShifts/ShrSame-8 4.00ns ± 1% 4.09ns ±10% +2.34% (p=0.048 n=16+19) Exp3Power/0x10-8 154ns ± 0% 159ns ±13% ~ (p=0.197 n=14+20) Exp3Power/0x40-8 171ns ± 1% 175ns ± 8% ~ (p=0.058 n=16+19) Exp3Power/0x100-8 287ns ± 0% 316ns ± 4% +10.03% (p=0.000 n=17+19) Exp3Power/0x400-8 698ns ± 1% 801ns ± 6% +14.75% (p=0.000 n=19+20) Exp3Power/0x1000-8 2.87µs ± 0% 3.65µs ± 6% +27.24% (p=0.000 n=18+18) Exp3Power/0x4000-8 21.9µs ± 1% 28.7µs ± 8% +31.09% (p=0.000 n=18+20) Exp3Power/0x10000-8 204µs ± 0% 267µs ± 9% +30.81% (p=0.000 n=20+20) Exp3Power/0x40000-8 1.86ms ± 0% 2.26ms ± 5% +21.68% (p=0.000 n=18+19) Exp3Power/0x100000-8 17.5ms ± 1% 20.7ms ± 7% +18.39% (p=0.000 n=19+20) Exp3Power/0x400000-8 156ms ± 0% 172ms ± 6% +10.54% (p=0.000 n=19+20) Fibo-8 26.9ms ± 1% 27.5ms ± 3% +2.32% (p=0.000 n=19+19) NatSqr/1-8 31.0ns ± 4% 39.5ns ±29% +27.25% (p=0.000 n=20+19) NatSqr/2-8 54.1ns ± 1% 69.0ns ±28% +27.52% (p=0.000 n=20+20) NatSqr/3-8 66.6ns ± 1% 83.0ns ±25% +24.59% (p=0.000 n=20+20) NatSqr/5-8 97.1ns ± 1% 119.9ns ±12% +23.50% (p=0.000 n=16+20) NatSqr/8-8 138ns ± 1% 171ns ± 9% +24.20% (p=0.000 n=19+20) NatSqr/10-8 182ns ± 0% 225ns ± 9% +23.50% (p=0.000 n=16+20) NatSqr/20-8 447ns ± 1% 624ns ± 6% +39.64% (p=0.000 n=19+19) NatSqr/30-8 736ns ± 2% 986ns ± 9% +33.94% (p=0.000 n=19+20) NatSqr/50-8 1.51µs ± 2% 1.97µs ± 9% +30.42% (p=0.000 n=20+20) NatSqr/80-8 3.03µs ± 1% 3.67µs ± 7% +21.08% (p=0.000 n=20+20) NatSqr/100-8 4.31µs ± 1% 5.20µs ± 7% +20.52% (p=0.000 n=19+20) NatSqr/200-8 14.2µs ± 0% 16.3µs ± 4% +14.92% (p=0.000 n=19+20) NatSqr/300-8 27.8µs ± 1% 33.2µs ± 7% +19.28% (p=0.000 n=20+18) NatSqr/500-8 66.6µs ± 1% 74.5µs ± 3% +11.87% (p=0.000 n=18+18) NatSqr/800-8 135µs ± 1% 165µs ± 7% +22.33% (p=0.000 n=20+20) NatSqr/1000-8 200µs ± 0% 228µs ± 3% +14.39% (p=0.000 n=19+20) NatSetBytes/8-8 8.87ns ± 4% 8.77ns ± 2% -1.17% (p=0.020 n=20+16) NatSetBytes/24-8 38.6ns ± 3% 49.5ns ±29% +28.32% (p=0.000 n=18+19) NatSetBytes/128-8 75.2ns ± 1% 120.7ns ±29% +60.60% (p=0.000 n=17+20) NatSetBytes/7-8 16.2ns ± 2% 16.5ns ± 2% +1.76% (p=0.000 n=20+20) NatSetBytes/23-8 46.5ns ± 1% 60.2ns ±24% +29.59% (p=0.000 n=20+20) NatSetBytes/127-8 83.1ns ± 1% 118.2ns ±20% +42.33% (p=0.000 n=18+20) ScanPi-8 89.1µs ± 1% 117.4µs ±12% +31.75% (p=0.000 n=18+20) StringPiParallel-8 35.1µs ± 9% 40.2µs ±12% +14.53% (p=0.000 n=20+20) Scan/10/Base2-8 410ns ±14% 429ns ±10% +4.47% (p=0.018 n=19+20) Scan/100/Base2-8 3.05µs ±20% 2.97µs ±14% ~ (p=0.449 n=20+20) Scan/1000/Base2-8 29.3µs ± 8% 30.1µs ±23% ~ (p=0.355 n=20+20) Scan/10000/Base2-8 402µs ±13% 395µs ±14% ~ (p=0.355 n=20+20) Scan/100000/Base2-8 11.8ms ±10% 11.6ms ± 1% ~ (p=0.245 n=17+18) Scan/10/Base8-8 194ns ± 6% 196ns ±12% ~ (p=0.829 n=20+19) Scan/100/Base8-8 1.11µs ±15% 1.11µs ±12% ~ (p=0.743 n=20+20) Scan/1000/Base8-8 11.7µs ±10% 11.7µs ±12% ~ (p=0.904 n=20+20) Scan/10000/Base8-8 209µs ± 7% 210µs ± 8% ~ (p=0.478 n=20+20) Scan/100000/Base8-8 10.6ms ± 7% 10.4ms ± 6% ~ (p=0.112 n=20+18) Scan/10/Base10-8 182ns ±12% 188ns ±11% +3.52% (p=0.044 n=20+20) Scan/100/Base10-8 1.01µs ± 8% 1.00µs ±13% ~ (p=0.588 n=20+20) Scan/1000/Base10-8 10.7µs ±20% 10.6µs ±14% ~ (p=0.560 n=20+20) Scan/10000/Base10-8 195µs ±10% 194µs ± 9% ~ (p=0.883 n=20+20) Scan/100000/Base10-8 10.6ms ± 2% 10.6ms ± 2% ~ (p=0.495 n=20+20) Scan/10/Base16-8 166ns ±10% 174ns ±17% ~ (p=0.072 n=20+20) Scan/100/Base16-8 836ns ±10% 826ns ±12% ~ (p=0.562 n=20+17) Scan/1000/Base16-8 8.96µs ±13% 8.65µs ± 9% ~ (p=0.203 n=20+18) Scan/10000/Base16-8 198µs ± 3% 198µs ± 5% ~ (p=0.718 n=20+20) Scan/100000/Base16-8 11.1ms ± 3% 11.0ms ± 4% ~ (p=0.512 n=20+20) String/10/Base2-8 88.1ns ± 7% 94.1ns ±11% +6.80% (p=0.000 n=19+20) String/100/Base2-8 577ns ± 4% 598ns ± 5% +3.72% (p=0.000 n=20+20) String/1000/Base2-8 5.25µs ± 2% 5.62µs ± 5% +7.04% (p=0.000 n=19+20) String/10000/Base2-8 55.6µs ± 1% 60.1µs ± 2% +8.12% (p=0.000 n=19+19) String/100000/Base2-8 519µs ± 2% 560µs ± 2% +7.91% (p=0.000 n=18+17) String/10/Base8-8 52.2ns ± 8% 53.3ns ±12% ~ (p=0.188 n=20+18) String/100/Base8-8 218ns ± 3% 232ns ±10% +6.66% (p=0.000 n=20+20) String/1000/Base8-8 1.84µs ± 3% 1.94µs ± 4% +5.07% (p=0.000 n=20+18) String/10000/Base8-8 18.1µs ± 2% 19.1µs ± 3% +5.84% (p=0.000 n=20+19) String/100000/Base8-8 184µs ± 2% 197µs ± 1% +7.15% (p=0.000 n=19+19) String/10/Base10-8 158ns ± 7% 146ns ± 6% -7.65% (p=0.000 n=20+19) String/100/Base10-8 807ns ± 2% 845ns ± 4% +4.79% (p=0.000 n=20+19) String/1000/Base10-8 3.99µs ± 3% 3.99µs ± 7% ~ (p=0.920 n=20+20) String/10000/Base10-8 20.8µs ± 6% 22.1µs ±10% +6.11% (p=0.000 n=19+20) String/100000/Base10-8 5.60ms ± 2% 5.59ms ± 2% ~ (p=0.749 n=20+19) String/10/Base16-8 49.0ns ±13% 49.3ns ±16% ~ (p=0.581 n=19+20) String/100/Base16-8 173ns ± 5% 185ns ± 6% +6.63% (p=0.000 n=20+18) String/1000/Base16-8 1.38µs ± 3% 1.49µs ±10% +8.27% (p=0.000 n=19+20) String/10000/Base16-8 13.5µs ± 2% 14.5µs ± 3% +7.08% (p=0.000 n=20+20) String/100000/Base16-8 138µs ± 4% 148µs ± 4% +7.57% (p=0.000 n=19+20) LeafSize/0-8 2.74ms ± 1% 2.79ms ± 2% +2.00% (p=0.000 n=19+19) LeafSize/1-8 24.8µs ± 4% 26.1µs ± 8% +5.33% (p=0.000 n=18+19) LeafSize/2-8 24.9µs ± 7% 25.0µs ± 8% ~ (p=0.989 n=20+19) LeafSize/3-8 97.6µs ± 3% 100.2µs ± 5% +2.66% (p=0.001 n=20+19) LeafSize/4-8 25.2µs ± 5% 25.4µs ± 5% ~ (p=0.173 n=19+20) LeafSize/5-8 118µs ± 2% 119µs ± 5% ~ (p=0.478 n=20+20) LeafSize/6-8 97.6µs ± 3% 100.1µs ± 8% +2.65% (p=0.021 n=20+19) LeafSize/7-8 65.6µs ± 5% 67.5µs ± 6% +2.92% (p=0.003 n=20+19) LeafSize/8-8 25.5µs ± 5% 25.6µs ± 6% ~ (p=0.461 n=19+20) LeafSize/9-8 134µs ± 4% 136µs ± 5% ~ (p=0.194 n=19+20) LeafSize/10-8 119µs ± 3% 122µs ± 3% +2.52% (p=0.000 n=20+19) LeafSize/11-8 115µs ± 5% 116µs ± 5% ~ (p=0.158 n=20+19) LeafSize/12-8 97.4µs ± 4% 100.3µs ± 5% +2.91% (p=0.003 n=19+20) LeafSize/13-8 93.1µs ± 4% 93.0µs ± 6% ~ (p=0.698 n=20+20) LeafSize/14-8 67.0µs ± 3% 69.7µs ± 6% +4.10% (p=0.000 n=20+20) LeafSize/15-8 48.3µs ± 2% 49.3µs ± 6% +1.91% (p=0.014 n=19+20) LeafSize/16-8 25.6µs ± 5% 25.6µs ± 6% ~ (p=0.947 n=20+20) LeafSize/32-8 30.1µs ± 4% 30.3µs ± 5% ~ (p=0.685 n=18+19) LeafSize/64-8 53.4µs ± 2% 54.0µs ± 3% ~ (p=0.053 n=19+19) ProbablyPrime/n=0-8 3.59ms ± 1% 3.55ms ± 1% -1.12% (p=0.000 n=20+18) ProbablyPrime/n=1-8 4.21ms ± 2% 4.17ms ± 2% -0.73% (p=0.018 n=20+19) ProbablyPrime/n=5-8 6.74ms ± 1% 6.72ms ± 1% ~ (p=0.102 n=20+20) ProbablyPrime/n=10-8 9.91ms ± 1% 9.89ms ± 2% ~ (p=0.322 n=19+20) ProbablyPrime/n=20-8 16.2ms ± 1% 16.1ms ± 2% -0.52% (p=0.006 n=19+19) ProbablyPrime/Lucas-8 2.94ms ± 1% 2.95ms ± 1% +0.52% (p=0.002 n=18+19) ProbablyPrime/MillerRabinBase2-8 641µs ± 2% 640µs ± 2% ~ (p=0.607 n=19+20) FloatSqrt/64-8 653ns ± 5% 704ns ± 5% +7.82% (p=0.000 n=19+20) FloatSqrt/128-8 1.32µs ± 3% 1.42µs ± 5% +7.29% (p=0.000 n=18+20) FloatSqrt/256-8 1.44µs ± 2% 1.45µs ± 4% ~ (p=0.089 n=19+19) FloatSqrt/1000-8 3.36µs ± 3% 3.42µs ± 5% +1.82% (p=0.012 n=20+20) FloatSqrt/10000-8 25.5µs ± 2% 27.5µs ± 7% +7.91% (p=0.000 n=18+19) FloatSqrt/100000-8 629µs ± 6% 663µs ± 9% +5.32% (p=0.000 n=18+20) FloatSqrt/1000000-8 46.4ms ± 2% 46.6ms ± 5% ~ (p=0.351 n=20+19) [Geo mean] 9.60µs 10.01µs +4.28% name old alloc/op new alloc/op delta DecimalConversion-8 54.0kB ± 0% 43.6kB ± 0% -19.40% (p=0.000 n=20+20) FloatString/100-8 400B ± 0% 400B ± 0% ~ (all equal) FloatString/1000-8 3.10kB ± 0% 3.10kB ± 0% ~ (all equal) FloatString/10000-8 52.1kB ± 0% 52.1kB ± 0% ~ (p=0.153 n=20+20) FloatString/100000-8 582kB ± 0% 582kB ± 0% ~ (all equal) FloatAdd/10-8 0.00B 0.00B ~ (all equal) FloatAdd/100-8 0.00B 0.00B ~ (all equal) FloatAdd/1000-8 0.00B 0.00B ~ (all equal) FloatAdd/10000-8 0.00B 0.00B ~ (all equal) FloatAdd/100000-8 0.00B 0.00B ~ (all equal) FloatSub/10-8 0.00B 0.00B ~ (all equal) FloatSub/100-8 0.00B 0.00B ~ (all equal) FloatSub/1000-8 0.00B 0.00B ~ (all equal) FloatSub/10000-8 0.00B 0.00B ~ (all equal) FloatSub/100000-8 0.00B 0.00B ~ (all equal) ParseFloatSmallExp-8 4.18kB ± 0% 3.60kB ± 0% -13.79% (p=0.000 n=20+20) ParseFloatLargeExp-8 18.9kB ± 0% 19.3kB ± 0% +2.25% (p=0.000 n=20+20) GCD10x10/WithoutXY-8 96.0B ± 0% 16.0B ± 0% -83.33% (p=0.000 n=20+20) GCD10x10/WithXY-8 240B ± 0% 88B ± 0% -63.33% (p=0.000 n=20+20) GCD10x100/WithoutXY-8 192B ± 0% 112B ± 0% -41.67% (p=0.000 n=20+20) GCD10x100/WithXY-8 464B ± 0% 424B ± 0% -8.62% (p=0.000 n=20+20) GCD10x1000/WithoutXY-8 416B ± 0% 336B ± 0% -19.23% (p=0.000 n=20+20) GCD10x1000/WithXY-8 1.25kB ± 0% 1.10kB ± 0% -12.18% (p=0.000 n=20+20) GCD10x10000/WithoutXY-8 2.91kB ± 0% 2.83kB ± 0% -2.75% (p=0.000 n=20+20) GCD10x10000/WithXY-8 8.70kB ± 0% 8.55kB ± 0% -1.76% (p=0.000 n=16+16) GCD10x100000/WithoutXY-8 27.2kB ± 0% 27.2kB ± 0% -0.29% (p=0.000 n=20+20) GCD10x100000/WithXY-8 82.4kB ± 0% 82.3kB ± 0% -0.17% (p=0.000 n=20+19) GCD100x100/WithoutXY-8 288B ± 0% 384B ± 0% +33.33% (p=0.000 n=20+20) GCD100x100/WithXY-8 464B ± 0% 576B ± 0% +24.14% (p=0.000 n=20+20) GCD100x1000/WithoutXY-8 640B ± 0% 688B ± 0% +7.50% (p=0.000 n=20+20) GCD100x1000/WithXY-8 1.52kB ± 0% 1.46kB ± 0% -3.68% (p=0.000 n=20+20) GCD100x10000/WithoutXY-8 4.24kB ± 0% 4.29kB ± 0% +1.13% (p=0.000 n=20+20) GCD100x10000/WithXY-8 11.1kB ± 0% 11.0kB ± 0% -0.51% (p=0.000 n=15+20) GCD100x100000/WithoutXY-8 40.9kB ± 0% 40.9kB ± 0% +0.12% (p=0.000 n=20+19) GCD100x100000/WithXY-8 110kB ± 0% 109kB ± 0% -0.08% (p=0.000 n=20+20) GCD1000x1000/WithoutXY-8 1.22kB ± 0% 1.06kB ± 0% -13.16% (p=0.000 n=20+20) GCD1000x1000/WithXY-8 2.37kB ± 0% 2.11kB ± 0% -10.83% (p=0.000 n=20+20) GCD1000x10000/WithoutXY-8 4.71kB ± 0% 4.63kB ± 0% -1.70% (p=0.000 n=20+19) GCD1000x10000/WithXY-8 28.2kB ± 0% 28.0kB ± 0% -0.43% (p=0.000 n=20+15) GCD1000x100000/WithoutXY-8 41.3kB ± 0% 41.2kB ± 0% -0.20% (p=0.000 n=20+16) GCD1000x100000/WithXY-8 301kB ± 0% 301kB ± 0% -0.13% (p=0.000 n=20+20) GCD10000x10000/WithoutXY-8 8.64kB ± 0% 8.48kB ± 0% -1.85% (p=0.000 n=20+20) GCD10000x10000/WithXY-8 57.2kB ± 0% 57.7kB ± 0% +0.80% (p=0.000 n=20+20) GCD10000x100000/WithoutXY-8 43.8kB ± 0% 43.7kB ± 0% -0.19% (p=0.000 n=20+18) GCD10000x100000/WithXY-8 2.08MB ± 0% 2.08MB ± 0% -0.02% (p=0.000 n=15+19) GCD100000x100000/WithoutXY-8 81.6kB ± 0% 81.4kB ± 0% -0.20% (p=0.000 n=20+20) GCD100000x100000/WithXY-8 4.32MB ± 0% 4.33MB ± 0% +0.12% (p=0.000 n=20+20) Hilbert-8 653kB ± 0% 313kB ± 0% -52.13% (p=0.000 n=19+20) Binomial-8 1.82kB ± 0% 1.02kB ± 0% -43.86% (p=0.000 n=20+20) QuoRem-8 0.00B 0.00B ~ (all equal) Exp-8 11.1kB ± 0% 11.0kB ± 0% -0.34% (p=0.000 n=19+20) Exp2-8 11.3kB ± 0% 11.3kB ± 0% -0.35% (p=0.000 n=19+20) Bitset-8 0.00B 0.00B ~ (all equal) BitsetNeg-8 0.00B 0.00B ~ (all equal) BitsetOrig-8 103B ± 0% 63B ± 0% -38.83% (p=0.000 n=20+20) BitsetNegOrig-8 215B ± 0% 175B ± 0% -18.60% (p=0.000 n=20+20) ModSqrt225_Tonelli-8 11.3kB ± 0% 11.0kB ± 0% -2.76% (p=0.000 n=20+17) ModSqrt225_3Mod4-8 3.57kB ± 0% 3.53kB ± 0% -1.12% (p=0.000 n=20+20) ModSqrt231_Tonelli-8 11.0kB ± 0% 10.7kB ± 0% -2.55% (p=0.000 n=20+20) ModSqrt231_5Mod8-8 4.21kB ± 0% 4.09kB ± 0% -2.85% (p=0.000 n=16+20) ModInverse-8 1.44kB ± 0% 1.28kB ± 0% -11.11% (p=0.000 n=20+20) Sqrt-8 6.00kB ± 0% 6.00kB ± 0% ~ (all equal) IntSqr/1-8 0.00B 0.00B ~ (all equal) IntSqr/2-8 0.00B 0.00B ~ (all equal) IntSqr/3-8 0.00B 0.00B ~ (all equal) IntSqr/5-8 0.00B 0.00B ~ (all equal) IntSqr/8-8 0.00B 0.00B ~ (all equal) IntSqr/10-8 0.00B 0.00B ~ (all equal) IntSqr/20-8 320B ± 0% 320B ± 0% ~ (all equal) IntSqr/30-8 480B ± 0% 480B ± 0% ~ (all equal) IntSqr/50-8 896B ± 0% 896B ± 0% ~ (all equal) IntSqr/80-8 1.28kB ± 0% 1.28kB ± 0% ~ (all equal) IntSqr/100-8 1.79kB ± 0% 1.79kB ± 0% ~ (all equal) IntSqr/200-8 3.20kB ± 0% 3.20kB ± 0% ~ (all equal) IntSqr/300-8 8.06kB ± 0% 8.06kB ± 0% ~ (all equal) IntSqr/500-8 12.3kB ± 0% 12.3kB ± 0% ~ (all equal) IntSqr/800-8 28.8kB ± 0% 28.8kB ± 0% ~ (all equal) IntSqr/1000-8 36.9kB ± 0% 36.9kB ± 0% ~ (all equal) Div/20/10-8 0.00B 0.00B ~ (all equal) Div/200/100-8 0.00B 0.00B ~ (all equal) Div/2000/1000-8 0.00B 0.00B ~ (all equal) Div/20000/10000-8 0.00B 0.00B ~ (all equal) Div/200000/100000-8 690B ± 0% 690B ± 0% ~ (all equal) Mul-8 565kB ± 0% 565kB ± 0% ~ (all equal) ZeroShifts/Shl-8 6.53kB ± 0% 6.53kB ± 0% ~ (all equal) ZeroShifts/ShlSame-8 0.00B 0.00B ~ (all equal) ZeroShifts/Shr-8 6.53kB ± 0% 6.53kB ± 0% ~ (all equal) ZeroShifts/ShrSame-8 0.00B 0.00B ~ (all equal) Exp3Power/0x10-8 192B ± 0% 112B ± 0% -41.67% (p=0.000 n=20+20) Exp3Power/0x40-8 192B ± 0% 112B ± 0% -41.67% (p=0.000 n=20+20) Exp3Power/0x100-8 288B ± 0% 208B ± 0% -27.78% (p=0.000 n=20+20) Exp3Power/0x400-8 672B ± 0% 592B ± 0% -11.90% (p=0.000 n=20+20) Exp3Power/0x1000-8 3.33kB ± 0% 3.25kB ± 0% -2.40% (p=0.000 n=20+20) Exp3Power/0x4000-8 13.8kB ± 0% 13.7kB ± 0% -0.58% (p=0.000 n=20+20) Exp3Power/0x10000-8 117kB ± 0% 117kB ± 0% -0.07% (p=0.000 n=20+20) Exp3Power/0x40000-8 755kB ± 0% 755kB ± 0% -0.01% (p=0.000 n=19+20) Exp3Power/0x100000-8 5.22MB ± 0% 5.22MB ± 0% -0.00% (p=0.000 n=20+20) Exp3Power/0x400000-8 39.8MB ± 0% 39.8MB ± 0% -0.00% (p=0.000 n=20+19) Fibo-8 3.09MB ± 0% 3.08MB ± 0% -0.28% (p=0.000 n=20+16) NatSqr/1-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) NatSqr/2-8 64.0B ± 0% 64.0B ± 0% ~ (all equal) NatSqr/3-8 80.0B ± 0% 80.0B ± 0% ~ (all equal) NatSqr/5-8 112B ± 0% 112B ± 0% ~ (all equal) NatSqr/8-8 160B ± 0% 160B ± 0% ~ (all equal) NatSqr/10-8 192B ± 0% 192B ± 0% ~ (all equal) NatSqr/20-8 672B ± 0% 672B ± 0% ~ (all equal) NatSqr/30-8 992B ± 0% 992B ± 0% ~ (all equal) NatSqr/50-8 1.79kB ± 0% 1.79kB ± 0% ~ (all equal) NatSqr/80-8 2.69kB ± 0% 2.69kB ± 0% ~ (all equal) NatSqr/100-8 3.58kB ± 0% 3.58kB ± 0% ~ (all equal) NatSqr/200-8 6.66kB ± 0% 6.66kB ± 0% ~ (all equal) NatSqr/300-8 24.4kB ± 0% 24.4kB ± 0% ~ (all equal) NatSqr/500-8 36.9kB ± 0% 36.9kB ± 0% ~ (all equal) NatSqr/800-8 69.8kB ± 0% 69.8kB ± 0% ~ (all equal) NatSqr/1000-8 86.0kB ± 0% 86.0kB ± 0% ~ (all equal) NatSetBytes/8-8 0.00B 0.00B ~ (all equal) NatSetBytes/24-8 64.0B ± 0% 64.0B ± 0% ~ (all equal) NatSetBytes/128-8 160B ± 0% 160B ± 0% ~ (all equal) NatSetBytes/7-8 0.00B 0.00B ~ (all equal) NatSetBytes/23-8 64.0B ± 0% 64.0B ± 0% ~ (all equal) NatSetBytes/127-8 160B ± 0% 160B ± 0% ~ (all equal) ScanPi-8 75.4kB ± 0% 75.7kB ± 0% +0.41% (p=0.000 n=20+20) StringPiParallel-8 20.4kB ± 0% 20.4kB ± 0% ~ (p=0.223 n=20+20) Scan/10/Base2-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100/Base2-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/1000/Base2-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/10000/Base2-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100000/Base2-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/10/Base8-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100/Base8-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/1000/Base8-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/10000/Base8-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100000/Base8-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/10/Base10-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100/Base10-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/1000/Base10-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/10000/Base10-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100000/Base10-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/10/Base16-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100/Base16-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/1000/Base16-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/10000/Base16-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) Scan/100000/Base16-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) String/10/Base2-8 48.0B ± 0% 48.0B ± 0% ~ (all equal) String/100/Base2-8 352B ± 0% 352B ± 0% ~ (all equal) String/1000/Base2-8 3.46kB ± 0% 3.46kB ± 0% ~ (all equal) String/10000/Base2-8 41.0kB ± 0% 41.0kB ± 0% ~ (all equal) String/100000/Base2-8 336kB ± 0% 336kB ± 0% ~ (all equal) String/10/Base8-8 16.0B ± 0% 16.0B ± 0% ~ (all equal) String/100/Base8-8 112B ± 0% 112B ± 0% ~ (all equal) String/1000/Base8-8 1.15kB ± 0% 1.15kB ± 0% ~ (all equal) String/10000/Base8-8 12.3kB ± 0% 12.3kB ± 0% ~ (all equal) String/100000/Base8-8 115kB ± 0% 115kB ± 0% ~ (all equal) String/10/Base10-8 64.0B ± 0% 24.0B ± 0% -62.50% (p=0.000 n=20+20) String/100/Base10-8 192B ± 0% 192B ± 0% ~ (all equal) String/1000/Base10-8 1.95kB ± 0% 1.95kB ± 0% ~ (all equal) String/10000/Base10-8 20.0kB ± 0% 20.0kB ± 0% ~ (p=0.983 n=19+20) String/100000/Base10-8 210kB ± 1% 211kB ± 1% +0.82% (p=0.000 n=19+20) String/10/Base16-8 16.0B ± 0% 16.0B ± 0% ~ (all equal) String/100/Base16-8 96.0B ± 0% 96.0B ± 0% ~ (all equal) String/1000/Base16-8 896B ± 0% 896B ± 0% ~ (all equal) String/10000/Base16-8 9.47kB ± 0% 9.47kB ± 0% ~ (all equal) String/100000/Base16-8 90.1kB ± 0% 90.1kB ± 0% ~ (all equal) LeafSize/0-8 16.9kB ± 0% 16.8kB ± 0% -0.44% (p=0.000 n=20+20) LeafSize/1-8 22.4kB ± 0% 22.3kB ± 0% -0.34% (p=0.000 n=20+19) LeafSize/2-8 22.4kB ± 0% 22.3kB ± 0% -0.34% (p=0.000 n=20+19) LeafSize/3-8 22.4kB ± 0% 22.3kB ± 0% -0.34% (p=0.000 n=20+17) LeafSize/4-8 22.4kB ± 0% 22.3kB ± 0% -0.34% (p=0.000 n=20+19) LeafSize/5-8 22.4kB ± 0% 22.3kB ± 0% -0.33% (p=0.000 n=20+20) LeafSize/6-8 22.3kB ± 0% 22.2kB ± 0% -0.34% (p=0.000 n=20+20) LeafSize/7-8 22.3kB ± 0% 22.2kB ± 0% -0.35% (p=0.000 n=20+20) LeafSize/8-8 22.3kB ± 0% 22.2kB ± 0% -0.34% (p=0.000 n=16+20) LeafSize/9-8 22.3kB ± 0% 22.2kB ± 0% -0.33% (p=0.000 n=20+20) LeafSize/10-8 22.3kB ± 0% 22.2kB ± 0% -0.33% (p=0.000 n=20+20) LeafSize/11-8 22.3kB ± 0% 22.2kB ± 0% -0.33% (p=0.000 n=20+20) LeafSize/12-8 22.3kB ± 0% 22.2kB ± 0% -0.33% (p=0.000 n=20+20) LeafSize/13-8 22.3kB ± 0% 22.2kB ± 0% -0.34% (p=0.000 n=20+15) LeafSize/14-8 22.3kB ± 0% 22.2kB ± 0% -0.33% (p=0.000 n=20+20) LeafSize/15-8 22.3kB ± 0% 22.2kB ± 0% -0.33% (p=0.000 n=20+20) LeafSize/16-8 22.3kB ± 0% 22.2kB ± 0% -0.33% (p=0.000 n=19+20) LeafSize/32-8 22.3kB ± 0% 22.2kB ± 0% -0.32% (p=0.000 n=20+20) LeafSize/64-8 21.8kB ± 0% 21.7kB ± 0% -0.33% (p=0.000 n=18+19) ProbablyPrime/n=0-8 15.3kB ± 0% 14.9kB ± 0% -2.35% (p=0.000 n=20+20) ProbablyPrime/n=1-8 21.0kB ± 0% 20.7kB ± 0% -1.71% (p=0.000 n=20+20) ProbablyPrime/n=5-8 43.4kB ± 0% 42.9kB ± 0% -1.20% (p=0.000 n=20+20) ProbablyPrime/n=10-8 71.5kB ± 0% 70.7kB ± 0% -1.01% (p=0.000 n=19+20) ProbablyPrime/n=20-8 127kB ± 0% 126kB ± 0% -0.88% (p=0.000 n=20+20) ProbablyPrime/Lucas-8 3.07kB ± 0% 2.79kB ± 0% -9.12% (p=0.000 n=20+20) ProbablyPrime/MillerRabinBase2-8 12.1kB ± 0% 12.0kB ± 0% -0.66% (p=0.000 n=20+20) FloatSqrt/64-8 416B ± 0% 360B ± 0% -13.46% (p=0.000 n=20+20) FloatSqrt/128-8 640B ± 0% 584B ± 0% -8.75% (p=0.000 n=20+20) FloatSqrt/256-8 512B ± 0% 472B ± 0% -7.81% (p=0.000 n=20+20) FloatSqrt/1000-8 1.47kB ± 0% 1.43kB ± 0% -2.72% (p=0.000 n=20+20) FloatSqrt/10000-8 18.2kB ± 0% 18.1kB ± 0% -0.22% (p=0.000 n=20+20) FloatSqrt/100000-8 204kB ± 0% 204kB ± 0% -0.02% (p=0.000 n=20+20) FloatSqrt/1000000-8 6.37MB ± 0% 6.37MB ± 0% -0.00% (p=0.000 n=19+20) [Geo mean] 3.42kB 3.24kB -5.33% name old allocs/op new allocs/op delta DecimalConversion-8 1.65k ± 0% 1.65k ± 0% ~ (all equal) FloatString/100-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) FloatString/1000-8 9.00 ± 0% 9.00 ± 0% ~ (all equal) FloatString/10000-8 22.0 ± 0% 22.0 ± 0% ~ (all equal) FloatString/100000-8 136 ± 0% 136 ± 0% ~ (all equal) FloatAdd/10-8 0.00 0.00 ~ (all equal) FloatAdd/100-8 0.00 0.00 ~ (all equal) FloatAdd/1000-8 0.00 0.00 ~ (all equal) FloatAdd/10000-8 0.00 0.00 ~ (all equal) FloatAdd/100000-8 0.00 0.00 ~ (all equal) FloatSub/10-8 0.00 0.00 ~ (all equal) FloatSub/100-8 0.00 0.00 ~ (all equal) FloatSub/1000-8 0.00 0.00 ~ (all equal) FloatSub/10000-8 0.00 0.00 ~ (all equal) FloatSub/100000-8 0.00 0.00 ~ (all equal) ParseFloatSmallExp-8 110 ± 0% 130 ± 0% +18.18% (p=0.000 n=20+20) ParseFloatLargeExp-8 319 ± 0% 371 ± 0% +16.30% (p=0.000 n=20+20) GCD10x10/WithoutXY-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) GCD10x10/WithXY-8 5.00 ± 0% 6.00 ± 0% +20.00% (p=0.000 n=20+20) GCD10x100/WithoutXY-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) GCD10x100/WithXY-8 9.00 ± 0% 12.00 ± 0% +33.33% (p=0.000 n=20+20) GCD10x1000/WithoutXY-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) GCD10x1000/WithXY-8 11.0 ± 0% 12.0 ± 0% +9.09% (p=0.000 n=20+20) GCD10x10000/WithoutXY-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) GCD10x10000/WithXY-8 11.0 ± 0% 12.0 ± 0% +9.09% (p=0.000 n=20+20) GCD10x100000/WithoutXY-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) GCD10x100000/WithXY-8 11.0 ± 0% 12.0 ± 0% +9.09% (p=0.000 n=20+20) GCD100x100/WithoutXY-8 6.00 ± 0% 10.00 ± 0% +66.67% (p=0.000 n=20+20) GCD100x100/WithXY-8 9.00 ± 0% 15.00 ± 0% +66.67% (p=0.000 n=20+20) GCD100x1000/WithoutXY-8 6.00 ± 0% 8.00 ± 0% +33.33% (p=0.000 n=20+20) GCD100x1000/WithXY-8 12.0 ± 0% 13.0 ± 0% +8.33% (p=0.000 n=20+20) GCD100x10000/WithoutXY-8 6.00 ± 0% 8.00 ± 0% +33.33% (p=0.000 n=20+20) GCD100x10000/WithXY-8 12.0 ± 0% 13.0 ± 0% +8.33% (p=0.000 n=20+20) GCD100x100000/WithoutXY-8 6.00 ± 0% 8.00 ± 0% +33.33% (p=0.000 n=20+20) GCD100x100000/WithXY-8 12.0 ± 0% 13.0 ± 0% +8.33% (p=0.000 n=20+20) GCD1000x1000/WithoutXY-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) GCD1000x1000/WithXY-8 19.0 ± 0% 20.0 ± 0% +5.26% (p=0.000 n=20+20) GCD1000x10000/WithoutXY-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) GCD1000x10000/WithXY-8 26.0 ± 0% 26.0 ± 0% ~ (all equal) GCD1000x100000/WithoutXY-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) GCD1000x100000/WithXY-8 27.0 ± 0% 27.0 ± 0% ~ (all equal) GCD10000x10000/WithoutXY-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) GCD10000x10000/WithXY-8 76.0 ± 0% 78.0 ± 0% +2.63% (p=0.000 n=20+20) GCD10000x100000/WithoutXY-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) GCD10000x100000/WithXY-8 174 ± 0% 174 ± 0% ~ (all equal) GCD100000x100000/WithoutXY-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) GCD100000x100000/WithXY-8 645 ± 0% 647 ± 0% +0.31% (p=0.000 n=20+20) Hilbert-8 14.1k ± 0% 14.3k ± 0% +0.92% (p=0.000 n=20+20) Binomial-8 38.0 ± 0% 38.0 ± 0% ~ (all equal) QuoRem-8 0.00 0.00 ~ (all equal) Exp-8 21.0 ± 0% 21.0 ± 0% ~ (all equal) Exp2-8 22.0 ± 0% 22.0 ± 0% ~ (all equal) Bitset-8 0.00 0.00 ~ (all equal) BitsetNeg-8 0.00 0.00 ~ (all equal) BitsetOrig-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) BitsetNegOrig-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) ModSqrt225_Tonelli-8 85.0 ± 0% 86.0 ± 0% +1.18% (p=0.000 n=20+20) ModSqrt225_3Mod4-8 25.0 ± 0% 25.0 ± 0% ~ (all equal) ModSqrt231_Tonelli-8 80.0 ± 0% 80.0 ± 0% ~ (all equal) ModSqrt231_5Mod8-8 32.0 ± 0% 32.0 ± 0% ~ (all equal) ModInverse-8 11.0 ± 0% 11.0 ± 0% ~ (all equal) Sqrt-8 13.0 ± 0% 13.0 ± 0% ~ (all equal) IntSqr/1-8 0.00 0.00 ~ (all equal) IntSqr/2-8 0.00 0.00 ~ (all equal) IntSqr/3-8 0.00 0.00 ~ (all equal) IntSqr/5-8 0.00 0.00 ~ (all equal) IntSqr/8-8 0.00 0.00 ~ (all equal) IntSqr/10-8 0.00 0.00 ~ (all equal) IntSqr/20-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) IntSqr/30-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) IntSqr/50-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) IntSqr/80-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) IntSqr/100-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) IntSqr/200-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) IntSqr/300-8 3.00 ± 0% 3.00 ± 0% ~ (all equal) IntSqr/500-8 3.00 ± 0% 3.00 ± 0% ~ (all equal) IntSqr/800-8 9.00 ± 0% 9.00 ± 0% ~ (all equal) IntSqr/1000-8 9.00 ± 0% 9.00 ± 0% ~ (all equal) Div/20/10-8 0.00 0.00 ~ (all equal) Div/200/100-8 0.00 0.00 ~ (all equal) Div/2000/1000-8 0.00 0.00 ~ (all equal) Div/20000/10000-8 0.00 0.00 ~ (all equal) Div/200000/100000-8 0.00 0.00 ~ (all equal) Mul-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) ZeroShifts/Shl-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) ZeroShifts/ShlSame-8 0.00 0.00 ~ (all equal) ZeroShifts/Shr-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) ZeroShifts/ShrSame-8 0.00 0.00 ~ (all equal) Exp3Power/0x10-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Exp3Power/0x40-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) Exp3Power/0x100-8 5.00 ± 0% 5.00 ± 0% ~ (all equal) Exp3Power/0x400-8 7.00 ± 0% 7.00 ± 0% ~ (all equal) Exp3Power/0x1000-8 11.0 ± 0% 11.0 ± 0% ~ (all equal) Exp3Power/0x4000-8 15.0 ± 0% 15.0 ± 0% ~ (all equal) Exp3Power/0x10000-8 29.0 ± 0% 29.0 ± 0% ~ (all equal) Exp3Power/0x40000-8 140 ± 0% 140 ± 0% ~ (all equal) Exp3Power/0x100000-8 1.12k ± 0% 1.12k ± 0% ~ (all equal) Exp3Power/0x400000-8 9.88k ± 0% 9.88k ± 0% ~ (p=0.747 n=17+19) Fibo-8 739 ± 0% 743 ± 0% +0.54% (p=0.000 n=20+20) NatSqr/1-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSqr/2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSqr/3-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSqr/5-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSqr/8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSqr/10-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSqr/20-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) NatSqr/30-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) NatSqr/50-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) NatSqr/80-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) NatSqr/100-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) NatSqr/200-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) NatSqr/300-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) NatSqr/500-8 4.00 ± 0% 4.00 ± 0% ~ (all equal) NatSqr/800-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) NatSqr/1000-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) NatSetBytes/8-8 0.00 0.00 ~ (all equal) NatSetBytes/24-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSetBytes/128-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSetBytes/7-8 0.00 0.00 ~ (all equal) NatSetBytes/23-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) NatSetBytes/127-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) ScanPi-8 60.0 ± 0% 61.0 ± 0% +1.67% (p=0.000 n=20+20) StringPiParallel-8 24.0 ± 0% 24.0 ± 0% ~ (all equal) Scan/10/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/1000/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/10000/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100000/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/10/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/1000/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/10000/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100000/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/10/Base10-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100/Base10-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/1000/Base10-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/10000/Base10-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100000/Base10-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/10/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/1000/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/10000/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) Scan/100000/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/10/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/100/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/1000/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/10000/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/100000/Base2-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/10/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/100/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/1000/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/10000/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/100000/Base8-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/10/Base10-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) String/100/Base10-8 2.00 ± 0% 2.00 ± 0% ~ (all equal) String/1000/Base10-8 3.00 ± 0% 3.00 ± 0% ~ (all equal) String/10000/Base10-8 3.00 ± 0% 3.00 ± 0% ~ (all equal) String/100000/Base10-8 3.00 ± 0% 3.00 ± 0% ~ (all equal) String/10/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/100/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/1000/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/10000/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) String/100000/Base16-8 1.00 ± 0% 1.00 ± 0% ~ (all equal) LeafSize/0-8 10.0 ± 0% 10.0 ± 0% ~ (all equal) LeafSize/1-8 13.0 ± 0% 13.0 ± 0% ~ (all equal) LeafSize/2-8 13.0 ± 0% 13.0 ± 0% ~ (all equal) LeafSize/3-8 13.0 ± 0% 13.0 ± 0% ~ (all equal) LeafSize/4-8 13.0 ± 0% 13.0 ± 0% ~ (all equal) LeafSize/5-8 13.0 ± 0% 13.0 ± 0% ~ (all equal) LeafSize/6-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/7-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/8-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/9-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/10-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/11-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/12-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/13-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/14-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/15-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/16-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/32-8 12.0 ± 0% 12.0 ± 0% ~ (all equal) LeafSize/64-8 11.0 ± 0% 11.0 ± 0% ~ (all equal) ProbablyPrime/n=0-8 52.0 ± 0% 52.0 ± 0% ~ (all equal) ProbablyPrime/n=1-8 73.0 ± 0% 73.0 ± 0% ~ (all equal) ProbablyPrime/n=5-8 157 ± 0% 157 ± 0% ~ (all equal) ProbablyPrime/n=10-8 262 ± 0% 262 ± 0% ~ (all equal) ProbablyPrime/n=20-8 472 ± 0% 472 ± 0% ~ (all equal) ProbablyPrime/Lucas-8 22.0 ± 0% 22.0 ± 0% ~ (all equal) ProbablyPrime/MillerRabinBase2-8 29.0 ± 0% 29.0 ± 0% ~ (all equal) FloatSqrt/64-8 9.00 ± 0% 10.00 ± 0% +11.11% (p=0.000 n=20+20) FloatSqrt/128-8 12.0 ± 0% 13.0 ± 0% +8.33% (p=0.000 n=20+20) FloatSqrt/256-8 8.00 ± 0% 8.00 ± 0% ~ (all equal) FloatSqrt/1000-8 9.00 ± 0% 9.00 ± 0% ~ (all equal) FloatSqrt/10000-8 14.0 ± 0% 14.0 ± 0% ~ (all equal) FloatSqrt/100000-8 33.0 ± 0% 33.0 ± 0% ~ (all equal) FloatSqrt/1000000-8 1.16k ± 0% 1.16k ± 0% ~ (all equal) [Geo mean] 6.62 6.76 +2.09% Change-Id: Id9df4157cac1e07721e35cff7fcdefe60703873a Reviewed-on: https://go-review.googlesource.com/c/150999 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Alan Donovan Reviewed-by: Robert Griesemer --- src/math/big/nat.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/math/big/nat.go b/src/math/big/nat.go index 5f5cf5c3e4f52..1e4a3b09cf771 100644 --- a/src/math/big/nat.go +++ b/src/math/big/nat.go @@ -58,6 +58,10 @@ func (z nat) make(n int) nat { if n <= cap(z) { return z[:n] // reuse z } + if n == 1 { + // Most nats start small and stay that way; don't over-allocate. + return make(nat, 1) + } // Choosing a good value for e has significant performance impact // because it increases the chance that a value can be reused. const e = 4 // extra capacity From 2d4bd3db7f0eb3d833453ae39079a5f2e5db2737 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 28 Nov 2018 16:50:57 +0100 Subject: [PATCH 155/594] plugin: fix build constraint to disable test on linux/arm64 CL 151478 was suppose to fix the build failure on linux/arm64 but the build constraint didn't exclude linux/arm64 properly. Fixes #28982 Change-Id: Ia80265b0adba0384cd28bc2deb1726418664975a Reviewed-on: https://go-review.googlesource.com/c/151303 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Andrew Bonventre --- src/plugin/plugin_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugin/plugin_test.go b/src/plugin/plugin_test.go index be742b8c6df5e..b334c5cf0ec02 100644 --- a/src/plugin/plugin_test.go +++ b/src/plugin/plugin_test.go @@ -2,7 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !nacl !linux,arm64 +// +build !nacl +// +build !linux linux,!arm64 package plugin_test From 96d41786c5bd5b3597b6a28a7e8c412c33f15086 Mon Sep 17 00:00:00 2001 From: James Craig Burley Date: Wed, 28 Nov 2018 18:53:16 +0000 Subject: [PATCH 156/594] doc: fix typo in FAQ Change-Id: I956d6d1dbf8516cb65eb3a0686a3b0584b4a6840 GitHub-Last-Rev: 1c928f3c67eceae424cbcd6b0935605a78728604 GitHub-Pull-Request: golang/go#28991 Reviewed-on: https://go-review.googlesource.com/c/151324 Reviewed-by: Brad Fitzpatrick --- doc/go_faq.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go_faq.html b/doc/go_faq.html index c61dd0fc5f481..305878f2378f1 100644 --- a/doc/go_faq.html +++ b/doc/go_faq.html @@ -1769,7 +1769,7 @@

    type *T consists of all methods with receiver *T or T. That means the method set of *T -includes that of T), +includes that of T, but not the reverse.

    From 4f15b54780af7159732794f9d67c9a8a455bbf61 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 28 Nov 2018 12:41:23 -0800 Subject: [PATCH 157/594] cmd/compile: ensure S390X moves don't overflow int32 Break ADDconst into ADD + MOVDconst, so that if the constant is too big it won't overflow ADDconst's constant field. For normal sizes, other rules will recombine into an ADDconst. Fixes S390X breakage from CL 33909. Change-Id: Id804ee052365527efb580f797688b0ce83c47915 Reviewed-on: https://go-review.googlesource.com/c/151597 Run-TryBot: Keith Randall Reviewed-by: Michael Munday --- src/cmd/compile/internal/ssa/gen/S390X.rules | 2 +- src/cmd/compile/internal/ssa/rewriteS390X.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cmd/compile/internal/ssa/gen/S390X.rules b/src/cmd/compile/internal/ssa/gen/S390X.rules index de2c09c2d1de2..0aeea53561683 100644 --- a/src/cmd/compile/internal/ssa/gen/S390X.rules +++ b/src/cmd/compile/internal/ssa/gen/S390X.rules @@ -350,7 +350,7 @@ // Move more than 1024 bytes using a loop. (Move [s] dst src mem) && s > 1024 -> - (LoweredMove [s%256] dst src (ADDconst src [(s/256)*256]) mem) + (LoweredMove [s%256] dst src (ADD src (MOVDconst [(s/256)*256])) mem) // Lowering Zero instructions (Zero [0] _ mem) -> mem diff --git a/src/cmd/compile/internal/ssa/rewriteS390X.go b/src/cmd/compile/internal/ssa/rewriteS390X.go index dce7a52529041..1695b08780985 100644 --- a/src/cmd/compile/internal/ssa/rewriteS390X.go +++ b/src/cmd/compile/internal/ssa/rewriteS390X.go @@ -4799,7 +4799,7 @@ func rewriteValueS390X_OpMove_10(v *Value) bool { } // match: (Move [s] dst src mem) // cond: s > 1024 - // result: (LoweredMove [s%256] dst src (ADDconst src [(s/256)*256]) mem) + // result: (LoweredMove [s%256] dst src (ADD src (MOVDconst [(s/256)*256])) mem) for { s := v.AuxInt _ = v.Args[2] @@ -4813,9 +4813,11 @@ func rewriteValueS390X_OpMove_10(v *Value) bool { v.AuxInt = s % 256 v.AddArg(dst) v.AddArg(src) - v0 := b.NewValue0(v.Pos, OpS390XADDconst, src.Type) - v0.AuxInt = (s / 256) * 256 + v0 := b.NewValue0(v.Pos, OpS390XADD, src.Type) v0.AddArg(src) + v1 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64) + v1.AuxInt = (s / 256) * 256 + v0.AddArg(v1) v.AddArg(v0) v.AddArg(mem) return true From 9aadbf5755dc8e3c3b0a224f513c92b804a1a3a7 Mon Sep 17 00:00:00 2001 From: Meng Zhuo Date: Tue, 27 Nov 2018 16:16:43 +0800 Subject: [PATCH 158/594] net/http: prevent transport sends two "Connection: close" headers There are three functions that do Connection header write: 1. transport.go/ persistConn.roundTrip 2. transfer.go/ transferWriter.writeHeader 3. request.go/ Request.write The root cause is roundTrip didn't lookup into request.Close and transferWriter didn't take care of extraHeaders. Fixes #28886 Change-Id: I1d131019c7cd42eb1bcc972c631b7df7511c1f39 Reviewed-on: https://go-review.googlesource.com/c/150722 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/http/request.go | 3 ++ src/net/http/transport.go | 2 +- src/net/http/transport_test.go | 54 ++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/net/http/request.go b/src/net/http/request.go index 5b7e6564ae504..d994e81d23771 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -1330,6 +1330,9 @@ func (r *Request) wantsHttp10KeepAlive() bool { } func (r *Request) wantsClose() bool { + if r.Close { + return true + } return hasToken(r.Header.get("Connection"), "close") } diff --git a/src/net/http/transport.go b/src/net/http/transport.go index e1cfc668ea84f..ad0201d554b75 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -2135,7 +2135,7 @@ func (pc *persistConn) roundTrip(req *transportRequest) (resp *Response, err err continueCh = make(chan struct{}, 1) } - if pc.t.DisableKeepAlives { + if pc.t.DisableKeepAlives && !req.wantsClose() { req.extraHeaders().Set("Connection", "close") } diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index 22ca3f9550e40..1021ce5aa20a3 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -41,6 +41,8 @@ import ( "sync/atomic" "testing" "time" + + "golang_org/x/net/http/httpguts" ) // TODO: test 5 pipelined requests with responses: 1) OK, 2) OK, Connection: Close @@ -310,6 +312,58 @@ func TestTransportConnectionCloseOnRequestDisableKeepAlive(t *testing.T) { } } +// Test that Transport only sends one "Connection: close", regardless of +// how "close" was indicated. +func TestTransportRespectRequestWantsClose(t *testing.T) { + tests := []struct { + disableKeepAlives bool + close bool + }{ + {disableKeepAlives: false, close: false}, + {disableKeepAlives: false, close: true}, + {disableKeepAlives: true, close: false}, + {disableKeepAlives: true, close: true}, + } + + for _, tc := range tests { + t.Run(fmt.Sprintf("DisableKeepAlive=%v,RequestClose=%v", tc.disableKeepAlives, tc.close), + func(t *testing.T) { + defer afterTest(t) + ts := httptest.NewServer(hostPortHandler) + defer ts.Close() + + c := ts.Client() + c.Transport.(*Transport).DisableKeepAlives = tc.disableKeepAlives + req, err := NewRequest("GET", ts.URL, nil) + if err != nil { + t.Fatal(err) + } + count := 0 + trace := &httptrace.ClientTrace{ + WroteHeaderField: func(key string, field []string) { + if key != "Connection" { + return + } + if httpguts.HeaderValuesContainsToken(field, "close") { + count += 1 + } + }, + } + req = req.WithContext(httptrace.WithClientTrace(req.Context(), trace)) + req.Close = tc.close + res, err := c.Do(req) + if err != nil { + t.Fatal(err) + } + defer res.Body.Close() + if want := tc.disableKeepAlives || tc.close; count > 1 || (count == 1) != want { + t.Errorf("expecting want:%v, got 'Connection: close':%d", want, count) + } + }) + } + +} + func TestTransportIdleCacheKeys(t *testing.T) { defer afterTest(t) ts := httptest.NewServer(hostPortHandler) From 048580d341a530bb8d9ca891f95ce79aace4151f Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Tue, 13 Nov 2018 16:05:15 -0500 Subject: [PATCH 159/594] cmd/asm,cmd/internal/obj/ppc64: add VPERMXOR to ppc64 assembler VPERMXOR is missing from the Go assembler for ppc64. It has the same format as VPERM. It was requested by an external user so they could write an optimized algorithm in asm. Change-Id: Icf4c682f7f46716ccae64e6ae3d62e8cec67f6c1 Reviewed-on: https://go-review.googlesource.com/c/151578 Run-TryBot: Lynn Boger TryBot-Result: Gobot Gobot Reviewed-by: Carlos Eduardo Seo --- src/cmd/asm/internal/asm/testdata/ppc64.s | 1 + src/cmd/internal/obj/ppc64/a.out.go | 1 + src/cmd/internal/obj/ppc64/anames.go | 1 + src/cmd/internal/obj/ppc64/asm9.go | 4 +++- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cmd/asm/internal/asm/testdata/ppc64.s b/src/cmd/asm/internal/asm/testdata/ppc64.s index 9e8929dac4c69..366c80c0905ae 100644 --- a/src/cmd/asm/internal/asm/testdata/ppc64.s +++ b/src/cmd/asm/internal/asm/testdata/ppc64.s @@ -948,6 +948,7 @@ label1: // VRA,VRB,VRC,VRT produces // VRT,VRA,VRB,VRC VPERM V3, V2, V1, V0 + VPERMXOR V3, V2, V1, V0 // Vector bit permute, VX-form // VRA,VRB,VRT produces diff --git a/src/cmd/internal/obj/ppc64/a.out.go b/src/cmd/internal/obj/ppc64/a.out.go index 0fd9c81039140..6b248d5c366c2 100644 --- a/src/cmd/internal/obj/ppc64/a.out.go +++ b/src/cmd/internal/obj/ppc64/a.out.go @@ -903,6 +903,7 @@ const ( AVCMPNEZB AVCMPNEZBCC AVPERM + AVPERMXOR AVBPERMQ AVBPERMD AVSEL diff --git a/src/cmd/internal/obj/ppc64/anames.go b/src/cmd/internal/obj/ppc64/anames.go index c04ce27e46313..fb934e96f953b 100644 --- a/src/cmd/internal/obj/ppc64/anames.go +++ b/src/cmd/internal/obj/ppc64/anames.go @@ -493,6 +493,7 @@ var Anames = []string{ "VCMPNEZB", "VCMPNEZBCC", "VPERM", + "VPERMXOR", "VBPERMQ", "VBPERMD", "VSEL", diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go index 51a9a18601347..d7f1a08622af2 100644 --- a/src/cmd/internal/obj/ppc64/asm9.go +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -1498,7 +1498,7 @@ func buildop(ctxt *obj.Link) { opset(AVCMPNEZBCC, r0) case AVPERM: /* vperm */ - opset(AVPERM, r0) + opset(AVPERMXOR, r0) case AVBPERMQ: /* vbpermq, vbpermd */ opset(AVBPERMD, r0) @@ -4503,6 +4503,8 @@ func (c *ctxt9) oprrr(a obj.As) uint32 { case AVPERM: return OPVX(4, 43, 0, 0) /* vperm - v2.03 */ + case AVPERMXOR: + return OPVX(4, 45, 0, 0) /* vpermxor - v2.03 */ case AVSEL: return OPVX(4, 42, 0, 0) /* vsel - v2.03 */ From 4f26f24d2ae8c99bfaafb33db4b7be27ee13afab Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 28 Nov 2018 16:02:15 -0800 Subject: [PATCH 160/594] cmd/cgo: recognize untyped constants defined in different files An untyped constant can be defined in any input file, we shouldn't segregate them by file. Updates #28772 Change-Id: I0347f15236833bb511eb49f86c449ee9241b0a25 Reviewed-on: https://go-review.googlesource.com/c/151600 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Andrew Bonventre --- misc/cgo/test/issue28545.go | 2 +- misc/cgo/test/issue28772.go | 12 ++++++++++++ src/cmd/cgo/ast.go | 3 +-- src/cmd/cgo/gcc.go | 2 +- src/cmd/cgo/main.go | 4 +++- 5 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 misc/cgo/test/issue28772.go diff --git a/misc/cgo/test/issue28545.go b/misc/cgo/test/issue28545.go index 0410a1662267d..8419b89c0afbe 100644 --- a/misc/cgo/test/issue28545.go +++ b/misc/cgo/test/issue28545.go @@ -22,5 +22,5 @@ const issue28772Constant = C.issue28772Constant func issue28545G(p **C.char) { C.issue28545F(p, -1, (0)) C.issue28545F(p, 2+3, complex(1, 1)) - C.issue28545F(p, issue28772Constant, (0)) + C.issue28545F(p, issue28772Constant, issue28772Constant2) } diff --git a/misc/cgo/test/issue28772.go b/misc/cgo/test/issue28772.go new file mode 100644 index 0000000000000..bed786bf30600 --- /dev/null +++ b/misc/cgo/test/issue28772.go @@ -0,0 +1,12 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cgotest + +// Constants didn't work if defined in different source file. + +// #define issue28772Constant2 2 +import "C" + +const issue28772Constant2 = C.issue28772Constant2 diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go index c342a017833b5..06058cb570d4f 100644 --- a/src/cmd/cgo/ast.go +++ b/src/cmd/cgo/ast.go @@ -66,7 +66,6 @@ func (f *File) ParseGo(name string, src []byte) { f.Package = ast1.Name.Name f.Name = make(map[string]*Name) f.NamePos = make(map[*Name]token.Pos) - f.Consts = make(map[string]bool) // In ast1, find the import "C" line and get any extra C preamble. sawC := false @@ -198,7 +197,7 @@ func (f *File) saveExprs(x interface{}, context astContext) { vs := spec.(*ast.ValueSpec) if vs.Type == nil { for _, name := range spec.(*ast.ValueSpec).Names { - f.Consts[name.Name] = true + consts[name.Name] = true } } } diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index fdd34f560fd71..56a4775746cd6 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -1233,7 +1233,7 @@ func (p *Package) isConst(f *File, x ast.Expr) bool { strings.HasPrefix(x.Name, "_Ciconst_") || strings.HasPrefix(x.Name, "_Cfconst_") || strings.HasPrefix(x.Name, "_Csconst_") || - f.Consts[x.Name] + consts[x.Name] case *ast.UnaryExpr: return p.isConst(f, x.X) case *ast.BinaryExpr: diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index a317a1494d782..e28a57b1481d0 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -62,9 +62,11 @@ type File struct { Name map[string]*Name // map from Go name to Name NamePos map[*Name]token.Pos // map from Name to position of the first reference Edit *edit.Buffer - Consts map[string]bool // untyped constants } +// Untyped constants in the current package. +var consts = make(map[string]bool) + func (f *File) offset(p token.Pos) int { return fset.Position(p).Offset } From 4c51c937808ee2fb88d469cf89c85c8e700f665c Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 28 Nov 2018 22:05:08 -0500 Subject: [PATCH 161/594] crypto/tls: prevent the test server from sending session tickets Since they are sent after the handshake in TLS 1.3, the client was not actually consuming them, as it doesn't make any Read calls. They were then sitting in the kernel receive buffer when the client would call Close. The kernel would see that and send a RST, which would race the closeNotify, causing errors. Also, we get to trim 600 lines of useless test data. Fixes #28852 Change-Id: I7517feab77dabab7504bfc111098ba09ea07ae5e Reviewed-on: https://go-review.googlesource.com/c/151659 Reviewed-by: Ian Lance Taylor --- src/crypto/tls/handshake_client_test.go | 239 +++++++------ .../tls/testdata/Client-TLSv13-AES128-SHA256 | 170 ++++----- .../tls/testdata/Client-TLSv13-AES256-SHA384 | 174 ++++----- src/crypto/tls/testdata/Client-TLSv13-ALPN | 172 ++++----- .../testdata/Client-TLSv13-CHACHA20-SHA256 | 170 ++++----- .../Client-TLSv13-ClientCert-ECDSA-RSA | 333 +++++++----------- .../Client-TLSv13-ClientCert-RSA-ECDSA | 320 ++++++----------- .../Client-TLSv13-ClientCert-RSA-RSAPSS | 324 ++++++----------- src/crypto/tls/testdata/Client-TLSv13-ECDSA | 160 ++++----- .../Client-TLSv13-ExportKeyingMaterial | 170 ++++----- .../testdata/Client-TLSv13-HelloRetryRequest | 169 ++++----- .../tls/testdata/Client-TLSv13-KeyUpdate | 184 ++++------ .../tls/testdata/Client-TLSv13-P256-ECDHE | 172 ++++----- .../tls/testdata/Client-TLSv13-X25519-ECDHE | 168 ++++----- 14 files changed, 1162 insertions(+), 1763 deletions(-) diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go index d7a4cc57d9603..2703cc72f9840 100644 --- a/src/crypto/tls/handshake_client_test.go +++ b/src/crypto/tls/handshake_client_test.go @@ -135,9 +135,9 @@ type clientTest struct { // name is a freeform string identifying the test and the file in which // the expected results will be stored. name string - // command, if not empty, contains a series of arguments for the + // args, if not empty, contains a series of arguments for the // command to run for the reference server. - command []string + args []string // config, if not nil, contains a custom Config to use for this test. config *Config // cert, if not empty, contains a DER-encoded certificate for the @@ -168,7 +168,7 @@ type clientTest struct { sendKeyUpdate bool } -var defaultServerCommand = []string{"openssl", "s_server"} +var serverCommand = []string{"openssl", "s_server", "-no_ticket", "-num_tickets", "0"} // connFromCommand starts the reference server process, connects to it and // returns a recordingConn for the connection. The stdin return value is an @@ -210,11 +210,8 @@ func (test *clientTest) connFromCommand() (conn *recordingConn, child *exec.Cmd, defer os.Remove(keyPath) var command []string - if len(test.command) > 0 { - command = append(command, test.command...) - } else { - command = append(command, defaultServerCommand...) - } + command = append(command, serverCommand...) + command = append(command, test.args...) command = append(command, "-cert", certPath, "-certform", "DER", "-key", keyPath) // serverPort contains the port that OpenSSL will listen on. OpenSSL // can't take "0" as an argument here so we have to pick a number and @@ -323,22 +320,16 @@ func (test *clientTest) run(t *testing.T, write bool) { clientConn, serverConn = localPipe(t) } - config := test.config - if config == nil { - config = testConfig - } - client := Client(clientConn, config) - doneChan := make(chan bool) go func() { - defer func() { - // Give time to the send buffer to drain, to avoid the kernel - // sending a RST and cutting off the flow. See Issue 18701. - time.Sleep(10 * time.Millisecond) - client.Close() - clientConn.Close() - doneChan <- true - }() + defer close(doneChan) + + config := test.config + if config == nil { + config = testConfig + } + client := Client(clientConn, config) + defer client.Close() if _, err := client.Write([]byte("hello\n")); err != nil { t.Errorf("Client.Write failed: %s", err) @@ -451,11 +442,8 @@ func (test *clientTest) run(t *testing.T, write bool) { // If the server sent us an alert after our last flight, give it a // chance to arrive. if write && test.renegotiationExpectedToFail == 0 { - client.SetReadDeadline(time.Now().Add(500 * time.Millisecond)) - if _, err := client.Read(make([]byte, 1)); err != nil { - if netErr, ok := err.(net.Error); !ok || !netErr.Timeout() { - t.Errorf("final Read returned an error: %s", err) - } + if err := peekError(client); err != nil { + t.Errorf("final Read returned an error: %s", err) } } }() @@ -475,19 +463,18 @@ func (test *clientTest) run(t *testing.T, write bool) { serverConn.SetReadDeadline(time.Now().Add(1 * time.Minute)) _, err := io.ReadFull(serverConn, bb) if err != nil { - t.Fatalf("%s #%d: %s", test.name, i, err) + t.Fatalf("%s, flow %d: %s", test.name, i+1, err) } if !bytes.Equal(b, bb) { - t.Fatalf("%s #%d: mismatch on read: got:%x want:%x", test.name, i, bb, b) + t.Fatalf("%s, flow %d: mismatch on read: got:%x want:%x", test.name, i+1, bb, b) } } - // Give time to the send buffer to drain, to avoid the kernel - // sending a RST and cutting off the flow. See Issue 18701. - time.Sleep(10 * time.Millisecond) - serverConn.Close() } <-doneChan + if !write { + serverConn.Close() + } if write { path := test.dataPath() @@ -509,6 +496,20 @@ func (test *clientTest) run(t *testing.T, write bool) { } } +// peekError does a read with a short timeout to check if the next read would +// cause an error, for example if there is an alert waiting on the wire. +func peekError(conn net.Conn) error { + conn.SetReadDeadline(time.Now().Add(100 * time.Millisecond)) + if n, err := conn.Read(make([]byte, 1)); n != 0 { + return errors.New("unexpectedly read data") + } else if err != nil { + if netErr, ok := err.(net.Error); !ok || !netErr.Timeout() { + return err + } + } + return nil +} + func runClientTestForVersion(t *testing.T, template *clientTest, version, option string) { t.Run(version, func(t *testing.T) { // Make a deep copy of the template before going parallel. @@ -522,11 +523,7 @@ func runClientTestForVersion(t *testing.T, template *clientTest, version, option } test.name = version + "-" + test.name - if len(test.command) == 0 { - test.command = defaultServerCommand - } - test.command = append([]string(nil), test.command...) - test.command = append(test.command, option) + test.args = append([]string{option}, test.args...) test.run(t, *update) }) } @@ -549,8 +546,8 @@ func runClientTestTLS13(t *testing.T, template *clientTest) { func TestHandshakeClientRSARC4(t *testing.T) { test := &clientTest{ - name: "RSA-RC4", - command: []string{"openssl", "s_server", "-cipher", "RC4-SHA"}, + name: "RSA-RC4", + args: []string{"-cipher", "RC4-SHA"}, } runClientTestTLS10(t, test) runClientTestTLS11(t, test) @@ -559,24 +556,24 @@ func TestHandshakeClientRSARC4(t *testing.T) { func TestHandshakeClientRSAAES128GCM(t *testing.T) { test := &clientTest{ - name: "AES128-GCM-SHA256", - command: []string{"openssl", "s_server", "-cipher", "AES128-GCM-SHA256"}, + name: "AES128-GCM-SHA256", + args: []string{"-cipher", "AES128-GCM-SHA256"}, } runClientTestTLS12(t, test) } func TestHandshakeClientRSAAES256GCM(t *testing.T) { test := &clientTest{ - name: "AES256-GCM-SHA384", - command: []string{"openssl", "s_server", "-cipher", "AES256-GCM-SHA384"}, + name: "AES256-GCM-SHA384", + args: []string{"-cipher", "AES256-GCM-SHA384"}, } runClientTestTLS12(t, test) } func TestHandshakeClientECDHERSAAES(t *testing.T) { test := &clientTest{ - name: "ECDHE-RSA-AES", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES128-SHA"}, + name: "ECDHE-RSA-AES", + args: []string{"-cipher", "ECDHE-RSA-AES128-SHA"}, } runClientTestTLS10(t, test) runClientTestTLS11(t, test) @@ -585,10 +582,10 @@ func TestHandshakeClientECDHERSAAES(t *testing.T) { func TestHandshakeClientECDHEECDSAAES(t *testing.T) { test := &clientTest{ - name: "ECDHE-ECDSA-AES", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA"}, - cert: testECDSACertificate, - key: testECDSAPrivateKey, + name: "ECDHE-ECDSA-AES", + args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA"}, + cert: testECDSACertificate, + key: testECDSAPrivateKey, } runClientTestTLS10(t, test) runClientTestTLS11(t, test) @@ -597,46 +594,46 @@ func TestHandshakeClientECDHEECDSAAES(t *testing.T) { func TestHandshakeClientECDHEECDSAAESGCM(t *testing.T) { test := &clientTest{ - name: "ECDHE-ECDSA-AES-GCM", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-GCM-SHA256"}, - cert: testECDSACertificate, - key: testECDSAPrivateKey, + name: "ECDHE-ECDSA-AES-GCM", + args: []string{"-cipher", "ECDHE-ECDSA-AES128-GCM-SHA256"}, + cert: testECDSACertificate, + key: testECDSAPrivateKey, } runClientTestTLS12(t, test) } func TestHandshakeClientAES256GCMSHA384(t *testing.T) { test := &clientTest{ - name: "ECDHE-ECDSA-AES256-GCM-SHA384", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES256-GCM-SHA384"}, - cert: testECDSACertificate, - key: testECDSAPrivateKey, + name: "ECDHE-ECDSA-AES256-GCM-SHA384", + args: []string{"-cipher", "ECDHE-ECDSA-AES256-GCM-SHA384"}, + cert: testECDSACertificate, + key: testECDSAPrivateKey, } runClientTestTLS12(t, test) } func TestHandshakeClientAES128CBCSHA256(t *testing.T) { test := &clientTest{ - name: "AES128-SHA256", - command: []string{"openssl", "s_server", "-cipher", "AES128-SHA256"}, + name: "AES128-SHA256", + args: []string{"-cipher", "AES128-SHA256"}, } runClientTestTLS12(t, test) } func TestHandshakeClientECDHERSAAES128CBCSHA256(t *testing.T) { test := &clientTest{ - name: "ECDHE-RSA-AES128-SHA256", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES128-SHA256"}, + name: "ECDHE-RSA-AES128-SHA256", + args: []string{"-cipher", "ECDHE-RSA-AES128-SHA256"}, } runClientTestTLS12(t, test) } func TestHandshakeClientECDHEECDSAAES128CBCSHA256(t *testing.T) { test := &clientTest{ - name: "ECDHE-ECDSA-AES128-SHA256", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA256"}, - cert: testECDSACertificate, - key: testECDSAPrivateKey, + name: "ECDHE-ECDSA-AES128-SHA256", + args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA256"}, + cert: testECDSACertificate, + key: testECDSAPrivateKey, } runClientTestTLS12(t, test) } @@ -646,9 +643,9 @@ func TestHandshakeClientX25519(t *testing.T) { config.CurvePreferences = []CurveID{X25519} test := &clientTest{ - name: "X25519-ECDHE", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "X25519"}, - config: config, + name: "X25519-ECDHE", + args: []string{"-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "X25519"}, + config: config, } runClientTestTLS12(t, test) @@ -660,9 +657,9 @@ func TestHandshakeClientP256(t *testing.T) { config.CurvePreferences = []CurveID{CurveP256} test := &clientTest{ - name: "P256-ECDHE", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "P-256"}, - config: config, + name: "P256-ECDHE", + args: []string{"-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "P-256"}, + config: config, } runClientTestTLS12(t, test) @@ -674,9 +671,9 @@ func TestHandshakeClientHelloRetryRequest(t *testing.T) { config.CurvePreferences = []CurveID{X25519, CurveP256} test := &clientTest{ - name: "HelloRetryRequest", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "P-256"}, - config: config, + name: "HelloRetryRequest", + args: []string{"-cipher", "ECDHE-RSA-AES128-GCM-SHA256", "-curves", "P-256"}, + config: config, } runClientTestTLS13(t, test) @@ -687,9 +684,9 @@ func TestHandshakeClientECDHERSAChaCha20(t *testing.T) { config.CipherSuites = []uint16{TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305} test := &clientTest{ - name: "ECDHE-RSA-CHACHA20-POLY1305", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-CHACHA20-POLY1305"}, - config: config, + name: "ECDHE-RSA-CHACHA20-POLY1305", + args: []string{"-cipher", "ECDHE-RSA-CHACHA20-POLY1305"}, + config: config, } runClientTestTLS12(t, test) @@ -700,11 +697,11 @@ func TestHandshakeClientECDHEECDSAChaCha20(t *testing.T) { config.CipherSuites = []uint16{TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305} test := &clientTest{ - name: "ECDHE-ECDSA-CHACHA20-POLY1305", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-CHACHA20-POLY1305"}, - config: config, - cert: testECDSACertificate, - key: testECDSAPrivateKey, + name: "ECDHE-ECDSA-CHACHA20-POLY1305", + args: []string{"-cipher", "ECDHE-ECDSA-CHACHA20-POLY1305"}, + config: config, + cert: testECDSACertificate, + key: testECDSAPrivateKey, } runClientTestTLS12(t, test) @@ -712,22 +709,22 @@ func TestHandshakeClientECDHEECDSAChaCha20(t *testing.T) { func TestHandshakeClientAES128SHA256(t *testing.T) { test := &clientTest{ - name: "AES128-SHA256", - command: []string{"openssl", "s_server", "-ciphersuites", "TLS_AES_128_GCM_SHA256"}, + name: "AES128-SHA256", + args: []string{"-ciphersuites", "TLS_AES_128_GCM_SHA256"}, } runClientTestTLS13(t, test) } func TestHandshakeClientAES256SHA384(t *testing.T) { test := &clientTest{ - name: "AES256-SHA384", - command: []string{"openssl", "s_server", "-ciphersuites", "TLS_AES_256_GCM_SHA384"}, + name: "AES256-SHA384", + args: []string{"-ciphersuites", "TLS_AES_256_GCM_SHA384"}, } runClientTestTLS13(t, test) } func TestHandshakeClientCHACHA20SHA256(t *testing.T) { test := &clientTest{ - name: "CHACHA20-SHA256", - command: []string{"openssl", "s_server", "-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256"}, + name: "CHACHA20-SHA256", + args: []string{"-ciphersuites", "TLS_CHACHA20_POLY1305_SHA256"}, } runClientTestTLS13(t, test) } @@ -747,20 +744,20 @@ func TestHandshakeClientCertRSA(t *testing.T) { config.Certificates = []Certificate{cert} test := &clientTest{ - name: "ClientCert-RSA-RSA", - command: []string{"openssl", "s_server", "-cipher", "AES128", "-verify", "1"}, - config: config, + name: "ClientCert-RSA-RSA", + args: []string{"-cipher", "AES128", "-verify", "1"}, + config: config, } runClientTestTLS10(t, test) runClientTestTLS12(t, test) test = &clientTest{ - name: "ClientCert-RSA-ECDSA", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, - config: config, - cert: testECDSACertificate, - key: testECDSAPrivateKey, + name: "ClientCert-RSA-ECDSA", + args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, + config: config, + cert: testECDSACertificate, + key: testECDSAPrivateKey, } runClientTestTLS10(t, test) @@ -768,11 +765,11 @@ func TestHandshakeClientCertRSA(t *testing.T) { runClientTestTLS13(t, test) test = &clientTest{ - name: "ClientCert-RSA-AES256-GCM-SHA384", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-RSA-AES256-GCM-SHA384", "-verify", "1"}, - config: config, - cert: testRSACertificate, - key: testRSAPrivateKey, + name: "ClientCert-RSA-AES256-GCM-SHA384", + args: []string{"-cipher", "ECDHE-RSA-AES256-GCM-SHA384", "-verify", "1"}, + config: config, + cert: testRSACertificate, + key: testRSAPrivateKey, } runClientTestTLS12(t, test) @@ -784,9 +781,9 @@ func TestHandshakeClientCertECDSA(t *testing.T) { config.Certificates = []Certificate{cert} test := &clientTest{ - name: "ClientCert-ECDSA-RSA", - command: []string{"openssl", "s_server", "-cipher", "AES128", "-verify", "1"}, - config: config, + name: "ClientCert-ECDSA-RSA", + args: []string{"-cipher", "AES128", "-verify", "1"}, + config: config, } runClientTestTLS10(t, test) @@ -794,11 +791,11 @@ func TestHandshakeClientCertECDSA(t *testing.T) { runClientTestTLS13(t, test) test = &clientTest{ - name: "ClientCert-ECDSA-ECDSA", - command: []string{"openssl", "s_server", "-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, - config: config, - cert: testECDSACertificate, - key: testECDSAPrivateKey, + name: "ClientCert-ECDSA-ECDSA", + args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, + config: config, + cert: testECDSACertificate, + key: testECDSAPrivateKey, } runClientTestTLS10(t, test) @@ -825,8 +822,8 @@ func TestHandshakeClientCertRSAPSS(t *testing.T) { test := &clientTest{ name: "ClientCert-RSA-RSAPSS", - command: []string{"openssl", "s_server", "-cipher", "AES128", "-verify", "1", - "-client_sigalgs", "rsa_pss_rsae_sha256", "-sigalgs", "rsa_pss_rsae_sha256"}, + args: []string{"-cipher", "AES128", "-verify", "1", "-client_sigalgs", + "rsa_pss_rsae_sha256", "-sigalgs", "rsa_pss_rsae_sha256"}, config: config, cert: testRSAPSSCertificate, key: testRSAPrivateKey, @@ -843,8 +840,8 @@ func TestHandshakeClientCertRSAPKCS1v15(t *testing.T) { test := &clientTest{ name: "ClientCert-RSA-RSAPKCS1v15", - command: []string{"openssl", "s_server", "-cipher", "AES128", "-verify", "1", - "-client_sigalgs", "rsa_pkcs1_sha256", "-sigalgs", "rsa_pkcs1_sha256"}, + args: []string{"-cipher", "AES128", "-verify", "1", "-client_sigalgs", + "rsa_pkcs1_sha256", "-sigalgs", "rsa_pkcs1_sha256"}, config: config, } @@ -854,7 +851,7 @@ func TestHandshakeClientCertRSAPKCS1v15(t *testing.T) { func TestClientKeyUpdate(t *testing.T) { test := &clientTest{ name: "KeyUpdate", - command: []string{"openssl", "s_server", "-state"}, + args: []string{"-state"}, sendKeyUpdate: true, } runClientTestTLS13(t, test) @@ -1148,8 +1145,8 @@ func TestHandshakeClientALPNMatch(t *testing.T) { name: "ALPN", // Note that this needs OpenSSL 1.0.2 because that is the first // version that supports the -alpn flag. - command: []string{"openssl", "s_server", "-alpn", "proto1,proto2"}, - config: config, + args: []string{"-alpn", "proto1,proto2"}, + config: config, validate: func(state ConnectionState) error { // The server's preferences should override the client. if state.NegotiatedProtocol != "proto1" { @@ -1206,7 +1203,7 @@ func TestRenegotiationRejected(t *testing.T) { config := testConfig.Clone() test := &clientTest{ name: "RenegotiationRejected", - command: []string{"openssl", "s_server", "-state"}, + args: []string{"-state"}, config: config, numRenegotiations: 1, renegotiationExpectedToFail: 1, @@ -1229,7 +1226,7 @@ func TestRenegotiateOnce(t *testing.T) { test := &clientTest{ name: "RenegotiateOnce", - command: []string{"openssl", "s_server", "-state"}, + args: []string{"-state"}, config: config, numRenegotiations: 1, } @@ -1243,7 +1240,7 @@ func TestRenegotiateTwice(t *testing.T) { test := &clientTest{ name: "RenegotiateTwice", - command: []string{"openssl", "s_server", "-state"}, + args: []string{"-state"}, config: config, numRenegotiations: 2, } @@ -1257,7 +1254,7 @@ func TestRenegotiateTwiceRejected(t *testing.T) { test := &clientTest{ name: "RenegotiateTwiceRejected", - command: []string{"openssl", "s_server", "-state"}, + args: []string{"-state"}, config: config, numRenegotiations: 2, renegotiationExpectedToFail: 2, diff --git a/src/crypto/tls/testdata/Client-TLSv13-AES128-SHA256 b/src/crypto/tls/testdata/Client-TLSv13-AES128-SHA256 index da51f260c8ed1..c35db9e681f36 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-AES128-SHA256 +++ b/src/crypto/tls/testdata/Client-TLSv13-AES128-SHA256 @@ -16,107 +16,75 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 cb 6b 3c f1 71 |....z...v...k<.q| -00000010 7d fb a1 03 ad d3 35 fb fa 9f f5 1b 58 62 c3 83 |}.....5.....Xb..| -00000020 18 d1 63 9f 14 57 e6 2d 82 f2 37 20 00 00 00 00 |..c..W.-..7 ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 e6 6e e6 44 9a |....z...v...n.D.| +00000010 c9 e2 51 58 ac ba 02 48 ea 6f dd 09 7a 08 04 d2 |..QX...H.o..z...| +00000020 df b6 96 2f 31 d4 6b bf ab 0e 8e 20 00 00 00 00 |.../1.k.... ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 50 |..+.....3.$... P| -00000060 5a 0c d6 69 92 a1 c7 2f 57 41 f3 29 b4 d3 a3 d3 |Z..i.../WA.)....| -00000070 b5 62 85 2a 1d 12 dc 46 d1 ac 96 b6 16 a5 39 14 |.b.*...F......9.| -00000080 03 03 00 01 01 17 03 03 00 17 1d a4 67 9f ac 28 |............g..(| -00000090 dc fe 5c 58 be c0 d0 72 9d 77 05 96 1a 9c ac 54 |..\X...r.w.....T| -000000a0 a2 17 03 03 02 6d 99 b0 fc 88 2d c2 fe 5b 84 1d |.....m....-..[..| -000000b0 38 f4 b9 70 87 b7 45 94 a5 09 e4 a3 2f 93 9a 9b |8..p..E...../...| -000000c0 ef 1f 80 a5 69 1d 81 47 d5 3e e0 f3 8e cd 1e 11 |....i..G.>......| -000000d0 ab 2d a1 1d a7 06 9c fd b4 dd aa 66 3e 8c e0 2f |.-.........f>../| -000000e0 cd e3 9a df 30 b4 c1 70 b0 be 2a 62 ba 3f f6 79 |....0..p..*b.?.y| -000000f0 aa 74 8b f4 4f 3e bc 5c 32 25 29 69 32 d4 90 6a |.t..O>.\2%)i2..j| -00000100 45 45 c5 93 94 4f 90 02 9c 23 45 e0 88 14 ae 6c |EE...O...#E....l| -00000110 e7 be 20 4e 47 ea 50 8e a0 c9 74 67 d2 97 d7 31 |.. NG.P...tg...1| -00000120 52 7e f7 5a a0 55 51 c8 8f 91 12 12 d7 0e 2b a5 |R~.Z.UQ.......+.| -00000130 ff 6c 5e 46 0d 2f d7 55 b6 c0 24 e1 5f e2 66 a0 |.l^F./.U..$._.f.| -00000140 32 c6 cf 88 d2 35 ec fd 17 1a ec 06 19 21 5b 6c |2....5.......![l| -00000150 eb ac 71 0a e6 3b d3 ea 51 05 33 45 28 ef 0b 25 |..q..;..Q.3E(..%| -00000160 7d 77 f1 76 6e fe f8 ef 74 21 ff 3b 7d 69 20 f2 |}w.vn...t!.;}i .| -00000170 7f 99 58 cd 8a 1a ab 87 c7 b0 9c a5 77 d7 b6 54 |..X.........w..T| -00000180 27 e5 5d ac 25 b7 7a 4a 4e 8a 74 cd 17 bf 86 4b |'.].%.zJN.t....K| -00000190 d4 fd a7 74 3f 03 68 d6 67 cf 05 3d 13 95 81 62 |...t?.h.g..=...b| -000001a0 80 1a f7 d3 3c 39 3d 8b 8c 68 20 4a c4 ee 16 06 |....<9=..h J....| -000001b0 5d 2f 3c cf 0d 26 0b 14 1a 4f 64 e4 25 c3 b5 63 |]/<..&...Od.%..c| -000001c0 86 32 82 78 ad 3e 79 c8 c8 e5 29 78 4a a5 98 81 |.2.x.>y...)xJ...| -000001d0 57 61 e9 3c dc f1 88 ba a9 5b 8d e1 c1 08 a8 ed |Wa.<.....[......| -000001e0 c8 06 3b f7 7a 60 c7 f2 cd ea 2f 7e 0c 30 1d 2b |..;.z`..../~.0.+| -000001f0 e4 d6 e3 46 2d 2f d5 26 4f 63 a4 b7 7a ff 8b 29 |...F-/.&Oc..z..)| -00000200 21 06 53 8d 99 57 f7 63 c6 72 96 cc 47 9a 80 cc |!.S..W.c.r..G...| -00000210 03 d5 96 3b bc ad 05 7e 49 f5 6f e6 f7 8c ae 55 |...;...~I.o....U| -00000220 b9 59 98 a6 93 22 43 9d 62 d9 ae ba 80 c6 82 e4 |.Y..."C.b.......| -00000230 d9 44 36 de ec dc 89 f3 45 ee bd 58 ff f5 fa de |.D6.....E..X....| -00000240 85 9b 0f fe 48 a1 0f 36 a4 ff f8 43 7b 18 74 49 |....H..6...C{.tI| -00000250 87 d6 bd f0 2b b3 fd 00 8a 86 8c d1 c1 7d 66 38 |....+........}f8| -00000260 f7 f9 72 36 77 17 7d 18 1c e6 4b 23 30 0c a4 e7 |..r6w.}...K#0...| -00000270 34 a9 39 83 3c 25 d1 de 0d f4 61 85 7b 01 92 9f |4.9.<%....a.{...| -00000280 e7 47 08 e2 fa 84 59 97 8c c5 55 47 27 4f 00 da |.G....Y...UG'O..| -00000290 ab 88 bf b8 fe 84 36 5f b4 f1 f1 28 75 55 29 af |......6_...(uU).| -000002a0 b8 a9 1b 46 dc 65 c7 97 27 4c 9a dc 00 59 3a 02 |...F.e..'L...Y:.| -000002b0 05 2e ed b0 f1 30 74 14 dd 51 08 44 b2 9f 38 1c |.....0t..Q.D..8.| -000002c0 03 3c 8f 00 ad 28 e9 27 bd 75 c3 4a f6 70 5e 79 |.<...(.'.u.J.p^y| -000002d0 7e 38 b3 df 5a 4f 69 11 f2 37 2f 52 cd cc f9 35 |~8..ZOi..7/R...5| -000002e0 16 49 01 24 32 8a e6 da 6b 4e a8 92 a0 d7 73 7b |.I.$2...kN....s{| -000002f0 fb 4c 0f 00 0e 82 d7 27 d3 22 f9 82 de 41 0b 1a |.L.....'."...A..| -00000300 2e d3 6c 97 cb 53 b0 6c 25 b5 65 86 8e 50 87 e0 |..l..S.l%.e..P..| -00000310 4b e6 6d 17 03 03 00 99 e1 28 35 0e 69 35 4a 55 |K.m......(5.i5JU| -00000320 12 ab 1c 8d 43 b4 a4 44 2b 56 3c 5d c6 1b 3a a8 |....C..D+V<]..:.| -00000330 df 0a e8 5d c2 a6 4f 83 c0 dc 07 87 53 0c 1f 63 |...]..O.....S..c| -00000340 e2 db f0 f7 16 e9 e8 f5 5f 5a f9 b1 f1 8d 36 1d |........_Z....6.| -00000350 53 47 60 3f ea 22 f7 6c 7c e7 e6 79 b1 85 f2 27 |SG`?.".l|..y...'| -00000360 5c ef 1e 99 52 5f 06 67 b3 8b 6d 13 83 06 c0 06 |\...R_.g..m.....| -00000370 ef fa 1b 9f 92 ec 5b e5 b3 25 64 79 6c 90 11 e1 |......[..%dyl...| -00000380 13 61 5b bf e9 4f 08 35 81 80 86 b7 77 ae 52 29 |.a[..O.5....w.R)| -00000390 9b 24 1e b0 55 23 ca 69 2f be d1 01 38 e8 79 a8 |.$..U#.i/...8.y.| -000003a0 e2 f7 61 0f 32 ca ff 09 44 84 84 79 19 22 54 1e |..a.2...D..y."T.| -000003b0 22 17 03 03 00 35 00 a1 ea bc bd 87 41 67 cc 5e |"....5......Ag.^| -000003c0 2f 4b 1c 52 c2 56 2c 69 7e 69 9b a3 06 69 b5 0b |/K.R.V,i~i...i..| -000003d0 6c 2e 1f de 53 9d 82 22 b7 36 9f ac 0e 7a 83 e5 |l...S..".6...z..| -000003e0 18 30 5b a9 b7 15 5a 16 87 97 1b |.0[...Z....| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 98 |..+.....3.$... .| +00000060 b2 16 47 4d 82 da 23 5b 2a a4 63 29 11 a8 d4 c0 |..GM..#[*.c)....| +00000070 0b 5e 2d 73 0d d6 e7 1e 15 78 1a c2 58 93 70 14 |.^-s.....x..X.p.| +00000080 03 03 00 01 01 17 03 03 00 17 c3 65 82 87 0c 61 |...........e...a| +00000090 57 28 08 d5 da fc 59 8d a3 76 49 0f d5 80 68 3d |W(....Y..vI...h=| +000000a0 03 17 03 03 02 6d c5 f1 b7 8a 61 03 06 9e 0f 3b |.....m....a....;| +000000b0 be 71 5b 29 17 c7 ed 0e 23 40 90 c6 7a 22 4e ad |.q[)....#@..z"N.| +000000c0 d5 f1 60 f6 db d9 37 73 1f b6 43 f7 7b fe 7b aa |..`...7s..C.{.{.| +000000d0 f7 16 28 e5 a8 b6 be 69 da 79 09 b5 dc ab bf d3 |..(....i.y......| +000000e0 36 ca 19 ae 8c de 27 5c 0d 44 5e 4a e2 ac ff bc |6.....'\.D^J....| +000000f0 33 4e 35 d3 8d 21 22 4d 12 38 e2 f9 73 3b 3d d1 |3N5..!"M.8..s;=.| +00000100 a7 b1 06 6a 6a 8d 25 0f 47 b1 d1 f2 da 32 cc 58 |...jj.%.G....2.X| +00000110 9e 78 b6 b4 4e c1 bc 9d 91 38 44 ff 35 71 a7 c3 |.x..N....8D.5q..| +00000120 39 67 5b 50 b1 9b 87 5d fd 6d 87 42 25 10 1a 19 |9g[P...].m.B%...| +00000130 e1 95 19 2f a1 2c 95 6e ce 6c c9 d9 92 1d e6 7f |.../.,.n.l......| +00000140 9d d0 98 60 f3 6c cf 64 8e 66 bb a4 af de 1e b6 |...`.l.d.f......| +00000150 6a 6d 7b 11 a7 ca e1 29 49 f3 57 50 73 e8 36 79 |jm{....)I.WPs.6y| +00000160 81 fe 33 f7 04 1a 04 e3 60 8e e7 11 fa 07 bb 79 |..3.....`......y| +00000170 73 c0 b7 5e 0f 61 b7 3a 50 85 a4 e1 8e 3b a3 43 |s..^.a.:P....;.C| +00000180 79 8a 14 78 0a ff 66 b4 c3 c0 fe 0a 6a c6 66 72 |y..x..f.....j.fr| +00000190 a8 8a e1 9c a6 ad ee 74 53 d9 b8 07 17 b3 9b f6 |.......tS.......| +000001a0 eb 28 1b 64 97 aa 17 fa 80 36 cb b1 35 6e ec e1 |.(.d.....6..5n..| +000001b0 16 1f ba 00 0c 26 fb 17 0e 00 8a e3 28 0d 6a 76 |.....&......(.jv| +000001c0 8c 78 ee 55 02 78 66 90 5b 87 f2 16 e2 af ef fb |.x.U.xf.[.......| +000001d0 a1 f3 8f fd b9 8e e3 16 68 7a ec c0 54 2f 88 c4 |........hz..T/..| +000001e0 08 6c 55 48 58 56 ac 3e 26 5b 67 42 18 72 6e a1 |.lUHXV.>&[gB.rn.| +000001f0 b5 86 cf 55 d1 29 c5 9b 2c 7b 7d f3 a5 26 2e 5e |...U.)..,{}..&.^| +00000200 21 3a 40 97 5a c1 c8 13 3d c3 12 4e d8 88 e1 8f |!:@.Z...=..N....| +00000210 e8 c5 d3 9b 0f 49 24 42 da 27 ac e5 5e 21 2e 2c |.....I$B.'..^!.,| +00000220 8b 27 ae c4 39 49 6f 43 69 a3 e4 0d f1 fc 62 9f |.'..9IoCi.....b.| +00000230 be 65 78 01 d8 c8 4e 0f b5 d7 12 d1 fc 73 cc 6e |.ex...N......s.n| +00000240 cc df d3 df 33 e4 f8 8e 4f 82 60 cd 1f a1 71 74 |....3...O.`...qt| +00000250 20 7a e2 46 fc 7a 83 15 dc 6c 5d b3 4f 92 de a2 | z.F.z...l].O...| +00000260 99 b5 33 4e b0 5d 19 0f 84 ae de 65 2e ee ef 40 |..3N.].....e...@| +00000270 e9 5b c6 53 86 0d 88 fc 2a b2 2c 5c 76 66 95 a7 |.[.S....*.,\vf..| +00000280 96 ad 7f ba 27 ea e4 54 5e 77 97 0d 6f 9e b8 e5 |....'..T^w..o...| +00000290 b7 2f 75 13 42 7e 61 08 e3 69 31 d4 e6 d0 c0 6d |./u.B~a..i1....m| +000002a0 e3 e2 e4 69 5d d0 7d c2 f1 48 a1 e0 23 f1 19 81 |...i].}..H..#...| +000002b0 23 ed a7 ac ed 88 70 60 c6 eb cf 11 23 39 cb 91 |#.....p`....#9..| +000002c0 35 3b 32 6c 20 fc 61 cb 49 77 9c d9 5d e2 b4 41 |5;2l .a.Iw..]..A| +000002d0 b9 c6 22 af 36 e4 a4 c4 45 47 f4 53 3f 7f b4 25 |..".6...EG.S?..%| +000002e0 a0 34 f4 40 42 04 17 63 3b fa 05 35 c3 76 ec f7 |.4.@B..c;..5.v..| +000002f0 b3 ee 62 fb 03 dc 06 22 90 4b fd 07 62 3b cd 27 |..b....".K..b;.'| +00000300 da 87 32 73 3d 46 5c e7 b6 22 f7 02 8e 43 f4 46 |..2s=F\.."...C.F| +00000310 79 cb 9b 17 03 03 00 99 81 e1 c1 b3 1d 11 4b 61 |y.............Ka| +00000320 6a 4a f2 9a 97 52 36 2a fc ef 77 54 aa 28 a7 4f |jJ...R6*..wT.(.O| +00000330 46 c5 69 2a a7 d7 da d6 ff 28 b1 21 3b 66 ac a7 |F.i*.....(.!;f..| +00000340 ff 66 0a 10 20 1d 24 9b f3 46 1a a7 04 4b b5 3d |.f.. .$..F...K.=| +00000350 e8 49 fc 3a f0 74 a8 02 b9 2d 5d e4 de 91 ef 4d |.I.:.t...-]....M| +00000360 ab 47 10 2c ba 70 c1 aa a9 79 a8 96 27 71 90 e3 |.G.,.p...y..'q..| +00000370 91 4d 4e dd 96 e0 4c ad c5 0b 44 0a c0 4d 17 42 |.MN...L...D..M.B| +00000380 65 12 8a ba fb 7c 66 7c 92 61 87 07 cd e3 a0 16 |e....|f|.a......| +00000390 8b 94 23 77 85 70 88 d2 22 64 14 16 b5 ab db 6a |..#w.p.."d.....j| +000003a0 b9 23 26 ee c8 33 6e 9b a6 e4 d1 85 d2 81 3a 5d |.#&..3n.......:]| +000003b0 33 17 03 03 00 35 b2 85 a7 fd fc 27 46 25 8f cd |3....5.....'F%..| +000003c0 ac ff 84 0a 54 cf f2 11 94 41 d0 7e 04 50 61 7d |....T....A.~.Pa}| +000003d0 71 40 df bc 48 0f c1 32 50 83 5c 05 c9 a5 02 95 |q@..H..2P.\.....| +000003e0 77 04 8c 76 ee 44 32 44 94 e3 8b |w..v.D2D...| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 23 b7 8d d5 9b |..........5#....| -00000010 e4 f6 21 27 94 5b 11 76 5c 1f ff f3 19 f8 43 a2 |..!'.[.v\.....C.| -00000020 4d 07 68 00 a1 de 53 c9 80 f9 e7 fa 56 2c 6b b8 |M.h...S.....V,k.| -00000030 bc 09 5e 61 ea 0c da c8 89 1c 41 95 55 0d ef 94 |..^a......A.U...| -00000040 17 03 03 00 17 9a 18 9a 29 27 19 1b 06 da 82 78 |........)'.....x| -00000050 da 9a 91 77 36 47 ce 25 72 dc b9 26 |...w6G.%r..&| ->>> Flow 4 (server to client) -00000000 17 03 03 00 ea d6 5f a3 a5 14 87 cc 16 54 4c a0 |......_......TL.| -00000010 57 34 92 34 4d 37 fb 27 2b 71 f7 cf ac 93 96 87 |W4.4M7.'+q......| -00000020 9a 1f 8d 58 cf 3a 0d 8c 00 e2 03 b1 6e e1 9f d3 |...X.:......n...| -00000030 f4 dc 17 73 70 59 52 03 a7 fc 99 cb d2 2d 0e c8 |...spYR......-..| -00000040 91 5c 18 42 a3 20 9b 1c 20 86 bc 15 71 5b b4 7d |.\.B. .. ...q[.}| -00000050 80 8d cf 1d 15 33 b8 aa 66 9d f0 f9 08 dc 7c 78 |.....3..f.....|x| -00000060 b7 12 48 11 e1 00 1c e7 3e b3 8b fe bf 07 6d 6d |..H.....>.....mm| -00000070 4c 7b 16 90 cb 8c da 03 a8 81 94 5c 76 09 c4 bf |L{.........\v...| -00000080 26 b4 2b fd 9c 44 b5 c0 49 4b 83 58 70 80 8f 7f |&.+..D..IK.Xp...| -00000090 1e f8 d0 b4 5d 6e a2 78 f0 8c 9d 0b e8 1a 0b b4 |....]n.x........| -000000a0 66 7e 74 88 35 a4 d0 a3 ab 6c b5 2a 90 3c ba 09 |f~t.5....l.*.<..| -000000b0 9c 4e 72 b7 9a ba f9 1f bb a9 bf 03 94 43 7a d2 |.Nr..........Cz.| -000000c0 25 2f c5 e8 83 89 37 1f ac 7b 22 7c 01 7e dc 97 |%/....7..{"|.~..| -000000d0 b3 05 5c 60 5b 22 2f be 8c 05 e8 1a a6 51 45 13 |..\`["/......QE.| -000000e0 7f 20 b9 24 f0 a6 7c 1d 21 37 b8 6c 47 9e e8 17 |. .$..|.!7.lG...| -000000f0 03 03 00 ea c1 05 ef 9c bf 4c 1a d9 36 0d d4 d0 |.........L..6...| -00000100 68 47 ac 8b c6 13 71 17 94 e7 74 8e 21 78 91 79 |hG....q...t.!x.y| -00000110 50 19 4e 43 0d f7 e9 a9 62 e5 25 17 67 3e 38 27 |P.NC....b.%.g>8'| -00000120 dd 3b 5d e9 ec cb 0f b7 1f aa bd 75 76 f7 88 b8 |.;]........uv...| -00000130 c6 60 2f b7 ad 89 17 bb bd d2 86 55 72 bd 52 10 |.`/........Ur.R.| -00000140 21 4d 92 2d c1 a8 24 18 63 ca 0a 38 90 6b 39 5c |!M.-..$.c..8.k9\| -00000150 76 58 ad 62 e5 57 e0 b5 d5 af c9 9b 64 84 76 48 |vX.b.W......d.vH| -00000160 4d 7f a7 32 09 50 f7 9e 92 ad ed 8e b5 0f 10 27 |M..2.P.........'| -00000170 45 bc 58 fd be 91 35 97 ec 71 af d5 6a e1 04 26 |E.X...5..q..j..&| -00000180 00 b3 91 4f a2 be ba b8 06 f1 2f 43 21 a6 0b ba |...O....../C!...| -00000190 43 b5 dd a6 cd a6 b1 1c 37 28 90 26 c4 af 71 56 |C.......7(.&..qV| -000001a0 26 4d 39 39 60 88 8d ae d1 3e 6e 7e 15 cb 60 1c |&M99`....>n~..`.| -000001b0 d2 00 c3 02 b6 2b 81 ea 60 1b 3a a8 a4 dc 29 c0 |.....+..`.:...).| -000001c0 df 86 41 b8 27 89 3a ca bc 31 19 ca 18 08 9e 96 |..A.'.:..1......| -000001d0 e7 b4 6b 78 8d d4 9a 75 1a 48 fb 49 6a 29 |..kx...u.H.Ij)| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 d5 5b 3c bb 8b 4d f2 c2 d8 dc 0b |......[<..M.....| -00000010 5a 94 49 38 ed 11 91 8a |Z.I8....| +00000000 14 03 03 00 01 01 17 03 03 00 35 11 f3 e0 d9 39 |..........5....9| +00000010 43 24 33 e1 54 01 5d f2 c7 50 21 9f db 2d 31 81 |C$3.T.]..P!..-1.| +00000020 3f d5 9c cb 59 cb 24 40 2a 77 da 0a 9e 52 12 11 |?...Y.$@*w...R..| +00000030 1e a8 f8 e2 f2 9e 32 6c 06 8c 48 e8 bf 9d ef 0f |......2l..H.....| +00000040 17 03 03 00 17 bc a1 a2 8a a1 6c c3 19 d1 49 7f |..........l...I.| +00000050 57 af 58 5b ff 7b 11 b2 bb 45 3c 6f 17 03 03 00 |W.X[.{...E>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 d0 99 92 ec 66 |....z...v......f| -00000010 25 e2 c4 9f 90 fa 7c 03 49 b9 19 3e 75 1b 37 42 |%.....|.I..>u.7B| -00000020 2b cf b4 b7 93 81 29 ef 5a e7 c2 20 00 00 00 00 |+.....).Z.. ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 fa ff 71 26 f0 |....z...v....q&.| +00000010 2c ee 80 2c 1c f9 ea 4b de ad d0 61 83 7f 89 6f |,..,...K...a...o| +00000020 db e6 a9 53 ff c5 b5 ec 04 08 4c 20 00 00 00 00 |...S......L ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 02 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 7a |..+.....3.$... z| -00000060 cc 5a 50 25 51 9c 6f 4d 5a d4 dc a0 fa 55 00 33 |.ZP%Q.oMZ....U.3| -00000070 26 0e f7 12 14 9b c2 e0 77 8e ff d3 95 3f 0c 14 |&.......w....?..| -00000080 03 03 00 01 01 17 03 03 00 17 b1 10 59 e2 0b 67 |............Y..g| -00000090 69 df ef 28 e4 f3 9c fc df 48 25 d2 b6 86 68 48 |i..(.....H%...hH| -000000a0 a2 17 03 03 02 6d 91 c1 dd 49 92 5c 77 c1 3f 38 |.....m...I.\w.?8| -000000b0 7d 78 80 21 d1 cc 15 d4 30 ba 77 fb 64 2c ca 05 |}x.!....0.w.d,..| -000000c0 ea bc 88 46 51 47 fd bb 39 08 a8 a8 db 3d 22 86 |...FQG..9....=".| -000000d0 fd b0 78 17 ac 19 18 b4 bb 00 df bf 02 47 75 fb |..x..........Gu.| -000000e0 34 06 ea 66 1b ae 06 5c 03 2d 5a 8e a5 55 20 3a |4..f...\.-Z..U :| -000000f0 ca 1f e9 53 58 6f 7b e7 c4 fa fd 22 7a 7a 45 df |...SXo{...."zzE.| -00000100 7c a7 53 58 92 a4 f9 75 c6 17 b1 bb 68 7b 4e 59 ||.SX...u....h{NY| -00000110 26 af 4d 1d 18 6c 6a f9 9d 14 52 89 7a 1a dd 97 |&.M..lj...R.z...| -00000120 67 4c 4d cd 1c 3f 66 95 d0 9b 4f 77 cf 22 bf 80 |gLM..?f...Ow."..| -00000130 49 17 45 a9 8e 8c 88 3b 21 ce d7 b9 43 e4 ff ac |I.E....;!...C...| -00000140 44 c2 6a 48 60 77 a1 39 8a 92 0c 9b ca f7 da 66 |D.jH`w.9.......f| -00000150 36 9a 86 9f 6e 2d 9b 49 2a 25 30 72 4f 09 41 e5 |6...n-.I*%0rO.A.| -00000160 37 34 30 a4 f9 f9 59 14 22 89 e7 10 2e 71 ee ac |740...Y."....q..| -00000170 82 e9 30 f0 1a 09 2d b5 51 26 ba 71 6b 06 dd fb |..0...-.Q&.qk...| -00000180 e4 e3 be 96 60 04 1c c9 45 7c 1c 58 9f b1 ae d7 |....`...E|.X....| -00000190 6a b2 41 ce 2c b8 fb 07 0a 2d 47 92 53 95 c2 65 |j.A.,....-G.S..e| -000001a0 3c a2 b5 84 58 c2 ae 67 46 9d 79 1e f6 52 59 36 |<...X..gF.y..RY6| -000001b0 1b 72 fb 2a b7 6f 74 38 d7 c6 35 9d f5 ce 12 89 |.r.*.ot8..5.....| -000001c0 25 c5 3e 0e 40 f2 75 30 2b ee 02 61 54 c6 d5 8a |%.>.@.u0+..aT...| -000001d0 19 b0 be 03 83 cf c7 0b bc 56 88 62 3b 7f 80 4e |.........V.b;..N| -000001e0 e7 8b bd 7f 99 c4 63 76 3e da d7 51 96 c4 52 2d |......cv>..Q..R-| -000001f0 49 7a 8d 8e fe d0 01 bb 29 84 2e 55 70 69 fb ba |Iz......)..Upi..| -00000200 f8 6a 8e f4 7d e3 98 46 1b 52 f5 0f 9c 9d 73 29 |.j..}..F.R....s)| -00000210 4d a6 f4 32 ee 2e 67 5c f2 03 a4 12 5e 16 2b 1b |M..2..g\....^.+.| -00000220 98 b2 d3 6c ee f4 10 db 3d b1 7d 75 6e c0 6a bd |...l....=.}un.j.| -00000230 56 56 c1 7f ef f5 c5 fe f9 48 6e 8f 93 1f 5d c2 |VV.......Hn...].| -00000240 35 ee 2f 15 f5 bf d1 10 14 dd c8 69 08 f0 be a2 |5./........i....| -00000250 45 4b 96 9e 12 0a 7f fa 4b 41 78 9c 54 9f 10 97 |EK......KAx.T...| -00000260 4f a7 4b 06 af b3 ab 1a b9 b0 b3 02 11 08 c4 f4 |O.K.............| -00000270 21 fb 86 c5 e9 d9 87 37 d3 79 14 0a 09 c2 4f 7a |!......7.y....Oz| -00000280 1c c2 8e ee 00 b1 0a 78 4f ac f1 78 95 5e 93 95 |.......xO..x.^..| -00000290 a7 ad 44 87 a1 30 d9 5b 1b 13 c5 d8 93 77 2d 2c |..D..0.[.....w-,| -000002a0 68 02 ff c5 91 78 8b 1f 19 eb 53 ae 5c b7 8a e9 |h....x....S.\...| -000002b0 76 ad 62 6a 03 1f f1 ad 01 32 3f 9a 07 36 6b 0a |v.bj.....2?..6k.| -000002c0 80 df 8a 87 f3 76 60 53 1f a7 a9 87 92 87 0a 3f |.....v`S.......?| -000002d0 7d 6e f3 94 23 b6 6e ae cd 32 4f 1c e4 06 42 cc |}n..#.n..2O...B.| -000002e0 33 50 81 dc e3 7b 2b 7a e4 b9 40 63 b7 13 a9 1c |3P...{+z..@c....| -000002f0 6f 30 53 17 4a 6f 18 d7 98 e5 bd 2d ef c3 90 04 |o0S.Jo.....-....| -00000300 da 3b eb 3d 79 4f 34 fb af b1 1b b0 99 6a 7b 11 |.;.=yO4......j{.| -00000310 e0 34 b9 17 03 03 00 99 43 66 96 ed b4 0d 38 fa |.4......Cf....8.| -00000320 e5 41 89 50 30 42 59 f2 35 1e 55 7f ba 7e c8 d2 |.A.P0BY.5.U..~..| -00000330 c8 34 d1 68 56 22 99 09 76 44 51 e2 5d ba 54 d1 |.4.hV"..vDQ.].T.| -00000340 7d ea a7 15 37 0a c9 b0 3b b5 42 97 34 4e 47 21 |}...7...;.B.4NG!| -00000350 f8 4e 94 38 3a 29 c6 6a e6 c7 f8 fe ef 9a 7f 42 |.N.8:).j.......B| -00000360 d3 08 33 b2 c4 fb 63 a0 76 2d ff e9 e2 83 66 35 |..3...c.v-....f5| -00000370 b4 1c 7e 10 4a 1d 02 ea b3 ab 77 b2 05 08 ae d3 |..~.J.....w.....| -00000380 33 5b f0 68 dd 4f 7e 05 99 82 b2 86 a3 49 55 b2 |3[.h.O~......IU.| -00000390 71 52 8b d5 fe a7 ee 75 8c b9 6d 3b 24 eb 1b 0a |qR.....u..m;$...| -000003a0 70 f2 89 19 2e ed ff 66 06 bd 28 ee df 4f 53 60 |p......f..(..OS`| -000003b0 66 17 03 03 00 45 6a 8f 40 5a f8 80 ff a6 e4 aa |f....Ej.@Z......| -000003c0 bc 7f 25 8d 99 4c 4a 87 31 39 1a 11 88 ca f5 c6 |..%..LJ.19......| -000003d0 55 fb 6c 53 27 f8 c9 83 cd fc 91 dc cd ce 5d 9b |U.lS'.........].| -000003e0 70 9f 8d ca 17 82 7c d4 3a 57 87 22 4c 50 f6 ce |p.....|.:W."LP..| -000003f0 73 74 64 2d 83 3b 78 d2 29 d6 a3 |std-.;x.)..| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 6f |..+.....3.$... o| +00000060 2a 3a fe 8e dc cf 2e 7d 26 bd 12 fb da 0a 00 16 |*:.....}&.......| +00000070 b7 12 79 72 a0 a8 95 11 81 d5 b3 ae f8 d7 26 14 |..yr..........&.| +00000080 03 03 00 01 01 17 03 03 00 17 42 95 95 65 84 db |..........B..e..| +00000090 3e dc c4 41 bb e2 21 94 27 2d 9e 27 4e dd 3e 9d |>..A..!.'-.'N.>.| +000000a0 6e 17 03 03 02 6d 71 24 bb 82 cf aa 37 52 4c 15 |n....mq$....7RL.| +000000b0 6d 5c 74 44 c5 08 21 31 ab 47 5a 75 b9 31 d6 97 |m\tD..!1.GZu.1..| +000000c0 69 64 40 b5 09 1c 2b 36 1d 54 19 52 4b ad c9 1c |id@...+6.T.RK...| +000000d0 d4 51 33 80 a4 b9 df 47 17 6a eb 7a d7 bc 12 3e |.Q3....G.j.z...>| +000000e0 7b 28 fa 15 16 aa 23 6f b5 5f a4 f6 8e 2b 00 11 |{(....#o._...+..| +000000f0 1b f2 00 e4 c8 31 38 ee 61 71 bc 7f dd a1 45 2d |.....18.aq....E-| +00000100 ac 1c 2b fd cd 40 51 29 4e 07 fd f4 04 45 09 56 |..+..@Q)N....E.V| +00000110 72 c8 83 22 3e 20 06 3a 93 16 89 21 4a 9f 3b bc |r.."> .:...!J.;.| +00000120 63 7f c0 1b 6a b2 30 d1 49 43 90 08 af 28 4a c1 |c...j.0.IC...(J.| +00000130 79 96 a1 72 0a 82 fe fb 20 1d 18 f8 b7 03 01 89 |y..r.... .......| +00000140 05 04 d7 98 1b 77 2e ad 81 56 de 08 f1 83 1e 9c |.....w...V......| +00000150 7d 2b 16 e1 15 87 12 db 5f 59 5d a3 95 75 ab f8 |}+......_Y]..u..| +00000160 54 87 91 0d 7f 80 76 6e d8 44 f3 c5 ef d6 b4 3d |T.....vn.D.....=| +00000170 6e 91 4c 65 b7 94 2d 05 d1 1e e6 49 d4 78 1c 34 |n.Le..-....I.x.4| +00000180 48 4a 5b 8c ed ad f7 cb 60 98 56 b5 98 ed 7e 88 |HJ[.....`.V...~.| +00000190 4b 98 ec aa 7d 79 71 2c f2 2f 15 5e c1 ed a6 14 |K...}yq,./.^....| +000001a0 01 df 25 df 79 35 1c f0 52 85 7b 2b 46 2c 09 14 |..%.y5..R.{+F,..| +000001b0 26 86 2c 6a d5 ec cf 24 04 49 9c d8 61 65 02 aa |&.,j...$.I..ae..| +000001c0 d6 ce 55 07 2f b6 23 f3 a7 8d 78 f9 72 fc 77 8b |..U./.#...x.r.w.| +000001d0 45 72 0e 61 c2 e8 8d 65 00 50 8b 00 42 48 d1 10 |Er.a...e.P..BH..| +000001e0 1f 3e cc ca 21 10 4c 0b 6b fc f8 c1 b7 83 3e 25 |.>..!.L.k.....>%| +000001f0 8e 40 11 55 32 34 83 0b 98 38 ad 2a ff e0 ae 71 |.@.U24...8.*...q| +00000200 86 0d 9a ef 50 e8 8a 32 53 ba c8 71 4e 96 46 95 |....P..2S..qN.F.| +00000210 c2 31 b5 64 6c 74 8e b6 be 8c e7 bd 5c 79 fd 87 |.1.dlt......\y..| +00000220 db 7e 39 82 7c 7b 38 58 42 34 a1 64 e9 15 f8 f3 |.~9.|{8XB4.d....| +00000230 56 2c ec c9 4f f3 4d e0 3d a6 ec 87 5f 48 be 75 |V,..O.M.=..._H.u| +00000240 d0 9e a6 6c ef 97 db a8 66 ff 8b 5e 34 28 bb 34 |...l....f..^4(.4| +00000250 e0 9c a0 a1 18 2a f4 98 71 e7 8b 18 2c 7c 37 a9 |.....*..q...,|7.| +00000260 c0 75 b4 24 7f ce 85 42 fe ed 7f fd 6d 7c 3d 5b |.u.$...B....m|=[| +00000270 bf d4 72 b9 2f 6d b6 09 86 cd 48 2f 69 a5 94 86 |..r./m....H/i...| +00000280 ab e9 04 b7 b3 88 3b 49 6b 28 e5 8a 30 73 60 9a |......;Ik(..0s`.| +00000290 c9 ff c5 ff 62 0b cc 3a ec 8b 4b a5 f2 2e c3 9d |....b..:..K.....| +000002a0 a1 5d 51 9d f0 2d 88 20 24 cc bf cf 79 69 aa 4d |.]Q..-. $...yi.M| +000002b0 f0 86 ba 9f 7c b4 f0 e3 97 54 7b f5 68 f8 da 26 |....|....T{.h..&| +000002c0 38 a5 5c 86 c5 0a f5 06 af 58 66 e3 40 a0 33 d4 |8.\......Xf.@.3.| +000002d0 cb 90 52 1b 81 3d 31 9d f9 8f 4f d9 38 80 f3 ea |..R..=1...O.8...| +000002e0 79 c4 2c 55 3f ea 9b 79 51 24 dc 70 6e 5c 68 ce |y.,U?..yQ$.pn\h.| +000002f0 b0 65 58 ec 3d 62 27 f3 1c 34 b4 7c b5 8e 91 1d |.eX.=b'..4.|....| +00000300 dc 6b 21 b5 3d 9c 6f 30 91 f8 39 d8 11 03 65 95 |.k!.=.o0..9...e.| +00000310 72 71 36 17 03 03 00 99 4f 82 32 b2 1c df 6d 0d |rq6.....O.2...m.| +00000320 c5 6f d7 89 39 07 42 4d d5 ae 7d 0d 6f a8 68 41 |.o..9.BM..}.o.hA| +00000330 ca 64 5c 38 5a 31 85 02 d7 99 28 ac 0d 33 1b e2 |.d\8Z1....(..3..| +00000340 d8 f7 f2 d3 13 30 50 0f e9 21 3c 9e 53 1c fb cd |.....0P..!<.S...| +00000350 96 e7 00 ef 35 5d d6 a7 64 77 fd 76 07 fa e6 e0 |....5]..dw.v....| +00000360 04 ec cf c0 76 41 a7 12 37 e0 c3 42 43 11 54 7e |....vA..7..BC.T~| +00000370 4f b8 38 3a 3e 60 0f 9c ac 65 d1 84 d3 6e b1 c2 |O.8:>`...e...n..| +00000380 fc be a7 96 59 89 87 c7 b9 d7 09 c0 ef 68 d7 10 |....Y........h..| +00000390 a5 08 8a 45 23 17 47 e3 eb f7 9f d3 ab 54 d1 4a |...E#.G......T.J| +000003a0 8c 69 1f aa a3 43 af dd ce 76 a3 9a 6f e5 4c 6a |.i...C...v..o.Lj| +000003b0 07 17 03 03 00 45 b8 72 a2 fb af 1c 5e 8f ed 0a |.....E.r....^...| +000003c0 53 85 d3 cd 32 ad 56 ba 38 82 1c 23 40 83 7e c1 |S...2.V.8..#@.~.| +000003d0 ce 0f 53 f5 74 a0 54 39 aa fb f1 13 8d 5f 3a 93 |..S.t.T9....._:.| +000003e0 fc 98 72 3f e5 70 e2 e5 97 fb 92 ca 2b 52 50 96 |..r?.p......+RP.| +000003f0 3f d0 8d 94 d5 17 2b 0d 90 4a 12 |?.....+..J.| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 45 8b d1 99 f6 dd |..........E.....| -00000010 80 21 59 2a 8a 12 a2 e3 1b 57 50 bd 49 90 95 c0 |.!Y*.....WP.I...| -00000020 17 59 0a c1 55 ff 14 f1 3d 95 e6 c9 ce 60 c7 94 |.Y..U...=....`..| -00000030 24 a3 a2 45 69 7a b0 0d 9f 1e f4 79 2c a7 73 f3 |$..Eiz.....y,.s.| -00000040 d1 2a f5 cb f6 86 79 3f 84 77 58 66 6d 96 0e eb |.*....y?.wXfm...| -00000050 17 03 03 00 17 26 45 2f 9c 9d 50 44 2d e4 a0 ce |.....&E/..PD-...| -00000060 fa b5 0b 37 a4 52 bb f6 ec 86 80 64 |...7.R.....d| ->>> Flow 4 (server to client) -00000000 17 03 03 00 ea 66 4c 54 52 a3 b4 4a 24 0b 2f 8b |.....fLTR..J$./.| -00000010 03 f7 61 70 3b 2a 69 cf 93 95 57 88 b6 1b 6d 2f |..ap;*i...W...m/| -00000020 81 88 7f a9 fd 47 ee 88 00 1d 94 96 1e 37 09 d4 |.....G.......7..| -00000030 e0 fe 47 fe 7f 33 5a 5a 74 b8 ae 63 b8 12 b2 07 |..G..3ZZt..c....| -00000040 a6 7c 8c cd 15 6e 88 c1 41 f9 c5 c6 b6 62 08 9a |.|...n..A....b..| -00000050 f2 30 e5 cd 2b a8 be f1 b6 73 2d 97 21 b3 ac 42 |.0..+....s-.!..B| -00000060 2c 35 cb 3b 9f 4a f6 3d 82 b1 91 a5 15 0a 43 e5 |,5.;.J.=......C.| -00000070 3d 0b 86 db bf bb cf 5a ab 67 0a 32 4b e1 ec 7b |=......Z.g.2K..{| -00000080 9a ea ee 8f 82 f2 0d 27 58 3d d5 85 ea 13 2c ed |.......'X=....,.| -00000090 87 77 95 65 55 1f ca 55 83 01 6f ee 56 74 1f 97 |.w.eU..U..o.Vt..| -000000a0 f7 e5 aa b8 7a 76 24 51 fd 14 71 0f 34 58 99 0b |....zv$Q..q.4X..| -000000b0 da cf 99 38 a5 27 83 37 a8 73 6f 84 11 9c 67 d5 |...8.'.7.so...g.| -000000c0 bc ce aa 07 73 30 2d 13 d0 6a f4 d0 51 92 89 b4 |....s0-..j..Q...| -000000d0 d1 86 ed 50 a4 bf 95 63 77 d6 dc bc 40 75 f8 00 |...P...cw...@u..| -000000e0 f6 b2 16 30 65 1b 46 25 8e 2d c6 f7 f4 5b 70 17 |...0e.F%.-...[p.| -000000f0 03 03 00 ea 8e 55 c9 38 ba 01 57 ff 88 1b c0 b0 |.....U.8..W.....| -00000100 d5 de 46 e9 17 43 2d 38 e3 c9 c2 ea 07 67 d7 8d |..F..C-8.....g..| -00000110 ab 36 e0 86 06 b4 ba d7 0d 93 9c da 10 fe b9 8c |.6..............| -00000120 7f 2e aa 8f a8 67 fd 72 fa 7e 8c 17 79 69 b7 3e |.....g.r.~..yi.>| -00000130 02 15 4d 72 02 80 1f f1 c6 d2 55 a8 67 07 63 db |..Mr......U.g.c.| -00000140 c8 92 1e fb e4 73 cd f9 48 5e aa 9b 76 c4 3e 85 |.....s..H^..v.>.| -00000150 b7 2a 68 52 4d d9 4d be ba 74 f5 e0 5e 4b 3d d3 |.*hRM.M..t..^K=.| -00000160 78 24 bc ba 89 c4 6e ac 54 04 7d fd 6b ee 71 f9 |x$....n.T.}.k.q.| -00000170 19 02 77 3a a3 d4 27 ab c4 95 38 f4 16 b6 18 77 |..w:..'...8....w| -00000180 8d 2a 7e d7 45 64 64 39 6f 4d 87 be 99 53 a8 ac |.*~.Edd9oM...S..| -00000190 f9 5e a6 e0 3d 1f 64 26 c6 f5 27 34 c8 8d 2b 1b |.^..=.d&..'4..+.| -000001a0 ad 12 0c 95 59 5c 07 5e 44 bf aa b0 0f b3 8c 13 |....Y\.^D.......| -000001b0 a4 6f ed 6a af 58 dc 87 32 70 e4 6b 64 f8 44 37 |.o.j.X..2p.kd.D7| -000001c0 cf 4a b0 3f 57 34 05 1c b8 47 5e ba f2 93 cc b2 |.J.?W4...G^.....| -000001d0 8e 86 ef b0 3c ea 4f 75 cf 85 ba 6e 9d 22 |....<.Ou...n."| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 9b cd 58 dd 0c e0 fa bd 3b 5e 25 |.......X.....;^%| -00000010 e4 9a 24 33 39 f0 b7 bf |..$39...| +00000000 14 03 03 00 01 01 17 03 03 00 45 f6 a2 b0 dd 25 |..........E....%| +00000010 6e 65 f4 c5 74 2b 60 e0 14 12 92 b3 fc 8c 18 06 |ne..t+`.........| +00000020 fb 5d c4 de d9 41 df 39 47 b1 d0 2f 3c 4e 90 fb |.]...A.9G../>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 ad d5 7d b8 f6 |....z...v....}..| -00000010 04 29 51 7d 2c e9 69 ed 5d e5 3a 92 bc ad f8 93 |.)Q},.i.].:.....| -00000020 dc e7 93 bd 0f 2a 3f 46 fd fd 1d 20 00 00 00 00 |.....*?F... ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 8b 65 4e 74 f0 |....z...v...eNt.| +00000010 c4 05 7a a1 58 a7 fd b0 55 9e d2 15 67 1f 19 f9 |..z.X...U...g...| +00000020 25 e1 3e 89 4f a6 79 90 95 5a 8c 20 00 00 00 00 |%.>.O.y..Z. ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 fe |..+.....3.$... .| -00000060 4b d7 8f 01 60 9e 75 40 11 72 06 64 f7 66 62 a7 |K...`.u@.r.d.fb.| -00000070 49 81 d2 f6 65 59 10 4f 2c 68 d8 4c f0 f0 60 14 |I...eY.O,h.L..`.| -00000080 03 03 00 01 01 17 03 03 00 24 e3 64 26 bd f9 1c |.........$.d&...| -00000090 ce 83 56 88 a0 a5 eb e7 a5 c5 13 53 2d 61 69 8a |..V........S-ai.| -000000a0 74 32 46 dc fa b2 63 58 f2 31 6a 21 8f 18 17 03 |t2F...cX.1j!....| -000000b0 03 02 6d 5f 4f bf d0 9d 00 9d 2e c6 86 0b d5 37 |..m_O..........7| -000000c0 01 0b a5 ac d5 ee 9c 91 87 98 89 c9 bd 2f b3 b4 |............./..| -000000d0 10 7e 40 eb bb 6b 9e d6 cc 0b 1d 3a 18 06 a2 a5 |.~@..k.....:....| -000000e0 1d d4 53 82 a7 3b 28 3f 3f d5 0e 23 5a f7 ff e4 |..S..;(??..#Z...| -000000f0 3d a4 66 95 a8 d0 18 52 2c 94 c4 84 89 0f d1 05 |=.f....R,.......| -00000100 a2 34 95 da 7b 65 e2 9c 62 b1 11 cc 15 78 58 8f |.4..{e..b....xX.| -00000110 43 d8 d0 04 9b db bf 06 34 d6 33 3d 55 0b 53 39 |C.......4.3=U.S9| -00000120 9f 96 8f 67 34 6a f6 13 09 9b ae 61 b8 c5 cf 65 |...g4j.....a...e| -00000130 f1 b5 43 bb ee fb 9c d4 2d b1 7e 3a 59 4b 56 45 |..C.....-.~:YKVE| -00000140 d4 1f 75 b7 07 35 18 e7 bd ad b7 36 2f 63 0f 67 |..u..5.....6/c.g| -00000150 68 3f 42 4c 53 22 bc b9 41 2c e0 a3 95 54 6b 4d |h?BLS"..A,...TkM| -00000160 b9 e4 00 3f 89 11 53 7e cc 4d 8c 72 d7 d0 fe bf |...?..S~.M.r....| -00000170 20 81 20 d3 d3 a1 e6 c8 ba 5b 49 d7 96 9e 8f fb | . ......[I.....| -00000180 f8 30 d6 7e e5 4a 3b e6 a6 0d 0a 42 80 68 cf 06 |.0.~.J;....B.h..| -00000190 19 d7 86 63 8e 23 c0 37 71 f6 bc 8b bd ab 62 a5 |...c.#.7q.....b.| -000001a0 45 f4 37 ea 50 cc 82 c9 f4 28 11 1c 1b 90 9d f7 |E.7.P....(......| -000001b0 67 dc 58 d2 10 59 49 26 17 68 50 a9 6c d9 e6 46 |g.X..YI&.hP.l..F| -000001c0 c5 e8 b3 ba 01 a9 ff 33 5e 2c 7c d3 eb d2 35 56 |.......3^,|...5V| -000001d0 b2 21 37 94 40 c7 15 d6 6f 29 ee 02 c9 98 e7 04 |.!7.@...o)......| -000001e0 0c 56 e9 f9 21 91 e7 75 7c 8d a1 50 28 b3 da 76 |.V..!..u|..P(..v| -000001f0 45 af 22 80 77 17 2e 96 d8 5e 05 0f 63 21 c9 32 |E.".w....^..c!.2| -00000200 2b c0 69 e9 8a 07 40 0c 21 73 1f 7d e8 b1 11 45 |+.i...@.!s.}...E| -00000210 37 40 c8 26 66 98 e9 0a 95 ed 08 26 12 f3 79 17 |7@.&f......&..y.| -00000220 6d d8 92 11 4f c7 ee db 5d 77 98 1a 31 cd cc db |m...O...]w..1...| -00000230 1d 96 e8 b5 a1 ba be 0f b1 84 4a a0 55 c5 41 78 |..........J.U.Ax| -00000240 8d 96 ca a0 4e 4d 1e ed 34 54 2b 95 08 1f 00 a6 |....NM..4T+.....| -00000250 a8 d7 35 66 0a ad 2a ac c4 4b 5d 60 b8 89 1f af |..5f..*..K]`....| -00000260 65 c3 a6 10 4b 4c c1 d6 07 1b 3a dc 7c 00 3e a1 |e...KL....:.|.>.| -00000270 06 8e ac f6 4c 4f d4 88 31 3e df 5b 6b 95 19 ed |....LO..1>.[k...| -00000280 6e b5 d1 0a 5e bc 5e 69 3f 5a fc ed 71 14 66 c4 |n...^.^i?Z..q.f.| -00000290 a3 ef 82 d4 2b bc 7c 5a 34 20 33 77 e4 48 4b 82 |....+.|Z4 3w.HK.| -000002a0 66 51 12 ac cf 9b e5 5f 17 34 2f a5 47 fd ab 53 |fQ....._.4/.G..S| -000002b0 85 8e d2 d5 c7 b2 58 a5 d2 fa eb d8 59 f6 2a bd |......X.....Y.*.| -000002c0 37 fc 68 65 75 e4 5f be a7 d8 6a da 41 36 6a 33 |7.heu._...j.A6j3| -000002d0 f1 8d 6a 9d f0 23 73 6a 33 42 52 6f 41 80 a3 40 |..j..#sj3BRoA..@| -000002e0 48 65 16 d9 23 dd 66 93 eb c5 d3 84 10 8b 0b ec |He..#.f.........| -000002f0 d8 c1 c3 3f 08 07 18 ed d9 8e 1d a3 85 d1 70 ef |...?..........p.| -00000300 cd c1 90 e1 80 70 94 9d 05 41 3d 4e 8f 6b 91 d7 |.....p...A=N.k..| -00000310 5d b4 9c 72 c0 de 2d bb f0 d7 dd 29 c4 4e 82 56 |]..r..-....).N.V| -00000320 17 03 03 00 99 ed 9c 42 76 9b 6c 6d 4f db 8d ca |.......Bv.lmO...| -00000330 4f a9 6b de 10 6e 5e 9a 1b b8 5a bd 35 0f a6 0a |O.k..n^...Z.5...| -00000340 cd bd 9d 60 ac 4b c9 35 4e 2a 70 5f 13 07 3f 4a |...`.K.5N*p_..?J| -00000350 bd 3c 9e 85 ef 6d cd 4e 91 c0 83 3e bc ac c7 03 |.<...m.N...>....| -00000360 fa 9d 3b 11 28 de d1 8e de c5 d3 3f cf cc ff 7b |..;.(......?...{| -00000370 63 27 51 4c ea 11 24 43 c5 24 20 69 f3 71 9f 1c |c'QL..$C.$ i.q..| -00000380 c5 a8 6f 4a 10 1b 4f 20 6c fa bc ab 79 b3 c7 15 |..oJ..O l...y...| -00000390 de 47 4d 74 19 65 49 38 31 15 cd c8 51 68 fa 74 |.GMt.eI81...Qh.t| -000003a0 c8 2f cf 34 17 35 0a 29 0c 45 c7 8a 99 1e 3e 18 |./.4.5.).E....>.| -000003b0 29 74 b6 be 9d ea b1 ab f4 0c d7 7f f3 16 17 03 |)t..............| -000003c0 03 00 35 e6 eb 90 3b 27 87 1b d4 7b a6 77 95 4a |..5...;'...{.w.J| -000003d0 2f b7 52 59 c7 4c 44 75 80 ca a3 04 ea 1a ba df |/.RY.LDu........| -000003e0 69 4c 42 97 a5 ad a8 67 4d c3 7d a7 83 33 8a c5 |iLB....gM.}..3..| -000003f0 ec af 2b c9 bc 32 91 8b |..+..2..| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 a5 |..+.....3.$... .| +00000060 e3 ac d0 3c 26 f8 66 41 ac b5 47 6f 63 a0 8f 0a |...<&.fA..Goc...| +00000070 6f 79 62 23 15 01 d0 57 5d 66 9c 09 50 c5 45 14 |oyb#...W]f..P.E.| +00000080 03 03 00 01 01 17 03 03 00 24 7d dc b2 50 38 8e |.........$}..P8.| +00000090 15 52 73 25 90 d3 d3 f2 19 da 76 ae 64 42 29 eb |.Rs%......v.dB).| +000000a0 21 1b 7d b1 d9 04 94 ac 71 b9 b3 e1 d7 59 17 03 |!.}.....q....Y..| +000000b0 03 02 6d cb 4e 30 d0 df 41 b8 1a 76 1d e2 a2 14 |..m.N0..A..v....| +000000c0 24 ec e4 b8 e4 5b 98 49 ed 4e 48 98 3d a7 89 d4 |$....[.I.NH.=...| +000000d0 d1 35 2f d4 12 dc 0b c3 3f e7 0c df 11 20 41 fb |.5/.....?.... A.| +000000e0 5c 24 62 82 26 ad 28 25 59 c0 c0 81 41 9d 80 b7 |\$b.&.(%Y...A...| +000000f0 db cd 41 bb 27 66 ba 55 e6 2f 52 5d 71 d4 77 6a |..A.'f.U./R]q.wj| +00000100 5c 5d 72 34 e6 83 9d c6 24 d1 be 3b 99 90 9b 22 |\]r4....$..;..."| +00000110 7f d8 81 39 d4 7b a8 f9 d7 61 82 a1 72 f9 27 0b |...9.{...a..r.'.| +00000120 b8 6a 5c 72 bd 8f 84 34 c6 d0 c8 1a b9 27 d6 7b |.j\r...4.....'.{| +00000130 12 20 37 b7 64 85 19 7e b4 37 46 df 51 77 23 be |. 7.d..~.7F.Qw#.| +00000140 c4 7a e4 7e 37 3b 53 3e 3b 86 8f 22 31 28 4b 8f |.z.~7;S>;.."1(K.| +00000150 89 0d dc 8d 67 37 53 9d 38 f2 5f 99 2c f4 76 64 |....g7S.8._.,.vd| +00000160 87 e4 ce b7 4f d0 83 99 b2 55 8c 38 8c d0 89 d1 |....O....U.8....| +00000170 2f 91 e8 ae ec b1 a6 29 65 3a 8f af 69 e0 48 00 |/......)e:..i.H.| +00000180 db 3e 30 bd 7f 4b 82 56 cf f9 5b 5e 74 d7 d5 4b |.>0..K.V..[^t..K| +00000190 47 4f 22 17 53 fc e6 98 a4 5a 25 ca 7d ca 39 e9 |GO".S....Z%.}.9.| +000001a0 fe 11 f5 ca 91 e1 25 3c 6d f2 b3 d0 9f ee 88 d2 |......%>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 0c 04 d4 20 a9 |..........5... .| -00000010 67 8e 45 d1 59 75 b8 1d 89 da a3 97 ae 3f f7 a4 |g.E.Yu.......?..| -00000020 64 3f d4 e2 05 45 da 2e e7 a0 c3 32 a4 19 40 b6 |d?...E.....2..@.| -00000030 af 8f cf 2c fe d2 14 88 18 cf 65 06 e3 91 a5 de |...,......e.....| -00000040 17 03 03 00 17 f9 61 2b d5 c3 68 88 6f d8 86 23 |......a+..h.o..#| -00000050 f1 7d 58 5c 75 8c 70 24 5b 4f de 74 |.}X\u.p$[O.t| ->>> Flow 4 (server to client) -00000000 17 03 03 00 ea 33 85 9d 72 d6 99 11 8b 5d b1 a2 |.....3..r....]..| -00000010 e8 b6 7c 00 b6 0b 4f cd 08 89 51 a5 86 4e db 28 |..|...O...Q..N.(| -00000020 67 50 03 f7 a6 6e 02 0a 3a 3b 7c 35 74 cc 87 d8 |gP...n..:;|5t...| -00000030 eb da 9a 07 9a 66 ce 1d 4d eb 62 51 fb 59 6f 45 |.....f..M.bQ.YoE| -00000040 14 18 40 5b 8d e6 35 17 fe dd 8d d3 56 3d 81 18 |..@[..5.....V=..| -00000050 83 a8 af 95 90 0a cf 6a 76 d0 a6 07 7e 1c 71 1c |.......jv...~.q.| -00000060 e6 c5 2f ce 47 b7 73 6d 8b 06 3a fd e8 ce 7e 34 |../.G.sm..:...~4| -00000070 7e 6c 5c ae d3 8d 3a c0 61 b6 f9 73 07 7b 4a 3f |~l\...:.a..s.{J?| -00000080 0d b9 fc f2 5e 70 13 09 c1 a6 16 04 2e 13 db 12 |....^p..........| -00000090 ab 1a 10 df c5 53 00 f8 58 46 63 86 e1 47 8a 25 |.....S..XFc..G.%| -000000a0 88 95 d4 53 dd 8c df ae 38 15 86 70 ad 8f c0 c7 |...S....8..p....| -000000b0 a6 ba 2a ac 4b c3 54 aa 00 41 43 1c 2e 30 47 a5 |..*.K.T..AC..0G.| -000000c0 bf 6c e5 c2 78 67 b4 07 3e fb 11 b5 87 8d 51 92 |.l..xg..>.....Q.| -000000d0 47 81 6b 8e 2f f9 5d 4e 66 25 5a b5 3b 92 9a d0 |G.k./.]Nf%Z.;...| -000000e0 e0 b6 63 28 d2 80 ba c7 97 95 1a ef d9 1c c8 17 |..c(............| -000000f0 03 03 00 ea 6a 98 5d 82 1c f0 42 0a 87 39 0c 0c |....j.]...B..9..| -00000100 cd e7 0b 16 1b 93 0f 1f ce 03 1a 1c c1 64 89 a2 |.............d..| -00000110 bb b3 73 33 0e 1b b5 7f 6f 53 73 86 cb 37 57 1a |..s3....oSs..7W.| -00000120 8e 1d 59 c8 5c 81 29 19 1b ca 8e 42 31 34 06 e7 |..Y.\.)....B14..| -00000130 43 a9 4c cd 91 45 4d 1e 48 31 57 50 10 fd 9e aa |C.L..EM.H1WP....| -00000140 b6 f4 14 a3 ff b2 c3 47 3e f2 3e 5a b9 5c 7a c6 |.......G>.>Z.\z.| -00000150 26 1a 91 7e c3 3a e3 7e a4 38 cd 83 89 85 8f f2 |&..~.:.~.8......| -00000160 fa c1 e3 1e 53 3d bd 54 ed 21 74 fb ff f0 d9 e9 |....S=.T.!t.....| -00000170 d5 b7 46 1c 6e 1d 9c 79 5e a7 32 97 79 8f 69 70 |..F.n..y^.2.y.ip| -00000180 e7 5c ad 7f 58 1a 0b af 16 dc fe 35 01 e3 bf 42 |.\..X......5...B| -00000190 be 78 6f 39 d0 a9 c8 6c 48 bd b0 c8 fb 5c f7 1d |.xo9...lH....\..| -000001a0 1a 3f 79 7a d9 7c 07 ab 11 1b 0b bb 30 88 bf 59 |.?yz.|......0..Y| -000001b0 36 79 5e 0b 23 2e 70 4e 84 f5 ab 6d b3 5d f6 ff |6y^.#.pN...m.]..| -000001c0 40 09 66 f2 89 af 58 fb 0c 29 fb 7d f6 be 97 b6 |@.f...X..).}....| -000001d0 1b 84 53 b5 a2 f2 2b a6 d5 f4 c9 16 70 b8 |..S...+.....p.| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 3c 30 88 da 6f 10 92 66 99 de 69 |.....<0..o..f..i| -00000010 ea 74 e4 a2 7a d3 b8 d4 |.t..z...| +00000000 14 03 03 00 01 01 17 03 03 00 35 f6 6b cb 4a 37 |..........5.k.J7| +00000010 3e e2 61 7e 5b ac c5 25 cc 54 a2 6d 4e 7c 37 19 |>.a~[..%.T.mN|7.| +00000020 ea 21 af df 7b dc 04 2d db 84 ad 06 04 bd 50 f5 |.!..{..-......P.| +00000030 05 9b 19 01 37 22 d2 6f 06 c2 63 dd 95 e6 ef 45 |....7".o..c....E| +00000040 17 03 03 00 17 6d 03 e7 38 f9 a4 3c a7 c2 ee 8d |.....m..8..<....| +00000050 07 49 bd e6 e4 be 3f a3 ec 64 6c 3a 17 03 03 00 |.I....?..dl:....| +00000060 13 cc a9 19 b1 03 56 99 c1 4c d0 f5 fd 3b e2 dd |......V..L...;..| +00000070 0e ef a0 20 |... | diff --git a/src/crypto/tls/testdata/Client-TLSv13-CHACHA20-SHA256 b/src/crypto/tls/testdata/Client-TLSv13-CHACHA20-SHA256 index 8f606cd56ff49..98c3c52170c12 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-CHACHA20-SHA256 +++ b/src/crypto/tls/testdata/Client-TLSv13-CHACHA20-SHA256 @@ -16,107 +16,75 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 8d 7b 1d 2a 66 |....z...v...{.*f| -00000010 8f 54 f0 d0 59 a6 ef ba aa 1a ba 98 bf 02 45 f5 |.T..Y.........E.| -00000020 56 69 80 67 e4 72 f4 d7 56 a1 ec 20 00 00 00 00 |Vi.g.r..V.. ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 49 41 93 3b 12 |....z...v..IA.;.| +00000010 17 ef c7 e6 29 09 70 0e 6b df f7 3d bb 01 9d 27 |....).p.k..=...'| +00000020 cb 0d 97 6b ce 4c 49 60 3e ff 18 20 00 00 00 00 |...k.LI`>.. ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 03 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 c8 |..+.....3.$... .| -00000060 b8 1d 9b 00 85 3c 1c 1d 1f 5e 88 e8 ea 38 1d 63 |.....<...^...8.c| -00000070 f4 99 b0 89 a5 c4 4e 7d 15 49 ca 27 05 26 10 14 |......N}.I.'.&..| -00000080 03 03 00 01 01 17 03 03 00 17 07 34 7c 5e 3f 52 |...........4|^?R| -00000090 c4 42 ed d9 50 e2 a6 cc 6e 0e 93 27 bf c1 97 d6 |.B..P...n..'....| -000000a0 78 17 03 03 02 6d 1c 60 91 f4 1b fd 8f 9b 89 8b |x....m.`........| -000000b0 65 50 19 c9 41 25 9e 35 8d 75 aa ec 5f 88 bf 6c |eP..A%.5.u.._..l| -000000c0 85 33 02 c3 01 6d 3c 5c 86 aa 12 22 35 49 e0 81 |.3...m<\..."5I..| -000000d0 4b e3 f2 ec 75 12 95 ed b4 aa f3 0e 7d bf e6 a8 |K...u.......}...| -000000e0 5d a3 6c 82 f7 f0 1e f7 e7 e8 73 af 14 77 24 ea |].l.......s..w$.| -000000f0 5f bc 25 88 95 93 bb 61 84 f9 36 95 b9 12 31 ff |_.%....a..6...1.| -00000100 f8 19 f0 76 d7 4a 1f a6 77 33 75 82 70 a7 98 71 |...v.J..w3u.p..q| -00000110 5b dc c0 d6 9c 85 c2 41 e3 d0 32 b1 e5 c0 42 8c |[......A..2...B.| -00000120 e8 32 38 ad 03 3a db 46 66 0c 63 0f 65 f6 ed 66 |.28..:.Ff.c.e..f| -00000130 34 ec c6 23 db e3 25 3e ec eb 44 21 76 7c 35 0f |4..#..%>..D!v|5.| -00000140 f2 2c 0f 92 9c db 8f 3e de 46 e8 af f8 6e c4 82 |.,.....>.F...n..| -00000150 91 5e a3 c2 de f7 73 3c 1c e2 84 42 02 a8 bf fb |.^....s<...B....| -00000160 04 96 a4 a7 f4 4c c2 d7 1e 1e 6a e2 82 68 58 07 |.....L....j..hX.| -00000170 a0 f4 e9 91 c1 bc f7 d6 d7 d7 63 6a e7 a3 9c fa |..........cj....| -00000180 69 57 28 e9 db 4e d1 4d 65 9a 05 41 a9 71 47 97 |iW(..N.Me..A.qG.| -00000190 17 0b 95 79 8e 60 90 ee 4c 75 e0 c4 10 c8 21 e7 |...y.`..Lu....!.| -000001a0 ab 62 ab a9 e7 25 86 80 93 76 f7 a2 2a c4 d2 9f |.b...%...v..*...| -000001b0 59 2a 15 7a 88 c0 8d 57 01 ab f2 8e 40 5d b5 49 |Y*.z...W....@].I| -000001c0 7f d4 1e 7f 4e ae ad bd 8c bc 2d 5f 91 3f a7 6c |....N.....-_.?.l| -000001d0 ce 0a 8c c7 53 66 4e 28 31 16 ab 05 dc 78 f6 f4 |....SfN(1....x..| -000001e0 5d b3 eb 38 e1 c1 53 11 11 97 69 4a 86 14 fa 34 |]..8..S...iJ...4| -000001f0 c7 ab 6d 2d 31 17 bf a7 d8 1a 9f bf 2f 4c c9 50 |..m-1......./L.P| -00000200 5e 21 30 b1 98 ac f3 46 a2 d9 4b 67 e7 44 cd 0c |^!0....F..Kg.D..| -00000210 77 2b 72 1c 6d e6 65 1b 28 6d d1 05 bb a6 15 54 |w+r.m.e.(m.....T| -00000220 5d 93 22 e0 e4 e8 3e 99 8c 18 18 27 a7 18 c2 0c |]."...>....'....| -00000230 6c fb 16 b6 ab f1 91 f1 ad 84 b3 53 30 27 b8 29 |l..........S0'.)| -00000240 82 c8 28 06 19 c8 44 3f 45 10 67 92 6a ff 94 47 |..(...D?E.g.j..G| -00000250 49 b2 fd 08 03 15 bd f7 c9 34 cc ad 84 9c 6d 08 |I........4....m.| -00000260 15 e8 df 10 3c 7d 28 5f 9d 77 07 49 47 2f ae 61 |....<}(_.w.IG/.a| -00000270 af 3b 8f 19 63 f7 b3 29 3c 45 4e 0d 9d 03 97 74 |.;..c..).7...E).V..._VG| -00000300 c2 4f cb ca 7c 86 8e ed 72 3d 3f e9 bc 38 a7 c1 |.O..|...r=?..8..| -00000310 59 8b a2 17 03 03 00 99 dc 71 24 a3 c4 ab 62 4c |Y........q$...bL| -00000320 26 c3 7c 73 d3 e9 fd 4b 82 95 30 b8 3f 87 7e bf |&.|s...K..0.?.~.| -00000330 c1 60 40 5f 6c 7f 8d db 0e 4e 91 d4 b4 02 66 ef |.`@_l....N....f.| -00000340 b8 b1 a8 af 42 a3 7d 5c 6a 97 81 f6 cb c8 d2 8b |....B.}\j.......| -00000350 7e 1d 09 e5 f1 a4 aa 5e c9 b6 f4 b7 43 2f 21 ba |~......^....C/!.| -00000360 90 d6 74 ab 8e 03 8b 54 79 57 b6 ae 77 a0 87 96 |..t....TyW..w...| -00000370 42 0f 95 66 74 6c 1b 0d ea 66 5c 62 57 32 b7 dd |B..ftl...f\bW2..| -00000380 03 65 b6 ad af 15 20 52 39 af 33 e6 08 5c 38 dd |.e.... R9.3..\8.| -00000390 40 42 c1 4c f6 48 0b 59 96 a0 04 c3 09 b6 bf ac |@B.L.H.Y........| -000003a0 7a 9d 96 8a ce 3f 7f 68 00 9e 1c 9a db e3 25 56 |z....?.h......%V| -000003b0 54 17 03 03 00 35 55 48 0b d0 5c c0 8c a4 5e 1e |T....5UH..\...^.| -000003c0 30 64 b7 b5 f7 d0 0d 50 64 a8 f1 79 36 9a 0f 00 |0d.....Pd..y6...| -000003d0 ac cb 25 c7 62 5f c1 05 e9 c2 ee 7a 87 00 19 fc |..%.b_.....z....| -000003e0 5b fd 4c 0a 73 ec dc f4 51 66 bd |[.L.s...Qf.| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 a6 |..+.....3.$... .| +00000060 16 ca 24 6e e9 b1 38 c9 3c 45 0e 35 98 32 c5 7c |..$n..8...U<| +00000150 00 77 9a 72 ba fc 13 ad 7a dc 34 0f aa 26 f9 c6 |.w.r....z.4..&..| +00000160 fe b7 ef 0f e8 d7 46 d0 a7 ee e8 39 4d c1 13 a2 |......F....9M...| +00000170 5c 00 e2 3e 47 08 71 b7 53 94 38 f6 31 3a 60 a5 |\..>G.q.S.8.1:`.| +00000180 57 82 4c bc c0 f7 9b c3 4e 00 5e 5e 40 ef ae 61 |W.L.....N.^^@..a| +00000190 09 37 38 40 b7 93 12 0a 7c 02 22 b9 39 a2 43 e3 |.78@....|.".9.C.| +000001a0 f3 09 36 a7 2a c9 2b 35 fc 2c fc 1c 82 d0 3f 03 |..6.*.+5.,....?.| +000001b0 a9 fc bc 53 79 23 5a ce 2d 07 80 5c 2c aa 34 52 |...Sy#Z.-..\,.4R| +000001c0 9d 71 2d 16 4a f0 09 e6 95 94 2b dd bf d5 9c 84 |.q-.J.....+.....| +000001d0 79 fc 41 15 a6 68 81 23 7e dc 83 55 b0 a4 a4 1c |y.A..h.#~..U....| +000001e0 4e 1e 4d 78 6d 62 45 59 1d bb c3 98 d5 0b 3a 8c |N.MxmbEY......:.| +000001f0 f1 98 49 6b 0f 64 29 d5 38 ad 6a ea 8b 34 29 99 |..Ik.d).8.j..4).| +00000200 c0 04 ce 5a 4f 74 e8 ec bb 0a a5 cd 23 6d 31 7a |...ZOt......#m1z| +00000210 d6 6e 1a 74 53 57 59 76 e9 e7 b2 5d 9f 5d 9a 53 |.n.tSWYv...].].S| +00000220 b0 e6 d1 ad ba 43 b6 40 65 65 3a 04 35 12 e1 f7 |.....C.@ee:.5...| +00000230 0e 91 f6 0c 1e 74 65 e3 90 ed e6 ec fd 88 99 e8 |.....te.........| +00000240 20 64 90 33 b9 a9 d8 a2 f0 d7 e8 e0 cf 8d d4 2a | d.3...........*| +00000250 91 12 44 28 3b 99 69 93 aa 3e b2 3b 6a f0 dc 0a |..D(;.i..>.;j...| +00000260 8b 2e 7c d9 c0 c7 b7 d6 f2 07 69 81 97 7b d9 6a |..|.......i..{.j| +00000270 56 c3 6a e5 d5 6a 06 e7 60 b2 72 1c 4f cc 3f 6e |V.j..j..`.r.O.?n| +00000280 e9 fe 94 79 49 36 a6 5f 6d bf b2 87 a1 59 a3 c4 |...yI6._m....Y..| +00000290 39 ad 9a ea 57 a5 69 47 f0 9b 60 4a a6 45 e8 70 |9...W.iG..`J.E.p| +000002a0 6c 6b 1b 17 8a 4e 5e 56 89 40 de 91 c3 8a 05 06 |lk...N^V.@......| +000002b0 57 9e 68 87 1e 00 c8 08 93 1c f1 57 0f 91 dd 32 |W.h........W...2| +000002c0 b7 e8 96 99 e3 90 44 5e 7a 68 d8 e0 55 67 80 a0 |......D^zh..Ug..| +000002d0 e3 bd d5 f7 01 f4 30 58 a7 b4 62 d7 7b 9c 5b 9b |......0X..b.{.[.| +000002e0 62 20 b6 01 25 1b ff 6f b3 4f bc 41 ae 9c 88 71 |b ..%..o.O.A...q| +000002f0 51 f5 25 06 44 a1 49 6b 1b db ac 4b 37 41 78 29 |Q.%.D.Ik...K7Ax)| +00000300 1c c9 33 82 f4 fe d3 0a f9 e0 e8 ca 8c 7b 76 3d |..3..........{v=| +00000310 8b 3c 3b 17 03 03 00 99 3e 4c 63 66 48 fa 43 7a |.<;.....>LcfH.Cz| +00000320 4d 4b 8b 95 25 ca 9a e7 cf d8 d6 e2 4d e7 15 07 |MK..%.......M...| +00000330 d2 cb 07 79 66 63 b5 8f 3a 7d 00 f4 3a 05 b4 ae |...yfc..:}..:...| +00000340 e6 7e 0e b5 a2 20 ee 0e cc 85 de c2 5d d5 49 32 |.~... ......].I2| +00000350 83 d8 2a 11 36 36 86 93 46 ac ce 7e b4 4d e6 20 |..*.66..F..~.M. | +00000360 24 7d 8e c7 37 5f 05 aa 5e a7 de e6 c7 79 88 a7 |$}..7_..^....y..| +00000370 e7 f7 86 51 07 e0 80 63 76 b2 03 a9 6c c4 86 1a |...Q...cv...l...| +00000380 8d 98 e7 16 e0 a2 dc 6e 5c 19 d1 98 c4 10 2b 39 |.......n\.....+9| +00000390 f4 03 b9 0f b5 ab c3 25 18 bf 8c 59 16 7a 06 60 |.......%...Y.z.`| +000003a0 73 9a 7c 6f d1 1e e1 de 07 23 21 0e 28 c2 fb 19 |s.|o.....#!.(...| +000003b0 64 17 03 03 00 35 e0 fd 9c 49 88 45 b3 c7 da a3 |d....5...I.E....| +000003c0 02 ee 8e 0c e0 33 64 01 35 7e aa 31 aa 43 75 64 |.....3d.5~.1.Cud| +000003d0 30 fc 89 d8 f0 dc 6e 49 68 e8 4e 01 41 0d 31 07 |0.....nIh.N.A.1.| +000003e0 c4 e1 bd db 83 b1 e6 46 f0 06 56 |.......F..V| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 36 71 be 3a 8d |..........56q.:.| -00000010 ee 01 10 3e 7b a9 7a 5a 81 2f 2a 65 bd 56 8f b9 |...>{.zZ./*e.V..| -00000020 0f a2 e9 80 eb ae 63 b0 60 69 ea f3 f7 66 d4 2c |......c.`i...f.,| -00000030 fd 13 2c 00 22 55 85 58 4e cf 4f 45 45 a1 ba 89 |..,."U.XN.OEE...| -00000040 17 03 03 00 17 bc cf b6 f9 13 87 04 83 9e 1d dd |................| -00000050 ff 33 77 cb a1 71 bb df 23 97 2c b6 |.3w..q..#.,.| ->>> Flow 4 (server to client) -00000000 17 03 03 00 ea 6c b0 c3 6b ed 51 ec 1e 57 a4 3e |.....l..k.Q..W.>| -00000010 f6 d0 e8 10 b6 b4 cd e6 0b 12 50 8f a2 26 b9 87 |..........P..&..| -00000020 19 ad a5 25 33 ab 5e 2e 58 d4 68 c5 85 42 6c 1d |...%3.^.X.h..Bl.| -00000030 34 02 b0 47 59 f0 cd c2 d5 a5 bb 27 3f 60 9d 07 |4..GY......'?`..| -00000040 22 3c 9a 25 d0 a6 2a b4 e4 52 20 18 07 f3 f8 b4 |"<.%..*..R .....| -00000050 ad 4f 2c ec 8d 41 5f dd b9 e1 bb 90 88 94 5e 73 |.O,..A_.......^s| -00000060 75 a1 ed 88 cf 97 a6 67 02 02 78 be a4 20 29 ad |u......g..x.. ).| -00000070 91 63 a6 39 e8 42 1a 65 76 c7 17 f0 39 7a c4 62 |.c.9.B.ev...9z.b| -00000080 d2 3e f4 12 eb ab da 7b 1f e6 94 b5 a1 b0 40 5c |.>.....{......@\| -00000090 e3 66 a3 7b 40 53 ce 74 10 77 d7 17 9f d0 b3 b2 |.f.{@S.t.w......| -000000a0 a2 97 fd 42 08 5f af 79 a3 c0 c0 98 fa 71 58 8b |...B._.y.....qX.| -000000b0 a5 81 50 8a fc 51 d5 82 19 fb a7 6f 9f b3 6a 96 |..P..Q.....o..j.| -000000c0 c3 d4 90 88 88 c2 96 df 70 ec 60 ca 71 9c 53 ef |........p.`.q.S.| -000000d0 fc a1 92 11 c9 a3 f8 b7 bc a2 6b f5 c5 dc dd b8 |..........k.....| -000000e0 cb 7b 1b af 60 0f 16 8f a8 d4 85 34 76 3c 35 17 |.{..`......4v<5.| -000000f0 03 03 00 ea 7a 0f ef f0 87 83 1d 23 30 ed 14 d4 |....z......#0...| -00000100 dc 97 19 38 71 e2 94 b1 54 e5 86 61 20 21 cd 57 |...8q...T..a !.W| -00000110 29 e6 b3 01 8a 69 7f 06 f2 a0 3e 87 38 3c 7c 9d |)....i....>.8<|.| -00000120 d5 83 e3 58 26 0d 16 13 b8 af 13 a9 c3 21 27 ae |...X&........!'.| -00000130 32 df fb 3d fa 2c cd 7c 4e af d3 e0 32 29 7e f3 |2..=.,.|N...2)~.| -00000140 b5 d2 56 58 bc 83 e2 c7 cd cc e7 e7 8d ff b1 70 |..VX...........p| -00000150 c6 c6 51 ac 6a 12 de 28 4c 99 73 6d 38 4f 74 76 |..Q.j..(L.sm8Otv| -00000160 ae 48 c8 ec a3 65 9c 3a c3 b5 6d 47 1c 0f 5d 63 |.H...e.:..mG..]c| -00000170 8c bb 85 61 51 89 f3 3c 9d 65 03 58 06 13 b2 d7 |...aQ..<.e.X....| -00000180 d8 13 53 d1 11 7a cf 10 c9 8d b1 70 ac 20 7e af |..S..z.....p. ~.| -00000190 f5 fc cc a4 ab 91 a8 dd 2a db d6 e2 44 73 c5 57 |........*...Ds.W| -000001a0 b8 ad 32 d4 98 ee 65 90 ee b7 c6 bf 78 b1 06 59 |..2...e.....x..Y| -000001b0 b8 74 c9 54 e0 fc 79 92 bd ff 6f 42 c5 39 13 b3 |.t.T..y...oB.9..| -000001c0 20 f7 e5 28 27 0e 22 4e b5 38 81 46 14 f6 d3 a8 | ..('."N.8.F....| -000001d0 f8 32 ca 3f da 1c d3 44 8f 21 da 5c f4 ad |.2.?...D.!.\..| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 6b f9 43 f6 f1 44 ba cc 47 cf 09 |.....k.C..D..G..| -00000010 4d 94 dd 31 1e 65 ce 32 |M..1.e.2| +00000000 14 03 03 00 01 01 17 03 03 00 35 a3 4c 7d ed 56 |..........5.L}.V| +00000010 62 f5 7a b9 39 08 02 7f 12 72 c2 de 2f dc 35 a2 |b.z.9....r../.5.| +00000020 1f d0 8e 1a 7b c2 19 17 93 df 83 84 66 9e 8d 1a |....{.......f...| +00000030 fa 8c 37 74 04 13 b5 a2 81 7f dc 85 4c 37 f0 f1 |..7t........L7..| +00000040 17 03 03 00 17 51 47 a8 1b bc 86 62 90 79 8a c7 |.....QG....b.y..| +00000050 db 2c 99 95 bf 7c d0 27 6c c3 b6 24 17 03 03 00 |.,...|.'l..$....| +00000060 13 e2 a8 b5 52 61 b0 66 54 50 60 83 78 3d 26 ef |....Ra.fTP`.x=&.| +00000070 f5 5e 36 58 |.^6X| diff --git a/src/crypto/tls/testdata/Client-TLSv13-ClientCert-ECDSA-RSA b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-ECDSA-RSA index 8b49c0fc82ab5..633397542c105 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-ClientCert-ECDSA-RSA +++ b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-ECDSA-RSA @@ -16,221 +16,124 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 16 6b 5e d7 00 |....z...v...k^..| -00000010 ce 00 c1 8e 7d 12 51 a4 83 4b fd 6a 06 28 4b 1b |....}.Q..K.j.(K.| -00000020 00 fe 6e 45 a2 87 29 76 81 08 ba 20 00 00 00 00 |..nE..)v... ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 9b d5 46 91 59 |....z...v....F.Y| +00000010 c3 26 be 21 ae 20 5f 26 4f 5f 19 ae 3c fe b9 df |.&.!. _&O_..<...| +00000020 16 1b 16 45 4b da 4e 08 58 e9 05 20 00 00 00 00 |...EK.N.X.. ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 82 |..+.....3.$... .| -00000060 b2 b1 82 2f 3e e3 e5 d4 90 5e 44 a5 02 30 df 45 |.../>....^D..0.E| -00000070 f1 c6 07 0d d8 af 64 b9 e3 51 30 6a eb a7 0e 14 |......d..Q0j....| -00000080 03 03 00 01 01 17 03 03 00 17 a2 97 33 5b 62 2c |............3[b,| -00000090 69 6c 17 61 14 ba 66 9e 29 04 fa c8 3a a4 57 70 |il.a..f.)...:.Wp| -000000a0 7f 17 03 03 00 42 30 a3 06 4b b8 20 2d ec f6 dc |.....B0..K. -...| -000000b0 cb e6 9c fa b2 5b b0 cc 55 54 53 1b 69 96 e1 3e |.....[..UTS.i..>| -000000c0 9a 57 08 6e 7a 8c 47 26 18 b6 90 f3 1f 7c c3 fc |.W.nz.G&.....|..| -000000d0 9f f6 f6 8c 22 d9 d7 5f 74 0e 55 2a 7f df 3b 12 |....".._t.U*..;.| -000000e0 20 bd 07 96 77 f1 e8 ab 17 03 03 02 6d c4 d3 3b | ...w.......m..;| -000000f0 a3 2c 60 92 18 f1 b4 e4 10 2e 33 21 f0 43 d8 8a |.,`.......3!.C..| -00000100 ce 8a 60 2d 4a ff aa 91 68 7a 83 16 0b e1 30 e7 |..`-J...hz....0.| -00000110 61 0b c4 c6 ba 60 46 72 c4 58 21 fb 3e 51 21 cb |a....`Fr.X!.>Q!.| -00000120 c0 77 c1 3e 40 b5 fc f5 07 83 6a aa 57 1a 30 df |.w.>@.....j.W.0.| -00000130 71 d9 6c 57 da d2 8a c6 2e b1 e5 29 f1 96 c1 1c |q.lW.......)....| -00000140 a2 c8 fe 31 be 71 c7 7a 36 c3 41 c9 2a c6 7f fc |...1.q.z6.A.*...| -00000150 a5 3c 5d 53 bc 7b 29 fe 62 64 bc b4 1e 2f c8 eb |.<]S.{).bd.../..| -00000160 98 6c 47 88 55 da bb 24 de 2b 6b c9 de 17 a1 13 |.lG.U..$.+k.....| -00000170 70 47 7e 86 95 78 49 e7 9f 5b f9 4d d1 ea d5 60 |pG~..xI..[.M...`| -00000180 af 66 10 b4 f5 cc f1 6e 80 56 b0 75 b4 a1 7c 22 |.f.....n.V.u..|"| -00000190 f6 f9 b2 7d 43 24 4f c4 4a c1 f9 8b 03 b9 a5 7b |...}C$O.J......{| -000001a0 76 58 75 46 c4 6c cd d6 16 2f 3e ff 67 e2 31 21 |vXuF.l.../>.g.1!| -000001b0 2c c5 cc 6a 2f 15 5e da 4b 6b e5 af 88 2f 9e 27 |,..j/.^.Kk.../.'| -000001c0 d6 9a 5e 05 ea 20 e1 0d 03 2e b7 5a 9e f1 63 f1 |..^.. .....Z..c.| -000001d0 31 f8 d4 bd 5a 28 6a c2 51 27 e8 d7 3d 51 fa 77 |1...Z(j.Q'..=Q.w| -000001e0 70 1e 17 a4 7b de 3b a6 44 3c 2b 16 a8 85 28 32 |p...{.;.D<+...(2| -000001f0 35 ff ff 60 24 32 d6 11 cb cc 23 51 97 82 b4 ac |5..`$2....#Q....| -00000200 66 a5 33 29 b0 2a 6c 8d d3 69 75 3e ef bb a8 2a |f.3).*l..iu>...*| -00000210 a4 ed 92 1f ee 56 b6 c6 00 bd 80 ae c4 a6 ce 78 |.....V.........x| -00000220 45 6b fc fb 7e ad cc ea 22 dd 33 0e 79 27 93 60 |Ek..~...".3.y'.`| -00000230 a8 c0 c2 b0 2f 3b ba e9 f2 1b 2b ea f3 ff 45 9b |..../;....+...E.| -00000240 7b 28 aa 30 a1 14 8f a7 9c 74 53 fb 8c d6 41 d4 |{(.0.....tS...A.| -00000250 a9 61 7a 5c 4a 20 aa 70 7f 03 52 e8 83 32 57 95 |.az\J .p..R..2W.| -00000260 02 a7 34 37 04 9c 91 90 5f 8e 51 24 70 63 02 80 |..47...._.Q$pc..| -00000270 dc 9c 54 e7 c1 d9 5c 8a d8 b5 6d 8e 05 ef 2d a2 |..T...\...m...-.| -00000280 38 74 d4 b6 83 77 4a 96 22 4d fb 3c 56 2b 29 6e |8t...wJ."M...Cyd.| -000002a0 bb 94 e6 20 c4 11 94 73 48 e3 5f 7b 1f 66 5a f8 |... ...sH._{.fZ.| -000002b0 96 a3 9e 2e 61 4b 1c 86 80 86 26 f2 eb d6 f4 a1 |....aK....&.....| -000002c0 29 9d dc ae de 38 f9 98 27 2e 69 d5 4f f6 ca 32 |)....8..'.i.O..2| -000002d0 ca d4 79 90 98 2f 94 f7 0f 8f 77 9a 21 44 0a b6 |..y../....w.!D..| -000002e0 e8 8b c3 3d 1a bd 2f 45 91 10 44 e2 74 22 6e e1 |...=../E..D.t"n.| -000002f0 20 fc 32 d1 74 da 9d ac 0b b1 e1 d2 7b 65 96 c3 | .2.t.......{e..| -00000300 41 eb dd a2 9e bf 7f 22 20 06 91 be 7a 94 77 fb |A......" ...z.w.| -00000310 88 31 f3 f4 d3 38 bb a3 01 4f e4 ee 08 b4 bf 23 |.1...8...O.....#| -00000320 ad 46 22 28 f0 e9 4f bc 76 4d 53 7a eb 58 f3 0c |.F"(..O.vMSz.X..| -00000330 ae 6f 09 70 f2 96 b9 16 7a 24 4a 94 99 b3 a2 da |.o.p....z$J.....| -00000340 1a 61 ac 53 e0 2c ae c5 de 4b c5 e5 dd 54 e4 d5 |.a.S.,...K...T..| -00000350 75 ea d1 dc 5d 57 04 2c 87 41 17 03 03 00 99 28 |u...]W.,.A.....(| -00000360 54 65 ee 2f ba b3 bf 24 d6 d4 30 8a 7c ea e0 b2 |Te./...$..0.|...| -00000370 e7 9a 32 55 f5 92 d4 1d eb 73 fd db e3 f1 c9 83 |..2U.....s......| -00000380 f8 89 fc bb a3 2e cb 3a 4e a9 4e 21 7c 1f 42 ce |.......:N.N!|.B.| -00000390 34 a7 7c 61 71 ff 58 80 f0 d2 fa 8f 01 16 02 47 |4.|aq.X........G| -000003a0 f5 4c f4 92 7b 27 46 b7 c5 7f 11 b2 83 b5 56 c8 |.L..{'F.......V.| -000003b0 95 79 eb 7f 11 b6 58 e7 73 6e 75 97 e7 5a 64 7b |.y....X.snu..Zd{| -000003c0 33 09 da 6b 1e 10 99 94 01 1d 03 fe f5 bb 69 0c |3..k..........i.| -000003d0 02 4b 1d 69 5f bf db a7 07 50 f0 b0 b9 8b 21 5b |.K.i_....P....![| -000003e0 98 55 b7 58 67 1f c7 dc 56 1b b0 58 e9 49 9a c9 |.U.Xg...V..X.I..| -000003f0 28 d6 e6 e8 fc 7a ac c8 17 03 03 00 35 c9 67 6c |(....z......5.gl| -00000400 2f bd 89 41 ae c9 65 e2 be 94 a8 6d f2 d4 f2 15 |/..A..e....m....| -00000410 74 a3 86 ed 57 67 d4 5e 76 de e4 67 5e f6 91 49 |t...Wg.^v..g^..I| -00000420 f2 01 db af 07 ad 42 ff a3 a1 1d e5 11 89 89 52 |......B........R| -00000430 ee 29 |.)| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 08 |..+.....3.$... .| +00000060 7c 10 a4 69 11 21 4e 78 e3 38 76 c1 4a c2 da 5e ||..i.!Nx.8v.J..^| +00000070 8f 82 b8 4a 32 d8 7c 48 b6 78 e2 61 1d b6 21 14 |...J2.|H.x.a..!.| +00000080 03 03 00 01 01 17 03 03 00 17 7f ac 84 c7 d4 6a |...............j| +00000090 fc 73 53 a6 ae 25 f9 ad e4 4c b9 31 71 4f ba b1 |.sS..%...L.1qO..| +000000a0 55 17 03 03 00 42 61 ac 61 81 87 40 f1 15 d1 7a |U....Ba.a..@...z| +000000b0 44 ef c0 c8 4a 79 99 f1 16 28 36 4b 31 24 95 b7 |D...Jy...(6K1$..| +000000c0 38 49 60 00 a9 aa 51 40 91 52 2f 39 20 d1 37 92 |8I`...Q@.R/9 .7.| +000000d0 cf e1 cb 42 4a 7a 83 27 d3 77 20 4c 3c 22 0b 65 |...BJz.'.w L<".e| +000000e0 8f ce 2a ec c2 5f 90 b0 17 03 03 02 6d 3a d2 ce |..*.._......m:..| +000000f0 b7 7b d3 94 d4 33 91 be 81 f1 af 80 e6 3e 28 d5 |.{...3.......>(.| +00000100 d8 2f 23 08 b6 a6 80 ec b4 bb 2e 85 31 ed 90 46 |./#.........1..F| +00000110 74 34 90 77 0d d3 51 2d 6e 67 f0 4c 36 7c f2 30 |t4.w..Q-ng.L6|.0| +00000120 08 86 6e 53 08 01 c5 06 c8 a4 c6 6a c0 32 80 d4 |..nS.......j.2..| +00000130 0f 05 ff 91 96 a6 75 5f 71 72 be 63 fb 88 dc 5c |......u_qr.c...\| +00000140 06 06 eb 06 57 94 04 61 11 b5 03 1a 96 a3 c4 10 |....W..a........| +00000150 7b b9 ee 83 3e 73 42 71 93 52 a3 44 b8 9d fb 8e |{...>sBq.R.D....| +00000160 5b 5d e4 af 22 0b dc 40 09 34 aa dc 08 d3 e9 54 |[].."..@.4.....T| +00000170 0a b6 ea 87 33 e6 f5 eb 59 e0 6e c3 24 be 81 b3 |....3...Y.n.$...| +00000180 93 89 d1 f4 dd 8f ab c9 a4 1f bf ed 58 86 f4 41 |............X..A| +00000190 de bf 87 2e 1c fb b0 99 f0 ab 4e ec 3e 22 80 78 |..........N.>".x| +000001a0 45 71 eb 6a f0 0a 89 bf fe 37 e4 1d a6 90 f4 f3 |Eq.j.....7......| +000001b0 7c 96 26 47 9d 07 53 16 7c 15 b1 8a 60 ec ad 55 ||.&G..S.|...`..U| +000001c0 e3 50 7c 1f 5f 67 bc 29 b0 c5 12 99 db d9 b2 1f |.P|._g.)........| +000001d0 6c b6 bc 7d ed 0c d3 76 a0 1d c3 f1 f3 10 9d 63 |l..}...v.......c| +000001e0 22 fd 66 f4 12 4d 4f 2e 7a 81 6e 9f 55 cb 40 26 |".f..MO.z.n.U.@&| +000001f0 77 6a 9c 44 5b c2 cf ae 2d de 7c 85 ca 3e f6 c9 |wj.D[...-.|..>..| +00000200 22 d0 34 f8 36 f2 a4 56 5d dc aa 7d f4 9d 3a e0 |".4.6..V]..}..:.| +00000210 3e 4a b8 77 be 7e 8c c1 f0 0f 42 e7 54 a3 a0 b7 |>J.w.~....B.T...| +00000220 76 33 fd 51 8c 2b e8 c3 85 de 0c d3 d7 1a 34 16 |v3.Q.+........4.| +00000230 41 fb e4 eb fb 0f 8b b2 71 45 a7 3e 8f 82 ac b9 |A.......qE.>....| +00000240 85 54 6f 5a 66 a0 16 90 00 24 e0 91 6e 7f 11 55 |.ToZf....$..n..U| +00000250 cb 1a 6f f1 89 b2 a7 23 52 a7 ec 54 cc 0c 51 71 |..o....#R..T..Qq| +00000260 e8 21 fc b2 ca 90 0d 44 ab 05 18 62 4c 01 41 44 |.!.....D...bL.AD| +00000270 eb a9 ca 97 31 a8 0f 5f b9 3a d3 18 a0 be a1 cc |....1.._.:......| +00000280 2f 88 54 b6 c3 8d e7 12 9f 2d 53 62 2e 05 ba 6e |/.T......-Sb...n| +00000290 9c 75 69 cb 4e 3d 2a 46 20 c0 92 c8 e6 e4 1a 16 |.ui.N=*F .......| +000002a0 4b 09 7d 02 ec 8e 7f a2 b9 e9 05 32 88 4b be 39 |K.}........2.K.9| +000002b0 30 c5 f9 ed ca 2a 1d a3 3b fe 18 76 2e f2 51 d4 |0....*..;..v..Q.| +000002c0 b3 aa 61 67 3b eb 90 9c bb ea 1a 6c 11 7b ba 86 |..ag;......l.{..| +000002d0 38 f1 cd c7 3c 64 56 f3 ca ff fd b2 14 bf 37 7f |8...>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 02 1e 71 98 b6 4f fe |...........q..O.| -00000010 ff bc ca 28 6c 91 6d 31 2f e4 05 f3 00 3a 04 26 |...(l.m1/....:.&| -00000020 80 a4 bd 8a 92 8f 11 88 f1 30 46 c2 86 dc dc 32 |.........0F....2| -00000030 fa 95 8e 52 f0 88 55 1d c7 f6 9a 2c 64 ff c1 4b |...R..U....,d..K| -00000040 11 2e bc 41 83 3b ba 1b 7a de d4 99 f7 46 15 53 |...A.;..z....F.S| -00000050 04 66 f5 57 7d 45 14 d1 cd 95 4c 33 8a 34 b1 0d |.f.W}E....L3.4..| -00000060 d2 a4 b4 be 41 eb 96 ae c0 e6 55 9f ba d5 64 19 |....A.....U...d.| -00000070 dd 84 93 cf c1 99 d2 73 3b a2 b0 30 17 df 7e 5a |.......s;..0..~Z| -00000080 21 14 44 4e 52 9d de 9c 4b 44 bf 6e b8 1e fc 47 |!.DNR...KD.n...G| -00000090 cd 2b 51 8d be 96 28 7a b7 6a c9 88 55 76 f3 80 |.+Q...(z.j..Uv..| -000000a0 b5 2e 5e c1 53 7f 99 2e d7 39 31 bd 16 07 b3 13 |..^.S....91.....| -000000b0 6b d5 e6 b0 e5 79 42 36 3a 21 09 9c 8f f1 1f 09 |k....yB6:!......| -000000c0 a6 3a d5 0c 62 d9 56 42 91 fc ba e0 8e 16 31 5a |.:..b.VB......1Z| -000000d0 a5 11 45 56 f8 4a 52 2d b1 de ed 3b ac 08 dd 7a |..EV.JR-...;...z| -000000e0 b8 8a 7b ef e0 65 10 10 5e d5 99 ac db 95 f6 58 |..{..e..^......X| -000000f0 a6 d7 18 72 14 9b 91 03 09 28 49 f9 63 55 92 71 |...r.....(I.cU.q| -00000100 62 94 36 5a de 7a 1b a6 f2 b0 18 09 7f 0d 7d 68 |b.6Z.z........}h| -00000110 c7 24 7f e1 15 86 86 01 23 91 77 76 86 37 40 3a |.$......#.wv.7@:| -00000120 16 ac 2d d0 55 0b 82 ef c6 85 e7 17 27 ee c9 42 |..-.U.......'..B| -00000130 a8 15 9c 2d a9 d5 41 bf d8 eb 1d 03 45 51 65 66 |...-..A.....EQef| -00000140 81 08 8e bf 86 df 5f 68 f3 b1 be 86 34 22 42 8c |......_h....4"B.| -00000150 e8 02 63 e2 18 bd dd db 13 36 dc 9f 0d d5 a7 fa |..c......6......| -00000160 4a 97 db 37 21 5c c7 fb 0a 6a f4 09 c3 5c db c1 |J..7!\...j...\..| -00000170 49 14 eb 94 1a 3f 0b 7a d6 cb d8 0c d7 0f 64 74 |I....?.z......dt| -00000180 20 1b bf 68 d7 f2 91 aa 9d b0 46 47 1d 52 ad 91 | ..h......FG.R..| -00000190 62 ed 90 42 99 fd 9e cf 80 1f 17 43 28 f4 71 90 |b..B.......C(.q.| -000001a0 64 d0 64 ea f2 d0 a2 ba 96 36 4f 2c 53 9b ee 49 |d.d......6O,S..I| -000001b0 a2 84 1d f2 4a eb 58 98 52 52 d3 92 91 7b 38 6c |....J.X.RR...{8l| -000001c0 39 2d 22 d6 92 6c 76 31 5b c3 32 fa 96 33 7a 92 |9-"..lv1[.2..3z.| -000001d0 89 34 a0 95 66 23 0e ce 51 48 7d f1 9d b4 c9 79 |.4..f#..QH}....y| -000001e0 b0 69 6b 9a 7c f2 4c 9c e6 1b 39 20 9a 96 0c 0e |.ik.|.L...9 ....| -000001f0 5c 33 c7 05 10 aa a3 51 d4 a0 e4 e9 f2 e0 97 94 |\3.....Q........| -00000200 dd fa 38 20 57 19 7b e5 ba 99 a5 1b 06 85 20 6c |..8 W.{....... l| -00000210 69 a8 ee f8 b6 fe e6 c7 af ff a8 23 0b 29 05 db |i..........#.)..| -00000220 d2 0f 7b ee 28 0b aa ba 75 17 03 03 00 a3 43 e7 |..{.(...u.....C.| -00000230 59 40 d1 64 64 65 63 42 75 b3 5e 89 a2 73 3d 67 |Y@.ddecBu.^..s=g| -00000240 1c 1b 5f 9e df f9 56 77 02 72 e4 ef 91 ab 2d 1a |.._...Vw.r....-.| -00000250 c6 78 cb 6a 9b 08 bb d4 6b 3e 46 73 0e 14 ee d8 |.x.j....k>Fs....| -00000260 b6 0e 68 a2 34 da 55 61 c9 3a f3 dd de 37 eb 41 |..h.4.Ua.:...7.A| -00000270 8d 26 3a 5f 47 31 34 2b d2 c0 b8 cd 8d 24 d3 2a |.&:_G14+.....$.*| -00000280 34 64 29 c5 0a 5c 72 57 35 50 5b fb 9b 7b 7e c5 |4d)..\rW5P[..{~.| -00000290 1a f8 96 85 3a 32 be a2 ba a5 00 2b 8c 6a c5 aa |....:2.....+.j..| -000002a0 fd 65 e2 5a 8a 89 05 c3 1d e6 ad fd c3 c7 b3 3a |.e.Z...........:| -000002b0 57 f6 3a 08 00 b6 e6 f4 b8 a7 4e 5d 42 26 d7 2d |W.:.......N]B&.-| -000002c0 00 04 2c e3 ba 67 b9 f6 c2 cb cd 73 10 d9 fa 6c |..,..g.....s...l| -000002d0 ab 17 03 03 00 35 b6 49 bd 61 18 68 8b c8 be 43 |.....5.I.a.h...C| -000002e0 bf ea 1c 64 f7 81 b9 9d b7 5d 6f e7 4a 2d e8 ae |...d.....]o.J-..| -000002f0 37 a0 bd 3a b6 d5 da ad 77 dd 8d e8 c7 5c 35 ba |7..:....w....\5.| -00000300 b9 af 67 21 1c c3 bd 6a 6e 9d a2 17 03 03 00 17 |..g!...jn.......| -00000310 9c 58 47 b5 ba 24 69 1d c5 88 10 31 8f 35 2f 24 |.XG..$i....1.5/$| -00000320 37 d5 ae b7 70 5c 8e |7...p\.| ->>> Flow 4 (server to client) -00000000 17 03 03 02 ea 4d 07 a0 65 50 d9 de ab ad 80 30 |.....M..eP.....0| -00000010 4a 6e 26 79 32 0b 14 59 ad f4 41 98 4f 22 c0 6b |Jn&y2..Y..A.O".k| -00000020 e1 b6 c4 95 84 77 0a b2 08 33 b0 73 52 f6 65 ef |.....w...3.sR.e.| -00000030 27 e0 0f da a6 30 3c 87 d6 43 c9 79 d7 00 29 07 |'....0<..C.y..).| -00000040 ee 8f e4 b8 63 bc 59 98 07 2f ea b1 57 a8 cb 8c |....c.Y../..W...| -00000050 5a c7 bd 2f 6e b5 1a 83 b7 c4 c3 89 d3 ec ec d2 |Z../n...........| -00000060 71 b5 58 78 22 7e 89 ee f1 b3 9c 3d f2 44 69 9a |q.Xx"~.....=.Di.| -00000070 aa 5a 13 d2 ba 28 34 11 d7 2b 78 c3 85 44 07 3d |.Z...(4..+x..D.=| -00000080 83 e2 13 f5 6c 63 23 77 dd bc 38 06 6e bf 5d 64 |....lc#w..8.n.]d| -00000090 08 58 9e 49 a3 d1 53 ca 80 29 22 b5 84 96 86 3c |.X.I..S..)"....<| -000000a0 09 93 68 c8 c2 59 db 81 77 a1 a4 cc 13 cc 77 85 |..h..Y..w.....w.| -000000b0 a6 d4 87 93 19 45 92 a6 5f 0e 03 23 3d a5 d5 1f |.....E.._..#=...| -000000c0 1b eb bb 28 17 b5 b7 85 29 6c 04 8d f2 08 a7 32 |...(....)l.....2| -000000d0 1f 02 b9 f5 eb 28 8d 8c b1 22 b6 84 76 fd c3 89 |.....(..."..v...| -000000e0 92 f0 9c 9d 39 32 52 e9 57 46 ba 66 cc 3c fb 2a |....92R.WF.f.<.*| -000000f0 2f 8a 4f ce 7e 11 b3 42 39 33 50 5e 56 73 a4 fe |/.O.~..B93P^Vs..| -00000100 31 2b c6 6c be 62 d9 1c 0f 5a 88 8b 99 3b ad ec |1+.l.b...Z...;..| -00000110 78 e3 32 d5 ae 7d b3 0d a4 7f 5a 79 86 65 be ed |x.2..}....Zy.e..| -00000120 00 ea 62 1d a3 52 fc 36 76 52 05 4a 68 9d 07 11 |..b..R.6vR.Jh...| -00000130 d6 eb f5 c2 cd 7b ef b2 c9 20 a0 0e 78 a8 2f 2a |.....{... ..x./*| -00000140 e9 54 4c 92 90 a7 9e 7f bb 48 b8 b7 f9 28 c8 9b |.TL......H...(..| -00000150 97 0c a2 20 da 9f 0e c9 b6 e1 07 51 c9 f0 34 32 |... .......Q..42| -00000160 2d 6f b1 36 1a 20 c3 fb c0 d6 88 84 b3 d8 7b 22 |-o.6. ........{"| -00000170 89 6e cb 19 96 ad 05 6a 94 06 00 d8 71 e6 ad 78 |.n.....j....q..x| -00000180 4c b8 4a 6a 63 fd 7a 66 4f 51 08 d3 7b 46 5f ae |L.Jjc.zfOQ..{F_.| -00000190 e7 39 d7 e8 97 de 3b ec 6a e0 c7 74 cb 53 74 b3 |.9....;.j..t.St.| -000001a0 13 89 bd a4 0a b5 8b 0a 32 1a 97 5f 20 c5 b5 d0 |........2.._ ...| -000001b0 14 ec 2e f3 20 19 e9 4e 85 28 1a 22 bf 14 3c ec |.... ..N.(."..<.| -000001c0 6d 4a c8 0f 0d 69 94 c0 e3 b2 86 8e 5b ac a4 84 |mJ...i......[...| -000001d0 e3 da 21 1f 0a 17 ae 40 64 c6 db c1 1d 61 5d e9 |..!....@d....a].| -000001e0 13 85 43 0d 72 48 09 8a 81 5a 1f 15 54 6c 1d 04 |..C.rH...Z..Tl..| -000001f0 09 e4 c7 75 06 36 c6 5f a9 f5 70 2e a2 68 40 b1 |...u.6._..p..h@.| -00000200 df 50 c7 9a 81 d8 cd f9 19 2c 7c a3 aa 35 4f b5 |.P.......,|..5O.| -00000210 62 c4 00 92 b2 f1 91 60 ce 64 bc fe 25 fc 7e da |b......`.d..%.~.| -00000220 48 d6 34 e8 39 bb c6 93 51 06 d0 3b 9c 29 b9 83 |H.4.9...Q..;.)..| -00000230 05 b5 62 47 e0 1c 61 ce 8a a6 55 25 45 8b b3 29 |..bG..a...U%E..)| -00000240 62 ab 16 ee 72 11 b9 2d 9c 00 cb 78 65 f5 8b 60 |b...r..-...xe..`| -00000250 6d 78 a2 a4 41 9b 05 4a 79 39 03 a9 6f 77 78 a1 |mx..A..Jy9..owx.| -00000260 fc 4c d4 4e 5b 27 b3 da 31 5c 5c 3a 10 18 a7 75 |.L.N['..1\\:...u| -00000270 78 1a d3 f4 6c a1 22 03 55 a2 70 1d 48 ce e1 67 |x...l.".U.p.H..g| -00000280 fe 42 f9 5e 3c 1e f8 6c c0 8f da 67 8c fe 07 5a |.B.^<..l...g...Z| -00000290 53 2a c9 01 2d b4 ca cf ac 9b 7c 9a c2 8f 24 0a |S*..-.....|...$.| -000002a0 fb 4a 1b b1 c8 d5 0a 9a e1 e9 40 a5 4a c5 07 46 |.J........@.J..F| -000002b0 28 d0 db 2b dc 40 02 70 38 09 d5 bc 04 a1 81 02 |(..+.@.p8.......| -000002c0 6c 40 e1 79 ef 50 ae 2d 0c 82 c0 19 88 7d a0 07 |l@.y.P.-.....}..| -000002d0 0d 4a 40 87 c0 8a 06 a3 ea 3e 5e 3e b7 3d 9d 92 |.J@......>^>.=..| -000002e0 b3 ee bd 72 90 ea 35 81 c1 29 86 24 13 9d 2a 17 |...r..5..).$..*.| -000002f0 03 03 02 ea 7c 16 54 e4 e2 06 d8 a1 e4 27 1b a4 |....|.T......'..| -00000300 14 a8 b6 29 50 18 bf d3 59 5e bb 53 8e 7c 8f d3 |...)P...Y^.S.|..| -00000310 fb bd e8 06 f2 6e 82 23 07 a7 0f 91 f6 be 11 70 |.....n.#.......p| -00000320 89 6a c8 f1 26 1f e4 09 88 38 01 ba 81 dc 4d 2c |.j..&....8....M,| -00000330 13 05 3b 37 2e 95 4c 7f 8a c3 a3 5b 4d 43 5c ee |..;7..L....[MC\.| -00000340 11 92 c3 a7 93 5a e7 7b f8 ae 9f 83 ef 25 d4 af |.....Z.{.....%..| -00000350 a3 4b 04 7e 8f 54 3a 5b f6 61 75 61 80 e0 40 cb |.K.~.T:[.aua..@.| -00000360 1d 4c ab 55 e9 35 ea 91 af b7 10 e4 ac 9d d5 d0 |.L.U.5..........| -00000370 1c c6 3e 73 ea 15 08 bb 53 76 0b 44 64 64 5b 98 |..>s....Sv.Ddd[.| -00000380 e8 d8 b6 32 43 91 53 2d 3d f9 04 a9 03 d4 73 c8 |...2C.S-=.....s.| -00000390 49 fe a2 48 a0 09 31 d1 08 47 d1 7d 71 4b 2f 43 |I..H..1..G.}qK/C| -000003a0 e6 67 a9 4f 66 0c 01 8c 4c 5b 36 84 d0 bb df 4d |.g.Of...L[6....M| -000003b0 c5 d3 27 9c c0 48 d3 49 b3 73 ce 51 38 70 a3 d8 |..'..H.I.s.Q8p..| -000003c0 53 88 a9 f8 2d 68 21 fd 7c b8 68 84 f5 f6 fd d5 |S...-h!.|.h.....| -000003d0 62 77 af dc 28 8b 44 46 3b a7 12 fc 28 72 d3 b9 |bw..(.DF;...(r..| -000003e0 de e9 73 af 93 d3 37 ce 60 81 8d 62 02 ff 78 d3 |..s...7.`..b..x.| -000003f0 9a 60 68 f9 54 df b7 f0 7b cc 4a 92 9e 31 76 0d |.`h.T...{.J..1v.| -00000400 02 31 fe e2 c6 03 63 a6 b2 cf aa 00 f8 93 3f a4 |.1....c.......?.| -00000410 d1 45 9c 7d b6 06 11 30 c9 7a 12 16 6a 0a 8f 5c |.E.}...0.z..j..\| -00000420 a8 aa 5d 3f 8c d6 89 de 5c a5 d9 da b7 92 dd a6 |..]?....\.......| -00000430 d3 a0 7f 62 95 c5 12 54 6d a3 2a 38 99 b2 12 d6 |...b...Tm.*8....| -00000440 47 56 56 f6 3d cf 37 9c 31 bd 9c 32 ae 52 05 e9 |GVV.=.7.1..2.R..| -00000450 2e c7 3b 84 45 ef 1f 94 ff ee d8 47 88 ea 09 ae |..;.E......G....| -00000460 27 51 9c 59 bb ff 7a 75 f7 72 38 35 f6 3e cc 01 |'Q.Y..zu.r85.>..| -00000470 54 72 5f e6 2e 16 12 25 b4 9b 69 76 fa 2a 2d 76 |Tr_....%..iv.*-v| -00000480 d2 bb e0 cf d2 41 00 20 d9 0b 88 42 7f 7c f8 70 |.....A. ...B.|.p| -00000490 67 7f 06 d9 a6 17 79 6d 6d 53 87 9a 28 df 97 8f |g.....ymmS..(...| -000004a0 f3 35 4b 5a 43 43 9a 07 6d c3 00 5b 58 7a 7a 80 |.5KZCC..m..[Xzz.| -000004b0 5e 0e 9c 6a da 8d 0b 65 26 af e6 2f f4 a5 cf 6e |^..j...e&../...n| -000004c0 07 9b 24 2b 5b 36 fd 07 3b 46 f5 f4 15 cc ea 11 |..$+[6..;F......| -000004d0 f9 d0 97 ea 1d b7 3d db bf 7c e2 dd 68 1e 8b ea |......=..|..h...| -000004e0 90 cb 67 8a 2e 25 77 40 3b 76 c1 0f 4e b0 33 95 |..g..%w@;v..N.3.| -000004f0 d0 b1 39 44 d9 7c eb 34 98 8d 2c 54 5b a8 9a 22 |..9D.|.4..,T[.."| -00000500 68 a7 74 10 6f 69 f0 9c 07 11 0b 9b 81 da 3e 16 |h.t.oi........>.| -00000510 a9 b6 92 55 ce a0 15 25 5e 25 6e 41 5a d6 34 83 |...U...%^%nAZ.4.| -00000520 83 fa b3 53 0c b0 5c 60 83 1e 42 09 90 e0 5d 20 |...S..\`..B...] | -00000530 79 6c 34 ec a0 da fa 32 b6 6e d3 37 a5 ad 5a f6 |yl4....2.n.7..Z.| -00000540 b7 85 a3 e2 75 c7 b0 c8 1b bc 71 73 24 c4 4f 7f |....u.....qs$.O.| -00000550 34 d4 0f a0 c1 53 f9 35 b3 c1 5e e9 32 a8 2d f0 |4....S.5..^.2.-.| -00000560 9b 8e 24 82 93 92 85 e5 82 56 84 a8 f2 e5 6f 81 |..$......V....o.| -00000570 a8 cd e9 34 ce 24 48 0a c5 07 32 ec a1 ec 44 37 |...4.$H...2...D7| -00000580 42 af 4f ef 33 de fb 98 e6 95 59 63 bc e0 aa 0a |B.O.3.....Yc....| -00000590 62 dc c0 28 7f b2 53 62 fb d6 42 d7 cc 60 b6 5b |b..(..Sb..B..`.[| -000005a0 8d 30 a7 94 36 9d c2 d0 fe 38 aa 95 0a 3f 7f 6f |.0..6....8...?.o| -000005b0 5b a3 bb 25 d9 e7 a6 7b 46 e9 e0 42 c7 73 c9 a8 |[..%...{F..B.s..| -000005c0 01 ec 54 93 d4 28 f1 ba c9 26 04 22 02 88 04 4d |..T..(...&."...M| -000005d0 e3 c8 6f a8 de fb fd 48 76 41 cc e2 98 52 |..o....HvA...R| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 3b cc e0 8a fe cd f3 1f 2c 07 cc |.....;.......,..| -00000010 9d c3 62 ae 15 fe 68 64 |..b...hd| +00000000 14 03 03 00 01 01 17 03 03 02 1e e2 06 ae 3e 78 |..............>x| +00000010 b4 85 1b 44 b7 6d 04 4b 9f 2c ea 23 79 66 d5 7d |...D.m.K.,.#yf.}| +00000020 c5 39 57 5c 15 49 9a 6e c8 19 1b ed 5d 95 ce 6f |.9W\.I.n....]..o| +00000030 df 96 3a 16 87 88 c0 25 6a 36 fc 62 05 01 bd c1 |..:....%j6.b....| +00000040 00 a8 11 da 7f 0e a3 6c 28 26 9f 4a 18 e2 44 b9 |.......l(&.J..D.| +00000050 aa 71 b2 f6 fa 8b cc 67 c5 29 72 32 cf 78 36 6b |.q.....g.)r2.x6k| +00000060 22 67 86 ac 71 19 cb 9d 9e 36 7b 03 42 01 e5 4b |"g..q....6{.B..K| +00000070 4c c0 0d 93 22 51 a6 d3 65 00 87 ef 92 f3 08 33 |L..."Q..e......3| +00000080 4b e1 18 bc ba 2b 43 90 0f 2f d5 8e 4c 79 9f a7 |K....+C../..Ly..| +00000090 bd 00 2a b7 89 27 b3 e3 db b7 a7 26 b4 8e 48 6f |..*..'.....&..Ho| +000000a0 e7 12 55 f0 8e 02 a8 3f 30 d4 22 a4 d0 e3 89 63 |..U....?0."....c| +000000b0 7d cf c2 46 27 31 8c 10 5f 28 9f 85 fb 02 64 6a |}..F'1.._(....dj| +000000c0 8d 50 26 e6 73 57 43 53 39 c7 bb 72 4e c2 dd 07 |.P&.sWCS9..rN...| +000000d0 86 b0 96 30 f5 d8 f0 5a a0 09 1c 42 26 65 50 d1 |...0...Z...B&eP.| +000000e0 65 1f 97 fd a0 3a c2 ae d6 a4 08 af 5c 9d 30 12 |e....:......\.0.| +000000f0 fc d8 a2 cd d3 b1 7b de 4b be df 54 aa 31 48 32 |......{.K..T.1H2| +00000100 7a d2 d5 59 f1 39 bc cd 23 2b ac 17 ff e4 0e ec |z..Y.9..#+......| +00000110 55 d2 b9 6b a0 30 65 db 5b e9 b4 ab b9 1e dd 3c |U..k.0e.[......<| +00000120 fd 38 7b 19 7f ea 79 56 90 f8 41 bc 3d 64 0b df |.8{...yV..A.=d..| +00000130 05 a3 6c b8 14 5f f5 41 4f 3c 6d 46 a3 24 92 22 |..l.._.AO.....| +00000250 18 9d de 95 a3 d2 00 98 88 90 4d d0 19 a0 47 60 |..........M...G`| +00000260 6f 1b 36 e4 c0 d8 02 52 b8 0b f4 78 44 8d 72 56 |o.6....R...xD.rV| +00000270 e4 68 ce c0 cd 71 34 60 6b 6c 8f 22 cb 78 d2 d7 |.h...q4`kl.".x..| +00000280 fc 89 b9 d6 34 34 c9 f1 44 78 84 36 27 bc 73 0e |....44..Dx.6'.s.| +00000290 ae 43 72 66 07 e4 6c fd ee da ca 99 a2 25 21 a7 |.Crf..l......%!.| +000002a0 eb 63 11 21 c4 30 45 b3 82 27 7d 8c 9d 37 86 8d |.c.!.0E..'}..7..| +000002b0 35 90 5c 13 be 21 fc bd 65 af ec 65 3d c0 9a 1d |5.\..!..e..e=...| +000002c0 6b 75 38 17 8d d1 92 ba 43 c1 e8 a5 43 f5 0b ab |ku8.....C...C...| +000002d0 16 4d 17 03 03 00 35 a9 24 2a fd af f5 da 3b ed |.M....5.$*....;.| +000002e0 d7 15 86 16 c5 e8 bf 95 bc e1 90 fb 0f be f2 3c |...............<| +000002f0 75 b0 30 1b ce f9 ac f7 97 ae 7e 29 d7 17 aa a4 |u.0.......~)....| +00000300 ba c3 2a db 1a 7c 5e bc 18 84 6e e0 17 03 03 00 |..*..|^...n.....| +00000310 17 52 2f 82 87 2d ca 50 2c 51 f6 99 9d 54 5a 68 |.R/..-.P,Q...TZh| +00000320 38 61 ca 02 81 2c 62 dc 17 03 03 00 13 35 e5 58 |8a...,b......5.X| +00000330 b4 26 e0 83 2a 8e 61 e9 96 1a cd 1a 6e c9 67 c0 |.&..*.a.....n.g.| diff --git a/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-ECDSA b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-ECDSA index a4823303e6ce3..74163f0521f5a 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-ECDSA +++ b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-ECDSA @@ -16,213 +16,119 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 0d bc 10 4c a6 |....z...v.....L.| -00000010 07 5d ee 65 44 88 da cb ec 3e e7 9f e7 e4 12 01 |.].eD....>......| -00000020 bf 4c ca 2a 69 77 b7 ce 2e 4d b0 20 00 00 00 00 |.L.*iw...M. ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 dd 25 8d f2 41 |....z...v...%..A| +00000010 0b 2f 7b 80 24 03 af 9d 81 4e fd a8 ae e4 00 ee |./{.$....N......| +00000020 99 5f 09 05 8b 2a c2 0a 7c 92 ad 20 00 00 00 00 |._...*..|.. ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 fa |..+.....3.$... .| -00000060 d3 a7 66 61 08 f4 5e 78 2b 04 6b 67 f6 db 95 c2 |..fa..^x+.kg....| -00000070 2f bc 13 13 ec 29 ca e3 88 77 33 08 1b b5 6e 14 |/....)...w3...n.| -00000080 03 03 00 01 01 17 03 03 00 17 04 08 27 c4 db 89 |............'...| -00000090 a1 a7 75 ec 5e 05 07 9a 47 40 89 a5 7c e1 77 e2 |..u.^...G@..|.w.| -000000a0 a6 17 03 03 00 42 70 bc 31 0d 73 a8 b5 ec 55 a5 |.....Bp.1.s...U.| -000000b0 87 cd 02 f9 8f 5c 77 59 b7 62 a0 7c 9a 6e 70 ca |.....\wY.b.|.np.| -000000c0 41 68 b6 0e 41 ba 28 e6 4b cc 64 ea 8a 08 5c 79 |Ah..A.(.K.d...\y| -000000d0 6d e7 06 bf ee 94 c9 04 84 0d df 4a 69 05 1d 37 |m..........Ji..7| -000000e0 68 36 17 61 53 58 ac 87 17 03 03 02 22 e6 c6 58 |h6.aSX......"..X| -000000f0 9d ca d8 79 54 67 64 72 8d 9b 12 4a 93 55 b7 70 |...yTgdr...J.U.p| -00000100 e1 15 6f a0 d1 64 17 b5 2b ec 29 37 91 0c 21 ff |..o..d..+.)7..!.| -00000110 ba d9 e9 4b 5a af a3 4a 6d 07 64 02 b1 a4 54 19 |...KZ..Jm.d...T.| -00000120 44 b2 a0 e6 b4 28 75 f0 d8 7e 0d 20 f0 45 ba 93 |D....(u..~. .E..| -00000130 3a 55 d6 e2 17 d7 ad fe 54 ac fe a9 a1 01 2d 62 |:U......T.....-b| -00000140 61 7d 20 90 2f d5 f3 e8 46 6d 7c 54 37 25 da 49 |a} ./...Fm|T7%.I| -00000150 56 db 9d da a3 60 7c 31 cb 5e e7 89 6d 23 30 7e |V....`|1.^..m#0~| -00000160 83 96 11 f7 4a 62 b7 e7 96 e7 f8 c9 c2 c9 bd 12 |....Jb..........| -00000170 b3 fc b0 8d 17 35 99 c4 ef f7 e8 9f 4f ad a0 bf |.....5......O...| -00000180 ea 6c 55 cd 0f 2d e3 85 4a 74 e7 94 89 e3 6d 94 |.lU..-..Jt....m.| -00000190 d1 d6 d3 1a aa c2 2e 32 37 79 1a ee f0 44 14 3a |.......27y...D.:| -000001a0 a1 61 bb cb 95 ce f5 e4 fe c4 c2 8b 90 38 00 ce |.a...........8..| -000001b0 46 4a b0 83 e2 d9 ae 7f bf fe 72 65 4a 5f bb 07 |FJ........reJ_..| -000001c0 78 a9 90 c0 9e b3 5c 4d 79 e3 de a0 5c c3 1f f8 |x.....\My...\...| -000001d0 7f a0 db e7 88 8c 5b e1 f0 0e f5 00 80 0a 5f 3b |......[......._;| -000001e0 2a a3 a9 7f 73 9b b3 3e 91 e4 5c 96 74 fe e5 41 |*...s..>..\.t..A| -000001f0 99 cb 14 a7 28 b3 ca 47 ec 53 88 0e 71 1d 26 11 |....(..G.S..q.&.| -00000200 60 d8 b5 9c 5e 93 79 9d 9f 84 74 f4 f7 90 82 dd |`...^.y...t.....| -00000210 8e 0a 29 10 45 9c 05 60 82 52 29 88 c9 09 d6 9a |..).E..`.R).....| -00000220 57 ee 72 62 0c 57 80 ec 46 b8 b1 c9 83 8b e6 c6 |W.rb.W..F.......| -00000230 2b d9 cf 9d 3c e0 51 c1 2d 68 96 c4 70 c8 60 9a |+...<.Q.-h..p.`.| -00000240 b0 95 6b 81 70 8e bd 7d c7 91 f6 e2 e6 66 f6 a9 |..k.p..}.....f..| -00000250 6c db 9a c1 42 3f 90 93 2f 9b cd 39 95 95 89 4f |l...B?../..9...O| -00000260 b8 a6 2e 70 25 a7 37 d1 9f 97 16 2d 41 2b de 80 |...p%.7....-A+..| -00000270 33 c3 72 e4 ac 7d f9 ba 2f 30 ed 0e c8 7a ac d7 |3.r..}../0...z..| -00000280 34 c5 a9 a5 e3 18 71 63 d1 33 94 5a b5 39 eb d5 |4.....qc.3.Z.9..| -00000290 25 da d0 47 0e e2 48 5a af e5 6f a7 ed 18 44 ce |%..G..HZ..o...D.| -000002a0 6c 3a 17 de b9 00 f9 cb de d2 cb 3b 29 fc 5d 69 |l:.........;).]i| -000002b0 ed 8e 64 83 07 c1 3d fa 6e 98 d4 45 b2 5a ff ca |..d...=.n..E.Z..| -000002c0 85 13 73 d9 19 8c e7 60 fc 2a cc 2d d0 1a 0c e3 |..s....`.*.-....| -000002d0 22 ec d6 38 f4 47 d0 96 b6 f8 11 2b 43 da 2a f9 |"..8.G.....+C.*.| -000002e0 e8 80 c6 63 68 bf fe ae 05 08 c7 4e 52 2f 2e 08 |...ch......NR/..| -000002f0 62 2b 2a 06 f2 f0 e3 22 be c6 8f 72 82 fd 33 29 |b+*...."...r..3)| -00000300 58 c8 5f 6d 36 d6 4c 02 c5 c5 e6 f2 66 1a f3 17 |X._m6.L.....f...| -00000310 03 03 00 a3 4e ac b9 1a db ec b9 f6 82 f6 07 c7 |....N...........| -00000320 7c a3 cf 11 bc 18 c1 8e 5d bc c4 52 af ac 20 a3 ||.......]..R.. .| -00000330 a0 90 28 01 6f 81 18 7f 14 d4 fd 87 55 54 13 73 |..(.o.......UT.s| -00000340 95 49 1b ad a8 29 d9 8d 5e 6e 02 49 2f a8 e0 a6 |.I...)..^n.I/...| -00000350 48 dc e5 6d 8e d6 7f 8f fe 40 94 c9 5b 3d 63 c4 |H..m.....@..[=c.| -00000360 85 a5 97 27 db 31 64 67 ab 81 62 8a 2b 2a fd 61 |...'.1dg..b.+*.a| -00000370 b1 c8 c8 d3 c4 e0 ad 5d 7a 59 1a 62 0c 2b e9 7e |.......]zY.b.+.~| -00000380 bb 6b af 63 f0 32 f1 b8 72 13 ca 69 06 cf 82 67 |.k.c.2..r..i...g| -00000390 8e 76 7a c2 d4 96 c9 ab d4 dd a4 22 c3 e3 32 a4 |.vz........"..2.| -000003a0 e6 e1 fd 3a 56 95 2a 0e ef 5c 87 d3 b0 e3 27 04 |...:V.*..\....'.| -000003b0 61 1a 5e 1c 9a 77 09 17 03 03 00 35 29 50 c2 81 |a.^..w.....5)P..| -000003c0 02 68 53 fe ef 46 7c eb 0c 2f 00 c1 67 8f 25 b6 |.hS..F|../..g.%.| -000003d0 6a fd 51 3a db fc cb 50 c8 32 9b cf 5a ba be ab |j.Q:...P.2..Z...| -000003e0 c8 fb 58 d5 5c 77 66 65 70 a2 2c 65 d2 5c 22 51 |..X.\wfep.,e.\"Q| -000003f0 09 |.| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 fd |..+.....3.$... .| +00000060 03 d1 75 4e 57 ae b0 cc 43 4f 7e 2b de a8 01 46 |..uNW...CO~+...F| +00000070 98 c7 f9 8e a5 46 95 68 fa 5e 07 c3 a1 55 5e 14 |.....F.h.^...U^.| +00000080 03 03 00 01 01 17 03 03 00 17 df 30 a4 ce 8e db |...........0....| +00000090 20 0d 74 59 0a df 8e 67 23 af 3d 2f 87 8f 31 a0 | .tY...g#.=/..1.| +000000a0 bf 17 03 03 00 42 0f 0a 20 4e 21 cd d8 01 13 ea |.....B.. N!.....| +000000b0 74 29 8d e4 a0 1b 6a a5 be 89 03 8d 2b 39 c4 23 |t)....j.....+9.#| +000000c0 5e b1 f7 4f e4 1f dd ea f8 38 fe 07 89 ca f1 e6 |^..O.....8......| +000000d0 11 e9 2d 40 ca f1 63 11 ac 29 44 c2 25 18 4d 29 |..-@..c..)D.%.M)| +000000e0 30 aa cb 35 b4 33 27 8a 17 03 03 02 22 36 fb 97 |0..5.3'....."6..| +000000f0 fd ba 12 9b e5 19 14 79 2b 78 0e 6c a9 d8 13 a2 |.......y+x.l....| +00000100 51 d8 c1 4b 53 ac a4 73 cf b1 2d 2c 4d 14 b8 10 |Q..KS..s..-,M...| +00000110 de 5d 86 81 19 77 19 a0 b4 1b eb 85 f4 dc 21 2f |.]...w........!/| +00000120 c5 5c 62 44 1b ca f2 91 06 95 14 7a 07 02 1f 98 |.\bD.......z....| +00000130 0d bc a4 89 7c 96 21 6b 37 1c 47 4a 10 e8 e2 b6 |....|.!k7.GJ....| +00000140 f9 e2 97 06 a5 88 ad 5c f1 08 28 4b f5 d5 9a a0 |.......\..(K....| +00000150 51 74 30 ab 9c 52 b0 b9 2d 38 bb 25 b8 6e 71 a7 |Qt0..R..-8.%.nq.| +00000160 7b c9 76 56 13 e6 60 bf 70 15 11 0c 21 12 cd a1 |{.vV..`.p...!...| +00000170 b8 e5 3a 49 00 ad 9c 2f e5 2b 1f cc 4e 4f 0b 90 |..:I.../.+..NO..| +00000180 e1 77 64 5f b5 fc 7b 1c f3 09 cb 0e c4 94 d7 33 |.wd_..{........3| +00000190 59 5b 8f ae e1 9c e4 f6 83 10 f0 71 5f 17 4b b3 |Y[.........q_.K.| +000001a0 3f 81 2c 0a 22 c5 f4 6b bd 83 32 37 4a 2a 9a db |?.,."..k..27J*..| +000001b0 7b 42 c2 c0 7d 13 e0 e7 ea d7 58 a6 b1 20 68 bc |{B..}.....X.. h.| +000001c0 ba 4e 1a 91 6d dd 11 b9 fc 57 02 4d d4 e8 47 74 |.N..m....W.M..Gt| +000001d0 9d e1 a0 25 2f d9 7d 21 39 b9 ca 4c ff de 42 8c |...%/.}!9..L..B.| +000001e0 36 bb 46 79 d3 52 be bc 1c dc 1f e3 6e 18 b8 4e |6.Fy.R......n..N| +000001f0 b2 47 e6 74 d3 50 fa cf fd 5a c8 33 9a 17 2f 48 |.G.t.P...Z.3../H| +00000200 e6 20 29 b3 7b e3 de a1 c8 e7 74 f0 ca eb f9 6e |. ).{.....t....n| +00000210 29 2c 73 17 df 5f 8f ed dc ae 2a a6 37 f2 b7 f7 |),s.._....*.7...| +00000220 38 da 45 63 cd 2e e6 bf c7 a4 3c 15 c2 89 6f 59 |8.Ec......<...oY| +00000230 c2 19 29 19 13 4f a4 59 57 f9 da 8c 7d 5a 82 7a |..)..O.YW...}Z.z| +00000240 9f 79 01 51 94 7c 25 46 7e c2 b2 bf b4 dd c1 e8 |.y.Q.|%F~.......| +00000250 12 14 3e 77 44 8c 47 8b 9b ab 88 47 5d 12 cd 63 |..>wD.G....G]..c| +00000260 17 c2 15 29 a3 cf 8c 08 e0 12 f6 36 ff ae a6 72 |...).......6...r| +00000270 3b 71 4d c7 a2 3b 38 63 be 77 43 67 fb 78 e6 a8 |;qM..;8c.wCg.x..| +00000280 1d aa 3a 42 f5 47 f8 d4 8d 83 f7 f0 93 ba 90 6d |..:B.G.........m| +00000290 25 65 e1 49 f5 3e fe e9 76 ea fb 23 38 6f b2 8f |%e.I.>..v..#8o..| +000002a0 3c 72 d3 fc 85 92 a0 d1 11 7c 6a 0b 0f 31 5d 8b |..| +000003c0 4a ba 5a 91 7b d1 b9 0e d1 98 5e 95 4d 1c 7f 77 |J.Z.{.....^.M..w| +000003d0 6e eb b9 8c 95 ce d4 04 5c 69 8f 7e 48 89 30 2b |n.......\i.~H.0+| +000003e0 71 27 a3 54 c2 b7 f2 ad 23 7b ee 64 88 a0 0d 75 |q'.T....#{.d...u| +000003f0 76 |v| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 02 11 77 e3 de 64 ac |...........w..d.| -00000010 38 0a da af 1f ce 7a 60 a6 34 74 5b 5f d5 c1 72 |8.....z`.4t[_..r| -00000020 7f b9 4f e8 19 26 35 c2 9a 0a d5 19 50 72 72 b3 |..O..&5.....Prr.| -00000030 de 05 ac 50 78 2a 69 8a 7f c2 5c d0 a5 58 70 b6 |...Px*i...\..Xp.| -00000040 18 86 f5 92 83 20 fc d5 fb fc 28 89 a0 5c 5e d3 |..... ....(..\^.| -00000050 d2 c8 d7 6e 31 47 a0 bc 9a f0 e6 75 be 55 a4 43 |...n1G.....u.U.C| -00000060 b0 e5 42 f6 66 f0 2c dd ce 9c 35 3d 93 a9 af 85 |..B.f.,...5=....| -00000070 1c df 81 5f a3 19 95 45 ec 18 ce 92 91 4e 7c 59 |..._...E.....N|Y| -00000080 12 dd b5 45 44 9d 1c b2 d3 53 a4 5b ce b6 49 c1 |...ED....S.[..I.| -00000090 1d 22 27 73 1f f3 46 ba 05 fd 2d ac d2 ae 9b 7a |."'s..F...-....z| -000000a0 33 d6 9d a9 fd 29 f7 d9 57 69 91 36 10 f7 93 50 |3....)..Wi.6...P| -000000b0 b1 c4 88 0b 55 de c4 8e 0f d3 60 9c cb 95 4a 2d |....U.....`...J-| -000000c0 35 37 29 03 4f a0 52 33 c9 98 60 88 33 0d f1 68 |57).O.R3..`.3..h| -000000d0 eb 02 f7 15 70 36 d7 86 38 18 ce 89 e5 39 2e c0 |....p6..8....9..| -000000e0 ca 23 07 2b f3 74 df 77 bc 48 5e db a4 c3 7e 68 |.#.+.t.w.H^...~h| -000000f0 8c b3 53 c4 69 b3 45 db be c5 04 b9 00 9e 3c 48 |..S.i.E.......| -00000170 2a be 2e 04 7a f5 ee d2 6b 55 f5 3c f8 46 1a 60 |*...z...kU.<.F.`| -00000180 a4 8d ef bb 3e 5c 35 44 73 4b d7 a9 22 ad 9e cb |....>\5DsK.."...| -00000190 95 01 14 2c a2 0f 72 2e 53 64 3f 11 44 9b da fb |...,..r.Sd?.D...| -000001a0 d5 be 42 f5 c1 c8 b2 12 6b 3c 00 27 8e 32 a3 2c |..B.....k<.'.2.,| -000001b0 7e d9 6f 03 2f 29 c3 84 3d 80 c3 cd a0 88 ef 7b |~.o./)..=......{| -000001c0 c7 52 14 2e f5 ba 12 05 1d 57 0d a9 57 7d 6b e8 |.R.......W..W}k.| -000001d0 07 09 8a 73 9e 17 30 3a 23 b5 2b 7c 20 f0 11 8b |...s..0:#.+| ...| -000001e0 50 0c 56 d3 35 9c d9 46 53 f2 dc 8a 76 41 7b d8 |P.V.5..FS...vA{.| -000001f0 d7 4b d7 c1 29 c8 41 46 a7 0a 30 85 a4 a8 d4 64 |.K..).AF..0....d| -00000200 93 13 fc 47 88 46 0d f7 fe ae cb 0a 55 89 64 c8 |...G.F......U.d.| -00000210 ab 0b 7f bb a1 d9 7c a4 56 fb ee 1f 17 03 03 00 |......|.V.......| -00000220 99 85 55 c5 ed 66 4f 93 f3 7a 7c 96 5e 75 1e 34 |..U..fO..z|.^u.4| -00000230 b1 3a ba b6 e7 2e de 4c b4 2f 06 ee fe a7 14 f8 |.:.....L./......| -00000240 32 3b 20 cf 9d 93 16 2a 80 e7 cc 46 de 13 f8 7e |2; ....*...F...~| -00000250 0b 83 69 de 4c 7d f2 cd 5e 23 30 8b 38 b9 68 cb |..i.L}..^#0.8.h.| -00000260 fe d9 dd ed e3 ad 59 50 71 6b f3 9c ce 6c 89 01 |......YPqk...l..| -00000270 cc 89 ed b0 71 87 10 c4 0b 47 45 c9 4f 16 b8 2d |....q....GE.O..-| -00000280 88 41 6e 5e 4e 26 fa 28 10 e5 f3 74 ed a1 ba 17 |.An^N&.(...t....| -00000290 cd 58 fa 60 26 f0 64 6f 61 51 0d 51 b3 32 bd 8e |.X.`&.doaQ.Q.2..| -000002a0 8a e7 8f b2 f6 c7 30 d3 22 a7 1e 0d 15 aa 64 db |......0.".....d.| -000002b0 26 11 e1 38 73 ee 29 b9 1f 34 17 03 03 00 35 cb |&..8s.)..4....5.| -000002c0 c3 5c e5 0f 1a 9b dd 44 04 89 12 b5 a2 7d 30 8f |.\.....D.....}0.| -000002d0 bd 67 6a 98 f0 f9 f9 7d 01 66 6e 28 05 45 56 89 |.gj....}.fn(.EV.| -000002e0 df 1f ba b8 1e 22 56 e1 e3 1c 1c dc dd 01 53 ed |....."V.......S.| -000002f0 50 39 3e c2 17 03 03 00 17 c2 af ed 30 35 b0 dd |P9>.........05..| -00000300 99 be 51 2a dd b8 68 2c 62 ac c2 a8 38 d0 a5 53 |..Q*..h,b...8..S| ->>> Flow 4 (server to client) -00000000 17 03 03 02 da 67 9d 9c f7 2d bf 7b bb 80 c0 6d |.....g...-.{...m| -00000010 d5 18 94 70 77 34 15 6e 81 08 7b db 88 77 80 ee |...pw4.n..{..w..| -00000020 d6 a6 ce 4e 7d 49 87 5e 05 b5 e5 9c cc 36 82 c2 |...N}I.^.....6..| -00000030 eb 9b 42 ed 9b 5d 6b ac 35 21 29 76 6c 84 a6 e2 |..B..]k.5!)vl...| -00000040 29 f8 74 3d b9 c3 0e 24 45 88 c5 19 19 e1 64 35 |).t=...$E.....d5| -00000050 a2 71 a5 42 c0 9c cc f3 51 93 f1 e5 c4 29 09 a6 |.q.B....Q....)..| -00000060 6f bc 47 e6 ba cf 5b 64 0e 18 e1 dd e8 4f d5 59 |o.G...[d.....O.Y| -00000070 b3 84 0d 70 12 51 9c fc f8 51 ff 53 30 e3 a7 0d |...p.Q...Q.S0...| -00000080 89 82 ce 0f ff 33 b8 e8 24 5b 35 fa 56 47 11 b3 |.....3..$[5.VG..| -00000090 77 10 c6 f6 3e a6 d0 e7 82 42 5e c0 5b 4a 1d 43 |w...>....B^.[J.C| -000000a0 0e 84 77 29 c0 69 fe 42 d5 e1 3d 86 f2 c9 1b fe |..w).i.B..=.....| -000000b0 f1 54 f6 0f 8a 48 04 c4 5b d6 11 30 68 ce e6 fd |.T...H..[..0h...| -000000c0 59 78 18 14 a4 ce 5a 12 ec a3 31 b6 6f de 42 07 |Yx....Z...1.o.B.| -000000d0 e1 e6 04 da d3 33 28 ef ab 21 f2 d1 5e e3 9e 91 |.....3(..!..^...| -000000e0 89 ad e4 12 b4 5b 11 2c 19 7e c7 d4 40 60 17 3a |.....[.,.~..@`.:| -000000f0 37 9a fa 62 44 fa 7e 36 1b bc 0c 55 dd f2 f3 d3 |7..bD.~6...U....| -00000100 94 9c 6b 63 36 06 e0 ae 48 41 1c b5 c5 b7 03 bd |..kc6...HA......| -00000110 6e da 0d 68 4d 22 e9 7c 29 ad eb 85 9d 0b 85 14 |n..hM".|).......| -00000120 2e 0d 3a 1f 23 08 cf e9 57 38 a8 ae 48 a0 3b af |..:.#...W8..H.;.| -00000130 e6 1f 83 6f d3 e1 d2 ae 42 14 af 50 1c 4a 51 fd |...o....B..P.JQ.| -00000140 68 1d ad d7 71 2a 0f 16 52 07 8b f9 d0 48 c0 33 |h...q*..R....H.3| -00000150 4e 24 85 e0 61 26 28 db 44 93 86 78 74 02 1c 48 |N$..a&(.D..xt..H| -00000160 1e cd 2a 7b 33 b3 08 f3 ba af 71 c7 f1 d8 af 46 |..*{3.....q....F| -00000170 d8 88 dd 22 cc d7 d8 96 98 ca 20 d1 5c 7a 59 ab |..."...... .\zY.| -00000180 df 66 0b 59 05 40 92 7b 8f 78 ac 67 90 d5 eb 24 |.f.Y.@.{.x.g...$| -00000190 4a 05 c3 5f cc 64 7d 26 30 2a 25 d8 8e b5 e6 a6 |J.._.d}&0*%.....| -000001a0 b2 85 a3 cf d4 04 1e d8 92 bc 8e 2b ad c0 ff 52 |...........+...R| -000001b0 79 8b 82 55 cd 39 7d 8e a5 4c dc bf 81 ac 1a e6 |y..U.9}..L......| -000001c0 ed df 61 c8 ad 70 dc 75 5b cc e9 a7 8d 96 74 a7 |..a..p.u[.....t.| -000001d0 7a 94 3c 60 65 1c 7f e1 89 2d c0 80 5f 2f fd 9c |z.<`e....-.._/..| -000001e0 66 2f ad 73 c3 96 8d 74 c6 cd 68 74 39 49 87 4c |f/.s...t..ht9I.L| -000001f0 2c 77 3c c4 c5 4e 9a 71 1e 69 86 3a fb a8 d2 e2 |,w<..N.q.i.:....| -00000200 9d 63 60 e5 f7 d2 63 a8 f2 5b f7 cb 57 32 00 be |.c`...c..[..W2..| -00000210 f2 f3 9c ae a5 f1 9d 05 be 8a c1 ed 8f f9 d0 51 |...............Q| -00000220 85 5e ca ce 92 45 ca b4 ce 6e 26 11 9d 94 38 22 |.^...E...n&...8"| -00000230 40 34 dc bc a0 34 f6 48 26 38 7a 59 f8 c8 d6 c4 |@4...4.H&8zY....| -00000240 35 24 82 96 19 49 bb 24 5f 25 fc c2 a0 b7 89 4f |5$...I.$_%.....O| -00000250 8f 71 e1 c6 da 4f 96 fa 3f 5c 73 96 41 86 1c 9d |.q...O..?\s.A...| -00000260 9a eb 7a fa bc 59 e9 4c 09 cf e5 95 33 27 7a a6 |..z..Y.L....3'z.| -00000270 61 fc ff 39 38 1e 65 79 75 48 b0 48 66 bd ad 77 |a..98.eyuH.Hf..w| -00000280 4a d3 ce 91 65 e4 72 51 87 88 8a 2a b7 55 c4 46 |J...e.rQ...*.U.F| -00000290 cc 35 ef d4 aa fc bb 70 36 10 7f f3 2e 8c a0 2f |.5.....p6....../| -000002a0 7e 14 f3 c0 5d 18 55 71 bd e9 36 dc 2f a6 9b c1 |~...].Uq..6./...| -000002b0 b5 c5 64 f7 6e a5 8e 93 71 c6 3e ef ef c1 34 2b |..d.n...q.>...4+| -000002c0 f6 9b e7 ad ff a0 ec 14 0d ce 6c c7 c5 b6 c2 c2 |..........l.....| -000002d0 a4 de d3 b9 1e d9 0c f4 67 9a 33 fe f7 35 84 17 |........g.3..5..| -000002e0 03 03 02 da 81 75 4f 5f 38 a9 da c7 88 88 09 ee |.....uO_8.......| -000002f0 fd fc 5b 2a de 6c a7 d4 59 20 69 0b 5f 77 e9 9c |..[*.l..Y i._w..| -00000300 59 bd ed 59 d6 f2 5a 43 49 1b 0c 9a 4a ca e8 bb |Y..Y..ZCI...J...| -00000310 d1 d7 65 55 98 ec 0b 6b 22 a3 3e f1 12 23 d3 f2 |..eU...k".>..#..| -00000320 cc e3 b9 cf 0f 4a 9b 16 a1 09 69 71 75 90 0d 85 |.....J....iqu...| -00000330 37 90 de c9 c1 0a b2 af aa 1c e9 96 17 49 11 01 |7............I..| -00000340 74 f1 23 39 ea cb 33 d1 45 af ae 2a 11 59 7f 4a |t.#9..3.E..*.Y.J| -00000350 fb 57 ba ef 32 13 a1 ca 9c 31 d1 a8 6a c8 67 de |.W..2....1..j.g.| -00000360 13 46 60 76 4c cf be 6c 45 ae e8 29 9f 34 e9 a6 |.F`vL..lE..).4..| -00000370 0a ed ff 8a 47 67 76 ac a0 6a 02 1f 77 28 a2 fd |....Ggv..j..w(..| -00000380 fa c1 ff 43 a6 23 54 0b c2 53 cb 1e f1 ba 4c a1 |...C.#T..S....L.| -00000390 55 ec af b6 b3 be 4a 2a 26 21 d1 68 b5 f5 cd da |U.....J*&!.h....| -000003a0 c4 14 8c 5c 5e 13 31 35 d5 e8 44 a8 ff 08 bc 79 |...\^.15..D....y| -000003b0 91 a0 42 21 67 09 fc d2 b9 95 d6 b1 da c8 75 9e |..B!g.........u.| -000003c0 d7 77 81 cb 35 34 29 c4 c8 62 c3 cd d4 9d 68 5f |.w..54)..b....h_| -000003d0 7e 14 7a 63 d9 84 22 6f 7e e8 5b f9 b5 94 ab 81 |~.zc.."o~.[.....| -000003e0 fc 02 0a 37 6b 71 28 25 fb f6 ab 62 a2 8d 09 73 |...7kq(%...b...s| -000003f0 74 84 39 dd 25 e8 a3 f7 bc dc 11 4a 51 41 31 05 |t.9.%......JQA1.| -00000400 63 8e 92 48 5a a4 81 63 4c 3a 59 96 9f 55 3f fd |c..HZ..cL:Y..U?.| -00000410 fb 68 6a dc 6c e2 69 79 20 b5 1e b7 08 a1 71 a9 |.hj.l.iy .....q.| -00000420 62 64 f3 5e ea dc 46 25 02 fe 3b ce b3 6e 81 de |bd.^..F%..;..n..| -00000430 31 e0 e3 d4 89 39 91 0b 60 dc b5 46 f6 e9 f8 92 |1....9..`..F....| -00000440 d7 f0 00 aa 2c 4a d8 fc fb 11 c5 cf 21 d9 0f 8e |....,J......!...| -00000450 49 92 57 53 9c 5a 0e 2a 05 e5 e3 88 6d dd 4f 84 |I.WS.Z.*....m.O.| -00000460 f7 45 d5 aa a0 ff a5 c7 fb f3 77 76 35 a8 01 b2 |.E........wv5...| -00000470 f6 95 2f e8 f7 b8 87 94 22 d6 ad 11 dc 73 47 b3 |../....."....sG.| -00000480 5f ac ac 6f 34 84 d9 ca 50 a9 de 06 49 c7 3a 41 |_..o4...P...I.:A| -00000490 d1 bc be c9 4f 7a 7d 6a 1e dc 51 ca f1 b9 20 f7 |....Oz}j..Q... .| -000004a0 f9 04 d3 d1 05 0a 36 cf 28 bd 6f 71 6e 9c fb a8 |......6.(.oqn...| -000004b0 7e 88 df 6e b3 e9 5f 7a 46 34 60 96 24 a3 f1 1d |~..n.._zF4`.$...| -000004c0 bd cb 34 fa 0d 54 91 03 01 9b 5d d5 95 e6 51 0d |..4..T....]...Q.| -000004d0 21 d0 99 c3 4f 3f bf 49 64 a8 5b 5d 46 e9 a4 ed |!...O?.Id.[]F...| -000004e0 09 c9 21 4f 13 60 34 51 db d8 44 d5 d3 84 59 6d |..!O.`4Q..D...Ym| -000004f0 8b 73 67 4e fc e3 8b 27 64 89 a3 12 6f fd 4b 27 |.sgN...'d...o.K'| -00000500 a0 80 a1 61 46 9c 16 2a 1f 22 31 a3 3c 9a 4b 7b |...aF..*."1.<.K{| -00000510 cc 25 9d 83 33 9f 62 0f 55 8a 7e 8a 2b 3b b8 7c |.%..3.b.U.~.+;.|| -00000520 3d 50 3d 85 ed 98 68 8d e9 7f 70 f9 2e 56 79 fa |=P=...h...p..Vy.| -00000530 39 53 59 74 f9 fb a2 47 fb 22 39 10 c7 03 6c 78 |9SYt...G."9...lx| -00000540 b5 7e b8 4e c2 3f 09 38 36 f9 b5 a6 2a 2a 33 aa |.~.N.?.86...**3.| -00000550 9b c6 29 db df 07 d7 f1 db 09 88 27 07 70 95 b2 |..)........'.p..| -00000560 a9 ce 9d 2d 25 23 cb 8f 67 6b 2f cc 3b 01 9c c3 |...-%#..gk/.;...| -00000570 04 7c ce ed 8b c0 e7 ed 4d 6f a9 1e 7e 87 26 e0 |.|......Mo..~.&.| -00000580 6c ed 02 93 5e 89 91 2b f8 5c ac 37 e3 6c 0d 71 |l...^..+.\.7.l.q| -00000590 2d 13 42 28 b2 db c5 75 9d 93 da 6e b2 11 89 f6 |-.B(...u...n....| -000005a0 c8 33 1a 22 92 fe 60 3f c0 d2 79 f1 ca 5f 7f 3c |.3."..`?..y.._.<| -000005b0 21 a6 21 b8 01 f3 d8 c9 5a 27 04 0b 7c 18 |!.!.....Z'..|.| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 27 46 19 d1 26 45 d8 b4 49 5c 53 |.....'F..&E..I\S| -00000010 7a 0c 87 9c 73 0d 3a af |z...s.:.| +00000000 14 03 03 00 01 01 17 03 03 02 11 1d fa f6 f0 5f |..............._| +00000010 36 d9 1a b8 03 4b b5 2e ba ca 43 ea 31 c2 08 05 |6....K....C.1...| +00000020 e5 a1 55 2e 93 82 3b d5 5a b3 ca fe 11 92 9a 30 |..U...;.Z......0| +00000030 7e d8 02 b4 95 29 8f 29 ba b5 34 22 97 99 bc a9 |~....).)..4"....| +00000040 43 1f 18 5c e2 26 7e 2e 5d ff 2c 68 86 82 7c da |C..\.&~.].,h..|.| +00000050 7e da c5 46 21 69 37 3b f5 65 a4 cd 70 ed e3 c8 |~..F!i7;.e..p...| +00000060 47 21 88 8d 45 3a 0f c9 1e 37 a9 0a 6e 2e 59 0e |G!..E:...7..n.Y.| +00000070 1b 6b 08 22 10 81 74 00 0c 15 6f c6 1e a0 2d 60 |.k."..t...o...-`| +00000080 b1 c6 ec 65 ff 91 16 1a e4 18 86 1b 43 04 dc b1 |...e........C...| +00000090 a0 f2 1d e8 4e 46 72 84 20 14 75 1e 72 52 1b 46 |....NFr. .u.rR.F| +000000a0 1f 8a ed 08 c8 e0 07 1b 6d e3 44 68 ec 52 74 d5 |........m.Dh.Rt.| +000000b0 8d 7f 41 96 b4 77 01 25 0c 1f aa 50 2f 8b d7 1a |..A..w.%...P/...| +000000c0 77 1b 24 01 0b 1f 0f c2 0f e1 00 db 0a 28 e9 c5 |w.$..........(..| +000000d0 a7 22 a2 fd c2 98 c5 69 51 91 d4 55 0f 52 da 33 |.".....iQ..U.R.3| +000000e0 47 f2 34 bd 06 bb 22 53 55 8c 6c e1 95 b5 0f b8 |G.4..."SU.l.....| +000000f0 e5 8a 64 51 50 47 5d ca 5b 1a 20 22 99 b2 d4 74 |..dQPG].[. "...t| +00000100 9e 6b 01 44 6b 7c 40 a0 e3 95 eb 96 53 c0 8d c0 |.k.Dk|@.....S...| +00000110 c1 e1 2b 21 04 f1 64 03 ba 0f d9 34 57 f2 2e 62 |..+!..d....4W..b| +00000120 5e f6 69 d6 86 3e f0 00 96 ca b7 ed 7d b4 1c 79 |^.i..>......}..y| +00000130 f3 ea f4 10 79 d2 6d 6e 49 6c e4 32 c1 81 da 9d |....y.mnIl.2....| +00000140 cc 59 ea 41 3f 1e 62 34 61 6b 0e a4 07 4f ef f7 |.Y.A?.b4ak...O..| +00000150 a3 31 ee 52 14 60 4c 06 5c 69 49 8e 6a ab e9 94 |.1.R.`L.\iI.j...| +00000160 bf cc a5 12 b7 94 10 87 2f cc d8 40 b1 f3 a9 27 |......../..@...'| +00000170 97 5c 7f 85 f9 14 dd e0 66 27 9e 3d f4 eb 75 ab |.\......f'.=..u.| +00000180 1d 1a c0 c3 72 af 6e 13 bb 24 ac fe f0 fb 47 d0 |....r.n..$....G.| +00000190 1d 79 37 70 86 d3 43 9b 64 8c d0 f5 2b a8 7a 77 |.y7p..C.d...+.zw| +000001a0 4a e7 92 a3 bf 1e db 22 5a 40 39 07 76 1c 71 de |J......"Z@9.v.q.| +000001b0 9c ff 75 b7 0d 6e 3e 14 69 8d 08 e5 f3 24 ae 6a |..u..n>.i....$.j| +000001c0 61 f3 dd a7 57 52 9e da f1 de aa 07 11 65 41 64 |a...WR.......eAd| +000001d0 61 57 23 71 47 aa 8e 47 9c 5f 99 84 90 2d 9a fd |aW#qG..G._...-..| +000001e0 5b 15 27 44 41 5c a0 41 87 05 8a 53 8f ed 93 22 |[.'DA\.A...S..."| +000001f0 50 15 b4 60 55 c7 78 20 b5 d8 dd 9d 5d 8c 69 bc |P..`U.x ....].i.| +00000200 74 da d6 a6 a6 86 fe 93 e1 48 48 f2 f0 36 93 86 |t........HH..6..| +00000210 d6 62 9d 09 3a 19 f7 9d 01 9b 87 85 17 03 03 00 |.b..:...........| +00000220 99 37 bf 65 e8 18 ef 10 d7 02 e2 73 3f 13 4a 6f |.7.e.......s?.Jo| +00000230 ea f0 e2 c8 a3 fc a4 3a d2 ea 96 2d 77 cb cc b3 |.......:...-w...| +00000240 1d 8a 77 4d 97 a6 e9 6e 6e b5 af 67 d1 e4 e6 be |..wM...nn..g....| +00000250 0b 05 b1 da 15 83 ca af 19 cf 57 60 05 16 47 bd |..........W`..G.| +00000260 ce 94 f9 bf 48 5c 2c 38 57 57 c3 39 9b 84 19 59 |....H\,8WW.9...Y| +00000270 db fc 09 06 29 4d e7 71 be d4 86 12 fa 8e 54 e8 |....)M.q......T.| +00000280 b0 7e 79 56 dc b2 7a 30 08 e2 8b c7 fa 46 ce 84 |.~yV..z0.....F..| +00000290 d3 3e 6d 1c 8d 4c 5e 76 c7 d2 1d 8b 85 5d be a3 |.>m..L^v.....]..| +000002a0 1b d8 92 72 6d b1 73 d9 b4 a7 14 00 58 80 79 a9 |...rm.s.....X.y.| +000002b0 75 55 96 af d9 d2 20 92 ef ca 17 03 03 00 35 b0 |uU.... .......5.| +000002c0 fe 3f 36 6e 82 b5 d3 7c e9 7b 75 d6 b1 4d f6 7b |.?6n...|.{u..M.{| +000002d0 d0 10 68 32 9a 7b 04 69 38 bf a2 42 1b 3d 14 75 |..h2.{.i8..B.=.u| +000002e0 31 00 90 d4 1b b1 bf 5b 76 65 50 42 21 60 75 30 |1......[vePB!`u0| +000002f0 f9 b8 ee 45 17 03 03 00 17 0b b8 78 9e a2 94 45 |...E.......x...E| +00000300 47 f4 8e af 08 d0 80 75 09 7b c6 44 45 82 19 30 |G......u.{.DE..0| +00000310 17 03 03 00 13 0e fb b9 24 58 7c ab 97 b3 6e 2e |........$X|...n.| +00000320 55 50 ff 05 5d 04 dc 72 |UP..]..r| diff --git a/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-RSAPSS b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-RSAPSS index 495f9ff124dc3..d2092baa8c63e 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-RSAPSS +++ b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-RSAPSS @@ -16,215 +16,121 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 63 54 7d 13 b3 |....z...v..cT}..| -00000010 e2 34 2b ce 4b 8e 0a 74 db b8 ef cd f9 6e 3f cf |.4+.K..t.....n?.| -00000020 01 22 34 82 8a 44 42 65 2e 5f 3d 20 00 00 00 00 |."4..DBe._= ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 01 26 b2 48 f5 |....z...v...&.H.| +00000010 b7 cc 24 54 75 e5 9d cd 17 e1 02 e4 2d e1 32 28 |..$Tu.......-.2(| +00000020 4e 19 1e 6d 8a 1e 3f 0e 37 3c 5f 20 00 00 00 00 |N..m..?.7<_ ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 d6 |..+.....3.$... .| -00000060 4b 8a 50 d0 fb 13 86 36 0b a1 52 2a a3 e4 f9 4f |K.P....6..R*...O| -00000070 57 35 33 a7 d4 6d 4f 84 fc 83 58 78 d9 85 0c 14 |W53..mO...Xx....| -00000080 03 03 00 01 01 17 03 03 00 17 1f 19 9a c9 99 fd |................| -00000090 a7 26 d2 26 17 74 5a 9c 69 92 c5 d0 bc 40 6f f2 |.&.&.tZ.i....@o.| -000000a0 6d 17 03 03 00 20 f9 64 91 4c cd 2c 70 2e 09 4f |m.... .d.L.,p..O| -000000b0 89 52 61 ac 1c 1d a4 f6 45 30 c3 59 eb 6d ba 83 |.Ra.....E0.Y.m..| -000000c0 17 53 34 54 98 37 17 03 03 02 7a 9e 5b 62 72 9f |.S4T.7....z.[br.| -000000d0 4f 8c 72 a7 1a a7 b4 ac 72 36 b2 21 8c 91 a3 4b |O.r.....r6.!...K| -000000e0 a4 ed 5d f7 a7 0b 68 c1 db 68 40 04 6f 3e b6 3c |..]...h..h@.o>.<| -000000f0 4c 67 84 d1 b1 9b d8 84 e3 28 b8 09 6e 7a 6d 6a |Lg.......(..nzmj| -00000100 91 d3 80 af 4b 2d b5 4e 0c ed 81 90 75 2e f8 1c |....K-.N....u...| -00000110 7f d3 c9 99 6e ba ff 42 eb 05 fb c6 5a f7 7b 5a |....n..B....Z.{Z| -00000120 14 c9 52 21 a6 44 a5 0c 9f 37 bb 78 c1 d9 e8 7b |..R!.D...7.x...{| -00000130 f3 44 84 06 32 a0 67 af d1 5c 03 f8 2b e4 5a c5 |.D..2.g..\..+.Z.| -00000140 18 be 1e bd dd 0c c4 84 0d 23 5e fd 2f f8 c9 4d |.........#^./..M| -00000150 86 e0 eb 41 66 0d de dd ab 6f 6c 9c 4e ab b0 14 |...Af....ol.N...| -00000160 a8 7c 6a 95 c9 02 30 df 9f 5a 45 4a 66 1e b4 15 |.|j...0..ZEJf...| -00000170 c0 ba cb 47 7b a1 4f ab df 81 f5 9a 2a 42 3a 1b |...G{.O.....*B:.| -00000180 35 f7 5b b1 c7 43 c1 b8 5a 1e b6 74 43 d8 97 2c |5.[..C..Z..tC..,| -00000190 63 7e 7d dd 37 77 0e 36 3f 2e cf 84 12 20 a6 5c |c~}.7w.6?.... .\| -000001a0 34 eb 09 25 03 89 47 89 9e cb 46 74 b9 21 2a 5f |4..%..G...Ft.!*_| -000001b0 63 fc 8e 2d f4 9f a6 4a 41 bf b8 3a a6 a1 7c 33 |c..-...JA..:..|3| -000001c0 1c 86 52 b0 ff a0 66 3d 39 55 36 e5 89 21 2f c4 |..R...f=9U6..!/.| -000001d0 3a 07 81 75 6d 62 15 9a 94 2b 5a f5 01 43 c3 a8 |:..umb...+Z..C..| -000001e0 b6 7d 71 3c 4d 96 8d e3 3a 3f 6f 33 5f 63 01 7d |.}q....| -00000200 23 d7 d2 ca 3d 6e e5 71 34 14 02 71 b1 20 e9 05 |#...=n.q4..q. ..| -00000210 2a b6 cc 50 a5 9c b3 ca f7 f7 b4 fc ef 24 4d 47 |*..P.........$MG| -00000220 e7 8c 0f f7 36 90 4c b5 c5 70 07 f7 33 c8 0f 42 |....6.L..p..3..B| -00000230 f9 e1 00 11 d8 ba 71 31 44 a5 84 15 56 d3 0b ec |......q1D...V...| -00000240 78 38 f4 ed 74 df e4 67 33 7f e8 1a c5 70 af 1e |x8..t..g3....p..| -00000250 65 f6 26 f0 02 e0 71 c0 89 48 96 06 92 b7 12 21 |e.&...q..H.....!| -00000260 bd b5 e0 30 c0 bd 5f ed 55 6b fa 3f c3 b6 30 2e |...0.._.Uk.?..0.| -00000270 d2 71 4f a3 45 f8 f8 ec de 23 28 0a 43 ae 73 69 |.qO.E....#(.C.si| -00000280 4c a1 d7 02 12 e8 f4 b6 7d 6c 3b 0f 7f 31 a8 dd |L.......}l;..1..| -00000290 41 f0 06 29 19 de b3 56 61 b0 55 6a bc b3 71 e7 |A..)...Va.Uj..q.| -000002a0 13 02 d6 cc ae 60 c1 32 5d be 8f 32 c0 21 95 b9 |.....`.2]..2.!..| -000002b0 e6 c6 cb 97 d9 66 12 a2 03 fb 3d 9d 15 dd 19 ef |.....f....=.....| -000002c0 62 f5 80 4f b9 27 e8 73 a3 21 57 04 bd 61 4e c8 |b..O.'.s.!W..aN.| -000002d0 44 93 3b 8c a3 32 39 ac 73 98 36 ba da 64 f4 33 |D.;..29.s.6..d.3| -000002e0 54 e9 ba ec f0 1d 75 74 ab 9b 18 dd c9 96 c6 66 |T.....ut.......f| -000002f0 a5 e3 48 47 76 f9 24 1d f7 84 05 33 d7 d8 ac 02 |..HGv.$....3....| -00000300 02 a4 65 14 7f 63 46 aa cd 6f ce 1a ab 5a bc 48 |..e..cF..o...Z.H| -00000310 15 db 93 55 9b 1f a8 b0 d7 ab 51 ab 8f 0d 0e 04 |...U......Q.....| -00000320 f3 4e 73 92 76 89 1c e4 0f 9d 00 19 6a 2b a1 6c |.Ns.v.......j+.l| -00000330 aa d9 21 df e5 c8 9d 6c bc 93 f2 0c 0c f6 86 c3 |..!....l........| -00000340 26 37 53 af f0 17 03 03 00 99 cd cf 63 df fd 8b |&7S.........c...| -00000350 a7 90 61 f2 37 21 17 d4 a7 c4 20 7c e3 16 2d 9b |..a.7!.... |..-.| -00000360 c4 c1 6a 87 2d 63 55 7e 17 ef aa f1 6d fe d1 37 |..j.-cU~....m..7| -00000370 f8 90 0d 34 db 45 20 6e 73 0d f1 eb 2d d4 6b 4a |...4.E ns...-.kJ| -00000380 23 f9 d5 5f 49 75 4d 02 b0 39 fd ee ef f5 65 08 |#.._IuM..9....e.| -00000390 d8 f6 ce fa 2a 3c 20 41 1f 5d 38 cc b4 39 0b 52 |....*< A.]8..9.R| -000003a0 29 93 0b ce 4c c4 7a 7c 92 81 8b ca 0b 5e 31 8f |)...L.z|.....^1.| -000003b0 6d 06 03 6f 25 19 52 f3 8f 3a 47 33 9b 15 d5 4f |m..o%.R..:G3...O| -000003c0 c8 db 6a fe fb d1 9e 32 ab 2e b2 10 83 20 c3 34 |..j....2..... .4| -000003d0 f8 35 62 fc 30 99 9a 72 ff 57 33 fd 73 0c 08 bc |.5b.0..r.W3.s...| -000003e0 d4 da f0 17 03 03 00 35 27 67 18 21 60 ca 5f e5 |.......5'g.!`._.| -000003f0 33 00 27 83 87 7c df 42 12 ba 89 78 eb b8 fa 6e |3.'..|.B...x...n| -00000400 a1 65 f4 33 e8 e8 99 c6 4f 71 a0 ff b8 08 5b 02 |.e.3....Oq....[.| -00000410 1b 82 b6 58 e2 d7 d7 e5 72 1b 81 a4 93 |...X....r....| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 67 |..+.....3.$... g| +00000060 35 32 50 33 37 9b 04 46 e4 7d 40 53 9d 3b c3 53 |52P37..F.}@S.;.S| +00000070 6d 16 d3 7a 95 ec 2b 09 37 ff 01 55 60 9c 53 14 |m..z..+.7..U`.S.| +00000080 03 03 00 01 01 17 03 03 00 17 b9 d8 da 19 0a e9 |................| +00000090 37 9a 76 b8 b1 e6 38 27 83 aa 0a 3a d5 cc 9a 25 |7.v...8'...:...%| +000000a0 1c 17 03 03 00 20 17 a1 70 92 5e 78 bf 9f e3 0c |..... ..p.^x....| +000000b0 cc e8 a3 6d c9 ba 77 e1 b5 0c 4b 1e 84 08 04 33 |...m..w...K....3| +000000c0 88 a3 05 4a e2 6a 17 03 03 02 7a f0 39 57 69 59 |...J.j....z.9WiY| +000000d0 dd 3d b1 be 1a 06 fc 7b 21 a1 7a cb b9 6e f6 ce |.=.....{!.z..n..| +000000e0 62 13 c8 b6 b3 85 b2 93 22 ab 5c f2 32 a2 af 32 |b.......".\.2..2| +000000f0 42 d1 c0 94 08 f4 ba 1f bb d9 16 f7 2b 40 8d dd |B...........+@..| +00000100 43 a2 80 0e 3a e4 ff 2d a3 18 59 b4 08 88 46 bf |C...:..-..Y...F.| +00000110 bb 46 58 82 b2 db 98 c0 9f 3a f8 c4 71 f0 87 ac |.FX......:..q...| +00000120 c5 ee 30 ea c4 b2 63 ee d0 cb 17 06 5c 80 19 3a |..0...c.....\..:| +00000130 bc f8 07 a1 e8 47 b4 b2 77 e0 14 ea 5d 16 c1 31 |.....G..w...]..1| +00000140 e6 34 bc 50 92 1a e8 9f e5 e9 0d 60 af 00 ad 9b |.4.P.......`....| +00000150 e3 10 bc 64 bd d4 c0 35 e8 26 67 df fb 3d d4 e8 |...d...5.&g..=..| +00000160 11 f2 24 13 d9 fb 68 5d 69 ce 23 98 07 e8 4a 4a |..$...h]i.#...JJ| +00000170 d9 d1 a7 b1 63 e1 01 08 ae e5 d1 57 1c e6 9a 5a |....c......W...Z| +00000180 ac 4a f8 f7 9a 33 51 d1 3b 68 42 1a 0d e0 08 f3 |.J...3Q.;hB.....| +00000190 a1 ea 83 5c 8f 95 7f ee bb 45 e3 72 72 2c a0 39 |...\.....E.rr,.9| +000001a0 86 f1 e0 58 6c 82 01 b0 3c 17 09 82 f3 d9 99 0c |...Xl...<.......| +000001b0 24 33 7d 50 b0 b7 84 3e 9b 91 a8 1f 91 02 95 aa |$3}P...>........| +000001c0 44 b6 de 0e 35 e1 b7 f6 ca 73 f8 6f f4 5a 21 db |D...5....s.o.Z!.| +000001d0 d6 f8 04 88 4e d6 04 7c 67 93 22 9a ff d0 0e 79 |....N..|g."....y| +000001e0 e6 cb b2 03 b9 f2 46 27 a3 1a 89 2e 8f 46 4f c5 |......F'.....FO.| +000001f0 4a ad 09 e7 79 38 a4 84 43 19 c9 1f 62 a0 5a 4a |J...y8..C...b.ZJ| +00000200 fa e4 98 14 e7 34 a6 3f 07 93 ab 6a fb 1c 3e 1f |.....4.?...j..>.| +00000210 a2 82 0a 42 43 d7 ef e7 aa fa 42 e0 be a1 dd 4e |...BC.....B....N| +00000220 2e 9e 49 da 81 da bc 5f 40 fa f8 00 99 19 d0 13 |..I...._@.......| +00000230 50 77 8b c5 69 f0 ec 7c bd 2d 9e c5 66 16 56 ca |Pw..i..|.-..f.V.| +00000240 bd 51 67 7b 87 5e 1f 4d 21 05 30 72 ac a8 ab 13 |.Qg{.^.M!.0r....| +00000250 12 dd 4c f7 e0 cc 95 c3 3e f0 94 95 40 ea c5 f1 |..L.....>...@...| +00000260 31 f9 53 32 40 64 5f c8 29 52 7a d6 22 5c 2d e8 |1.S2@d_.)Rz."\-.| +00000270 f9 eb f8 b9 e6 66 09 48 ad ed 73 6a 42 bc a8 7c |.....f.H..sjB..|| +00000280 d6 f9 62 45 25 f6 bf 8a 56 13 b4 50 cb 1b 5e 8b |..bE%...V..P..^.| +00000290 92 f3 9d 50 fc 7d 3c e4 b1 55 ae b2 3f 6a a8 a2 |...P.}<..U..?j..| +000002a0 f1 dd 83 9a 97 0e 3f 93 a9 6d 94 e5 cc a9 53 14 |......?..m....S.| +000002b0 24 44 80 28 a2 6a 21 57 07 63 96 78 3f 05 40 7d |$D.(.j!W.c.x?.@}| +000002c0 be 83 b2 b8 b3 0a 58 a7 50 29 dc bb b1 7f c6 c7 |......X.P)......| +000002d0 4b 5a ff 95 4a c8 50 0b 8e 44 ec 9b 0f 95 ac 8f |KZ..J.P..D......| +000002e0 f9 b3 19 d0 aa a6 67 f8 ce dc 67 34 0e c9 98 98 |......g...g4....| +000002f0 82 b1 54 4a a0 0e 02 d7 02 d3 36 06 4d 51 6f e4 |..TJ......6.MQo.| +00000300 f5 68 ff 4d 8f 00 94 a6 6b 6c 33 41 31 1a 9e 2c |.h.M....kl3A1..,| +00000310 f5 df 4a 43 b7 00 01 5b 6e 59 af 9c 9f bb c5 37 |..JC...[nY.....7| +00000320 22 32 35 25 bf 69 0a 9d 75 7e aa 19 b9 4e b1 17 |"25%.i..u~...N..| +00000330 cb f8 b5 8f 0f 81 9c df b1 ce a0 5b f2 ed df 20 |...........[... | +00000340 5a bd 8a 88 b1 17 03 03 00 99 15 09 f2 8d 63 c0 |Z.............c.| +00000350 f2 00 9f e8 1a d3 0f cc 35 0b ce eb 3c 45 87 59 |........5...>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 02 11 5e 13 11 0e f1 |...........^....| -00000010 96 10 11 c9 e7 a3 dc 79 80 fc 2a a9 60 55 07 b2 |.......y..*.`U..| -00000020 59 b3 69 97 2f ef 14 58 9b 64 a3 19 71 fa ce 8b |Y.i./..X.d..q...| -00000030 86 34 92 82 f4 cd 17 c1 45 2f 69 e9 e7 84 1d 4c |.4......E/i....L| -00000040 d0 62 6e 30 40 e6 a7 a6 f1 c6 b2 ce 88 ae 5a 05 |.bn0@.........Z.| -00000050 06 d2 ab 40 6b d4 17 fa 89 69 41 46 bf 96 23 37 |...@k....iAF..#7| -00000060 07 04 5d 62 32 98 da db a4 67 c8 7a 81 55 00 1d |..]b2....g.z.U..| -00000070 e2 ce c3 44 2a 24 23 c0 ef aa 8f c6 14 75 fb ad |...D*$#......u..| -00000080 bb 4a b5 7d c3 dd 69 29 9b 05 60 80 1c 66 c4 4a |.J.}..i)..`..f.J| -00000090 cc 63 fb 8a 8a cf 44 05 80 7f ed 0b c1 e0 8f 14 |.c....D.........| -000000a0 9b 4b f8 39 f8 03 c2 c5 97 62 61 f5 7b 38 ac 07 |.K.9.....ba.{8..| -000000b0 2b c5 c6 5a 10 fc 28 20 c7 56 2c c6 92 28 4c dd |+..Z..( .V,..(L.| -000000c0 a2 01 f5 90 e2 5b 9b a4 07 ef 28 27 c6 7c fb d1 |.....[....('.|..| -000000d0 84 2f d4 ab 5d dc 13 a3 49 9d ce c5 3f c6 a4 90 |./..]...I...?...| -000000e0 43 9c ba c8 96 c7 8b c3 a0 63 e9 99 4f d5 49 a2 |C........c..O.I.| -000000f0 c2 a8 cd ff 5b e0 fc 29 85 80 bd 62 c1 22 c0 b1 |....[..)...b."..| -00000100 b8 1d f0 ed d3 17 22 13 5f 06 5d a1 bd 04 ae 34 |......"._.]....4| -00000110 d1 60 70 ad 60 10 fa da 90 82 87 09 cd 0c f7 aa |.`p.`...........| -00000120 1f 10 90 a5 cc b1 44 11 f6 62 92 ed 23 7b 7d 1e |......D..b..#{}.| -00000130 90 a1 9c 7b 5a e7 d1 f4 41 8f 8e 1f ba 4e cd 51 |...{Z...A....N.Q| -00000140 fe 38 f2 f5 3d 6a b3 c9 9b 36 6e 58 ad c3 5c d5 |.8..=j...6nX..\.| -00000150 54 63 e3 c6 c2 14 96 ee 46 03 cc 14 b9 09 73 0e |Tc......F.....s.| -00000160 1c ad 32 12 ba 85 a9 8b b4 fe cb e9 98 f0 f9 fa |..2.............| -00000170 5a 8d 88 79 54 e7 8e e7 c2 ac d9 2a f1 1d b5 39 |Z..yT......*...9| -00000180 ba 3e f0 af 08 3f f8 50 1d 8c ca 9e b2 47 c3 68 |.>...?.P.....G.h| -00000190 12 3b 60 38 b0 d8 da b6 15 ff 0e b4 76 28 0f e9 |.;`8........v(..| -000001a0 56 b3 41 b3 55 68 88 f7 66 41 5c 98 90 5e 10 ad |V.A.Uh..fA\..^..| -000001b0 20 82 a3 09 77 fb 45 3d 2c 0e 2c 5b 25 02 94 87 | ...w.E=,.,[%...| -000001c0 e5 ee 1c a1 05 e3 70 33 7e 9a 16 55 92 35 c2 91 |......p3~..U.5..| -000001d0 f8 0a 3d 2d f0 af ba e4 93 b3 98 4b 04 6d 6b b3 |..=-.......K.mk.| -000001e0 ac 76 c8 48 74 84 99 d5 58 95 f1 c7 f6 2c 05 d1 |.v.Ht...X....,..| -000001f0 7c 47 55 be 90 27 17 df 02 49 a6 b1 4b 92 23 9a ||GU..'...I..K.#.| -00000200 12 8a 3a 56 51 e6 4a 92 1c ae 19 de 57 b2 df b0 |..:VQ.J.....W...| -00000210 df 07 94 a3 e0 ea 81 e3 fc d0 35 2d 17 03 03 00 |..........5-....| -00000220 99 47 fd c2 4d a0 5f b9 dc 3b 3c ae 1e d7 c5 d6 |.G..M._..;<.....| -00000230 94 05 6a 61 72 6e b9 29 b7 d4 e2 9b 26 6c 86 94 |..jarn.)....&l..| -00000240 e0 7f 1d 66 1d 90 bb 09 fd e8 83 32 51 6c a1 96 |...f.......2Ql..| -00000250 28 c3 5f c0 69 d5 09 00 60 b8 05 de 45 88 51 b8 |(._.i...`...E.Q.| -00000260 f0 ed 67 57 97 8f b9 82 ed 4b 31 66 f2 7e e5 a4 |..gW.....K1f.~..| -00000270 92 2b cc 63 b5 98 ea 57 6c 44 51 f6 de ee 3b bf |.+.c...WlDQ...;.| -00000280 ac 25 c8 21 a9 74 f8 ca 61 69 93 95 83 c9 f3 da |.%.!.t..ai......| -00000290 17 e5 3d 82 05 c2 3f e8 80 92 e0 14 b5 b8 40 63 |..=...?.......@c| -000002a0 3a e7 cd 39 5e e5 1c a4 31 8a 74 97 1e 16 fb 0a |:..9^...1.t.....| -000002b0 2c 0d d5 fa aa b2 4b de 59 56 17 03 03 00 35 ab |,.....K.YV....5.| -000002c0 07 57 5c 79 b1 5f 13 6a 37 e7 a4 a1 97 0c 87 cb |.W\y._.j7.......| -000002d0 84 1e fd d7 15 ec 37 c4 18 83 41 c7 c1 26 cf 1b |......7...A..&..| -000002e0 43 5e 2a 06 1b be 66 42 84 46 f5 e0 d6 a7 83 cf |C^*...fB.F......| -000002f0 08 d9 30 a6 17 03 03 00 17 dc b8 10 ea ce 82 16 |..0.............| -00000300 ff ce bc 5f 46 5d d0 61 9b dd bf 64 54 8e 54 b1 |..._F].a...dT.T.| ->>> Flow 4 (server to client) -00000000 17 03 03 02 da ad f0 96 2c a1 08 c0 c7 aa 43 b8 |........,.....C.| -00000010 23 65 61 d2 4b 56 54 a2 0c d4 31 12 5d 19 ac 38 |#ea.KVT...1.]..8| -00000020 b3 bd 72 1f e4 40 39 5d a5 95 85 93 ff 53 63 0a |..r..@9].....Sc.| -00000030 df 7f 79 39 07 75 c2 18 ef 4e 20 6b d6 81 6c 91 |..y9.u...N k..l.| -00000040 63 9a d8 45 99 2c ed e7 19 8e 4b 2d 06 c9 60 7e |c..E.,....K-..`~| -00000050 3b e7 68 bd 35 13 bb be 57 4a 43 01 74 3c 92 b6 |;.h.5...WJC.t<..| -00000060 f9 c3 6d 0f 26 80 3f 3d 5b 86 10 27 d8 51 71 d1 |..m.&.?=[..'.Qq.| -00000070 ad 5d d4 3d 8c 66 e7 db 9d 6f fe e2 f2 4e 56 7a |.].=.f...o...NVz| -00000080 76 02 94 d9 95 0f 64 8e 6b 89 b0 8c 82 c3 eb 22 |v.....d.k......"| -00000090 1d 15 64 5a e7 3c bd 3d 64 0b 44 3c 6e 13 79 27 |..dZ.<.=d.D.b./?...`.5| -000000c0 f6 8e 2e 7d ec 17 32 f6 f4 99 b5 8c 6d b2 e6 ba |...}..2.....m...| -000000d0 29 1a 85 c0 1c ea 8c 2d f2 b3 14 53 13 5d e9 2d |)......-...S.].-| -000000e0 db d5 7f 41 89 86 a6 88 e5 56 82 ba 6d 67 6a 33 |...A.....V..mgj3| -000000f0 02 f6 b9 6c 5b 89 02 4e 5e df d1 c4 46 61 69 08 |...l[..N^...Fai.| -00000100 18 91 6b 98 d1 97 bd 6c d4 71 d9 91 c6 9c d6 58 |..k....l.q.....X| -00000110 51 4a 34 72 34 be 59 50 4d 49 0c 60 d2 c1 bd d6 |QJ4r4.YPMI.`....| -00000120 54 5d 8e 3f db ec b1 9a f8 84 ce 69 ef 58 f0 63 |T].?.......i.X.c| -00000130 17 2b fe 30 df 57 e4 c1 42 1f 1f 49 8d a1 9d d7 |.+.0.W..B..I....| -00000140 82 b9 c8 36 59 4e f9 31 2b 3e 49 17 5d ac 30 9e |...6YN.1+>I.].0.| -00000150 1d a4 04 84 1b 88 51 47 4e a1 b6 5a 12 72 8f 1a |......QGN..Z.r..| -00000160 22 96 1c 7c a7 11 33 4c 40 33 03 cd ba fb 2d 4e |"..|..3L@3....-N| -00000170 8d d4 20 bd c8 d8 32 ab 81 fd c1 a5 a6 9e bf 4a |.. ...2........J| -00000180 26 69 be d8 62 b2 12 a8 4a 1b 44 42 20 1e fc 7d |&i..b...J.DB ..}| -00000190 de f1 3f f6 0e cb 3d 2a 2e d7 91 9a 74 d7 c9 24 |..?...=*....t..$| -000001a0 35 9e c9 78 d4 b0 d0 9d 43 60 45 e3 9b 91 5a a5 |5..x....C`E...Z.| -000001b0 47 cc 4e 1f 4b e6 ce 9a b3 ae 3f bd ca 2b 79 cd |G.N.K.....?..+y.| -000001c0 e1 e7 10 bb 80 fc f2 93 7c d5 b5 5b e0 51 88 94 |........|..[.Q..| -000001d0 53 4f 99 a6 f0 29 fa 11 56 3b 01 12 6b b1 24 5a |SO...)..V;..k.$Z| -000001e0 08 19 1f ed f1 c6 3a 09 ad bf d6 e3 37 17 1a e0 |......:.....7...| -000001f0 00 8a de 74 ad 3e 2f 99 e7 f4 3f fe 6d 9a a4 5a |...t.>/...?.m..Z| -00000200 de 5b 8a 17 86 60 0f 91 43 77 b7 34 9a f1 fb d0 |.[...`..Cw.4....| -00000210 34 df 0d 08 47 5a 47 f1 e4 43 86 d8 1e dd c0 7e |4...GZG..C.....~| -00000220 63 13 8f f3 01 a1 e1 70 d7 1b 9a 2b 82 3d c4 87 |c......p...+.=..| -00000230 af 6c 9d d2 bb f2 cd da 8e c6 e3 5b 19 ae 31 75 |.l.........[..1u| -00000240 1c b5 01 51 c9 38 1c 29 ca f5 8a a5 51 14 a4 e4 |...Q.8.)....Q...| -00000250 fe 46 86 47 c4 a1 7c 56 a0 e2 6e 50 f5 7a 15 1a |.F.G..|V..nP.z..| -00000260 6d 9f 6c 43 24 ce 9e 1e b2 8a f9 da 2e d3 6a 81 |m.lC$.........j.| -00000270 5d 14 97 75 44 f1 ba 81 55 0a 38 64 1f 40 7b 4a |]..uD...U.8d.@{J| -00000280 23 47 13 7e cd f7 6d 67 45 7f c7 4d 42 59 ad 42 |#G.~..mgE..MBY.B| -00000290 e1 67 53 25 dc e1 8e 56 f4 cc 14 00 9b d0 e2 d5 |.gS%...V........| -000002a0 b9 bf fa de 74 39 60 4f 24 7c 51 5e a0 34 05 53 |....t9`O$|Q^.4.S| -000002b0 23 01 b9 50 f4 f7 39 c2 f3 e1 62 5d d3 2a 43 98 |#..P..9...b].*C.| -000002c0 32 3e 3d 40 39 32 8b 6f db 77 53 ec ac 1e a3 95 |2>=@92.o.wS.....| -000002d0 24 b5 88 f8 62 e9 f7 a5 a3 20 8a be 02 8a 58 17 |$...b.... ....X.| -000002e0 03 03 02 da 51 d2 ea aa e4 a6 65 20 5c c2 70 aa |....Q.....e \.p.| -000002f0 75 4e c1 40 69 7b 49 d7 25 65 a0 97 1e 69 5d d6 |uN.@i{I.%e...i].| -00000300 99 cf 32 fc 4c 3d 6b 6d b9 e5 db 20 ed 00 00 93 |..2.L=km... ....| -00000310 6d 6a 24 8a 2f 85 49 5b 2d 18 a8 08 ac a2 b2 4f |mj$./.I[-......O| -00000320 c5 52 4a 2f 94 7b d5 c4 87 21 0f 60 c6 c9 fd 06 |.RJ/.{...!.`....| -00000330 69 66 b8 8d 43 83 be 4e 64 23 e9 d8 01 02 af af |if..C..Nd#......| -00000340 cf 1d 8b 7d e7 38 c8 31 30 f7 e8 9f 17 46 35 9b |...}.8.10....F5.| -00000350 72 ba 65 6d 18 bd 0e b7 5e ec 3f c5 f5 f1 c0 dd |r.em....^.?.....| -00000360 a1 3d 1c 41 ca eb 0a 7e f9 ab a1 2e 32 be 60 79 |.=.A...~....2.`y| -00000370 0f 28 1d fa 4a 62 ff 4f 0b ba 84 a1 63 fa 4a 07 |.(..Jb.O....c.J.| -00000380 02 d4 7c bf 42 90 1b 38 cc 21 71 1e 70 f7 65 a3 |..|.B..8.!q.p.e.| -00000390 b5 a7 1e 54 47 ec 7f 65 8e 8f 3c 95 dc ee af 21 |...TG..e..<....!| -000003a0 52 7a 05 a6 51 5e 1c aa cd 5d 45 2f 11 31 2f 9a |Rz..Q^...]E/.1/.| -000003b0 cb e6 92 cd 21 b4 18 c1 12 bc 3c 9e d7 3b 3f 42 |....!.....<..;?B| -000003c0 b6 df b4 4e cc af 22 9e c3 5d 2d 2c 75 b6 0b 00 |...N.."..]-,u...| -000003d0 3d cf bb 3b 2a 14 70 49 f2 e7 c2 07 be 16 ca 83 |=..;*.pI........| -000003e0 b1 27 da 78 8b f0 b6 ef 2a e0 8f cb 50 f5 89 47 |.'.x....*...P..G| -000003f0 30 f6 84 57 21 de 33 e7 fb 58 26 6a 3f 3b 72 2b |0..W!.3..X&j?;r+| -00000400 23 a4 09 41 41 a8 86 bd c9 af 78 53 23 94 e6 6c |#..AA.....xS#..l| -00000410 87 1c f8 e9 96 b0 0e 37 b8 13 96 12 05 60 97 9e |.......7.....`..| -00000420 c7 d2 a3 33 4b 68 49 d4 b7 99 3c 94 c9 57 72 de |...3KhI...<..Wr.| -00000430 5a ff 9d ef 55 7b b9 35 e3 e1 13 ad 53 90 6e cf |Z...U{.5....S.n.| -00000440 2f 82 79 dd 95 ce b3 4d 5b c9 b3 3e 5e af 75 85 |/.y....M[..>^.u.| -00000450 9b c0 58 96 40 f9 28 04 0b 28 64 c4 9d f4 fa 9c |..X.@.(..(d.....| -00000460 ea 59 1a c2 db 98 13 8d 5f 8b f5 32 2d ab a6 70 |.Y......_..2-..p| -00000470 36 0d c8 f6 98 84 88 e8 31 23 c5 18 29 59 1a 5a |6.......1#..)Y.Z| -00000480 14 d3 fc 69 47 95 6d f9 a8 51 12 4a 91 9c 19 23 |...iG.m..Q.J...#| -00000490 64 1b 96 5c a3 45 c4 ef 58 22 9c e2 08 46 fd 23 |d..\.E..X"...F.#| -000004a0 3d fd e6 a2 5e 42 90 ac a0 ad 8f 27 2f 8a e8 97 |=...^B.....'/...| -000004b0 fa b9 72 a1 28 9a 71 87 68 9a ae 73 bb bc b3 6f |..r.(.q.h..s...o| -000004c0 cb c4 48 0c a8 50 b5 2d ad f0 ca 1e d6 0f 7e 9a |..H..P.-......~.| -000004d0 56 ad 3e 98 43 f4 7e 56 57 7f 79 6e 9a 99 15 62 |V.>.C.~VW.yn...b| -000004e0 98 a6 78 2e ce 18 3c 21 a5 66 7b c5 3c a1 48 49 |..x...b..P....N.}:d.| -000005a0 71 5c 16 4a d0 66 bc 0b cc b6 ba bd 53 ff b7 f5 |q\.J.f......S...| -000005b0 05 c6 e1 31 0b 18 69 74 e5 63 95 7d 34 cd |...1..it.c.}4.| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 8e f7 f6 9b 86 95 cc d0 fb 93 36 |...............6| -00000010 11 5a a4 7d 85 aa c7 c6 |.Z.}....| +00000000 14 03 03 00 01 01 17 03 03 02 11 7e e6 cb d5 bf |...........~....| +00000010 e1 5f 0a a5 6f 08 47 a4 27 a0 a0 2d 8e 6b 56 c6 |._..o.G.'..-.kV.| +00000020 2e d4 7d 3d 83 f0 25 31 59 9d e5 61 a0 95 21 2e |..}=..%1Y..a..!.| +00000030 f8 39 8c 16 4b 6e d9 e0 19 23 05 b0 6c 89 2c f2 |.9..Kn...#..l.,.| +00000040 e2 60 fb 83 99 2b 33 37 38 b0 85 67 cf 91 5f 22 |.`...+378..g.._"| +00000050 32 8b 10 f6 0b 2b 0d 4a 18 32 e7 41 fc 07 58 54 |2....+.J.2.A..XT| +00000060 d1 e2 6e da bb f7 4a 45 60 34 02 01 95 5e b3 4f |..n...JE`4...^.O| +00000070 0a df 33 d6 07 06 fc 20 5a 97 2f b8 bf 66 23 40 |..3.... Z./..f#@| +00000080 32 24 0d f5 c8 a2 aa e4 6a 85 21 d5 a3 95 a8 3b |2$......j.!....;| +00000090 8f 6a 43 5c 96 64 80 ef 04 ed a4 10 2f e4 a8 8d |.jC\.d....../...| +000000a0 ff fb 77 53 28 30 cd ca df 8e 25 08 51 ee 56 b8 |..wS(0....%.Q.V.| +000000b0 3a ae 2f 27 a4 4a 71 9e 77 cc 70 af 62 d1 a7 2f |:./'.Jq.w.p.b../| +000000c0 2b 2f 98 2f e5 62 b5 3b 65 b6 2e a5 a5 19 1f c2 |+/./.b.;e.......| +000000d0 a9 ef d8 2a 95 25 fc 10 32 31 da 29 bf 7e 58 d0 |...*.%..21.).~X.| +000000e0 b5 2f 62 bf ed 57 c8 b4 55 85 29 66 07 52 6f 25 |./b..W..U.)f.Ro%| +000000f0 02 2b 98 22 a5 e8 41 50 de f5 e3 e9 ce 60 f2 af |.+."..AP.....`..| +00000100 b3 c8 80 f1 27 2a 04 7a 1f 3b 13 0f 76 ec 6a 74 |....'*.z.;..v.jt| +00000110 ad a9 8f e9 0d 67 9d 1c a3 54 b3 14 a0 5c 36 80 |.....g...T...\6.| +00000120 a7 be 7f 2b d1 89 c0 19 3f 25 c6 7a fd 04 44 c2 |...+....?%.z..D.| +00000130 18 75 a9 44 7b cc 20 2b f3 6a 9a e1 cc 4f aa 76 |.u.D{. +.j...O.v| +00000140 e2 0a 45 75 81 0d d7 72 a1 e7 b2 82 02 77 45 e9 |..Eu...r.....wE.| +00000150 f8 07 93 8b e5 79 c2 06 65 52 a5 0e 13 73 a7 f6 |.....y..eR...s..| +00000160 be 85 5c 00 af 90 ed 83 3f b4 53 68 cf 0b b9 a6 |..\.....?.Sh....| +00000170 06 43 3c 7a 15 6a b1 74 be af 70 3b fa 70 f3 4b |.C....{E.R$| +00000310 17 03 03 00 13 3b 43 97 33 75 c2 b6 9a f7 cd 96 |.....;C.3u......| +00000320 e3 67 b7 2d cf ac d8 0a |.g.-....| diff --git a/src/crypto/tls/testdata/Client-TLSv13-ECDSA b/src/crypto/tls/testdata/Client-TLSv13-ECDSA index 55b8cc5263256..96c8e8c1ee545 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-ECDSA +++ b/src/crypto/tls/testdata/Client-TLSv13-ECDSA @@ -16,101 +16,71 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 48 a3 75 25 ac |....z...v..H.u%.| -00000010 19 49 b6 e7 5a 9a c2 15 3e e3 a6 21 c0 f5 09 40 |.I..Z...>..!...@| -00000020 b7 ad fc 0c 39 1b 3c 44 36 13 9e 20 00 00 00 00 |....9.W@ ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 20 |..+.....3.$... | -00000060 db 3f 51 79 d2 24 e1 e1 a4 b6 f8 84 2d 25 27 ca |.?Qy.$......-%'.| -00000070 9a d2 5e cc 28 ac 5e 74 2a ea 1b 56 28 24 76 14 |..^.(.^t*..V($v.| -00000080 03 03 00 01 01 17 03 03 00 17 bc dd d4 00 24 28 |..............$(| -00000090 82 e2 0a 74 8f a6 06 9b 14 2d ca c1 90 6c 1c 8f |...t.....-...l..| -000000a0 7f 17 03 03 02 22 f9 8f 72 d6 f1 34 fa 90 0e 42 |....."..r..4...B| -000000b0 2d 2e a0 1d 9e 1f ce ee 79 af b6 b3 bd c2 6b 8f |-.......y.....k.| -000000c0 62 4c 5d 1c 1e 47 a7 77 97 ca 04 c5 16 f8 58 3a |bL]..G.w......X:| -000000d0 b7 33 15 bc 5f f0 13 7f 02 4d f2 80 95 84 6f 41 |.3.._....M....oA| -000000e0 df 03 c8 64 23 91 e5 8c e9 01 45 fe 8e 37 27 e0 |...d#.....E..7'.| -000000f0 47 83 43 a2 0f ef 3d eb 11 fb ba 52 2f 8e 43 97 |G.C...=....R/.C.| -00000100 1b fe 49 28 e7 ce 73 c4 3e 9d 18 9d 34 a4 b4 5e |..I(..s.>...4..^| -00000110 ee ec bf e3 75 fc 00 be b7 0e 80 f8 a2 db 90 a9 |....u...........| -00000120 62 74 35 c6 8e 36 55 68 4e 6c 94 b6 61 d7 d0 34 |bt5..6UhNl..a..4| -00000130 e8 83 ae c3 75 2d eb 35 95 d3 5f 28 3e 05 f3 ea |....u-.5.._(>...| -00000140 18 76 6b 6d b9 98 c0 d5 ea 6d 62 9b 15 d8 be 55 |.vkm.....mb....U| -00000150 8c f5 5a 3d 14 81 82 cc 8c 6c 34 2f e8 50 87 ef |..Z=.....l4/.P..| -00000160 c6 fe 92 39 e0 f4 6d ca d1 97 c9 df 81 6d dc 3f |...9..m......m.?| -00000170 6f 60 58 30 e1 c7 87 d0 fb 40 f6 ce 44 96 e9 19 |o`X0.....@..D...| -00000180 21 d3 3a 56 fd c1 60 22 96 f7 d9 07 30 15 40 f9 |!.:V..`"....0.@.| -00000190 b3 0c 9c cf f7 38 94 43 41 8a 76 92 4a 71 55 22 |.....8.CA.v.JqU"| -000001a0 8d ce 03 ed 97 98 54 0e 94 8c b7 a4 ee ce d6 60 |......T........`| -000001b0 5d a2 4e 9f ff e6 90 23 69 b1 a2 0e c5 e7 5b 58 |].N....#i.....[X| -000001c0 7b d1 13 ba f2 d3 ff 6a 48 ff 77 2d 61 05 4b 15 |{......jH.w-a.K.| -000001d0 cc 6f 52 4a 69 1c e2 38 b3 2a 96 ff 10 bb 55 02 |.oRJi..8.*....U.| -000001e0 50 e9 f2 09 92 66 cc 43 ea f4 4e ad aa 18 fc 9b |P....f.C..N.....| -000001f0 05 52 3b f1 44 3b 6e 25 47 cd 20 4d 69 86 8b 64 |.R;.D;n%G. Mi..d| -00000200 61 31 0a 03 92 0e 21 9d 67 d5 af 00 de 88 a4 f5 |a1....!.g.......| -00000210 3d 3e 45 0f f4 02 15 ae bf 45 76 80 0d 8d 7a 04 |=>E......Ev...z.| -00000220 58 d7 e5 5a 81 41 a9 04 7e aa 67 af 27 92 cf 51 |X..Z.A..~.g.'..Q| -00000230 13 c4 e6 84 2e 28 dc 53 c8 73 11 f9 f7 d9 28 ac |.....(.S.s....(.| -00000240 a6 00 af cb 38 bc f2 b7 1c 6d e8 21 f0 6e e5 35 |....8....m.!.n.5| -00000250 12 c0 a9 57 2f 87 39 bc a6 7a ab ab 04 02 48 e8 |...W/.9..z....H.| -00000260 13 a3 20 a4 c9 09 64 b2 2a 66 39 91 d7 3a 7a 41 |.. ...d.*f9..:zA| -00000270 1c a4 15 4e 84 d3 72 66 31 3a ba 7a b8 18 ee 0c |...N..rf1:.z....| -00000280 e2 17 1a 8f f7 af 38 49 e3 4d d7 ed be 7a 1e bd |......8I.M...z..| -00000290 ae 70 c1 fc 6a 09 05 29 bb fc 78 5b 8f a4 f7 81 |.p..j..)..x[....| -000002a0 34 fd ad 9b 22 87 67 15 0f ee d4 99 90 e7 af 4b |4...".g........K| -000002b0 14 bd af f3 ab 04 e0 d1 58 f5 34 b2 e1 ee 65 92 |........X.4...e.| -000002c0 80 05 68 c3 b2 6a bc 6d 17 03 03 00 a4 f4 d6 df |..h..j.m........| -000002d0 b6 61 6a c2 6c a6 25 f9 b2 95 8f 73 10 05 e2 63 |.aj.l.%....s...c| -000002e0 37 22 63 bd 50 af 18 0c 71 17 61 40 c9 a1 b1 6d |7"c.P...q.a@...m| -000002f0 d7 a6 2f c6 c2 46 9d 40 06 e3 30 04 e1 d9 97 c1 |../..F.@..0.....| -00000300 a8 6c ce 97 47 4e 9e 54 bc 8e 2c 77 e8 21 c3 0b |.l..GN.T..,w.!..| -00000310 8f 51 0c c2 8f 0d 64 b9 79 26 c0 33 07 e0 df 08 |.Q....d.y&.3....| -00000320 50 98 26 b1 2b 69 6a 5d b4 9c b7 4e 20 97 cc d9 |P.&.+ij]...N ...| -00000330 43 94 9f 4d 2b d1 72 24 a7 a8 3e 7d 9e 84 7a 98 |C..M+.r$..>}..z.| -00000340 23 64 7b b9 17 15 d6 27 80 6c 60 2d 38 c7 4d cd |#d{....'.l`-8.M.| -00000350 9a 87 d6 ab 31 8d 59 62 58 b4 11 f4 2e d5 81 10 |....1.YbX.......| -00000360 87 e5 58 3e 37 99 37 af 68 6f 11 cc 0b a2 f1 d1 |..X>7.7.ho......| -00000370 b0 17 03 03 00 35 be f6 19 d0 66 ec cd 14 d5 28 |.....5....f....(| -00000380 b8 bf 0d f4 37 5d 55 3d 2e 2c 1e 0c 62 0a 49 3e |....7]U=.,..b.I>| -00000390 df cf c2 dc 2c 27 df 54 64 67 8d 33 8b f0 b1 50 |....,'.Tdg.3...P| -000003a0 c5 dd fc 47 5c e7 58 5b 74 57 4b |...G\.X[tWK| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 16 |..+.....3.$... .| +00000060 4c 6f 4f d1 32 2e 2e b5 4c 48 29 0f cb 65 23 b2 |LoO.2...LH)..e#.| +00000070 ab 2e 41 d8 c4 70 30 88 4f a1 d9 bb 52 e8 35 14 |..A..p0.O...R.5.| +00000080 03 03 00 01 01 17 03 03 00 17 a7 86 3a 06 dc db |............:...| +00000090 c6 bc d5 8e 55 0f 93 b5 fc f4 d4 17 40 dc 3e d7 |....U.......@.>.| +000000a0 16 17 03 03 02 22 b3 07 3f ab 52 ac c4 0d 50 75 |....."..?.R...Pu| +000000b0 18 37 a5 f5 4b ba e7 e7 c0 30 3c b4 3f e4 11 2d |.7..K....0<.?..-| +000000c0 d1 33 07 a7 9d 41 47 61 40 ec db bb dd 7c 89 7b |.3...AGa@....|.{| +000000d0 e4 3e db 5a 30 c6 a3 74 7c 7a b1 53 d2 0a 48 65 |.>.Z0..t|z.S..He| +000000e0 2c f6 d9 ca b4 f4 88 d2 d8 7e a6 ce b0 30 c6 32 |,........~...0.2| +000000f0 36 fa 73 b2 0e 39 8e d5 af 41 ab 88 8c 3d d1 56 |6.s..9...A...=.V| +00000100 2e 7b 7d 93 77 c6 51 66 d6 ed 20 52 a9 b1 98 ae |.{}.w.Qf.. R....| +00000110 c9 04 a5 1a 97 36 91 b9 38 39 7c 7c 8c bb 0f 37 |.....6..89||...7| +00000120 e2 37 9c c0 49 fb a7 59 7d f2 0f 97 ee 15 9c e9 |.7..I..Y}.......| +00000130 5a 9b 6d fd 7e 36 61 fb 30 69 ea 2f e8 37 70 b0 |Z.m.~6a.0i./.7p.| +00000140 b5 65 1c 05 25 7a 32 36 6e 24 c9 e2 ca 6c c2 82 |.e..%z26n$...l..| +00000150 d0 5b 1f 85 ba 1b f0 b2 49 71 2a bd 8d ae 16 95 |.[......Iq*.....| +00000160 2c b9 ab ce f1 05 47 59 e5 65 02 57 34 85 df 26 |,.....GY.e.W4..&| +00000170 cf 97 94 29 09 4d aa a6 dd 18 ef 9d 15 38 10 90 |...).M.......8..| +00000180 ea a3 76 b7 25 c8 9c cd b6 1e 88 a6 4e b8 b1 34 |..v.%.......N..4| +00000190 70 1f 7b a1 83 e2 2e 3f d8 e8 f2 2e 74 f1 93 bc |p.{....?....t...| +000001a0 ee 80 8a c3 d0 e0 d2 7a 16 5a 97 a5 57 1c c6 37 |.......z.Z..W..7| +000001b0 ba 8a cd 07 8f ca 93 3a d7 57 82 be 69 1d 83 5e |.......:.W..i..^| +000001c0 62 0e 65 f3 7f 3b 28 8f 51 f0 96 da 55 4c f5 55 |b.e..;(.Q...UL.U| +000001d0 60 59 7c c4 61 1f 1d 50 38 09 e0 7b 90 ed b9 35 |`Y|.a..P8..{...5| +000001e0 4d 70 37 f8 c8 59 09 9e 77 02 27 cc 5a cc 7c 8d |Mp7..Y..w.'.Z.|.| +000001f0 a8 cc 83 9d 3d dc e1 85 89 98 65 e9 aa 16 f9 e9 |....=.....e.....| +00000200 85 f9 ec 6d 28 8d 20 4b 33 01 2f df fb 7d 6c 6e |...m(. K3./..}ln| +00000210 b8 28 d4 2e 72 1d af 66 15 1a ff ba bc 68 31 cb |.(..r..f.....h1.| +00000220 3e c8 62 d3 3e fd e8 ce 90 bc 30 36 31 e2 6d 47 |>.b.>.....061.mG| +00000230 06 d4 df ad e8 51 3d 61 b7 8f b6 16 d5 e1 81 ff |.....Q=a........| +00000240 c7 ad 99 04 e1 af d0 a8 37 5e 57 44 93 7b e0 6d |........7^WD.{.m| +00000250 c2 23 f2 b7 7d 14 41 c6 ab 17 c8 3b de 48 20 73 |.#..}.A....;.H s| +00000260 78 78 78 4a c4 1f ea 55 11 6e dc 55 48 5d 9b f1 |xxxJ...U.n.UH]..| +00000270 33 84 17 35 cc b9 8d d4 6e 86 87 f1 c3 ab 31 46 |3..5....n.....1F| +00000280 79 39 5f 41 19 40 7b 54 44 79 21 25 06 a1 ca 36 |y9_A.@{TDy!%...6| +00000290 e0 9f d6 70 7c 3f 9f 5c 17 29 cc a3 ed a2 cd 6f |...p|?.\.).....o| +000002a0 12 19 d9 89 aa a1 fa 51 53 98 9f 34 d2 75 12 22 |.......QS..4.u."| +000002b0 ea 63 85 3c 32 c8 cb e2 74 15 13 55 61 a1 80 1f |.c.<2...t..Ua...| +000002c0 85 5e 45 95 9c 92 4a 8d 17 03 03 00 a4 e8 50 d5 |.^E...J.......P.| +000002d0 71 f4 21 a6 79 63 11 6a 8e 5e 3e 5d 96 63 4e 42 |q.!.yc.j.^>].cNB| +000002e0 08 27 34 b7 4c 36 8a fe b1 ed f2 f1 3c 72 00 99 |.'4.L6.......D..h.S.qA| +000003a0 61 17 e3 da 92 ff 5a 8f 21 06 f5 |a.....Z.!..| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 2d 01 39 11 82 |..........5-.9..| -00000010 67 c7 e5 db 3f dd 18 c3 0b 0a 25 8a 24 2e e1 f4 |g...?.....%.$...| -00000020 5e a2 0f 8a 1c 70 83 26 d0 5d b1 8d cf c6 69 a9 |^....p.&.]....i.| -00000030 38 8c 14 22 74 4a 85 fe f5 86 e6 c2 07 44 bf 87 |8.."tJ.......D..| -00000040 17 03 03 00 17 a8 2f 45 46 d9 59 7e 5f 4c 9e 46 |....../EF.Y~_L.F| -00000050 09 e4 38 e1 e3 e3 5e ab 62 14 eb 2f |..8...^.b../| ->>> Flow 4 (server to client) -00000000 17 03 03 00 da 41 7f 38 18 5c d5 fc c7 ba 60 66 |.....A.8.\....`f| -00000010 d6 92 60 81 83 bc f3 35 ff 00 ef 4b 99 48 de 1c |..`....5...K.H..| -00000020 aa 1c f8 80 6d 59 48 30 83 03 ad fd e3 15 23 16 |....mYH0......#.| -00000030 aa c8 d7 71 58 df 65 fc 8c d3 77 56 f4 19 f2 5e |...qX.e...wV...^| -00000040 c2 d5 15 1b b7 9a 46 68 81 68 c6 2b be 81 f2 f5 |......Fh.h.+....| -00000050 5a 71 81 55 10 0f 09 9a 9a 9e c4 be 28 db fa 50 |Zq.U........(..P| -00000060 f6 fa 88 5b c6 63 35 77 8c d0 1b 4a 50 b8 42 6d |...[.c5w...JP.Bm| -00000070 5d f5 b7 5a 5e 73 0f 12 ba 86 92 44 23 bc 70 e1 |]..Z^s.....D#.p.| -00000080 3d f4 1b 20 87 e6 c2 89 43 2a 76 7f e3 8f 2c db |=.. ....C*v...,.| -00000090 86 31 4a 38 5b 5e 44 3e 6c 72 be 13 a5 77 d2 90 |.1J8[^D>lr...w..| -000000a0 95 80 35 c6 c9 1b 0e ea b8 0a 18 65 78 23 e4 0e |..5........ex#..| -000000b0 bc 67 86 5b 6a 77 32 66 f3 38 89 01 86 d3 c2 3e |.g.[jw2f.8.....>| -000000c0 93 70 57 11 07 1a be 26 3c 69 f8 8b 3b c3 4a 1c |.pW....&>> Flow 5 (client to server) -00000000 17 03 03 00 13 d2 5d 20 07 4c 51 50 40 86 e8 36 |......] .LQP@..6| -00000010 59 ba c4 f6 13 ab 29 1f |Y.....).| +00000000 14 03 03 00 01 01 17 03 03 00 35 a3 d4 49 e5 82 |..........5..I..| +00000010 8d 09 1b 33 8a 0d 9b 4f 8d a8 95 66 0e 50 e0 85 |...3...O...f.P..| +00000020 a7 0d f2 09 f6 05 44 f5 59 c3 48 92 9d 80 a7 db |......D.Y.H.....| +00000030 d0 18 7e 7b 5c fa 31 bf c5 94 71 60 cf 0c d1 c7 |..~{\.1...q`....| +00000040 17 03 03 00 17 f7 61 d6 c4 fa 7f 34 e7 cf cb b0 |......a....4....| +00000050 9f 5d 13 25 8c 75 6c 1a 87 91 44 84 17 03 03 00 |.].%.ul...D.....| +00000060 13 89 68 71 8d be 27 8e 31 f5 ca 7a 4e c5 b6 38 |..hq..'.1..zN..8| +00000070 b2 68 b8 0d |.h..| diff --git a/src/crypto/tls/testdata/Client-TLSv13-ExportKeyingMaterial b/src/crypto/tls/testdata/Client-TLSv13-ExportKeyingMaterial index 2045af72f4a50..a30a26249b7b8 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-ExportKeyingMaterial +++ b/src/crypto/tls/testdata/Client-TLSv13-ExportKeyingMaterial @@ -16,107 +16,75 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 da 33 a6 d1 76 |....z...v...3..v| -00000010 5f 72 df d4 59 9b 94 e8 e3 04 a6 c3 f0 58 4d 44 |_r..Y........XMD| -00000020 08 e8 1e 41 c0 25 4c 0c de c0 36 20 00 00 00 00 |...A.%L...6 ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 fe a9 2f 00 0c |....z...v..../..| +00000010 0b 91 a0 86 1d 9b 21 19 35 a1 07 9e 36 1d d2 82 |......!.5...6...| +00000020 51 b7 d2 3e a6 42 ce 6f 86 e9 69 20 00 00 00 00 |Q..>.B.o..i ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 44 |..+.....3.$... D| -00000060 7f a7 d1 f1 38 fa c2 00 dd 48 44 20 b9 32 0b 16 |....8....HD .2..| -00000070 d4 a6 72 da cb c9 23 52 c9 fb b9 b5 2d a0 62 14 |..r...#R....-.b.| -00000080 03 03 00 01 01 17 03 03 00 17 d5 8b b4 47 9e 59 |.............G.Y| -00000090 ff 8b 7e bd 0b 61 97 62 14 78 56 85 a4 45 37 0a |..~..a.b.xV..E7.| -000000a0 fa 17 03 03 02 6d 2d e1 4d 15 4f 8b 0a 55 f4 ed |.....m-.M.O..U..| -000000b0 eb a8 ba e3 ba 65 b2 94 ed ca 94 18 cb e9 31 86 |.....e........1.| -000000c0 38 0a 61 78 e6 19 38 28 7c e6 8e a3 d2 01 4f 16 |8.ax..8(|.....O.| -000000d0 90 ce a9 db 64 e8 ec a1 97 01 04 4a ce dd f2 0f |....d......J....| -000000e0 f8 1c 25 4d 28 d5 07 33 f9 fd c4 f3 f9 26 15 2f |..%M(..3.....&./| -000000f0 66 ef f0 82 49 1b 3d a0 99 ee 27 61 d3 0f 9c d5 |f...I.=...'a....| -00000100 85 3b 49 54 5d 58 7b 0c e2 97 e5 ac b1 10 d5 73 |.;IT]X{........s| -00000110 f8 18 57 2d 7a e2 15 7f a0 e2 07 c1 7a 16 d0 05 |..W-z.......z...| -00000120 df 2e 29 fc c4 59 2a 7c 63 2e 7e e2 b8 75 92 35 |..)..Y*|c.~..u.5| -00000130 f6 92 e4 1e e4 43 dc 25 64 e0 32 9f fe 0a 76 d7 |.....C.%d.2...v.| -00000140 ee 08 f0 e3 e9 02 bc 93 d8 db d2 11 28 df b1 05 |............(...| -00000150 fa fe 70 ef 73 e7 ca f1 a1 e1 95 a1 c6 05 30 0c |..p.s.........0.| -00000160 23 5c 5f d0 77 f0 7e 85 cc 2d 0b 88 41 7a 95 11 |#\_.w.~..-..Az..| -00000170 6b 87 df 6e 5b 4a e4 7a 7a bf 42 f6 d1 fa 8e e5 |k..n[J.zz.B.....| -00000180 96 5f 3b 2e 02 ba c9 f8 40 77 9c ed 81 82 29 2b |._;.....@w....)+| -00000190 8f 97 5e 97 de ff 5f 30 c1 06 66 c7 b4 33 b9 eb |..^..._0..f..3..| -000001a0 ca ee ff 42 db 8e 9c 18 0c 19 0a a4 d0 b7 e2 74 |...B...........t| -000001b0 be d1 6f 79 ea a0 32 44 50 16 86 41 2d d8 4f 5c |..oy..2DP..A-.O\| -000001c0 c1 16 b2 6c a6 5a 49 e9 a1 ff 79 9c b1 23 41 eb |...l.ZI...y..#A.| -000001d0 35 1a a8 f2 21 ff f5 54 a2 92 26 61 f6 53 2c e8 |5...!..T..&a.S,.| -000001e0 c9 4d 1e 42 2b bd de c0 78 f5 9f d0 b4 1e 30 e9 |.M.B+...x.....0.| -000001f0 0a e0 71 50 f6 72 c2 15 1f 93 72 15 c9 3e bc ab |..qP.r....r..>..| -00000200 96 04 e3 5c 4a ee 6f 64 87 b1 ec d4 ca 76 ab 4e |...\J.od.....v.N| -00000210 cf 6e 32 7a 39 15 66 3e e0 67 10 9c 3c 59 d1 31 |.n2z9.f>.g...g| +000003a0 97 23 3f 86 f2 38 b5 a7 df 98 68 57 89 a3 e4 86 |.#?..8....hW....| +000003b0 d7 17 03 03 00 35 4a d4 e1 fb d1 39 57 90 d1 19 |.....5J....9W...| +000003c0 b9 f2 1b 0b 1a 0d 8f fb 4b f3 f1 f8 31 d2 ac 3b |........K...1..;| +000003d0 25 ad e7 da 8a 78 ab 2a d6 97 9b 66 88 6a db ef |%....x.*...f.j..| +000003e0 bf b6 ed b9 8a 39 72 8c ea 8f 0d |.....9r....| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 c3 68 6c 59 46 |..........5.hlYF| -00000010 70 ff b5 04 41 bd c5 66 a4 da cd df 04 f8 7e f9 |p...A..f......~.| -00000020 a2 7b 0d f2 e6 cc 0c 30 df a9 66 4d 09 09 dc bf |.{.....0..fM....| -00000030 f4 5c 5e 30 5a 6d 2f bc 48 33 21 2b cb 6a ce f7 |.\^0Zm/.H3!+.j..| -00000040 17 03 03 00 17 9a d0 31 9a c5 c4 4b 59 e3 a4 74 |.......1...KY..t| -00000050 c5 d1 c5 09 a0 5e 08 48 fd 49 df 61 |.....^.H.I.a| ->>> Flow 4 (server to client) -00000000 17 03 03 00 ea c7 4f b3 d0 32 fa 3d 4e e8 58 ea |......O..2.=N.X.| -00000010 d1 8c 9a ed 6d bc 41 ae 22 58 d2 cb 9b 16 4f 45 |....m.A."X....OE| -00000020 91 86 8d 9f 9f 50 be 4d f7 11 c9 ea 20 57 29 f8 |.....P.M.... W).| -00000030 f3 78 8e e3 99 a1 8d 53 52 f0 1d 0a ef 64 cf 19 |.x.....SR....d..| -00000040 9f 6f b7 c3 11 27 07 d6 1a 61 39 75 26 9b 41 a1 |.o...'...a9u&.A.| -00000050 4d a2 a2 cd 59 c5 35 f3 58 ff 52 60 ba 04 54 3c |M...Y.5.X.R`..T<| -00000060 1b 2d 55 81 76 c9 59 af b8 5e 46 4d 09 58 6c 55 |.-U.v.Y..^FM.XlU| -00000070 66 1e d2 f5 7c bb 5e b0 e5 91 19 b0 be 32 04 46 |f...|.^......2.F| -00000080 20 10 f2 75 55 5e 30 96 9d da 37 07 dc df 1d 6f | ..uU^0...7....o| -00000090 c3 f1 d5 b6 db 85 d9 04 d4 13 5b ba 83 20 17 ae |..........[.. ..| -000000a0 68 05 71 d5 72 46 ba 23 ad ab 76 60 68 6a d7 12 |h.q.rF.#..v`hj..| -000000b0 91 55 07 bb b4 2b 40 9f d1 75 6c 36 28 89 89 3d |.U...+@..ul6(..=| -000000c0 9a 73 25 7a 7e 49 56 4c 92 32 74 ad 49 52 a1 09 |.s%z~IVL.2t.IR..| -000000d0 3f 02 62 fe a5 de 80 8c 93 01 de bd 59 5b 95 01 |?.b.........Y[..| -000000e0 f1 62 5f 22 f6 e3 e6 27 ed b7 4b 81 7f 13 13 17 |.b_"...'..K.....| -000000f0 03 03 00 ea 24 b0 f9 84 63 59 2b 30 09 4d 6e 44 |....$...cY+0.MnD| -00000100 13 db 38 db 42 9f 20 7f df f0 73 12 76 0d a5 57 |..8.B. ...s.v..W| -00000110 0c 36 21 7d f6 26 98 66 67 4f 07 8d b0 25 6b 7b |.6!}.&.fgO...%k{| -00000120 7c d7 c0 3d b0 33 8b 87 15 e6 23 6f b5 5a 77 98 ||..=.3....#o.Zw.| -00000130 d8 a7 d2 94 84 2a 7e 05 b2 ba 95 87 1d f5 44 54 |.....*~.......DT| -00000140 33 32 9f 8e df ff 91 77 21 fe db 6e f6 bd 9f 2b |32.....w!..n...+| -00000150 63 43 a9 c4 94 e8 b7 22 ed 6f 03 42 12 95 17 fb |cC.....".o.B....| -00000160 7f 83 ca 8e dd 29 08 52 40 fe 2a aa f1 f2 29 b8 |.....).R@.*...).| -00000170 5e e4 8f b7 67 a5 71 4d 4b 79 cf 5d 5d f2 72 44 |^...g.qMKy.]].rD| -00000180 c2 3e a2 54 18 fc 58 33 d6 4c 2c bd d9 52 08 1f |.>.T..X3.L,..R..| -00000190 3e c3 58 bf 86 80 ad cc 8f 55 a1 b0 fb 96 e6 94 |>.X......U......| -000001a0 43 be a6 14 b0 10 d4 27 38 93 b6 de 1d e1 3e e8 |C......'8.....>.| -000001b0 8a 06 3c 65 49 5a fb 70 4b f7 01 eb 2a ff b0 e0 |..>> Flow 5 (client to server) -00000000 17 03 03 00 13 4b 79 39 94 f7 13 0c 77 5a 78 47 |.....Ky9....wZxG| -00000010 fe e6 e8 41 96 49 84 53 |...A.I.S| +00000000 14 03 03 00 01 01 17 03 03 00 35 8c 85 73 71 98 |..........5..sq.| +00000010 40 37 77 e7 8c fd d1 f0 42 a8 97 f3 7c 68 f4 a7 |@7w.....B...|h..| +00000020 ac dc 7a ff 9b 2e f4 fe 2a c0 37 f9 56 a4 00 f5 |..z.....*.7.V...| +00000030 b1 40 34 53 89 48 9a a6 9d af a1 75 3f 34 53 fd |.@4S.H.....u?4S.| +00000040 17 03 03 00 17 92 cf 4a 20 2e 0c 2b 4a dc 86 2a |.......J ..+J..*| +00000050 75 cd 8f 73 b3 b3 4b 3b 3a e4 39 c3 17 03 03 00 |u..s..K;:.9.....| +00000060 13 83 08 42 b1 a8 95 2d a5 4c 8b e8 e8 35 d2 4c |...B...-.L...5.L| +00000070 23 8b 83 73 |#..s| diff --git a/src/crypto/tls/testdata/Client-TLSv13-HelloRetryRequest b/src/crypto/tls/testdata/Client-TLSv13-HelloRetryRequest index 8dac31adb6220..c06837e6da28e 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-HelloRetryRequest +++ b/src/crypto/tls/testdata/Client-TLSv13-HelloRetryRequest @@ -43,107 +43,76 @@ 00000100 f8 2b 2d 4f 9e f1 07 9f 6c 4b 5b 83 56 e2 32 42 |.+-O....lK[.V.2B| 00000110 e9 58 b6 d7 49 a6 b5 68 1a 41 03 56 6b dc 5a 89 |.X..I..h.A.Vk.Z.| >>> Flow 4 (server to client) -00000000 16 03 03 00 9b 02 00 00 97 03 03 40 bb fc 8b c3 |...........@....| -00000010 21 f3 14 d1 8d 63 52 bd 36 eb 78 47 3c 6e 8e 11 |!....cR.6.xG8.....| +00000020 34 04 33 99 7a 18 e2 2a cc d1 67 20 00 00 00 00 |4.3.z..*..g ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| 00000050 4f 00 2b 00 02 03 04 00 33 00 45 00 17 00 41 04 |O.+.....3.E...A.| -00000060 68 4b 33 bf 83 bd ff 25 68 0f b8 79 da c5 68 5e |hK3....%h..y..h^| -00000070 c7 ca 00 07 f1 79 17 22 41 c6 e0 24 c2 97 f7 07 |.....y."A..$....| -00000080 b5 f1 04 20 26 17 90 6b 31 3f 25 15 bc 3b 4f 59 |... &..k1?%..;OY| -00000090 54 b3 4f 75 4e 7a c0 2c 17 0f ea 2a 7e 5f 54 7f |T.OuNz.,...*~_T.| -000000a0 17 03 03 00 17 c3 10 7e 45 b9 96 05 4f a7 f1 bd |.......~E...O...| -000000b0 9f 79 b1 b5 88 e7 90 b1 44 b0 7d f6 17 03 03 02 |.y......D.}.....| -000000c0 6d c3 e9 2e 7e 18 e5 0b 51 bb eb 55 62 44 6e bd |m...~...Q..UbDn.| -000000d0 03 6c 85 0d f5 39 52 58 b4 6b 44 cc f6 f6 0d 7c |.l...9RX.kD....|| -000000e0 71 f1 0a 24 a7 c9 19 2a 87 92 5c f7 b9 af 4e 84 |q..$...*..\...N.| -000000f0 94 69 df 28 a1 a0 18 2e 56 a1 15 3e 41 e2 f8 0c |.i.(....V..>A...| -00000100 73 98 d5 3c 04 93 d1 80 b3 21 11 a4 93 f9 2e 01 |s..<.....!......| -00000110 bd d1 63 4b ed aa 31 3d 5d 9a ec 39 03 97 78 3c |..cK..1=]..9..x<| -00000120 a4 1c ee cd 72 10 a6 05 44 ff 43 09 66 b5 c4 f4 |....r...D.C.f...| -00000130 9e fb 36 5b 73 6b 13 55 9e d5 ce 20 77 72 19 1b |..6[sk.U... wr..| -00000140 20 ea db d0 0f a7 ae 06 7d 95 4d d5 71 74 64 63 | .......}.M.qtdc| -00000150 4d 88 6b f3 f8 d6 7d 56 97 b5 c4 4d a6 b7 86 a8 |M.k...}V...M....| -00000160 9c 4d fb 53 65 7b 4b 2d d4 49 4d 97 64 ca 39 d5 |.M.Se{K-.IM.d.9.| -00000170 cb c7 38 a6 5b 0d 65 f6 12 d9 a4 26 a4 dd aa 2d |..8.[.e....&...-| -00000180 af f9 d4 2e a2 3f 28 51 87 c2 a5 b2 59 b4 23 e9 |.....?(Q....Y.#.| -00000190 e5 e5 21 5e 90 29 1b 7c 21 3c 17 b5 96 71 4a d3 |..!^.).|!<...qJ.| -000001a0 e4 60 58 ea 03 1c d4 b1 4a da 19 9e 75 83 1f 82 |.`X.....J...u...| -000001b0 38 ea fe f4 3a db 36 0e 11 1d d6 09 76 52 cb 72 |8...:.6.....vR.r| -000001c0 9f 67 44 83 c0 57 c3 1e 86 bd 73 c5 68 1c 0a ac |.gD..W....s.h...| -000001d0 f4 70 08 2d 9f 96 70 ca 08 c7 12 6d 58 12 6e 02 |.p.-..p....mX.n.| -000001e0 7b 4f 1c 30 73 66 8c ce 05 35 ed 0f 19 41 88 c8 |{O.0sf...5...A..| -000001f0 5a ed f0 c1 ff dd f9 c7 b0 0c 82 16 98 98 ec 0e |Z...............| -00000200 59 e5 9f e0 b2 a2 8a 62 46 21 d1 5d f3 3e e9 6d |Y......bF!.].>.m| -00000210 62 5f 66 0a 41 34 c7 75 05 62 ea 60 7a 9e 5e 56 |b_f.A4.u.b.`z.^V| -00000220 32 6d 94 0a 08 ff 73 55 04 98 50 c3 d8 d6 10 cd |2m....sU..P.....| -00000230 80 77 29 84 d3 24 d3 dd 0a 0a 50 95 5f 41 f9 95 |.w)..$....P._A..| -00000240 82 11 39 b3 c8 32 90 4f 6f 67 1f 14 c6 fb c5 0a |..9..2.Oog......| -00000250 a7 79 85 a2 0c 11 a2 d9 d1 07 66 5d 50 63 43 fb |.y........f]PcC.| -00000260 b5 e1 70 49 86 15 2d db 1c 8a 86 d3 97 9e 24 5c |..pI..-.......$\| -00000270 40 95 89 47 7a a5 0e dc ba bd eb 0a 77 b9 42 58 |@..Gz.......w.BX| -00000280 8b d1 18 ce 08 c5 3a eb da 89 57 15 f0 00 9d 6f |......:...W....o| -00000290 ee be dc 1f e3 54 a3 ba eb 39 61 0a f6 a6 21 26 |.....T...9a...!&| -000002a0 d0 8e 0a ff a5 c4 53 37 5d fd b7 47 90 0d 79 dd |......S7]..G..y.| -000002b0 23 c4 94 54 d0 bd 59 93 68 f9 94 f0 00 ea 5a b1 |#..T..Y.h.....Z.| -000002c0 88 79 bb e8 9b 5e 77 93 f0 36 fb 12 57 fc 3b c1 |.y...^w..6..W.;.| -000002d0 15 d5 45 77 b5 35 ee fb 60 7f a8 cc da 99 1b 1e |..Ew.5..`.......| -000002e0 5c 7f 61 c0 9c 41 54 02 bc db af 48 ef a7 a8 62 |\.a..AT....H...b| -000002f0 42 2d 1c b6 60 f8 1b ef 56 03 1d 79 68 79 a9 e9 |B-..`...V..yhy..| -00000300 e6 78 62 66 c6 2e b4 6a 3c db 7a ee 1b f9 fa f3 |.xbf...j<.z.....| -00000310 0a f1 10 55 18 da 2f 6d 35 67 9f c6 c6 d0 40 eb |...U../m5g....@.| -00000320 09 0b 6b a2 72 71 5c 77 b5 8e cf d5 ec 2b 17 03 |..k.rq\w.....+..| -00000330 03 00 99 e4 93 85 ef 4e a3 15 ca d2 76 f9 5a 20 |.......N....v.Z | -00000340 40 08 b9 ad 74 93 12 7f 37 37 ab 9f 17 05 9c 0d |@...t...77......| -00000350 6a 84 85 c9 3e d2 3e 50 0b 7c 4e 51 6b 88 0a 91 |j...>.>P.|NQk...| -00000360 82 67 90 99 f8 69 74 80 b8 75 4f c4 04 42 68 58 |.g...it..uO..BhX| -00000370 26 8b 70 66 e1 b2 60 ac 63 92 3c 35 79 90 53 a2 |&.pf..`.c.<5y.S.| -00000380 8b 37 8b c1 84 d9 ac 1f 36 83 95 25 75 89 d7 f0 |.7......6..%u...| -00000390 44 81 be 9a 52 e7 a3 51 6d 28 50 80 e4 ea b4 db |D...R..Qm(P.....| -000003a0 89 68 9b 61 6e 88 7f 10 1e d7 f9 ea 12 a7 16 3c |.h.an..........<| -000003b0 2b 73 62 9b af 98 eb d1 7a 67 b1 6e 38 29 9d c1 |+sb.....zg.n8)..| -000003c0 94 18 7e 2a 50 96 72 25 7a 23 21 13 17 03 03 00 |..~*P.r%z#!.....| -000003d0 35 1f f9 91 ac 1f 78 93 2b 39 35 7e 52 22 e8 79 |5.....x.+95~R".y| -000003e0 84 4a a6 de 74 21 c8 a5 c7 d1 35 0d 53 bd 85 7d |.J..t!....5.S..}| -000003f0 e0 2f 51 74 b9 69 f1 7b a9 b2 2c b1 89 99 06 48 |./Qt.i.{..,....H| -00000400 f8 b2 b4 c7 5d 06 |....].| +00000060 c8 a0 2b 32 b8 d5 a7 19 a7 5e 02 f6 f1 e9 ad 34 |..+2.....^.....4| +00000070 72 59 97 9e 05 a8 46 42 21 53 06 06 81 ea b6 f1 |rY....FB!S......| +00000080 ca b6 c6 a1 b6 2e c6 b7 93 17 8e bc 92 3f ac 9c |.............?..| +00000090 7a 74 d0 f9 b2 00 68 e3 f2 1d b6 b8 66 7b 8a cd |zt....h.....f{..| +000000a0 17 03 03 00 17 69 26 9c 4e 1d ec 10 61 5f 5b ef |.....i&.N...a_[.| +000000b0 d1 ad 5d 6a c5 0c d4 ef a8 c4 8c ee 17 03 03 02 |..]j............| +000000c0 6d c1 89 98 5a 1d 09 68 1a cd 6e 75 e6 d7 9c d4 |m...Z..h..nu....| +000000d0 fb c4 70 dd c4 0d 6b 28 09 9b 59 53 81 44 80 f3 |..p...k(..YS.D..| +000000e0 9f 16 7a 04 e2 15 8a 80 58 2d 98 1e aa 1c ac dc |..z.....X-......| +000000f0 f4 60 d9 b3 ff d3 da 56 4a d4 dc 99 89 78 7b 0e |.`.....VJ....x{.| +00000100 0a 76 93 08 9f c4 a6 22 de fe 9f ad 19 19 92 20 |.v....."....... | +00000110 f3 2f ba c7 dd bc 15 54 03 8a ed 2f 5f 75 32 f2 |./.....T.../_u2.| +00000120 2b cf 0e 08 2e c6 7e 6a 4c 3f 40 4e 89 3f c5 de |+.....~jL?@N.?..| +00000130 f0 0d a2 f3 e7 b6 48 ac a6 c8 e9 78 8b ee a3 f1 |......H....x....| +00000140 7c 87 ff 5d d0 9b 4c 98 bc fc 25 1b b8 56 00 22 ||..]..L...%..V."| +00000150 e0 7e 52 24 c6 12 a3 21 39 2a 63 77 da ff de 21 |.~R$...!9*cw...!| +00000160 98 85 1d 73 57 df 21 6c e3 f8 de 06 4b 50 39 0e |...sW.!l....KP9.| +00000170 7c c9 c9 bc 7b 16 1e d7 e3 b2 e4 9e d3 a9 94 35 ||...{..........5| +00000180 fb 65 22 b9 a9 f8 ef 13 5e 54 ef 4b d7 09 b8 72 |.e".....^T.K...r| +00000190 a9 a5 30 a2 67 d3 ef 6e aa 00 7c fb fa 63 28 e7 |..0.g..n..|..c(.| +000001a0 48 18 23 9b 7e 0f dd 8b b2 13 4f f6 d2 e4 75 42 |H.#.~.....O...uB| +000001b0 27 8a 42 0c 02 d8 1e 45 82 ef 1b 65 a7 eb b5 19 |'.B....E...e....| +000001c0 26 e5 42 06 80 80 d7 84 1e 05 c5 d5 f4 ea 53 51 |&.B...........SQ| +000001d0 78 ba f3 47 47 01 7b 25 ab 34 f7 fc 52 71 ff a4 |x..GG.{%.4..Rq..| +000001e0 d5 50 2b b5 7d e2 62 6a e9 8e 9c 8d b2 6f d4 78 |.P+.}.bj.....o.x| +000001f0 07 da 3a 9c 51 a3 d4 f5 24 a6 c0 c8 39 85 5f e1 |..:.Q...$...9._.| +00000200 03 b0 65 8b 50 c4 5d 03 f6 36 d2 3d f2 36 e3 c6 |..e.P.]..6.=.6..| +00000210 26 5b 82 d1 bd 54 e7 90 50 23 a8 e3 36 d9 d9 a0 |&[...T..P#..6...| +00000220 07 df 1b 47 17 9c 2a ab 56 07 d5 ea e5 c7 71 0b |...G..*.V.....q.| +00000230 fb 0c 4e f3 5b 0e 1d d6 75 df 21 50 c3 c9 18 5f |..N.[...u.!P..._| +00000240 55 e1 84 91 5c 9c 13 68 95 15 ab 0e db 17 b1 b7 |U...\..h........| +00000250 ee 3e 89 61 0f 6f 09 8b 6a 67 b5 bc 2a 61 cd 42 |.>.a.o..jg..*a.B| +00000260 79 9a 9c a4 99 98 0d 1c 43 2c bd 8d ee ac a9 2e |y.......C,......| +00000270 6d 73 cc b3 a0 b7 b7 8f 8f 09 32 8a 9f 00 87 5f |ms........2...._| +00000280 ae b4 0f 47 22 0b ec f4 e2 be 4e 6f 13 8d 30 97 |...G".....No..0.| +00000290 5a a8 f0 38 46 dd 1a 28 10 8b a8 4a e4 e6 fb 84 |Z..8F..(...J....| +000002a0 c4 85 15 11 3d 0b 08 f7 9d fd 45 6a 6b f5 bf d4 |....=.....Ejk...| +000002b0 2b 84 e5 20 5a a8 cb df 1f a3 af 96 17 df e8 b2 |+.. Z...........| +000002c0 61 f1 d0 d1 85 91 d2 02 a5 38 a0 5e 19 ba c4 2c |a........8.^...,| +000002d0 80 64 77 13 e1 27 86 d3 d4 17 07 86 c7 11 c0 38 |.dw..'.........8| +000002e0 11 69 89 48 39 7e b2 e5 d9 72 c1 b4 29 50 ab 9b |.i.H9~...r..)P..| +000002f0 49 cd 74 b9 4a ce c5 67 46 47 73 81 b1 a1 82 8f |I.t.J..gFGs.....| +00000300 76 ee 81 28 70 66 da 94 2a 8e 20 b0 ab 2e e4 d4 |v..(pf..*. .....| +00000310 ef 26 8b 31 07 85 b6 b0 c2 5b 05 0a 32 2e e7 73 |.&.1.....[..2..s| +00000320 41 e7 a1 97 f7 5e 2f 9c 73 25 c1 f7 77 12 17 03 |A....^/.s%..w...| +00000330 03 00 99 92 0a 8c 17 e9 0d 77 a3 6f ab 1a 4f dd |.........w.o..O.| +00000340 de 1d 0f 72 39 5c 8f 9f 80 00 b2 e5 fe 28 79 a2 |...r9\.......(y.| +00000350 16 21 e3 a2 25 90 c6 cd f2 28 6d b6 08 5b 51 0d |.!..%....(m..[Q.| +00000360 58 22 a6 11 ac 29 5d 54 aa 05 35 28 87 da 54 39 |X"...)]T..5(..T9| +00000370 b6 7f ef 94 3e 1c 80 59 f1 12 06 77 66 20 a1 00 |....>..Y...wf ..| +00000380 82 ed 0b 7a 1f 5d 55 5e 31 11 85 93 69 94 2a 44 |...z.]U^1...i.*D| +00000390 96 1c 39 7b 5b 7f 5b a6 05 6a 6d 52 79 20 52 f7 |..9{[.[..jmRy R.| +000003a0 1f 79 50 36 f1 a9 00 aa 9d 46 57 fd 00 70 7b 4a |.yP6.....FW..p{J| +000003b0 7a 14 75 20 91 83 3e 1b 47 2a 90 c9 09 71 b6 95 |z.u ..>.G*...q..| +000003c0 48 53 2a 3f 22 5f 9c 46 d6 12 27 b1 17 03 03 00 |HS*?"_.F..'.....| +000003d0 35 98 15 74 4c d4 52 cf 0c 78 88 8f 82 9b c5 23 |5..tL.R..x.....#| +000003e0 14 02 71 da 63 6c 28 36 aa 91 a0 14 74 0a 47 59 |..q.cl(6....t.GY| +000003f0 ea 6f b1 46 1e a7 c4 5f 76 33 96 ae 82 eb 4b b4 |.o.F..._v3....K.| +00000400 88 6a ce 37 db fd |.j.7..| >>> Flow 5 (client to server) -00000000 17 03 03 00 35 fa 53 f3 c8 84 37 c3 c8 b9 b6 0a |....5.S...7.....| -00000010 41 bb 27 76 d5 7a 32 b6 3a fe 5b d5 28 d9 a6 81 |A.'v.z2.:.[.(...| -00000020 21 63 ee 43 03 3d b6 c0 0c 5f 3c cc 2a 2a 7f ee |!c.C.=..._<.**..| -00000030 f6 5e 02 f5 c9 06 c8 56 de b1 17 03 03 00 17 9a |.^.....V........| -00000040 8f 68 ac 18 fc f4 87 b4 fb 1e 33 b9 77 51 04 57 |.h........3.wQ.W| -00000050 f6 34 a4 f9 62 05 |.4..b.| ->>> Flow 6 (server to client) -00000000 17 03 03 00 da 4b cf 84 da 4f 53 58 d4 24 69 e4 |.....K...OSX.$i.| -00000010 4f e1 92 ae 27 23 7e ac 05 95 aa e3 c1 fb 41 7b |O...'#~.......A{| -00000020 5a 94 eb bc 0b 03 df 95 77 f7 9a 47 4a 88 52 83 |Z.......w..GJ.R.| -00000030 4d a4 c1 a6 e9 79 dd 77 76 a0 fc 9b 50 55 72 8e |M....y.wv...PUr.| -00000040 c8 0a d6 e4 d4 b8 18 b4 0e cc 06 05 2a 40 17 7d |............*@.}| -00000050 f6 ef b5 76 93 85 fc 0b e1 ca d7 e6 06 d0 e0 34 |...v...........4| -00000060 86 e2 62 a4 35 fe 5d 63 6c 4a 2e 0f 3d dd ea a1 |..b.5.]clJ..=...| -00000070 bf a8 86 56 e2 2e 21 79 47 c4 9a c4 6f 07 82 59 |...V..!yG...o..Y| -00000080 d7 55 a9 32 97 de 5a af 0c ab fa 46 d4 2e ab b0 |.U.2..Z....F....| -00000090 8d c8 36 0f d7 a5 cc 27 31 6e 42 a6 d0 61 72 45 |..6....'1nB..arE| -000000a0 d7 43 8d 74 51 da a8 bb 6b 7a 69 30 79 f3 ff 92 |.C.tQ...kzi0y...| -000000b0 dc 0a d7 52 b0 9a d8 c3 d6 c9 2b 3d 7e 60 63 5b |...R......+=~`c[| -000000c0 02 8c 5e 76 92 9d ad 4e 18 c3 67 a7 40 62 41 04 |..^v...N..g.@bA.| -000000d0 0b c9 29 26 d8 0c 51 51 d1 5b a4 bf 69 d5 31 17 |..)&..QQ.[..i.1.| -000000e0 03 03 00 da fa d6 36 16 4c 85 87 4f 4b 17 b8 65 |......6.L..OK..e| -000000f0 3f dc c3 5d 09 c5 ed 80 b1 d4 3d aa dc f8 78 1e |?..]......=...x.| -00000100 c0 d5 e3 87 74 57 f4 3c ec 7c d0 09 e6 88 fa 16 |....tW.<.|......| -00000110 30 de 10 7c 25 14 d2 23 71 63 e5 bb 97 bf 5c 9e |0..|%..#qc....\.| -00000120 e4 81 cc 5d 0e b0 e4 06 0e 6b 87 93 6c ce 7c fc |...].....k..l.|.| -00000130 2b 66 c2 48 53 65 31 40 b8 ce 7e a2 f2 69 a0 b8 |+f.HSe1@..~..i..| -00000140 41 ff 18 f1 1a db 96 7e b0 e5 9a 40 de 4e d0 4f |A......~...@.N.O| -00000150 95 37 81 15 e9 b2 a5 fa af 26 97 1b d7 e5 2b 17 |.7.......&....+.| -00000160 51 5c ee d6 cd 20 6a 19 5c 80 41 f5 ca 52 d5 c8 |Q\... j.\.A..R..| -00000170 70 e5 3a 0f 17 3e b4 b4 c5 bc f8 90 49 df ee 3b |p.:..>......I..;| -00000180 c5 33 43 14 16 d5 f7 f6 85 ef f2 ee cb 23 5a e8 |.3C..........#Z.| -00000190 09 5d 15 73 98 b9 d3 1e 74 27 3e ff 7b 9d 63 13 |.].s....t'>.{.c.| -000001a0 5c d4 b5 6a 34 b8 9e 1b 4b cf d8 5a da 4a 73 5e |\..j4...K..Z.Js^| -000001b0 5c ae 38 78 ba 12 00 bc 98 15 f3 c7 69 6b |\.8x........ik| ->>> Flow 7 (client to server) -00000000 17 03 03 00 13 d0 9e 34 0a 13 b3 c3 d9 22 79 a9 |.......4....."y.| -00000010 66 e6 3a 8b 3e bc cf de |f.:.>...| +00000000 17 03 03 00 35 7b c5 88 f4 a0 83 1e 6e 67 e6 05 |....5{......ng..| +00000010 05 fa b4 40 e3 7f fc f8 bc 50 11 76 93 22 92 5f |...@.....P.v."._| +00000020 9a 67 e5 65 a1 a3 af bc ae 3b c7 aa b3 fb 99 f0 |.g.e.....;......| +00000030 2a c2 65 aa 4b bd 91 20 17 22 17 03 03 00 17 1d |*.e.K.. ."......| +00000040 4f a0 06 07 65 2e 10 e7 15 c9 56 f3 2c 18 10 51 |O...e.....V.,..Q| +00000050 c7 d5 ac 09 e6 93 17 03 03 00 13 34 b2 1d 5e da |...........4..^.| +00000060 55 b2 dd 2b c1 e0 ac 65 7e a2 52 f8 a4 5b |U..+...e~.R..[| diff --git a/src/crypto/tls/testdata/Client-TLSv13-KeyUpdate b/src/crypto/tls/testdata/Client-TLSv13-KeyUpdate index 3d6c21bcee11c..a613b78da58f6 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-KeyUpdate +++ b/src/crypto/tls/testdata/Client-TLSv13-KeyUpdate @@ -16,117 +16,87 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 0f 9a 86 30 a4 |....z...v.....0.| -00000010 0a 88 2e ae a6 b9 ca ee 46 9c 87 f8 38 b3 5f d4 |........F...8._.| -00000020 2c 42 29 e3 e7 44 e4 d3 e2 00 53 20 00 00 00 00 |,B)..D....S ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 59 2c d4 a8 e3 |....z...v..Y,...| +00000010 ec 72 f1 2f 9b ff af 2f ab 13 fe 21 80 a5 c1 71 |.r./.../...!...q| +00000020 02 55 9b 06 67 0f 7b dd 27 32 66 20 00 00 00 00 |.U..g.{.'2f ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 1e |..+.....3.$... .| -00000060 0b 5c d8 c6 44 ba ac 71 70 3c a2 20 b0 05 d5 98 |.\..D..qp<. ....| -00000070 c4 12 e3 43 67 53 c4 2a 72 6e 59 50 03 81 0e 14 |...CgS.*rnYP....| -00000080 03 03 00 01 01 17 03 03 00 17 cc 54 e1 4a d7 5c |...........T.J.\| -00000090 1b 96 70 6e c0 ea 25 c6 0e 9d bd a6 c0 08 0a 45 |..pn..%........E| -000000a0 1b 17 03 03 02 6d 17 74 77 1a b1 00 47 8f e5 01 |.....m.tw...G...| -000000b0 3a 29 a3 e8 94 1b 3e ef 91 f7 05 8d 9a a4 2d 9a |:)....>.......-.| -000000c0 9b cf d2 83 e4 74 28 b9 d5 ae c8 79 b4 f4 6b eb |.....t(....y..k.| -000000d0 a0 db e7 db f3 ff 0b 2b be 0c e7 3b d3 c6 79 ea |.......+...;..y.| -000000e0 39 a6 66 19 88 39 04 01 f9 8d 82 04 6d e2 ce 73 |9.f..9......m..s| -000000f0 71 f9 bd 5b f6 66 a5 c7 f8 8b be db 1a b5 1b 38 |q..[.f.........8| -00000100 4b b4 3a 04 01 5e 68 13 e7 51 40 fe bd b8 a0 00 |K.:..^h..Q@.....| -00000110 7a 7d b7 60 0c 9d 23 7b 6e 77 fd 71 6f 45 30 41 |z}.`..#{nw.qoE0A| -00000120 bf 3f 5f 45 27 b1 bd 3e 39 d1 bf 80 be 74 e1 e3 |.?_E'..>9....t..| -00000130 ae 9c a7 68 40 ac 98 ef 3f 7f e6 41 a5 f5 c9 56 |...h@...?..A...V| -00000140 45 1c 4e ad 1f 62 58 fc 0b 1f 06 1a 12 c5 d1 c6 |E.N..bX.........| -00000150 0a 3d f9 f7 e9 a5 16 9b 69 bf f8 39 6f 38 8c cd |.=......i..9o8..| -00000160 da da 97 f7 40 9b a1 9f 3b c8 a5 5b 42 2f 44 29 |....@...;..[B/D)| -00000170 f0 d9 0b 0e 7a b8 ae 9f 7f de fd 4c 81 c4 a2 9d |....z......L....| -00000180 a1 40 b3 5e a5 22 1a 1a 7b f7 83 14 4d 53 c9 68 |.@.^."..{...MS.h| -00000190 4e e0 3f 8a 88 b0 74 51 eb 3a 85 ee 45 3b 5d d5 |N.?...tQ.:..E;].| -000001a0 8c cd ba 55 b9 89 32 4c 6e d9 81 c3 b0 68 4d 39 |...U..2Ln....hM9| -000001b0 0e 3b 70 31 a2 e2 6e f1 07 5a 0e 4f 6a 0c 58 f1 |.;p1..n..Z.Oj.X.| -000001c0 71 0d dc 35 a9 ea 15 50 1e fe f4 e5 c6 ff ef 6a |q..5...P.......j| -000001d0 46 8c 04 27 1b cc a6 0e 40 25 c5 5e 13 e0 26 e8 |F..'....@%.^..&.| -000001e0 5f 44 bb 05 f7 1c 6e 8c 1e 58 f3 5f af 92 98 79 |_D....n..X._...y| -000001f0 93 50 a2 22 8d 65 62 20 78 15 8e 02 16 77 53 45 |.P.".eb x....wSE| -00000200 fd 51 a6 db 80 26 7a 69 c1 55 69 76 96 2e 49 62 |.Q...&zi.Uiv..Ib| -00000210 0e b8 fe 58 36 0d ac 68 b7 f0 54 16 45 bc 6a a0 |...X6..h..T.E.j.| -00000220 8b fa 2e 00 de cf ad 73 31 ff c0 5f be ff 09 76 |.......s1.._...v| -00000230 07 b2 08 27 90 98 2f b6 08 9f 8b 31 77 0a d1 41 |...'../....1w..A| -00000240 ee ca 97 0d 46 03 91 d6 12 02 b3 7d 13 e8 ab 83 |....F......}....| -00000250 79 93 96 33 f0 fc 14 3a 90 06 df 0d 38 59 1e 34 |y..3...:....8Y.4| -00000260 a6 8a 5c 19 ae 8f ba b7 b8 6d cf 59 29 81 8c b7 |..\......m.Y)...| -00000270 86 44 e0 a5 ef c1 24 cd 21 05 2a da 4b 01 e9 2b |.D....$.!.*.K..+| -00000280 b6 c0 be 8e be f1 af 1c a4 be b1 26 4c a9 e5 e7 |...........&L...| -00000290 41 fa 74 73 03 77 9b 5b 56 69 ca bd a5 99 ff d6 |A.ts.w.[Vi......| -000002a0 eb 77 0c b0 3e 29 dc e7 54 7d 4e 03 5f 75 1e a5 |.w..>)..T}N._u..| -000002b0 93 73 9a bd 53 31 57 b9 63 9c 17 f2 ae 3b 21 81 |.s..S1W.c....;!.| -000002c0 38 55 1f 56 96 0f 02 de ad 2a a4 7e 71 52 79 21 |8U.V.....*.~qRy!| -000002d0 b0 76 e5 59 1c 74 10 0e e3 90 4b 69 53 4d dd 20 |.v.Y.t....KiSM. | -000002e0 52 25 14 d1 67 ed 72 26 6a 4e 1f 1b aa b9 03 6d |R%..g.r&jN.....m| -000002f0 81 67 1c c3 f2 f5 2e f0 01 b5 f5 8f d3 5e 08 2d |.g...........^.-| -00000300 fc f5 8a c0 3d af c1 3d 3f 14 c1 b3 18 55 6b 98 |....=..=?....Uk.| -00000310 f5 4b c0 17 03 03 00 99 44 a2 0f 9b 62 d7 b0 e0 |.K......D...b...| -00000320 68 2e f1 90 64 fc fe 4f e3 e0 9a 82 8d c3 14 6d |h...d..O.......m| -00000330 f4 22 00 d9 74 5d 98 82 9f e5 6e fd 7e e5 9e d2 |."..t]....n.~...| -00000340 5a 1b 11 fd 05 c0 d7 4e 48 6b 8b e1 33 8d f3 04 |Z......NHk..3...| -00000350 2c 20 00 53 86 b7 f8 34 20 2f 6a e0 f9 c3 3a 85 |, .S...4 /j...:.| -00000360 f2 32 4e a0 3e 3c 2d c6 91 86 d3 4b 09 ef d2 93 |.2N.><-....K....| -00000370 3f a3 9a ad 0f f6 a3 04 ba 88 fe 9a 80 12 c5 0d |?...............| -00000380 f9 86 2b b8 cb 7e 46 28 16 2d 58 bf 5a 0a 2e f8 |..+..~F(.-X.Z...| -00000390 cd c2 2e 01 c2 cf ca f7 5e b1 1d 8b 9d 1b 4b 8e |........^.....K.| -000003a0 62 a2 c2 17 14 e7 00 be 00 3a 0c 4c 84 d7 c1 47 |b........:.L...G| -000003b0 61 17 03 03 00 35 7d 84 99 5a 9f b5 26 b5 f6 ce |a....5}..Z..&...| -000003c0 56 ca a6 25 60 84 e3 5b c1 b8 7c ed ed 02 f1 13 |V..%`..[..|.....| -000003d0 50 2a e8 a2 65 65 f9 88 b1 a5 01 24 0f 52 4a da |P*..ee.....$.RJ.| -000003e0 5d ea 2b 88 b3 9c b7 ed d8 70 38 |].+......p8| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 3e |..+.....3.$... >| +00000060 13 b1 51 26 01 be c0 e5 85 a7 18 aa b5 83 21 6e |..Q&..........!n| +00000070 85 48 1b ea 4c 99 13 ba b8 de 07 30 f4 9f 5b 14 |.H..L......0..[.| +00000080 03 03 00 01 01 17 03 03 00 17 9f 78 1e 98 cb 85 |...........x....| +00000090 0e 65 2b e5 20 c1 63 c1 b7 49 49 76 e3 90 0c c9 |.e+. .c..IIv....| +000000a0 b6 17 03 03 02 6d 8f 91 03 6b b7 0d 7d 79 4c 16 |.....m...k..}yL.| +000000b0 fc cb 62 11 62 12 2a 52 9a 19 7c b6 1c fc 31 d2 |..b.b.*R..|...1.| +000000c0 11 4d b4 e9 23 3c 58 3e 87 f1 9e e0 27 04 a2 fb |.M..#....'...| +000000d0 21 9a 82 59 3b ea 6b 29 ec a8 0e 1c 58 99 46 9b |!..Y;.k)....X.F.| +000000e0 2b c2 90 10 5d bc df d1 a0 71 00 8f 9b 90 10 49 |+...]....q.....I| +000000f0 97 1d b5 d2 8f e2 a6 78 b1 2a e9 2d 8d 13 38 2f |.......x.*.-..8/| +00000100 db 56 bb cd 0f 08 69 f7 04 de 53 ec 3c 90 97 ca |.V....i...S.<...| +00000110 9f 63 d0 96 7f 3a 98 98 77 21 c8 ee 0f 5c 4e 97 |.c...:..w!...\N.| +00000120 3c 72 88 13 48 82 1b 70 b2 83 b4 95 03 81 05 ef |:.....U3| +00000300 76 5f ce 26 f6 53 d0 23 3a e2 78 0f 0a fe 2f 89 |v_.&.S.#:.x.../.| +00000310 43 27 b3 17 03 03 00 99 61 da d2 f7 6d 84 f0 08 |C'......a...m...| +00000320 b0 89 f8 a4 1f b4 99 6a cf d1 08 d6 a7 03 fa f9 |.......j........| +00000330 db c2 8a 9a 74 62 0c 93 7d 7c 22 c0 2d 84 5d 96 |....tb..}|".-.].| +00000340 f8 66 05 6c c5 ab b6 5b 2d f5 10 27 c6 c3 81 13 |.f.l...[-..'....| +00000350 94 3c af 56 ca 37 ca a6 24 86 34 54 f2 60 e2 51 |.<.V.7..$.4T.`.Q| +00000360 67 5e dd 81 7f 87 81 84 15 cf b9 92 01 9c fc 90 |g^..............| +00000370 18 21 ad 6a 4a b8 4f fe 03 c8 83 08 fd 55 5a 4d |.!.jJ.O......UZM| +00000380 75 b7 e3 2d ff 9d 0a e5 61 b2 e9 82 bf 65 6a 05 |u..-....a....ej.| +00000390 d1 8d 36 82 07 8d a0 95 78 26 9e 3a c7 99 27 3f |..6.....x&.:..'?| +000003a0 54 0e a3 dd 9a 93 a6 6c 9b a3 14 46 bb cc f8 70 |T......l...F...p| +000003b0 f1 17 03 03 00 35 34 03 e6 68 dc f1 3e ae 38 69 |.....54..h..>.8i| +000003c0 87 ce 72 92 13 4a c0 4a 0d 22 28 3a 9f df 7d d5 |..r..J.J."(:..}.| +000003d0 de 5f 3c 0d 49 be b7 63 85 67 90 be 68 dc e7 88 |._<.I..c.g..h...| +000003e0 e3 58 90 43 99 0a db ee ad be 6d |.X.C......m| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 e7 50 0e 48 d7 |..........5.P.H.| -00000010 8f 45 ff 48 48 1d 0c 94 b8 61 e2 ad 89 eb 4d 9b |.E.HH....a....M.| -00000020 20 f5 73 41 85 0c 7b c1 9b 1e d1 a1 27 b3 83 51 | .sA..{.....'..Q| -00000030 05 51 a9 fc 98 7e fe ef e2 43 6b a8 da f0 d0 d5 |.Q...~...Ck.....| -00000040 17 03 03 00 17 f3 bb 74 b9 31 69 37 87 c9 eb 04 |.......t.1i7....| -00000050 49 95 8f 30 e7 cf c5 67 27 3d 11 66 |I..0...g'=.f| +00000000 14 03 03 00 01 01 17 03 03 00 35 ea a5 10 9a 0a |..........5.....| +00000010 57 40 9c b7 f8 e6 01 28 9e 3f ae ce ec 73 7f 2e |W@.....(.?...s..| +00000020 84 8e a9 e3 cb 03 3b b3 1b 98 3c 09 5b 23 c2 10 |......;...<.[#..| +00000030 c1 18 47 74 a8 a5 0e 33 93 5f 83 e9 e6 aa ed f5 |..Gt...3._......| +00000040 17 03 03 00 17 80 72 fb 00 25 ff 83 4c df 43 66 |......r..%..L.Cf| +00000050 cd e5 64 2e 78 44 e4 b7 58 61 fe 01 |..d.xD..Xa..| >>> Flow 4 (server to client) -00000000 17 03 03 00 ea 04 c2 4b 8d b2 6b 4e d5 f1 84 03 |.......K..kN....| -00000010 22 ec f6 d5 61 ba fe 8a e2 23 75 f3 9e b5 9f 9f |"...a....#u.....| -00000020 f7 23 a6 45 46 72 c1 90 cf 30 42 22 f4 7b 0b ca |.#.EFr...0B".{..| -00000030 6e b3 4a 74 98 3c 5b a4 1e 27 af 25 a9 af 45 ad |n.Jt.<[..'.%..E.| -00000040 70 0a 61 2a b3 0b 17 e6 ea 99 d5 d9 be 8e e9 97 |p.a*............| -00000050 7a 8b 95 4b 50 91 86 35 ef c5 67 0a 10 0f fb 26 |z..KP..5..g....&| -00000060 11 cb f7 7b 35 5a 58 79 80 38 cf f8 e8 77 c2 84 |...{5ZXy.8...w..| -00000070 3a 91 f5 26 23 79 2c ac 8b f7 40 f1 38 dd 0f d6 |:..&#y,...@.8...| -00000080 3c 0e be e3 12 37 5a 98 0c c8 6a 86 33 df e3 ef |<....7Z...j.3...| -00000090 7d a1 9b 3b 1b 1e 3e 17 58 8d 39 7b 28 c2 02 bd |}..;..>.X.9{(...| -000000a0 8a 5e 20 17 cb 0b 4c 01 df 36 a4 c0 0d de 26 67 |.^ ...L..6....&g| -000000b0 18 b0 a8 b2 98 b2 01 2a 8c 0e 29 ce 2f c7 4a c5 |.......*..)./.J.| -000000c0 ea 2a 86 06 33 62 93 ad 7a 08 15 d1 ab 46 14 43 |.*..3b..z....F.C| -000000d0 8d 44 b8 6f ac 4a bc fe e2 91 2f ca 03 6d 49 66 |.D.o.J..../..mIf| -000000e0 7c bd ca 7b e1 da 73 45 c1 c2 79 02 02 55 52 17 ||..{..sE..y..UR.| -000000f0 03 03 00 ea 3c fa 1d 62 22 67 f0 44 ac ab 17 a0 |....<..b"g.D....| -00000100 f2 7d 44 ce 6a 3f dd 2c d5 45 8f 2c 5d 6f 8e a6 |.}D.j?.,.E.,]o..| -00000110 c8 97 ea e9 df 35 fd 00 57 98 33 d1 87 f4 1a ee |.....5..W.3.....| -00000120 8d 68 a7 ac b0 18 84 e3 26 df 08 85 8f e0 65 48 |.h......&.....eH| -00000130 a9 94 f1 e5 09 78 6c 76 4a 1a 14 35 93 cc 44 ea |.....xlvJ..5..D.| -00000140 8c 8d f7 ee 33 4f cf e0 54 db ba 49 4b 5c b9 ea |....3O..T..IK\..| -00000150 de a9 6d eb bc f4 43 85 27 a4 d6 64 6d 1e 9d 9d |..m...C.'..dm...| -00000160 e1 81 22 30 b9 a1 c4 c9 b4 0b 4b 23 25 58 34 33 |.."0......K#%X43| -00000170 40 fc ea 84 fa f5 ba 40 6d 60 cc 60 1b 95 19 f6 |@......@m`.`....| -00000180 c6 9e ba 00 d8 fd 93 cd bb 50 91 55 f1 e3 34 ea |.........P.U..4.| -00000190 f8 99 7e fd 18 02 69 e3 54 cf 15 3f d3 54 0e e9 |..~...i.T..?.T..| -000001a0 30 4e 67 94 2e 48 49 45 b8 ae 1a 3c 6d 78 f0 2c |0Ng..HIE...>> Flow 5 (client to server) -00000000 17 03 03 00 16 38 87 e3 aa 7a 6f 28 c7 6f bd cf |.....8...zo(.o..| -00000010 d0 50 21 a4 e0 44 9f fe 29 47 e9 |.P!..D..)G.| +00000000 17 03 03 00 16 b2 74 fa c8 c6 6e 4f 62 4f ea 02 |......t...nObO..| +00000010 4d 10 78 f1 b3 4a e2 e5 1d 8f 33 |M.x..J....3| >>> Flow 6 (server to client) -00000000 17 03 03 00 1a 3c be d6 90 e8 ad 97 7c 0f c9 b6 |.....<......|...| -00000010 3d 66 52 35 57 1e 01 c5 a2 27 8b c4 17 25 20 |=fR5W....'...% | +00000000 17 03 03 00 1a ba bc 59 f7 ad b4 77 2f bc 3d 60 |.......Y...w/.=`| +00000010 5c bd 6c 6e 37 86 75 bd e1 41 b9 07 f6 87 47 |\.ln7.u..A....G| >>> Flow 7 (client to server) -00000000 17 03 03 00 1d 21 5f dc 8c da b2 e4 b2 9c 1e c6 |.....!_.........| -00000010 dc 2c a5 f6 51 0d 18 03 13 e5 f3 b2 00 c8 4d 1f |.,..Q.........M.| -00000020 f9 1b 17 03 03 00 13 f0 2a 99 bd b7 c6 3c 9b da |........*....<..| -00000030 b8 c3 3d ee b3 f8 a3 0d 59 f8 |..=.....Y.| +00000000 17 03 03 00 1d 7d 12 1b b2 a7 b7 ae 37 fb 2d 71 |.....}......7.-q| +00000010 98 ec c2 f0 7f 16 e9 b9 f9 49 05 e2 b2 c3 c6 ec |.........I......| +00000020 38 32 17 03 03 00 13 9f c4 f4 f7 e9 c9 5f e2 70 |82..........._.p| +00000030 b4 33 9f 35 f3 2a b1 cd 01 d5 |.3.5.*....| diff --git a/src/crypto/tls/testdata/Client-TLSv13-P256-ECDHE b/src/crypto/tls/testdata/Client-TLSv13-P256-ECDHE index 826fd7aea8ad8..20cafb45b61cc 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-P256-ECDHE +++ b/src/crypto/tls/testdata/Client-TLSv13-P256-ECDHE @@ -18,109 +18,77 @@ 00000100 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 a6 b5 68 |lK[.V.2B.X..I..h| 00000110 1a 41 03 56 6b dc 5a 89 |.A.Vk.Z.| >>> Flow 2 (server to client) -00000000 16 03 03 00 9b 02 00 00 97 03 03 43 72 ac ef 29 |...........Cr..)| -00000010 8f 37 16 cf c9 d8 4c ce 9b d9 c1 93 f6 bb 47 a9 |.7....L.......G.| -00000020 2d 23 83 b5 ff b0 e0 93 34 01 52 20 00 00 00 00 |-#......4.R ....| +00000000 16 03 03 00 9b 02 00 00 97 03 03 42 8e 0f 88 bb |...........B....| +00000010 99 f5 32 74 2a 0a 66 98 59 da 0c 3f df 23 8c 72 |..2t*.f.Y..?.#.r| +00000020 a7 ba f5 52 78 88 22 a0 db 3d cc 20 00 00 00 00 |...Rx."..=. ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| 00000050 4f 00 2b 00 02 03 04 00 33 00 45 00 17 00 41 04 |O.+.....3.E...A.| -00000060 3b 16 53 b1 b9 87 04 07 c6 35 62 02 6b d1 d6 e6 |;.S......5b.k...| -00000070 06 54 aa eb 03 ab b3 69 79 0f 86 77 1b 09 0c 70 |.T.....iy..w...p| -00000080 2e 7d 09 86 1c df d9 a0 67 5c 87 75 f6 0d 1b 3b |.}......g\.u...;| -00000090 fd 0a 21 e2 2c 47 e4 be 60 79 f8 b4 e0 36 9f 1e |..!.,G..`y...6..| -000000a0 14 03 03 00 01 01 17 03 03 00 17 b5 fa 96 8c 5b |...............[| -000000b0 2b 29 ea 48 bb 2f ef d2 f2 b6 46 6c 06 9a a6 6d |+).H./....Fl...m| -000000c0 b5 d9 17 03 03 02 6d 54 d1 a7 bb 4a 57 68 0f 8d |......mT...JWh..| -000000d0 d9 1f 9c 8d da a4 30 4f 03 74 3e b7 5f 62 9e cc |......0O.t>._b..| -000000e0 5d bb df 24 57 db 11 f4 84 e4 65 a2 98 cf bf 27 |]..$W.....e....'| -000000f0 75 ae 70 3b f8 15 b0 d4 3f e5 50 76 1b 12 fe 41 |u.p;....?.Pv...A| -00000100 cb d3 f4 7b b8 e5 93 2f 25 87 e0 da ba ce 2e ee |...{.../%.......| -00000110 dc ee 2d ae dd e0 d2 2c 55 f8 ff e3 53 d2 c4 b5 |..-....,U...S...| -00000120 0e dc cd 5f d9 4b dc 6b 6f e1 c8 bb 05 aa 6c 4f |..._.K.ko.....lO| -00000130 e9 ee 89 c8 fe 90 ee 37 21 94 c5 7b 06 3c e0 d6 |.......7!..{.<..| -00000140 bd 94 45 96 9c 72 d3 24 cd e7 a4 14 67 5a b3 24 |..E..r.$....gZ.$| -00000150 8c a4 5e 95 bb 5a 1a 83 a5 75 00 b6 9c 3f b4 23 |..^..Z...u...?.#| -00000160 57 ae 19 cb c8 ae ed 17 9a 1a ed 9a c7 51 48 2b |W............QH+| -00000170 1e 35 a5 a3 fa 58 3d 6b e2 06 93 4d 7b 0b 22 cd |.5...X=k...M{.".| -00000180 11 22 33 59 b0 21 88 97 ca 11 a6 35 4d 7a ef d0 |."3Y.!.....5Mz..| -00000190 01 b7 da 3c 32 ce ee 50 d5 cf 3f 17 a5 8f 6c 61 |...<2..P..?...la| -000001a0 8c b0 d2 4f c5 53 43 9a d7 24 1f b0 75 ef fb 14 |...O.SC..$..u...| -000001b0 c6 96 fd 2e 80 d2 9a 8a 9b 69 e0 f5 78 60 a3 47 |.........i..x`.G| -000001c0 36 41 c1 7e 26 d9 9c c3 93 f8 c7 7c 20 77 de 1a |6A.~&......| w..| -000001d0 d9 33 0c 9f 60 89 e2 ac 08 df 34 92 23 fe 6a e6 |.3..`.....4.#.j.| -000001e0 ec bc 51 3f 2f ec 95 38 39 5a e1 12 3b ca ca bb |..Q?/..89Z..;...| -000001f0 be 5d 87 71 4d 9a 2e 04 6c 8b 01 34 bb 71 09 45 |.].qM...l..4.q.E| -00000200 60 a6 bd e2 33 30 04 bb 89 bc 79 01 84 06 73 04 |`...30....y...s.| -00000210 c7 5e af 9f ad f6 62 c5 32 46 69 41 7a 31 56 e9 |.^....b.2FiAz1V.| -00000220 01 5f 65 9f 6b 15 21 d4 a6 ba 3c 45 d7 9e cd 4a |._e.k.!.....| -00000350 02 21 70 2c 25 a3 23 42 08 63 9b 34 0d 88 62 ae |.!p,%.#B.c.4..b.| -00000360 2c 8f ed 91 c6 2d 78 9f bf e3 16 bb b1 83 99 e4 |,....-x.........| -00000370 72 fd 31 ec c3 4f 16 b6 98 d8 d5 d8 46 85 a7 32 |r.1..O......F..2| -00000380 51 d8 b4 0c 9e 31 a3 e6 80 31 ee d1 d8 e6 ad f2 |Q....1...1......| -00000390 d5 3d 73 1d 17 5a 73 e4 f1 ac a8 ca 7f 24 a9 76 |.=s..Zs......$.v| -000003a0 77 28 33 60 c3 fb dd d8 bd bd 38 f5 e5 fc 12 aa |w(3`......8.....| -000003b0 34 c4 c8 24 07 db 59 fe 46 ab ab a6 20 77 44 25 |4..$..Y.F... wD%| -000003c0 d5 27 7c 97 14 ef 01 8a 4c 3a 2b e8 ac 8d c9 05 |.'|.....L:+.....| -000003d0 d8 12 17 03 03 00 35 7b 1a ff 01 f0 d6 9b 24 e2 |......5{......$.| -000003e0 e4 50 54 33 21 2b 58 6d 88 4c d7 fd a9 5a d8 6d |.PT3!+Xm.L...Z.m| -000003f0 78 13 9f 09 8f 8c 1d 3a bc 76 c7 f6 95 9c 4d 04 |x......:.v....M.| -00000400 92 06 e4 82 d1 77 24 da 05 49 4e 52 |.....w$..INR| +00000060 42 55 a6 b0 22 e7 51 7f ce 3c 15 f5 ef db 69 89 |BU..".Q..<....i.| +00000070 80 e1 5a 54 37 d9 df 4c bd 83 72 43 5f b5 bf 28 |..ZT7..L..rC_..(| +00000080 21 41 0f 4c 71 a4 42 ae 90 20 8b 2e 95 88 1d a0 |!A.Lq.B.. ......| +00000090 4d 50 6f 05 3d 71 26 e2 ca 12 2b bf 5b 18 b6 16 |MPo.=q&...+.[...| +000000a0 14 03 03 00 01 01 17 03 03 00 17 fd a0 c1 f6 d6 |................| +000000b0 f5 7c 39 25 4c 67 ad fa 10 18 d1 90 b2 61 90 3f |.|9%Lg.......a.?| +000000c0 71 49 17 03 03 02 6d 28 31 4d 75 d8 9d 93 a0 ee |qI....m(1Mu.....| +000000d0 ad ef a3 dc 14 12 a8 af 17 b4 46 20 50 96 26 54 |..........F P.&T| +000000e0 78 4d d7 4f 08 e9 93 61 b6 53 da b2 e9 9c 67 54 |xM.O...a.S....gT| +000000f0 e8 87 0d 64 0c cc 14 cd d0 b5 df 1e d7 25 58 ce |...d.........%X.| +00000100 0b c9 a6 dc 38 9d 00 85 ce c3 01 29 3a 74 26 d4 |....8......):t&.| +00000110 71 db c0 92 2b 95 d2 00 d0 38 8d 85 f5 22 05 c7 |q...+....8..."..| +00000120 3b d4 d5 c7 a6 36 0d 3e 39 2c d5 0f 0d 84 80 22 |;....6.>9,....."| +00000130 e5 f0 71 24 0d 93 68 21 db 51 e2 24 84 0c 30 2a |..q$..h!.Q.$..0*| +00000140 87 e5 b5 a2 b6 b8 9c 53 a1 bb 76 7d e8 10 e4 59 |.......S..v}...Y| +00000150 f2 be 69 6f 39 75 e2 ed 70 f3 f0 fd 70 2f ce 2a |..io9u..p...p/.*| +00000160 24 d0 05 3e 13 ee 76 f5 6b b8 ed ee 34 40 cc e5 |$..>..v.k...4@..| +00000170 11 58 62 22 99 04 3c 22 43 24 46 78 66 a0 04 11 |.Xb"..<"C$Fxf...| +00000180 86 b4 b7 87 71 ff f9 ed 6f 4f 7e 9f 2d 08 ed ae |....q...oO~.-...| +00000190 cc 03 29 6f 34 9b 18 2c ae d7 d5 e9 03 51 5d 37 |..)o4..,.....Q]7| +000001a0 d5 ac 93 07 2a 78 8f 7d b0 85 ae 19 37 a5 e8 d6 |....*x.}....7...| +000001b0 e4 b3 01 14 04 fc ab 36 d6 5e 31 45 47 14 f8 d9 |.......6.^1EG...| +000001c0 c8 a0 a0 49 56 74 68 5b b4 20 f7 e0 54 34 41 45 |...IVth[. ..T4AE| +000001d0 c0 5e ed a6 1c 84 d8 3a c7 2d 17 5a 4c bd 7d d1 |.^.....:.-.ZL.}.| +000001e0 a8 9e 5e d1 31 b1 6b 48 64 11 d8 89 01 9f ed 12 |..^.1.kHd.......| +000001f0 60 73 66 80 38 13 23 8d 31 ca 94 06 22 e9 45 ff |`sf.8.#.1...".E.| +00000200 d6 a3 0b 7c 30 c8 d7 30 4f c0 62 84 ac f9 b0 3d |...|0..0O.b....=| +00000210 68 76 d2 02 27 d9 1e 7e da ae 85 47 e1 08 0f 4f |hv..'..~...G...O| +00000220 74 a9 fc ca f2 38 68 6d c6 f3 3c e9 99 c5 48 79 |t....8hm..<...Hy| +00000230 88 37 b6 5d 4f f8 8b 53 41 9a 39 a7 2f 8e 39 81 |.7.]O..SA.9./.9.| +00000240 75 cf 70 2f 28 4c 10 32 73 9b 6e 4f 58 1f ae 28 |u.p/(L.2s.nOX..(| +00000250 3f 6c 3d 60 49 48 15 10 2a af ea d7 ce 55 07 47 |?l=`IH..*....U.G| +00000260 90 3a c8 0d 6a 4a 88 c2 9c d3 08 99 02 c9 88 be |.:..jJ..........| +00000270 91 5b c9 41 46 cf b1 5e fe 28 1e 97 8a 44 5a e0 |.[.AF..^.(...DZ.| +00000280 d0 a3 a9 ea f7 51 27 87 b3 0f fd dc 7d d4 96 4a |.....Q'.....}..J| +00000290 39 2c 0a 58 9c 23 0d 41 89 42 5e fd 19 ab 19 a8 |9,.X.#.A.B^.....| +000002a0 e4 70 3f ef c6 54 fb ed 80 9b 68 d6 d9 6f 21 53 |.p?..T....h..o!S| +000002b0 89 40 06 c9 0c 56 40 8c 36 61 91 18 81 ce 76 5d |.@...V@.6a....v]| +000002c0 78 f5 01 9f 2e de 3e 89 61 d7 81 a5 f9 32 24 44 |x.....>.a....2$D| +000002d0 6b fa 0b 9c 8b a4 f6 df a1 2a 31 91 b2 40 cd 7e |k........*1..@.~| +000002e0 6c d1 75 c9 56 48 e3 36 eb 13 00 cf ea d5 d9 98 |l.u.VH.6........| +000002f0 71 4c d2 af 06 e5 f1 f7 8f ce 79 7a 93 4c 1c 99 |qL........yz.L..| +00000300 61 8f 93 76 de 1d ca ff 1b e5 c3 8f 99 ac 65 92 |a..v..........e.| +00000310 74 a9 d6 fd 9d bd a7 da f6 d5 94 7f 66 87 e1 7e |t...........f..~| +00000320 16 43 04 8a 9f 00 cc 89 1b 33 32 a2 26 e1 62 76 |.C.......32.&.bv| +00000330 30 07 5d 0e 17 03 03 00 99 22 4f 7b 1f 73 59 91 |0.]......"O{.sY.| +00000340 1e dc 62 ce 8b 32 7f 7d 99 b0 71 7a fb 79 09 5a |..b..2.}..qz.y.Z| +00000350 2e 0c b4 f2 00 13 5d ae 7d ae 80 1c 5f 8a a1 99 |......].}..._...| +00000360 c9 20 39 a9 66 36 f0 2b de 2e 1d ef 1f e1 ce 34 |. 9.f6.+.......4| +00000370 9a db f7 7b 17 52 91 ac 76 ff 22 63 8c 07 dd 7d |...{.R..v."c...}| +00000380 72 eb 9b 34 0f e9 a4 43 6b e3 fa e1 00 e3 dc 65 |r..4...Ck......e| +00000390 7a 49 bf a6 cd 97 4f e9 49 ae 91 4c be c3 3a b1 |zI....O.I..L..:.| +000003a0 a1 ee 09 55 ce 87 e7 59 58 24 cb 43 16 c9 5f d6 |...U...YX$.C.._.| +000003b0 11 32 83 47 dd 14 8d 11 c9 29 ac b8 57 7d 1e 07 |.2.G.....)..W}..| +000003c0 34 cc 79 13 22 00 62 39 4c 7e 5f 89 dc 94 b9 ca |4.y.".b9L~_.....| +000003d0 d9 ef 17 03 03 00 35 6a 70 22 84 c0 ed d6 70 b1 |......5jp"....p.| +000003e0 d5 8c 29 f9 0d 03 69 d1 0e 4c 01 79 1b 97 2f 24 |..)...i..L.y../$| +000003f0 45 08 25 4e 56 58 7c d7 d1 79 67 73 7c e2 30 54 |E.%NVX|..ygs|.0T| +00000400 54 2f c0 e2 28 e3 5a 87 47 0f f9 33 |T/..(.Z.G..3| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 6f 4f 2f 2f c7 |..........5oO//.| -00000010 73 95 d9 6a ea 12 1f e4 a0 ea a0 c5 10 8b 57 99 |s..j..........W.| -00000020 5b 6f 33 ae 14 f8 97 55 7d c2 4a 18 a7 6c 5d a8 |[o3....U}.J..l].| -00000030 3b 33 6f fd 1e b2 78 4a 02 3f 50 b6 f5 0a 52 88 |;3o...xJ.?P...R.| -00000040 17 03 03 00 17 c6 b1 65 78 2e 41 4e a8 a6 68 21 |.......ex.AN..h!| -00000050 27 41 d6 8b cf 69 c4 79 6a a9 93 1e |'A...i.yj...| ->>> Flow 4 (server to client) -00000000 17 03 03 00 ea 38 4c b2 c8 55 46 fe 6f e7 fe 59 |.....8L..UF.o..Y| -00000010 16 64 0d 78 97 f3 13 b1 6a 64 2b ed 64 d8 c0 96 |.d.x....jd+.d...| -00000020 5c 52 45 ba ac 9c b0 42 14 81 15 99 79 c9 75 7c |\RE....B....y.u|| -00000030 41 a4 15 90 7c 2c 8d 7f 75 43 37 1e 26 8f 74 a2 |A...|,..uC7.&.t.| -00000040 13 45 40 1b ec df f6 a8 fa 75 3d e0 29 7e b9 00 |.E@......u=.)~..| -00000050 aa b9 c5 60 dd 87 ac dc 44 74 17 0d ed 5a 50 b6 |...`....Dt...ZP.| -00000060 8f 4e ee 4e d0 a7 97 fc 73 ef 9b 09 d3 ca aa 92 |.N.N....s.......| -00000070 e9 32 61 9e 18 62 67 20 10 2c e5 18 fd 49 d9 76 |.2a..bg .,...I.v| -00000080 68 9a 61 c3 be fc 1e 7c 9e ca ed 8c c5 40 dc 03 |h.a....|.....@..| -00000090 3f 54 39 7e 3a 2a ec 78 a4 a0 91 14 30 cf 8f 9d |?T9~:*.x....0...| -000000a0 a9 c3 5b ba 1b 47 93 83 49 e2 dd fc c7 2b a3 11 |..[..G..I....+..| -000000b0 27 3c dd 35 46 ef 06 d6 89 e6 81 13 c4 61 7f 47 |'<.5F........a.G| -000000c0 5b ea b1 55 4e 6b 04 75 d1 4a a2 dc 1e 22 20 24 |[..UNk.u.J..." $| -000000d0 f3 13 2a 63 b7 f4 51 ca 32 3c 82 75 49 e4 29 76 |..*c..Q.2<.uI.)v| -000000e0 eb 19 20 d5 98 b0 03 9a 02 9f 1f 7e de ca 19 17 |.. ........~....| -000000f0 03 03 00 ea 72 3d f9 82 80 34 d2 b3 a3 bd e8 cc |....r=...4......| -00000100 34 a2 0b 9f 40 c2 07 28 e8 55 5b 73 ce e5 4c 64 |4...@..(.U[s..Ld| -00000110 54 8e 6b 16 22 b4 00 1c 81 1b c4 ec 2b 0b a1 9c |T.k.".......+...| -00000120 10 27 a4 d1 14 d7 4c 65 1e 0f 84 de a3 3e 0e eb |.'....Le.....>..| -00000130 46 db 04 f6 dd c4 7f 17 42 96 39 0d e7 2a ca f3 |F.......B.9..*..| -00000140 ab fb 9b f2 4b a0 fc 8f ba 16 97 bc ce 39 78 b9 |....K........9x.| -00000150 fe 81 c9 de e2 c0 56 df 15 d0 ef d6 02 14 52 4b |......V.......RK| -00000160 a7 70 ee 46 34 22 6c 53 df b0 61 4e 79 de ad ad |.p.F4"lS..aNy...| -00000170 d0 c7 e7 0f fe 02 cd 68 6b e0 57 40 54 f9 7d 57 |.......hk.W@T.}W| -00000180 42 bb 0b 63 a7 68 a0 c6 c9 92 af 5b e6 d6 ec e3 |B..c.h.....[....| -00000190 10 a3 07 ac 2e 9a 88 a9 ec 20 47 77 22 c8 54 08 |......... Gw".T.| -000001a0 90 19 ca 1e 01 a9 92 3e c9 cf 70 92 5b 90 7a 75 |.......>..p.[.zu| -000001b0 95 15 d5 e2 e2 13 6e 45 1a 51 ae e0 e0 6c 39 ed |......nE.Q...l9.| -000001c0 6c ef c4 c0 c4 29 f5 a2 c1 b4 a9 e9 73 fc dc a4 |l....)......s...| -000001d0 ea 90 ec bc 33 bf 7c 94 7f e8 ed 54 e2 19 |....3.|....T..| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 ca f6 56 a8 93 c9 5c ad 35 01 39 |.......V...\.5.9| -00000010 17 11 3c fb a7 94 d6 e5 |..<.....| +00000000 14 03 03 00 01 01 17 03 03 00 35 f1 7c 55 b2 e9 |..........5.|U..| +00000010 01 cd 57 d5 17 17 30 51 43 74 46 00 83 c7 d2 73 |..W...0QCtF....s| +00000020 2b ff 57 45 5c 13 d9 9e ec 56 c5 f1 d2 26 00 76 |+.WE\....V...&.v| +00000030 75 5c f0 3c 80 39 74 4e 38 72 35 39 a3 29 4d ff |u\.<.9tN8r59.)M.| +00000040 17 03 03 00 17 43 aa f1 73 de 22 92 8c 54 2c 3f |.....C..s."..T,?| +00000050 c6 f2 f1 07 27 b2 f6 0e 54 79 4d 05 17 03 03 00 |....'...TyM.....| +00000060 13 a5 64 ef ae 3f f0 52 08 71 9e 24 dc ea f1 50 |..d..?.R.q.$...P| +00000070 b5 27 20 54 |.' T| diff --git a/src/crypto/tls/testdata/Client-TLSv13-X25519-ECDHE b/src/crypto/tls/testdata/Client-TLSv13-X25519-ECDHE index 3dea0ac4cb364..7de7d279b2b6e 100644 --- a/src/crypto/tls/testdata/Client-TLSv13-X25519-ECDHE +++ b/src/crypto/tls/testdata/Client-TLSv13-X25519-ECDHE @@ -16,105 +16,75 @@ 000000e0 28 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed |(.._.).0........| 000000f0 90 99 5f 58 cb 3b 74 |.._X.;t| >>> Flow 2 (server to client) -00000000 16 03 03 00 7a 02 00 00 76 03 03 ff 75 f5 a2 e7 |....z...v...u...| -00000010 a6 49 83 90 e7 aa ad d6 71 53 82 9d 1c 0b 4a 8a |.I......qS....J.| -00000020 ea 06 7d e6 95 72 d8 f5 52 31 9a 20 00 00 00 00 |..}..r..R1. ....| +00000000 16 03 03 00 7a 02 00 00 76 03 03 cd c7 29 34 e2 |....z...v....)4.| +00000010 96 86 e5 32 80 01 ea b9 3f d1 c5 90 da 7d 6e b9 |...2....?....}n.| +00000020 6f c2 f3 de 0f 16 7c c6 be 22 9f 20 00 00 00 00 |o.....|..". ....| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| -00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 37 |..+.....3.$... 7| -00000060 7b a6 43 94 9b 0f 95 5e 65 65 f3 50 25 27 d2 c6 |{.C....^ee.P%'..| -00000070 40 03 1e a3 2f f4 8f c3 a0 f5 62 21 86 0e 32 14 |@.../.....b!..2.| -00000080 03 03 00 01 01 17 03 03 00 17 4c 11 25 b7 37 16 |..........L.%.7.| -00000090 50 0f b8 58 72 30 37 e2 25 10 6c 39 9f 7b bf b5 |P..Xr07.%.l9.{..| -000000a0 53 17 03 03 02 6d 03 5c 76 8c 92 4d 9e f7 75 8b |S....m.\v..M..u.| -000000b0 31 48 b9 f9 43 c1 cf 87 3d 5e dc 10 e4 4a 57 86 |1H..C...=^...JW.| -000000c0 f4 45 f0 9f e2 c3 ac eb c0 c0 0e 9c d5 7f 8a 07 |.E..............| -000000d0 c7 ca d4 9a cd a0 7b 14 c7 b3 da d2 29 19 c6 e3 |......{.....)...| -000000e0 f5 78 e0 fc 61 4e 6a f1 1a 3d b1 ba 91 5b 5d c5 |.x..aNj..=...[].| -000000f0 77 51 13 6a 6b 6a 68 ba 76 11 df af 6f 75 cf e9 |wQ.jkjh.v...ou..| -00000100 08 a8 69 05 ae 1f d4 b2 aa a8 95 a2 22 2d 6e e5 |..i........."-n.| -00000110 fb 18 ac 8c 84 77 56 17 8d 94 c3 25 59 59 b9 c6 |.....wV....%YY..| -00000120 1a c1 f2 cd f9 41 75 64 3b 19 ff 1c 4e 7c fc 84 |.....Aud;...N|..| -00000130 bb 42 12 57 2c d4 e1 0f 73 ae 1a 80 af e5 66 9f |.B.W,...s.....f.| -00000140 24 93 68 ef 41 6e 52 c7 c4 8a 50 66 2c dd ec fb |$.h.AnR...Pf,...| -00000150 75 e7 cd c0 83 cd d3 ce fc 9c 2c af 2b 86 8d 58 |u.........,.+..X| -00000160 50 05 82 dd 03 5a 89 cd 59 13 aa d6 dd 50 86 48 |P....Z..Y....P.H| -00000170 64 a6 ad 12 90 6a 72 78 30 77 dc e1 f1 f5 30 a3 |d....jrx0w....0.| -00000180 d3 86 60 9c bc 7f ae 28 9a f6 0c 8a 54 0c 78 a8 |..`....(....T.x.| -00000190 e5 1f 61 73 a2 25 11 7a 92 50 59 af 67 e4 67 bf |..as.%.z.PY.g.g.| -000001a0 c6 36 02 fc 83 77 b4 2c b2 a3 ab f6 43 68 29 ff |.6...w.,....Ch).| -000001b0 28 1c 9c bb c9 bb dc 89 d1 fa b9 1d 54 d8 bf 2b |(...........T..+| -000001c0 98 8c c6 df 5c bf 22 db 2d 95 2a 22 89 aa 10 98 |....\.".-.*"....| -000001d0 66 a8 04 24 6d 44 19 2c 44 f5 80 fb be a5 84 41 |f..$mD.,D......A| -000001e0 17 ab 01 81 a4 3e 1f 6a fc d0 c2 af d4 fb 48 d3 |.....>.j......H.| -000001f0 d8 a7 d6 af e7 f6 0d 6f 84 76 e5 27 6d 61 a0 95 |.......o.v.'ma..| -00000200 cd 3c 72 c3 c3 12 61 d1 23 6f a3 3a 15 3c e1 56 |.| -00000290 ec b5 d2 15 9c 44 cd f6 f2 65 01 ac d4 b0 7b 31 |.....D...e....{1| -000002a0 96 5d d3 cb ee ba 29 ee da 20 dc 39 25 f9 b8 77 |.]....).. .9%..w| -000002b0 b1 56 e2 72 a2 1d ca 65 69 e6 31 79 b8 cd bb 70 |.V.r...ei.1y...p| -000002c0 00 15 0b 47 e3 b5 00 e1 f1 4e 83 ca e9 2d 84 c3 |...G.....N...-..| -000002d0 69 99 95 43 bf 89 b3 22 7b ca 17 9b 46 b6 fa 3f |i..C..."{...F..?| -000002e0 21 05 87 ea 60 f6 3b ea a8 e8 30 2a c8 aa d9 9a |!...`.;...0*....| -000002f0 e8 4f 15 48 f1 50 54 68 b3 4e 7b e8 8c f2 78 ea |.O.H.PTh.N{...x.| -00000300 32 7c ed e1 32 96 90 6e 46 be 28 bb e0 d6 60 4b |2|..2..nF.(...`K| -00000310 48 fe 5a 17 03 03 00 99 bc bd b8 1f c4 f4 be 7e |H.Z............~| -00000320 e0 cc 0d 79 fe d7 ed 73 d9 c4 80 f3 e3 0a d3 26 |...y...s.......&| -00000330 d5 d7 7d f4 5f c1 56 6a 2c 03 b4 70 46 4d 88 67 |..}._.Vj,..pFM.g| -00000340 d2 43 6c 67 4d 2f e1 89 ff bc 9d 70 c7 de 24 0f |.ClgM/.....p..$.| -00000350 01 53 82 53 d4 20 30 93 8d 70 5d 3f bd b1 a8 d3 |.S.S. 0..p]?....| -00000360 d3 46 aa fa d0 2b 9b 70 de 3c f3 1c a4 75 d8 a0 |.F...+.p.<...u..| -00000370 6a 14 7d ec ad 6f 01 c1 d4 e0 f2 33 1a 1b 71 a8 |j.}..o.....3..q.| -00000380 74 3d 4c dc 64 fe b9 3b 52 22 39 13 71 19 78 7c |t=L.d..;R"9.q.x|| -00000390 bf 9d 06 0d 0d 27 4d b6 35 8a 44 f4 4f b9 f7 55 |.....'M.5.D.O..U| -000003a0 d4 ba f5 ac 05 5b e5 ac 07 8e 49 7a 93 cf 3f 78 |.....[....Iz..?x| -000003b0 fe 17 03 03 00 35 07 76 8c 10 f4 e8 70 e9 c6 12 |.....5.v....p...| -000003c0 2d c8 ee 2f b3 6a 72 59 93 ae 8d af 00 8b 7e 5f |-../.jrY......~_| -000003d0 2a 33 87 dc 92 a9 7f e4 eb b4 09 8e 57 0f 02 16 |*3..........W...| -000003e0 31 13 32 fe c5 88 fc b2 28 56 e5 |1.2.....(V.| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 71 |..+.....3.$... q| +00000060 a3 1e 19 38 17 d7 fb c4 d7 c0 c5 0b 1a 4f 43 b8 |...8.........OC.| +00000070 36 73 5b ba ac 71 44 76 e5 18 a8 5f f0 e9 53 14 |6s[..qDv..._..S.| +00000080 03 03 00 01 01 17 03 03 00 17 2b d0 f2 01 36 99 |..........+...6.| +00000090 3c fe 38 af 22 1c 4f ec 1f 31 a2 48 31 a4 b9 83 |<.8.".O..1.H1...| +000000a0 74 17 03 03 02 6d 87 69 ac 88 28 88 6e 62 c8 96 |t....m.i..(.nb..| +000000b0 b9 32 1a 3d f6 a3 10 70 06 bd a6 3b d1 e4 a6 3a |.2.=...p...;...:| +000000c0 be e0 93 61 27 d4 bf 1f b0 17 f0 19 b3 30 e1 5e |...a'........0.^| +000000d0 94 18 13 78 9b 9d d5 16 b2 c7 8a 21 54 c9 f0 31 |...x.......!T..1| +000000e0 09 5b 6c 7f 22 79 9f 33 66 b7 e7 ea d4 11 63 5f |.[l."y.3f.....c_| +000000f0 05 21 e2 1a 66 96 ac 62 10 be 4b 51 73 df 29 9e |.!..f..b..KQs.).| +00000100 71 92 1a cb d2 d3 99 0c a7 35 7d 12 b4 44 d7 96 |q........5}..D..| +00000110 2b 29 9d 49 70 11 8c f8 5c 80 a4 98 56 21 66 2b |+).Ip...\...V!f+| +00000120 ac 72 1c 2e 86 e3 62 d2 e5 f1 7f 58 97 7b ac 85 |.r....b....X.{..| +00000130 a8 c1 99 62 3b 8c 7f 47 95 09 e7 dc 7d 31 ed d2 |...b;..G....}1..| +00000140 9b f8 71 fb 15 9c 80 1c cc 28 dd 4d ef 95 89 92 |..q......(.M....| +00000150 1f e8 c0 c3 78 b9 8f 92 88 e9 57 f6 2b 30 90 f1 |....x.....W.+0..| +00000160 27 b8 d8 65 0e 12 6d 51 9c e8 f2 5d b0 58 90 88 |'..e..mQ...].X..| +00000170 22 e3 fb 0e 2e 1f 6b 6b a2 8e 52 2c a7 2a 32 03 |".....kk..R,.*2.| +00000180 a4 e9 fc b7 e4 ec f5 73 37 fc bb d3 62 68 90 3d |.......s7...bh.=| +00000190 69 02 65 d5 35 6c 9b 89 68 c2 93 df 84 e3 f0 5f |i.e.5l..h......_| +000001a0 35 c7 05 d1 4d 60 93 b9 1d 5e 39 78 fd ed 85 f7 |5...M`...^9x....| +000001b0 1b 82 f6 cc 0a 02 5e f6 e0 7a 78 55 3a 12 e3 b3 |......^..zxU:...| +000001c0 45 ab 7e f0 12 2e 28 11 fd 73 7e 05 ef e1 c2 a0 |E.~...(..s~.....| +000001d0 45 ac 2e 3c 0b 00 69 ad 01 78 c7 2b 15 4e 6b eb |E..<..i..x.+.Nk.| +000001e0 65 3d d8 c2 4b e6 9d 73 35 62 4f 58 d1 ec 7f 8d |e=..K..s5bOX....| +000001f0 6e 56 66 06 cf 90 56 09 70 53 bd ed 16 ff c1 14 |nVf...V.pS......| +00000200 7f 1b 13 80 73 d2 7d f3 85 99 bd f2 f8 16 65 00 |....s.}.......e.| +00000210 97 51 12 64 7a 34 20 b1 1a d9 fb 5c 38 e6 b7 ae |.Q.dz4 ....\8...| +00000220 99 34 6d 1a 87 30 09 96 13 04 f9 4d 51 b7 f5 76 |.4m..0.....MQ..v| +00000230 30 ac 18 05 ba e4 0e 3d 28 6e 09 5e ec 52 18 d4 |0......=(n.^.R..| +00000240 1e da d3 7e b4 16 ff 76 4e 31 10 42 5a 7e 75 ea |...~...vN1.BZ~u.| +00000250 86 82 4e ad 7a 11 1d a8 6b ab 5c 7d bd 7b 07 b8 |..N.z...k.\}.{..| +00000260 aa bb 13 57 4a 24 d1 92 1d bb b9 7b 46 8b 7e 69 |...WJ$.....{F.~i| +00000270 9c a5 ea a6 9d 20 42 b1 92 4f b6 0e 48 8a 29 be |..... B..O..H.).| +00000280 67 19 b8 5b 27 7f fd c0 7e b1 01 e0 19 42 bb 19 |g..['...~....B..| +00000290 c4 91 b0 52 3e 0b 4c a6 2b 03 ff e3 e2 b9 d7 54 |...R>.L.+......T| +000002a0 77 4c 04 83 c6 41 3b 8f ee 8a 70 d8 16 e7 02 6f |wL...A;...p....o| +000002b0 13 9c a4 22 1d 1b cc 9e 6a 0e e8 96 94 54 df 2e |..."....j....T..| +000002c0 8a 60 53 e2 45 30 7b 8f 46 d2 ab 0e c1 6d 75 e2 |.`S.E0{.F....mu.| +000002d0 cf 6c fe 9e 2d 31 af 9e 51 73 a6 39 02 ff 7b c2 |.l..-1..Qs.9..{.| +000002e0 da 66 d6 27 87 9d 51 99 c9 7e 1b e7 43 8d 1e dc |.f.'..Q..~..C...| +000002f0 49 93 0e 9c 47 5c d6 97 19 ee 80 6d 4f 92 9d 25 |I...G\.....mO..%| +00000300 ff ea bf ab 9a 64 a6 d4 70 80 5e 13 42 48 75 4e |.....d..p.^.BHuN| +00000310 8c c3 9b 17 03 03 00 99 7b 4a 09 b6 85 dc 5c 10 |........{J....\.| +00000320 76 05 e8 11 e1 bc 63 ec ec b8 19 14 f3 95 16 6b |v.....c........k| +00000330 2a a6 e1 ae b9 1c e0 5c 94 20 49 62 8c fd 76 7e |*......\. Ib..v~| +00000340 0e f9 9f ec 0d 01 47 4b 86 a8 b1 9f a2 bc 83 85 |......GK........| +00000350 de e8 e0 2f c4 a4 f6 90 72 57 38 ad 2e aa 1e 4f |.../....rW8....O| +00000360 d4 8b e1 a2 b8 ba 80 99 ad 57 09 72 98 1c 5b 7b |.........W.r..[{| +00000370 a7 35 a2 c5 4a be 76 14 ee d4 63 a9 96 5e 33 7c |.5..J.v...c..^3|| +00000380 0a e0 15 0d 14 19 f1 5a 5a e4 2c 9c 22 19 db e3 |.......ZZ.,."...| +00000390 ea ee a1 c6 f8 1d 22 cc 5c 34 94 fa af 02 b0 26 |......".\4.....&| +000003a0 8d 25 67 e6 f5 74 a9 38 38 37 57 ee 11 ac 0a 73 |.%g..t.887W....s| +000003b0 01 17 03 03 00 35 bf ef 2c 2e 6c ae 90 ba d7 e0 |.....5..,.l.....| +000003c0 99 b3 ea 42 db 8e ad 03 5b af 93 1e 35 3a fb f7 |...B....[...5:..| +000003d0 87 bc 90 b6 98 ad e2 e6 1c 24 3b c1 20 8c 1a 79 |.........$;. ..y| +000003e0 97 ad e3 8b 08 7b cc 7e 2b 98 fa |.....{.~+..| >>> Flow 3 (client to server) -00000000 14 03 03 00 01 01 17 03 03 00 35 73 82 31 66 2c |..........5s.1f,| -00000010 6e 22 2d 6f b5 30 4d db eb f0 91 2e b1 11 6d 0e |n"-o.0M.......m.| -00000020 ca 50 e6 ce 92 bc 44 8c e4 e4 3b 8f 13 82 6e 9c |.P....D...;...n.| -00000030 bb 25 bc 36 e8 27 5a c1 8f ed 6d fc f1 8c 8a e1 |.%.6.'Z...m.....| -00000040 17 03 03 00 17 66 bb ee 75 14 79 25 af 92 97 ad |.....f..u.y%....| -00000050 ac 26 bf 2e 37 c1 12 e2 ab 65 1f ac |.&..7....e..| ->>> Flow 4 (server to client) -00000000 17 03 03 00 da 19 f9 46 cf 64 be 58 bf d0 24 37 |.......F.d.X..$7| -00000010 9d 7a 91 0d 24 60 d7 a7 b8 8f dc ca db e2 b3 c6 |.z..$`..........| -00000020 ec 6e 30 f6 88 8b c9 18 92 b8 f1 06 09 82 49 c5 |.n0...........I.| -00000030 89 9b a0 76 8e 55 e0 52 ca 12 88 ef dc 62 7c ad |...v.U.R.....b|.| -00000040 b1 66 cb 23 b9 3b 7f 4f d9 da 02 d8 9c c2 f8 66 |.f.#.;.O.......f| -00000050 26 60 57 a7 99 76 d2 de 15 98 e5 9f b5 b0 54 82 |&`W..v........T.| -00000060 a9 88 76 25 aa bd 10 7b 47 0b 3d e4 c4 a2 fd 5f |..v%...{G.=...._| -00000070 71 da aa 6b 4b e4 77 1e 85 7c f0 6d b8 f2 5b f3 |q..kK.w..|.m..[.| -00000080 df 73 1e df a0 60 bb 8e 53 4b 5b ac 16 49 aa 15 |.s...`..SK[..I..| -00000090 11 bf e1 91 a1 03 df 3d 5f 68 a0 93 08 53 c8 98 |.......=_h...S..| -000000a0 77 b9 22 70 63 44 21 23 22 0c 27 2f b3 22 fd 47 |w."pcD!#".'/.".G| -000000b0 a1 b9 27 8c 10 b0 e7 db 36 d1 0f 45 d4 59 24 cd |..'.....6..E.Y$.| -000000c0 84 db 5f e1 db 8f f8 a6 d7 11 04 6f b4 10 e7 48 |.._........o...H| -000000d0 f7 50 4e 32 f4 a0 ed 37 04 0d 6b f9 7d 30 e8 17 |.PN2...7..k.}0..| -000000e0 03 03 00 da 22 55 eb fb b6 0d 36 a1 46 10 2c 0a |...."U....6.F.,.| -000000f0 22 00 59 c0 e2 69 98 4d f8 38 4b 23 d0 49 a2 3e |".Y..i.M.8K#.I.>| -00000100 d6 f3 64 f7 e1 47 39 a4 90 a5 17 81 c4 9a 2a 0f |..d..G9.......*.| -00000110 6f e9 71 9a 9e e5 c6 e4 5b fe 91 4a 78 68 9b d7 |o.q.....[..Jxh..| -00000120 3e 2b c4 81 cd 0b 7a 1a a0 5d 85 5b 49 db 15 0b |>+....z..].[I...| -00000130 c8 90 34 e6 8e 5f 44 4e 85 07 23 4c aa 41 8a 94 |..4.._DN..#L.A..| -00000140 49 87 69 39 e3 0c 6f 80 19 7c 81 4a 8a 42 5b ed |I.i9..o..|.J.B[.| -00000150 1d 65 0b 7e f0 28 60 87 24 ce 23 4e 34 6e f2 10 |.e.~.(`.$.#N4n..| -00000160 91 85 b1 a0 10 6c ec 30 c0 c3 dd b7 d8 eb 59 71 |.....l.0......Yq| -00000170 80 20 8a 58 f1 79 f7 70 e9 fa d5 12 58 fd 68 06 |. .X.y.p....X.h.| -00000180 66 3e 0a 21 4d 9c aa df 92 fc b4 1f 20 e4 df 98 |f>.!M....... ...| -00000190 c4 11 e1 7b 1f 55 6c e5 75 c1 b9 b6 29 91 85 58 |...{.Ul.u...)..X| -000001a0 85 a0 7c 9f 29 ea 51 3e 4a 93 21 e6 3a ce 69 c5 |..|.).Q>J.!.:.i.| -000001b0 60 77 ca fc 04 13 f7 6e ce 14 73 8d 21 b1 |`w.....n..s.!.| ->>> Flow 5 (client to server) -00000000 17 03 03 00 13 03 3a 80 ef 54 48 49 d8 a1 d8 66 |......:..THI...f| -00000010 3d 5b 76 16 c0 d6 68 5e |=[v...h^| +00000000 14 03 03 00 01 01 17 03 03 00 35 ce 50 b5 dc 27 |..........5.P..'| +00000010 34 5b ea 1b 27 76 67 d1 9e 24 cf f9 51 4a 9a 6b |4[..'vg..$..QJ.k| +00000020 cd 57 12 b2 5a 52 03 be e8 62 e2 29 64 1e 16 f1 |.W..ZR...b.)d...| +00000030 61 af 70 a7 11 f1 41 ef e3 44 da 0e 9b 90 05 ad |a.p...A..D......| +00000040 17 03 03 00 17 b4 9d 4e de fb da 13 02 ad 51 40 |.......N......Q@| +00000050 b0 55 1d 89 ec 09 2b 52 e5 51 34 1f 17 03 03 00 |.U....+R.Q4.....| +00000060 13 52 89 42 ba d7 14 f0 53 b4 b1 5a a5 a3 37 55 |.R.B....S..Z..7U| +00000070 bd f8 e9 e5 |....| From 311d87dbebbb0238196d3aa13fd9a37f655e1fc3 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Wed, 28 Nov 2018 19:57:13 +1100 Subject: [PATCH 162/594] debug/pe: use ws2_32.dll in TestImportTableInUnknownSection Apparently (see https://github.com/golang/go/issues/27904#issuecomment-442140627 for details) kernel32.dll file is not present on windows/arm, so use ws2_32.dll instead. ws2_32.dll imports table also lives in '.rdata' section, so ws2_32.dll is as good as kernel32.dll for testing issue #16103. Updates #27904 Change-Id: Ibc72b24eea9a4d85abd371ffdcf00442e711b745 Reviewed-on: https://go-review.googlesource.com/c/151480 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick --- src/debug/pe/file_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug/pe/file_test.go b/src/debug/pe/file_test.go index 5b9fe521d2579..9613af3a3c3c0 100644 --- a/src/debug/pe/file_test.go +++ b/src/debug/pe/file_test.go @@ -603,9 +603,9 @@ func TestImportTableInUnknownSection(t *testing.T) { t.Skip("skipping Windows-only test") } - // kernel32.dll import table is located in ".rdata" section, + // ws2_32.dll import table is located in ".rdata" section, // so it is good enough to test issue #16103. - const filename = "kernel32.dll" + const filename = "ws2_32.dll" path, err := exec.LookPath(filename) if err != nil { t.Fatalf("unable to locate required file %q in search path: %s", filename, err) From 2b58ca6e3de3d93817a4e6cc55378015eb3c2040 Mon Sep 17 00:00:00 2001 From: David Chase Date: Fri, 26 Oct 2018 12:00:07 -0400 Subject: [PATCH 163/594] cmd/compile: begin OpArg and OpPhi location lists at block start For the entry block, make the "first instruction" be truly the first instruction. This allows printing of incoming parameters with Delve. Also be sure Phis are marked as being at the start of their block. This is observed to move location list pointers, and where moved, they become correct. Leading zero-width instructions include LoweredGetClosurePtr. Because this instruction is actually architecture-specific, and it is now tested for in 3 different places, also created Op.isLoweredGetClosurePtr() to reduce future surprises. Change-Id: Ic043b7265835cf1790382a74334b5714ae4060af Reviewed-on: https://go-review.googlesource.com/c/145179 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick --- src/cmd/compile/internal/gc/ssa.go | 6 +++- src/cmd/compile/internal/ssa/debug.go | 43 +++++++++++++++++++----- src/cmd/compile/internal/ssa/schedule.go | 20 +++++++---- src/cmd/compile/internal/ssa/tighten.go | 13 ++++--- 4 files changed, 60 insertions(+), 22 deletions(-) diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 51fd589db99f3..d7fc4adb8a86a 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -5190,6 +5190,10 @@ func genssa(f *ssa.Func, pp *Progs) { e.curfn.Func.DebugInfo.GetPC = func(b, v ssa.ID) int64 { switch v { case ssa.BlockStart.ID: + if b == f.Entry.ID { + return 0 // Start at the very beginning, at the assembler-generated prologue. + // this should only happen for function args (ssa.OpArg) + } return bstart[b].Pc case ssa.BlockEnd.ID: return e.curfn.Func.lsym.Size @@ -5199,7 +5203,7 @@ func genssa(f *ssa.Func, pp *Progs) { } } - // Resolove branchers, and relax DefaultStmt into NotStmt + // Resolve branches, and relax DefaultStmt into NotStmt for _, br := range s.Branches { br.P.To.Val = s.bstart[br.B.ID] if br.P.Pos.IsStmt() != src.PosIsStmt { diff --git a/src/cmd/compile/internal/ssa/debug.go b/src/cmd/compile/internal/ssa/debug.go index 3d0be0fe1c899..b6c25f6573dff 100644 --- a/src/cmd/compile/internal/ssa/debug.go +++ b/src/cmd/compile/internal/ssa/debug.go @@ -826,6 +826,7 @@ func firstReg(set RegisterSet) uint8 { func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) { // Run through the function in program text order, building up location // lists as we go. The heavy lifting has mostly already been done. + for _, b := range state.f.Blocks { if !blockLocs[b.ID].relevant { continue @@ -834,13 +835,24 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) { state.mergePredecessors(b, blockLocs) zeroWidthPending := false + apcChangedSize := 0 // size of changedVars for leading Args, Phi, ClosurePtr + // expect to see values in pattern (apc)* (zerowidth|real)* for _, v := range b.Values { slots := state.valueNames[v.ID] reg, _ := state.f.getHome(v.ID).(*Register) - changed := state.processValue(v, slots, reg) + changed := state.processValue(v, slots, reg) // changed == added to state.changedVars if opcodeTable[v.Op].zeroWidth { if changed { + if v.Op == OpArg || v.Op == OpPhi || v.Op.isLoweredGetClosurePtr() { + // These ranges begin at true beginning of block, not after first instruction + if zeroWidthPending { + b.Func.Fatalf("Unexpected op mixed with OpArg/OpPhi/OpLoweredGetClosurePtr at beginning of block %s in %s\n%s", b, b.Func.Name, b.Func) + } + apcChangedSize = len(state.changedVars.contents()) + continue + } + // Other zero-width ops must wait on a "real" op. zeroWidthPending = true } continue @@ -849,12 +861,25 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) { if !changed && !zeroWidthPending { continue } + // Not zero-width; i.e., a "real" instruction. zeroWidthPending = false - for _, varID := range state.changedVars.contents() { - state.updateVar(VarID(varID), v, state.currentState.slots) + for i, varID := range state.changedVars.contents() { + if i < apcChangedSize { // buffered true start-of-block changes + state.updateVar(VarID(varID), v.Block, BlockStart) + } else { + state.updateVar(VarID(varID), v.Block, v) + } } state.changedVars.clear() + apcChangedSize = 0 + } + for i, varID := range state.changedVars.contents() { + if i < apcChangedSize { // buffered true start-of-block changes + state.updateVar(VarID(varID), b, BlockStart) + } else { + state.updateVar(VarID(varID), b, BlockEnd) + } } } @@ -877,8 +902,10 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) { } // updateVar updates the pending location list entry for varID to -// reflect the new locations in curLoc, caused by v. -func (state *debugState) updateVar(varID VarID, v *Value, curLoc []VarLoc) { +// reflect the new locations in curLoc, beginning at v in block b. +// v may be one of the special values indicating block start or end. +func (state *debugState) updateVar(varID VarID, b *Block, v *Value) { + curLoc := state.currentState.slots // Assemble the location list entry with whatever's live. empty := true for _, slotID := range state.varSlots[varID] { @@ -889,7 +916,7 @@ func (state *debugState) updateVar(varID VarID, v *Value, curLoc []VarLoc) { } pending := &state.pendingEntries[varID] if empty { - state.writePendingEntry(varID, v.Block.ID, v.ID) + state.writePendingEntry(varID, b.ID, v.ID) pending.clear() return } @@ -908,9 +935,9 @@ func (state *debugState) updateVar(varID VarID, v *Value, curLoc []VarLoc) { } } - state.writePendingEntry(varID, v.Block.ID, v.ID) + state.writePendingEntry(varID, b.ID, v.ID) pending.present = true - pending.startBlock = v.Block.ID + pending.startBlock = b.ID pending.startValue = v.ID for i, slot := range state.varSlots[varID] { pending.pieces[i] = curLoc[slot] diff --git a/src/cmd/compile/internal/ssa/schedule.go b/src/cmd/compile/internal/ssa/schedule.go index 1f9edb1937d03..c5b4c538434f9 100644 --- a/src/cmd/compile/internal/ssa/schedule.go +++ b/src/cmd/compile/internal/ssa/schedule.go @@ -62,6 +62,16 @@ func (h ValHeap) Less(i, j int) bool { return x.ID > y.ID } +func (op Op) isLoweredGetClosurePtr() bool { + switch op { + case OpAMD64LoweredGetClosurePtr, OpPPC64LoweredGetClosurePtr, OpARMLoweredGetClosurePtr, OpARM64LoweredGetClosurePtr, + Op386LoweredGetClosurePtr, OpMIPS64LoweredGetClosurePtr, OpS390XLoweredGetClosurePtr, OpMIPSLoweredGetClosurePtr, + OpWasmLoweredGetClosurePtr: + return true + } + return false +} + // Schedule the Values in each Block. After this phase returns, the // order of b.Values matters and is the order in which those values // will appear in the assembly output. For now it generates a @@ -92,11 +102,7 @@ func schedule(f *Func) { // Compute score. Larger numbers are scheduled closer to the end of the block. for _, v := range b.Values { switch { - case v.Op == OpAMD64LoweredGetClosurePtr || v.Op == OpPPC64LoweredGetClosurePtr || - v.Op == OpARMLoweredGetClosurePtr || v.Op == OpARM64LoweredGetClosurePtr || - v.Op == Op386LoweredGetClosurePtr || v.Op == OpMIPS64LoweredGetClosurePtr || - v.Op == OpS390XLoweredGetClosurePtr || v.Op == OpMIPSLoweredGetClosurePtr || - v.Op == OpWasmLoweredGetClosurePtr: + case v.Op.isLoweredGetClosurePtr(): // We also score GetLoweredClosurePtr as early as possible to ensure that the // context register is not stomped. GetLoweredClosurePtr should only appear // in the entry block where there are no phi functions, so there is no @@ -189,9 +195,11 @@ func schedule(f *Func) { } } - if b.Control != nil && b.Control.Op != OpPhi { + if b.Control != nil && b.Control.Op != OpPhi && b.Control.Op != OpArg { // Force the control value to be scheduled at the end, // unless it is a phi value (which must be first). + // OpArg also goes first -- if it is stack it register allocates + // to a LoadReg, if it is register it is from the beginning anyway. score[b.Control.ID] = ScoreControl // Schedule values dependent on the control value at the end. diff --git a/src/cmd/compile/internal/ssa/tighten.go b/src/cmd/compile/internal/ssa/tighten.go index 3713269376977..580a06dfde588 100644 --- a/src/cmd/compile/internal/ssa/tighten.go +++ b/src/cmd/compile/internal/ssa/tighten.go @@ -13,15 +13,14 @@ func tighten(f *Func) { canMove := make([]bool, f.NumValues()) for _, b := range f.Blocks { for _, v := range b.Values { + if v.Op.isLoweredGetClosurePtr() { + // Must stay in the entry block. + continue + } switch v.Op { - case OpPhi, OpArg, OpSelect0, OpSelect1, - OpAMD64LoweredGetClosurePtr, Op386LoweredGetClosurePtr, - OpARMLoweredGetClosurePtr, OpARM64LoweredGetClosurePtr, - OpMIPSLoweredGetClosurePtr, OpMIPS64LoweredGetClosurePtr, - OpS390XLoweredGetClosurePtr, OpPPC64LoweredGetClosurePtr, - OpWasmLoweredGetClosurePtr: + case OpPhi, OpArg, OpSelect0, OpSelect1: // Phis need to stay in their block. - // GetClosurePtr & Arg must stay in the entry block. + // Arg must stay in the entry block. // Tuple selectors must stay with the tuple generator. continue } From 70a684cf44cc3398c44afcd69387d7938d90f063 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Wed, 28 Nov 2018 10:50:54 -0500 Subject: [PATCH 164/594] go/internal/gccgoimporter: additional V3 export data changes This patch merges in support for reading the most recent incarnation of V3 export data (initial inline function bodies), from the importer portions of https://golang.org/cl/150061 and https://golang.org/cl/150067. Updates #28961. Change-Id: I34e837acbf48b8fd1a4896a1a977d2241adfb28d Reviewed-on: https://go-review.googlesource.com/c/151557 Run-TryBot: Than McIntosh TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor Reviewed-by: Cherry Zhang --- src/go/internal/gccgoimporter/parser.go | 72 ++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 6 deletions(-) diff --git a/src/go/internal/gccgoimporter/parser.go b/src/go/internal/gccgoimporter/parser.go index 6fab1ef409a4f..e75f15c429f4d 100644 --- a/src/go/internal/gccgoimporter/parser.go +++ b/src/go/internal/gccgoimporter/parser.go @@ -15,6 +15,7 @@ import ( "strconv" "strings" "text/scanner" + "unicode/utf8" ) type parser struct { @@ -41,7 +42,7 @@ func (p *parser) init(filename string, src io.Reader, imports map[string]*types. func (p *parser) initScanner(filename string, src io.Reader) { p.scanner.Init(src) p.scanner.Error = func(_ *scanner.Scanner, msg string) { p.error(msg) } - p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanFloats | scanner.ScanStrings | scanner.ScanComments | scanner.SkipComments + p.scanner.Mode = scanner.ScanIdents | scanner.ScanInts | scanner.ScanFloats | scanner.ScanStrings p.scanner.Whitespace = 1<<'\t' | 1<<' ' p.scanner.Filename = filename // for good error messages p.next() @@ -281,6 +282,15 @@ func (p *parser) parseConversion(pkg *types.Package) (val constant.Value, typ ty // ConstValue = string | "false" | "true" | ["-"] (int ["'"] | FloatOrComplex) | Conversion . // FloatOrComplex = float ["i" | ("+"|"-") float "i"] . func (p *parser) parseConstValue(pkg *types.Package) (val constant.Value, typ types.Type) { + // v3 changed to $false, $true, $convert, to avoid confusion + // with variable names in inline function bodies. + if p.tok == '$' { + p.next() + if p.tok != scanner.Ident { + p.errorf("expected identifer after '$', got %s (%q)", scanner.TokenString(p.tok), p.lit) + } + } + switch p.tok { case scanner.String: str := p.parseString() @@ -443,7 +453,7 @@ func (p *parser) update(t types.Type, nlist []int) { // NamedType = TypeName [ "=" ] Type { Method } . // TypeName = ExportedName . -// Method = "func" "(" Param ")" Name ParamList ResultList ";" . +// Method = "func" "(" Param ")" Name ParamList ResultList [InlineBody] ";" . func (p *parser) parseNamedType(nlist []int) types.Type { pkg, name := p.parseExportedName() scope := pkg.Scope() @@ -508,6 +518,7 @@ func (p *parser) parseNamedType(nlist []int) types.Type { name := p.parseName() params, isVariadic := p.parseParamList(pkg) results := p.parseResultList(pkg) + p.skipInlineBody() p.expectEOL() sig := types.NewSignature(receiver, params, results, isVariadic) @@ -653,7 +664,11 @@ func (p *parser) parseParamList(pkg *types.Package) (*types.Tuple, bool) { func (p *parser) parseResultList(pkg *types.Package) *types.Tuple { switch p.tok { case '<': - return types.NewTuple(types.NewParam(token.NoPos, pkg, "", p.parseType(pkg))) + p.next() + if p.tok == scanner.Ident && p.lit == "inl" { + return nil + } + return types.NewTuple(types.NewParam(token.NoPos, pkg, "", p.parseTypeAfterAngle(pkg))) case '(': params, _ := p.parseParamList(pkg) @@ -676,7 +691,7 @@ func (p *parser) parseFunctionType(pkg *types.Package, nlist []int) *types.Signa return t } -// Func = Name FunctionType . +// Func = Name FunctionType [InlineBody] . func (p *parser) parseFunc(pkg *types.Package) *types.Func { name := p.parseName() if strings.ContainsRune(name, '$') { @@ -685,7 +700,9 @@ func (p *parser) parseFunc(pkg *types.Package) *types.Func { p.discardDirectiveWhileParsingTypes(pkg) return nil } - return types.NewFunc(token.NoPos, pkg, name, p.parseFunctionType(pkg, nil)) + f := types.NewFunc(token.NoPos, pkg, name, p.parseFunctionType(pkg, nil)) + p.skipInlineBody() + return f } // InterfaceType = "interface" "{" { ("?" Type | Func) ";" } "}" . @@ -823,8 +840,13 @@ func lookupBuiltinType(typ int) types.Type { // // parseType updates the type map to t for all type numbers n. // -func (p *parser) parseType(pkg *types.Package, n ...int) (t types.Type) { +func (p *parser) parseType(pkg *types.Package, n ...int) types.Type { p.expect('<') + return p.parseTypeAfterAngle(pkg, n...) +} + +// (*parser).Type after reading the "<". +func (p *parser) parseTypeAfterAngle(pkg *types.Package, n ...int) (t types.Type) { p.expectKeyword("type") switch p.tok { @@ -863,6 +885,39 @@ func (p *parser) parseType(pkg *types.Package, n ...int) (t types.Type) { return } +// InlineBody = "" .{NN} +// Reports whether a body was skipped. +func (p *parser) skipInlineBody() { + // We may or may not have seen the '<' already, depending on + // whether the function had a result type or not. + if p.tok == '<' { + p.next() + p.expectKeyword("inl") + } else if p.tok != scanner.Ident || p.lit != "inl" { + return + } else { + p.next() + } + + p.expect(':') + want := p.parseInt() + p.expect('>') + + defer func(w uint64) { + p.scanner.Whitespace = w + }(p.scanner.Whitespace) + p.scanner.Whitespace = 0 + + got := 0 + for got < want { + r := p.scanner.Next() + if r == scanner.EOF { + p.error("unexpected EOF") + } + got += utf8.RuneLen(r) + } +} + // Types = "types" maxp1 exportedp1 (offset length)* . func (p *parser) parseTypes(pkg *types.Package) { maxp1 := p.parseInt() @@ -882,6 +937,11 @@ func (p *parser) parseTypes(pkg *types.Package) { total += len } + defer func(w uint64) { + p.scanner.Whitespace = w + }(p.scanner.Whitespace) + p.scanner.Whitespace = 0 + // We should now have p.tok pointing to the final newline. // The next runes from the scanner should be the type data. From 2012227b01020eb505cf1dbe719b1fa74ed8c5f4 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 5 Nov 2018 15:01:53 -0500 Subject: [PATCH 165/594] vendor/golang_org/x: move to internal/x Packages in vendor/ directories have a "vendor/" path prefix in GOPATH mode, but intentionally do not in module mode. Since the import path is embedded in the compiled output, changing that path invalidates cache entries and causes cmd/go to try to rebuild (and reinstall) the vendored libraries, which will fail if the directory containing those libraries is read-only. If I understood correctly, this is the approach Russ suggested as an alternative to https://golang.org/cl/136138. Fixes #27285 Fixes #26988 Change-Id: I8a2507fa892b84cde0a803aaa79e460723da572b Reviewed-on: https://go-review.googlesource.com/c/147443 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/api/goapi.go | 7 +---- src/cmd/go/go_test.go | 16 ---------- src/cmd/go/internal/load/pkg.go | 14 --------- src/cmd/go/internal/modload/import.go | 3 -- src/cmd/go/testdata/script/list_importmap.txt | 25 ++++++++++++++++ src/cmd/go/testdata/script/list_std.txt | 2 +- src/cmd/go/testdata/script/mod_internal.txt | 13 -------- src/cmd/go/testdata/script/mod_std_vendor.txt | 2 +- src/crypto/tls/cipher_suites.go | 2 +- src/crypto/tls/handshake_messages.go | 2 +- src/crypto/tls/key_schedule.go | 6 ++-- src/crypto/tls/ticket.go | 2 +- src/crypto/x509/x509.go | 4 +-- src/go/build/build_test.go | 30 +++++++++++++------ src/go/build/deps_test.go | 30 +++++++++---------- src/go/build/testdata/withvendor/src/a/b/b.go | 3 ++ .../testdata/withvendor/src/a/vendor/c/d/d.go | 1 + .../internal/srcimporter/srcimporter_test.go | 2 +- .../chacha20poly1305/chacha20poly1305.go | 2 +- .../chacha20poly1305_amd64.go | 0 .../chacha20poly1305/chacha20poly1305_amd64.s | 0 .../chacha20poly1305_generic.go | 4 +-- .../chacha20poly1305_noasm.go | 0 .../chacha20poly1305/chacha20poly1305_test.go | 0 .../chacha20poly1305_vectors_test.go | 0 .../x/crypto/cryptobyte/asn1.go | 2 +- .../x/crypto/cryptobyte/asn1/asn1.go | 2 +- .../x/crypto/cryptobyte/asn1_test.go | 2 +- .../x/crypto/cryptobyte/builder.go | 0 .../x/crypto/cryptobyte/cryptobyte_test.go | 0 .../x/crypto/cryptobyte/example_test.go | 4 +-- .../x/crypto/cryptobyte/string.go | 2 +- .../x/crypto/curve25519/const_amd64.h | 0 .../x/crypto/curve25519/const_amd64.s | 0 .../x/crypto/curve25519/cswap_amd64.s | 0 .../x/crypto/curve25519/curve25519.go | 0 .../x/crypto/curve25519/curve25519_test.go | 0 .../x/crypto/curve25519/doc.go | 2 +- .../x/crypto/curve25519/freeze_amd64.s | 0 .../x/crypto/curve25519/ladderstep_amd64.s | 0 .../x/crypto/curve25519/mont25519_amd64.go | 0 .../x/crypto/curve25519/mul_amd64.s | 0 .../x/crypto/curve25519/square_amd64.s | 0 .../x/crypto/hkdf/example_test.go | 2 +- .../x/crypto/hkdf/hkdf.go | 2 +- .../x/crypto/hkdf/hkdf_test.go | 0 .../x/crypto/internal/chacha20/asm_s390x.s | 0 .../internal/chacha20/chacha_generic.go | 0 .../crypto/internal/chacha20/chacha_noasm.go | 0 .../crypto/internal/chacha20/chacha_s390x.go | 0 .../x/crypto/internal/chacha20/chacha_test.go | 0 .../crypto/internal/chacha20/vectors_test.go | 0 .../x/crypto/internal/chacha20/xor.go | 0 .../x/crypto/poly1305/poly1305.go | 2 +- .../x/crypto/poly1305/poly1305_test.go | 0 .../x/crypto/poly1305/sum_amd64.go | 0 .../x/crypto/poly1305/sum_amd64.s | 0 .../x/crypto/poly1305/sum_arm.go | 0 .../x/crypto/poly1305/sum_arm.s | 0 .../x/crypto/poly1305/sum_noasm.go | 0 .../x/crypto/poly1305/sum_ref.go | 0 .../x/crypto/poly1305/sum_s390x.go | 0 .../x/crypto/poly1305/sum_s390x.s | 0 .../x/crypto/poly1305/sum_vmsl_s390x.s | 0 .../x/crypto/poly1305/vectors_test.go | 0 src/internal/x/fiximports.bash | 6 ++++ .../x/net/dns/dnsmessage/example_test.go | 2 +- .../x/net/dns/dnsmessage/message.go | 0 .../x/net/dns/dnsmessage/message_test.go | 0 .../x/net/http/httpguts/guts.go | 0 .../x/net/http/httpguts/httplex.go | 2 +- .../x/net/http/httpguts/httplex_test.go | 0 .../x/net/http/httpproxy/export_test.go | 0 .../x/net/http/httpproxy/proxy.go | 2 +- .../x/net/http/httpproxy/proxy_test.go | 2 +- .../x/net/http2/hpack/encode.go | 0 .../x/net/http2/hpack/encode_test.go | 0 .../x/net/http2/hpack/hpack.go | 0 .../x/net/http2/hpack/hpack_test.go | 0 .../x/net/http2/hpack/huffman.go | 0 .../x/net/http2/hpack/tables.go | 0 .../x/net/http2/hpack/tables_test.go | 0 .../x/net/idna/idna.go | 8 ++--- .../x/net/idna/punycode.go | 0 .../x/net/idna/punycode_test.go | 0 .../x/net/idna/tables.go | 2 +- .../x/net/idna/trie.go | 0 .../x/net/idna/trieval.go | 2 +- .../x/net/internal/nettest/helper_bsd.go | 0 .../x/net/internal/nettest/helper_nobsd.go | 0 .../x/net/internal/nettest/helper_posix.go | 0 .../x/net/internal/nettest/helper_stub.go | 0 .../x/net/internal/nettest/helper_unix.go | 0 .../x/net/internal/nettest/helper_windows.go | 0 .../x/net/internal/nettest/interface.go | 0 .../x/net/internal/nettest/rlimit.go | 0 .../x/net/internal/nettest/stack.go | 2 +- .../x/net/lif/address.go | 0 .../x/net/lif/address_test.go | 0 .../x/net/lif/binary.go | 0 .../x/net/lif/defs_solaris.go | 0 .../golang_org => internal}/x/net/lif/lif.go | 0 .../golang_org => internal}/x/net/lif/link.go | 0 .../x/net/lif/link_test.go | 0 .../golang_org => internal}/x/net/lif/sys.go | 0 .../x/net/lif/sys_solaris_amd64.s | 0 .../x/net/lif/syscall.go | 0 .../x/net/lif/zsys_solaris_amd64.go | 0 .../x/net/nettest/conntest.go | 0 .../x/net/nettest/conntest_go16.go | 0 .../x/net/nettest/conntest_go17.go | 0 .../x/net/nettest/conntest_test.go | 2 +- .../x/net/route/address.go | 0 .../x/net/route/address_darwin_test.go | 0 .../x/net/route/address_test.go | 0 .../x/net/route/binary.go | 0 .../x/net/route/defs_darwin.go | 0 .../x/net/route/defs_dragonfly.go | 0 .../x/net/route/defs_freebsd.go | 0 .../x/net/route/defs_netbsd.go | 0 .../x/net/route/defs_openbsd.go | 0 .../x/net/route/empty.s | 0 .../x/net/route/interface.go | 0 .../x/net/route/interface_announce.go | 0 .../x/net/route/interface_classic.go | 0 .../x/net/route/interface_freebsd.go | 0 .../x/net/route/interface_multicast.go | 0 .../x/net/route/interface_openbsd.go | 0 .../x/net/route/message.go | 0 .../x/net/route/message_darwin_test.go | 0 .../x/net/route/message_freebsd_test.go | 0 .../x/net/route/message_test.go | 0 .../x/net/route/route.go | 0 .../x/net/route/route_classic.go | 0 .../x/net/route/route_openbsd.go | 0 .../x/net/route/route_test.go | 0 .../x/net/route/sys.go | 0 .../x/net/route/sys_darwin.go | 0 .../x/net/route/sys_dragonfly.go | 0 .../x/net/route/sys_freebsd.go | 0 .../x/net/route/sys_netbsd.go | 0 .../x/net/route/sys_openbsd.go | 0 .../x/net/route/syscall.go | 0 .../x/net/route/syscall_go1_11_darwin.go | 0 .../x/net/route/syscall_go1_12_darwin.go | 0 .../x/net/route/zsys_darwin.go | 0 .../x/net/route/zsys_dragonfly.go | 0 .../x/net/route/zsys_freebsd_386.go | 0 .../x/net/route/zsys_freebsd_amd64.go | 0 .../x/net/route/zsys_freebsd_arm.go | 0 .../x/net/route/zsys_netbsd.go | 0 .../x/net/route/zsys_openbsd.go | 0 .../x/text/secure/bidirule/bidirule.go | 4 +-- .../x/text/secure/doc.go | 2 +- .../x/text/transform/examples_test.go | 4 +-- .../x/text/transform/transform.go | 2 +- .../x/text/unicode/bidi/bidi.go | 2 +- .../x/text/unicode/bidi/bracket.go | 0 .../x/text/unicode/bidi/core.go | 0 .../x/text/unicode/bidi/example_test.go | 2 +- .../x/text/unicode/bidi/prop.go | 0 .../x/text/unicode/bidi/tables.go | 2 +- .../x/text/unicode/bidi/trieval.go | 2 +- .../x/text/unicode/doc.go | 2 +- .../x/text/unicode/norm/composition.go | 0 .../x/text/unicode/norm/example_iter_test.go | 2 +- .../x/text/unicode/norm/example_test.go | 2 +- .../x/text/unicode/norm/forminfo.go | 0 .../x/text/unicode/norm/input.go | 0 .../x/text/unicode/norm/iter.go | 0 .../x/text/unicode/norm/normalize.go | 4 +-- .../x/text/unicode/norm/readwriter.go | 0 .../x/text/unicode/norm/tables.go | 2 +- .../x/text/unicode/norm/transform.go | 2 +- .../x/text/unicode/norm/trie.go | 0 .../x/text/unicode/norm/triegen.go | 0 src/net/dnsclient.go | 2 +- src/net/dnsclient_unix.go | 2 +- src/net/dnsclient_unix_test.go | 2 +- src/net/http/h2_bundle.go | 6 ++-- src/net/http/http.go | 2 +- src/net/http/httptest/recorder.go | 2 +- src/net/http/httputil/reverseproxy.go | 2 +- src/net/http/request.go | 2 +- src/net/http/response.go | 2 +- src/net/http/server.go | 2 +- src/net/http/transfer.go | 2 +- src/net/http/transport.go | 4 +-- src/net/http/transport_test.go | 2 +- src/net/interface_bsd.go | 2 +- src/net/interface_bsdvar.go | 2 +- src/net/interface_darwin.go | 2 +- src/net/interface_freebsd.go | 2 +- src/net/interface_solaris.go | 2 +- src/net/lookup_unix.go | 2 +- src/net/pipe_test.go | 2 +- 196 files changed, 148 insertions(+), 152 deletions(-) create mode 100644 src/cmd/go/testdata/script/list_importmap.txt create mode 100644 src/go/build/testdata/withvendor/src/a/b/b.go create mode 100644 src/go/build/testdata/withvendor/src/a/vendor/c/d/d.go rename src/{vendor/golang_org => internal}/x/crypto/chacha20poly1305/chacha20poly1305.go (97%) rename src/{vendor/golang_org => internal}/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/chacha20poly1305/chacha20poly1305_generic.go (96%) rename src/{vendor/golang_org => internal}/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/chacha20poly1305/chacha20poly1305_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/cryptobyte/asn1.go (99%) rename src/{vendor/golang_org => internal}/x/crypto/cryptobyte/asn1/asn1.go (96%) rename src/{vendor/golang_org => internal}/x/crypto/cryptobyte/asn1_test.go (99%) rename src/{vendor/golang_org => internal}/x/crypto/cryptobyte/builder.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/cryptobyte/cryptobyte_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/cryptobyte/example_test.go (98%) rename src/{vendor/golang_org => internal}/x/crypto/cryptobyte/string.go (98%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/const_amd64.h (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/const_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/cswap_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/curve25519.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/curve25519_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/doc.go (94%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/freeze_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/ladderstep_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/mont25519_amd64.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/mul_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/curve25519/square_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/hkdf/example_test.go (97%) rename src/{vendor/golang_org => internal}/x/crypto/hkdf/hkdf.go (98%) rename src/{vendor/golang_org => internal}/x/crypto/hkdf/hkdf_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/internal/chacha20/asm_s390x.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/internal/chacha20/chacha_generic.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/internal/chacha20/chacha_noasm.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/internal/chacha20/chacha_s390x.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/internal/chacha20/chacha_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/internal/chacha20/vectors_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/internal/chacha20/xor.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/poly1305.go (95%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/poly1305_test.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_amd64.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_arm.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_arm.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_noasm.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_ref.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_s390x.go (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_s390x.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/sum_vmsl_s390x.s (100%) rename src/{vendor/golang_org => internal}/x/crypto/poly1305/vectors_test.go (100%) create mode 100755 src/internal/x/fiximports.bash rename src/{vendor/golang_org => internal}/x/net/dns/dnsmessage/example_test.go (98%) rename src/{vendor/golang_org => internal}/x/net/dns/dnsmessage/message.go (100%) rename src/{vendor/golang_org => internal}/x/net/dns/dnsmessage/message_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/http/httpguts/guts.go (100%) rename src/{vendor/golang_org => internal}/x/net/http/httpguts/httplex.go (99%) rename src/{vendor/golang_org => internal}/x/net/http/httpguts/httplex_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/http/httpproxy/export_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/http/httpproxy/proxy.go (99%) rename src/{vendor/golang_org => internal}/x/net/http/httpproxy/proxy_test.go (99%) rename src/{vendor/golang_org => internal}/x/net/http2/hpack/encode.go (100%) rename src/{vendor/golang_org => internal}/x/net/http2/hpack/encode_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/http2/hpack/hpack.go (100%) rename src/{vendor/golang_org => internal}/x/net/http2/hpack/hpack_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/http2/hpack/huffman.go (100%) rename src/{vendor/golang_org => internal}/x/net/http2/hpack/tables.go (100%) rename src/{vendor/golang_org => internal}/x/net/http2/hpack/tables_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/idna/idna.go (99%) rename src/{vendor/golang_org => internal}/x/net/idna/punycode.go (100%) rename src/{vendor/golang_org => internal}/x/net/idna/punycode_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/idna/tables.go (99%) rename src/{vendor/golang_org => internal}/x/net/idna/trie.go (100%) rename src/{vendor/golang_org => internal}/x/net/idna/trieval.go (97%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/helper_bsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/helper_nobsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/helper_posix.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/helper_stub.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/helper_unix.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/helper_windows.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/interface.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/rlimit.go (100%) rename src/{vendor/golang_org => internal}/x/net/internal/nettest/stack.go (98%) rename src/{vendor/golang_org => internal}/x/net/lif/address.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/address_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/binary.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/defs_solaris.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/lif.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/link.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/link_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/sys.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/sys_solaris_amd64.s (100%) rename src/{vendor/golang_org => internal}/x/net/lif/syscall.go (100%) rename src/{vendor/golang_org => internal}/x/net/lif/zsys_solaris_amd64.go (100%) rename src/{vendor/golang_org => internal}/x/net/nettest/conntest.go (100%) rename src/{vendor/golang_org => internal}/x/net/nettest/conntest_go16.go (100%) rename src/{vendor/golang_org => internal}/x/net/nettest/conntest_go17.go (100%) rename src/{vendor/golang_org => internal}/x/net/nettest/conntest_test.go (97%) rename src/{vendor/golang_org => internal}/x/net/route/address.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/address_darwin_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/address_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/binary.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/defs_darwin.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/defs_dragonfly.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/defs_freebsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/defs_netbsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/defs_openbsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/empty.s (100%) rename src/{vendor/golang_org => internal}/x/net/route/interface.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/interface_announce.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/interface_classic.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/interface_freebsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/interface_multicast.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/interface_openbsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/message.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/message_darwin_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/message_freebsd_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/message_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/route.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/route_classic.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/route_openbsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/route_test.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/sys.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/sys_darwin.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/sys_dragonfly.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/sys_freebsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/sys_netbsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/sys_openbsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/syscall.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/syscall_go1_11_darwin.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/syscall_go1_12_darwin.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/zsys_darwin.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/zsys_dragonfly.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/zsys_freebsd_386.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/zsys_freebsd_amd64.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/zsys_freebsd_arm.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/zsys_netbsd.go (100%) rename src/{vendor/golang_org => internal}/x/net/route/zsys_openbsd.go (100%) rename src/{vendor/golang_org => internal}/x/text/secure/bidirule/bidirule.go (99%) rename src/{vendor/golang_org => internal}/x/text/secure/doc.go (85%) rename src/{vendor/golang_org => internal}/x/text/transform/examples_test.go (92%) rename src/{vendor/golang_org => internal}/x/text/transform/transform.go (99%) rename src/{vendor/golang_org => internal}/x/text/unicode/bidi/bidi.go (99%) rename src/{vendor/golang_org => internal}/x/text/unicode/bidi/bracket.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/bidi/core.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/bidi/example_test.go (99%) rename src/{vendor/golang_org => internal}/x/text/unicode/bidi/prop.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/bidi/tables.go (99%) rename src/{vendor/golang_org => internal}/x/text/unicode/bidi/trieval.go (95%) rename src/{vendor/golang_org => internal}/x/text/unicode/doc.go (84%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/composition.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/example_iter_test.go (98%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/example_test.go (94%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/forminfo.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/input.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/iter.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/normalize.go (99%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/readwriter.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/tables.go (99%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/transform.go (98%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/trie.go (100%) rename src/{vendor/golang_org => internal}/x/text/unicode/norm/triegen.go (100%) diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go index 9698f25b512b7..02dfa7c841282 100644 --- a/src/cmd/api/goapi.go +++ b/src/cmd/api/goapi.go @@ -442,13 +442,8 @@ func (w *Walker) Import(name string) (*types.Package, error) { } w.imported[name] = &importing - root := w.root - if strings.HasPrefix(name, "golang_org/x/") { - root = filepath.Join(root, "vendor") - } - // Determine package files. - dir := filepath.Join(root, filepath.FromSlash(name)) + dir := filepath.Join(w.root, filepath.FromSlash(name)) if fi, err := os.Stat(dir); err != nil || !fi.IsDir() { log.Fatalf("no source in tree for import %q: %v", name, err) } diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index f956ecb9163fc..6c31f9841500f 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1207,22 +1207,6 @@ func TestImportCycle(t *testing.T) { tg.run("list", "-e", "-json", "selfimport") } -func TestListImportMap(t *testing.T) { - skipIfGccgo(t, "gccgo does not have standard packages") - tg := testgo(t) - defer tg.cleanup() - tg.parallel() - tg.run("list", "-f", "{{.ImportPath}}: {{.ImportMap}}", "net", "fmt") - tg.grepStdout(`^net: map\[(.* )?golang_org/x/net/dns/dnsmessage:vendor/golang_org/x/net/dns/dnsmessage.*\]`, "net/http should have rewritten dnsmessage import") - tg.grepStdout(`^fmt: map\[\]`, "fmt should have no rewritten imports") - tg.run("list", "-deps", "-test", "-f", "{{.ImportPath}} MAP: {{.ImportMap}}\n{{.ImportPath}} IMPORT: {{.Imports}}", "fmt") - tg.grepStdout(`^flag \[fmt\.test\] MAP: map\[fmt:fmt \[fmt\.test\]\]`, "flag [fmt.test] should import fmt [fmt.test] as fmt") - tg.grepStdout(`^fmt\.test MAP: map\[(.* )?testing:testing \[fmt\.test\]`, "fmt.test should import testing [fmt.test] as testing") - tg.grepStdout(`^fmt\.test MAP: map\[(.* )?testing:testing \[fmt\.test\]`, "fmt.test should import testing [fmt.test] as testing") - tg.grepStdoutNot(`^fmt\.test MAP: map\[(.* )?os:`, "fmt.test should not import a modified os") - tg.grepStdout(`^fmt\.test IMPORT: \[fmt \[fmt\.test\] fmt_test \[fmt\.test\] os testing \[fmt\.test\] testing/internal/testdeps \[fmt\.test\]\]`, "wrong imports for fmt.test") -} - // cmd/go: custom import path checking should not apply to Go packages without import comment. func TestIssue10952(t *testing.T) { testenv.MustHaveExternalNetwork(t) diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index ae738c6a12e52..a64bab1479cbb 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -1051,20 +1051,6 @@ func disallowVendor(srcDir string, importer *Package, importerPath, path string, return p } - // Modules must not import vendor packages in the standard library, - // but the usual vendor visibility check will not catch them - // because the module loader presents them with an ImportPath starting - // with "golang_org/" instead of "vendor/". - if p.Standard && !importer.Standard && strings.HasPrefix(p.ImportPath, "golang_org") { - perr := *p - perr.Error = &PackageError{ - ImportStack: stk.Copy(), - Err: "use of vendored package " + path + " not allowed", - } - perr.Incomplete = true - return &perr - } - if perr := disallowVendorVisibility(srcDir, p, stk); perr != p { return perr } diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go index 44c2a2372670b..ba2052d3cdd59 100644 --- a/src/cmd/go/internal/modload/import.go +++ b/src/cmd/go/internal/modload/import.go @@ -58,9 +58,6 @@ func Import(path string) (m module.Version, dir string, err error) { // Is the package in the standard library? if search.IsStandardImportPath(path) { - if strings.HasPrefix(path, "golang_org/") { - return module.Version{}, filepath.Join(cfg.GOROOT, "src/vendor", path), nil - } if goroot.IsStandardPackage(cfg.GOROOT, cfg.BuildContext.Compiler, path) { dir := filepath.Join(cfg.GOROOT, "src", path) return module.Version{}, dir, nil diff --git a/src/cmd/go/testdata/script/list_importmap.txt b/src/cmd/go/testdata/script/list_importmap.txt new file mode 100644 index 0000000000000..a42dc47f2443b --- /dev/null +++ b/src/cmd/go/testdata/script/list_importmap.txt @@ -0,0 +1,25 @@ +# gccgo does not have standard packages. +[gccgo] skip + +# fmt should have no rewritten imports. +# The import from a/b should map c/d to a's vendor directory. +go list -f '{{.ImportPath}}: {{.ImportMap}}' fmt a/b +stdout 'fmt: map\[\]' +stdout 'a/b: map\[c/d:a/vendor/c/d\]' + +# flag [fmt.test] should import fmt [fmt.test] as fmt +# fmt.test should import testing [fmt.test] as testing +# fmt.test should not import a modified os +go list -deps -test -f '{{.ImportPath}} MAP: {{.ImportMap}}{{"\n"}}{{.ImportPath}} IMPORT: {{.Imports}}' fmt +stdout '^flag \[fmt\.test\] MAP: map\[fmt:fmt \[fmt\.test\]\]' +stdout '^fmt\.test MAP: map\[(.* )?testing:testing \[fmt\.test\]' +! stdout '^fmt\.test MAP: map\[(.* )?os:' +stdout '^fmt\.test IMPORT: \[fmt \[fmt\.test\] fmt_test \[fmt\.test\] os testing \[fmt\.test\] testing/internal/testdeps \[fmt\.test\]\]' + + +-- a/b/b.go -- +package b + +import _ "c/d" +-- a/vendor/c/d/d.go -- +package d diff --git a/src/cmd/go/testdata/script/list_std.txt b/src/cmd/go/testdata/script/list_std.txt index a63d74db1205a..046bec6ac54b0 100644 --- a/src/cmd/go/testdata/script/list_std.txt +++ b/src/cmd/go/testdata/script/list_std.txt @@ -8,5 +8,5 @@ go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' ./... # our vendored packages should be reported as standard go list std cmd -stdout golang_org/x/net/http2/hpack +stdout internal/x/net/http2/hpack stdout cmd/vendor/golang\.org/x/arch/x86/x86asm diff --git a/src/cmd/go/testdata/script/mod_internal.txt b/src/cmd/go/testdata/script/mod_internal.txt index e5f5a1205ee76..5a47c3fa44ae6 100644 --- a/src/cmd/go/testdata/script/mod_internal.txt +++ b/src/cmd/go/testdata/script/mod_internal.txt @@ -18,15 +18,6 @@ stderr 'use of internal package golang.org/x/.* not allowed' ! go build ./fromstd stderr 'use of internal package internal/testenv not allowed' -# Packages found via standard-library vendoring should not leak. -! go build ./fromstdvendor -stderr 'use of vendored package golang_org/x/net/http/httpguts not allowed' - -env GO111MODULE=off -! go build ./fromstdvendor -stderr 'cannot find package "golang_org/x/net/http/httpguts" in any of:' -env GO111MODULE=on - # Dependencies should be able to use their own internal modules... rm go.mod go mod init golang.org/notx @@ -83,10 +74,6 @@ import _ "golang.org/notx/useinternal" package fromstd import _ "internal/testenv" --- fromstdvendor/useinternal.go -- -package fromstdvendor -import _ "golang_org/x/net/http/httpguts" - -- replace/golang.org/notx/internal/go.mod -- module golang.org/x/internal diff --git a/src/cmd/go/testdata/script/mod_std_vendor.txt b/src/cmd/go/testdata/script/mod_std_vendor.txt index 36d4ffca9eca5..7aa1bc353be85 100644 --- a/src/cmd/go/testdata/script/mod_std_vendor.txt +++ b/src/cmd/go/testdata/script/mod_std_vendor.txt @@ -4,7 +4,7 @@ go list -f '{{.TestImports}}' stdout net/http # from .TestImports go list -test -f '{{.Deps}}' -stdout golang_org/x/crypto # dep of .TestImports +stdout internal/x/crypto # dep of .TestImports -- go.mod -- module m diff --git a/src/crypto/tls/cipher_suites.go b/src/crypto/tls/cipher_suites.go index 26e14c9924894..ecb4db290a0f8 100644 --- a/src/crypto/tls/cipher_suites.go +++ b/src/crypto/tls/cipher_suites.go @@ -14,8 +14,8 @@ import ( "crypto/sha1" "crypto/sha256" "crypto/x509" - "golang_org/x/crypto/chacha20poly1305" "hash" + "internal/x/crypto/chacha20poly1305" ) // a keyAgreement implements the client and server side of a TLS key agreement diff --git a/src/crypto/tls/handshake_messages.go b/src/crypto/tls/handshake_messages.go index f86cc4b9b0399..c0e049b16f0ed 100644 --- a/src/crypto/tls/handshake_messages.go +++ b/src/crypto/tls/handshake_messages.go @@ -6,7 +6,7 @@ package tls import ( "fmt" - "golang_org/x/crypto/cryptobyte" + "internal/x/crypto/cryptobyte" "strings" ) diff --git a/src/crypto/tls/key_schedule.go b/src/crypto/tls/key_schedule.go index 310d92e2c5e3a..2cfc226d7f6e9 100644 --- a/src/crypto/tls/key_schedule.go +++ b/src/crypto/tls/key_schedule.go @@ -8,10 +8,10 @@ import ( "crypto/elliptic" "crypto/hmac" "errors" - "golang_org/x/crypto/cryptobyte" - "golang_org/x/crypto/curve25519" - "golang_org/x/crypto/hkdf" "hash" + "internal/x/crypto/cryptobyte" + "internal/x/crypto/curve25519" + "internal/x/crypto/hkdf" "io" "math/big" ) diff --git a/src/crypto/tls/ticket.go b/src/crypto/tls/ticket.go index 7f804ee5715a2..9560176259e21 100644 --- a/src/crypto/tls/ticket.go +++ b/src/crypto/tls/ticket.go @@ -12,7 +12,7 @@ import ( "crypto/sha256" "crypto/subtle" "errors" - "golang_org/x/crypto/cryptobyte" + "internal/x/crypto/cryptobyte" "io" ) diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index b0d366c2458b6..d8587aba927d9 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -24,8 +24,8 @@ import ( "encoding/pem" "errors" "fmt" - "golang_org/x/crypto/cryptobyte" - cryptobyte_asn1 "golang_org/x/crypto/cryptobyte/asn1" + "internal/x/crypto/cryptobyte" + cryptobyte_asn1 "internal/x/crypto/cryptobyte/asn1" "io" "math/big" "net" diff --git a/src/go/build/build_test.go b/src/go/build/build_test.go index 091443f646f2f..db8b12eabf83c 100644 --- a/src/go/build/build_test.go +++ b/src/go/build/build_test.go @@ -351,12 +351,16 @@ func TestImportDirNotExist(t *testing.T) { func TestImportVendor(t *testing.T) { testenv.MustHaveGoBuild(t) // really must just have source ctxt := Default - ctxt.GOPATH = "" - p, err := ctxt.Import("golang_org/x/net/http2/hpack", filepath.Join(ctxt.GOROOT, "src/net/http"), 0) + wd, err := os.Getwd() + if err != nil { + t.Fatal(err) + } + ctxt.GOPATH = filepath.Join(wd, "testdata/withvendor") + p, err := ctxt.Import("c/d", filepath.Join(ctxt.GOPATH, "src/a/b"), 0) if err != nil { - t.Fatalf("cannot find vendored golang_org/x/net/http2/hpack from net/http directory: %v", err) + t.Fatalf("cannot find vendored c/d from testdata src/a/b directory: %v", err) } - want := "vendor/golang_org/x/net/http2/hpack" + want := "a/vendor/c/d" if p.ImportPath != want { t.Fatalf("Import succeeded but found %q, want %q", p.ImportPath, want) } @@ -365,8 +369,12 @@ func TestImportVendor(t *testing.T) { func TestImportVendorFailure(t *testing.T) { testenv.MustHaveGoBuild(t) // really must just have source ctxt := Default - ctxt.GOPATH = "" - p, err := ctxt.Import("x.com/y/z", filepath.Join(ctxt.GOROOT, "src/net/http"), 0) + wd, err := os.Getwd() + if err != nil { + t.Fatal(err) + } + ctxt.GOPATH = filepath.Join(wd, "testdata/withvendor") + p, err := ctxt.Import("x.com/y/z", filepath.Join(ctxt.GOPATH, "src/a/b"), 0) if err == nil { t.Fatalf("found made-up package x.com/y/z in %s", p.Dir) } @@ -380,9 +388,13 @@ func TestImportVendorFailure(t *testing.T) { func TestImportVendorParentFailure(t *testing.T) { testenv.MustHaveGoBuild(t) // really must just have source ctxt := Default - ctxt.GOPATH = "" - // This import should fail because the vendor/golang.org/x/net/http2 directory has no source code. - p, err := ctxt.Import("golang_org/x/net/http2", filepath.Join(ctxt.GOROOT, "src/net/http"), 0) + wd, err := os.Getwd() + if err != nil { + t.Fatal(err) + } + ctxt.GOPATH = filepath.Join(wd, "testdata/withvendor") + // This import should fail because the vendor/c directory has no source code. + p, err := ctxt.Import("c", filepath.Join(ctxt.GOPATH, "src/a/b"), 0) if err == nil { t.Fatalf("found empty parent in %s", p.Dir) } diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index 4654a8d9ed6f9..7251274756407 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -320,7 +320,7 @@ var pkgDeps = map[string][]string{ "context", "math/rand", "os", "reflect", "sort", "syscall", "time", "internal/nettrace", "internal/poll", "internal/syscall/unix", "internal/syscall/windows", "internal/singleflight", "internal/race", - "golang_org/x/net/dns/dnsmessage", "golang_org/x/net/lif", "golang_org/x/net/route", + "internal/x/net/dns/dnsmessage", "internal/x/net/lif", "internal/x/net/route", }, // NET enables use of basic network-related packages. @@ -357,9 +357,9 @@ var pkgDeps = map[string][]string{ "crypto/sha1", "crypto/sha256", "crypto/sha512", - "golang_org/x/crypto/chacha20poly1305", - "golang_org/x/crypto/curve25519", - "golang_org/x/crypto/poly1305", + "internal/x/crypto/chacha20poly1305", + "internal/x/crypto/curve25519", + "internal/x/crypto/poly1305", }, // Random byte, number generation. @@ -387,13 +387,13 @@ var pkgDeps = map[string][]string{ // SSL/TLS. "crypto/tls": { - "L4", "CRYPTO-MATH", "OS", "golang_org/x/crypto/cryptobyte", "golang_org/x/crypto/hkdf", + "L4", "CRYPTO-MATH", "OS", "internal/x/crypto/cryptobyte", "internal/x/crypto/hkdf", "container/list", "crypto/x509", "encoding/pem", "net", "syscall", }, "crypto/x509": { "L4", "CRYPTO-MATH", "OS", "CGO", "crypto/x509/pkix", "encoding/pem", "encoding/hex", "net", "os/user", "syscall", "net/url", - "golang_org/x/crypto/cryptobyte", "golang_org/x/crypto/cryptobyte/asn1", + "internal/x/crypto/cryptobyte", "internal/x/crypto/cryptobyte/asn1", }, "crypto/x509/pkix": {"L4", "CRYPTO-MATH", "encoding/hex"}, @@ -409,12 +409,12 @@ var pkgDeps = map[string][]string{ "context", "crypto/rand", "crypto/tls", - "golang_org/x/net/http/httpguts", - "golang_org/x/net/http/httpproxy", - "golang_org/x/net/http2/hpack", - "golang_org/x/net/idna", - "golang_org/x/text/unicode/norm", - "golang_org/x/text/width", + "internal/x/net/http/httpguts", + "internal/x/net/http/httpproxy", + "internal/x/net/http2/hpack", + "internal/x/net/idna", + "internal/x/text/unicode/norm", + "internal/x/text/width", "internal/nettrace", "mime/multipart", "net/http/httptrace", @@ -432,9 +432,9 @@ var pkgDeps = map[string][]string{ "net/http/fcgi": {"L4", "NET", "OS", "context", "net/http", "net/http/cgi"}, "net/http/httptest": { "L4", "NET", "OS", "crypto/tls", "flag", "net/http", "net/http/internal", "crypto/x509", - "golang_org/x/net/http/httpguts", + "internal/x/net/http/httpguts", }, - "net/http/httputil": {"L4", "NET", "OS", "context", "net/http", "net/http/internal", "golang_org/x/net/http/httpguts"}, + "net/http/httputil": {"L4", "NET", "OS", "context", "net/http", "net/http/internal", "internal/x/net/http/httpguts"}, "net/http/pprof": {"L4", "OS", "html/template", "net/http", "runtime/pprof", "runtime/trace"}, "net/rpc": {"L4", "NET", "encoding/gob", "html/template", "net/http"}, "net/rpc/jsonrpc": {"L4", "NET", "encoding/json", "net/rpc"}, @@ -485,7 +485,7 @@ func listStdPkgs(goroot string) ([]string, error) { } name := filepath.ToSlash(path[len(src):]) - if name == "builtin" || name == "cmd" || strings.Contains(name, "golang_org") { + if name == "builtin" || name == "cmd" || strings.Contains(name, "internal/x/") { return filepath.SkipDir } diff --git a/src/go/build/testdata/withvendor/src/a/b/b.go b/src/go/build/testdata/withvendor/src/a/b/b.go new file mode 100644 index 0000000000000..4405d547a6288 --- /dev/null +++ b/src/go/build/testdata/withvendor/src/a/b/b.go @@ -0,0 +1,3 @@ +package b + +import _ "c/d" diff --git a/src/go/build/testdata/withvendor/src/a/vendor/c/d/d.go b/src/go/build/testdata/withvendor/src/a/vendor/c/d/d.go new file mode 100644 index 0000000000000..142fb423f66d1 --- /dev/null +++ b/src/go/build/testdata/withvendor/src/a/vendor/c/d/d.go @@ -0,0 +1 @@ +package d diff --git a/src/go/internal/srcimporter/srcimporter_test.go b/src/go/internal/srcimporter/srcimporter_test.go index b9caa90fc5888..b84672610c6f8 100644 --- a/src/go/internal/srcimporter/srcimporter_test.go +++ b/src/go/internal/srcimporter/srcimporter_test.go @@ -99,7 +99,7 @@ var importedObjectTests = []struct { {"math.Pi", "const Pi untyped float"}, {"math.Sin", "func Sin(x float64) float64"}, {"math/big.Int", "type Int struct{neg bool; abs nat}"}, - {"golang_org/x/text/unicode/norm.MaxSegmentSize", "const MaxSegmentSize untyped int"}, + {"internal/x/text/unicode/norm.MaxSegmentSize", "const MaxSegmentSize untyped int"}, } func TestImportedTypes(t *testing.T) { diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305.go b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305.go similarity index 97% rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305.go rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305.go index e28f49d12fcbe..80789a1212293 100644 --- a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305.go +++ b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package chacha20poly1305 implements the ChaCha20-Poly1305 AEAD as specified in RFC 7539. -package chacha20poly1305 // import "golang.org/x/crypto/chacha20poly1305" +package chacha20poly1305 import ( "crypto/cipher" diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go similarity index 100% rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305_generic.go similarity index 96% rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305_generic.go index 56e4f0e782a74..a77ab35f676d2 100644 --- a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go +++ b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305_generic.go @@ -7,8 +7,8 @@ package chacha20poly1305 import ( "encoding/binary" - "golang_org/x/crypto/internal/chacha20" - "golang_org/x/crypto/poly1305" + "internal/x/crypto/internal/chacha20" + "internal/x/crypto/poly1305" ) func roundTo16(n int) int { diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go similarity index 100% rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_test.go b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_test.go rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305_test.go diff --git a/src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go b/src/internal/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go diff --git a/src/vendor/golang_org/x/crypto/cryptobyte/asn1.go b/src/internal/x/crypto/cryptobyte/asn1.go similarity index 99% rename from src/vendor/golang_org/x/crypto/cryptobyte/asn1.go rename to src/internal/x/crypto/cryptobyte/asn1.go index 08314b47d1c56..2d40680ddd3b7 100644 --- a/src/vendor/golang_org/x/crypto/cryptobyte/asn1.go +++ b/src/internal/x/crypto/cryptobyte/asn1.go @@ -11,7 +11,7 @@ import ( "reflect" "time" - "golang_org/x/crypto/cryptobyte/asn1" + "internal/x/crypto/cryptobyte/asn1" ) // This file contains ASN.1-related methods for String and Builder. diff --git a/src/vendor/golang_org/x/crypto/cryptobyte/asn1/asn1.go b/src/internal/x/crypto/cryptobyte/asn1/asn1.go similarity index 96% rename from src/vendor/golang_org/x/crypto/cryptobyte/asn1/asn1.go rename to src/internal/x/crypto/cryptobyte/asn1/asn1.go index cda8e3edfd5ea..90ef6a241de2f 100644 --- a/src/vendor/golang_org/x/crypto/cryptobyte/asn1/asn1.go +++ b/src/internal/x/crypto/cryptobyte/asn1/asn1.go @@ -4,7 +4,7 @@ // Package asn1 contains supporting types for parsing and building ASN.1 // messages with the cryptobyte package. -package asn1 // import "golang.org/x/crypto/cryptobyte/asn1" +package asn1 // Tag represents an ASN.1 identifier octet, consisting of a tag number // (indicating a type) and class (such as context-specific or constructed). diff --git a/src/vendor/golang_org/x/crypto/cryptobyte/asn1_test.go b/src/internal/x/crypto/cryptobyte/asn1_test.go similarity index 99% rename from src/vendor/golang_org/x/crypto/cryptobyte/asn1_test.go rename to src/internal/x/crypto/cryptobyte/asn1_test.go index f7762880ca84b..ca28e3bcfb256 100644 --- a/src/vendor/golang_org/x/crypto/cryptobyte/asn1_test.go +++ b/src/internal/x/crypto/cryptobyte/asn1_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "golang_org/x/crypto/cryptobyte/asn1" + "internal/x/crypto/cryptobyte/asn1" ) type readASN1Test struct { diff --git a/src/vendor/golang_org/x/crypto/cryptobyte/builder.go b/src/internal/x/crypto/cryptobyte/builder.go similarity index 100% rename from src/vendor/golang_org/x/crypto/cryptobyte/builder.go rename to src/internal/x/crypto/cryptobyte/builder.go diff --git a/src/vendor/golang_org/x/crypto/cryptobyte/cryptobyte_test.go b/src/internal/x/crypto/cryptobyte/cryptobyte_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/cryptobyte/cryptobyte_test.go rename to src/internal/x/crypto/cryptobyte/cryptobyte_test.go diff --git a/src/vendor/golang_org/x/crypto/cryptobyte/example_test.go b/src/internal/x/crypto/cryptobyte/example_test.go similarity index 98% rename from src/vendor/golang_org/x/crypto/cryptobyte/example_test.go rename to src/internal/x/crypto/cryptobyte/example_test.go index 056c23014a14f..5b50025318f5b 100644 --- a/src/vendor/golang_org/x/crypto/cryptobyte/example_test.go +++ b/src/internal/x/crypto/cryptobyte/example_test.go @@ -8,8 +8,8 @@ import ( "errors" "fmt" - "golang_org/x/crypto/cryptobyte" - "golang_org/x/crypto/cryptobyte/asn1" + "internal/x/crypto/cryptobyte" + "internal/x/crypto/cryptobyte/asn1" ) func ExampleString_lengthPrefixed() { diff --git a/src/vendor/golang_org/x/crypto/cryptobyte/string.go b/src/internal/x/crypto/cryptobyte/string.go similarity index 98% rename from src/vendor/golang_org/x/crypto/cryptobyte/string.go rename to src/internal/x/crypto/cryptobyte/string.go index 39bf98aeead81..bd2ed2e207c6e 100644 --- a/src/vendor/golang_org/x/crypto/cryptobyte/string.go +++ b/src/internal/x/crypto/cryptobyte/string.go @@ -15,7 +15,7 @@ // // See the documentation and examples for the Builder and String types to get // started. -package cryptobyte // import "golang.org/x/crypto/cryptobyte" +package cryptobyte // String represents a string of bytes. It provides methods for parsing // fixed-length and length-prefixed values from it. diff --git a/src/vendor/golang_org/x/crypto/curve25519/const_amd64.h b/src/internal/x/crypto/curve25519/const_amd64.h similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/const_amd64.h rename to src/internal/x/crypto/curve25519/const_amd64.h diff --git a/src/vendor/golang_org/x/crypto/curve25519/const_amd64.s b/src/internal/x/crypto/curve25519/const_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/const_amd64.s rename to src/internal/x/crypto/curve25519/const_amd64.s diff --git a/src/vendor/golang_org/x/crypto/curve25519/cswap_amd64.s b/src/internal/x/crypto/curve25519/cswap_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/cswap_amd64.s rename to src/internal/x/crypto/curve25519/cswap_amd64.s diff --git a/src/vendor/golang_org/x/crypto/curve25519/curve25519.go b/src/internal/x/crypto/curve25519/curve25519.go similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/curve25519.go rename to src/internal/x/crypto/curve25519/curve25519.go diff --git a/src/vendor/golang_org/x/crypto/curve25519/curve25519_test.go b/src/internal/x/crypto/curve25519/curve25519_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/curve25519_test.go rename to src/internal/x/crypto/curve25519/curve25519_test.go diff --git a/src/vendor/golang_org/x/crypto/curve25519/doc.go b/src/internal/x/crypto/curve25519/doc.go similarity index 94% rename from src/vendor/golang_org/x/crypto/curve25519/doc.go rename to src/internal/x/crypto/curve25519/doc.go index da9b10d9c1ffd..076a8d4f10aa3 100644 --- a/src/vendor/golang_org/x/crypto/curve25519/doc.go +++ b/src/internal/x/crypto/curve25519/doc.go @@ -4,7 +4,7 @@ // Package curve25519 provides an implementation of scalar multiplication on // the elliptic curve known as curve25519. See https://cr.yp.to/ecdh.html -package curve25519 // import "golang.org/x/crypto/curve25519" +package curve25519 // basePoint is the x coordinate of the generator of the curve. var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} diff --git a/src/vendor/golang_org/x/crypto/curve25519/freeze_amd64.s b/src/internal/x/crypto/curve25519/freeze_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/freeze_amd64.s rename to src/internal/x/crypto/curve25519/freeze_amd64.s diff --git a/src/vendor/golang_org/x/crypto/curve25519/ladderstep_amd64.s b/src/internal/x/crypto/curve25519/ladderstep_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/ladderstep_amd64.s rename to src/internal/x/crypto/curve25519/ladderstep_amd64.s diff --git a/src/vendor/golang_org/x/crypto/curve25519/mont25519_amd64.go b/src/internal/x/crypto/curve25519/mont25519_amd64.go similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/mont25519_amd64.go rename to src/internal/x/crypto/curve25519/mont25519_amd64.go diff --git a/src/vendor/golang_org/x/crypto/curve25519/mul_amd64.s b/src/internal/x/crypto/curve25519/mul_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/mul_amd64.s rename to src/internal/x/crypto/curve25519/mul_amd64.s diff --git a/src/vendor/golang_org/x/crypto/curve25519/square_amd64.s b/src/internal/x/crypto/curve25519/square_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/curve25519/square_amd64.s rename to src/internal/x/crypto/curve25519/square_amd64.s diff --git a/src/vendor/golang_org/x/crypto/hkdf/example_test.go b/src/internal/x/crypto/hkdf/example_test.go similarity index 97% rename from src/vendor/golang_org/x/crypto/hkdf/example_test.go rename to src/internal/x/crypto/hkdf/example_test.go index 1fd140a324dc7..3b68a408103b9 100644 --- a/src/vendor/golang_org/x/crypto/hkdf/example_test.go +++ b/src/internal/x/crypto/hkdf/example_test.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - "golang_org/x/crypto/hkdf" + "internal/x/crypto/hkdf" ) // Usage example that expands one master secret into three other diff --git a/src/vendor/golang_org/x/crypto/hkdf/hkdf.go b/src/internal/x/crypto/hkdf/hkdf.go similarity index 98% rename from src/vendor/golang_org/x/crypto/hkdf/hkdf.go rename to src/internal/x/crypto/hkdf/hkdf.go index dda3f143bec50..c9077658e64b7 100644 --- a/src/vendor/golang_org/x/crypto/hkdf/hkdf.go +++ b/src/internal/x/crypto/hkdf/hkdf.go @@ -8,7 +8,7 @@ // HKDF is a cryptographic key derivation function (KDF) with the goal of // expanding limited input keying material into one or more cryptographically // strong secret keys. -package hkdf // import "golang.org/x/crypto/hkdf" +package hkdf import ( "crypto/hmac" diff --git a/src/vendor/golang_org/x/crypto/hkdf/hkdf_test.go b/src/internal/x/crypto/hkdf/hkdf_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/hkdf/hkdf_test.go rename to src/internal/x/crypto/hkdf/hkdf_test.go diff --git a/src/vendor/golang_org/x/crypto/internal/chacha20/asm_s390x.s b/src/internal/x/crypto/internal/chacha20/asm_s390x.s similarity index 100% rename from src/vendor/golang_org/x/crypto/internal/chacha20/asm_s390x.s rename to src/internal/x/crypto/internal/chacha20/asm_s390x.s diff --git a/src/vendor/golang_org/x/crypto/internal/chacha20/chacha_generic.go b/src/internal/x/crypto/internal/chacha20/chacha_generic.go similarity index 100% rename from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_generic.go rename to src/internal/x/crypto/internal/chacha20/chacha_generic.go diff --git a/src/vendor/golang_org/x/crypto/internal/chacha20/chacha_noasm.go b/src/internal/x/crypto/internal/chacha20/chacha_noasm.go similarity index 100% rename from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_noasm.go rename to src/internal/x/crypto/internal/chacha20/chacha_noasm.go diff --git a/src/vendor/golang_org/x/crypto/internal/chacha20/chacha_s390x.go b/src/internal/x/crypto/internal/chacha20/chacha_s390x.go similarity index 100% rename from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_s390x.go rename to src/internal/x/crypto/internal/chacha20/chacha_s390x.go diff --git a/src/vendor/golang_org/x/crypto/internal/chacha20/chacha_test.go b/src/internal/x/crypto/internal/chacha20/chacha_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_test.go rename to src/internal/x/crypto/internal/chacha20/chacha_test.go diff --git a/src/vendor/golang_org/x/crypto/internal/chacha20/vectors_test.go b/src/internal/x/crypto/internal/chacha20/vectors_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/internal/chacha20/vectors_test.go rename to src/internal/x/crypto/internal/chacha20/vectors_test.go diff --git a/src/vendor/golang_org/x/crypto/internal/chacha20/xor.go b/src/internal/x/crypto/internal/chacha20/xor.go similarity index 100% rename from src/vendor/golang_org/x/crypto/internal/chacha20/xor.go rename to src/internal/x/crypto/internal/chacha20/xor.go diff --git a/src/vendor/golang_org/x/crypto/poly1305/poly1305.go b/src/internal/x/crypto/poly1305/poly1305.go similarity index 95% rename from src/vendor/golang_org/x/crypto/poly1305/poly1305.go rename to src/internal/x/crypto/poly1305/poly1305.go index f562fa5712ba0..6d6be9a6406a2 100644 --- a/src/vendor/golang_org/x/crypto/poly1305/poly1305.go +++ b/src/internal/x/crypto/poly1305/poly1305.go @@ -17,7 +17,7 @@ used with a fixed key in order to generate one-time keys from an nonce. However, in this package AES isn't used and the one-time key is specified directly. */ -package poly1305 // import "golang.org/x/crypto/poly1305" +package poly1305 import "crypto/subtle" diff --git a/src/vendor/golang_org/x/crypto/poly1305/poly1305_test.go b/src/internal/x/crypto/poly1305/poly1305_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/poly1305_test.go rename to src/internal/x/crypto/poly1305/poly1305_test.go diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_amd64.go b/src/internal/x/crypto/poly1305/sum_amd64.go similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_amd64.go rename to src/internal/x/crypto/poly1305/sum_amd64.go diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_amd64.s b/src/internal/x/crypto/poly1305/sum_amd64.s similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_amd64.s rename to src/internal/x/crypto/poly1305/sum_amd64.s diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_arm.go b/src/internal/x/crypto/poly1305/sum_arm.go similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_arm.go rename to src/internal/x/crypto/poly1305/sum_arm.go diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_arm.s b/src/internal/x/crypto/poly1305/sum_arm.s similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_arm.s rename to src/internal/x/crypto/poly1305/sum_arm.s diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_noasm.go b/src/internal/x/crypto/poly1305/sum_noasm.go similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_noasm.go rename to src/internal/x/crypto/poly1305/sum_noasm.go diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_ref.go b/src/internal/x/crypto/poly1305/sum_ref.go similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_ref.go rename to src/internal/x/crypto/poly1305/sum_ref.go diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_s390x.go b/src/internal/x/crypto/poly1305/sum_s390x.go similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_s390x.go rename to src/internal/x/crypto/poly1305/sum_s390x.go diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_s390x.s b/src/internal/x/crypto/poly1305/sum_s390x.s similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_s390x.s rename to src/internal/x/crypto/poly1305/sum_s390x.s diff --git a/src/vendor/golang_org/x/crypto/poly1305/sum_vmsl_s390x.s b/src/internal/x/crypto/poly1305/sum_vmsl_s390x.s similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/sum_vmsl_s390x.s rename to src/internal/x/crypto/poly1305/sum_vmsl_s390x.s diff --git a/src/vendor/golang_org/x/crypto/poly1305/vectors_test.go b/src/internal/x/crypto/poly1305/vectors_test.go similarity index 100% rename from src/vendor/golang_org/x/crypto/poly1305/vectors_test.go rename to src/internal/x/crypto/poly1305/vectors_test.go diff --git a/src/internal/x/fiximports.bash b/src/internal/x/fiximports.bash new file mode 100755 index 0000000000000..ec72643b63a3a --- /dev/null +++ b/src/internal/x/fiximports.bash @@ -0,0 +1,6 @@ +#!/bin/bash + +# To fix import paths when importing new snapshots from the golang.org/x +# repositories, run this script in the current directory. + +sed -i 's,"golang\.org/x,"internal/x,g' $(grep -lr 'golang.org') diff --git a/src/vendor/golang_org/x/net/dns/dnsmessage/example_test.go b/src/internal/x/net/dns/dnsmessage/example_test.go similarity index 98% rename from src/vendor/golang_org/x/net/dns/dnsmessage/example_test.go rename to src/internal/x/net/dns/dnsmessage/example_test.go index a1bb5b7b1b88e..8453c230483cb 100644 --- a/src/vendor/golang_org/x/net/dns/dnsmessage/example_test.go +++ b/src/internal/x/net/dns/dnsmessage/example_test.go @@ -9,7 +9,7 @@ import ( "net" "strings" - "golang_org/x/net/dns/dnsmessage" + "internal/x/net/dns/dnsmessage" ) func mustNewName(name string) dnsmessage.Name { diff --git a/src/vendor/golang_org/x/net/dns/dnsmessage/message.go b/src/internal/x/net/dns/dnsmessage/message.go similarity index 100% rename from src/vendor/golang_org/x/net/dns/dnsmessage/message.go rename to src/internal/x/net/dns/dnsmessage/message.go diff --git a/src/vendor/golang_org/x/net/dns/dnsmessage/message_test.go b/src/internal/x/net/dns/dnsmessage/message_test.go similarity index 100% rename from src/vendor/golang_org/x/net/dns/dnsmessage/message_test.go rename to src/internal/x/net/dns/dnsmessage/message_test.go diff --git a/src/vendor/golang_org/x/net/http/httpguts/guts.go b/src/internal/x/net/http/httpguts/guts.go similarity index 100% rename from src/vendor/golang_org/x/net/http/httpguts/guts.go rename to src/internal/x/net/http/httpguts/guts.go diff --git a/src/vendor/golang_org/x/net/http/httpguts/httplex.go b/src/internal/x/net/http/httpguts/httplex.go similarity index 99% rename from src/vendor/golang_org/x/net/http/httpguts/httplex.go rename to src/internal/x/net/http/httpguts/httplex.go index 9337435174e67..7f3cdd8bd255c 100644 --- a/src/vendor/golang_org/x/net/http/httpguts/httplex.go +++ b/src/internal/x/net/http/httpguts/httplex.go @@ -9,7 +9,7 @@ import ( "strings" "unicode/utf8" - "golang_org/x/net/idna" + "internal/x/net/idna" ) var isTokenTable = [127]bool{ diff --git a/src/vendor/golang_org/x/net/http/httpguts/httplex_test.go b/src/internal/x/net/http/httpguts/httplex_test.go similarity index 100% rename from src/vendor/golang_org/x/net/http/httpguts/httplex_test.go rename to src/internal/x/net/http/httpguts/httplex_test.go diff --git a/src/vendor/golang_org/x/net/http/httpproxy/export_test.go b/src/internal/x/net/http/httpproxy/export_test.go similarity index 100% rename from src/vendor/golang_org/x/net/http/httpproxy/export_test.go rename to src/internal/x/net/http/httpproxy/export_test.go diff --git a/src/vendor/golang_org/x/net/http/httpproxy/proxy.go b/src/internal/x/net/http/httpproxy/proxy.go similarity index 99% rename from src/vendor/golang_org/x/net/http/httpproxy/proxy.go rename to src/internal/x/net/http/httpproxy/proxy.go index 0409f4340c373..d3947841392e6 100644 --- a/src/vendor/golang_org/x/net/http/httpproxy/proxy.go +++ b/src/internal/x/net/http/httpproxy/proxy.go @@ -19,7 +19,7 @@ import ( "strings" "unicode/utf8" - "golang_org/x/net/idna" + "internal/x/net/idna" ) // Config holds configuration for HTTP proxy settings. See diff --git a/src/vendor/golang_org/x/net/http/httpproxy/proxy_test.go b/src/internal/x/net/http/httpproxy/proxy_test.go similarity index 99% rename from src/vendor/golang_org/x/net/http/httpproxy/proxy_test.go rename to src/internal/x/net/http/httpproxy/proxy_test.go index 8791f64bcdc2c..cf0589dba97ec 100644 --- a/src/vendor/golang_org/x/net/http/httpproxy/proxy_test.go +++ b/src/internal/x/net/http/httpproxy/proxy_test.go @@ -13,7 +13,7 @@ import ( "strings" "testing" - "golang_org/x/net/http/httpproxy" + "internal/x/net/http/httpproxy" ) // setHelper calls t.Helper() for Go 1.9+ (see go19_test.go) and does nothing otherwise. diff --git a/src/vendor/golang_org/x/net/http2/hpack/encode.go b/src/internal/x/net/http2/hpack/encode.go similarity index 100% rename from src/vendor/golang_org/x/net/http2/hpack/encode.go rename to src/internal/x/net/http2/hpack/encode.go diff --git a/src/vendor/golang_org/x/net/http2/hpack/encode_test.go b/src/internal/x/net/http2/hpack/encode_test.go similarity index 100% rename from src/vendor/golang_org/x/net/http2/hpack/encode_test.go rename to src/internal/x/net/http2/hpack/encode_test.go diff --git a/src/vendor/golang_org/x/net/http2/hpack/hpack.go b/src/internal/x/net/http2/hpack/hpack.go similarity index 100% rename from src/vendor/golang_org/x/net/http2/hpack/hpack.go rename to src/internal/x/net/http2/hpack/hpack.go diff --git a/src/vendor/golang_org/x/net/http2/hpack/hpack_test.go b/src/internal/x/net/http2/hpack/hpack_test.go similarity index 100% rename from src/vendor/golang_org/x/net/http2/hpack/hpack_test.go rename to src/internal/x/net/http2/hpack/hpack_test.go diff --git a/src/vendor/golang_org/x/net/http2/hpack/huffman.go b/src/internal/x/net/http2/hpack/huffman.go similarity index 100% rename from src/vendor/golang_org/x/net/http2/hpack/huffman.go rename to src/internal/x/net/http2/hpack/huffman.go diff --git a/src/vendor/golang_org/x/net/http2/hpack/tables.go b/src/internal/x/net/http2/hpack/tables.go similarity index 100% rename from src/vendor/golang_org/x/net/http2/hpack/tables.go rename to src/internal/x/net/http2/hpack/tables.go diff --git a/src/vendor/golang_org/x/net/http2/hpack/tables_test.go b/src/internal/x/net/http2/hpack/tables_test.go similarity index 100% rename from src/vendor/golang_org/x/net/http2/hpack/tables_test.go rename to src/internal/x/net/http2/hpack/tables_test.go diff --git a/src/vendor/golang_org/x/net/idna/idna.go b/src/internal/x/net/idna/idna.go similarity index 99% rename from src/vendor/golang_org/x/net/idna/idna.go rename to src/internal/x/net/idna/idna.go index 9fd0334cd9df0..7f2471e70e7aa 100644 --- a/src/vendor/golang_org/x/net/idna/idna.go +++ b/src/internal/x/net/idna/idna.go @@ -13,16 +13,16 @@ // UTS #46 is defined in http://www.unicode.org/reports/tr46. // See http://unicode.org/cldr/utility/idna.jsp for a visualization of the // differences between these two standards. -package idna // import "golang_org/x/text/internal/export/idna" +package idna import ( "fmt" "strings" "unicode/utf8" - "golang_org/x/text/secure/bidirule" - "golang_org/x/text/unicode/bidi" - "golang_org/x/text/unicode/norm" + "internal/x/text/secure/bidirule" + "internal/x/text/unicode/bidi" + "internal/x/text/unicode/norm" ) // NOTE: Unlike common practice in Go APIs, the functions will return a diff --git a/src/vendor/golang_org/x/net/idna/punycode.go b/src/internal/x/net/idna/punycode.go similarity index 100% rename from src/vendor/golang_org/x/net/idna/punycode.go rename to src/internal/x/net/idna/punycode.go diff --git a/src/vendor/golang_org/x/net/idna/punycode_test.go b/src/internal/x/net/idna/punycode_test.go similarity index 100% rename from src/vendor/golang_org/x/net/idna/punycode_test.go rename to src/internal/x/net/idna/punycode_test.go diff --git a/src/vendor/golang_org/x/net/idna/tables.go b/src/internal/x/net/idna/tables.go similarity index 99% rename from src/vendor/golang_org/x/net/idna/tables.go rename to src/internal/x/net/idna/tables.go index a470c5a3e2588..41cf9c13d2a5b 100644 --- a/src/vendor/golang_org/x/net/idna/tables.go +++ b/src/internal/x/net/idna/tables.go @@ -1,6 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -// Code generated by running "go generate" in golang_org/x/text. DO NOT EDIT. +// Code generated by running "go generate" in internal/x/text. DO NOT EDIT. package idna diff --git a/src/vendor/golang_org/x/net/idna/trie.go b/src/internal/x/net/idna/trie.go similarity index 100% rename from src/vendor/golang_org/x/net/idna/trie.go rename to src/internal/x/net/idna/trie.go diff --git a/src/vendor/golang_org/x/net/idna/trieval.go b/src/internal/x/net/idna/trieval.go similarity index 97% rename from src/vendor/golang_org/x/net/idna/trieval.go rename to src/internal/x/net/idna/trieval.go index 5f4e5f2e7457e..bf57260034946 100644 --- a/src/vendor/golang_org/x/net/idna/trieval.go +++ b/src/internal/x/net/idna/trieval.go @@ -1,6 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -// Code generated by running "go generate" in golang_org/x/text. DO NOT EDIT. +// Code generated by running "go generate" in internal/x/text. DO NOT EDIT. package idna diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_bsd.go b/src/internal/x/net/internal/nettest/helper_bsd.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/helper_bsd.go rename to src/internal/x/net/internal/nettest/helper_bsd.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go b/src/internal/x/net/internal/nettest/helper_nobsd.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go rename to src/internal/x/net/internal/nettest/helper_nobsd.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_posix.go b/src/internal/x/net/internal/nettest/helper_posix.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/helper_posix.go rename to src/internal/x/net/internal/nettest/helper_posix.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_stub.go b/src/internal/x/net/internal/nettest/helper_stub.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/helper_stub.go rename to src/internal/x/net/internal/nettest/helper_stub.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_unix.go b/src/internal/x/net/internal/nettest/helper_unix.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/helper_unix.go rename to src/internal/x/net/internal/nettest/helper_unix.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/helper_windows.go b/src/internal/x/net/internal/nettest/helper_windows.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/helper_windows.go rename to src/internal/x/net/internal/nettest/helper_windows.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/interface.go b/src/internal/x/net/internal/nettest/interface.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/interface.go rename to src/internal/x/net/internal/nettest/interface.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/rlimit.go b/src/internal/x/net/internal/nettest/rlimit.go similarity index 100% rename from src/vendor/golang_org/x/net/internal/nettest/rlimit.go rename to src/internal/x/net/internal/nettest/rlimit.go diff --git a/src/vendor/golang_org/x/net/internal/nettest/stack.go b/src/internal/x/net/internal/nettest/stack.go similarity index 98% rename from src/vendor/golang_org/x/net/internal/nettest/stack.go rename to src/internal/x/net/internal/nettest/stack.go index 3b8a01e9bb0ed..1a545e21ab019 100644 --- a/src/vendor/golang_org/x/net/internal/nettest/stack.go +++ b/src/internal/x/net/internal/nettest/stack.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // Package nettest provides utilities for network testing. -package nettest // import "golang.org/x/net/internal/nettest" +package nettest import ( "fmt" diff --git a/src/vendor/golang_org/x/net/lif/address.go b/src/internal/x/net/lif/address.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/address.go rename to src/internal/x/net/lif/address.go diff --git a/src/vendor/golang_org/x/net/lif/address_test.go b/src/internal/x/net/lif/address_test.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/address_test.go rename to src/internal/x/net/lif/address_test.go diff --git a/src/vendor/golang_org/x/net/lif/binary.go b/src/internal/x/net/lif/binary.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/binary.go rename to src/internal/x/net/lif/binary.go diff --git a/src/vendor/golang_org/x/net/lif/defs_solaris.go b/src/internal/x/net/lif/defs_solaris.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/defs_solaris.go rename to src/internal/x/net/lif/defs_solaris.go diff --git a/src/vendor/golang_org/x/net/lif/lif.go b/src/internal/x/net/lif/lif.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/lif.go rename to src/internal/x/net/lif/lif.go diff --git a/src/vendor/golang_org/x/net/lif/link.go b/src/internal/x/net/lif/link.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/link.go rename to src/internal/x/net/lif/link.go diff --git a/src/vendor/golang_org/x/net/lif/link_test.go b/src/internal/x/net/lif/link_test.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/link_test.go rename to src/internal/x/net/lif/link_test.go diff --git a/src/vendor/golang_org/x/net/lif/sys.go b/src/internal/x/net/lif/sys.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/sys.go rename to src/internal/x/net/lif/sys.go diff --git a/src/vendor/golang_org/x/net/lif/sys_solaris_amd64.s b/src/internal/x/net/lif/sys_solaris_amd64.s similarity index 100% rename from src/vendor/golang_org/x/net/lif/sys_solaris_amd64.s rename to src/internal/x/net/lif/sys_solaris_amd64.s diff --git a/src/vendor/golang_org/x/net/lif/syscall.go b/src/internal/x/net/lif/syscall.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/syscall.go rename to src/internal/x/net/lif/syscall.go diff --git a/src/vendor/golang_org/x/net/lif/zsys_solaris_amd64.go b/src/internal/x/net/lif/zsys_solaris_amd64.go similarity index 100% rename from src/vendor/golang_org/x/net/lif/zsys_solaris_amd64.go rename to src/internal/x/net/lif/zsys_solaris_amd64.go diff --git a/src/vendor/golang_org/x/net/nettest/conntest.go b/src/internal/x/net/nettest/conntest.go similarity index 100% rename from src/vendor/golang_org/x/net/nettest/conntest.go rename to src/internal/x/net/nettest/conntest.go diff --git a/src/vendor/golang_org/x/net/nettest/conntest_go16.go b/src/internal/x/net/nettest/conntest_go16.go similarity index 100% rename from src/vendor/golang_org/x/net/nettest/conntest_go16.go rename to src/internal/x/net/nettest/conntest_go16.go diff --git a/src/vendor/golang_org/x/net/nettest/conntest_go17.go b/src/internal/x/net/nettest/conntest_go17.go similarity index 100% rename from src/vendor/golang_org/x/net/nettest/conntest_go17.go rename to src/internal/x/net/nettest/conntest_go17.go diff --git a/src/vendor/golang_org/x/net/nettest/conntest_test.go b/src/internal/x/net/nettest/conntest_test.go similarity index 97% rename from src/vendor/golang_org/x/net/nettest/conntest_test.go rename to src/internal/x/net/nettest/conntest_test.go index ae8426a05c29a..e14df0e6fbb77 100644 --- a/src/vendor/golang_org/x/net/nettest/conntest_test.go +++ b/src/internal/x/net/nettest/conntest_test.go @@ -12,7 +12,7 @@ import ( "runtime" "testing" - "golang_org/x/net/internal/nettest" + "internal/x/net/internal/nettest" ) func TestTestConn(t *testing.T) { diff --git a/src/vendor/golang_org/x/net/route/address.go b/src/internal/x/net/route/address.go similarity index 100% rename from src/vendor/golang_org/x/net/route/address.go rename to src/internal/x/net/route/address.go diff --git a/src/vendor/golang_org/x/net/route/address_darwin_test.go b/src/internal/x/net/route/address_darwin_test.go similarity index 100% rename from src/vendor/golang_org/x/net/route/address_darwin_test.go rename to src/internal/x/net/route/address_darwin_test.go diff --git a/src/vendor/golang_org/x/net/route/address_test.go b/src/internal/x/net/route/address_test.go similarity index 100% rename from src/vendor/golang_org/x/net/route/address_test.go rename to src/internal/x/net/route/address_test.go diff --git a/src/vendor/golang_org/x/net/route/binary.go b/src/internal/x/net/route/binary.go similarity index 100% rename from src/vendor/golang_org/x/net/route/binary.go rename to src/internal/x/net/route/binary.go diff --git a/src/vendor/golang_org/x/net/route/defs_darwin.go b/src/internal/x/net/route/defs_darwin.go similarity index 100% rename from src/vendor/golang_org/x/net/route/defs_darwin.go rename to src/internal/x/net/route/defs_darwin.go diff --git a/src/vendor/golang_org/x/net/route/defs_dragonfly.go b/src/internal/x/net/route/defs_dragonfly.go similarity index 100% rename from src/vendor/golang_org/x/net/route/defs_dragonfly.go rename to src/internal/x/net/route/defs_dragonfly.go diff --git a/src/vendor/golang_org/x/net/route/defs_freebsd.go b/src/internal/x/net/route/defs_freebsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/defs_freebsd.go rename to src/internal/x/net/route/defs_freebsd.go diff --git a/src/vendor/golang_org/x/net/route/defs_netbsd.go b/src/internal/x/net/route/defs_netbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/defs_netbsd.go rename to src/internal/x/net/route/defs_netbsd.go diff --git a/src/vendor/golang_org/x/net/route/defs_openbsd.go b/src/internal/x/net/route/defs_openbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/defs_openbsd.go rename to src/internal/x/net/route/defs_openbsd.go diff --git a/src/vendor/golang_org/x/net/route/empty.s b/src/internal/x/net/route/empty.s similarity index 100% rename from src/vendor/golang_org/x/net/route/empty.s rename to src/internal/x/net/route/empty.s diff --git a/src/vendor/golang_org/x/net/route/interface.go b/src/internal/x/net/route/interface.go similarity index 100% rename from src/vendor/golang_org/x/net/route/interface.go rename to src/internal/x/net/route/interface.go diff --git a/src/vendor/golang_org/x/net/route/interface_announce.go b/src/internal/x/net/route/interface_announce.go similarity index 100% rename from src/vendor/golang_org/x/net/route/interface_announce.go rename to src/internal/x/net/route/interface_announce.go diff --git a/src/vendor/golang_org/x/net/route/interface_classic.go b/src/internal/x/net/route/interface_classic.go similarity index 100% rename from src/vendor/golang_org/x/net/route/interface_classic.go rename to src/internal/x/net/route/interface_classic.go diff --git a/src/vendor/golang_org/x/net/route/interface_freebsd.go b/src/internal/x/net/route/interface_freebsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/interface_freebsd.go rename to src/internal/x/net/route/interface_freebsd.go diff --git a/src/vendor/golang_org/x/net/route/interface_multicast.go b/src/internal/x/net/route/interface_multicast.go similarity index 100% rename from src/vendor/golang_org/x/net/route/interface_multicast.go rename to src/internal/x/net/route/interface_multicast.go diff --git a/src/vendor/golang_org/x/net/route/interface_openbsd.go b/src/internal/x/net/route/interface_openbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/interface_openbsd.go rename to src/internal/x/net/route/interface_openbsd.go diff --git a/src/vendor/golang_org/x/net/route/message.go b/src/internal/x/net/route/message.go similarity index 100% rename from src/vendor/golang_org/x/net/route/message.go rename to src/internal/x/net/route/message.go diff --git a/src/vendor/golang_org/x/net/route/message_darwin_test.go b/src/internal/x/net/route/message_darwin_test.go similarity index 100% rename from src/vendor/golang_org/x/net/route/message_darwin_test.go rename to src/internal/x/net/route/message_darwin_test.go diff --git a/src/vendor/golang_org/x/net/route/message_freebsd_test.go b/src/internal/x/net/route/message_freebsd_test.go similarity index 100% rename from src/vendor/golang_org/x/net/route/message_freebsd_test.go rename to src/internal/x/net/route/message_freebsd_test.go diff --git a/src/vendor/golang_org/x/net/route/message_test.go b/src/internal/x/net/route/message_test.go similarity index 100% rename from src/vendor/golang_org/x/net/route/message_test.go rename to src/internal/x/net/route/message_test.go diff --git a/src/vendor/golang_org/x/net/route/route.go b/src/internal/x/net/route/route.go similarity index 100% rename from src/vendor/golang_org/x/net/route/route.go rename to src/internal/x/net/route/route.go diff --git a/src/vendor/golang_org/x/net/route/route_classic.go b/src/internal/x/net/route/route_classic.go similarity index 100% rename from src/vendor/golang_org/x/net/route/route_classic.go rename to src/internal/x/net/route/route_classic.go diff --git a/src/vendor/golang_org/x/net/route/route_openbsd.go b/src/internal/x/net/route/route_openbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/route_openbsd.go rename to src/internal/x/net/route/route_openbsd.go diff --git a/src/vendor/golang_org/x/net/route/route_test.go b/src/internal/x/net/route/route_test.go similarity index 100% rename from src/vendor/golang_org/x/net/route/route_test.go rename to src/internal/x/net/route/route_test.go diff --git a/src/vendor/golang_org/x/net/route/sys.go b/src/internal/x/net/route/sys.go similarity index 100% rename from src/vendor/golang_org/x/net/route/sys.go rename to src/internal/x/net/route/sys.go diff --git a/src/vendor/golang_org/x/net/route/sys_darwin.go b/src/internal/x/net/route/sys_darwin.go similarity index 100% rename from src/vendor/golang_org/x/net/route/sys_darwin.go rename to src/internal/x/net/route/sys_darwin.go diff --git a/src/vendor/golang_org/x/net/route/sys_dragonfly.go b/src/internal/x/net/route/sys_dragonfly.go similarity index 100% rename from src/vendor/golang_org/x/net/route/sys_dragonfly.go rename to src/internal/x/net/route/sys_dragonfly.go diff --git a/src/vendor/golang_org/x/net/route/sys_freebsd.go b/src/internal/x/net/route/sys_freebsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/sys_freebsd.go rename to src/internal/x/net/route/sys_freebsd.go diff --git a/src/vendor/golang_org/x/net/route/sys_netbsd.go b/src/internal/x/net/route/sys_netbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/sys_netbsd.go rename to src/internal/x/net/route/sys_netbsd.go diff --git a/src/vendor/golang_org/x/net/route/sys_openbsd.go b/src/internal/x/net/route/sys_openbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/sys_openbsd.go rename to src/internal/x/net/route/sys_openbsd.go diff --git a/src/vendor/golang_org/x/net/route/syscall.go b/src/internal/x/net/route/syscall.go similarity index 100% rename from src/vendor/golang_org/x/net/route/syscall.go rename to src/internal/x/net/route/syscall.go diff --git a/src/vendor/golang_org/x/net/route/syscall_go1_11_darwin.go b/src/internal/x/net/route/syscall_go1_11_darwin.go similarity index 100% rename from src/vendor/golang_org/x/net/route/syscall_go1_11_darwin.go rename to src/internal/x/net/route/syscall_go1_11_darwin.go diff --git a/src/vendor/golang_org/x/net/route/syscall_go1_12_darwin.go b/src/internal/x/net/route/syscall_go1_12_darwin.go similarity index 100% rename from src/vendor/golang_org/x/net/route/syscall_go1_12_darwin.go rename to src/internal/x/net/route/syscall_go1_12_darwin.go diff --git a/src/vendor/golang_org/x/net/route/zsys_darwin.go b/src/internal/x/net/route/zsys_darwin.go similarity index 100% rename from src/vendor/golang_org/x/net/route/zsys_darwin.go rename to src/internal/x/net/route/zsys_darwin.go diff --git a/src/vendor/golang_org/x/net/route/zsys_dragonfly.go b/src/internal/x/net/route/zsys_dragonfly.go similarity index 100% rename from src/vendor/golang_org/x/net/route/zsys_dragonfly.go rename to src/internal/x/net/route/zsys_dragonfly.go diff --git a/src/vendor/golang_org/x/net/route/zsys_freebsd_386.go b/src/internal/x/net/route/zsys_freebsd_386.go similarity index 100% rename from src/vendor/golang_org/x/net/route/zsys_freebsd_386.go rename to src/internal/x/net/route/zsys_freebsd_386.go diff --git a/src/vendor/golang_org/x/net/route/zsys_freebsd_amd64.go b/src/internal/x/net/route/zsys_freebsd_amd64.go similarity index 100% rename from src/vendor/golang_org/x/net/route/zsys_freebsd_amd64.go rename to src/internal/x/net/route/zsys_freebsd_amd64.go diff --git a/src/vendor/golang_org/x/net/route/zsys_freebsd_arm.go b/src/internal/x/net/route/zsys_freebsd_arm.go similarity index 100% rename from src/vendor/golang_org/x/net/route/zsys_freebsd_arm.go rename to src/internal/x/net/route/zsys_freebsd_arm.go diff --git a/src/vendor/golang_org/x/net/route/zsys_netbsd.go b/src/internal/x/net/route/zsys_netbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/zsys_netbsd.go rename to src/internal/x/net/route/zsys_netbsd.go diff --git a/src/vendor/golang_org/x/net/route/zsys_openbsd.go b/src/internal/x/net/route/zsys_openbsd.go similarity index 100% rename from src/vendor/golang_org/x/net/route/zsys_openbsd.go rename to src/internal/x/net/route/zsys_openbsd.go diff --git a/src/vendor/golang_org/x/text/secure/bidirule/bidirule.go b/src/internal/x/text/secure/bidirule/bidirule.go similarity index 99% rename from src/vendor/golang_org/x/text/secure/bidirule/bidirule.go rename to src/internal/x/text/secure/bidirule/bidirule.go index c3ca2bc6fede0..87e656a37d012 100644 --- a/src/vendor/golang_org/x/text/secure/bidirule/bidirule.go +++ b/src/internal/x/text/secure/bidirule/bidirule.go @@ -14,8 +14,8 @@ import ( "errors" "unicode/utf8" - "golang_org/x/text/transform" - "golang_org/x/text/unicode/bidi" + "internal/x/text/transform" + "internal/x/text/unicode/bidi" ) // This file contains an implementation of RFC 5893: Right-to-Left Scripts for diff --git a/src/vendor/golang_org/x/text/secure/doc.go b/src/internal/x/text/secure/doc.go similarity index 85% rename from src/vendor/golang_org/x/text/secure/doc.go rename to src/internal/x/text/secure/doc.go index 5eb60b94bf275..6151b79d6e3e3 100644 --- a/src/vendor/golang_org/x/text/secure/doc.go +++ b/src/internal/x/text/secure/doc.go @@ -5,4 +5,4 @@ // license that can be found in the LICENSE file. // secure is a repository of text security related packages. -package secure // import "golang_org/x/text/secure" +package secure diff --git a/src/vendor/golang_org/x/text/transform/examples_test.go b/src/internal/x/text/transform/examples_test.go similarity index 92% rename from src/vendor/golang_org/x/text/transform/examples_test.go rename to src/internal/x/text/transform/examples_test.go index 1323d9bec033d..8d2fbb21711e7 100644 --- a/src/vendor/golang_org/x/text/transform/examples_test.go +++ b/src/internal/x/text/transform/examples_test.go @@ -10,8 +10,8 @@ import ( "fmt" "unicode" - "golang_org/x/text/transform" - "golang_org/x/text/unicode/norm" + "internal/x/text/transform" + "internal/x/text/unicode/norm" ) func ExampleRemoveFunc() { diff --git a/src/vendor/golang_org/x/text/transform/transform.go b/src/internal/x/text/transform/transform.go similarity index 99% rename from src/vendor/golang_org/x/text/transform/transform.go rename to src/internal/x/text/transform/transform.go index 9ddfa80cf3e69..7b6b55e0194f2 100644 --- a/src/vendor/golang_org/x/text/transform/transform.go +++ b/src/internal/x/text/transform/transform.go @@ -8,7 +8,7 @@ // bytes passing through as well as various transformations. Example // transformations provided by other packages include normalization and // conversion between character sets. -package transform // import "golang_org/x/text/transform" +package transform import ( "bytes" diff --git a/src/vendor/golang_org/x/text/unicode/bidi/bidi.go b/src/internal/x/text/unicode/bidi/bidi.go similarity index 99% rename from src/vendor/golang_org/x/text/unicode/bidi/bidi.go rename to src/internal/x/text/unicode/bidi/bidi.go index e691ae86942b1..4542171736ee1 100644 --- a/src/vendor/golang_org/x/text/unicode/bidi/bidi.go +++ b/src/internal/x/text/unicode/bidi/bidi.go @@ -10,7 +10,7 @@ // // NOTE: UNDER CONSTRUCTION. This API may change in backwards incompatible ways // and without notice. -package bidi // import "golang_org/x/text/unicode/bidi" +package bidi // TODO: // The following functionality would not be hard to implement, but hinges on diff --git a/src/vendor/golang_org/x/text/unicode/bidi/bracket.go b/src/internal/x/text/unicode/bidi/bracket.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/bidi/bracket.go rename to src/internal/x/text/unicode/bidi/bracket.go diff --git a/src/vendor/golang_org/x/text/unicode/bidi/core.go b/src/internal/x/text/unicode/bidi/core.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/bidi/core.go rename to src/internal/x/text/unicode/bidi/core.go diff --git a/src/vendor/golang_org/x/text/unicode/bidi/example_test.go b/src/internal/x/text/unicode/bidi/example_test.go similarity index 99% rename from src/vendor/golang_org/x/text/unicode/bidi/example_test.go rename to src/internal/x/text/unicode/bidi/example_test.go index e1739598d43e1..56c5c4a1219ab 100644 --- a/src/vendor/golang_org/x/text/unicode/bidi/example_test.go +++ b/src/internal/x/text/unicode/bidi/example_test.go @@ -8,7 +8,7 @@ import ( "fmt" "log" - "golang_org/x/text/bidi" + "internal/x/text/bidi" ) func foo() { diff --git a/src/vendor/golang_org/x/text/unicode/bidi/prop.go b/src/internal/x/text/unicode/bidi/prop.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/bidi/prop.go rename to src/internal/x/text/unicode/bidi/prop.go diff --git a/src/vendor/golang_org/x/text/unicode/bidi/tables.go b/src/internal/x/text/unicode/bidi/tables.go similarity index 99% rename from src/vendor/golang_org/x/text/unicode/bidi/tables.go rename to src/internal/x/text/unicode/bidi/tables.go index fb2229efa875c..c9c45c625f559 100644 --- a/src/vendor/golang_org/x/text/unicode/bidi/tables.go +++ b/src/internal/x/text/unicode/bidi/tables.go @@ -1,6 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -// Code generated by running "go generate" in golang_org/x/text. DO NOT EDIT. +// Code generated by running "go generate" in internal/x/text. DO NOT EDIT. package bidi diff --git a/src/vendor/golang_org/x/text/unicode/bidi/trieval.go b/src/internal/x/text/unicode/bidi/trieval.go similarity index 95% rename from src/vendor/golang_org/x/text/unicode/bidi/trieval.go rename to src/internal/x/text/unicode/bidi/trieval.go index c3f0e21f3e879..e59d249c7507f 100644 --- a/src/vendor/golang_org/x/text/unicode/bidi/trieval.go +++ b/src/internal/x/text/unicode/bidi/trieval.go @@ -1,6 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -// Code generated by running "go generate" in golang_org/x/text. DO NOT EDIT. +// Code generated by running "go generate" in internal/x/text. DO NOT EDIT. package bidi diff --git a/src/vendor/golang_org/x/text/unicode/doc.go b/src/internal/x/text/unicode/doc.go similarity index 84% rename from src/vendor/golang_org/x/text/unicode/doc.go rename to src/internal/x/text/unicode/doc.go index 55a6775d59a38..4f7e9f5a4336e 100644 --- a/src/vendor/golang_org/x/text/unicode/doc.go +++ b/src/internal/x/text/unicode/doc.go @@ -5,6 +5,6 @@ // license that can be found in the LICENSE file. // unicode holds packages with implementations of Unicode standards that are -// mostly used as building blocks for other packages in golang_org/x/text, +// mostly used as building blocks for other packages in internal/x/text, // layout engines, or are otherwise more low-level in nature. package unicode diff --git a/src/vendor/golang_org/x/text/unicode/norm/composition.go b/src/internal/x/text/unicode/norm/composition.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/norm/composition.go rename to src/internal/x/text/unicode/norm/composition.go diff --git a/src/vendor/golang_org/x/text/unicode/norm/example_iter_test.go b/src/internal/x/text/unicode/norm/example_iter_test.go similarity index 98% rename from src/vendor/golang_org/x/text/unicode/norm/example_iter_test.go rename to src/internal/x/text/unicode/norm/example_iter_test.go index aed6c16fbb23d..fb0e52410b8a3 100644 --- a/src/vendor/golang_org/x/text/unicode/norm/example_iter_test.go +++ b/src/internal/x/text/unicode/norm/example_iter_test.go @@ -11,7 +11,7 @@ import ( "fmt" "unicode/utf8" - "golang_org/x/text/unicode/norm" + "internal/x/text/unicode/norm" ) // EqualSimple uses a norm.Iter to compare two non-normalized diff --git a/src/vendor/golang_org/x/text/unicode/norm/example_test.go b/src/internal/x/text/unicode/norm/example_test.go similarity index 94% rename from src/vendor/golang_org/x/text/unicode/norm/example_test.go rename to src/internal/x/text/unicode/norm/example_test.go index 72e72c9d34a57..a9904400df43d 100644 --- a/src/vendor/golang_org/x/text/unicode/norm/example_test.go +++ b/src/internal/x/text/unicode/norm/example_test.go @@ -9,7 +9,7 @@ package norm_test import ( "fmt" - "golang_org/x/text/unicode/norm" + "internal/x/text/unicode/norm" ) func ExampleForm_NextBoundary() { diff --git a/src/vendor/golang_org/x/text/unicode/norm/forminfo.go b/src/internal/x/text/unicode/norm/forminfo.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/norm/forminfo.go rename to src/internal/x/text/unicode/norm/forminfo.go diff --git a/src/vendor/golang_org/x/text/unicode/norm/input.go b/src/internal/x/text/unicode/norm/input.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/norm/input.go rename to src/internal/x/text/unicode/norm/input.go diff --git a/src/vendor/golang_org/x/text/unicode/norm/iter.go b/src/internal/x/text/unicode/norm/iter.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/norm/iter.go rename to src/internal/x/text/unicode/norm/iter.go diff --git a/src/vendor/golang_org/x/text/unicode/norm/normalize.go b/src/internal/x/text/unicode/norm/normalize.go similarity index 99% rename from src/vendor/golang_org/x/text/unicode/norm/normalize.go rename to src/internal/x/text/unicode/norm/normalize.go index 4de4ed6ed0f9d..791c39b1c48e8 100644 --- a/src/vendor/golang_org/x/text/unicode/norm/normalize.go +++ b/src/internal/x/text/unicode/norm/normalize.go @@ -7,12 +7,12 @@ // Note: the file data_test.go that is generated should not be checked in. // Package norm contains types and functions for normalizing Unicode strings. -package norm // import "golang_org/x/text/unicode/norm" +package norm import ( "unicode/utf8" - "golang_org/x/text/transform" + "internal/x/text/transform" ) // A Form denotes a canonical representation of Unicode code points. diff --git a/src/vendor/golang_org/x/text/unicode/norm/readwriter.go b/src/internal/x/text/unicode/norm/readwriter.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/norm/readwriter.go rename to src/internal/x/text/unicode/norm/readwriter.go diff --git a/src/vendor/golang_org/x/text/unicode/norm/tables.go b/src/internal/x/text/unicode/norm/tables.go similarity index 99% rename from src/vendor/golang_org/x/text/unicode/norm/tables.go rename to src/internal/x/text/unicode/norm/tables.go index d6466836cefe6..2dd61adf63c03 100644 --- a/src/vendor/golang_org/x/text/unicode/norm/tables.go +++ b/src/internal/x/text/unicode/norm/tables.go @@ -1,6 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. -// Code generated by running "go generate" in golang_org/x/text. DO NOT EDIT. +// Code generated by running "go generate" in internal/x/text. DO NOT EDIT. package norm diff --git a/src/vendor/golang_org/x/text/unicode/norm/transform.go b/src/internal/x/text/unicode/norm/transform.go similarity index 98% rename from src/vendor/golang_org/x/text/unicode/norm/transform.go rename to src/internal/x/text/unicode/norm/transform.go index 73869a5a1cddb..7837cb96a414a 100644 --- a/src/vendor/golang_org/x/text/unicode/norm/transform.go +++ b/src/internal/x/text/unicode/norm/transform.go @@ -9,7 +9,7 @@ package norm import ( "unicode/utf8" - "golang_org/x/text/transform" + "internal/x/text/transform" ) // Reset implements the Reset method of the transform.Transformer interface. diff --git a/src/vendor/golang_org/x/text/unicode/norm/trie.go b/src/internal/x/text/unicode/norm/trie.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/norm/trie.go rename to src/internal/x/text/unicode/norm/trie.go diff --git a/src/vendor/golang_org/x/text/unicode/norm/triegen.go b/src/internal/x/text/unicode/norm/triegen.go similarity index 100% rename from src/vendor/golang_org/x/text/unicode/norm/triegen.go rename to src/internal/x/text/unicode/norm/triegen.go diff --git a/src/net/dnsclient.go b/src/net/dnsclient.go index 2c47bc413013f..4fdf60ff4e35a 100644 --- a/src/net/dnsclient.go +++ b/src/net/dnsclient.go @@ -8,7 +8,7 @@ import ( "math/rand" "sort" - "golang_org/x/net/dns/dnsmessage" + "internal/x/net/dns/dnsmessage" ) // reverseaddr returns the in-addr.arpa. or ip6.arpa. hostname of the IP diff --git a/src/net/dnsclient_unix.go b/src/net/dnsclient_unix.go index 73630faa498c6..86ce92dc43784 100644 --- a/src/net/dnsclient_unix.go +++ b/src/net/dnsclient_unix.go @@ -23,7 +23,7 @@ import ( "sync" "time" - "golang_org/x/net/dns/dnsmessage" + "internal/x/net/dns/dnsmessage" ) var ( diff --git a/src/net/dnsclient_unix_test.go b/src/net/dnsclient_unix_test.go index 7dccb6b8ec5d8..be04a44c14bea 100644 --- a/src/net/dnsclient_unix_test.go +++ b/src/net/dnsclient_unix_test.go @@ -20,7 +20,7 @@ import ( "testing" "time" - "golang_org/x/net/dns/dnsmessage" + "internal/x/net/dns/dnsmessage" ) var goResolver = Resolver{PreferGo: true} diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 12cf65f109c13..1a97b01db8d94 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -44,9 +44,9 @@ import ( "sync" "time" - "golang_org/x/net/http/httpguts" - "golang_org/x/net/http2/hpack" - "golang_org/x/net/idna" + "internal/x/net/http/httpguts" + "internal/x/net/http2/hpack" + "internal/x/net/idna" ) // A list of the possible cipher suite ids. Taken from diff --git a/src/net/http/http.go b/src/net/http/http.go index 30d1a52b63190..624b2cfe69567 100644 --- a/src/net/http/http.go +++ b/src/net/http/http.go @@ -11,7 +11,7 @@ import ( "time" "unicode/utf8" - "golang_org/x/net/http/httpguts" + "internal/x/net/http/httpguts" ) // maxInt64 is the effective "infinite" value for the Server and diff --git a/src/net/http/httptest/recorder.go b/src/net/http/httptest/recorder.go index 67f90b837698a..f2c3c0757bacf 100644 --- a/src/net/http/httptest/recorder.go +++ b/src/net/http/httptest/recorder.go @@ -12,7 +12,7 @@ import ( "strconv" "strings" - "golang_org/x/net/http/httpguts" + "internal/x/net/http/httpguts" ) // ResponseRecorder is an implementation of http.ResponseWriter that diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index e9552a2256414..f0607a68ea2d3 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -18,7 +18,7 @@ import ( "sync" "time" - "golang_org/x/net/http/httpguts" + "internal/x/net/http/httpguts" ) // ReverseProxy is an HTTP Handler that takes an incoming request and diff --git a/src/net/http/request.go b/src/net/http/request.go index d994e81d23771..fb058f9fbf38f 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -26,7 +26,7 @@ import ( "strings" "sync" - "golang_org/x/net/idna" + "internal/x/net/idna" ) const ( diff --git a/src/net/http/response.go b/src/net/http/response.go index b3ca56c4190db..f906ce829b4aa 100644 --- a/src/net/http/response.go +++ b/src/net/http/response.go @@ -12,7 +12,7 @@ import ( "crypto/tls" "errors" "fmt" - "golang_org/x/net/http/httpguts" + "internal/x/net/http/httpguts" "io" "net/textproto" "net/url" diff --git a/src/net/http/server.go b/src/net/http/server.go index cf03b09f84414..97ed59e9fd1e8 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -29,7 +29,7 @@ import ( "sync/atomic" "time" - "golang_org/x/net/http/httpguts" + "internal/x/net/http/httpguts" ) // Errors used by the HTTP server. diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go index 3eb9f0da91298..e8a93e9137eb8 100644 --- a/src/net/http/transfer.go +++ b/src/net/http/transfer.go @@ -21,7 +21,7 @@ import ( "sync" "time" - "golang_org/x/net/http/httpguts" + "internal/x/net/http/httpguts" ) // ErrLineTooLong is returned when reading request or response bodies diff --git a/src/net/http/transport.go b/src/net/http/transport.go index ad0201d554b75..f30ad2151c494 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -30,8 +30,8 @@ import ( "sync/atomic" "time" - "golang_org/x/net/http/httpguts" - "golang_org/x/net/http/httpproxy" + "internal/x/net/http/httpguts" + "internal/x/net/http/httpproxy" ) // DefaultTransport is the default implementation of Transport and is diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index 1021ce5aa20a3..6e075847ddeea 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -42,7 +42,7 @@ import ( "testing" "time" - "golang_org/x/net/http/httpguts" + "internal/x/net/http/httpguts" ) // TODO: test 5 pipelined requests with responses: 1) OK, 2) OK, Connection: Close diff --git a/src/net/interface_bsd.go b/src/net/interface_bsd.go index 35b1c2681592a..77372964b104c 100644 --- a/src/net/interface_bsd.go +++ b/src/net/interface_bsd.go @@ -9,7 +9,7 @@ package net import ( "syscall" - "golang_org/x/net/route" + "internal/x/net/route" ) // If the ifindex is zero, interfaceTable returns mappings of all diff --git a/src/net/interface_bsdvar.go b/src/net/interface_bsdvar.go index 0b84ca37d4a44..818fafe9708a5 100644 --- a/src/net/interface_bsdvar.go +++ b/src/net/interface_bsdvar.go @@ -9,7 +9,7 @@ package net import ( "syscall" - "golang_org/x/net/route" + "internal/x/net/route" ) func interfaceMessages(ifindex int) ([]route.Message, error) { diff --git a/src/net/interface_darwin.go b/src/net/interface_darwin.go index 2ec8e1cc6ef70..6a6b3a58187dc 100644 --- a/src/net/interface_darwin.go +++ b/src/net/interface_darwin.go @@ -7,7 +7,7 @@ package net import ( "syscall" - "golang_org/x/net/route" + "internal/x/net/route" ) func interfaceMessages(ifindex int) ([]route.Message, error) { diff --git a/src/net/interface_freebsd.go b/src/net/interface_freebsd.go index 8a7d6f67c039d..8eee2aa03159a 100644 --- a/src/net/interface_freebsd.go +++ b/src/net/interface_freebsd.go @@ -7,7 +7,7 @@ package net import ( "syscall" - "golang_org/x/net/route" + "internal/x/net/route" ) func interfaceMessages(ifindex int) ([]route.Message, error) { diff --git a/src/net/interface_solaris.go b/src/net/interface_solaris.go index dc8ffbfcb8a64..868d4174ed38d 100644 --- a/src/net/interface_solaris.go +++ b/src/net/interface_solaris.go @@ -7,7 +7,7 @@ package net import ( "syscall" - "golang_org/x/net/lif" + "internal/x/net/lif" ) // If the ifindex is zero, interfaceTable returns mappings of all diff --git a/src/net/lookup_unix.go b/src/net/lookup_unix.go index bef9dcfe14634..6543f121a738f 100644 --- a/src/net/lookup_unix.go +++ b/src/net/lookup_unix.go @@ -12,7 +12,7 @@ import ( "sync" "syscall" - "golang_org/x/net/dns/dnsmessage" + "internal/x/net/dns/dnsmessage" ) var onceReadProtocols sync.Once diff --git a/src/net/pipe_test.go b/src/net/pipe_test.go index 84a71b756bc04..53ddc16313d97 100644 --- a/src/net/pipe_test.go +++ b/src/net/pipe_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "golang_org/x/net/nettest" + "internal/x/net/nettest" ) func TestPipe(t *testing.T) { From 75a7675ed6c85de5bd17060e39fb0cf1cb400ab1 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 31 Oct 2018 15:42:44 -0400 Subject: [PATCH 166/594] cmd/go/internal/renameio: add package renameio.WriteFile writes files atomically by renaming temporary files. See the subsequent changes for usage examples. Updates #26794 Updates #22397 Change-Id: I4bfe3125a53f58060587f98afbb4260bb1cc3d32 Reviewed-on: https://go-review.googlesource.com/c/146377 Run-TryBot: Bryan C. Mills Reviewed-by: Giovanni Bajo Reviewed-by: Russ Cox --- src/cmd/go/internal/renameio/renameio.go | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/cmd/go/internal/renameio/renameio.go diff --git a/src/cmd/go/internal/renameio/renameio.go b/src/cmd/go/internal/renameio/renameio.go new file mode 100644 index 0000000000000..8f59e1a577325 --- /dev/null +++ b/src/cmd/go/internal/renameio/renameio.go @@ -0,0 +1,63 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package renameio writes files atomically by renaming temporary files. +package renameio + +import ( + "bytes" + "io" + "io/ioutil" + "os" + "path/filepath" +) + +const patternSuffix = "*.tmp" + +// Pattern returns a glob pattern that matches the unrenamed temporary files +// created when writing to filename. +func Pattern(filename string) string { + return filepath.Join(filepath.Dir(filename), filepath.Base(filename)+patternSuffix) +} + +// WriteFile is like ioutil.WriteFile, but first writes data to an arbitrary +// file in the same directory as filename, then renames it atomically to the +// final name. +// +// That ensures that the final location, if it exists, is always a complete file. +func WriteFile(filename string, data []byte) (err error) { + return WriteToFile(filename, bytes.NewReader(data)) +} + +// WriteToFile is a variant of WriteFile that accepts the data as an io.Reader +// instead of a slice. +func WriteToFile(filename string, data io.Reader) (err error) { + f, err := ioutil.TempFile(filepath.Dir(filename), filepath.Base(filename)+patternSuffix) + if err != nil { + return err + } + defer func() { + // Only call os.Remove on f.Name() if we failed to rename it: otherwise, + // some other process may have created a new file with the same name after + // that. + if err != nil { + f.Close() + os.Remove(f.Name()) + } + }() + + if _, err := io.Copy(f, data); err != nil { + return err + } + // Sync the file before renaming it: otherwise, after a crash the reader may + // observe a 0-length file instead of the actual contents. + // See https://golang.org/issue/22397#issuecomment-380831736. + if err := f.Sync(); err != nil { + return err + } + if err := f.Close(); err != nil { + return err + } + return os.Rename(f.Name(), filename) +} From 68f496949b9524c610cd25bffd109f27b78536dc Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 23 Oct 2018 14:48:59 -0400 Subject: [PATCH 167/594] cmd/go/internal/cache: write shared mutable files atomically Updates #26794 Change-Id: I2a50e3b756ff6a2bbaee4737ca7ed053b01c8d0e Reviewed-on: https://go-review.googlesource.com/c/146378 Reviewed-by: Russ Cox --- src/cmd/go/internal/cache/cache.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/internal/cache/cache.go b/src/cmd/go/internal/cache/cache.go index 0cf01550ff90d..ab84cf6302c0d 100644 --- a/src/cmd/go/internal/cache/cache.go +++ b/src/cmd/go/internal/cache/cache.go @@ -18,6 +18,8 @@ import ( "strconv" "strings" "time" + + "cmd/go/internal/renameio" ) // An ActionID is a cache action key, the hash of a complete description of a @@ -283,7 +285,9 @@ func (c *Cache) Trim() { c.trimSubdir(subdir, cutoff) } - ioutil.WriteFile(filepath.Join(c.dir, "trim.txt"), []byte(fmt.Sprintf("%d", now.Unix())), 0666) + // Ignore errors from here: if we don't write the complete timestamp, the + // cache will appear older than it is, and we'll trim it again next time. + renameio.WriteFile(filepath.Join(c.dir, "trim.txt"), []byte(fmt.Sprintf("%d", now.Unix()))) } // trimSubdir trims a single cache subdirectory. @@ -338,6 +342,8 @@ func (c *Cache) putIndexEntry(id ActionID, out OutputID, size int64, allowVerify } file := c.fileName(id, "a") if err := ioutil.WriteFile(file, entry, 0666); err != nil { + // TODO(bcmills): This Remove potentially races with another go command writing to file. + // Can we eliminate it? os.Remove(file) return err } From a30f8d1e69238984fcb43fbd9d1c64d46602f6dd Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Thu, 29 Nov 2018 09:47:11 -0800 Subject: [PATCH 168/594] doc: add relnotes for stack objects and mid-stack inlining Change-Id: Ief11612b67def93311707165910124d3ce28fb89 Reviewed-on: https://go-review.googlesource.com/c/151777 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 7a2a50bacc301..9a5d4bc621c43 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -66,6 +66,48 @@

    Build cache requirement

    has no effect in Go 1.12.

    +

    Compiler toolchain

    + +

    + The compiler's live variable analysis has improved. This may mean that + finalizers will be executed sooner in this release than in previous + releases. If that is a problem, consider the appropriate addition of a + runtime.KeepAlive call. +

    + +

    + More functions are now eligible for inlining by default, including + functions that do nothing but call another function. + This extra inlining makes it additionally important to use + runtime.CallersFrames + instead of iterating over the result of + runtime.Callers directly. +

    +// Old code which no longer works correctly (it will miss inlined call frames).
    +var pcs [10]uintptr
    +n := runtime.Callers(1, pcs[:])
    +for _, pc := range pcs[:n] {
    +	f := runtime.FuncForPC(pc)
    +	if f != nil {
    +		fmt.Println(f.Name())
    +	}
    +}
    +
    +
    +// New code which will work correctly.
    +var pcs [10]uintptr
    +n := runtime.Callers(1, pcs[:])
    +frames := runtime.CallersFrames(pcs[:n])
    +for {
    +	frame, more := frames.Next()
    +	fmt.Println(frame.Function)
    +	if !more {
    +		break
    +	}
    +}
    +
    +

    +

    Godoc

    From 47dc92824613e8cb8435457c8b60ba6da671737d Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 16 Oct 2018 10:42:58 -0400 Subject: [PATCH 169/594] cmd/go/internal/lockedfile: add package and support library lockedfile.File passes through to os.File, with Open, Create, and OpenFile functions that mimic the corresponding os functions but acquire locks automatically, releasing them when the file is closed. lockedfile.Sentinel is a simplified wrapper around lockedfile.OpenFile for the common use-case of files that signal the status of idempotent tasks. lockedfile.Mutex is a Mutex-like synchronization primitive implemented in terms of file locks. lockedfile.Read is like ioutil.Read, but obtains a read-lock. lockedfile.Write is like ioutil.Write, but obtains a write-lock and can be used for read-only files with idempotent contents. Updates #26794 Change-Id: I50f7132c71d2727862eed54411f3f27e1af55cad Reviewed-on: https://go-review.googlesource.com/c/145178 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- .../lockedfile/internal/filelock/filelock.go | 98 +++++++++ .../internal/filelock/filelock_other.go | 36 +++ .../internal/filelock/filelock_plan9.go | 38 ++++ .../internal/filelock/filelock_solaris.go | 157 +++++++++++++ .../internal/filelock/filelock_test.go | 206 ++++++++++++++++++ .../internal/filelock/filelock_unix.go | 44 ++++ .../internal/filelock/filelock_windows.go | 66 ++++++ src/cmd/go/internal/lockedfile/lockedfile.go | 122 +++++++++++ .../lockedfile/lockedfile_filelock.go | 63 ++++++ .../internal/lockedfile/lockedfile_plan9.go | 93 ++++++++ .../go/internal/lockedfile/lockedfile_test.go | 174 +++++++++++++++ src/cmd/go/internal/lockedfile/mutex.go | 60 +++++ src/cmd/go/testdata/script/mod_patterns.txt | 10 + 13 files changed, 1167 insertions(+) create mode 100644 src/cmd/go/internal/lockedfile/internal/filelock/filelock.go create mode 100644 src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go create mode 100644 src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go create mode 100644 src/cmd/go/internal/lockedfile/internal/filelock/filelock_solaris.go create mode 100644 src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go create mode 100644 src/cmd/go/internal/lockedfile/internal/filelock/filelock_unix.go create mode 100644 src/cmd/go/internal/lockedfile/internal/filelock/filelock_windows.go create mode 100644 src/cmd/go/internal/lockedfile/lockedfile.go create mode 100644 src/cmd/go/internal/lockedfile/lockedfile_filelock.go create mode 100644 src/cmd/go/internal/lockedfile/lockedfile_plan9.go create mode 100644 src/cmd/go/internal/lockedfile/lockedfile_test.go create mode 100644 src/cmd/go/internal/lockedfile/mutex.go diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock.go new file mode 100644 index 0000000000000..aba3eed7767db --- /dev/null +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock.go @@ -0,0 +1,98 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package filelock provides a platform-independent API for advisory file +// locking. Calls to functions in this package on platforms that do not support +// advisory locks will return errors for which IsNotSupported returns true. +package filelock + +import ( + "errors" + "os" +) + +// A File provides the minimal set of methods required to lock an open file. +// File implementations must be usable as map keys. +// The usual implementation is *os.File. +type File interface { + // Name returns the name of the file. + Name() string + + // Fd returns a valid file descriptor. + // (If the File is an *os.File, it must not be closed.) + Fd() uintptr + + // Stat returns the FileInfo structure describing file. + Stat() (os.FileInfo, error) +} + +// Lock places an advisory write lock on the file, blocking until it can be +// locked. +// +// If Lock returns nil, no other process will be able to place a read or write +// lock on the file until this process exits, closes f, or calls Unlock on it. +// +// If f's descriptor is already read- or write-locked, the behavior of Lock is +// unspecified. +// +// Closing the file may or may not release the lock promptly. Callers should +// ensure that Unlock is always called when Lock succeeds. +func Lock(f File) error { + return lock(f, writeLock) +} + +// RLock places an advisory read lock on the file, blocking until it can be locked. +// +// If RLock returns nil, no other process will be able to place a write lock on +// the file until this process exits, closes f, or calls Unlock on it. +// +// If f is already read- or write-locked, the behavior of RLock is unspecified. +// +// Closing the file may or may not release the lock promptly. Callers should +// ensure that Unlock is always called if RLock succeeds. +func RLock(f File) error { + return lock(f, readLock) +} + +// Unlock removes an advisory lock placed on f by this process. +// +// The caller must not attempt to unlock a file that is not locked. +func Unlock(f File) error { + return unlock(f) +} + +// String returns the name of the function corresponding to lt +// (Lock, RLock, or Unlock). +func (lt lockType) String() string { + switch lt { + case readLock: + return "RLock" + case writeLock: + return "Lock" + default: + return "Unlock" + } +} + +// IsNotSupported returns a boolean indicating whether the error is known to +// report that a function is not supported (possibly for a specific input). +// It is satisfied by ErrNotSupported as well as some syscall errors. +func IsNotSupported(err error) bool { + return isNotSupported(underlyingError(err)) +} + +var ErrNotSupported = errors.New("operation not supported") + +// underlyingError returns the underlying error for known os error types. +func underlyingError(err error) error { + switch err := err.(type) { + case *os.PathError: + return err.Err + case *os.LinkError: + return err.Err + case *os.SyscallError: + return err.Err + } + return err +} diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go new file mode 100644 index 0000000000000..7d60160f909ff --- /dev/null +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go @@ -0,0 +1,36 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!plan9,!solaris,!windows + +package filelock + +import "os" + +type lockType int8 + +const ( + readLock = iota + 1 + writeLock +) + +func lock(f File, lt lockType) error { + return &os.PathError{ + Op: lt.String(), + Path: f.Name(), + Err: ErrNotSupported, + } +} + +func unlock(f File) error { + return &os.PathError{ + Op: "Unlock", + Path: f.Name(), + Err: ErrNotSupported, + } +} + +func isNotSupported(err error) bool { + return err == ErrNotSupported +} diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go new file mode 100644 index 0000000000000..afdffe323fcde --- /dev/null +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go @@ -0,0 +1,38 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build plan9 + +package filelock + +import ( + "os" +) + +type lockType int8 + +const ( + readLock = iota + 1 + writeLock +) + +func lock(f File, lt lockType) error { + return &os.PathError{ + Op: lt.String(), + Path: f.Name(), + Err: ErrNotSupported, + } +} + +func unlock(f File) error { + return &os.PathError{ + Op: "Unlock", + Path: f.Name(), + Err: ErrNotSupported, + } +} + +func isNotSupported(err error) bool { + return err == ErrNotSupported +} diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_solaris.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_solaris.go new file mode 100644 index 0000000000000..b03d5f893e933 --- /dev/null +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_solaris.go @@ -0,0 +1,157 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This code implements the filelock API using POSIX 'fcntl' locks, which attach +// to an (inode, process) pair rather than a file descriptor. To avoid unlocking +// files prematurely when the same file is opened through different descriptors, +// we allow only one read-lock at a time. +// +// Most platforms provide some alternative API, such as an 'flock' system call +// or an F_OFD_SETLK command for 'fcntl', that allows for better concurrency and +// does not require per-inode bookkeeping in the application. +// +// TODO(bcmills): If we add a build tag for Illumos (see golang.org/issue/20603) +// then Illumos should use F_OFD_SETLK, and the resulting code would be as +// simple as filelock_unix.go. We will still need the code in this file as long +// as Oracle Solaris provides only F_SETLK. + +package filelock + +import ( + "errors" + "io" + "os" + "sync" + "syscall" +) + +type lockType int16 + +const ( + readLock lockType = syscall.F_RDLCK + writeLock lockType = syscall.F_WRLCK +) + +type inode = uint64 // type of syscall.Stat_t.Ino + +type inodeLock struct { + owner File + queue []<-chan File +} + +type token struct{} + +var ( + mu sync.Mutex + inodes = map[File]inode{} + locks = map[inode]inodeLock{} +) + +func lock(f File, lt lockType) (err error) { + // POSIX locks apply per inode and process, and the lock for an inode is + // released when *any* descriptor for that inode is closed. So we need to + // synchronize access to each inode internally, and must serialize lock and + // unlock calls that refer to the same inode through different descriptors. + fi, err := f.Stat() + if err != nil { + return err + } + ino := fi.Sys().(*syscall.Stat_t).Ino + + mu.Lock() + if i, dup := inodes[f]; dup && i != ino { + mu.Unlock() + return &os.PathError{ + Op: lt.String(), + Path: f.Name(), + Err: errors.New("inode for file changed since last Lock or RLock"), + } + } + inodes[f] = ino + + var wait chan File + l := locks[ino] + if l.owner == f { + // This file already owns the lock, but the call may change its lock type. + } else if l.owner == nil { + // No owner: it's ours now. + l.owner = f + } else { + // Already owned: add a channel to wait on. + wait = make(chan File) + l.queue = append(l.queue, wait) + } + locks[ino] = l + mu.Unlock() + + if wait != nil { + wait <- f + } + + err = setlkw(f.Fd(), lt) + + if err != nil { + unlock(f) + return &os.PathError{ + Op: lt.String(), + Path: f.Name(), + Err: err, + } + } + + return nil +} + +func unlock(f File) error { + var owner File + + mu.Lock() + ino, ok := inodes[f] + if ok { + owner = locks[ino].owner + } + mu.Unlock() + + if owner != f { + panic("unlock called on a file that is not locked") + } + + err := setlkw(f.Fd(), syscall.F_UNLCK) + + mu.Lock() + l := locks[ino] + if len(l.queue) == 0 { + // No waiters: remove the map entry. + delete(locks, ino) + } else { + // The first waiter is sending us their file now. + // Receive it and update the queue. + l.owner = <-l.queue[0] + l.queue = l.queue[1:] + locks[ino] = l + } + delete(inodes, f) + mu.Unlock() + + return err +} + +// setlkw calls FcntlFlock with F_SETLKW for the entire file indicated by fd. +func setlkw(fd uintptr, lt lockType) error { + for { + err := syscall.FcntlFlock(fd, syscall.F_SETLKW, &syscall.Flock_t{ + Type: int16(lt), + Whence: io.SeekStart, + Start: 0, + Len: 0, // All bytes. + }) + if err != syscall.EINTR { + return err + } + } +} + +func isNotSupported(err error) bool { + return err == syscall.ENOSYS || err == syscall.ENOTSUP || err == syscall.EOPNOTSUPP || err == ErrNotSupported +} diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go new file mode 100644 index 0000000000000..96f4874378fc6 --- /dev/null +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go @@ -0,0 +1,206 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !js,!nacl,!plan9 + +package filelock_test + +import ( + "fmt" + "io/ioutil" + "os" + "os/exec" + "path/filepath" + "runtime" + "testing" + "time" + + "cmd/go/internal/lockedfile/internal/filelock" +) + +func lock(t *testing.T, f *os.File) { + t.Helper() + err := filelock.Lock(f) + t.Logf("Lock(fd %d) = %v", f.Fd(), err) + if err != nil { + t.Fail() + } +} + +func rLock(t *testing.T, f *os.File) { + t.Helper() + err := filelock.RLock(f) + t.Logf("RLock(fd %d) = %v", f.Fd(), err) + if err != nil { + t.Fail() + } +} + +func unlock(t *testing.T, f *os.File) { + t.Helper() + err := filelock.Unlock(f) + t.Logf("Unlock(fd %d) = %v", f.Fd(), err) + if err != nil { + t.Fail() + } +} + +func mustTempFile(t *testing.T) (f *os.File, remove func()) { + t.Helper() + + base := filepath.Base(t.Name()) + f, err := ioutil.TempFile("", base) + if err != nil { + t.Fatalf(`ioutil.TempFile("", %q) = %v`, base, err) + } + t.Logf("fd %d = %s", f.Fd(), f.Name()) + + return f, func() { + f.Close() + os.Remove(f.Name()) + } +} + +func mustOpen(t *testing.T, name string) *os.File { + t.Helper() + + f, err := os.OpenFile(name, os.O_RDWR, 0) + if err != nil { + t.Fatalf("os.Open(%q) = %v", name, err) + } + + t.Logf("fd %d = os.Open(%q)", f.Fd(), name) + return f +} + +const ( + quiescent = 10 * time.Millisecond + probablyStillBlocked = 10 * time.Second +) + +func mustBlock(t *testing.T, op string, f *os.File) (wait func(*testing.T)) { + t.Helper() + + desc := fmt.Sprintf("%s(fd %d)", op, f.Fd()) + + done := make(chan struct{}) + go func() { + t.Helper() + switch op { + case "Lock": + lock(t, f) + case "RLock": + rLock(t, f) + default: + panic("invalid op: " + op) + } + close(done) + }() + + select { + case <-done: + t.Fatalf("%s unexpectedly did not block", desc) + return nil + + case <-time.After(quiescent): + t.Logf("%s is blocked (as expected)", desc) + return func(t *testing.T) { + t.Helper() + select { + case <-time.After(probablyStillBlocked): + t.Fatalf("%s is unexpectedly still blocked", desc) + case <-done: + } + } + } +} + +func TestLockExcludesLock(t *testing.T) { + t.Parallel() + + f, remove := mustTempFile(t) + defer remove() + + other := mustOpen(t, f.Name()) + defer other.Close() + + lock(t, f) + lockOther := mustBlock(t, "Lock", other) + unlock(t, f) + lockOther(t) + unlock(t, other) +} + +func TestLockExcludesRLock(t *testing.T) { + t.Parallel() + + f, remove := mustTempFile(t) + defer remove() + + other := mustOpen(t, f.Name()) + defer other.Close() + + lock(t, f) + rLockOther := mustBlock(t, "RLock", other) + unlock(t, f) + rLockOther(t) + unlock(t, other) +} + +func TestRLockExcludesOnlyLock(t *testing.T) { + t.Parallel() + + f, remove := mustTempFile(t) + defer remove() + rLock(t, f) + + f2 := mustOpen(t, f.Name()) + defer f2.Close() + + if runtime.GOOS == "solaris" { + // When using POSIX locks (as on Solaris), we can't safely read-lock the + // same inode through two different descriptors at the same time: when the + // first descriptor is closed, the second descriptor would still be open but + // silently unlocked. So a second RLock must block instead of proceeding. + lockF2 := mustBlock(t, "RLock", f2) + unlock(t, f) + lockF2(t) + } else { + rLock(t, f2) + } + + other := mustOpen(t, f.Name()) + defer other.Close() + lockOther := mustBlock(t, "Lock", other) + + unlock(t, f2) + if runtime.GOOS != "solaris" { + unlock(t, f) + } + lockOther(t) + unlock(t, other) +} + +func TestLockNotDroppedByExecCommand(t *testing.T) { + f, remove := mustTempFile(t) + defer remove() + + lock(t, f) + + other := mustOpen(t, f.Name()) + defer other.Close() + + // Some kinds of file locks are dropped when a duplicated or forked file + // descriptor is unlocked. Double-check that the approach used by os/exec does + // not accidentally drop locks. + cmd := exec.Command(os.Args[0], "-test.run=^$") + if err := cmd.Run(); err != nil { + t.Fatalf("exec failed: %v", err) + } + + lockOther := mustBlock(t, "Lock", other) + unlock(t, f) + lockOther(t) + unlock(t, other) +} diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_unix.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_unix.go new file mode 100644 index 0000000000000..00c4262832214 --- /dev/null +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_unix.go @@ -0,0 +1,44 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin dragonfly freebsd linux netbsd openbsd + +package filelock + +import ( + "os" + "syscall" +) + +type lockType int16 + +const ( + readLock lockType = syscall.LOCK_SH + writeLock lockType = syscall.LOCK_EX +) + +func lock(f File, lt lockType) (err error) { + for { + err = syscall.Flock(int(f.Fd()), int(lt)) + if err != syscall.EINTR { + break + } + } + if err != nil { + return &os.PathError{ + Op: lt.String(), + Path: f.Name(), + Err: err, + } + } + return nil +} + +func unlock(f File) error { + return lock(f, syscall.LOCK_UN) +} + +func isNotSupported(err error) bool { + return err == syscall.ENOSYS || err == syscall.ENOTSUP || err == syscall.EOPNOTSUPP || err == ErrNotSupported +} diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_windows.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_windows.go new file mode 100644 index 0000000000000..43e85e450ec01 --- /dev/null +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_windows.go @@ -0,0 +1,66 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build windows + +package filelock + +import ( + "internal/syscall/windows" + "os" + "syscall" +) + +type lockType uint32 + +const ( + readLock lockType = 0 + writeLock lockType = windows.LOCKFILE_EXCLUSIVE_LOCK +) + +const ( + reserved = 0 + allBytes = ^uint32(0) +) + +func lock(f File, lt lockType) error { + // Per https://golang.org/issue/19098, “Programs currently expect the Fd + // method to return a handle that uses ordinary synchronous I/O.” + // However, LockFileEx still requires an OVERLAPPED structure, + // which contains the file offset of the beginning of the lock range. + // We want to lock the entire file, so we leave the offset as zero. + ol := new(syscall.Overlapped) + + err := windows.LockFileEx(syscall.Handle(f.Fd()), uint32(lt), reserved, allBytes, allBytes, ol) + if err != nil { + return &os.PathError{ + Op: lt.String(), + Path: f.Name(), + Err: err, + } + } + return nil +} + +func unlock(f File) error { + ol := new(syscall.Overlapped) + err := windows.UnlockFileEx(syscall.Handle(f.Fd()), reserved, allBytes, allBytes, ol) + if err != nil { + return &os.PathError{ + Op: "Unlock", + Path: f.Name(), + Err: err, + } + } + return nil +} + +func isNotSupported(err error) bool { + switch err { + case windows.ERROR_NOT_SUPPORTED, windows.ERROR_CALL_NOT_IMPLEMENTED, ErrNotSupported: + return true + default: + return false + } +} diff --git a/src/cmd/go/internal/lockedfile/lockedfile.go b/src/cmd/go/internal/lockedfile/lockedfile.go new file mode 100644 index 0000000000000..bb184b1085e4e --- /dev/null +++ b/src/cmd/go/internal/lockedfile/lockedfile.go @@ -0,0 +1,122 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package lockedfile creates and manipulates files whose contents should only +// change atomically. +package lockedfile + +import ( + "fmt" + "io" + "io/ioutil" + "os" + "runtime" +) + +// A File is a locked *os.File. +// +// Closing the file releases the lock. +// +// If the program exits while a file is locked, the operating system releases +// the lock but may not do so promptly: callers must ensure that all locked +// files are closed before exiting. +type File struct { + osFile + closed bool +} + +// osFile embeds a *os.File while keeping the pointer itself unexported. +// (When we close a File, it must be the same file descriptor that we opened!) +type osFile struct { + *os.File +} + +// OpenFile is like os.OpenFile, but returns a locked file. +// If flag includes os.O_WRONLY or os.O_RDWR, the file is write-locked; +// otherwise, it is read-locked. +func OpenFile(name string, flag int, perm os.FileMode) (*File, error) { + var ( + f = new(File) + err error + ) + f.osFile.File, err = openFile(name, flag, perm) + if err != nil { + return nil, err + } + + // Although the operating system will drop locks for open files when the go + // command exits, we want to hold locks for as little time as possible, and we + // especially don't want to leave a file locked after we're done with it. Our + // Close method is what releases the locks, so use a finalizer to report + // missing Close calls on a best-effort basis. + runtime.SetFinalizer(f, func(f *File) { + panic(fmt.Sprintf("lockedfile.File %s became unreachable without a call to Close", f.Name())) + }) + + return f, nil +} + +// Open is like os.Open, but returns a read-locked file. +func Open(name string) (*File, error) { + return OpenFile(name, os.O_RDONLY, 0) +} + +// Create is like os.Create, but returns a write-locked file. +func Create(name string) (*File, error) { + return OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666) +} + +// Edit creates the named file with mode 0666 (before umask), +// but does not truncate existing contents. +// +// If Edit succeeds, methods on the returned File can be used for I/O. +// The associated file descriptor has mode O_RDWR and the file is write-locked. +func Edit(name string) (*File, error) { + return OpenFile(name, os.O_RDWR|os.O_CREATE, 0666) +} + +// Close unlocks and closes the underlying file. +// +// Close may be called multiple times; all calls after the first will return a +// non-nil error. +func (f *File) Close() error { + if f.closed { + return &os.PathError{ + Op: "close", + Path: f.Name(), + Err: os.ErrClosed, + } + } + f.closed = true + + err := closeFile(f.osFile.File) + runtime.SetFinalizer(f, nil) + return err +} + +// Read opens the named file with a read-lock and returns its contents. +func Read(name string) ([]byte, error) { + f, err := Open(name) + if err != nil { + return nil, err + } + defer f.Close() + + return ioutil.ReadAll(f) +} + +// Write opens the named file (creating it with the given permissions if needed), +// then write-locks it and overwrites it with the given content. +func Write(name string, content io.Reader, perm os.FileMode) (err error) { + f, err := OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) + if err != nil { + return err + } + + _, err = io.Copy(f, content) + if closeErr := f.Close(); err == nil { + err = closeErr + } + return err +} diff --git a/src/cmd/go/internal/lockedfile/lockedfile_filelock.go b/src/cmd/go/internal/lockedfile/lockedfile_filelock.go new file mode 100644 index 0000000000000..1c390f7425d0a --- /dev/null +++ b/src/cmd/go/internal/lockedfile/lockedfile_filelock.go @@ -0,0 +1,63 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !plan9 + +package lockedfile + +import ( + "os" + + "cmd/go/internal/lockedfile/internal/filelock" +) + +func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { + // On BSD systems, we could add the O_SHLOCK or O_EXLOCK flag to the OpenFile + // call instead of locking separately, but we have to support separate locking + // calls for Linux and Windows anyway, so it's simpler to use that approach + // consistently. + + f, err := os.OpenFile(name, flag&^os.O_TRUNC, perm) + if err != nil { + return nil, err + } + + switch flag & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR) { + case os.O_WRONLY, os.O_RDWR: + err = filelock.Lock(f) + default: + err = filelock.RLock(f) + } + if err == nil && flag&os.O_TRUNC == os.O_TRUNC { + if err = f.Truncate(0); err != nil { + // The documentation for os.O_TRUNC says “if possible, truncate file when + // opened”, but doesn't define “possible” (golang.org/issue/28699). + // We'll treat regular files (and symlinks to regular files) as “possible” + // and ignore errors for the rest. + if fi, statErr := f.Stat(); statErr == nil && !fi.Mode().IsRegular() { + err = nil + } + } + } + + if err != nil { + filelock.Unlock(f) + f.Close() + return nil, err + } + + return f, nil +} + +func closeFile(f *os.File) error { + // Since locking syscalls operate on file descriptors, we must unlock the file + // while the descriptor is still valid — that is, before the file is closed — + // and avoid unlocking files that are already closed. + err := filelock.Unlock(f) + + if closeErr := f.Close(); err == nil { + err = closeErr + } + return err +} diff --git a/src/cmd/go/internal/lockedfile/lockedfile_plan9.go b/src/cmd/go/internal/lockedfile/lockedfile_plan9.go new file mode 100644 index 0000000000000..4a52c94976381 --- /dev/null +++ b/src/cmd/go/internal/lockedfile/lockedfile_plan9.go @@ -0,0 +1,93 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build plan9 + +package lockedfile + +import ( + "math/rand" + "os" + "strings" + "time" +) + +// Opening an exclusive-use file returns an error. +// The expected error strings are: +// +// - "open/create -- file is locked" (cwfs, kfs) +// - "exclusive lock" (fossil) +// - "exclusive use file already open" (ramfs) +var lockedErrStrings = [...]string{ + "file is locked", + "exclusive lock", + "exclusive use file already open", +} + +// Even though plan9 doesn't support the Lock/RLock/Unlock functions to +// manipulate already-open files, IsLocked is still meaningful: os.OpenFile +// itself may return errors that indicate that a file with the ModeExclusive bit +// set is already open. +func isLocked(err error) bool { + s := err.Error() + + for _, frag := range lockedErrStrings { + if strings.Contains(s, frag) { + return true + } + } + + return false +} + +func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { + // Plan 9 uses a mode bit instead of explicit lock/unlock syscalls. + // + // Per http://man.cat-v.org/plan_9/5/stat: “Exclusive use files may be open + // for I/O by only one fid at a time across all clients of the server. If a + // second open is attempted, it draws an error.” + // + // So we can try to open a locked file, but if it fails we're on our own to + // figure out when it becomes available. We'll use exponential backoff with + // some jitter and an arbitrary limit of 500ms. + + // If the file was unpacked or created by some other program, it might not + // have the ModeExclusive bit set. Set it before we call OpenFile, so that we + // can be confident that a successful OpenFile implies exclusive use. + if fi, err := os.Stat(name); err == nil { + if fi.Mode()&os.ModeExclusive == 0 { + if err := os.Chmod(name, fi.Mode()|os.ModeExclusive); err != nil { + return nil, err + } + } + } else if !os.IsNotExist(err) { + return nil, err + } + + nextSleep := 1 * time.Millisecond + const maxSleep = 500 * time.Millisecond + for { + f, err := os.OpenFile(name, flag, perm|os.ModeExclusive) + if err == nil { + return f, nil + } + + if !isLocked(err) { + return nil, err + } + + time.Sleep(nextSleep) + + nextSleep += nextSleep + if nextSleep > maxSleep { + nextSleep = maxSleep + } + // Apply 10% jitter to avoid synchronizing collisions. + nextSleep += time.Duration((0.1*rand.Float64() - 0.05) * float64(nextSleep)) + } +} + +func closeFile(f *os.File) error { + return f.Close() +} diff --git a/src/cmd/go/internal/lockedfile/lockedfile_test.go b/src/cmd/go/internal/lockedfile/lockedfile_test.go new file mode 100644 index 0000000000000..6d5819efdb0e9 --- /dev/null +++ b/src/cmd/go/internal/lockedfile/lockedfile_test.go @@ -0,0 +1,174 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// js and nacl do not support inter-process file locking. +// +build !js,!nacl + +package lockedfile_test + +import ( + "io/ioutil" + "os" + "path/filepath" + "testing" + "time" + + "cmd/go/internal/lockedfile" +) + +func mustTempDir(t *testing.T) (dir string, remove func()) { + t.Helper() + + dir, err := ioutil.TempDir("", filepath.Base(t.Name())) + if err != nil { + t.Fatal(err) + } + return dir, func() { os.RemoveAll(dir) } +} + +const ( + quiescent = 10 * time.Millisecond + probablyStillBlocked = 10 * time.Second +) + +func mustBlock(t *testing.T, desc string, f func()) (wait func(*testing.T)) { + t.Helper() + + done := make(chan struct{}) + go func() { + f() + close(done) + }() + + select { + case <-done: + t.Fatalf("%s unexpectedly did not block", desc) + return nil + + case <-time.After(quiescent): + return func(t *testing.T) { + t.Helper() + select { + case <-time.After(probablyStillBlocked): + t.Fatalf("%s is unexpectedly still blocked after %v", desc, probablyStillBlocked) + case <-done: + } + } + } +} + +func TestMutexExcludes(t *testing.T) { + t.Parallel() + + dir, remove := mustTempDir(t) + defer remove() + + path := filepath.Join(dir, "lock") + + mu := lockedfile.MutexAt(path) + t.Logf("mu := MutexAt(_)") + + unlock, err := mu.Lock() + if err != nil { + t.Fatalf("mu.Lock: %v", err) + } + t.Logf("unlock, _ := mu.Lock()") + + mu2 := lockedfile.MutexAt(mu.Path) + t.Logf("mu2 := MutexAt(mu.Path)") + + wait := mustBlock(t, "mu2.Lock()", func() { + unlock2, err := mu2.Lock() + if err != nil { + t.Errorf("mu2.Lock: %v", err) + return + } + t.Logf("unlock2, _ := mu2.Lock()") + t.Logf("unlock2()") + unlock2() + }) + + t.Logf("unlock()") + unlock() + wait(t) +} + +func TestReadWaitsForLock(t *testing.T) { + t.Parallel() + + dir, remove := mustTempDir(t) + defer remove() + + path := filepath.Join(dir, "timestamp.txt") + + f, err := lockedfile.Create(path) + if err != nil { + t.Fatalf("Create: %v", err) + } + defer f.Close() + + const ( + part1 = "part 1\n" + part2 = "part 2\n" + ) + _, err = f.WriteString(part1) + if err != nil { + t.Fatalf("WriteString: %v", err) + } + t.Logf("WriteString(%q) = ", part1) + + wait := mustBlock(t, "Read", func() { + b, err := lockedfile.Read(path) + if err != nil { + t.Errorf("Read: %v", err) + return + } + + const want = part1 + part2 + got := string(b) + if got == want { + t.Logf("Read(_) = %q", got) + } else { + t.Errorf("Read(_) = %q, _; want %q", got, want) + } + }) + + _, err = f.WriteString(part2) + if err != nil { + t.Errorf("WriteString: %v", err) + } else { + t.Logf("WriteString(%q) = ", part2) + } + f.Close() + + wait(t) +} + +func TestCanLockExistingFile(t *testing.T) { + t.Parallel() + + dir, remove := mustTempDir(t) + defer remove() + path := filepath.Join(dir, "existing.txt") + + if err := ioutil.WriteFile(path, []byte("ok"), 0777); err != nil { + t.Fatalf("ioutil.WriteFile: %v", err) + } + + f, err := lockedfile.Edit(path) + if err != nil { + t.Fatalf("first Edit: %v", err) + } + + wait := mustBlock(t, "Edit", func() { + other, err := lockedfile.Edit(path) + if err != nil { + t.Errorf("second Edit: %v", err) + } + other.Close() + }) + + f.Close() + wait(t) +} diff --git a/src/cmd/go/internal/lockedfile/mutex.go b/src/cmd/go/internal/lockedfile/mutex.go new file mode 100644 index 0000000000000..17f3751c37169 --- /dev/null +++ b/src/cmd/go/internal/lockedfile/mutex.go @@ -0,0 +1,60 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lockedfile + +import ( + "fmt" + "os" +) + +// A Mutex provides mutual exclusion within and across processes by locking a +// well-known file. Such a file generally guards some other part of the +// filesystem: for example, a Mutex file in a directory might guard access to +// the entire tree rooted in that directory. +// +// Mutex does not implement sync.Locker: unlike a sync.Mutex, a lockedfile.Mutex +// can fail to lock (e.g. if there is a permission error in the filesystem). +// +// Like a sync.Mutex, a Mutex may be included as a field of a larger struct but +// must not be copied after first use. The Path field must be set before first +// use and must not be change thereafter. +type Mutex struct { + Path string // The path to the well-known lock file. Must be non-empty. +} + +// MutexAt returns a new Mutex with Path set to the given non-empty path. +func MutexAt(path string) *Mutex { + if path == "" { + panic("lockedfile.MutexAt: path must be non-empty") + } + return &Mutex{Path: path} +} + +func (mu *Mutex) String() string { + return fmt.Sprintf("lockedfile.Mutex(%s)", mu.Path) +} + +// Lock attempts to lock the Mutex. +// +// If successful, Lock returns a non-nil unlock function: it is provided as a +// return-value instead of a separate method to remind the caller to check the +// accompanying error. (See https://golang.org/issue/20803.) +func (mu *Mutex) Lock() (unlock func(), err error) { + if mu.Path == "" { + panic("lockedfile.Mutex: missing Path during Lock") + } + + // We could use either O_RDWR or O_WRONLY here. If we choose O_RDWR and the + // file at mu.Path is write-only, the call to OpenFile will fail with a + // permission error. That's actually what we want: if we add an RLock method + // in the future, it should call OpenFile with O_RDONLY and will require the + // files must be readable, so we should not let the caller make any + // assumptions about Mutex working with write-only files. + f, err := OpenFile(mu.Path, os.O_RDWR|os.O_CREATE, 0666) + if err != nil { + return nil, err + } + return func() { f.Close() }, nil +} diff --git a/src/cmd/go/testdata/script/mod_patterns.txt b/src/cmd/go/testdata/script/mod_patterns.txt index 4fa436ba2d076..5f9ab62704745 100644 --- a/src/cmd/go/testdata/script/mod_patterns.txt +++ b/src/cmd/go/testdata/script/mod_patterns.txt @@ -34,6 +34,13 @@ env CGO_ENABLED=0 go list -f '{{.ImportPath}}: {{.Match}}' all ... example.com/m/... ./... ./xyz... ! stdout example.com/m/useC +# 'go list ./...' should not try to resolve the main module. +cd ../empty +go list -deps ./... +! stdout . +! stderr 'finding' +stderr -count=1 '^go: warning: "./..." matched no packages' + -- m/go.mod -- module example.com/m @@ -64,3 +71,6 @@ module example.com/m/nested -- nested/useencoding/useencoding.go -- package useencoding import _ "encoding" + +-- empty/go.mod -- +module example.com/empty From c124a919716fd54f9b16b83fa94f68b0c8fc4681 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 23 Oct 2018 15:39:07 -0400 Subject: [PATCH 170/594] cmd/go/internal/{clean,test}: lock testexpire.txt Also check to make sure we don't overwrite a newer timestamp with an older one. testexpire.txt may be written concurrently, and a partially-written timestamp may appear much older than the actual intended one. We don't want to re-run tests that should still be cached. Updates #26794 Change-Id: If56348e799f0e7be3c5bc91b4a336e23ad99f791 Reviewed-on: https://go-review.googlesource.com/c/146379 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/clean/clean.go | 17 ++++++++++++++++- src/cmd/go/internal/test/test.go | 3 ++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go index b12bd981a70a0..73e04960d2bbd 100644 --- a/src/cmd/go/internal/clean/clean.go +++ b/src/cmd/go/internal/clean/clean.go @@ -10,6 +10,7 @@ import ( "io/ioutil" "os" "path/filepath" + "strconv" "strings" "time" @@ -17,6 +18,7 @@ import ( "cmd/go/internal/cache" "cmd/go/internal/cfg" "cmd/go/internal/load" + "cmd/go/internal/lockedfile" "cmd/go/internal/modfetch" "cmd/go/internal/modload" "cmd/go/internal/work" @@ -146,7 +148,20 @@ func runClean(cmd *base.Command, args []string) { // right now are to be ignored. dir := cache.DefaultDir() if dir != "off" { - err := ioutil.WriteFile(filepath.Join(dir, "testexpire.txt"), []byte(fmt.Sprintf("%d\n", time.Now().UnixNano())), 0666) + f, err := lockedfile.Edit(filepath.Join(dir, "testexpire.txt")) + if err == nil { + now := time.Now().UnixNano() + buf, _ := ioutil.ReadAll(f) + prev, _ := strconv.ParseInt(strings.TrimSpace(string(buf)), 10, 64) + if now > prev { + if err = f.Truncate(0); err == nil { + _, err = fmt.Fprintf(f, "%d\n", now) + } + } + if closeErr := f.Close(); err == nil { + err = closeErr + } + } if err != nil { base.Errorf("go clean -testcache: %v", err) } diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index b38eb4c41dafa..8dfb3df22d3b9 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -27,6 +27,7 @@ import ( "cmd/go/internal/cache" "cmd/go/internal/cfg" "cmd/go/internal/load" + "cmd/go/internal/lockedfile" "cmd/go/internal/modload" "cmd/go/internal/str" "cmd/go/internal/work" @@ -566,7 +567,7 @@ func runTest(cmd *base.Command, args []string) { // (We implement go clean -testcache by writing an expiration date // instead of searching out and deleting test result cache entries.) if dir := cache.DefaultDir(); dir != "off" { - if data, _ := ioutil.ReadFile(filepath.Join(dir, "testexpire.txt")); len(data) > 0 && data[len(data)-1] == '\n' { + if data, _ := lockedfile.Read(filepath.Join(dir, "testexpire.txt")); len(data) > 0 && data[len(data)-1] == '\n' { if t, err := strconv.ParseInt(string(data[:len(data)-1]), 10, 64); err == nil { testCacheExpire = time.Unix(0, t) } From ba2e8f65ab36f145177419c56cc03adf67f0e167 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 27 Nov 2018 08:50:28 -0500 Subject: [PATCH 171/594] cmd/go/internal/modfetch: make Repo.Zip write to an io.Writer instead of a temporary file This will be used to eliminate a redundant copy in CL 145178. (It also decouples two design points that were previously coupled: the destination of the zip output and the program logic to write that output.) Updates #26794 Change-Id: I6cfd5a33c162c0016a1b83a278003684560a3772 Reviewed-on: https://go-review.googlesource.com/c/151341 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/modfetch/cache.go | 5 +- src/cmd/go/internal/modfetch/coderepo.go | 67 +++++++------------ src/cmd/go/internal/modfetch/coderepo_test.go | 8 ++- src/cmd/go/internal/modfetch/fetch.go | 26 ++++--- src/cmd/go/internal/modfetch/proxy.go | 30 +++------ src/cmd/go/internal/modfetch/repo.go | 19 +++--- 6 files changed, 71 insertions(+), 84 deletions(-) diff --git a/src/cmd/go/internal/modfetch/cache.go b/src/cmd/go/internal/modfetch/cache.go index 171718d20b068..f3f04a151d80a 100644 --- a/src/cmd/go/internal/modfetch/cache.go +++ b/src/cmd/go/internal/modfetch/cache.go @@ -8,6 +8,7 @@ import ( "bytes" "encoding/json" "fmt" + "io" "io/ioutil" "os" "path/filepath" @@ -215,8 +216,8 @@ func (r *cachingRepo) GoMod(rev string) ([]byte, error) { return append([]byte(nil), c.text...), nil } -func (r *cachingRepo) Zip(version, tmpdir string) (string, error) { - return r.r.Zip(version, tmpdir) +func (r *cachingRepo) Zip(dst io.Writer, version string) error { + return r.r.Zip(dst, version) } // Stat is like Lookup(path).Stat(rev) but avoids the diff --git a/src/cmd/go/internal/modfetch/coderepo.go b/src/cmd/go/internal/modfetch/coderepo.go index 9cf0e911508c0..737aade739b6d 100644 --- a/src/cmd/go/internal/modfetch/coderepo.go +++ b/src/cmd/go/internal/modfetch/coderepo.go @@ -407,25 +407,26 @@ func (r *codeRepo) modPrefix(rev string) string { return r.modPath + "@" + rev } -func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error) { +func (r *codeRepo) Zip(dst io.Writer, version string) error { rev, dir, _, err := r.findDir(version) if err != nil { - return "", err + return err } dl, actualDir, err := r.code.ReadZip(rev, dir, codehost.MaxZipFile) if err != nil { - return "", err + return err } + defer dl.Close() if actualDir != "" && !hasPathPrefix(dir, actualDir) { - return "", fmt.Errorf("internal error: downloading %v %v: dir=%q but actualDir=%q", r.path, rev, dir, actualDir) + return fmt.Errorf("internal error: downloading %v %v: dir=%q but actualDir=%q", r.path, rev, dir, actualDir) } subdir := strings.Trim(strings.TrimPrefix(dir, actualDir), "/") // Spool to local file. - f, err := ioutil.TempFile(tmpdir, "go-codehost-") + f, err := ioutil.TempFile("", "go-codehost-") if err != nil { dl.Close() - return "", err + return err } defer os.Remove(f.Name()) defer f.Close() @@ -433,35 +434,24 @@ func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error lr := &io.LimitedReader{R: dl, N: maxSize + 1} if _, err := io.Copy(f, lr); err != nil { dl.Close() - return "", err + return err } dl.Close() if lr.N <= 0 { - return "", fmt.Errorf("downloaded zip file too large") + return fmt.Errorf("downloaded zip file too large") } size := (maxSize + 1) - lr.N if _, err := f.Seek(0, 0); err != nil { - return "", err + return err } // Translate from zip file we have to zip file we want. zr, err := zip.NewReader(f, size) if err != nil { - return "", err - } - f2, err := ioutil.TempFile(tmpdir, "go-codezip-") - if err != nil { - return "", err + return err } - zw := zip.NewWriter(f2) - newName := f2.Name() - defer func() { - f2.Close() - if err != nil { - os.Remove(newName) - } - }() + zw := zip.NewWriter(dst) if subdir != "" { subdir += "/" } @@ -472,12 +462,12 @@ func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error if topPrefix == "" { i := strings.Index(zf.Name, "/") if i < 0 { - return "", fmt.Errorf("missing top-level directory prefix") + return fmt.Errorf("missing top-level directory prefix") } topPrefix = zf.Name[:i+1] } if !strings.HasPrefix(zf.Name, topPrefix) { - return "", fmt.Errorf("zip file contains more than one top-level directory") + return fmt.Errorf("zip file contains more than one top-level directory") } dir, file := path.Split(zf.Name) if file == "go.mod" { @@ -497,11 +487,12 @@ func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error name = dir[:len(dir)-1] } } + for _, zf := range zr.File { if topPrefix == "" { i := strings.Index(zf.Name, "/") if i < 0 { - return "", fmt.Errorf("missing top-level directory prefix") + return fmt.Errorf("missing top-level directory prefix") } topPrefix = zf.Name[:i+1] } @@ -509,7 +500,7 @@ func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error continue } if !strings.HasPrefix(zf.Name, topPrefix) { - return "", fmt.Errorf("zip file contains more than one top-level directory") + return fmt.Errorf("zip file contains more than one top-level directory") } name := strings.TrimPrefix(zf.Name, topPrefix) if !strings.HasPrefix(name, subdir) { @@ -529,28 +520,28 @@ func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error } base := path.Base(name) if strings.ToLower(base) == "go.mod" && base != "go.mod" { - return "", fmt.Errorf("zip file contains %s, want all lower-case go.mod", zf.Name) + return fmt.Errorf("zip file contains %s, want all lower-case go.mod", zf.Name) } if name == "LICENSE" { haveLICENSE = true } - size := int64(zf.UncompressedSize) + size := int64(zf.UncompressedSize64) if size < 0 || maxSize < size { - return "", fmt.Errorf("module source tree too big") + return fmt.Errorf("module source tree too big") } maxSize -= size rc, err := zf.Open() if err != nil { - return "", err + return err } w, err := zw.Create(r.modPrefix(version) + "/" + name) lr := &io.LimitedReader{R: rc, N: size + 1} if _, err := io.Copy(w, lr); err != nil { - return "", err + return err } if lr.N <= 0 { - return "", fmt.Errorf("individual file too large") + return fmt.Errorf("individual file too large") } } @@ -559,21 +550,15 @@ func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error if err == nil { w, err := zw.Create(r.modPrefix(version) + "/LICENSE") if err != nil { - return "", err + return err } if _, err := w.Write(data); err != nil { - return "", err + return err } } } - if err := zw.Close(); err != nil { - return "", err - } - if err := f2.Close(); err != nil { - return "", err - } - return f2.Name(), nil + return zw.Close() } // hasPathPrefix reports whether the path s begins with the diff --git a/src/cmd/go/internal/modfetch/coderepo_test.go b/src/cmd/go/internal/modfetch/coderepo_test.go index 73c4bd2ccab9d..e8bf8ed750e83 100644 --- a/src/cmd/go/internal/modfetch/coderepo_test.go +++ b/src/cmd/go/internal/modfetch/coderepo_test.go @@ -391,7 +391,13 @@ func TestCodeRepo(t *testing.T) { } } if tt.zip != nil || tt.ziperr != "" { - zipfile, err := repo.Zip(tt.version, tmpdir) + f, err := ioutil.TempFile(tmpdir, tt.version+".zip.") + if err != nil { + t.Fatalf("ioutil.TempFile: %v", err) + } + zipfile := f.Name() + err = repo.Zip(f, tt.version) + f.Close() if err != nil { if tt.ziperr != "" { if err.Error() == tt.ziperr { diff --git a/src/cmd/go/internal/modfetch/fetch.go b/src/cmd/go/internal/modfetch/fetch.go index 9984595c05510..e3bc7b51332d6 100644 --- a/src/cmd/go/internal/modfetch/fetch.go +++ b/src/cmd/go/internal/modfetch/fetch.go @@ -108,41 +108,47 @@ func downloadZip(mod module.Version, target string) error { if err != nil { return err } - tmpfile, err := repo.Zip(mod.Version, os.TempDir()) + tmpfile, err := ioutil.TempFile("", "go-codezip-") if err != nil { return err } - defer os.Remove(tmpfile) + defer func() { + tmpfile.Close() + os.Remove(tmpfile.Name()) + }() + if err := repo.Zip(tmpfile, mod.Version); err != nil { + return err + } // Double-check zip file looks OK. - z, err := zip.OpenReader(tmpfile) + fi, err := tmpfile.Stat() + if err != nil { + return err + } + z, err := zip.NewReader(tmpfile, fi.Size()) if err != nil { return err } prefix := mod.Path + "@" + mod.Version + "/" for _, f := range z.File { if !strings.HasPrefix(f.Name, prefix) { - z.Close() return fmt.Errorf("zip for %s has unexpected file %s", prefix[:len(prefix)-1], f.Name) } } - z.Close() - hash, err := dirhash.HashZip(tmpfile, dirhash.DefaultHash) + hash, err := dirhash.HashZip(tmpfile.Name(), dirhash.DefaultHash) if err != nil { return err } checkOneSum(mod, hash) // check before installing the zip file - r, err := os.Open(tmpfile) - if err != nil { + if _, err := tmpfile.Seek(0, io.SeekStart); err != nil { return err } - defer r.Close() w, err := os.Create(target) if err != nil { return err } - if _, err := io.Copy(w, r); err != nil { + if _, err := io.Copy(w, tmpfile); err != nil { w.Close() return fmt.Errorf("copying: %v", err) } diff --git a/src/cmd/go/internal/modfetch/proxy.go b/src/cmd/go/internal/modfetch/proxy.go index 7c78502f318d7..60ed2a3796606 100644 --- a/src/cmd/go/internal/modfetch/proxy.go +++ b/src/cmd/go/internal/modfetch/proxy.go @@ -8,7 +8,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/url" "os" "strings" @@ -209,39 +208,26 @@ func (p *proxyRepo) GoMod(version string) ([]byte, error) { return data, nil } -func (p *proxyRepo) Zip(version string, tmpdir string) (tmpfile string, err error) { +func (p *proxyRepo) Zip(dst io.Writer, version string) error { var body io.ReadCloser encVer, err := module.EncodeVersion(version) if err != nil { - return "", err + return err } err = webGetBody(p.url+"/@v/"+pathEscape(encVer)+".zip", &body) if err != nil { - return "", err + return err } defer body.Close() - // Spool to local file. - f, err := ioutil.TempFile(tmpdir, "go-proxy-download-") - if err != nil { - return "", err - } - defer f.Close() - maxSize := int64(codehost.MaxZipFile) - lr := &io.LimitedReader{R: body, N: maxSize + 1} - if _, err := io.Copy(f, lr); err != nil { - os.Remove(f.Name()) - return "", err + lr := &io.LimitedReader{R: body, N: codehost.MaxZipFile + 1} + if _, err := io.Copy(dst, lr); err != nil { + return err } if lr.N <= 0 { - os.Remove(f.Name()) - return "", fmt.Errorf("downloaded zip file too large") - } - if err := f.Close(); err != nil { - os.Remove(f.Name()) - return "", err + return fmt.Errorf("downloaded zip file too large") } - return f.Name(), nil + return nil } // pathEscape escapes s so it can be used in a path. diff --git a/src/cmd/go/internal/modfetch/repo.go b/src/cmd/go/internal/modfetch/repo.go index 0ea8c1f0e35e8..c63f6b04221dd 100644 --- a/src/cmd/go/internal/modfetch/repo.go +++ b/src/cmd/go/internal/modfetch/repo.go @@ -6,8 +6,10 @@ package modfetch import ( "fmt" + "io" "os" "sort" + "strconv" "time" "cmd/go/internal/cfg" @@ -45,11 +47,8 @@ type Repo interface { // GoMod returns the go.mod file for the given version. GoMod(version string) (data []byte, err error) - // Zip downloads a zip file for the given version - // to a new file in a given temporary directory. - // It returns the name of the new file. - // The caller should remove the file when finished with it. - Zip(version, tmpdir string) (tmpfile string, err error) + // Zip writes a zip file for the given version to dst. + Zip(dst io.Writer, version string) error } // A Rev describes a single revision in a module repository. @@ -357,7 +356,11 @@ func (l *loggingRepo) GoMod(version string) ([]byte, error) { return l.r.GoMod(version) } -func (l *loggingRepo) Zip(version, tmpdir string) (string, error) { - defer logCall("Repo[%s]: Zip(%q, %q)", l.r.ModulePath(), version, tmpdir)() - return l.r.Zip(version, tmpdir) +func (l *loggingRepo) Zip(dst io.Writer, version string) error { + dstName := "_" + if dst, ok := dst.(interface{ Name() string }); ok { + dstName = strconv.Quote(dst.Name()) + } + defer logCall("Repo[%s]: Zip(%s, %q)", l.r.ModulePath(), dstName, version)() + return l.r.Zip(dst, version) } From 04e12a5bfa51777c4ba46ed2e026f53578206754 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 15 Oct 2018 15:52:01 -0400 Subject: [PATCH 172/594] cmd/go/internal/modfetch: lock files and directories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We employ the following new locking mechanisms: • Zip files and list files within the module cache are written using atomic renames of temporary files, so that GOPROXY servers reading from the cache will never serve incomplete content. • A lock file for each module version guards downloading and extraction of (immutable) module contents. • A lock file alongside each version list (named 'list.lock') guards updates to the list. • A single lock file in the module cache guards updates to all go.sum files. The go.sum files themselves are written using an atomic rename to ensure that we never accidentally discard existing sums. Updates #26794 RELNOTE=yes Change-Id: I16ef8b06ee4bd7b94d0c0a6f5d17e1cecc379076 Reviewed-on: https://go-review.googlesource.com/c/146382 Run-TryBot: Bryan C. Mills Reviewed-by: Russ Cox --- src/cmd/go/internal/clean/clean.go | 16 +- src/cmd/go/internal/modfetch/cache.go | 75 +++-- src/cmd/go/internal/modfetch/fetch.go | 305 ++++++++++++++---- src/cmd/go/internal/modfetch/unzip.go | 22 +- src/cmd/go/testdata/script/mod_concurrent.txt | 31 ++ 5 files changed, 337 insertions(+), 112 deletions(-) create mode 100644 src/cmd/go/testdata/script/mod_concurrent.txt diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go index 73e04960d2bbd..96fd653b745e3 100644 --- a/src/cmd/go/internal/clean/clean.go +++ b/src/cmd/go/internal/clean/clean.go @@ -176,27 +176,13 @@ func runClean(cmd *base.Command, args []string) { b.Showcmd("", "rm -rf %s", modfetch.PkgMod) } if !cfg.BuildN { - if err := removeAll(modfetch.PkgMod); err != nil { + if err := modfetch.RemoveAll(modfetch.PkgMod); err != nil { base.Errorf("go clean -modcache: %v", err) } } } } -func removeAll(dir string) error { - // Module cache has 0555 directories; make them writable in order to remove content. - filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { - if err != nil { - return nil // ignore errors walking in file system - } - if info.IsDir() { - os.Chmod(path, 0777) - } - return nil - }) - return os.RemoveAll(dir) -} - var cleaned = map[*load.Package]bool{} // TODO: These are dregs left by Makefile-based builds. diff --git a/src/cmd/go/internal/modfetch/cache.go b/src/cmd/go/internal/modfetch/cache.go index f3f04a151d80a..80484d5b5e728 100644 --- a/src/cmd/go/internal/modfetch/cache.go +++ b/src/cmd/go/internal/modfetch/cache.go @@ -15,9 +15,11 @@ import ( "strings" "cmd/go/internal/base" + "cmd/go/internal/lockedfile" "cmd/go/internal/modfetch/codehost" "cmd/go/internal/module" "cmd/go/internal/par" + "cmd/go/internal/renameio" "cmd/go/internal/semver" ) @@ -75,6 +77,37 @@ func DownloadDir(m module.Version) (string, error) { return filepath.Join(PkgMod, enc+"@"+encVer), nil } +// lockVersion locks a file within the module cache that guards the downloading +// and extraction of the zipfile for the given module version. +func lockVersion(mod module.Version) (unlock func(), err error) { + path, err := CachePath(mod, "lock") + if err != nil { + return nil, err + } + if err := os.MkdirAll(filepath.Dir(path), 0777); err != nil { + return nil, err + } + return lockedfile.MutexAt(path).Lock() +} + +// SideLock locks a file within the module cache that that guards edits to files +// outside the cache, such as go.sum and go.mod files in the user's working +// directory. It returns a function that must be called to unlock the file. +func SideLock() (unlock func()) { + if PkgMod == "" { + base.Fatalf("go: internal error: modfetch.PkgMod not set") + } + path := filepath.Join(PkgMod, "cache", "lock") + if err := os.MkdirAll(filepath.Dir(path), 0777); err != nil { + base.Fatalf("go: failed to create cache directory %s: %v", filepath.Dir(path), err) + } + unlock, err := lockedfile.MutexAt(path).Lock() + if err != nil { + base.Fatalf("go: failed to lock file at %v", path) + } + return unlock +} + // A cachingRepo is a cache around an underlying Repo, // avoiding redundant calls to ModulePath, Versions, Stat, Latest, and GoMod (but not Zip). // It is also safe for simultaneous use by multiple goroutines @@ -386,7 +419,7 @@ func readDiskStatByHash(path, rev string) (file string, info *RevInfo, err error // and should ignore it. var oldVgoPrefix = []byte("//vgo 0.0.") -// readDiskGoMod reads a cached stat result from disk, +// readDiskGoMod reads a cached go.mod file from disk, // returning the name of the cache file and the result. // If the read fails, the caller can use // writeDiskGoMod(file, data) to write a new cache entry. @@ -452,22 +485,8 @@ func writeDiskCache(file string, data []byte) error { if err := os.MkdirAll(filepath.Dir(file), 0777); err != nil { return err } - // Write data to temp file next to target file. - f, err := ioutil.TempFile(filepath.Dir(file), filepath.Base(file)+".tmp-") - if err != nil { - return err - } - defer os.Remove(f.Name()) - defer f.Close() - if _, err := f.Write(data); err != nil { - return err - } - if err := f.Close(); err != nil { - return err - } - // Rename temp file onto cache file, - // so that the cache file is always a complete file. - if err := os.Rename(f.Name(), file); err != nil { + + if err := renameio.WriteFile(file, data); err != nil { return err } @@ -484,8 +503,18 @@ func rewriteVersionList(dir string) { base.Fatalf("go: internal error: misuse of rewriteVersionList") } - // TODO(rsc): We should do some kind of directory locking here, - // to avoid lost updates. + listFile := filepath.Join(dir, "list") + + // We use a separate lockfile here instead of locking listFile itself because + // we want to use Rename to write the file atomically. The list may be read by + // a GOPROXY HTTP server, and if we crash midway through a rewrite (or if the + // HTTP server ignores our locking and serves the file midway through a + // rewrite) it's better to serve a stale list than a truncated one. + unlock, err := lockedfile.MutexAt(listFile + ".lock").Lock() + if err != nil { + base.Fatalf("go: can't lock version list lockfile: %v", err) + } + defer unlock() infos, err := ioutil.ReadDir(dir) if err != nil { @@ -514,12 +543,12 @@ func rewriteVersionList(dir string) { buf.WriteString(v) buf.WriteString("\n") } - listFile := filepath.Join(dir, "list") old, _ := ioutil.ReadFile(listFile) if bytes.Equal(buf.Bytes(), old) { return } - // TODO: Use rename to install file, - // so that readers never see an incomplete file. - ioutil.WriteFile(listFile, buf.Bytes(), 0666) + + if err := renameio.WriteFile(listFile, buf.Bytes()); err != nil { + base.Fatalf("go: failed to write version list: %v", err) + } } diff --git a/src/cmd/go/internal/modfetch/fetch.go b/src/cmd/go/internal/modfetch/fetch.go index e3bc7b51332d6..159bc569296b3 100644 --- a/src/cmd/go/internal/modfetch/fetch.go +++ b/src/cmd/go/internal/modfetch/fetch.go @@ -21,6 +21,7 @@ import ( "cmd/go/internal/dirhash" "cmd/go/internal/module" "cmd/go/internal/par" + "cmd/go/internal/renameio" ) var downloadCache par.Cache @@ -34,9 +35,7 @@ func Download(mod module.Version) (dir string, err error) { return "", fmt.Errorf("missing modfetch.PkgMod") } - // The par.Cache here avoids duplicate work but also - // avoids conflicts from simultaneous calls by multiple goroutines - // for the same version. + // The par.Cache here avoids duplicate work. type cached struct { dir string err error @@ -46,16 +45,8 @@ func Download(mod module.Version) (dir string, err error) { if err != nil { return cached{"", err} } - if files, _ := ioutil.ReadDir(dir); len(files) == 0 { - zipfile, err := DownloadZip(mod) - if err != nil { - return cached{"", err} - } - modpath := mod.Path + "@" + mod.Version - if err := Unzip(dir, zipfile, modpath, 0); err != nil { - fmt.Fprintf(os.Stderr, "-> %s\n", err) - return cached{"", err} - } + if err := download(mod, dir); err != nil { + return cached{"", err} } checkSum(mod) return cached{dir, nil} @@ -63,14 +54,81 @@ func Download(mod module.Version) (dir string, err error) { return c.dir, c.err } +func download(mod module.Version, dir string) (err error) { + // If the directory exists, the module has already been extracted. + fi, err := os.Stat(dir) + if err == nil && fi.IsDir() { + return nil + } + + // To avoid cluttering the cache with extraneous files, + // DownloadZip uses the same lockfile as Download. + // Invoke DownloadZip before locking the file. + zipfile, err := DownloadZip(mod) + if err != nil { + return err + } + + if cfg.CmdName != "mod download" { + fmt.Fprintf(os.Stderr, "go: extracting %s %s\n", mod.Path, mod.Version) + } + + unlock, err := lockVersion(mod) + if err != nil { + return err + } + defer unlock() + + // Check whether the directory was populated while we were waiting on the lock. + fi, err = os.Stat(dir) + if err == nil && fi.IsDir() { + return nil + } + + // Clean up any remaining temporary directories from previous runs. + // This is only safe to do because the lock file ensures that their writers + // are no longer active. + parentDir := filepath.Dir(dir) + tmpPrefix := filepath.Base(dir) + ".tmp-" + if old, err := filepath.Glob(filepath.Join(parentDir, tmpPrefix+"*")); err == nil { + for _, path := range old { + RemoveAll(path) // best effort + } + } + + // Extract the zip file to a temporary directory, then rename it to the + // final path. That way, we can use the existence of the source directory to + // signal that it has been extracted successfully, and if someone deletes + // the entire directory (e.g. as an attempt to prune out file corruption) + // the module cache will still be left in a recoverable state. + if err := os.MkdirAll(parentDir, 0777); err != nil { + return err + } + tmpDir, err := ioutil.TempDir(parentDir, tmpPrefix) + if err != nil { + return err + } + defer func() { + if err != nil { + RemoveAll(tmpDir) + } + }() + + modpath := mod.Path + "@" + mod.Version + if err := Unzip(tmpDir, zipfile, modpath, 0); err != nil { + fmt.Fprintf(os.Stderr, "-> %s\n", err) + return err + } + + return os.Rename(tmpDir, dir) +} + var downloadZipCache par.Cache // DownloadZip downloads the specific module version to the // local zip cache and returns the name of the zip file. func DownloadZip(mod module.Version) (zipfile string, err error) { - // The par.Cache here avoids duplicate work but also - // avoids conflicts from simultaneous calls by multiple goroutines - // for the same version. + // The par.Cache here avoids duplicate work. type cached struct { zipfile string err error @@ -80,52 +138,82 @@ func DownloadZip(mod module.Version) (zipfile string, err error) { if err != nil { return cached{"", err} } + + // Skip locking if the zipfile already exists. if _, err := os.Stat(zipfile); err == nil { - // Use it. - // This should only happen if the mod/cache directory is preinitialized - // or if pkg/mod/path was removed but not pkg/mod/cache/download. - if cfg.CmdName != "mod download" { - fmt.Fprintf(os.Stderr, "go: extracting %s %s\n", mod.Path, mod.Version) - } - } else { - if err := os.MkdirAll(filepath.Dir(zipfile), 0777); err != nil { - return cached{"", err} - } - if cfg.CmdName != "mod download" { - fmt.Fprintf(os.Stderr, "go: downloading %s %s\n", mod.Path, mod.Version) - } - if err := downloadZip(mod, zipfile); err != nil { - return cached{"", err} - } + return cached{zipfile, nil} + } + + // The zip file does not exist. Acquire the lock and create it. + if cfg.CmdName != "mod download" { + fmt.Fprintf(os.Stderr, "go: downloading %s %s\n", mod.Path, mod.Version) + } + unlock, err := lockVersion(mod) + if err != nil { + return cached{"", err} + } + defer unlock() + + // Double-check that the zipfile was not created while we were waiting for + // the lock. + if _, err := os.Stat(zipfile); err == nil { + return cached{zipfile, nil} + } + if err := os.MkdirAll(filepath.Dir(zipfile), 0777); err != nil { + return cached{"", err} + } + if err := downloadZip(mod, zipfile); err != nil { + return cached{"", err} } return cached{zipfile, nil} }).(cached) return c.zipfile, c.err } -func downloadZip(mod module.Version, target string) error { - repo, err := Lookup(mod.Path) - if err != nil { - return err +func downloadZip(mod module.Version, zipfile string) (err error) { + // Clean up any remaining tempfiles from previous runs. + // This is only safe to do because the lock file ensures that their + // writers are no longer active. + for _, base := range []string{zipfile, zipfile + "hash"} { + if old, err := filepath.Glob(renameio.Pattern(base)); err == nil { + for _, path := range old { + os.Remove(path) // best effort + } + } } - tmpfile, err := ioutil.TempFile("", "go-codezip-") + + // From here to the os.Rename call below is functionally almost equivalent to + // renameio.WriteToFile, with one key difference: we want to validate the + // contents of the file (by hashing it) before we commit it. Because the file + // is zip-compressed, we need an actual file — or at least an io.ReaderAt — to + // validate it: we can't just tee the stream as we write it. + f, err := ioutil.TempFile(filepath.Dir(zipfile), filepath.Base(renameio.Pattern(zipfile))) if err != nil { return err } defer func() { - tmpfile.Close() - os.Remove(tmpfile.Name()) + if err != nil { + f.Close() + os.Remove(f.Name()) + } }() - if err := repo.Zip(tmpfile, mod.Version); err != nil { + + repo, err := Lookup(mod.Path) + if err != nil { + return err + } + if err := repo.Zip(f, mod.Version); err != nil { return err } - // Double-check zip file looks OK. - fi, err := tmpfile.Stat() + // Double-check that the paths within the zip file are well-formed. + // + // TODO(bcmills): There is a similar check within the Unzip function. Can we eliminate one? + fi, err := f.Stat() if err != nil { return err } - z, err := zip.NewReader(tmpfile, fi.Size()) + z, err := zip.NewReader(f, fi.Size()) if err != nil { return err } @@ -136,33 +224,48 @@ func downloadZip(mod module.Version, target string) error { } } - hash, err := dirhash.HashZip(tmpfile.Name(), dirhash.DefaultHash) - if err != nil { + // Sync the file before renaming it: otherwise, after a crash the reader may + // observe a 0-length file instead of the actual contents. + // See https://golang.org/issue/22397#issuecomment-380831736. + if err := f.Sync(); err != nil { return err } - checkOneSum(mod, hash) // check before installing the zip file - if _, err := tmpfile.Seek(0, io.SeekStart); err != nil { + if err := f.Close(); err != nil { return err } - w, err := os.Create(target) + + // Hash the zip file and check the sum before renaming to the final location. + hash, err := dirhash.HashZip(f.Name(), dirhash.DefaultHash) if err != nil { return err } - if _, err := io.Copy(w, tmpfile); err != nil { - w.Close() - return fmt.Errorf("copying: %v", err) + checkOneSum(mod, hash) + + if err := renameio.WriteFile(zipfile+"hash", []byte(hash)); err != nil { + return err } - if err := w.Close(); err != nil { + if err := os.Rename(f.Name(), zipfile); err != nil { return err } - return ioutil.WriteFile(target+"hash", []byte(hash), 0666) + + // TODO(bcmills): Should we make the .zip and .ziphash files read-only to discourage tampering? + + return nil } var GoSumFile string // path to go.sum; set by package modload +type modSum struct { + mod module.Version + sum string +} + var goSum struct { mu sync.Mutex m map[module.Version][]string // content of go.sum file (+ go.modverify if present) + checked map[modSum]bool // sums actually checked during execution + dirty bool // whether we added any new sums to m + overwrite bool // if true, overwrite go.sum without incorporating its contents enabled bool // whether to use go.sum at all modverify string // path to go.modverify, to be deleted } @@ -179,18 +282,25 @@ func initGoSum() bool { } goSum.m = make(map[module.Version][]string) + goSum.checked = make(map[modSum]bool) data, err := ioutil.ReadFile(GoSumFile) if err != nil && !os.IsNotExist(err) { base.Fatalf("go: %v", err) } goSum.enabled = true - readGoSum(GoSumFile, data) + readGoSum(goSum.m, GoSumFile, data) // Add old go.modverify file. // We'll delete go.modverify in WriteGoSum. alt := strings.TrimSuffix(GoSumFile, ".sum") + ".modverify" if data, err := ioutil.ReadFile(alt); err == nil { - readGoSum(alt, data) + migrate := make(map[module.Version][]string) + readGoSum(migrate, alt, data) + for mod, sums := range migrate { + for _, sum := range sums { + checkOneSumLocked(mod, sum) + } + } goSum.modverify = alt } return true @@ -203,7 +313,7 @@ const emptyGoModHash = "h1:G7mAYYxgmS0lVkHyy2hEOLQCFB0DlQFTMLWggykrydY=" // readGoSum parses data, which is the content of file, // and adds it to goSum.m. The goSum lock must be held. -func readGoSum(file string, data []byte) { +func readGoSum(dst map[module.Version][]string, file string, data []byte) { lineno := 0 for len(data) > 0 { var line []byte @@ -227,7 +337,7 @@ func readGoSum(file string, data []byte) { continue } mod := module.Version{Path: f[0], Version: f[1]} - goSum.m[mod] = append(goSum.m[mod], f[2]) + dst[mod] = append(dst[mod], f[2]) } } @@ -241,7 +351,7 @@ func checkSum(mod module.Version) { // Do the file I/O before acquiring the go.sum lock. ziphash, err := CachePath(mod, "ziphash") if err != nil { - base.Fatalf("go: verifying %s@%s: %v", mod.Path, mod.Version, err) + base.Fatalf("verifying %s@%s: %v", mod.Path, mod.Version, err) } data, err := ioutil.ReadFile(ziphash) if err != nil { @@ -249,11 +359,11 @@ func checkSum(mod module.Version) { // This can happen if someone does rm -rf GOPATH/src/cache/download. So it goes. return } - base.Fatalf("go: verifying %s@%s: %v", mod.Path, mod.Version, err) + base.Fatalf("verifying %s@%s: %v", mod.Path, mod.Version, err) } h := strings.TrimSpace(string(data)) if !strings.HasPrefix(h, "h1:") { - base.Fatalf("go: verifying %s@%s: unexpected ziphash: %q", mod.Path, mod.Version, h) + base.Fatalf("verifying %s@%s: unexpected ziphash: %q", mod.Path, mod.Version, h) } checkOneSum(mod, h) @@ -271,7 +381,7 @@ func goModSum(data []byte) (string, error) { func checkGoMod(path, version string, data []byte) { h, err := goModSum(data) if err != nil { - base.Fatalf("go: verifying %s %s go.mod: %v", path, version, err) + base.Fatalf("verifying %s %s go.mod: %v", path, version, err) } checkOneSum(module.Version{Path: path, Version: version + "/go.mod"}, h) @@ -281,22 +391,27 @@ func checkGoMod(path, version string, data []byte) { func checkOneSum(mod module.Version, h string) { goSum.mu.Lock() defer goSum.mu.Unlock() - if !initGoSum() { - return + if initGoSum() { + checkOneSumLocked(mod, h) } +} + +func checkOneSumLocked(mod module.Version, h string) { + goSum.checked[modSum{mod, h}] = true for _, vh := range goSum.m[mod] { if h == vh { return } if strings.HasPrefix(vh, "h1:") { - base.Fatalf("go: verifying %s@%s: checksum mismatch\n\tdownloaded: %v\n\tgo.sum: %v", mod.Path, mod.Version, h, vh) + base.Fatalf("verifying %s@%s: checksum mismatch\n\tdownloaded: %v\n\tgo.sum: %v", mod.Path, mod.Version, h, vh) } } if len(goSum.m[mod]) > 0 { fmt.Fprintf(os.Stderr, "warning: verifying %s@%s: unknown hashes in go.sum: %v; adding %v", mod.Path, mod.Version, strings.Join(goSum.m[mod], ", "), h) } goSum.m[mod] = append(goSum.m[mod], h) + goSum.dirty = true } // Sum returns the checksum for the downloaded copy of the given module, @@ -322,10 +437,55 @@ func Sum(mod module.Version) string { func WriteGoSum() { goSum.mu.Lock() defer goSum.mu.Unlock() - if !initGoSum() { + + if !goSum.enabled { + // If we haven't read the go.sum file yet, don't bother writing it: at best, + // we could rename the go.modverify file if it isn't empty, but we haven't + // needed to touch it so far — how important could it be? + return + } + if !goSum.dirty { + // Don't bother opening the go.sum file if we don't have anything to add. return } + // We want to avoid races between creating the lockfile and deleting it, but + // we also don't want to leave a permanent lockfile in the user's repository. + // + // On top of that, if we crash while writing go.sum, we don't want to lose the + // sums that were already present in the file, so it's important that we write + // the file by renaming rather than truncating — which means that we can't + // lock the go.sum file itself. + // + // Instead, we'll lock a distinguished file in the cache directory: that will + // only race if the user runs `go clean -modcache` concurrently with a command + // that updates go.sum, and that's already racy to begin with. + // + // We'll end up slightly over-synchronizing go.sum writes if the user runs a + // bunch of go commands that update sums in separate modules simultaneously, + // but that's unlikely to matter in practice. + + unlock := SideLock() + defer unlock() + + if !goSum.overwrite { + // Re-read the go.sum file to incorporate any sums added by other processes + // in the meantime. + data, err := ioutil.ReadFile(GoSumFile) + if err != nil && !os.IsNotExist(err) { + base.Fatalf("go: re-reading go.sum: %v", err) + } + + // Add only the sums that we actually checked: the user may have edited or + // truncated the file to remove erroneous hashes, and we shouldn't restore + // them without good reason. + goSum.m = make(map[module.Version][]string, len(goSum.m)) + readGoSum(goSum.m, GoSumFile, data) + for ms := range goSum.checked { + checkOneSumLocked(ms.mod, ms.sum) + } + } + var mods []module.Version for m := range goSum.m { mods = append(mods, m) @@ -340,15 +500,16 @@ func WriteGoSum() { } } - data, _ := ioutil.ReadFile(GoSumFile) - if !bytes.Equal(data, buf.Bytes()) { - if err := ioutil.WriteFile(GoSumFile, buf.Bytes(), 0666); err != nil { - base.Fatalf("go: writing go.sum: %v", err) - } + if err := renameio.WriteFile(GoSumFile, buf.Bytes()); err != nil { + base.Fatalf("go: writing go.sum: %v", err) } + goSum.checked = make(map[modSum]bool) + goSum.dirty = false + goSum.overwrite = false + if goSum.modverify != "" { - os.Remove(goSum.modverify) + os.Remove(goSum.modverify) // best effort } } @@ -366,6 +527,8 @@ func TrimGoSum(keep map[module.Version]bool) { noGoMod := module.Version{Path: m.Path, Version: strings.TrimSuffix(m.Version, "/go.mod")} if !keep[m] && !keep[noGoMod] { delete(goSum.m, m) + goSum.dirty = true + goSum.overwrite = true } } } diff --git a/src/cmd/go/internal/modfetch/unzip.go b/src/cmd/go/internal/modfetch/unzip.go index a50431fd8629d..113d5b743bc98 100644 --- a/src/cmd/go/internal/modfetch/unzip.go +++ b/src/cmd/go/internal/modfetch/unzip.go @@ -21,12 +21,12 @@ import ( ) func Unzip(dir, zipfile, prefix string, maxSize int64) error { + // TODO(bcmills): The maxSize parameter is invariantly 0. Remove it. if maxSize == 0 { maxSize = codehost.MaxZipFile } // Directory can exist, but must be empty. - // except maybe files, _ := ioutil.ReadDir(dir) if len(files) > 0 { return fmt.Errorf("target directory %v exists and is not empty", dir) @@ -113,7 +113,7 @@ func Unzip(dir, zipfile, prefix string, maxSize int64) error { if err := os.MkdirAll(filepath.Dir(dst), 0777); err != nil { return err } - w, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0444) + w, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0444) if err != nil { return fmt.Errorf("unzip %v: %v", zipfile, err) } @@ -143,11 +143,27 @@ func Unzip(dir, zipfile, prefix string, maxSize int64) error { dirlist = append(dirlist, dir) } sort.Strings(dirlist) - // Run over list backward to chmod children before parents. for i := len(dirlist) - 1; i >= 0; i-- { + // TODO(bcmills): Does this end up stomping on the umask of the cache directory? os.Chmod(dirlist[i], 0555) } return nil } + +// RemoveAll removes a directory written by Download or Unzip, first applying +// any permission changes needed to do so. +func RemoveAll(dir string) error { + // Module cache has 0555 directories; make them writable in order to remove content. + filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return nil // ignore errors walking in file system + } + if info.IsDir() { + os.Chmod(path, 0777) + } + return nil + }) + return os.RemoveAll(dir) +} diff --git a/src/cmd/go/testdata/script/mod_concurrent.txt b/src/cmd/go/testdata/script/mod_concurrent.txt new file mode 100644 index 0000000000000..e03e5e5edbeda --- /dev/null +++ b/src/cmd/go/testdata/script/mod_concurrent.txt @@ -0,0 +1,31 @@ +env GO111MODULE=on + +# Concurrent builds should succeed, even if they need to download modules. +go build ./x & +go build ./y +wait + +# Concurrent builds should update go.sum to the union of the hashes for the +# modules they read. +cmp go.sum go.sum.want + +-- go.mod -- +module golang.org/issue/26794 + +require ( + golang.org/x/text v0.3.0 + rsc.io/sampler v1.0.0 +) +-- x/x.go -- +package x + +import _ "golang.org/x/text/language" +-- y/y.go -- +package y + +import _ "rsc.io/sampler" +-- go.sum.want -- +golang.org/x/text v0.3.0 h1:ivTorhoiROmZ1mcs15mO2czVF0uy0tnezXpBVNzgrmA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +rsc.io/sampler v1.0.0 h1:SRJnjyQ07sAtq6G4RcfJEmz8JxqLyj3PoGXG2VhbDWo= +rsc.io/sampler v1.0.0/go.mod h1:cqxpM3ZVz9VtirqxZPmrWzkQ+UkiNiGtkrN+B+i8kx8= From 143c1c82371d52a4f2cf72c56eaaac4c8766e234 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 23 Oct 2018 15:51:42 -0400 Subject: [PATCH 173/594] cmd/go/internal/{modcmd,modload}: lock edits to go.mod Use an arbitrary lockfile to serialize edits, and use atomic renames to actually write the go.mod file so that we never drop version requirements due to a command failing partway through a write. Multiple invocations of the 'go' command may read the go.mod file concurrently, and will see some consistent version even if some other invocation changes it concurrently. Multiple commands may attempt to write the go.mod file concurrently. One writer will succeed and write a consistent, complete go.mod file. The others will detect the changed contents and fail explicitly: it is not, in general, possible to resolve two conflicting changes to module requirements, so we surface the problem to the user rather than trying to solve the problem heuristically. Updates #26794 Change-Id: Ia1a06a01ef93fa9be664f560eb83bb86b0207443 Reviewed-on: https://go-review.googlesource.com/c/146380 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/modcmd/edit.go | 14 +++++-- src/cmd/go/internal/modload/init.go | 58 +++++++++++++++++++++++------ 2 files changed, 57 insertions(+), 15 deletions(-) diff --git a/src/cmd/go/internal/modcmd/edit.go b/src/cmd/go/internal/modcmd/edit.go index c589c6d4edff7..875bad78dcfc0 100644 --- a/src/cmd/go/internal/modcmd/edit.go +++ b/src/cmd/go/internal/modcmd/edit.go @@ -7,6 +7,7 @@ package modcmd import ( + "bytes" "encoding/json" "fmt" "io/ioutil" @@ -15,6 +16,7 @@ import ( "strings" "cmd/go/internal/base" + "cmd/go/internal/modfetch" "cmd/go/internal/modfile" "cmd/go/internal/modload" "cmd/go/internal/module" @@ -204,17 +206,23 @@ func runEdit(cmd *base.Command, args []string) { return } - data, err = modFile.Format() + out, err := modFile.Format() if err != nil { base.Fatalf("go: %v", err) } if *editPrint { - os.Stdout.Write(data) + os.Stdout.Write(out) return } - if err := ioutil.WriteFile(gomod, data, 0666); err != nil { + unlock := modfetch.SideLock() + defer unlock() + lockedData, err := ioutil.ReadFile(gomod) + if err == nil && !bytes.Equal(lockedData, data) { + base.Fatalf("go: go.mod changed during editing; not overwriting") + } + if err := ioutil.WriteFile(gomod, out, 0666); err != nil { base.Fatalf("go: %v", err) } } diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index 7e8c223189395..baefea88c54f8 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -16,6 +16,7 @@ import ( "cmd/go/internal/modfile" "cmd/go/internal/module" "cmd/go/internal/mvs" + "cmd/go/internal/renameio" "cmd/go/internal/search" "encoding/json" "fmt" @@ -34,10 +35,11 @@ var ( MustUseModules = mustUseModules() initialized bool - ModRoot string - modFile *modfile.File - excluded map[module.Version]bool - Target module.Version + ModRoot string + modFile *modfile.File + modFileData []byte + excluded map[module.Version]bool + Target module.Version gopath string @@ -285,6 +287,7 @@ func InitMod() { base.Fatalf("go: errors parsing go.mod:\n%s\n", err) } modFile = f + modFileData = data if len(f.Syntax.Stmt) == 0 || f.Module == nil { // Empty mod file. Must add module path. @@ -579,22 +582,53 @@ func WriteGoMod() { modFile.SetRequire(list) } - file := filepath.Join(ModRoot, "go.mod") - old, _ := ioutil.ReadFile(file) modFile.Cleanup() // clean file after edits new, err := modFile.Format() if err != nil { base.Fatalf("go: %v", err) } - if !bytes.Equal(old, new) { - if cfg.BuildMod == "readonly" { - base.Fatalf("go: updates to go.mod needed, disabled by -mod=readonly") + + // Always update go.sum, even if we didn't change go.mod: we may have + // downloaded modules that we didn't have before. + modfetch.WriteGoSum() + + if bytes.Equal(new, modFileData) { + // We don't need to modify go.mod from what we read previously. + // Ignore any intervening edits. + return + } + if cfg.BuildMod == "readonly" { + base.Fatalf("go: updates to go.mod needed, disabled by -mod=readonly") + } + + unlock := modfetch.SideLock() + defer unlock() + + file := filepath.Join(ModRoot, "go.mod") + old, err := ioutil.ReadFile(file) + if !bytes.Equal(old, modFileData) { + if bytes.Equal(old, new) { + // Some other process wrote the same go.mod file that we were about to write. + modFileData = new + return } - if err := ioutil.WriteFile(file, new, 0666); err != nil { - base.Fatalf("go: %v", err) + if err != nil { + base.Fatalf("go: can't determine whether go.mod has changed: %v", err) } + // The contents of the go.mod file have changed. In theory we could add all + // of the new modules to the build list, recompute, and check whether any + // module in *our* build list got bumped to a different version, but that's + // a lot of work for marginal benefit. Instead, fail the command: if users + // want to run concurrent commands, they need to start with a complete, + // consistent module definition. + base.Fatalf("go: updates to go.mod needed, but contents have changed") + } - modfetch.WriteGoSum() + + if err := renameio.WriteFile(file, new); err != nil { + base.Fatalf("error writing go.mod: %v", err) + } + modFileData = new } func fixVersion(path, vers string) (string, error) { From a2b4ac6cf29d31f1c927720712a25cda7bfbc682 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 25 Oct 2018 16:42:26 -0400 Subject: [PATCH 174/594] cmd/go/internal/modfetch/codehost: add lockfiles for repos The lockfile guards calls that may change the repo's filesystem contents. We don't know how robust VCS implementations are to running simultaneous commands, and this way we don't need to care: only one 'go' command at a time will modify any given repository. If we can guarantee that particular VCS implementations are robust enough across all of the VCS tool versions we support, we may be able to remove some of this locking to improve parallelism. Updates #26794 Change-Id: I578524974f5015629239cef43d3793aee2b9075c Reviewed-on: https://go-review.googlesource.com/c/146381 Run-TryBot: Bryan C. Mills Reviewed-by: Russ Cox --- .../go/internal/modfetch/codehost/codehost.go | 38 ++++++++--- src/cmd/go/internal/modfetch/codehost/git.go | 58 +++++++++++----- src/cmd/go/internal/modfetch/codehost/vcs.go | 66 +++++++++++++++++-- 3 files changed, 130 insertions(+), 32 deletions(-) diff --git a/src/cmd/go/internal/modfetch/codehost/codehost.go b/src/cmd/go/internal/modfetch/codehost/codehost.go index 4205cd26bda11..988504f4c87c5 100644 --- a/src/cmd/go/internal/modfetch/codehost/codehost.go +++ b/src/cmd/go/internal/modfetch/codehost/codehost.go @@ -20,6 +20,7 @@ import ( "time" "cmd/go/internal/cfg" + "cmd/go/internal/lockedfile" "cmd/go/internal/str" ) @@ -131,9 +132,9 @@ var WorkRoot string // WorkDir returns the name of the cached work directory to use for the // given repository type and name. -func WorkDir(typ, name string) (string, error) { +func WorkDir(typ, name string) (dir, lockfile string, err error) { if WorkRoot == "" { - return "", fmt.Errorf("codehost.WorkRoot not set") + return "", "", fmt.Errorf("codehost.WorkRoot not set") } // We name the work directory for the SHA256 hash of the type and name. @@ -142,22 +143,41 @@ func WorkDir(typ, name string) (string, error) { // that one checkout is never nested inside another. That nesting has // led to security problems in the past. if strings.Contains(typ, ":") { - return "", fmt.Errorf("codehost.WorkDir: type cannot contain colon") + return "", "", fmt.Errorf("codehost.WorkDir: type cannot contain colon") } key := typ + ":" + name - dir := filepath.Join(WorkRoot, fmt.Sprintf("%x", sha256.Sum256([]byte(key)))) + dir = filepath.Join(WorkRoot, fmt.Sprintf("%x", sha256.Sum256([]byte(key)))) + + if cfg.BuildX { + fmt.Fprintf(os.Stderr, "mkdir -p %s # %s %s\n", filepath.Dir(dir), typ, name) + } + if err := os.MkdirAll(filepath.Dir(dir), 0777); err != nil { + return "", "", err + } + + lockfile = dir + ".lock" + if cfg.BuildX { + fmt.Fprintf(os.Stderr, "# lock %s", lockfile) + } + + unlock, err := lockedfile.MutexAt(lockfile).Lock() + if err != nil { + return "", "", fmt.Errorf("codehost.WorkDir: can't find or create lock file: %v", err) + } + defer unlock() + data, err := ioutil.ReadFile(dir + ".info") info, err2 := os.Stat(dir) if err == nil && err2 == nil && info.IsDir() { // Info file and directory both already exist: reuse. have := strings.TrimSuffix(string(data), "\n") if have != key { - return "", fmt.Errorf("%s exists with wrong content (have %q want %q)", dir+".info", have, key) + return "", "", fmt.Errorf("%s exists with wrong content (have %q want %q)", dir+".info", have, key) } if cfg.BuildX { fmt.Fprintf(os.Stderr, "# %s for %s %s\n", dir, typ, name) } - return dir, nil + return dir, lockfile, nil } // Info file or directory missing. Start from scratch. @@ -166,13 +186,13 @@ func WorkDir(typ, name string) (string, error) { } os.RemoveAll(dir) if err := os.MkdirAll(dir, 0777); err != nil { - return "", err + return "", "", err } if err := ioutil.WriteFile(dir+".info", []byte(key), 0666); err != nil { os.RemoveAll(dir) - return "", err + return "", "", err } - return dir, nil + return dir, lockfile, nil } type RunError struct { diff --git a/src/cmd/go/internal/modfetch/codehost/git.go b/src/cmd/go/internal/modfetch/codehost/git.go index bcf8609826251..7b3775779badf 100644 --- a/src/cmd/go/internal/modfetch/codehost/git.go +++ b/src/cmd/go/internal/modfetch/codehost/git.go @@ -17,6 +17,7 @@ import ( "sync" "time" + "cmd/go/internal/lockedfile" "cmd/go/internal/par" ) @@ -57,22 +58,29 @@ func newGitRepo(remote string, localOK bool) (Repo, error) { r := &gitRepo{remote: remote} if strings.Contains(remote, "://") { // This is a remote path. - dir, err := WorkDir(gitWorkDirType, r.remote) + var err error + r.dir, r.mu.Path, err = WorkDir(gitWorkDirType, r.remote) if err != nil { return nil, err } - r.dir = dir - if _, err := os.Stat(filepath.Join(dir, "objects")); err != nil { - if _, err := Run(dir, "git", "init", "--bare"); err != nil { - os.RemoveAll(dir) + + unlock, err := r.mu.Lock() + if err != nil { + return nil, err + } + defer unlock() + + if _, err := os.Stat(filepath.Join(r.dir, "objects")); err != nil { + if _, err := Run(r.dir, "git", "init", "--bare"); err != nil { + os.RemoveAll(r.dir) return nil, err } // We could just say git fetch https://whatever later, // but this lets us say git fetch origin instead, which // is a little nicer. More importantly, using a named remote // avoids a problem with Git LFS. See golang.org/issue/25605. - if _, err := Run(dir, "git", "remote", "add", "origin", r.remote); err != nil { - os.RemoveAll(dir) + if _, err := Run(r.dir, "git", "remote", "add", "origin", r.remote); err != nil { + os.RemoveAll(r.dir) return nil, err } r.remote = "origin" @@ -97,6 +105,7 @@ func newGitRepo(remote string, localOK bool) (Repo, error) { return nil, fmt.Errorf("%s exists but is not a directory", remote) } r.dir = remote + r.mu.Path = r.dir + ".lock" } return r, nil } @@ -106,7 +115,8 @@ type gitRepo struct { local bool dir string - mu sync.Mutex // protects fetchLevel, some git repo state + mu lockedfile.Mutex // protects fetchLevel and git repo state + fetchLevel int statCache par.Cache @@ -304,11 +314,11 @@ func (r *gitRepo) stat(rev string) (*RevInfo, error) { } // Protect r.fetchLevel and the "fetch more and more" sequence. - // TODO(rsc): Add LockDir and use it for protecting that - // sequence, so that multiple processes don't collide in their - // git commands. - r.mu.Lock() - defer r.mu.Unlock() + unlock, err := r.mu.Lock() + if err != nil { + return nil, err + } + defer unlock() // Perhaps r.localTags did not have the ref when we loaded local tags, // but we've since done fetches that pulled down the hash we need @@ -495,8 +505,11 @@ func (r *gitRepo) ReadFileRevs(revs []string, file string, maxSize int64) (map[s // Protect r.fetchLevel and the "fetch more and more" sequence. // See stat method above. - r.mu.Lock() - defer r.mu.Unlock() + unlock, err := r.mu.Lock() + if err != nil { + return nil, err + } + defer unlock() var refs []string var protoFlag []string @@ -658,8 +671,11 @@ func (r *gitRepo) RecentTag(rev, prefix string) (tag string, err error) { // There are plausible tags, but we don't know if rev is a descendent of any of them. // Fetch the history to find out. - r.mu.Lock() - defer r.mu.Unlock() + unlock, err := r.mu.Lock() + if err != nil { + return "", err + } + defer unlock() if r.fetchLevel < fetchAll { // Fetch all heads and tags and see if that gives us enough history. @@ -678,7 +694,7 @@ func (r *gitRepo) RecentTag(rev, prefix string) (tag string, err error) { // unreachable for a reason). // // Try one last time in case some other goroutine fetched rev while we were - // waiting on r.mu. + // waiting on the lock. describe() return tag, err } @@ -694,6 +710,12 @@ func (r *gitRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, return nil, "", err } + unlock, err := r.mu.Lock() + if err != nil { + return nil, "", err + } + defer unlock() + if err := ensureGitAttributes(r.dir); err != nil { return nil, "", err } diff --git a/src/cmd/go/internal/modfetch/codehost/vcs.go b/src/cmd/go/internal/modfetch/codehost/vcs.go index 9e862a0ef8c0d..190f47cf8d1f0 100644 --- a/src/cmd/go/internal/modfetch/codehost/vcs.go +++ b/src/cmd/go/internal/modfetch/codehost/vcs.go @@ -18,6 +18,7 @@ import ( "sync" "time" + "cmd/go/internal/lockedfile" "cmd/go/internal/par" "cmd/go/internal/str" ) @@ -56,6 +57,8 @@ func NewRepo(vcs, remote string) (Repo, error) { var vcsRepoCache par.Cache type vcsRepo struct { + mu lockedfile.Mutex // protects all commands, so we don't have to decide which are safe on a per-VCS basis + remote string cmd *vcsCmd dir string @@ -81,18 +84,27 @@ func newVCSRepo(vcs, remote string) (Repo, error) { if !strings.Contains(remote, "://") { return nil, fmt.Errorf("invalid vcs remote: %s %s", vcs, remote) } + r := &vcsRepo{remote: remote, cmd: cmd} + var err error + r.dir, r.mu.Path, err = WorkDir(vcsWorkDirType+vcs, r.remote) + if err != nil { + return nil, err + } + if cmd.init == nil { return r, nil } - dir, err := WorkDir(vcsWorkDirType+vcs, r.remote) + + unlock, err := r.mu.Lock() if err != nil { return nil, err } - r.dir = dir - if _, err := os.Stat(filepath.Join(dir, "."+vcs)); err != nil { - if _, err := Run(dir, cmd.init(r.remote)); err != nil { - os.RemoveAll(dir) + defer unlock() + + if _, err := os.Stat(filepath.Join(r.dir, "."+vcs)); err != nil { + if _, err := Run(r.dir, cmd.init(r.remote)); err != nil { + os.RemoveAll(r.dir) return nil, err } } @@ -270,6 +282,12 @@ func (r *vcsRepo) loadBranches() { } func (r *vcsRepo) Tags(prefix string) ([]string, error) { + unlock, err := r.mu.Lock() + if err != nil { + return nil, err + } + defer unlock() + r.tagsOnce.Do(r.loadTags) tags := []string{} @@ -283,6 +301,12 @@ func (r *vcsRepo) Tags(prefix string) ([]string, error) { } func (r *vcsRepo) Stat(rev string) (*RevInfo, error) { + unlock, err := r.mu.Lock() + if err != nil { + return nil, err + } + defer unlock() + if rev == "latest" { rev = r.cmd.latest } @@ -332,6 +356,14 @@ func (r *vcsRepo) ReadFile(rev, file string, maxSize int64) ([]byte, error) { if err != nil { return nil, err } + + // r.Stat acquires r.mu, so lock after that. + unlock, err := r.mu.Lock() + if err != nil { + return nil, err + } + defer unlock() + out, err := Run(r.dir, r.cmd.readFile(rev, file, r.remote)) if err != nil { return nil, os.ErrNotExist @@ -340,14 +372,38 @@ func (r *vcsRepo) ReadFile(rev, file string, maxSize int64) ([]byte, error) { } func (r *vcsRepo) ReadFileRevs(revs []string, file string, maxSize int64) (map[string]*FileRev, error) { + // We don't technically need to lock here since we're returning an error + // uncondititonally, but doing so anyway will help to avoid baking in + // lock-inversion bugs. + unlock, err := r.mu.Lock() + if err != nil { + return nil, err + } + defer unlock() + return nil, fmt.Errorf("ReadFileRevs not implemented") } func (r *vcsRepo) RecentTag(rev, prefix string) (tag string, err error) { + // We don't technically need to lock here since we're returning an error + // uncondititonally, but doing so anyway will help to avoid baking in + // lock-inversion bugs. + unlock, err := r.mu.Lock() + if err != nil { + return "", err + } + defer unlock() + return "", fmt.Errorf("RecentTags not implemented") } func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, actualSubdir string, err error) { + unlock, err := r.mu.Lock() + if err != nil { + return nil, "", err + } + defer unlock() + if rev == "latest" { rev = r.cmd.latest } From cdbd4d49d8b3595048ae63ac0f3891633470dfbe Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 8 Nov 2018 10:29:40 -0500 Subject: [PATCH 175/594] cmd/go: enable module mode without a main module when GO111MODULE=on This is as minimal a change as I could comfortably make to enable 'go get' outside of a module for 1.12. In general, commands invoked in module mode while outside of a module operate as though they are in a module with an initially-empty go.mod file. ('go env GOMOD' reports os.DevNull.) Commands that operate on the current directory (such as 'go list' and 'go get -u' without arguments) fail: without a module definition, we don't know the package path. Likewise, commands whose sole purpose is to write files within the main module (such as 'go mod edit' and 'go mod vendor') fail, since we don't know where to write their output. Since the go.sum file for the main module is authoritative, we do not check go.sum files when operating outside of a module. I plan to revisit that when the tree opens for 1.13. We may also want to revisit the behavior of 'go list': it would be useful to be able to query individual packages (and dependencies of those packages) within versioned modules, but today we only allow versioned paths in conjunction with the '-m' flag. Fixes #24250 RELNOTE=yes Change-Id: I028c323ddea27693a92ad0aa4a6a55d5e3f43f2c Reviewed-on: https://go-review.googlesource.com/c/148517 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/clean/clean.go | 5 +- src/cmd/go/internal/envcmd/env.go | 6 +- src/cmd/go/internal/load/pkg.go | 4 +- src/cmd/go/internal/modcmd/edit.go | 3 +- src/cmd/go/internal/modcmd/vendor.go | 2 +- src/cmd/go/internal/modget/get.go | 4 +- src/cmd/go/internal/modload/build.go | 8 +- src/cmd/go/internal/modload/import.go | 4 +- src/cmd/go/internal/modload/init.go | 191 ++++++++++------ src/cmd/go/internal/modload/list.go | 18 +- src/cmd/go/internal/modload/load.go | 29 ++- src/cmd/go/internal/modload/query.go | 16 +- src/cmd/go/internal/modload/search.go | 5 +- src/cmd/go/internal/modload/testgo.go | 9 + .../mod/example.com_printversion_v0.1.0.txt | 27 +++ .../mod/example.com_printversion_v1.0.0.txt | 35 +++ .../mod/example.com_version_v1.0.0.txt | 11 + .../mod/example.com_version_v1.0.1.txt | 11 + .../mod/example.com_version_v1.1.0.txt | 11 + src/cmd/go/testdata/script/mod_enabled.txt | 2 +- src/cmd/go/testdata/script/mod_nomod.txt | 2 +- src/cmd/go/testdata/script/mod_outside.txt | 214 ++++++++++++++++++ 22 files changed, 511 insertions(+), 106 deletions(-) create mode 100644 src/cmd/go/internal/modload/testgo.go create mode 100644 src/cmd/go/testdata/mod/example.com_printversion_v0.1.0.txt create mode 100644 src/cmd/go/testdata/mod/example.com_printversion_v1.0.0.txt create mode 100644 src/cmd/go/testdata/mod/example.com_version_v1.0.0.txt create mode 100644 src/cmd/go/testdata/mod/example.com_version_v1.0.1.txt create mode 100644 src/cmd/go/testdata/mod/example.com_version_v1.1.0.txt create mode 100644 src/cmd/go/testdata/script/mod_outside.txt diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go index 96fd653b745e3..32cc80736df4b 100644 --- a/src/cmd/go/internal/clean/clean.go +++ b/src/cmd/go/internal/clean/clean.go @@ -105,10 +105,7 @@ func init() { } func runClean(cmd *base.Command, args []string) { - if len(args) == 0 && modload.Failed() { - // Don't try to clean current directory, - // which will cause modload to base.Fatalf. - } else { + if len(args) > 0 || !modload.Enabled() || modload.HasModRoot() { for _, pkg := range load.PackagesAndErrors(args) { clean(pkg) } diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go index 85a42e0519ad6..ae98d3999a1fa 100644 --- a/src/cmd/go/internal/envcmd/env.go +++ b/src/cmd/go/internal/envcmd/env.go @@ -115,8 +115,10 @@ func findEnv(env []cfg.EnvVar, name string) string { // ExtraEnvVars returns environment variables that should not leak into child processes. func ExtraEnvVars() []cfg.EnvVar { gomod := "" - if modload.Init(); modload.ModRoot != "" { - gomod = filepath.Join(modload.ModRoot, "go.mod") + if modload.HasModRoot() { + gomod = filepath.Join(modload.ModRoot(), "go.mod") + } else if modload.Enabled() { + gomod = os.DevNull } return []cfg.EnvVar{ {Name: "GOMOD", Value: gomod}, diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index a64bab1479cbb..72a3d70607441 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -1515,7 +1515,9 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) { } if cfg.ModulesEnabled { - p.Module = ModPackageModuleInfo(p.ImportPath) + if !p.Internal.CmdlineFiles { + p.Module = ModPackageModuleInfo(p.ImportPath) + } if p.Name == "main" { p.Internal.BuildInfo = ModPackageBuildInfo(p.ImportPath, p.Deps) } diff --git a/src/cmd/go/internal/modcmd/edit.go b/src/cmd/go/internal/modcmd/edit.go index 875bad78dcfc0..f13fe249937de 100644 --- a/src/cmd/go/internal/modcmd/edit.go +++ b/src/cmd/go/internal/modcmd/edit.go @@ -157,8 +157,7 @@ func runEdit(cmd *base.Command, args []string) { if len(args) == 1 { gomod = args[0] } else { - modload.MustInit() - gomod = filepath.Join(modload.ModRoot, "go.mod") + gomod = filepath.Join(modload.ModRoot(), "go.mod") } if *editModule != "" { diff --git a/src/cmd/go/internal/modcmd/vendor.go b/src/cmd/go/internal/modcmd/vendor.go index 7bd1d0b5718b8..b70f25cec3952 100644 --- a/src/cmd/go/internal/modcmd/vendor.go +++ b/src/cmd/go/internal/modcmd/vendor.go @@ -43,7 +43,7 @@ func runVendor(cmd *base.Command, args []string) { } pkgs := modload.LoadVendor() - vdir := filepath.Join(modload.ModRoot, "vendor") + vdir := filepath.Join(modload.ModRoot(), "vendor") if err := os.RemoveAll(vdir); err != nil { base.Fatalf("go mod vendor: %v", err) } diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go index c2e134c2d695d..2bfe6d3bb23fe 100644 --- a/src/cmd/go/internal/modget/get.go +++ b/src/cmd/go/internal/modget/get.go @@ -281,8 +281,8 @@ func runGet(cmd *base.Command, args []string) { base.Errorf("go get %s: %v", arg, err) continue } - if !str.HasFilePathPrefix(abs, modload.ModRoot) { - base.Errorf("go get %s: directory %s is outside module root %s", arg, abs, modload.ModRoot) + if !str.HasFilePathPrefix(abs, modload.ModRoot()) { + base.Errorf("go get %s: directory %s is outside module root %s", arg, abs, modload.ModRoot()) continue } // TODO: Check if abs is inside a nested module. diff --git a/src/cmd/go/internal/modload/build.go b/src/cmd/go/internal/modload/build.go index 76068069087f7..b4856a94199c0 100644 --- a/src/cmd/go/internal/modload/build.go +++ b/src/cmd/go/internal/modload/build.go @@ -98,8 +98,8 @@ func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic { Path: m.Path, Version: m.Version, Main: true, - Dir: ModRoot, - GoMod: filepath.Join(ModRoot, "go.mod"), + Dir: ModRoot(), + GoMod: filepath.Join(ModRoot(), "go.mod"), } if modFile.Go != nil { info.GoVersion = modFile.Go.Version @@ -117,7 +117,7 @@ func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic { } if cfg.BuildMod == "vendor" { - info.Dir = filepath.Join(ModRoot, "vendor", m.Path) + info.Dir = filepath.Join(ModRoot(), "vendor", m.Path) return info } @@ -171,7 +171,7 @@ func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic { if filepath.IsAbs(r.Path) { info.Replace.Dir = r.Path } else { - info.Replace.Dir = filepath.Join(ModRoot, r.Path) + info.Replace.Dir = filepath.Join(ModRoot(), r.Path) } } complete(info.Replace) diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go index ba2052d3cdd59..96e546d6df01c 100644 --- a/src/cmd/go/internal/modload/import.go +++ b/src/cmd/go/internal/modload/import.go @@ -67,8 +67,8 @@ func Import(path string) (m module.Version, dir string, err error) { // -mod=vendor is special. // Everything must be in the main module or the main module's vendor directory. if cfg.BuildMod == "vendor" { - mainDir, mainOK := dirInModule(path, Target.Path, ModRoot, true) - vendorDir, vendorOK := dirInModule(path, "", filepath.Join(ModRoot, "vendor"), false) + mainDir, mainOK := dirInModule(path, Target.Path, ModRoot(), true) + vendorDir, vendorOK := dirInModule(path, "", filepath.Join(ModRoot(), "vendor"), false) if mainOK && vendorOK { return module.Version{}, "", fmt.Errorf("ambiguous import: found %s in multiple directories:\n\t%s\n\t%s", path, mainDir, vendorDir) } diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index baefea88c54f8..97c48be00e126 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -26,16 +26,17 @@ import ( "path" "path/filepath" "regexp" + "runtime/debug" "strconv" "strings" ) var ( - cwd string + cwd string // TODO(bcmills): Is this redundant with base.Cwd? MustUseModules = mustUseModules() initialized bool - ModRoot string + modRoot string modFile *modfile.File modFileData []byte excluded map[module.Version]bool @@ -56,11 +57,15 @@ var ( // To make permanent changes to the require statements // in go.mod, edit it before calling ImportPaths or LoadBuildList. func ModFile() *modfile.File { + Init() + if modFile == nil { + die() + } return modFile } func BinDir() string { - MustInit() + Init() return filepath.Join(gopath, "bin") } @@ -76,6 +81,10 @@ func mustUseModules() bool { var inGOPATH bool // running in GOPATH/src +// Init determines whether module mode is enabled, locates the root of the +// current module (if any), sets environment variables for Git subprocesses, and +// configures the cfg, codehost, load, modfetch, and search packages for use +// with modules. func Init() { if initialized { return @@ -141,6 +150,9 @@ func Init() { } if inGOPATH && !MustUseModules { + if CmdModInit { + die() // Don't init a module that we're just going to ignore. + } // No automatic enabling in GOPATH. if root, _ := FindModuleRoot(cwd, "", false); root != "" { cfg.GoModInGOPATH = filepath.Join(root, "go.mod") @@ -150,26 +162,54 @@ func Init() { if CmdModInit { // Running 'go mod init': go.mod will be created in current directory. - ModRoot = cwd + modRoot = cwd } else { - ModRoot, _ = FindModuleRoot(cwd, "", MustUseModules) - if !MustUseModules { - if ModRoot == "" { - return - } - if search.InDir(ModRoot, os.TempDir()) == "." { - // If you create /tmp/go.mod for experimenting, - // then any tests that create work directories under /tmp - // will find it and get modules when they're not expecting them. - // It's a bit of a peculiar thing to disallow but quite mysterious - // when it happens. See golang.org/issue/26708. - ModRoot = "" - fmt.Fprintf(os.Stderr, "go: warning: ignoring go.mod in system temp root %v\n", os.TempDir()) + modRoot, _ = FindModuleRoot(cwd, "", MustUseModules) + if modRoot == "" { + if !MustUseModules { + // GO111MODULE is 'auto' (or unset), and we can't find a module root. + // Stay in GOPATH mode. return } + } else if search.InDir(modRoot, os.TempDir()) == "." { + // If you create /tmp/go.mod for experimenting, + // then any tests that create work directories under /tmp + // will find it and get modules when they're not expecting them. + // It's a bit of a peculiar thing to disallow but quite mysterious + // when it happens. See golang.org/issue/26708. + modRoot = "" + fmt.Fprintf(os.Stderr, "go: warning: ignoring go.mod in system temp root %v\n", os.TempDir()) } } + // We're in module mode. Install the hooks to make it work. + + if c := cache.Default(); c == nil { + // With modules, there are no install locations for packages + // other than the build cache. + base.Fatalf("go: cannot use modules with build cache disabled") + } + + list := filepath.SplitList(cfg.BuildContext.GOPATH) + if len(list) == 0 || list[0] == "" { + base.Fatalf("missing $GOPATH") + } + gopath = list[0] + if _, err := os.Stat(filepath.Join(gopath, "go.mod")); err == nil { + base.Fatalf("$GOPATH/go.mod exists but should not") + } + + oldSrcMod := filepath.Join(list[0], "src/mod") + pkgMod := filepath.Join(list[0], "pkg/mod") + infoOld, errOld := os.Stat(oldSrcMod) + _, errMod := os.Stat(pkgMod) + if errOld == nil && infoOld.IsDir() && errMod != nil && os.IsNotExist(errMod) { + os.Rename(oldSrcMod, pkgMod) + } + + modfetch.PkgMod = pkgMod + codehost.WorkRoot = filepath.Join(pkgMod, "cache/vcs") + cfg.ModulesEnabled = true load.ModBinDir = BinDir load.ModLookup = Lookup @@ -180,7 +220,35 @@ func Init() { load.ModImportFromFiles = ImportFromFiles load.ModDirImportPath = DirImportPath - search.SetModRoot(ModRoot) + if modRoot == "" { + // We're in module mode, but not inside a module. + // + // If the command is 'go get' or 'go list' and all of the args are in the + // same existing module, we could use that module's download directory in + // the module cache as the module root, applying any replacements and/or + // exclusions specified by that module. However, that would leave us in a + // strange state: we want 'go get' to be consistent with 'go list', and 'go + // list' should be able to operate on multiple modules. Moreover, the 'get' + // target might specify relative file paths (e.g. in the same repository) as + // replacements, and we would not be able to apply those anyway: we would + // need to either error out or ignore just those replacements, when a build + // from an empty module could proceed without error. + // + // Instead, we'll operate as though we're in some ephemeral external module, + // ignoring all replacements and exclusions uniformly. + + // Normally we check sums using the go.sum file from the main module, but + // without a main module we do not have an authoritative go.sum file. + // + // TODO(bcmills): In Go 1.13, check sums when outside the main module. + // + // One possible approach is to merge the go.sum files from all of the + // modules we download: that doesn't protect us against bad top-level + // modules, but it at least ensures consistency for transitive dependencies. + } else { + modfetch.GoSumFile = filepath.Join(modRoot, "go.sum") + search.SetModRoot(modRoot) + } } func init() { @@ -193,38 +261,41 @@ func init() { } // Enabled reports whether modules are (or must be) enabled. -// If modules must be enabled but are not, Enabled returns true +// If modules are enabled but there is no main module, Enabled returns true // and then the first use of module information will call die -// (usually through InitMod and MustInit). +// (usually through MustModRoot). func Enabled() bool { - if !initialized { - panic("go: Enabled called before Init") - } - return ModRoot != "" || MustUseModules + Init() + return modRoot != "" || MustUseModules } -// MustInit calls Init if needed and checks that -// modules are enabled and the main module has been found. -// If not, MustInit calls base.Fatalf with an appropriate message. -func MustInit() { - if Init(); ModRoot == "" { +// ModRoot returns the root of the main module. +// It calls base.Fatalf if there is no main module. +func ModRoot() string { + if !HasModRoot() { die() } - if c := cache.Default(); c == nil { - // With modules, there are no install locations for packages - // other than the build cache. - base.Fatalf("go: cannot use modules with build cache disabled") - } + return modRoot } -// Failed reports whether module loading failed. -// If Failed returns true, then any use of module information will call die. -func Failed() bool { +// HasModRoot reports whether a main module is present. +// HasModRoot may return false even if Enabled returns true: for example, 'get' +// does not require a main module. +func HasModRoot() bool { Init() - return cfg.ModulesEnabled && ModRoot == "" + return modRoot != "" } +// printStackInDie causes die to print a stack trace. +// +// It is enabled by the testgo tag, and helps to diagnose paths that +// unexpectedly require a main module. +var printStackInDie = false + func die() { + if printStackInDie { + debug.PrintStack() + } if os.Getenv("GO111MODULE") == "off" { base.Fatalf("go: modules disabled by GO111MODULE=off; see 'go help modules'") } @@ -234,33 +305,20 @@ func die() { base.Fatalf("go: cannot find main module; see 'go help modules'") } +// InitMod sets Target and, if there is a main module, parses the initial build +// list from its go.mod file, creating and populating that file if needed. func InitMod() { - MustInit() - if modFile != nil { + if len(buildList) > 0 { return } - list := filepath.SplitList(cfg.BuildContext.GOPATH) - if len(list) == 0 || list[0] == "" { - base.Fatalf("missing $GOPATH") - } - gopath = list[0] - if _, err := os.Stat(filepath.Join(gopath, "go.mod")); err == nil { - base.Fatalf("$GOPATH/go.mod exists but should not") - } - - oldSrcMod := filepath.Join(list[0], "src/mod") - pkgMod := filepath.Join(list[0], "pkg/mod") - infoOld, errOld := os.Stat(oldSrcMod) - _, errMod := os.Stat(pkgMod) - if errOld == nil && infoOld.IsDir() && errMod != nil && os.IsNotExist(errMod) { - os.Rename(oldSrcMod, pkgMod) + Init() + if modRoot == "" { + Target = module.Version{Path: "main"} + buildList = []module.Version{Target} + return } - modfetch.PkgMod = pkgMod - modfetch.GoSumFile = filepath.Join(ModRoot, "go.sum") - codehost.WorkRoot = filepath.Join(pkgMod, "cache/vcs") - if CmdModInit { // Running go mod init: do legacy module conversion legacyModInit() @@ -269,7 +327,7 @@ func InitMod() { return } - gomod := filepath.Join(ModRoot, "go.mod") + gomod := filepath.Join(modRoot, "go.mod") data, err := ioutil.ReadFile(gomod) if err != nil { if os.IsNotExist(err) { @@ -291,7 +349,7 @@ func InitMod() { if len(f.Syntax.Stmt) == 0 || f.Module == nil { // Empty mod file. Must add module path. - path, err := FindModulePath(ModRoot) + path, err := FindModulePath(modRoot) if err != nil { base.Fatalf("go: %v", err) } @@ -329,7 +387,7 @@ func Allowed(m module.Version) bool { func legacyModInit() { if modFile == nil { - path, err := FindModulePath(ModRoot) + path, err := FindModulePath(modRoot) if err != nil { base.Fatalf("go: %v", err) } @@ -341,7 +399,7 @@ func legacyModInit() { addGoStmt() for _, name := range altConfigs { - cfg := filepath.Join(ModRoot, name) + cfg := filepath.Join(modRoot, name) data, err := ioutil.ReadFile(cfg) if err == nil { convert := modconv.Converters[name] @@ -566,6 +624,11 @@ func WriteGoMod() { return } + // If we aren't in a module, we don't have anywhere to write a go.mod file. + if modRoot == "" { + return + } + if loaded != nil { reqs := MinReqs() min, err := reqs.Required(Target) @@ -604,7 +667,7 @@ func WriteGoMod() { unlock := modfetch.SideLock() defer unlock() - file := filepath.Join(ModRoot, "go.mod") + file := filepath.Join(modRoot, "go.mod") old, err := ioutil.ReadFile(file) if !bytes.Equal(old, modFileData) { if bytes.Equal(old, new) { diff --git a/src/cmd/go/internal/modload/list.go b/src/cmd/go/internal/modload/list.go index 69a832de1df52..2f1a3c24d223c 100644 --- a/src/cmd/go/internal/modload/list.go +++ b/src/cmd/go/internal/modload/list.go @@ -17,7 +17,7 @@ import ( ) func ListModules(args []string, listU, listVersions bool) []*modinfo.ModulePublic { - mods := listModules(args) + mods := listModules(args, listVersions) if listU || listVersions { var work par.Work for _, m := range mods { @@ -39,7 +39,7 @@ func ListModules(args []string, listU, listVersions bool) []*modinfo.ModulePubli return mods } -func listModules(args []string) []*modinfo.ModulePublic { +func listModules(args []string, listVersions bool) []*modinfo.ModulePublic { LoadBuildList() if len(args) == 0 { return []*modinfo.ModulePublic{moduleInfo(buildList[0], true)} @@ -83,6 +83,10 @@ func listModules(args []string) []*modinfo.ModulePublic { } matched := false for i, m := range buildList { + if i == 0 && !HasModRoot() { + // The root module doesn't actually exist: omit it. + continue + } if match(m.Path) { matched = true if !matchedBuildList[i] { @@ -93,6 +97,16 @@ func listModules(args []string) []*modinfo.ModulePublic { } if !matched { if literal { + if listVersions { + // Don't make the user provide an explicit '@latest' when they're + // explicitly asking what the available versions are. + // Instead, resolve the module, even if it isn't an existing dependency. + info, err := Query(arg, "latest", nil) + if err == nil { + mods = append(mods, moduleInfo(module.Version{Path: arg, Version: info.Version}, false)) + continue + } + } mods = append(mods, &modinfo.ModulePublic{ Path: arg, Error: &modinfo.ModuleError{ diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go index 3b8c0b6435f56..dd1a370825e73 100644 --- a/src/cmd/go/internal/modload/load.go +++ b/src/cmd/go/internal/modload/load.go @@ -101,10 +101,10 @@ func ImportPaths(patterns []string) []*search.Match { // Note: The checks for @ here are just to avoid misinterpreting // the module cache directories (formerly GOPATH/src/mod/foo@v1.5.2/bar). // It's not strictly necessary but helpful to keep the checks. - if dir == ModRoot { + if modRoot != "" && dir == modRoot { pkg = Target.Path - } else if strings.HasPrefix(dir, ModRoot+string(filepath.Separator)) && !strings.Contains(dir[len(ModRoot):], "@") { - suffix := filepath.ToSlash(dir[len(ModRoot):]) + } else if modRoot != "" && strings.HasPrefix(dir, modRoot+string(filepath.Separator)) && !strings.Contains(dir[len(modRoot):], "@") { + suffix := filepath.ToSlash(dir[len(modRoot):]) if strings.HasPrefix(suffix, "/vendor/") { // TODO getmode vendor check pkg = strings.TrimPrefix(suffix, "/vendor/") @@ -118,6 +118,7 @@ func ImportPaths(patterns []string) []*search.Match { } else { pkg = "" if !iterating { + ModRoot() base.Errorf("go: directory %s outside available modules", base.ShortPath(dir)) } } @@ -251,17 +252,21 @@ func ImportFromFiles(gofiles []string) { // DirImportPath returns the effective import path for dir, // provided it is within the main module, or else returns ".". func DirImportPath(dir string) string { + if modRoot == "" { + return "." + } + if !filepath.IsAbs(dir) { dir = filepath.Join(cwd, dir) } else { dir = filepath.Clean(dir) } - if dir == ModRoot { + if dir == modRoot { return Target.Path } - if strings.HasPrefix(dir, ModRoot+string(filepath.Separator)) { - suffix := filepath.ToSlash(dir[len(ModRoot):]) + if strings.HasPrefix(dir, modRoot+string(filepath.Separator)) { + suffix := filepath.ToSlash(dir[len(modRoot):]) if strings.HasPrefix(suffix, "/vendor/") { return strings.TrimPrefix(suffix, "/vendor/") } @@ -810,7 +815,7 @@ func WhyDepth(path string) int { // a module.Version with Path == "". func Replacement(mod module.Version) module.Version { if modFile == nil { - // Happens during testing. + // Happens during testing and if invoking 'go get' or 'go list' outside a module. return module.Version{} } @@ -887,7 +892,7 @@ func readVendorList() { vendorOnce.Do(func() { vendorList = nil vendorMap = make(map[string]module.Version) - data, _ := ioutil.ReadFile(filepath.Join(ModRoot, "vendor/modules.txt")) + data, _ := ioutil.ReadFile(filepath.Join(ModRoot(), "vendor/modules.txt")) var m module.Version for _, line := range strings.Split(string(data), "\n") { if strings.HasPrefix(line, "# ") { @@ -917,7 +922,7 @@ func (r *mvsReqs) modFileToList(f *modfile.File) []module.Version { func (r *mvsReqs) required(mod module.Version) ([]module.Version, error) { if mod == Target { - if modFile.Go != nil { + if modFile != nil && modFile.Go != nil { r.versions.LoadOrStore(mod, modFile.Go.Version) } var list []module.Version @@ -937,7 +942,7 @@ func (r *mvsReqs) required(mod module.Version) ([]module.Version, error) { // TODO: need to slip the new version into the tags list etc. dir := repl.Path if !filepath.IsAbs(dir) { - dir = filepath.Join(ModRoot, dir) + dir = filepath.Join(ModRoot(), dir) } gomod := filepath.Join(dir, "go.mod") data, err := ioutil.ReadFile(gomod) @@ -1052,13 +1057,13 @@ func (*mvsReqs) next(m module.Version) (module.Version, error) { func fetch(mod module.Version) (dir string, isLocal bool, err error) { if mod == Target { - return ModRoot, true, nil + return ModRoot(), true, nil } if r := Replacement(mod); r.Path != "" { if r.Version == "" { dir = r.Path if !filepath.IsAbs(dir) { - dir = filepath.Join(ModRoot, dir) + dir = filepath.Join(ModRoot(), dir) } return dir, true, nil } diff --git a/src/cmd/go/internal/modload/query.go b/src/cmd/go/internal/modload/query.go index 40713413131ae..0856486c212c2 100644 --- a/src/cmd/go/internal/modload/query.go +++ b/src/cmd/go/internal/modload/query.go @@ -210,14 +210,16 @@ func matchSemverPrefix(p, v string) bool { // If the path is in the main module and the query is "latest", // QueryPackage returns Target as the version. func QueryPackage(path, query string, allowed func(module.Version) bool) (module.Version, *modfetch.RevInfo, error) { - if _, ok := dirInModule(path, Target.Path, ModRoot, true); ok { - if query != "latest" { - return module.Version{}, nil, fmt.Errorf("can't query specific version (%q) for package %s in the main module (%s)", query, path, Target.Path) - } - if !allowed(Target) { - return module.Version{}, nil, fmt.Errorf("internal error: package %s is in the main module (%s), but version is not allowed", path, Target.Path) + if HasModRoot() { + if _, ok := dirInModule(path, Target.Path, modRoot, true); ok { + if query != "latest" { + return module.Version{}, nil, fmt.Errorf("can't query specific version (%q) for package %s in the main module (%s)", query, path, Target.Path) + } + if !allowed(Target) { + return module.Version{}, nil, fmt.Errorf("internal error: package %s is in the main module (%s), but version is not allowed", path, Target.Path) + } + return Target, &modfetch.RevInfo{Version: Target.Version}, nil } - return Target, &modfetch.RevInfo{Version: Target.Version}, nil } finalErr := errMissing diff --git a/src/cmd/go/internal/modload/search.go b/src/cmd/go/internal/modload/search.go index 24825cc35d8a3..7d8852d01d7f7 100644 --- a/src/cmd/go/internal/modload/search.go +++ b/src/cmd/go/internal/modload/search.go @@ -118,7 +118,10 @@ func matchPackages(pattern string, tags map[string]bool, useStd bool, modules [] } var root string if mod.Version == "" { - root = ModRoot + if !HasModRoot() { + continue // If there is no main module, we can't search in it. + } + root = ModRoot() } else { var err error root, _, err = fetch(mod) diff --git a/src/cmd/go/internal/modload/testgo.go b/src/cmd/go/internal/modload/testgo.go new file mode 100644 index 0000000000000..6cfba0c68fcf2 --- /dev/null +++ b/src/cmd/go/internal/modload/testgo.go @@ -0,0 +1,9 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package modload + +func init() { + printStackInDie = true +} diff --git a/src/cmd/go/testdata/mod/example.com_printversion_v0.1.0.txt b/src/cmd/go/testdata/mod/example.com_printversion_v0.1.0.txt new file mode 100644 index 0000000000000..bae8b13d470e2 --- /dev/null +++ b/src/cmd/go/testdata/mod/example.com_printversion_v0.1.0.txt @@ -0,0 +1,27 @@ +example.com/printversion v0.1.0 + +-- .mod -- +module example.com/printversion +-- .info -- +{"Version":"v0.1.0"} +-- README.txt -- +There is no go.mod file for this version of the module. +-- printversion.go -- +package main + +import ( + "fmt" + "os" + "runtime/debug" + + _ "example.com/version" +) + +func main() { + info, _ := debug.ReadBuildInfo() + fmt.Fprintf(os.Stdout, "path is %s\n", info.Path) + fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version) + for _, m := range info.Deps { + fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version) + } +} diff --git a/src/cmd/go/testdata/mod/example.com_printversion_v1.0.0.txt b/src/cmd/go/testdata/mod/example.com_printversion_v1.0.0.txt new file mode 100644 index 0000000000000..246741821aff1 --- /dev/null +++ b/src/cmd/go/testdata/mod/example.com_printversion_v1.0.0.txt @@ -0,0 +1,35 @@ +example.com/printversion v1.0.0 + +-- .mod -- +module example.com/printversion + +require example.com/version v1.0.0 +replace example.com/version v1.0.0 => ../oops v0.0.0 +exclude example.com/version v1.1.0 +-- .info -- +{"Version":"v1.0.0"} +-- go.mod -- +module example.com/printversion + +require example.com/version v1.0.0 +replace example.com/version v1.0.0 => ../oops v0.0.0 +exclude example.com/version v1.0.1 +-- printversion.go -- +package main + +import ( + "fmt" + "os" + "runtime/debug" + + _ "example.com/version" +) + +func main() { + info, _ := debug.ReadBuildInfo() + fmt.Fprintf(os.Stdout, "path is %s\n", info.Path) + fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version) + for _, m := range info.Deps { + fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version) + } +} diff --git a/src/cmd/go/testdata/mod/example.com_version_v1.0.0.txt b/src/cmd/go/testdata/mod/example.com_version_v1.0.0.txt new file mode 100644 index 0000000000000..d8c45b527e9d5 --- /dev/null +++ b/src/cmd/go/testdata/mod/example.com_version_v1.0.0.txt @@ -0,0 +1,11 @@ +example.com/version v1.0.0 +written by hand + +-- .mod -- +module example.com/version +-- .info -- +{"Version":"v1.0.0"} +-- version.go -- +package version + +const V = "v1.0.0" diff --git a/src/cmd/go/testdata/mod/example.com_version_v1.0.1.txt b/src/cmd/go/testdata/mod/example.com_version_v1.0.1.txt new file mode 100644 index 0000000000000..3bfdb0e4cdcc2 --- /dev/null +++ b/src/cmd/go/testdata/mod/example.com_version_v1.0.1.txt @@ -0,0 +1,11 @@ +example.com/version v1.0.1 +written by hand + +-- .mod -- +module example.com/version +-- .info -- +{"Version":"v1.0.1"} +-- version.go -- +package version + +const V = "v1.0.1" diff --git a/src/cmd/go/testdata/mod/example.com_version_v1.1.0.txt b/src/cmd/go/testdata/mod/example.com_version_v1.1.0.txt new file mode 100644 index 0000000000000..8109a9acc9e53 --- /dev/null +++ b/src/cmd/go/testdata/mod/example.com_version_v1.1.0.txt @@ -0,0 +1,11 @@ +example.com/version v1.1.0 +written by hand + +-- .mod -- +module example.com/version +-- .info -- +{"Version":"v1.1.0"} +-- version.go -- +package version + +const V = "v1.1.0" diff --git a/src/cmd/go/testdata/script/mod_enabled.txt b/src/cmd/go/testdata/script/mod_enabled.txt index 8eef870b02b35..1de4719d53d83 100644 --- a/src/cmd/go/testdata/script/mod_enabled.txt +++ b/src/cmd/go/testdata/script/mod_enabled.txt @@ -38,7 +38,7 @@ stdout z[/\\]go.mod cd $GOPATH/src/x/y go env GOMOD -! stdout . +stdout 'NUL|/dev/null' ! go list -m stderr 'cannot find main module' diff --git a/src/cmd/go/testdata/script/mod_nomod.txt b/src/cmd/go/testdata/script/mod_nomod.txt index 640d5a363120b..7e0f55a602fd6 100644 --- a/src/cmd/go/testdata/script/mod_nomod.txt +++ b/src/cmd/go/testdata/script/mod_nomod.txt @@ -16,7 +16,7 @@ go mod edit -json x.mod ! go get ! go install ! go list -! go run x.go +! go run ! go test ! go vet diff --git a/src/cmd/go/testdata/script/mod_outside.txt b/src/cmd/go/testdata/script/mod_outside.txt new file mode 100644 index 0000000000000..cc99ed6b00cd3 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_outside.txt @@ -0,0 +1,214 @@ +env GO111MODULE=on + +# This script tests commands in module mode outside of any module. +# +# First, ensure that we really are in module mode, and that we really don't have +# a go.mod file. +go env GOMOD +stdout 'NUL|/dev/null' + + +# 'go list' without arguments implicitly operates on the current directory, +# which is not in a module. +! go list +stderr 'cannot find main module' +! go list -m +stderr 'cannot find main module' +# 'go list' in the working directory should fail even if there is a a 'package +# main' present: without a main module, we do not know its package path. +! go list ./foo +stderr 'cannot find main module' + +# 'go list all' lists the transitive import graph of the main module, +# which is empty if there is no main module. +go list all +! stdout . +stderr 'warning: "all" matched no packages' +go list -m all +stderr 'warning: pattern "all" matched no module dependencies' + +# 'go list' on standard-library packages should work, since they do not depend +# on the contents of any module. +go list -deps cmd +stdout '^fmt$' +stdout '^cmd/go$' + +go list $GOROOT/src/fmt +stdout '^fmt$' + + +# 'go list -m' with an explicit version should resolve that version. +go list -m example.com/version@latest +stdout 'example.com/version v1.1.0' + +# 'go list -m -versions' should succeed even without an explicit version. +go list -m -versions example.com/version +stdout 'v1.0.0\s+v1.0.1\s+v1.1.0' + +# 'go list -m all' does not include the dependencies of in the computation of 'all'. +go list -m example.com/printversion@v1.0.0 all +stdout 'example.com/printversion v1.0.0' +stderr 'warning: pattern "all" matched no module dependencies' +! stdout 'example.com/version' + + +# 'go clean' should skip the current directory if it isn't in a module. +go clean -n +! stdout . +! stderr . + +# 'go mod graph' should not display anything, since there are no active modules. +go mod graph +! stdout . +! stderr . + +# 'go mod why' should report that nothing is a dependency. +go mod why -m example.com/version +stdout 'does not need' + + +# 'go mod edit', 'go mod tidy', and 'go mod fmt' should fail: +# there is no go.mod file to edit. +! go mod tidy +stderr 'cannot find main module' +! go mod edit -fmt +stderr 'cannot find main module' +! go mod edit -require example.com/version@v1.0.0 +stderr 'cannot find main module' + + +# 'go mod download' should download exactly the requested module without dependencies. +rm -r $GOPATH/pkg/mod/cache/download/example.com +go mod download example.com/printversion@v1.0.0 +exists $GOPATH/pkg/mod/cache/download/example.com/printversion/@v/v1.0.0.zip +! exists $GOPATH/pkg/mod/cache/download/example.com/version/@v/v1.0.0.zip + +# 'go mod vendor' should fail: it starts by clearing the existing vendor +# directory, and we don't know where that is. +! go mod vendor +stderr 'cannot find main module' + +# 'go mod verify' should succeed: we have no modules to verify. +go mod verify +stdout 'all modules verified' +! stderr . + + +# 'go get' without arguments implicitly operates on the main module, and thus +# should fail. +! go get +stderr 'cannot find main module' +! go get -u +stderr 'cannot find main module' +! go get -u ./foo +stderr 'cannot find main module' + +# 'go get -u all' upgrades the transitive import graph of the main module, +# which is empty. +go get -u all +! stdout . +stderr 'warning: "all" matched no packages' + +# 'go get -m' should check the proposed module graph for consistency, +# even though it will not be saved anywhere. +! go get -m example.com/printversion@v1.0.0 example.com/version@none +stderr 'inconsistent versions' + +# 'go get -d' should download and extract the source code needed to build the requested version. +rm -r $GOPATH/pkg/mod/example.com +go get -d example.com/printversion@v1.0.0 +exists $GOPATH/pkg/mod/example.com/printversion@v1.0.0 +exists $GOPATH/pkg/mod/example.com/version@v1.0.0 + + +# 'go build' without arguments implicitly operates on the current directory, and should fail. +cd foo +! go build +stderr 'cannot find main module' +cd .. + +# 'go build' of a non-module directory should fail too. +! go build ./foo +stderr 'cannot find main module' + +# However, 'go build' should succeed for standard-library packages. +go build -n fmt + + +# TODO(golang.org/issue/28992): 'go doc' should document the latest version. +# For now it does not. +! go doc example.com/version +stderr 'no such package' + +# 'go install' with a version should fail due to syntax. +! go install example.com/printversion@v1.0.0 +stderr 'can only use path@version syntax with' + + +# The remainder of the test checks dependencies by linking and running binaries. +[short] stop + +# 'go get' of a binary without a go.mod should install the requested version, +# resolving outside dependencies to the latest available versions. +go get example.com/printversion@v0.1.0 +exec ../bin/printversion +stdout 'path is example.com/printversion' +stdout 'main is example.com/printversion v0.1.0' +stdout 'using example.com/version v1.1.0' + +# 'go get' of a versioned binary should build and install the latest version +# using its minimal module requirements, ignoring replacements and exclusions. +go get example.com/printversion +exec ../bin/printversion +stdout 'path is example.com/printversion' +stdout 'main is example.com/printversion v1.0.0' +stdout 'using example.com/version v1.0.0' + +# 'go get -u=patch' should patch dependencies before installing, +# again ignoring replacements and exclusions. +go get -u=patch example.com/printversion@v1.0.0 +exec ../bin/printversion +stdout 'path is example.com/printversion' +stdout 'main is example.com/printversion v1.0.0' +stdout 'using example.com/version v1.0.1' + +# 'go install' without a version should install the latest version +# using its minimal module requirements. +go install example.com/printversion +exec ../bin/printversion +stdout 'path is example.com/printversion' +stdout 'main is example.com/printversion v1.0.0' +stdout 'using example.com/version v1.0.0' + +# 'go run' should use 'main' as the effective module and import path. +go run ./foo/foo.go +stdout 'path is \.$' +stdout 'main is main \(devel\)' +stdout 'using example.com/version v1.1.0' + + +-- README.txt -- +There is no go.mod file in the working directory. + +-- foo/foo.go -- +package main + +import ( + "fmt" + "os" + "runtime/debug" + + _ "example.com/version" +) + +func main() { + info, ok := debug.ReadBuildInfo() + if !ok { + panic("missing build info") + } + fmt.Fprintf(os.Stdout, "path is %s\n", info.Path) + fmt.Fprintf(os.Stdout, "main is %s %s\n", info.Main.Path, info.Main.Version) + for _, m := range info.Deps { + fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version) + } +} From 365a1877560e938b683dde76df0b8b71800f8cff Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 28 Nov 2018 11:28:47 -0500 Subject: [PATCH 176/594] cmd/go/internal/modcmd: check for errors in Download Also test that Download restores deleted files. Updates #27783 Change-Id: If50074dbcffd74ff08fbaa9ad8c314cfdce0b02d Reviewed-on: https://go-review.googlesource.com/c/151559 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/modcmd/download.go | 10 ++++++++++ src/cmd/go/testdata/script/mod_download.txt | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/cmd/go/internal/modcmd/download.go b/src/cmd/go/internal/modcmd/download.go index 8678caea51673..bbaba444f507f 100644 --- a/src/cmd/go/internal/modcmd/download.go +++ b/src/cmd/go/internal/modcmd/download.go @@ -128,6 +128,16 @@ func runDownload(cmd *base.Command, args []string) { base.Fatalf("%v", err) } os.Stdout.Write(append(b, '\n')) + if m.Error != "" { + base.SetExitStatus(1) + } + } + } else { + for _, m := range mods { + if m.Error != "" { + base.Errorf("%s@%s: %s\n", m.Path, m.Version, m.Error) + } } + base.ExitIfErrors() } } diff --git a/src/cmd/go/testdata/script/mod_download.txt b/src/cmd/go/testdata/script/mod_download.txt index 6be6acb360c9f..22f07c33c7565 100644 --- a/src/cmd/go/testdata/script/mod_download.txt +++ b/src/cmd/go/testdata/script/mod_download.txt @@ -8,6 +8,12 @@ exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.info exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.mod exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.zip +# download of an invalid path should report the error +! go mod download this.domain.is.invalid/somemodule@v1.0.0 +stderr 'this.domain.is.invalid' +! go mod download -json this.domain.is.invalid/somemodule@v1.0.0 +stdout '"Error": ".*this.domain.is.invalid.*"' + # download -json with version should print JSON go mod download -json 'rsc.io/quote@<=v1.5.0' stdout '^\t"Path": "rsc.io/quote"' @@ -42,6 +48,21 @@ exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.mod exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.zip exists $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 +# download repopulates deleted files and directories independently. +rm $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.info +go mod download +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.info +rm $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.mod +go mod download +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.mod +rm $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.zip +go mod download +exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.2.zip +rm -r $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 +go mod download +exists $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 + +# download reports the locations of downloaded files go mod download -json stdout '^\t"Path": "rsc.io/quote"' stdout '^\t"Version": "v1.5.2"' From aab0b704d88b7dad10c767ad941619d59887203c Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 8 Nov 2018 09:46:24 -0500 Subject: [PATCH 177/594] cmd/go/internal/load: remove redundant assignment to BinDir This assignment became a no-op in CL 36196, where both it and the preceding assignment were changed to cfg.GOROOTbin (from gorootBin and gobin respectively). Change-Id: If74969c4cc3ffc5d8394ff9d8e8bcec9e0a4e3b0 Reviewed-on: https://go-review.googlesource.com/c/151561 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/load/pkg.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 72a3d70607441..616adcc57ae80 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -1769,9 +1769,6 @@ func loadPackage(arg string, stk *ImportStack) *Package { bp.ImportPath = arg bp.Goroot = true bp.BinDir = cfg.GOROOTbin - if cfg.GOROOTbin != "" { - bp.BinDir = cfg.GOROOTbin - } bp.Root = cfg.GOROOT bp.SrcRoot = cfg.GOROOTsrc p := new(Package) From 20950dba2609a1aff01a4bf950e2d0d2792f1b87 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 5 Nov 2018 10:49:22 -0500 Subject: [PATCH 178/594] cmd/go/testdata/mod: remove unused research.swtch.com/vgo-tour The test that used that module was removed in https://golang.org/cl/128900. Change-Id: Id96270a52398c8ccc09821efb2a6a6b4764f44d9 Reviewed-on: https://go-review.googlesource.com/c/151560 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- .../research.swtch.com_vgo-tour_v1.0.0.txt | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/cmd/go/testdata/mod/research.swtch.com_vgo-tour_v1.0.0.txt diff --git a/src/cmd/go/testdata/mod/research.swtch.com_vgo-tour_v1.0.0.txt b/src/cmd/go/testdata/mod/research.swtch.com_vgo-tour_v1.0.0.txt deleted file mode 100644 index 0f060dc8e32fe..0000000000000 --- a/src/cmd/go/testdata/mod/research.swtch.com_vgo-tour_v1.0.0.txt +++ /dev/null @@ -1,23 +0,0 @@ -research.swtch.com/vgo-tour@v1.0.0 - --- .mod -- -module "research.swtch.com/vgo-tour" --- .info -- -{"Version":"v1.0.0","Name":"84de74b35823c1e49634f2262f1a58cfc951ebae","Short":"84de74b35823","Time":"2018-02-20T00:04:00Z"} --- go.mod -- -module "research.swtch.com/vgo-tour" --- hello.go -- -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "fmt" - "rsc.io/quote" -) - -func main() { - fmt.Println(quote.Hello()) -} From c37b6ecc8ae90fad4c3bde947d96487820cdceec Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 8 Nov 2018 10:23:53 -0500 Subject: [PATCH 179/594] cmd/go/internal/modfetch: document DownloadDir Change-Id: I4717964234fca0c8c5889ed710b66f39eb53a809 Reviewed-on: https://go-review.googlesource.com/c/151562 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/modfetch/cache.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/go/internal/modfetch/cache.go b/src/cmd/go/internal/modfetch/cache.go index 80484d5b5e728..1ccd43dc2ae84 100644 --- a/src/cmd/go/internal/modfetch/cache.go +++ b/src/cmd/go/internal/modfetch/cache.go @@ -56,6 +56,8 @@ func CachePath(m module.Version, suffix string) (string, error) { return filepath.Join(dir, encVer+"."+suffix), nil } +// DownloadDir returns the directory to which m should be downloaded. +// Note that the directory may not yet exist. func DownloadDir(m module.Version) (string, error) { if PkgMod == "" { return "", fmt.Errorf("internal error: modfetch.PkgMod not set") From ec4de31c5c4230dd70050c4c58def88e811b8fb5 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 28 Nov 2018 16:22:05 -0500 Subject: [PATCH 180/594] cmd/doc: treat any non-empty GOMOD as module mode Previously, we were looking for the string go.mod specifically, but the module-mode-outside-a-module logic added in CL 148517 sets GOMOD to os.DevNull Updates #28992 Change-Id: I62a4baaa911a495350294d78bae96be3fe4866cb Reviewed-on: https://go-review.googlesource.com/c/151617 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/doc/dirs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/doc/dirs.go b/src/cmd/doc/dirs.go index 24bd797eb51f9..c6f5cd9af8516 100644 --- a/src/cmd/doc/dirs.go +++ b/src/cmd/doc/dirs.go @@ -162,7 +162,7 @@ func findCodeRoots() []Dir { // Check for use of modules by 'go env GOMOD', // which reports a go.mod file path if modules are enabled. stdout, _ := exec.Command("go", "env", "GOMOD").Output() - usingModules = bytes.Contains(stdout, []byte("go.mod")) + usingModules = len(bytes.TrimSpace(stdout)) > 0 } if !usingModules { From 689fae2d7861fe14032762479011f9e48562e1e0 Mon Sep 17 00:00:00 2001 From: Gergely Brautigam Date: Wed, 28 Nov 2018 18:10:28 +0000 Subject: [PATCH 181/594] runtime: node ordering in mTreap; adjust code to reflect description. Adjust mTreap ordering logic to reflect the description of mTreap ordering. Before it was using unsafe.Pointer in order to gather the base address of a span. This has been changed to use base, which is the startAddress of a span as the description is telling us in mgclarge.go. Fixes: golang/go#28805 Change-Id: Ib3cd94a0757e23d135b5d41830f38fc08bcf16a3 GitHub-Last-Rev: 93f749b6700b1e179de16607a18395d5e162ecc1 GitHub-Pull-Request: golang/go#28973 Reviewed-on: https://go-review.googlesource.com/c/151499 Reviewed-by: Michael Knyszek Run-TryBot: Michael Knyszek --- src/runtime/mgclarge.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/mgclarge.go b/src/runtime/mgclarge.go index ab665615be566..66259d4cdfd81 100644 --- a/src/runtime/mgclarge.go +++ b/src/runtime/mgclarge.go @@ -164,10 +164,10 @@ func (root *mTreap) insert(span *mspan) { pt = &t.right } else if t.npagesKey > npages { pt = &t.left - } else if uintptr(unsafe.Pointer(t.spanKey)) < uintptr(unsafe.Pointer(span)) { + } else if t.spanKey.base() < span.base() { // t.npagesKey == npages, so sort on span addresses. pt = &t.right - } else if uintptr(unsafe.Pointer(t.spanKey)) > uintptr(unsafe.Pointer(span)) { + } else if t.spanKey.base() > span.base() { pt = &t.left } else { throw("inserting span already in treap") @@ -271,9 +271,9 @@ func (root *mTreap) removeSpan(span *mspan) { t = t.right } else if t.npagesKey > npages { t = t.left - } else if uintptr(unsafe.Pointer(t.spanKey)) < uintptr(unsafe.Pointer(span)) { + } else if t.spanKey.base() < span.base() { t = t.right - } else if uintptr(unsafe.Pointer(t.spanKey)) > uintptr(unsafe.Pointer(span)) { + } else if t.spanKey.base() > span.base() { t = t.left } } From 81a5c9c306a35a297c86d72c9729a16f69acec21 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Tue, 20 Nov 2018 11:13:03 +0530 Subject: [PATCH 182/594] go/doc: convert to unicode quotes for ToText and Synopsis We refactor the conversion of quotes to their unicode equivalent to a separate function so that it can be called from ToText and Synopsis. And we introduce a temp buffer to write the escaped HTML and convert the unicode quotes back to html escaped entities. This simplifies the logic and gets rid of the need to track the index of the escaped text. Fixes #27759 Change-Id: I71cf47ddcd4c6794ccdf2898ac25539388b393c1 Reviewed-on: https://go-review.googlesource.com/c/150377 Run-TryBot: Robert Griesemer Reviewed-by: Robert Griesemer --- src/go/doc/comment.go | 48 ++++++++++++++++++++++--------------- src/go/doc/comment_test.go | 18 ++++++++++++++ src/go/doc/synopsis.go | 1 + src/go/doc/synopsis_test.go | 1 + 4 files changed, 49 insertions(+), 19 deletions(-) diff --git a/src/go/doc/comment.go b/src/go/doc/comment.go index d9268b87fb885..d2c026ea70290 100644 --- a/src/go/doc/comment.go +++ b/src/go/doc/comment.go @@ -7,6 +7,7 @@ package doc import ( + "bytes" "io" "strings" "text/template" // for HTMLEscape @@ -14,32 +15,38 @@ import ( "unicode/utf8" ) +const ( + ldquo = "“" + rdquo = "”" + ulquo = "“" + urquo = "”" +) + var ( - ldquo = []byte("“") - rdquo = []byte("”") + htmlQuoteReplacer = strings.NewReplacer(ulquo, ldquo, urquo, rdquo) + unicodeQuoteReplacer = strings.NewReplacer("``", ulquo, "''", urquo) ) // Escape comment text for HTML. If nice is set, // also turn `` into “ and '' into ”. func commentEscape(w io.Writer, text string, nice bool) { - last := 0 if nice { - for i := 0; i < len(text)-1; i++ { - ch := text[i] - if ch == text[i+1] && (ch == '`' || ch == '\'') { - template.HTMLEscape(w, []byte(text[last:i])) - last = i + 2 - switch ch { - case '`': - w.Write(ldquo) - case '\'': - w.Write(rdquo) - } - i++ // loop will add one more - } - } + // In the first pass, we convert `` and '' into their unicode equivalents. + // This prevents them from being escaped in HTMLEscape. + text = convertQuotes(text) + var buf bytes.Buffer + template.HTMLEscape(&buf, []byte(text)) + // Now we convert the unicode quotes to their HTML escaped entities to maintain old behavior. + // We need to use a temp buffer to read the string back and do the conversion, + // otherwise HTMLEscape will escape & to & + htmlQuoteReplacer.WriteString(w, buf.String()) + return } - template.HTMLEscape(w, []byte(text[last:])) + template.HTMLEscape(w, []byte(text)) +} + +func convertQuotes(text string) string { + return unicodeQuoteReplacer.Replace(text) } const ( @@ -248,7 +255,7 @@ func heading(line string) string { } // allow "." when followed by non-space - for b := line;; { + for b := line; ; { i := strings.IndexRune(b, '.') if i < 0 { break @@ -429,12 +436,14 @@ func ToText(w io.Writer, text string, indent, preIndent string, width int) { case opPara: // l.write will add leading newline if required for _, line := range b.lines { + line = convertQuotes(line) l.write(line) } l.flush() case opHead: w.Write(nl) for _, line := range b.lines { + line = convertQuotes(line) l.write(line + "\n") } l.flush() @@ -445,6 +454,7 @@ func ToText(w io.Writer, text string, indent, preIndent string, width int) { w.Write([]byte("\n")) } else { w.Write([]byte(preIndent)) + line = convertQuotes(line) w.Write([]byte(line)) } } diff --git a/src/go/doc/comment_test.go b/src/go/doc/comment_test.go index 0523ab899ee34..1e6cf84cdfb96 100644 --- a/src/go/doc/comment_test.go +++ b/src/go/doc/comment_test.go @@ -7,6 +7,7 @@ package doc import ( "bytes" "reflect" + "strings" "testing" ) @@ -212,3 +213,20 @@ func TestPairedParensPrefixLen(t *testing.T) { } } } + +func TestCommentEscape(t *testing.T) { + commentTests := []struct { + in, out string + }{ + {"typically invoked as ``go tool asm'',", "typically invoked as " + ldquo + "go tool asm" + rdquo + ","}, + {"For more detail, run ``go help test'' and ``go help testflag''", "For more detail, run " + ldquo + "go help test" + rdquo + " and " + ldquo + "go help testflag" + rdquo}, + } + for i, tt := range commentTests { + var buf strings.Builder + commentEscape(&buf, tt.in, true) + out := buf.String() + if out != tt.out { + t.Errorf("#%d: mismatch\nhave: %q\nwant: %q", i, out, tt.out) + } + } +} diff --git a/src/go/doc/synopsis.go b/src/go/doc/synopsis.go index c90080b7cc175..3fa1616cd147b 100644 --- a/src/go/doc/synopsis.go +++ b/src/go/doc/synopsis.go @@ -72,6 +72,7 @@ func Synopsis(s string) string { return "" } } + s = convertQuotes(s) return s } diff --git a/src/go/doc/synopsis_test.go b/src/go/doc/synopsis_test.go index 59b253cb8dcea..3f443dc757883 100644 --- a/src/go/doc/synopsis_test.go +++ b/src/go/doc/synopsis_test.go @@ -35,6 +35,7 @@ var tests = []struct { {"All Rights reserved. Package foo does bar.", 20, ""}, {"All rights reserved. Package foo does bar.", 20, ""}, {"Authors: foo@bar.com. Package foo does bar.", 21, ""}, + {"typically invoked as ``go tool asm'',", 37, "typically invoked as " + ulquo + "go tool asm" + urquo + ","}, } func TestSynopsis(t *testing.T) { From fbdaa965634be842647195ee2d610dc363c760d2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 20 Nov 2018 15:55:02 -0800 Subject: [PATCH 183/594] cmd/cgo: use field alignment when setting field offset The old code ignored the field alignment, and only looked at the field offset: if the field offset required padding, cgo added padding. But while that approach works for Go (at least with the gc toolchain) it doesn't work for C code using packed structs. With a packed struct the added padding may leave the struct at a misaligned position, and the inserted alignment, which cgo is not considering, may introduce additional, unexpected, padding. Padding that ignores alignment is not a good idea when the struct is not packed, and Go structs are never packed. So don't ignore alignment. Fixes #28896 Change-Id: Ie50ea15fa6dc35557497097be9fecfecb11efd8a Reviewed-on: https://go-review.googlesource.com/c/150602 Run-TryBot: Ian Lance Taylor Reviewed-by: Bryan C. Mills --- misc/cgo/test/cgo_test.go | 1 + misc/cgo/test/issue28896.go | 83 +++++++++++++++++++++++++++++++++++++ src/cmd/cgo/gcc.go | 18 +++++--- 3 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 misc/cgo/test/issue28896.go diff --git a/misc/cgo/test/cgo_test.go b/misc/cgo/test/cgo_test.go index ae856a37d690f..242ba6c0e5d01 100644 --- a/misc/cgo/test/cgo_test.go +++ b/misc/cgo/test/cgo_test.go @@ -93,6 +93,7 @@ func Test23356(t *testing.T) { test23356(t) } func Test26066(t *testing.T) { test26066(t) } func Test26213(t *testing.T) { test26213(t) } func Test27660(t *testing.T) { test27660(t) } +func Test28896(t *testing.T) { test28896(t) } func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) } func BenchmarkGoString(b *testing.B) { benchGoString(b) } diff --git a/misc/cgo/test/issue28896.go b/misc/cgo/test/issue28896.go new file mode 100644 index 0000000000000..8796040f18e42 --- /dev/null +++ b/misc/cgo/test/issue28896.go @@ -0,0 +1,83 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// cgo was incorrectly adding padding after a packed struct. + +package cgotest + +/* +#include +#include +#include + +typedef struct { + void *f1; + uint32_t f2; +} __attribute__((__packed__)) innerPacked; + +typedef struct { + innerPacked g1; + uint64_t g2; +} outerPacked; + +typedef struct { + void *f1; + uint32_t f2; +} innerUnpacked; + +typedef struct { + innerUnpacked g1; + uint64_t g2; +} outerUnpacked; + +size_t offset(int x) { + switch (x) { + case 0: + return offsetof(innerPacked, f2); + case 1: + return offsetof(outerPacked, g2); + case 2: + return offsetof(innerUnpacked, f2); + case 3: + return offsetof(outerUnpacked, g2); + default: + abort(); + } +} +*/ +import "C" + +import ( + "testing" + "unsafe" +) + +func offset(i int) uintptr { + var pi C.innerPacked + var po C.outerPacked + var ui C.innerUnpacked + var uo C.outerUnpacked + switch i { + case 0: + return unsafe.Offsetof(pi.f2) + case 1: + return unsafe.Offsetof(po.g2) + case 2: + return unsafe.Offsetof(ui.f2) + case 3: + return unsafe.Offsetof(uo.g2) + default: + panic("can't happen") + } +} + +func test28896(t *testing.T) { + for i := 0; i < 4; i++ { + c := uintptr(C.offset(C.int(i))) + g := offset(i) + if c != g { + t.Errorf("%d: C: %d != Go %d", i, c, g) + } + } +} diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 56a4775746cd6..b5bc87dde686a 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -2717,11 +2717,6 @@ func (c *typeConv) Struct(dt *dwarf.StructType, pos token.Pos) (expr *ast.Struct anon := 0 for _, f := range dt.Field { - if f.ByteOffset > off { - fld, sizes = c.pad(fld, sizes, f.ByteOffset-off) - off = f.ByteOffset - } - name := f.Name ft := f.Type @@ -2770,6 +2765,19 @@ func (c *typeConv) Struct(dt *dwarf.StructType, pos token.Pos) (expr *ast.Struct // structs are in system headers that cannot be corrected. continue } + + // Round off up to talign, assumed to be a power of 2. + off = (off + talign - 1) &^ (talign - 1) + + if f.ByteOffset > off { + fld, sizes = c.pad(fld, sizes, f.ByteOffset-off) + off = f.ByteOffset + } + if f.ByteOffset < off { + // Drop a packed field that we can't represent. + continue + } + n := len(fld) fld = fld[0 : n+1] if name == "" { From 438b9544a079576c539cdc040cbf337966a0b25d Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 26 Nov 2018 14:41:23 -0500 Subject: [PATCH 184/594] runtime: check more work flushing races This adds several new checks to help debug #27993. It adds a mechanism for freezing write barriers and gcWork puts during the mark completion algorithm. This way, if we do detect mark completion, we can catch any puts that happened during the completion algorithm. Based on build dashboard failures, this seems to be the window of time when these are happening. This also double-checks that all work buffers are empty immediately upon entering mark termination (much earlier than the current check). This is unlikely to trigger based on the current failures, but is a good safety net. Change-Id: I03f56c48c4322069e28c50fbc3c15b2fee2130c2 Reviewed-on: https://go-review.googlesource.com/c/151797 Run-TryBot: Austin Clements Reviewed-by: Michael Knyszek --- src/runtime/mgc.go | 64 +++++++++++++++++++++++++++++++++++++++++- src/runtime/mgcwork.go | 34 ++++++++++++---------- src/runtime/mwbbuf.go | 2 +- 3 files changed, 83 insertions(+), 17 deletions(-) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index db589c3f8fae6..7747e5409c9ae 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1363,6 +1363,19 @@ func gcStart(trigger gcTrigger) { // This is protected by markDoneSema. var gcMarkDoneFlushed uint32 +// debugCachedWork enables extra checks for debugging premature mark +// termination. +// +// For debugging issue #27993. +const debugCachedWork = true + +// gcWorkPauseGen is for debugging the mark completion algorithm. +// gcWork put operations spin while gcWork.pauseGen == gcWorkPauseGen. +// Only used if debugCachedWork is true. +// +// For debugging issue #27993. +var gcWorkPauseGen uint32 = 1 + // gcMarkDone transitions the GC from mark to mark termination if all // reachable objects have been marked (that is, there are no grey // objects and can be no more in the future). Otherwise, it flushes @@ -1408,6 +1421,14 @@ top: // Flush the write barrier buffer, since this may add // work to the gcWork. wbBufFlush1(_p_) + // For debugging, shrink the write barrier + // buffer so it flushes immediately. + // wbBuf.reset will keep it at this size as + // long as throwOnGCWork is set. + if debugCachedWork { + b := &_p_.wbBuf + b.end = uintptr(unsafe.Pointer(&b.buf[wbBufEntryPointers])) + } // Flush the gcWork, since this may create global work // and set the flushedWork flag. // @@ -1418,11 +1439,23 @@ top: if _p_.gcw.flushedWork { atomic.Xadd(&gcMarkDoneFlushed, 1) _p_.gcw.flushedWork = false + } else if debugCachedWork { + // For debugging, freeze the gcWork + // until we know whether we've reached + // completion or not. If we think + // we've reached completion, but + // there's a paused gcWork, then + // that's a bug. + _p_.gcw.pauseGen = gcWorkPauseGen } }) }) if gcMarkDoneFlushed != 0 { + if debugCachedWork { + // Release paused gcWorks. + atomic.Xadd(&gcWorkPauseGen, 1) + } // More grey objects were discovered since the // previous termination check, so there may be more // work to do. Keep going. It's possible the @@ -1431,7 +1464,12 @@ top: goto top } - throwOnGCWork = true + if debugCachedWork { + throwOnGCWork = true + // Release paused gcWorks. If there are any, they + // should now observe throwOnGCWork and panic. + atomic.Xadd(&gcWorkPauseGen, 1) + } // There was no global work, no local work, and no Ps // communicated work since we took markDoneSema. Therefore @@ -1449,6 +1487,30 @@ top: // below. The important thing is that the wb remains active until // all marking is complete. This includes writes made by the GC. + if debugCachedWork { + // For debugging, double check that no work was added after we + // went around above and disable write barrier buffering. + for _, p := range allp { + gcw := &p.gcw + if !gcw.empty() { + printlock() + print("runtime: P ", p.id, " flushedWork ", gcw.flushedWork) + if gcw.wbuf1 == nil { + print(" wbuf1=") + } else { + print(" wbuf1.n=", gcw.wbuf1.nobj) + } + if gcw.wbuf2 == nil { + print(" wbuf2=") + } else { + print(" wbuf2.n=", gcw.wbuf2.nobj) + } + print("\n") + throw("throwOnGCWork") + } + } + } + // Disable assists and background workers. We must do // this before waking blocked assists. atomic.Store(&gcBlackenEnabled, 0) diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go index da2129ee508dd..8a77ff55e4d1d 100644 --- a/src/runtime/mgcwork.go +++ b/src/runtime/mgcwork.go @@ -93,6 +93,10 @@ type gcWork struct { // termination check. Specifically, this indicates that this // gcWork may have communicated work to another gcWork. flushedWork bool + + // pauseGen causes put operations to spin while pauseGen == + // gcWorkPauseGen if debugCachedWork is true. + pauseGen uint32 } // Most of the methods of gcWork are go:nowritebarrierrec because the @@ -111,13 +115,21 @@ func (w *gcWork) init() { w.wbuf2 = wbuf2 } +func (w *gcWork) checkPut() { + if debugCachedWork { + for atomic.Load(&gcWorkPauseGen) == w.pauseGen { + } + if throwOnGCWork { + throw("throwOnGCWork") + } + } +} + // put enqueues a pointer for the garbage collector to trace. // obj must point to the beginning of a heap object or an oblet. //go:nowritebarrierrec func (w *gcWork) put(obj uintptr) { - if throwOnGCWork { - throw("throwOnGCWork") - } + w.checkPut() flushed := false wbuf := w.wbuf1 @@ -153,9 +165,7 @@ func (w *gcWork) put(obj uintptr) { // otherwise it returns false and the caller needs to call put. //go:nowritebarrierrec func (w *gcWork) putFast(obj uintptr) bool { - if throwOnGCWork { - throw("throwOnGCWork") - } + w.checkPut() wbuf := w.wbuf1 if wbuf == nil { @@ -178,9 +188,7 @@ func (w *gcWork) putBatch(obj []uintptr) { return } - if throwOnGCWork { - throw("throwOnGCWork") - } + w.checkPut() flushed := false wbuf := w.wbuf1 @@ -303,16 +311,12 @@ func (w *gcWork) balance() { return } if wbuf := w.wbuf2; wbuf.nobj != 0 { - if throwOnGCWork { - throw("throwOnGCWork") - } + w.checkPut() putfull(wbuf) w.flushedWork = true w.wbuf2 = getempty() } else if wbuf := w.wbuf1; wbuf.nobj > 4 { - if throwOnGCWork { - throw("throwOnGCWork") - } + w.checkPut() w.wbuf1 = handoff(wbuf) w.flushedWork = true // handoff did putfull } else { diff --git a/src/runtime/mwbbuf.go b/src/runtime/mwbbuf.go index c91cea254e9da..a698493a0a2c5 100644 --- a/src/runtime/mwbbuf.go +++ b/src/runtime/mwbbuf.go @@ -79,7 +79,7 @@ const ( func (b *wbBuf) reset() { start := uintptr(unsafe.Pointer(&b.buf[0])) b.next = start - if writeBarrier.cgo { + if writeBarrier.cgo || (debugCachedWork && throwOnGCWork) { // Effectively disable the buffer by forcing a flush // on every barrier. b.end = uintptr(unsafe.Pointer(&b.buf[wbBufEntryPointers])) From 2140975ebde164ea1eaa70fc72775c03567f2bc9 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 27 Nov 2018 12:40:16 -0800 Subject: [PATCH 185/594] cmd/compile: eliminate write barriers when writing non-heap ptrs We don't need a write barrier if: 1) The location we're writing to doesn't hold a heap pointer, and 2) The value we're writing isn't a heap pointer. The freshly returned value from runtime.newobject satisfies (1). Pointers to globals, and the contents of the read-only data section satisfy (2). This is particularly helpful for code like: p := []string{"abc", "def", "ghi"} Where the compiler generates: a := new([3]string) move(a, statictmp_) // eliminates write barriers here p := a[:] For big slice literals, this makes the code a smaller and faster to compile. Update #13554. Reduces the compile time by ~10% and RSS by ~30%. Change-Id: Icab81db7591c8777f68e5d528abd48c7e44c87eb Reviewed-on: https://go-review.googlesource.com/c/151498 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/ssa/writebarrier.go | 57 +++++++++++++++++++- test/writebarrier.go | 11 ++++ 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/ssa/writebarrier.go b/src/cmd/compile/internal/ssa/writebarrier.go index 2366e0bfbf358..95816d2bdaa94 100644 --- a/src/cmd/compile/internal/ssa/writebarrier.go +++ b/src/cmd/compile/internal/ssa/writebarrier.go @@ -24,6 +24,14 @@ func needwb(v *Value) bool { if IsStackAddr(v.Args[0]) { return false // write on stack doesn't need write barrier } + if v.Op == OpStore && IsGlobalAddr(v.Args[1]) && IsNewObject(v.Args[0], v.MemoryArg()) { + // Storing pointers to non-heap locations into a fresh object doesn't need a write barrier. + return false + } + if v.Op == OpMove && IsReadOnlyGlobalAddr(v.Args[1]) && IsNewObject(v.Args[0], v.MemoryArg()) { + // Copying data from readonly memory into a fresh object doesn't need a write barrier. + return false + } return true } @@ -353,7 +361,7 @@ func round(o int64, r int64) int64 { return (o + r - 1) &^ (r - 1) } -// IsStackAddr returns whether v is known to be an address of a stack slot +// IsStackAddr reports whether v is known to be an address of a stack slot. func IsStackAddr(v *Value) bool { for v.Op == OpOffPtr || v.Op == OpAddPtr || v.Op == OpPtrIndex || v.Op == OpCopy { v = v.Args[0] @@ -365,6 +373,51 @@ func IsStackAddr(v *Value) bool { return false } +// IsGlobalAddr reports whether v is known to be an address of a global. +func IsGlobalAddr(v *Value) bool { + return v.Op == OpAddr && v.Args[0].Op == OpSB +} + +// IsReadOnlyGlobalAddr reports whether v is known to be an address of a read-only global. +func IsReadOnlyGlobalAddr(v *Value) bool { + if !IsGlobalAddr(v) { + return false + } + // See TODO in OpAddr case in IsSanitizerSafeAddr below. + return strings.HasPrefix(v.Aux.(*obj.LSym).Name, `"".statictmp_`) +} + +// IsNewObject reports whether v is a pointer to a freshly allocated & zeroed object at memory state mem. +// TODO: Be more precise. We really want "IsNilPointer" for the particular field in question. +// Right now, we can only detect a new object before any writes have been done to it. +// We could ignore non-pointer writes, writes to offsets which +// are known not to overlap the write in question, etc. +func IsNewObject(v *Value, mem *Value) bool { + if v.Op != OpLoad { + return false + } + if v.MemoryArg() != mem { + return false + } + if mem.Op != OpStaticCall { + return false + } + if !isSameSym(mem.Aux, "runtime.newobject") { + return false + } + if v.Args[0].Op != OpOffPtr { + return false + } + if v.Args[0].Args[0].Op != OpSP { + return false + } + c := v.Block.Func.Config + if v.Args[0].AuxInt != c.ctxt.FixedFrameSize()+c.RegSize { // offset of return value + return false + } + return true +} + // IsSanitizerSafeAddr reports whether v is known to be an address // that doesn't need instrumentation. func IsSanitizerSafeAddr(v *Value) bool { @@ -393,7 +446,7 @@ func IsSanitizerSafeAddr(v *Value) bool { return false } -// isVolatile returns whether v is a pointer to argument region on stack which +// isVolatile reports whether v is a pointer to argument region on stack which // will be clobbered by a function call. func isVolatile(v *Value) bool { for v.Op == OpOffPtr || v.Op == OpAddPtr || v.Op == OpPtrIndex || v.Op == OpCopy { diff --git a/test/writebarrier.go b/test/writebarrier.go index 55ba81e764e08..8d262dd203783 100644 --- a/test/writebarrier.go +++ b/test/writebarrier.go @@ -250,3 +250,14 @@ func f23c() { // also test partial assignments t23 = T23{p: &i23} // ERROR "write barrier" } + +var g int + +func f24() **int { + p := new(*int) + *p = &g // no write barrier here + return p +} +func f25() []string { + return []string{"abc", "def", "ghi"} // no write barrier here +} From 96a6bd4bf6281a57c933bdcc1da96a7608cf20d7 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 30 Nov 2018 12:09:59 +0100 Subject: [PATCH 186/594] cmd/go/internal/lockedfile/internal/filelock: fix test on iOS Change-Id: I0390b382db0ca36de20af0ef15204c5bfc084d3d Reviewed-on: https://go-review.googlesource.com/c/151937 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- .../go/internal/lockedfile/internal/filelock/filelock_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go index 96f4874378fc6..0ccee07ceebd5 100644 --- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go @@ -8,6 +8,7 @@ package filelock_test import ( "fmt" + "internal/testenv" "io/ioutil" "os" "os/exec" @@ -183,6 +184,8 @@ func TestRLockExcludesOnlyLock(t *testing.T) { } func TestLockNotDroppedByExecCommand(t *testing.T) { + testenv.MustHaveExec(t) + f, remove := mustTempFile(t) defer remove() From 42e8b9c3a430ccc4a03b2994f7dcbde630410e1e Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 29 Nov 2018 17:46:14 -0500 Subject: [PATCH 187/594] cmd/go/internal/modfetch: make directories read-only after renaming, not before The call to os.Rename was failing on the darwin builders, despite having passed in the TryBots. (I tested this change by running 'go test cmd/go' manually on a darwin gomote.) This fixes the builder failures after CL 146382. Updates #26794 Fixes #29030 Change-Id: I3644773421789f65e56f183d077b4e4fd17b8325 Reviewed-on: https://go-review.googlesource.com/c/151798 Reviewed-by: Austin Clements Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot --- src/cmd/go/internal/modfetch/fetch.go | 9 ++++++- src/cmd/go/internal/modfetch/unzip.go | 38 +++++++++++++++------------ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/cmd/go/internal/modfetch/fetch.go b/src/cmd/go/internal/modfetch/fetch.go index 159bc569296b3..81a6c843abccf 100644 --- a/src/cmd/go/internal/modfetch/fetch.go +++ b/src/cmd/go/internal/modfetch/fetch.go @@ -120,7 +120,14 @@ func download(mod module.Version, dir string) (err error) { return err } - return os.Rename(tmpDir, dir) + if err := os.Rename(tmpDir, dir); err != nil { + return err + } + + // Make dir read-only only *after* renaming it. + // os.Rename was observed to fail for read-only directories on macOS. + makeDirsReadOnly(dir) + return nil } var downloadZipCache par.Cache diff --git a/src/cmd/go/internal/modfetch/unzip.go b/src/cmd/go/internal/modfetch/unzip.go index 113d5b743bc98..ac13ede257b61 100644 --- a/src/cmd/go/internal/modfetch/unzip.go +++ b/src/cmd/go/internal/modfetch/unzip.go @@ -12,7 +12,6 @@ import ( "os" "path" "path/filepath" - "sort" "strings" "cmd/go/internal/modfetch/codehost" @@ -98,18 +97,12 @@ func Unzip(dir, zipfile, prefix string, maxSize int64) error { } // Unzip, enforcing sizes checked earlier. - dirs := map[string]bool{dir: true} for _, zf := range z.File { if zf.Name == prefix || strings.HasSuffix(zf.Name, "/") { continue } name := zf.Name[len(prefix):] dst := filepath.Join(dir, name) - parent := filepath.Dir(dst) - for parent != dir { - dirs[parent] = true - parent = filepath.Dir(parent) - } if err := os.MkdirAll(filepath.Dir(dst), 0777); err != nil { return err } @@ -137,19 +130,30 @@ func Unzip(dir, zipfile, prefix string, maxSize int64) error { } } - // Mark directories unwritable, best effort. - var dirlist []string - for dir := range dirs { - dirlist = append(dirlist, dir) + return nil +} + +// makeDirsReadOnly makes a best-effort attempt to remove write permissions for dir +// and its transitive contents. +func makeDirsReadOnly(dir string) { + type pathMode struct { + path string + mode os.FileMode } - sort.Strings(dirlist) + var dirs []pathMode // in lexical order + filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { + if err == nil && info.Mode()&0222 != 0 { + if info.IsDir() { + dirs = append(dirs, pathMode{path, info.Mode()}) + } + } + return nil + }) + // Run over list backward to chmod children before parents. - for i := len(dirlist) - 1; i >= 0; i-- { - // TODO(bcmills): Does this end up stomping on the umask of the cache directory? - os.Chmod(dirlist[i], 0555) + for i := len(dirs) - 1; i >= 0; i-- { + os.Chmod(dirs[i].path, dirs[i].mode&^0222) } - - return nil } // RemoveAll removes a directory written by Download or Unzip, first applying From 90812292e25796f8411f625c062cfc2e2b4bdf5e Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Thu, 29 Nov 2018 18:41:03 -0500 Subject: [PATCH 188/594] net: skip flaky TestLookupDotsWithRemoteSource on darwin Updates golang/go#27992 Change-Id: Ic327df7cc5002a3d537f9117559c25f30e1eab9c Reviewed-on: https://go-review.googlesource.com/c/151799 Run-TryBot: Andrew Bonventre TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/lookup_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go index 35b2a635b2c95..1da0e49a28c30 100644 --- a/src/net/lookup_test.go +++ b/src/net/lookup_test.go @@ -618,6 +618,9 @@ func TestLookupDotsWithLocalSource(t *testing.T) { } func TestLookupDotsWithRemoteSource(t *testing.T) { + if runtime.GOOS == "darwin" { + testenv.SkipFlaky(t, 27992) + } mustHaveExternalNetwork(t) if !supportsIPv4() || !*testIPv4 { From d8ce141dde36c7781a5c43356feb403550cc47ec Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Thu, 29 Nov 2018 01:38:07 -0500 Subject: [PATCH 189/594] crypto/tls: fix client certificates support for legacy servers signatureSchemesForCertificate was written to be used with TLS 1.3, but ended up used for TLS 1.2 client certificates in a refactor. Since it only supported TLS 1.3 signature algorithms, it would lead to no RSA client certificates being sent to servers that didn't support RSA-PSS. TestHandshakeClientCertRSAPKCS1v15 was testing *specifically* for this, but alas the OpenSSL flag -verify accepts an empty certificates list as valid, as opposed to -Verify... Fixes #28925 Change-Id: I61afc02ca501d3d64ab4ad77bbb4cf10931e6f93 Reviewed-on: https://go-review.googlesource.com/c/151660 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Adam Langley --- src/crypto/tls/auth.go | 27 +++- src/crypto/tls/common.go | 13 +- src/crypto/tls/handshake_client.go | 2 +- src/crypto/tls/handshake_client_test.go | 35 +++--- src/crypto/tls/handshake_client_tls13.go | 15 ++- src/crypto/tls/handshake_server_test.go | 9 +- src/crypto/tls/handshake_server_tls13.go | 9 +- .../Client-TLSv10-ClientCert-RSA-ECDSA | 116 ++++++++++++------ .../testdata/Client-TLSv10-ClientCert-RSA-RSA | 110 +++++++++++------ .../Client-TLSv12-ClientCert-RSA-RSAPKCS1v15 | 104 +++++++++++----- 10 files changed, 298 insertions(+), 142 deletions(-) diff --git a/src/crypto/tls/auth.go b/src/crypto/tls/auth.go index 859387ee14949..b277e74b53d1c 100644 --- a/src/crypto/tls/auth.go +++ b/src/crypto/tls/auth.go @@ -134,8 +134,10 @@ func writeSignedMessage(sigHash io.Writer, context string, transcript hash.Hash) } // signatureSchemesForCertificate returns the list of supported SignatureSchemes -// for a given certificate, based on the public key. -func signatureSchemesForCertificate(cert *Certificate) []SignatureScheme { +// for a given certificate, based on the public key and the protocol version. It +// does not support the crypto.Decrypter interface, so shouldn't be used on the +// server side in TLS 1.2 and earlier. +func signatureSchemesForCertificate(version uint16, cert *Certificate) []SignatureScheme { priv, ok := cert.PrivateKey.(crypto.Signer) if !ok { return nil @@ -143,6 +145,16 @@ func signatureSchemesForCertificate(cert *Certificate) []SignatureScheme { switch priv := priv.Public().(type) { case *ecdsa.PublicKey: + if version != VersionTLS13 { + // In TLS 1.2 and earlier, ECDSA algorithms are not + // constrained to a single curve. + return []SignatureScheme{ + ECDSAWithP256AndSHA256, + ECDSAWithP384AndSHA384, + ECDSAWithP521AndSHA512, + ECDSAWithSHA1, + } + } switch priv.Curve { case elliptic.P256(): return []SignatureScheme{ECDSAWithP256AndSHA256} @@ -154,6 +166,17 @@ func signatureSchemesForCertificate(cert *Certificate) []SignatureScheme { return nil } case *rsa.PublicKey: + if version != VersionTLS13 { + return []SignatureScheme{ + PSSWithSHA256, + PSSWithSHA384, + PSSWithSHA512, + PKCS1WithSHA256, + PKCS1WithSHA384, + PKCS1WithSHA512, + PKCS1WithSHA1, + } + } // RSA keys with RSA-PSS OID are not supported by crypto/x509. return []SignatureScheme{ PSSWithSHA256, diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go index 3ba3aac86bb09..b5e4ab734c1a0 100644 --- a/src/crypto/tls/common.go +++ b/src/crypto/tls/common.go @@ -291,7 +291,7 @@ type ClientSessionCache interface { type SignatureScheme uint16 const ( - PKCS1WithSHA1 SignatureScheme = 0x0201 + // RSASSA-PKCS1-v1_5 algorithms. PKCS1WithSHA256 SignatureScheme = 0x0401 PKCS1WithSHA384 SignatureScheme = 0x0501 PKCS1WithSHA512 SignatureScheme = 0x0601 @@ -301,11 +301,13 @@ const ( PSSWithSHA384 SignatureScheme = 0x0805 PSSWithSHA512 SignatureScheme = 0x0806 + // ECDSA algorithms. Only constrained to a specific curve in TLS 1.3. ECDSAWithP256AndSHA256 SignatureScheme = 0x0403 ECDSAWithP384AndSHA384 SignatureScheme = 0x0503 ECDSAWithP521AndSHA512 SignatureScheme = 0x0603 // Legacy signature and hash algorithms for TLS 1.2. + PKCS1WithSHA1 SignatureScheme = 0x0201 ECDSAWithSHA1 SignatureScheme = 0x0203 ) @@ -917,11 +919,10 @@ var writerMutex sync.Mutex // A Certificate is a chain of one or more certificates, leaf first. type Certificate struct { Certificate [][]byte - // PrivateKey contains the private key corresponding to the public key - // in Leaf. For a server, this must implement crypto.Signer and/or - // crypto.Decrypter, with an RSA or ECDSA PublicKey. For a client - // (performing client authentication), this must be a crypto.Signer - // with an RSA or ECDSA PublicKey. + // PrivateKey contains the private key corresponding to the public key in + // Leaf. This must implement crypto.Signer with an RSA or ECDSA PublicKey. + // For a server up to TLS 1.2, it can also implement crypto.Decrypter with + // an RSA PublicKey. PrivateKey crypto.PrivateKey // OCSPStaple contains an optional OCSP response which will be served // to clients that request it. diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go index d556e651a64ad..ca74989f6ed0b 100644 --- a/src/crypto/tls/handshake_client.go +++ b/src/crypto/tls/handshake_client.go @@ -934,7 +934,7 @@ func (c *Conn) getClientCertificate(cri *CertificateRequestInfo) (*Certificate, // Issuer is in AcceptableCAs. for i, chain := range c.config.Certificates { sigOK := false - for _, alg := range signatureSchemesForCertificate(&chain) { + for _, alg := range signatureSchemesForCertificate(c.vers, &chain) { if isSupportedSignatureAlgorithm(alg, cri.SignatureSchemes) { sigOK = true break diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go index 2703cc72f9840..ececd7b04d047 100644 --- a/src/crypto/tls/handshake_client_test.go +++ b/src/crypto/tls/handshake_client_test.go @@ -124,9 +124,8 @@ func (o *opensslOutputSink) Write(data []byte) (n int, err error) { return len(data), nil } -func (o *opensslOutputSink) WriteTo(w io.Writer) (int64, error) { - n, err := w.Write(o.all) - return int64(n), err +func (o *opensslOutputSink) String() string { + return string(o.all) } // clientTest represents a test of the TLS client handshake against a reference @@ -275,9 +274,9 @@ func (test *clientTest) connFromCommand() (conn *recordingConn, child *exec.Cmd, } if err != nil { close(stdin) - out.WriteTo(os.Stdout) cmd.Process.Kill() - return nil, nil, nil, nil, cmd.Wait() + err = fmt.Errorf("error connecting to the OpenSSL server: %v (%v)\n\n%s", err, cmd.Wait(), out) + return nil, nil, nil, nil, err } record := &recordingConn{ @@ -316,11 +315,20 @@ func (test *clientTest) run(t *testing.T, write bool) { t.Fatalf("Failed to start subcommand: %s", err) } clientConn = recordingConn + defer func() { + if t.Failed() { + t.Logf("OpenSSL output:\n\n%s", stdout.all) + } + }() } else { clientConn, serverConn = localPipe(t) } doneChan := make(chan bool) + defer func() { + clientConn.Close() + <-doneChan + }() go func() { defer close(doneChan) @@ -488,11 +496,10 @@ func (test *clientTest) run(t *testing.T, write bool) { childProcess.Process.Kill() childProcess.Wait() if len(recordingConn.flows) < 3 { - os.Stdout.Write(stdout.all) t.Fatalf("Client connection didn't work") } recordingConn.WriteTo(out) - fmt.Printf("Wrote %s\n", path) + t.Logf("Wrote %s\n", path) } } @@ -745,7 +752,7 @@ func TestHandshakeClientCertRSA(t *testing.T) { test := &clientTest{ name: "ClientCert-RSA-RSA", - args: []string{"-cipher", "AES128", "-verify", "1"}, + args: []string{"-cipher", "AES128", "-Verify", "1"}, config: config, } @@ -754,7 +761,7 @@ func TestHandshakeClientCertRSA(t *testing.T) { test = &clientTest{ name: "ClientCert-RSA-ECDSA", - args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, + args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA", "-Verify", "1"}, config: config, cert: testECDSACertificate, key: testECDSAPrivateKey, @@ -766,7 +773,7 @@ func TestHandshakeClientCertRSA(t *testing.T) { test = &clientTest{ name: "ClientCert-RSA-AES256-GCM-SHA384", - args: []string{"-cipher", "ECDHE-RSA-AES256-GCM-SHA384", "-verify", "1"}, + args: []string{"-cipher", "ECDHE-RSA-AES256-GCM-SHA384", "-Verify", "1"}, config: config, cert: testRSACertificate, key: testRSAPrivateKey, @@ -782,7 +789,7 @@ func TestHandshakeClientCertECDSA(t *testing.T) { test := &clientTest{ name: "ClientCert-ECDSA-RSA", - args: []string{"-cipher", "AES128", "-verify", "1"}, + args: []string{"-cipher", "AES128", "-Verify", "1"}, config: config, } @@ -792,7 +799,7 @@ func TestHandshakeClientCertECDSA(t *testing.T) { test = &clientTest{ name: "ClientCert-ECDSA-ECDSA", - args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA", "-verify", "1"}, + args: []string{"-cipher", "ECDHE-ECDSA-AES128-SHA", "-Verify", "1"}, config: config, cert: testECDSACertificate, key: testECDSAPrivateKey, @@ -822,7 +829,7 @@ func TestHandshakeClientCertRSAPSS(t *testing.T) { test := &clientTest{ name: "ClientCert-RSA-RSAPSS", - args: []string{"-cipher", "AES128", "-verify", "1", "-client_sigalgs", + args: []string{"-cipher", "AES128", "-Verify", "1", "-client_sigalgs", "rsa_pss_rsae_sha256", "-sigalgs", "rsa_pss_rsae_sha256"}, config: config, cert: testRSAPSSCertificate, @@ -840,7 +847,7 @@ func TestHandshakeClientCertRSAPKCS1v15(t *testing.T) { test := &clientTest{ name: "ClientCert-RSA-RSAPKCS1v15", - args: []string{"-cipher", "AES128", "-verify", "1", "-client_sigalgs", + args: []string{"-cipher", "AES128", "-Verify", "1", "-client_sigalgs", "rsa_pkcs1_sha256", "-sigalgs", "rsa_pkcs1_sha256"}, config: config, } diff --git a/src/crypto/tls/handshake_client_tls13.go b/src/crypto/tls/handshake_client_tls13.go index 1a819cc32f9a1..f8e90f9457196 100644 --- a/src/crypto/tls/handshake_client_tls13.go +++ b/src/crypto/tls/handshake_client_tls13.go @@ -548,7 +548,7 @@ func (hs *clientHandshakeStateTLS13) sendClientCertificate() error { return err } - // If the client is sending an empty certificate message, skip the CertificateVerify. + // If we sent an empty certificate message, skip the CertificateVerify. if len(cert.Certificate) == 0 { return nil } @@ -556,7 +556,7 @@ func (hs *clientHandshakeStateTLS13) sendClientCertificate() error { certVerifyMsg := new(certificateVerifyMsg) certVerifyMsg.hasSignatureAlgorithm = true - supportedAlgs := signatureSchemesForCertificate(cert) + supportedAlgs := signatureSchemesForCertificate(c.vers, cert) if supportedAlgs == nil { c.sendAlert(alertInternalError) return fmt.Errorf("tls: unsupported certificate key (%T)", cert.PrivateKey) @@ -569,14 +569,17 @@ func (hs *clientHandshakeStateTLS13) sendClientCertificate() error { break } } + if certVerifyMsg.signatureAlgorithm == 0 { + // getClientCertificate returned a certificate incompatible with the + // CertificateRequestInfo supported signature algorithms. + c.sendAlert(alertHandshakeFailure) + return errors.New("tls: server doesn't support selected certificate") + } sigType := signatureFromSignatureScheme(certVerifyMsg.signatureAlgorithm) sigHash, err := hashFromSignatureScheme(certVerifyMsg.signatureAlgorithm) if sigType == 0 || err != nil { - // getClientCertificate returned a certificate incompatible with the - // CertificateRequestInfo supported signature algorithms. - c.sendAlert(alertInternalError) - return err + return c.sendAlert(alertInternalError) } h := sigHash.New() writeSignedMessage(h, clientSignatureContext, hs.transcript) diff --git a/src/crypto/tls/handshake_server_test.go b/src/crypto/tls/handshake_server_test.go index 0bd0ae0b2cd09..a6240f2235fa0 100644 --- a/src/crypto/tls/handshake_server_test.go +++ b/src/crypto/tls/handshake_server_test.go @@ -608,7 +608,6 @@ func (test *serverTest) connFromCommand() (conn *recordingConn, child *exec.Cmd, } tcpConn = connOrError.(net.Conn) case <-time.After(2 * time.Second): - output.WriteTo(os.Stdout) return nil, nil, errors.New("timed out waiting for connection from child process") } @@ -646,6 +645,11 @@ func (test *serverTest) run(t *testing.T, write bool) { t.Fatalf("Failed to start subcommand: %s", err) } serverConn = recordingConn + defer func() { + if t.Failed() { + t.Logf("OpenSSL output:\n\n%s", childProcess.Stdout) + } + }() } else { clientConn, serverConn = localPipe(t) } @@ -725,13 +729,12 @@ func (test *serverTest) run(t *testing.T, write bool) { defer out.Close() recordingConn.Close() if len(recordingConn.flows) < 3 { - childProcess.Stdout.(*bytes.Buffer).WriteTo(os.Stdout) if len(test.expectHandshakeErrorIncluding) == 0 { t.Fatalf("Handshake failed") } } recordingConn.WriteTo(out) - fmt.Printf("Wrote %s\n", path) + t.Logf("Wrote %s\n", path) childProcess.Wait() } } diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go index becb4be3b009e..6f20d61aa4271 100644 --- a/src/crypto/tls/handshake_server_tls13.go +++ b/src/crypto/tls/handshake_server_tls13.go @@ -369,7 +369,7 @@ func (hs *serverHandshakeStateTLS13) pickCertificate() error { c.sendAlert(alertInternalError) return err } - supportedAlgs := signatureSchemesForCertificate(certificate) + supportedAlgs := signatureSchemesForCertificate(c.vers, certificate) if supportedAlgs == nil { c.sendAlert(alertInternalError) return fmt.Errorf("tls: unsupported certificate key (%T)", certificate.PrivateKey) @@ -383,6 +383,8 @@ func (hs *serverHandshakeStateTLS13) pickCertificate() error { } } if hs.sigAlg == 0 { + // getCertificate returned a certificate incompatible with the + // ClientHello supported signature algorithms. c.sendAlert(alertHandshakeFailure) return errors.New("tls: client doesn't support selected certificate") } @@ -623,10 +625,7 @@ func (hs *serverHandshakeStateTLS13) sendServerCertificate() error { sigType := signatureFromSignatureScheme(hs.sigAlg) sigHash, err := hashFromSignatureScheme(hs.sigAlg) if sigType == 0 || err != nil { - // getCertificate returned a certificate incompatible with the - // ClientHello supported signature algorithms. - c.sendAlert(alertInternalError) - return err + return c.sendAlert(alertInternalError) } h := sigHash.New() writeSignedMessage(h, serverSignatureContext, hs.transcript) diff --git a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA index ebfe99c2cf8d3..14ed93ca096ab 100644 --- a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA +++ b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA @@ -16,11 +16,11 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 01 00 59 02 00 00 55 03 01 24 74 3f be 60 |....Y...U..$t?.`| -00000010 1a db 62 d6 00 1d f6 32 81 97 cf 92 4a 24 e1 3a |..b....2....J$.:| -00000020 1b 9d 3c 3e e7 c3 fc ea 1c 44 a1 20 39 e7 5e 49 |..<>.....D. 9.^I| -00000030 7e 82 32 fa 18 2e e0 99 ad 9a 47 cd d1 13 b3 82 |~.2.......G.....| -00000040 c3 08 7f 50 8e fc 22 2b ca 0b 36 58 c0 09 00 00 |...P.."+..6X....| +00000000 16 03 01 00 59 02 00 00 55 03 01 04 4a 64 8e 4f |....Y...U...Jd.O| +00000010 f1 4e 06 19 e2 cb b8 92 93 7b f5 ec 1b 0e 30 8e |.N.......{....0.| +00000020 1f 89 6c a1 28 e7 87 7f 9e 9e 19 20 cf aa b7 1f |..l.(...... ....| +00000030 77 43 26 3e 15 5e 67 68 0d a6 a3 b1 25 e5 63 27 |wC&>.^gh....%.c'| +00000040 00 f9 59 23 e0 a3 1c d7 49 e9 dc b3 c0 09 00 00 |..Y#....I.......| 00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| 00000060 01 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..| 00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....| @@ -55,39 +55,79 @@ 00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....| 00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.| 00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....| -00000270 2a 16 03 01 00 b5 0c 00 00 b1 03 00 1d 20 f2 e9 |*............ ..| -00000280 14 47 0b c1 59 82 1c 18 99 70 51 34 32 b7 56 10 |.G..Y....pQ42.V.| -00000290 60 10 e4 6d ba 4a 2d 71 34 54 72 ee c3 14 00 8b |`..m.J-q4Tr.....| -000002a0 30 81 88 02 42 01 98 89 43 ea 15 40 bc d1 d0 29 |0...B...C..@...)| -000002b0 55 0d 1f 44 ba ac 9f 3a 20 4e 79 ec fa 51 fb 09 |U..D...: Ny..Q..| -000002c0 91 64 bc c8 0c 7a c0 99 be 98 b4 4c 73 10 1d e6 |.d...z.....Ls...| -000002d0 62 c8 35 cf 31 b3 f8 0a 5a 2f ca ea 9b df a0 6b |b.5.1...Z/.....k| -000002e0 c0 2c eb cd 0d 06 f1 02 42 01 f7 9a 9e d5 e9 78 |.,......B......x| -000002f0 1a c3 7f 5f da d3 7d 6f d9 ff 3d 15 46 1e 2f e2 |..._..}o..=.F./.| -00000300 11 fd c7 91 fd 08 3f 53 5f 1b 35 1a 6f 01 95 2a |......?S_.5.o..*| -00000310 91 3d 67 7a 72 52 d0 7b 83 00 f4 41 06 29 f3 cb |.=gzrR.{...A.)..| -00000320 29 22 3c 27 84 cf 90 28 bf fe b6 16 03 01 00 0a |)"<'...(........| -00000330 0d 00 00 06 03 01 02 40 00 00 16 03 01 00 04 0e |.......@........| -00000340 00 00 00 |...| +00000270 2a 16 03 01 00 b4 0c 00 00 b0 03 00 1d 20 6c 3b |*............ l;| +00000280 3f 6b 18 21 57 c4 df bf 3d ac 92 ee bc 99 0b 2f |?k.!W...=....../| +00000290 d5 b3 f5 ff 5f 6c 6b 33 db a9 7c 02 f8 4c 00 8a |...._lk3..|..L..| +000002a0 30 81 87 02 42 00 8e 15 e5 bb dc f5 3d c6 10 d7 |0...B.......=...| +000002b0 67 54 3d 80 b5 6a 4d 69 f1 2c fe 99 bc 32 e1 ab |gT=..jMi.,...2..| +000002c0 42 c0 7d f2 5d e0 d6 22 95 58 25 5e 63 ba f0 9c |B.}.]..".X%^c...| +000002d0 9f 29 91 c9 a9 42 99 ab b0 4f ed a9 42 8e 1f 3a |.)...B...O..B..:| +000002e0 44 34 48 d9 5a dd 9b 02 41 44 21 e1 54 b5 a3 e7 |D4H.Z...AD!.T...| +000002f0 0a 57 45 52 ae 9d b5 fe 45 8a 3f 8b e7 50 e8 01 |.WER....E.?..P..| +00000300 8c 26 27 85 f4 ef 80 30 7e d6 d8 27 4f d5 5e 9d |.&'....0~..'O.^.| +00000310 7b 65 1a c6 5a ab 57 17 3f 6e 5c 66 aa cd 46 bc |{e..Z.W.?n\f..F.| +00000320 5d 32 db a5 48 f8 f8 35 11 8b 16 03 01 00 0a 0d |]2..H..5........| +00000330 00 00 06 03 01 02 40 00 00 16 03 01 00 04 0e 00 |......@.........| +00000340 00 00 |..| >>> Flow 3 (client to server) -00000000 16 03 01 00 07 0b 00 00 03 00 00 00 16 03 01 00 |................| -00000010 25 10 00 00 21 20 2f e5 7d a3 47 cd 62 43 15 28 |%...! /.}.G.bC.(| -00000020 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed 90 |.._.).0.........| -00000030 99 5f 58 cb 3b 74 14 03 01 00 01 01 16 03 01 00 |._X.;t..........| -00000040 30 50 c4 b8 10 a3 18 68 5a 9e f4 9b 18 0a dc 5c |0P.....hZ......\| -00000050 c7 a6 de 40 d9 1a 9d 6a 7e 11 92 62 61 bc 16 8c |...@...j~..ba...| -00000060 6f 62 9c f9 96 e9 6b d7 35 a1 2b bb 4c cf b7 17 |ob....k.5.+.L...| -00000070 e4 |.| +00000000 16 03 01 01 fd 0b 00 01 f9 00 01 f6 00 01 f3 30 |...............0| +00000010 82 01 ef 30 82 01 58 a0 03 02 01 02 02 10 5c 19 |...0..X.......\.| +00000020 c1 89 65 83 55 6f dc 0b c9 b9 93 9f e9 bc 30 0d |..e.Uo........0.| +00000030 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 12 31 |..*.H........0.1| +00000040 10 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 |.0...U....Acme C| +00000050 6f 30 1e 17 0d 31 36 30 38 31 37 32 31 35 32 33 |o0...16081721523| +00000060 31 5a 17 0d 31 37 30 38 31 37 32 31 35 32 33 31 |1Z..170817215231| +00000070 5a 30 12 31 10 30 0e 06 03 55 04 0a 13 07 41 63 |Z0.1.0...U....Ac| +00000080 6d 65 20 43 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |me Co0..0...*.H.| +00000090 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +000000a0 81 00 ba 6f aa 86 bd cf bf 9f f2 ef 5c 94 60 78 |...o........\.`x| +000000b0 6f e8 13 f2 d1 96 6f cd d9 32 6e 22 37 ce 41 f9 |o.....o..2n"7.A.| +000000c0 ca 5d 29 ac e1 27 da 61 a2 ee 81 cb 10 c7 df 34 |.])..'.a.......4| +000000d0 58 95 86 e9 3d 19 e6 5c 27 73 60 c8 8d 78 02 f4 |X...=..\'s`..x..| +000000e0 1d a4 98 09 a3 19 70 69 3c 25 62 66 2a ab 22 23 |......pi<%bf*."#| +000000f0 c5 7b 85 38 4f 2e 09 73 32 a7 bd 3e 9b ad ca 84 |.{.8O..s2..>....| +00000100 07 e6 0f 3a ff 77 c5 9d 41 85 00 8a b6 9b ee b0 |...:.w..A.......| +00000110 a4 3f 2d 4c 4c e6 42 3e bb 51 c8 dd 48 54 f4 0c |.?-LL.B>.Q..HT..| +00000120 8e 47 02 03 01 00 01 a3 46 30 44 30 0e 06 03 55 |.G......F0D0...U| +00000130 1d 0f 01 01 ff 04 04 03 02 05 a0 30 13 06 03 55 |...........0...U| +00000140 1d 25 04 0c 30 0a 06 08 2b 06 01 05 05 07 03 01 |.%..0...+.......| +00000150 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 0f |0...U.......0.0.| +00000160 06 03 55 1d 11 04 08 30 06 87 04 7f 00 00 01 30 |..U....0.......0| +00000170 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 |...*.H..........| +00000180 81 00 46 ab 44 a2 fb 28 54 f8 5a 67 f8 62 94 f1 |..F.D..(T.Zg.b..| +00000190 9a b2 18 9e f2 b1 de 1d 7e 6f 76 95 a9 ba e7 5d |........~ov....]| +000001a0 a8 16 6c 9c f7 09 d3 37 e4 4b 2b 36 7c 01 ad 41 |..l....7.K+6|..A| +000001b0 d2 32 d8 c3 d2 93 f9 10 6b 8e 95 b9 2c 17 8a a3 |.2......k...,...| +000001c0 44 48 bc 59 13 83 16 04 88 a4 81 5c 25 0d 98 0c |DH.Y.......\%...| +000001d0 ac 11 b1 28 56 be 1d cd 61 62 84 09 bf d6 80 c6 |...(V...ab......| +000001e0 45 8d 82 2c b4 d8 83 9b db c9 22 b7 2a 12 11 7b |E..,......".*..{| +000001f0 fa 02 3b c1 c9 ff ea c9 9d a8 49 d3 95 d7 d5 0e |..;.......I.....| +00000200 e5 35 16 03 01 00 25 10 00 00 21 20 2f e5 7d a3 |.5....%...! /.}.| +00000210 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 |G.bC.(.._.).0...| +00000220 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 16 03 01 00 |......._X.;t....| +00000230 86 0f 00 00 82 00 80 9a 02 82 fb dd 68 e7 91 9f |............h...| +00000240 83 12 57 35 23 7c de 88 97 07 a3 b2 67 77 0f c1 |..W5#|......gw..| +00000250 bd 33 36 b3 ce fb f7 96 26 91 ab dc 96 26 64 fa |.36.....&....&d.| +00000260 34 66 31 2b fa 6d 52 60 3e fb a3 87 27 a7 7c ac |4f1+.mR`>...'.|.| +00000270 8c 87 ff c5 5e 6f 6f e1 db bf bc 58 3d b3 f6 89 |....^oo....X=...| +00000280 a0 8e 0b 9d 26 74 68 57 ca e9 c2 ab 79 7b 6a dd |....&thW....y{j.| +00000290 c7 89 ef 0d 62 aa 47 7b 67 18 f2 ad 00 98 56 45 |....b.G{g.....VE| +000002a0 12 ca de 6a d1 1a b5 a9 d2 53 ba 3b 90 a6 cf 69 |...j.....S.;...i| +000002b0 12 65 32 c2 95 46 01 14 03 01 00 01 01 16 03 01 |.e2..F..........| +000002c0 00 30 f7 2d b9 19 66 b2 2c 1b 96 08 bc 70 5b f5 |.0.-..f.,....p[.| +000002d0 6d 58 9e 51 fb b5 3c a6 4f 4a fc 52 1f 10 20 c4 |mX.Q..<.OJ.R.. .| +000002e0 3f d6 3c 0e 99 e3 1c b5 21 7f 0d fa 08 ec 17 27 |?.<.....!......'| +000002f0 75 9f |u.| >>> Flow 4 (server to client) -00000000 14 03 01 00 01 01 16 03 01 00 30 61 7e fa 1d 0b |..........0a~...| -00000010 62 c3 05 92 7c 80 f4 d2 b5 66 04 d7 f5 70 4c e8 |b...|....f...pL.| -00000020 8c 6b 26 cf 82 1d 9e cd b7 f0 d3 fa 64 12 13 90 |.k&.........d...| -00000030 6f 9d e9 cf 14 9f fc 6a fb a5 e7 |o......j...| +00000000 14 03 01 00 01 01 16 03 01 00 30 db ac b4 71 dc |..........0...q.| +00000010 92 06 9c fe 87 11 69 eb a6 4e e9 50 29 6d 06 37 |......i..N.P)m.7| +00000020 02 73 b8 6d 7e ca 89 02 cf fa ad 0c 7c d0 90 cb |.s.m~.......|...| +00000030 af e5 50 68 fc 76 c5 09 a1 a1 d3 |..Ph.v.....| >>> Flow 5 (client to server) -00000000 17 03 01 00 20 7d 85 95 00 0d e4 b4 e5 51 d8 62 |.... }.......Q.b| -00000010 6f 4c 4b 40 70 d0 38 d4 26 1d 66 68 48 e7 2c fb |oLK@p.8.&.fhH.,.| -00000020 5d c4 73 ec 56 17 03 01 00 20 b7 2a 4d 8f fd 23 |].s.V.... .*M..#| -00000030 ad 22 16 61 5f 87 56 4a 61 75 4d bc 8c e7 47 1d |.".a_.VJauM...G.| -00000040 a8 6c 7f 20 48 be ea 5d 14 65 15 03 01 00 20 da |.l. H..].e.... .| -00000050 4d e2 92 83 ea 81 8a c8 d1 50 8b 81 c5 d8 8c 72 |M........P.....r| -00000060 b1 27 00 5c 0f 35 69 1d 88 78 fa 1d ba 8a 5b |.'.\.5i..x....[| +00000000 17 03 01 00 20 cd b3 a4 99 da 5d 59 36 6f f8 26 |.... .....]Y6o.&| +00000010 2d b2 4a 47 a1 54 7f b0 b3 df 0d 52 cc 13 7a 8b |-.JG.T.....R..z.| +00000020 a3 6a 8b 1f ee 17 03 01 00 20 d6 ab 8a 3e b3 41 |.j....... ...>.A| +00000030 0a be 61 50 79 19 1a 45 03 c6 b9 b4 84 b2 18 46 |..aPy..E.......F| +00000040 86 1f c3 b7 78 77 fc 7f 4f 30 15 03 01 00 20 2d |....xw..O0.... -| +00000050 c0 f2 71 06 dc 19 9d 88 82 b9 3a 6b be a4 77 98 |..q.......:k..w.| +00000060 87 32 46 54 27 e4 17 47 8a 83 9c 5a 45 6e 6b |.2FT'..G...ZEnk| diff --git a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA index 1029adfff867b..c5b33c01fe54f 100644 --- a/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA +++ b/src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA @@ -16,11 +16,11 @@ 000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| 000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| >>> Flow 2 (server to client) -00000000 16 03 01 00 59 02 00 00 55 03 01 8b f2 24 20 ca |....Y...U....$ .| -00000010 0c dc 78 2d 89 f0 26 c9 f9 4d ed a7 f6 dc 52 53 |..x-..&..M....RS| -00000020 3d fd 7e bb 2a 9a 8e e3 af ed 75 20 7a 55 cc 63 |=.~.*.....u zU.c| -00000030 00 7b b0 1a 6a 29 3a 1d 69 b7 ef 29 7f 54 8f b4 |.{..j):.i..).T..| -00000040 2c 61 6b 7a 4a da 8e 73 02 04 ed be c0 13 00 00 |,akzJ..s........| +00000000 16 03 01 00 59 02 00 00 55 03 01 6b 8a f7 68 78 |....Y...U..k..hx| +00000010 f1 ea ad 9b 20 40 42 52 eb fa 55 fb 37 a7 21 22 |.... @BR..U.7.!"| +00000020 71 0d f7 4d 46 bf 38 df 6e 00 e0 20 17 73 28 32 |q..MF.8.n.. .s(2| +00000030 30 3f f4 01 df 70 98 ce 33 d0 c3 8c 0a fd 0a ba |0?...p..3.......| +00000040 6b 56 d7 f9 16 a2 24 0d 07 b1 32 47 c0 13 00 00 |kV....$...2G....| 00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| 00000060 01 02 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 |..Y...U..R..O0..| 00000070 4b 30 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d |K0..............| @@ -60,38 +60,78 @@ 00000290 77 8d 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d |w.......@.a.Lr+.| 000002a0 ae db 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db |..F..M...>...B..| 000002b0 fe 3d 13 60 84 5c 21 d3 3b e9 fa e7 16 03 01 00 |.=.`.\!.;.......| -000002c0 aa 0c 00 00 a6 03 00 1d 20 45 66 28 0d 9f 51 f3 |........ Ef(..Q.| -000002d0 a6 00 d5 86 ac c6 aa 32 2e 16 e6 ca ed d2 5b 73 |.......2......[s| -000002e0 c0 25 e9 e3 6f 30 20 0d 19 00 80 69 90 55 6d 9a |.%..o0 ....i.Um.| -000002f0 3f 74 8e c5 1b bd 78 c2 d0 b5 a2 45 27 42 15 c6 |?t....x....E'B..| -00000300 05 bc 84 f8 79 65 ee b2 e7 74 db 6a 4d d2 c4 72 |....ye...t.jM..r| -00000310 ee 6a c3 97 74 e5 51 d6 dc 6a 19 b8 19 f2 a1 0d |.j..t.Q..j......| -00000320 a6 78 59 a4 47 d5 46 8c f8 f8 cd dc 86 01 a5 24 |.xY.G.F........$| -00000330 2a cc ab d6 9d f4 58 15 52 1b 50 80 76 be 05 bc |*.....X.R.P.v...| -00000340 12 b9 a2 e3 c7 65 c6 af f0 ff a8 73 6c 29 4a aa |.....e.....sl)J.| -00000350 d6 ca ed e4 bb 50 73 82 a9 ea a8 db 4a 85 8e bf |.....Ps.....J...| -00000360 0e 51 04 9f 26 c1 18 52 58 0c 69 16 03 01 00 0a |.Q..&..RX.i.....| +000002c0 aa 0c 00 00 a6 03 00 1d 20 b1 de e2 91 3f 1f be |........ ....?..| +000002d0 0e 21 49 44 db d1 d3 a7 89 db 61 56 97 bf 4c 73 |.!ID......aV..Ls| +000002e0 7b d3 da 81 a5 cc 0a e3 13 00 80 66 fd 15 8d 8a |{..........f....| +000002f0 a2 f9 8d b9 d9 cb a5 6b 45 7c 11 05 24 6d de e5 |.......kE|..$m..| +00000300 8f 3e 42 ba 3e bd 5a b8 f7 51 c0 b9 55 06 db d7 |.>B.>.Z..Q..U...| +00000310 2d 78 d2 5d 47 2d 52 c9 7b 59 20 73 1a 1d 26 c4 |-x.]G-R.{Y s..&.| +00000320 84 3d 5b 57 5f 1a fd 52 8c 40 87 be 58 58 73 d2 |.=[W_..R.@..XXs.| +00000330 4b 84 9a 6c 96 c0 36 82 95 13 f9 12 74 c3 3b dd |K..l..6.....t.;.| +00000340 27 11 c3 66 fa de 28 b4 c0 d9 6e 65 e0 8a 5e b6 |'..f..(...ne..^.| +00000350 3a a8 52 db 62 89 2b 1d d0 be fb b7 6e 03 bd f7 |:.R.b.+.....n...| +00000360 e3 a5 df c2 b3 5a 16 09 d8 1e df 16 03 01 00 0a |.....Z..........| 00000370 0d 00 00 06 03 01 02 40 00 00 16 03 01 00 04 0e |.......@........| 00000380 00 00 00 |...| >>> Flow 3 (client to server) -00000000 16 03 01 00 07 0b 00 00 03 00 00 00 16 03 01 00 |................| -00000010 25 10 00 00 21 20 2f e5 7d a3 47 cd 62 43 15 28 |%...! /.}.G.bC.(| -00000020 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed 90 |.._.).0.........| -00000030 99 5f 58 cb 3b 74 14 03 01 00 01 01 16 03 01 00 |._X.;t..........| -00000040 30 70 37 c6 ea aa d1 67 0e ab 47 3a 9a 1a 8b fa |0p7....g..G:....| -00000050 53 27 c5 7a 01 2d ce 28 06 2e e0 c8 3b 1e 1f 93 |S'.z.-.(....;...| -00000060 19 a9 c4 cb fb 3d e8 62 21 28 3b 08 62 df 33 e5 |.....=.b!(;.b.3.| -00000070 5e |^| +00000000 16 03 01 01 fd 0b 00 01 f9 00 01 f6 00 01 f3 30 |...............0| +00000010 82 01 ef 30 82 01 58 a0 03 02 01 02 02 10 5c 19 |...0..X.......\.| +00000020 c1 89 65 83 55 6f dc 0b c9 b9 93 9f e9 bc 30 0d |..e.Uo........0.| +00000030 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 12 31 |..*.H........0.1| +00000040 10 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 |.0...U....Acme C| +00000050 6f 30 1e 17 0d 31 36 30 38 31 37 32 31 35 32 33 |o0...16081721523| +00000060 31 5a 17 0d 31 37 30 38 31 37 32 31 35 32 33 31 |1Z..170817215231| +00000070 5a 30 12 31 10 30 0e 06 03 55 04 0a 13 07 41 63 |Z0.1.0...U....Ac| +00000080 6d 65 20 43 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |me Co0..0...*.H.| +00000090 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +000000a0 81 00 ba 6f aa 86 bd cf bf 9f f2 ef 5c 94 60 78 |...o........\.`x| +000000b0 6f e8 13 f2 d1 96 6f cd d9 32 6e 22 37 ce 41 f9 |o.....o..2n"7.A.| +000000c0 ca 5d 29 ac e1 27 da 61 a2 ee 81 cb 10 c7 df 34 |.])..'.a.......4| +000000d0 58 95 86 e9 3d 19 e6 5c 27 73 60 c8 8d 78 02 f4 |X...=..\'s`..x..| +000000e0 1d a4 98 09 a3 19 70 69 3c 25 62 66 2a ab 22 23 |......pi<%bf*."#| +000000f0 c5 7b 85 38 4f 2e 09 73 32 a7 bd 3e 9b ad ca 84 |.{.8O..s2..>....| +00000100 07 e6 0f 3a ff 77 c5 9d 41 85 00 8a b6 9b ee b0 |...:.w..A.......| +00000110 a4 3f 2d 4c 4c e6 42 3e bb 51 c8 dd 48 54 f4 0c |.?-LL.B>.Q..HT..| +00000120 8e 47 02 03 01 00 01 a3 46 30 44 30 0e 06 03 55 |.G......F0D0...U| +00000130 1d 0f 01 01 ff 04 04 03 02 05 a0 30 13 06 03 55 |...........0...U| +00000140 1d 25 04 0c 30 0a 06 08 2b 06 01 05 05 07 03 01 |.%..0...+.......| +00000150 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 0f |0...U.......0.0.| +00000160 06 03 55 1d 11 04 08 30 06 87 04 7f 00 00 01 30 |..U....0.......0| +00000170 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 |...*.H..........| +00000180 81 00 46 ab 44 a2 fb 28 54 f8 5a 67 f8 62 94 f1 |..F.D..(T.Zg.b..| +00000190 9a b2 18 9e f2 b1 de 1d 7e 6f 76 95 a9 ba e7 5d |........~ov....]| +000001a0 a8 16 6c 9c f7 09 d3 37 e4 4b 2b 36 7c 01 ad 41 |..l....7.K+6|..A| +000001b0 d2 32 d8 c3 d2 93 f9 10 6b 8e 95 b9 2c 17 8a a3 |.2......k...,...| +000001c0 44 48 bc 59 13 83 16 04 88 a4 81 5c 25 0d 98 0c |DH.Y.......\%...| +000001d0 ac 11 b1 28 56 be 1d cd 61 62 84 09 bf d6 80 c6 |...(V...ab......| +000001e0 45 8d 82 2c b4 d8 83 9b db c9 22 b7 2a 12 11 7b |E..,......".*..{| +000001f0 fa 02 3b c1 c9 ff ea c9 9d a8 49 d3 95 d7 d5 0e |..;.......I.....| +00000200 e5 35 16 03 01 00 25 10 00 00 21 20 2f e5 7d a3 |.5....%...! /.}.| +00000210 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 |G.bC.(.._.).0...| +00000220 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 16 03 01 00 |......._X.;t....| +00000230 86 0f 00 00 82 00 80 9c f0 ab 90 83 2a 47 ba 5c |............*G.\| +00000240 37 a4 19 b8 62 b1 01 74 35 4d 1a 62 5e 3f 0b 54 |7...b..t5M.b^?.T| +00000250 5a 6f b7 b5 99 4b b4 84 68 90 46 2b 95 e6 10 77 |Zo...K..h.F+...w| +00000260 bf 68 81 b1 96 11 5c e9 93 a4 d5 78 42 c0 c4 92 |.h....\....xB...| +00000270 cf 4e ce 25 e7 da 7d d9 2c 4d ab 71 2d b5 a7 1c |.N.%..}.,M.q-...| +00000280 5f b5 a3 32 f6 3e 38 79 17 36 45 94 8a e3 f8 1e |_..2.>8y.6E.....| +00000290 9e 95 23 48 0f f6 aa 1b 00 d2 45 85 c7 95 b2 d1 |..#H......E.....| +000002a0 c1 81 e8 31 34 45 bd 28 32 26 a8 d1 23 90 cb 40 |...14E.(2&..#..@| +000002b0 1c ed db eb c3 ec b6 14 03 01 00 01 01 16 03 01 |................| +000002c0 00 30 16 97 3e a2 2a 11 d5 3f 29 f6 5b b8 7a d5 |.0..>.*..?).[.z.| +000002d0 83 24 51 f0 0c c3 79 18 9c 58 b6 f4 2f 70 9f c0 |.$Q...y..X../p..| +000002e0 52 be a0 f0 eb d7 0e de 42 36 14 39 84 fc 84 ed |R.......B6.9....| +000002f0 77 0c |w.| >>> Flow 4 (server to client) -00000000 14 03 01 00 01 01 16 03 01 00 30 5d 50 b8 35 7f |..........0]P.5.| -00000010 cc f0 89 20 ba 27 c1 42 74 b2 a9 42 c7 6f af c4 |... .'.Bt..B.o..| -00000020 4d 53 70 71 0c e0 d6 11 62 64 c9 a7 35 a3 58 40 |MSpq....bd..5.X@| -00000030 cd 3e b9 e3 b7 d9 0b 5a 00 a0 d9 |.>.....Z...| +00000000 14 03 01 00 01 01 16 03 01 00 30 8a 97 aa 38 29 |..........0...8)| +00000010 a4 7a 25 ae d5 5f 66 17 cb 8e de d3 ac 0f b3 9d |.z%.._f.........| +00000020 ba 61 54 31 cb c8 fc 1f 4c f5 76 b0 7e 7e 74 04 |.aT1....L.v.~~t.| +00000030 8a 2e 45 a8 5f c7 43 d7 d5 f4 7d |..E._.C...}| >>> Flow 5 (client to server) -00000000 17 03 01 00 20 8c 7a e5 0e 07 a8 ac fb 0b c9 8c |.... .z.........| -00000010 f7 d4 44 6c 8e fb 87 28 b9 80 8a 58 aa 46 b2 b8 |..Dl...(...X.F..| -00000020 50 e0 58 80 88 17 03 01 00 20 28 81 ca 46 ab 8b |P.X...... (..F..| -00000030 17 05 fa 66 52 a1 6d 12 44 8c 5a 4d bb c7 95 3b |...fR.m.D.ZM...;| -00000040 b3 03 56 a4 5d 84 ea 7a c6 24 15 03 01 00 20 8e |..V.]..z.$.... .| -00000050 1f dd 2c 71 6b ba 22 f8 5e c4 eb c8 02 a9 f1 21 |..,qk.".^......!| -00000060 a8 e7 79 af da 1f 6b dc 69 d0 6c d7 c4 cb 6e |..y...k.i.l...n| +00000000 17 03 01 00 20 22 4d 00 3f 2a 41 f0 53 06 93 fe |.... "M.?*A.S...| +00000010 aa 79 9b 69 bb d5 9b e5 e4 3b 48 ff e5 ce 7d db |.y.i.....;H...}.| +00000020 d8 e8 e6 e1 04 17 03 01 00 20 e8 01 13 cb f1 1f |......... ......| +00000030 17 68 33 6a ad 74 ae a7 c5 d9 00 ea 0b dc bb 9c |.h3j.t..........| +00000040 5c 5f 49 01 1e 53 74 30 58 e6 15 03 01 00 20 bb |\_I..St0X..... .| +00000050 30 7d c2 43 c3 0d b9 b5 3a 70 14 2c 4a 64 c9 fe |0}.C....:p.,Jd..| +00000060 20 25 a7 0a 01 11 3c 62 ca d6 28 80 ed cd 73 | %....>> Flow 2 (server to client) -00000000 16 03 03 00 59 02 00 00 55 03 03 9e c5 76 4f 86 |....Y...U....vO.| -00000010 2f ea 67 f1 bb 97 d9 ae 3c 44 fb ce 23 2d 6a 5e |/.g........B..| 000002b0 fe 3d 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 |.=.`.\!.;.......| -000002c0 ac 0c 00 00 a8 03 00 1d 20 ed b8 44 39 60 30 90 |........ ..D9`0.| -000002d0 59 2e bd 1c 2d 47 65 3d 9e 0d af c0 c3 c1 cf f6 |Y...-Ge=........| -000002e0 11 6e ca d5 3d ae a4 3a 1c 04 01 00 80 44 29 dd |.n..=..:.....D).| -000002f0 e8 ee 81 ba b0 f4 1b 4f 93 77 49 83 82 37 d7 30 |.......O.wI..7.0| -00000300 95 a4 6c c1 f0 ce 70 9d 26 9b c6 ce 67 9b ea 80 |..l...p.&...g...| -00000310 82 ea c0 a4 af 45 f7 22 a0 7f ed 32 3c 11 2a 68 |.....E."...2<.*h| -00000320 21 25 a5 41 42 bb 45 81 7c f4 a7 2c 67 3a 07 51 |!%.AB.E.|..,g:.Q| -00000330 db 2f ac 2e 61 b1 a3 e9 5e 27 8e 51 a7 78 04 ef |./..a...^'.Q.x..| -00000340 d1 b5 de 6d 83 db a8 e7 1b 5b 13 95 4d 4d 39 24 |...m.....[..MM9$| -00000350 f5 22 a8 2b 46 ca 49 b5 13 15 d2 4b be 9d d8 57 |.".+F.I....K...W| -00000360 3d 3b 84 f8 5c d1 99 f5 09 2d a1 78 e5 16 03 03 |=;..\....-.x....| +000002c0 ac 0c 00 00 a8 03 00 1d 20 41 51 d5 70 34 15 c0 |........ AQ.p4..| +000002d0 76 3e 2b 5c e2 de 36 69 a9 2e bf b8 60 b4 3a 56 |v>+\..6i....`.:V| +000002e0 00 73 c1 85 4a b2 3e a6 54 04 01 00 80 5d 44 f2 |.s..J.>.T....]D.| +000002f0 28 99 f6 4f 45 bc 83 ce f7 98 ab 29 21 05 a6 c3 |(..OE......)!...| +00000300 8c a9 ef c2 82 b5 b3 bd 31 09 ae 11 15 fa 21 02 |........1.....!.| +00000310 43 59 00 fb 53 9d 0f bb b0 ab ca ba ce e8 41 28 |CY..S.........A(| +00000320 0a 7b ff cb d4 eb 81 8a a2 ce a6 32 f8 d7 f2 a0 |.{.........2....| +00000330 3b 0d c8 fc 8d 45 a8 4c 66 ef 48 ce 4a fc d3 7a |;....E.Lf.H.J..z| +00000340 19 1d 7f bd 71 c6 61 4a 93 b9 01 c9 39 32 48 ec |....q.aJ....92H.| +00000350 fd 01 c9 32 6b 9f d1 0e c1 62 bc 78 32 34 af 7e |...2k....b.x24.~| +00000360 58 16 d0 4c c7 44 a6 3a e5 4c 89 d6 f3 16 03 03 |X..L.D.:.L......| 00000370 00 0c 0d 00 00 08 01 01 00 02 04 01 00 00 16 03 |................| 00000380 03 00 04 0e 00 00 00 |.......| >>> Flow 3 (client to server) -00000000 16 03 03 00 07 0b 00 00 03 00 00 00 16 03 03 00 |................| -00000010 25 10 00 00 21 20 2f e5 7d a3 47 cd 62 43 15 28 |%...! /.}.G.bC.(| -00000020 da ac 5f bb 29 07 30 ff f6 84 af c4 cf c2 ed 90 |.._.).0.........| -00000030 99 5f 58 cb 3b 74 14 03 03 00 01 01 16 03 03 00 |._X.;t..........| -00000040 28 00 00 00 00 00 00 00 00 cd ea 9d d6 a1 2c b6 |(.............,.| -00000050 49 43 70 2d 39 73 88 af 83 66 6e 40 45 56 5b 4d |ICp-9s...fn@EV[M| -00000060 97 23 b9 7a 89 bd 43 be f6 |.#.z..C..| +00000000 16 03 03 01 fd 0b 00 01 f9 00 01 f6 00 01 f3 30 |...............0| +00000010 82 01 ef 30 82 01 58 a0 03 02 01 02 02 10 5c 19 |...0..X.......\.| +00000020 c1 89 65 83 55 6f dc 0b c9 b9 93 9f e9 bc 30 0d |..e.Uo........0.| +00000030 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 12 31 |..*.H........0.1| +00000040 10 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 |.0...U....Acme C| +00000050 6f 30 1e 17 0d 31 36 30 38 31 37 32 31 35 32 33 |o0...16081721523| +00000060 31 5a 17 0d 31 37 30 38 31 37 32 31 35 32 33 31 |1Z..170817215231| +00000070 5a 30 12 31 10 30 0e 06 03 55 04 0a 13 07 41 63 |Z0.1.0...U....Ac| +00000080 6d 65 20 43 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |me Co0..0...*.H.| +00000090 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +000000a0 81 00 ba 6f aa 86 bd cf bf 9f f2 ef 5c 94 60 78 |...o........\.`x| +000000b0 6f e8 13 f2 d1 96 6f cd d9 32 6e 22 37 ce 41 f9 |o.....o..2n"7.A.| +000000c0 ca 5d 29 ac e1 27 da 61 a2 ee 81 cb 10 c7 df 34 |.])..'.a.......4| +000000d0 58 95 86 e9 3d 19 e6 5c 27 73 60 c8 8d 78 02 f4 |X...=..\'s`..x..| +000000e0 1d a4 98 09 a3 19 70 69 3c 25 62 66 2a ab 22 23 |......pi<%bf*."#| +000000f0 c5 7b 85 38 4f 2e 09 73 32 a7 bd 3e 9b ad ca 84 |.{.8O..s2..>....| +00000100 07 e6 0f 3a ff 77 c5 9d 41 85 00 8a b6 9b ee b0 |...:.w..A.......| +00000110 a4 3f 2d 4c 4c e6 42 3e bb 51 c8 dd 48 54 f4 0c |.?-LL.B>.Q..HT..| +00000120 8e 47 02 03 01 00 01 a3 46 30 44 30 0e 06 03 55 |.G......F0D0...U| +00000130 1d 0f 01 01 ff 04 04 03 02 05 a0 30 13 06 03 55 |...........0...U| +00000140 1d 25 04 0c 30 0a 06 08 2b 06 01 05 05 07 03 01 |.%..0...+.......| +00000150 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 0f |0...U.......0.0.| +00000160 06 03 55 1d 11 04 08 30 06 87 04 7f 00 00 01 30 |..U....0.......0| +00000170 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 |...*.H..........| +00000180 81 00 46 ab 44 a2 fb 28 54 f8 5a 67 f8 62 94 f1 |..F.D..(T.Zg.b..| +00000190 9a b2 18 9e f2 b1 de 1d 7e 6f 76 95 a9 ba e7 5d |........~ov....]| +000001a0 a8 16 6c 9c f7 09 d3 37 e4 4b 2b 36 7c 01 ad 41 |..l....7.K+6|..A| +000001b0 d2 32 d8 c3 d2 93 f9 10 6b 8e 95 b9 2c 17 8a a3 |.2......k...,...| +000001c0 44 48 bc 59 13 83 16 04 88 a4 81 5c 25 0d 98 0c |DH.Y.......\%...| +000001d0 ac 11 b1 28 56 be 1d cd 61 62 84 09 bf d6 80 c6 |...(V...ab......| +000001e0 45 8d 82 2c b4 d8 83 9b db c9 22 b7 2a 12 11 7b |E..,......".*..{| +000001f0 fa 02 3b c1 c9 ff ea c9 9d a8 49 d3 95 d7 d5 0e |..;.......I.....| +00000200 e5 35 16 03 03 00 25 10 00 00 21 20 2f e5 7d a3 |.5....%...! /.}.| +00000210 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 |G.bC.(.._.).0...| +00000220 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 16 03 03 00 |......._X.;t....| +00000230 88 0f 00 00 84 04 01 00 80 02 7e 43 b4 4e a2 07 |..........~C.N..| +00000240 a4 97 70 3f 80 91 5c b5 a0 f9 d7 c4 52 c9 ee 8a |..p?..\.....R...| +00000250 af 59 63 58 bb ac 55 47 cc 25 27 ea ca 48 0e fb |.YcX..UG.%'..H..| +00000260 87 e3 3e 5f 55 67 d8 60 8c 47 45 10 36 aa 66 6c |..>_Ug.`.GE.6.fl| +00000270 6b 16 2b 9e e5 da 50 73 dc 30 ef 2c 01 01 87 2e |k.+...Ps.0.,....| +00000280 68 eb 14 35 f5 ef c4 45 ae 8e 95 29 86 96 6e 04 |h..5...E...)..n.| +00000290 03 d6 3c 29 49 55 7c 7d ea 6c 1a a8 bf f9 5a e1 |..<)IU|}.l....Z.| +000002a0 a9 c4 66 5b 8d b5 78 b8 05 ce 44 ca 98 77 a2 7d |..f[..x...D..w.}| +000002b0 74 26 f4 ed 41 a3 97 2b 29 14 03 03 00 01 01 16 |t&..A..+).......| +000002c0 03 03 00 28 00 00 00 00 00 00 00 00 ac ec 0d 5a |...(...........Z| +000002d0 c7 81 fe c3 b3 ff 3a 6e d0 f3 f7 8e 17 6a 53 db |......:n.....jS.| +000002e0 58 5f 44 bb ce 59 0a 99 06 21 62 24 |X_D..Y...!b$| >>> Flow 4 (server to client) -00000000 14 03 03 00 01 01 16 03 03 00 28 b2 bd 08 a3 03 |..........(.....| -00000010 eb 4a e1 c2 85 4f 39 7a c6 d3 6d c4 30 27 6a 12 |.J...O9z..m.0'j.| -00000020 6e 73 5f c5 17 9d 52 a8 cb 4e d4 07 3c 8e fc 57 |ns_...R..N..<..W| -00000030 51 ad e4 |Q..| +00000000 14 03 03 00 01 01 16 03 03 00 28 59 19 13 9f ea |..........(Y....| +00000010 68 14 58 ab 09 0c af 4d b4 a1 05 09 47 08 50 cd |h.X....M....G.P.| +00000020 b0 40 a0 3a 3f 89 68 c9 9c ea 8f 69 0a ea e1 75 |.@.:?.h....i...u| +00000030 11 97 ab |...| >>> Flow 5 (client to server) -00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 e8 79 0e |..............y.| -00000010 bc 26 db 44 68 96 8d fd f4 cf c5 e7 bf 58 d1 31 |.&.Dh........X.1| -00000020 a1 d0 60 15 03 03 00 1a 00 00 00 00 00 00 00 02 |..`.............| -00000030 ae 33 9b 97 76 74 79 21 24 d2 11 a8 66 50 a8 97 |.3..vty!$...fP..| -00000040 22 fe |".| +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 38 f1 0f |.............8..| +00000010 d6 4f 5c 0a 60 1a 9f 97 6d 4a 43 e8 c8 a8 18 7e |.O\.`...mJC....~| +00000020 30 6f 67 15 03 03 00 1a 00 00 00 00 00 00 00 02 |0og.............| +00000030 d9 ac f7 69 ca a2 58 78 10 c2 eb 1a 61 da af 28 |...i..Xx....a..(| +00000040 20 02 | .| From 950100a95c700fb60cafc51276786dd93f85d6c9 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Thu, 29 Nov 2018 02:30:26 -0500 Subject: [PATCH 190/594] crypto/tls: improve error message for unsupported certificates in TLS 1.3 Fixes #28960 Change-Id: I0d049d4776dc42ef165a1da15f63de08677fbb85 Reviewed-on: https://go-review.googlesource.com/c/151661 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Adam Langley --- src/crypto/tls/auth.go | 36 ++++++++++++++++++++++-- src/crypto/tls/handshake_client_tls13.go | 3 +- src/crypto/tls/handshake_server_tls13.go | 3 +- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/crypto/tls/auth.go b/src/crypto/tls/auth.go index b277e74b53d1c..6fe97185050d6 100644 --- a/src/crypto/tls/auth.go +++ b/src/crypto/tls/auth.go @@ -143,7 +143,7 @@ func signatureSchemesForCertificate(version uint16, cert *Certificate) []Signatu return nil } - switch priv := priv.Public().(type) { + switch pub := priv.Public().(type) { case *ecdsa.PublicKey: if version != VersionTLS13 { // In TLS 1.2 and earlier, ECDSA algorithms are not @@ -155,7 +155,7 @@ func signatureSchemesForCertificate(version uint16, cert *Certificate) []Signatu ECDSAWithSHA1, } } - switch priv.Curve { + switch pub.Curve { case elliptic.P256(): return []SignatureScheme{ECDSAWithP256AndSHA256} case elliptic.P384(): @@ -187,3 +187,35 @@ func signatureSchemesForCertificate(version uint16, cert *Certificate) []Signatu return nil } } + +// unsupportedCertificateError returns a helpful error for certificates with +// an unsupported private key. +func unsupportedCertificateError(cert *Certificate) error { + switch cert.PrivateKey.(type) { + case rsa.PrivateKey, ecdsa.PrivateKey: + return fmt.Errorf("tls: unsupported certificate: private key is %T, expected *%T", + cert.PrivateKey, cert.PrivateKey) + } + + signer, ok := cert.PrivateKey.(crypto.Signer) + if !ok { + return fmt.Errorf("tls: certificate private key (%T) does not implement crypto.Signer", + cert.PrivateKey) + } + + switch pub := signer.Public().(type) { + case *ecdsa.PublicKey: + switch pub.Curve { + case elliptic.P256(): + case elliptic.P384(): + case elliptic.P521(): + default: + return fmt.Errorf("tls: unsupported certificate curve (%s)", pub.Curve.Params().Name) + } + case *rsa.PublicKey: + default: + return fmt.Errorf("tls: unsupported certificate key (%T)", pub) + } + + return fmt.Errorf("tls: internal error: unsupported key (%T)", cert.PrivateKey) +} diff --git a/src/crypto/tls/handshake_client_tls13.go b/src/crypto/tls/handshake_client_tls13.go index f8e90f9457196..85715b721c0dd 100644 --- a/src/crypto/tls/handshake_client_tls13.go +++ b/src/crypto/tls/handshake_client_tls13.go @@ -10,7 +10,6 @@ import ( "crypto/hmac" "crypto/rsa" "errors" - "fmt" "hash" "sync/atomic" "time" @@ -559,7 +558,7 @@ func (hs *clientHandshakeStateTLS13) sendClientCertificate() error { supportedAlgs := signatureSchemesForCertificate(c.vers, cert) if supportedAlgs == nil { c.sendAlert(alertInternalError) - return fmt.Errorf("tls: unsupported certificate key (%T)", cert.PrivateKey) + return unsupportedCertificateError(cert) } // Pick signature scheme in server preference order, as the client // preference order is not configurable. diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go index 6f20d61aa4271..fa76f7ca06567 100644 --- a/src/crypto/tls/handshake_server_tls13.go +++ b/src/crypto/tls/handshake_server_tls13.go @@ -10,7 +10,6 @@ import ( "crypto/hmac" "crypto/rsa" "errors" - "fmt" "hash" "io" "sync/atomic" @@ -372,7 +371,7 @@ func (hs *serverHandshakeStateTLS13) pickCertificate() error { supportedAlgs := signatureSchemesForCertificate(c.vers, certificate) if supportedAlgs == nil { c.sendAlert(alertInternalError) - return fmt.Errorf("tls: unsupported certificate key (%T)", certificate.PrivateKey) + return unsupportedCertificateError(certificate) } // Pick signature scheme in client preference order, as the server // preference order is not configurable. From 13aa235ae0b441989f6ac3cb5ea953836dcdfdde Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Fri, 30 Nov 2018 09:50:05 -0500 Subject: [PATCH 191/594] go/internal/gccgoimporter: fix bug reading V1 export data Fix a bug in the reading of elderly export data. In such export data when reading type information it's possible to encounter a named type N1 defined as a typedef of some other named type N2 at a point when the underying type of N1 has not yet been finalized. Handle this case by generating a fixup, then process fixups at the end of parsing to set the correct underlying type. Fixes #29006. Change-Id: I6a505c897bd95eb161ee04637bb6eebad9f20d52 Reviewed-on: https://go-review.googlesource.com/c/151997 Run-TryBot: Than McIntosh Reviewed-by: Robert Griesemer TryBot-Result: Gobot Gobot --- .../internal/gccgoimporter/importer_test.go | 1 + src/go/internal/gccgoimporter/parser.go | 38 +++++++++++++++++- .../gccgoimporter/testdata/v1reflect.gox | Bin 0 -> 10872 bytes 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/go/internal/gccgoimporter/testdata/v1reflect.gox diff --git a/src/go/internal/gccgoimporter/importer_test.go b/src/go/internal/gccgoimporter/importer_test.go index 96505b2bab62b..30b51db9d4d0a 100644 --- a/src/go/internal/gccgoimporter/importer_test.go +++ b/src/go/internal/gccgoimporter/importer_test.go @@ -86,6 +86,7 @@ var importerTests = [...]importerTest{ {pkgpath: "aliases", name: "C0", want: "type C0 struct{f1 C1; f2 C1}"}, {pkgpath: "escapeinfo", name: "NewT", want: "func NewT(data []byte) *T"}, {pkgpath: "issue27856", name: "M", want: "type M struct{E F}"}, + {pkgpath: "v1reflect", name: "Type", want: "type Type interface{Align() int; AssignableTo(u Type) bool; Bits() int; ChanDir() ChanDir; Elem() Type; Field(i int) StructField; FieldAlign() int; FieldByIndex(index []int) StructField; FieldByName(name string) (StructField, bool); FieldByNameFunc(match func(string) bool) (StructField, bool); Implements(u Type) bool; In(i int) Type; IsVariadic() bool; Key() Type; Kind() Kind; Len() int; Method(int) Method; MethodByName(string) (Method, bool); Name() string; NumField() int; NumIn() int; NumMethod() int; NumOut() int; Out(i int) Type; PkgPath() string; Size() uintptr; String() string; common() *commonType; rawString() string; runtimeType() *runtimeType; uncommon() *uncommonType}"}, } func TestGoxImporter(t *testing.T) { diff --git a/src/go/internal/gccgoimporter/parser.go b/src/go/internal/gccgoimporter/parser.go index e75f15c429f4d..7d075db4cef62 100644 --- a/src/go/internal/gccgoimporter/parser.go +++ b/src/go/internal/gccgoimporter/parser.go @@ -29,9 +29,30 @@ type parser struct { imports map[string]*types.Package // package path -> package object typeList []types.Type // type number -> type typeData []string // unparsed type data (v3 and later) + fixups []fixupRecord // fixups to apply at end of parsing initdata InitData // package init priority data } +// When reading V1 export data it's possible to encounter a defined +// type N1 with an underlying defined type N2 while we are still +// reading in that defined type N2; see issue #29006 for an instance +// of this. Example: +// +// type N1 N2 +// type N2 struct { +// ... +// p *N1 +// } +// +// To handle such cases, the parser generates a fixup record (below) and +// delays setting of N1's underlying type until parsing is complete, at +// which point fixups are applied. + +type fixupRecord struct { + toUpdate *types.Named // type to modify when fixup is processed + target types.Type // type that was incomplete when fixup was created +} + func (p *parser) init(filename string, src io.Reader, imports map[string]*types.Package) { p.scanner = new(scanner.Scanner) p.initScanner(filename, src) @@ -504,7 +525,15 @@ func (p *parser) parseNamedType(nlist []int) types.Type { underlying := p.parseType(pkg) if nt.Underlying() == nil { - nt.SetUnderlying(underlying.Underlying()) + if underlying.Underlying() == nil { + if p.version != "v1" { + p.errorf("internal error: unexpected fixup required for %v", nt) + } + fix := fixupRecord{toUpdate: nt, target: underlying} + p.fixups = append(p.fixups, fix) + } else { + nt.SetUnderlying(underlying.Underlying()) + } } if p.tok == '\n' { @@ -1175,6 +1204,13 @@ func (p *parser) parsePackage() *types.Package { for p.tok != scanner.EOF { p.parseDirective() } + for _, f := range p.fixups { + if f.target.Underlying() == nil { + p.errorf("internal error: fixup can't be applied, loop required") + } + f.toUpdate.SetUnderlying(f.target.Underlying()) + } + p.fixups = nil for _, typ := range p.typeList { if it, ok := typ.(*types.Interface); ok { it.Complete() diff --git a/src/go/internal/gccgoimporter/testdata/v1reflect.gox b/src/go/internal/gccgoimporter/testdata/v1reflect.gox new file mode 100644 index 0000000000000000000000000000000000000000..ea468414d9fa8ad66e978799a8ff5d2f90eb4961 GIT binary patch literal 10872 zcmb^%U2o&KF?-iOG*9hwUkIZpoI?^sl4Zxp)kVIx4es^>P3|6A6br2*Cqit=mE>&P z!=itnKcx@-iJc)i=IOMCfv1OMQa`eRGAqigUW@2#KU*w|vK9+Okbipk zw`Tz5DzCEzP}9$z{$Vkyx||mIv!G{B|6myFd@3sZ)5E_Ou*$1smJ0posV9Q-tR`{k zd3>xzjjXU{EHLtE@fd{U(oX{k&-Q04km-E6O!Iruuf(_YdYOtq^nOg{tF))zLtNQv zT8p2=vDWD^AZlnNzERT#qG!O^SnVJUpXH>_lYJqBtzYZqhbC}>a56ct zWXVpVe_&82XYJ`Q=e;(9!9*+hQQx9bcffli?Irq|=6w_dz^K0nRvTe5OJ~z5(hwAt7gqiI#k6iCLuP4dFWQfGaE%r<6vd-$&c|J zCQdUeJQY10A&VS=Ly@~Yk)}^!jb38=!0~3WoTrO4uPf1C(G1iI*$va_c~wDHPCm}l zyJ7>{MTS)DR8-UDW0GHGr5z5(qNfL~)Pa$jszNy4D0TH?QfA40HnoJ00u=QcR%6FP zRH}5FrdzA!MJJ*Ms(}h8kw~B@uu1649UEBQC6uZoNGys2j1hf|RWeh}P+`e`N^8-7 zO4mmJ+!nAJwAs7atO7K$5W3S%exJVRktnj67JU`K=XsH@7sZN_vCrqlxmz)j(nd2J}pW|^=hHrr8SPkTZ8XbU@mu54rRtVm_yYHBu^XRs;QJI z(NKtnRNX?T3@jh0`fXW7BSM7A#PHe`B!c!t@yB8#ixLXk4 zh{m63wa@}J(r(*JY;6HADJWy1cLH~3VavL_EAAdM^577YOS`m2rab_?u*zB&uA5m9ax-H(k}vtF(3n^rGoB=c-nv z1kCTzObfvnQf{w-U+SRGiRbRlyB7IrHSyyU0 zXXy8hLO0F4e!=4}nAhJ8-zrJYaO&@~UJ-UX#@yMbqGX$uLBw|b5=Q;-2ueNKg;P4e zzh^rK<|iEKqA2FpH)Ln)qjj;aQ?@%9@a8r==@8&D$z2&b$phvsw(d6X!*0YU$7M1H zaWgt#8pJknLaR>G2mG|8Q@Hv3cAmk0nUNd$$(=gGUcrpnrc%O%It@_ah)MGhHt6KH zV}~3G9kU{U+YbNomt095Hocq|6>gdRBnsTKzHl-uR=8`prLcq7hC;Y$hPMpHfmMv$ zdXZ{2Q|c&!ra|{9Qi|QRiHgIG1#dIqd677d%(?-tT-q^epTOmAS?x{E>B6y$Z(R^b zfR~o?AZU9yIk@KNDvq4fq|YoPx=YZEu97;j{uD!Q2n8Kh;!&($)SK#UwoB^4{%xMI zOxT%4y4!9pc6Xn^vEC$0Z6bS|u+>B`33?TlCu281c}?bT(>FTVwrzm35SfYS?5@=+ zZsW75SK@5mJ%iKDi%*x7Ug$jKD8Lgm#irA8H2bxR9y|AB_qj4Y%*?^=6Mx7svdqjK z#MM_A*5}d7y~h1ZI(i3xj$~rO zGm$q6c$)zC=XLr*yD`;h-dFSo5sE!#ILra*}%o4()44=3b>82Q~PtPC1j@*@5Eq4A*y zu~zQKDa!9Y*bUoO0+`Aqfw$?WZJGjX-w4lsVZDuSc;C{y9zV?FTPIc0DS0PGoYt ziNyAR-eH;I(wJN(6#OW{h{wNa(aXoc;}WRrQ~30yAp-k)Wvd7-OZ=S4Sv1BoV<}I+ z`FjWgvv;X|=@562q2JByl_TVW%!Kw&uu?KNGng!@oV~3d2x_Du%y7z-2yEmb_zH+a z8<_|`1>#UQ7h!#|bm4f_(FlAyWWchzQ-{Un4l&g+wV+G0*I}$bCA%)m!h9+<9NLR@ zy=x?2!JB%y{WVPZ{T_WbGBo9XD6fMhb-s&HSL7;SVb{G%CC2|Vk1(n~KbJ@%j_)+P z8S)*Ih5wqCm=1W3=Qz{Hbox}S7UJq^Gzw2fko>f|Fl>ry=*>DNQ?0nU}-e3(AL^gi9MGQB9y;BVoLf5(a6Z-)9? zPDCWwZ{YXWIH3Q{0O$Ag0#Cxj=T~g}-+(9J{TF&1pTCCxzk>gq-hTj(XaLCk{vXU8 BTEYMT literal 0 HcmV?d00001 From 3ce9e5a10e19055610d82e87c3fef44d71f1afc5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 30 Nov 2018 12:26:10 -0800 Subject: [PATCH 192/594] go/internal/gccgoimporter: fix test when using gccgo 4.7 TestInstallationImporter checks that it can read the export data for a list of known standard library packages. It was failing on the SmartOS builder which has GCC 4.7 installed. Skip packages that did not exist in GCC 4.7. Most packages are still there and the missing packages are fairly simple, so this doesn't really affect test quality. Updates #29006 Change-Id: If7ae6f83d51d40168a9692acb0b99c9bf21f2a4d Reviewed-on: https://go-review.googlesource.com/c/152077 Run-TryBot: Ian Lance Taylor Reviewed-by: Than McIntosh TryBot-Result: Gobot Gobot --- .../gccgoimporter/gccgoinstallation_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/go/internal/gccgoimporter/gccgoinstallation_test.go b/src/go/internal/gccgoimporter/gccgoinstallation_test.go index 732159ca63200..b332babc7b685 100644 --- a/src/go/internal/gccgoimporter/gccgoinstallation_test.go +++ b/src/go/internal/gccgoimporter/gccgoinstallation_test.go @@ -9,6 +9,11 @@ import ( "testing" ) +// importablePackages is a list of packages that we verify that we can +// import. This should be all standard library packages in all relevant +// versions of gccgo. Note that since gccgo follows a different release +// cycle, and since different systems have different versions installed, +// we can't use the last-two-versions rule of the gc toolchain. var importablePackages = [...]string{ "archive/tar", "archive/zip", @@ -55,7 +60,7 @@ var importablePackages = [...]string{ "encoding/binary", "encoding/csv", "encoding/gob", - "encoding", + // "encoding", // Added in GCC 4.9. "encoding/hex", "encoding/json", "encoding/pem", @@ -67,7 +72,7 @@ var importablePackages = [...]string{ "go/ast", "go/build", "go/doc", - "go/format", + // "go/format", // Added in GCC 4.8. "go/parser", "go/printer", "go/scanner", @@ -80,7 +85,7 @@ var importablePackages = [...]string{ "html", "html/template", "image/color", - "image/color/palette", + // "image/color/palette", // Added in GCC 4.9. "image/draw", "image/gif", "image", @@ -99,7 +104,7 @@ var importablePackages = [...]string{ "mime/multipart", "net", "net/http/cgi", - "net/http/cookiejar", + // "net/http/cookiejar", // Added in GCC 4.8. "net/http/fcgi", "net/http", "net/http/httptest", From 8476fd7b2c5c048c2dd46fe63c5aff966506ab87 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 30 Nov 2018 12:44:34 -0800 Subject: [PATCH 193/594] go/internal/gccgoimporter: fix test when using gccgo before GCC 7 In TestObjImporter skip tests that use type aliases when using a version of gccgo before GCC 7, since that is when type aliases were added. Fixes #29006 Change-Id: I676bae9f023931cf95ac9b4d4de893fe8517af9b Reviewed-on: https://go-review.googlesource.com/c/152078 Reviewed-by: Than McIntosh --- .../internal/gccgoimporter/importer_test.go | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/go/internal/gccgoimporter/importer_test.go b/src/go/internal/gccgoimporter/importer_test.go index 30b51db9d4d0a..9725fd429fb1d 100644 --- a/src/go/internal/gccgoimporter/importer_test.go +++ b/src/go/internal/gccgoimporter/importer_test.go @@ -11,6 +11,8 @@ import ( "os" "os/exec" "path/filepath" + "regexp" + "strconv" "testing" ) @@ -120,6 +122,25 @@ func TestObjImporter(t *testing.T) { t.Skip("This test needs gccgo") } + verout, err := exec.Command(gpath, "--version").CombinedOutput() + if err != nil { + t.Logf("%s", verout) + t.Fatal(err) + } + vers := regexp.MustCompile(`([0-9]+)\.([0-9]+)`).FindSubmatch(verout) + if len(vers) == 0 { + t.Fatalf("could not find version number in %s", verout) + } + major, err := strconv.Atoi(string(vers[1])) + if err != nil { + t.Fatal(err) + } + minor, err := strconv.Atoi(string(vers[2])) + if err != nil { + t.Fatal(err) + } + t.Logf("gccgo version %d.%d", major, minor) + tmpdir, err := ioutil.TempDir("", "") if err != nil { t.Fatal(err) @@ -135,6 +156,14 @@ func TestObjImporter(t *testing.T) { arimp := GetImporter([]string{artmpdir}, arinitmap) for _, test := range importerTests { + // Support for type aliases was added in GCC 7. + if test.pkgpath == "aliases" || test.pkgpath == "issue27856" { + if major < 7 { + t.Logf("skipping %q: not supported before gccgo version 7", test.pkgpath) + continue + } + } + gofile := filepath.Join("testdata", test.pkgpath+".go") if _, err := os.Stat(gofile); os.IsNotExist(err) { continue From d029058b5912312963225c40ae4bf44e3cb4be76 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Wed, 28 Nov 2018 18:52:35 +0000 Subject: [PATCH 194/594] runtime: fix heap pointer invariant rules in HACKING.md This change fixes an error in HACKING.md which claims all pointers which live in unmanaged memory but point to the heap must be marked as GC roots explicitly by runtime.markroot. This isn't technically necessary if the pointer is accessible through a global variable. Change-Id: I632b25272fdb2f789c5259dd1685d517f45fd435 Reviewed-on: https://go-review.googlesource.com/c/151539 Reviewed-by: Rick Hudson --- src/runtime/HACKING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/HACKING.md b/src/runtime/HACKING.md index 72ba61970bd67..993edc67d886b 100644 --- a/src/runtime/HACKING.md +++ b/src/runtime/HACKING.md @@ -205,8 +205,10 @@ marked `//go:notinheap` (see below). Objects that are allocated in unmanaged memory **must not** contain heap pointers unless the following rules are also obeyed: -1. Any pointers from unmanaged memory to the heap must be added as - explicit garbage collection roots in `runtime.markroot`. +1. Any pointers from unmanaged memory to the heap must be garbage + collection roots. More specifically, any pointer must either be + accessible through a global variable or be added as an explicit + garbage collection root in `runtime.markroot`. 2. If the memory is reused, the heap pointers must be zero-initialized before they become visible as GC roots. Otherwise, the GC may From a37d95c74a68da299073ff5a5bb077aa60aeab39 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 28 Nov 2018 14:34:45 -0800 Subject: [PATCH 195/594] cmd/compile: fix constant index bounds check and error message While here, rename nonnegintconst to indexconst (because that's what it is) and add Fatalf calls where we are not expecting the indexconst call to fail, and fixed wrong comparison in smallintconst. Fixes #23781. Change-Id: I86eb13081c450943b1806dfe3ae368872f76639a Reviewed-on: https://go-review.googlesource.com/c/151599 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/gc/const.go | 22 +++++++++++++--------- src/cmd/compile/internal/gc/sinit.go | 17 +++++++++++++---- src/cmd/compile/internal/gc/typecheck.go | 14 ++++++++++---- src/cmd/compile/internal/gc/walk.go | 6 +++++- test/fixedbugs/issue23781.go | 10 ++++++++++ 5 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 test/fixedbugs/issue23781.go diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index c01820506deb6..3a9080e67d874 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -1229,6 +1229,7 @@ func strlit(n *Node) string { return n.Val().U.(string) } +// TODO(gri) smallintconst is only used in one place - can we used indexconst? func smallintconst(n *Node) bool { if n.Op == OLITERAL && Isconst(n, CTINT) && n.Type != nil { switch simtype[n.Type.Etype] { @@ -1243,7 +1244,7 @@ func smallintconst(n *Node) bool { case TIDEAL, TINT64, TUINT64, TPTR: v, ok := n.Val().U.(*Mpint) - if ok && v.Cmp(minintval[TINT32]) > 0 && v.Cmp(maxintval[TINT32]) < 0 { + if ok && v.Cmp(minintval[TINT32]) >= 0 && v.Cmp(maxintval[TINT32]) <= 0 { return true } } @@ -1252,21 +1253,24 @@ func smallintconst(n *Node) bool { return false } -// nonnegintconst checks if Node n contains a constant expression -// representable as a non-negative small integer, and returns its -// (integer) value if that's the case. Otherwise, it returns -1. -func nonnegintconst(n *Node) int64 { +// indexconst checks if Node n contains a constant expression +// representable as a non-negative int and returns its value. +// If n is not a constant expression, not representable as an +// integer, or negative, it returns -1. If n is too large, it +// returns -2. +func indexconst(n *Node) int64 { if n.Op != OLITERAL { return -1 } - // toint will leave n.Val unchanged if it's not castable to an - // Mpint, so we still have to guard the conversion. - v := toint(n.Val()) + v := toint(n.Val()) // toint returns argument unchanged if not representable as an *Mpint vi, ok := v.U.(*Mpint) - if !ok || vi.CmpInt64(0) < 0 || vi.Cmp(maxintval[TINT32]) > 0 { + if !ok || vi.CmpInt64(0) < 0 { return -1 } + if vi.Cmp(maxintval[TINT]) > 0 { + return -2 + } return vi.Int64() } diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index acd8550ee3608..56c63065b222a 100644 --- a/src/cmd/compile/internal/gc/sinit.go +++ b/src/cmd/compile/internal/gc/sinit.go @@ -711,7 +711,10 @@ func fixedlit(ctxt initContext, kind initKind, n *Node, var_ *Node, init *Nodes) var k int64 splitnode = func(r *Node) (*Node, *Node) { if r.Op == OKEY { - k = nonnegintconst(r.Left) + k = indexconst(r.Left) + if k < 0 { + Fatalf("fixedlit: invalid index %v", r.Left) + } r = r.Right } a := nod(OINDEX, var_, nodintconst(k)) @@ -893,7 +896,10 @@ func slicelit(ctxt initContext, n *Node, var_ *Node, init *Nodes) { var index int64 for _, value := range n.List.Slice() { if value.Op == OKEY { - index = nonnegintconst(value.Left) + index = indexconst(value.Left) + if index < 0 { + Fatalf("slicelit: invalid index %v", value.Left) + } value = value.Right } a := nod(OINDEX, vauto, nodintconst(index)) @@ -1250,7 +1256,10 @@ func initplan(n *Node) { var k int64 for _, a := range n.List.Slice() { if a.Op == OKEY { - k = nonnegintconst(a.Left) + k = indexconst(a.Left) + if k < 0 { + Fatalf("initplan arraylit: invalid index %v", a.Left) + } a = a.Right } addvalue(p, k*n.Type.Elem().Width, a) @@ -1260,7 +1269,7 @@ func initplan(n *Node) { case OSTRUCTLIT: for _, a := range n.List.Slice() { if a.Op != OSTRUCTKEY { - Fatalf("initplan fixedlit") + Fatalf("initplan structlit") } addvalue(p, a.Xoffset, a.Left) } diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index cbca68541577e..633c5e5061a5a 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -3073,10 +3073,16 @@ func typecheckcomplit(n *Node) (res *Node) { if l.Op == OKEY { l.Left = typecheck(l.Left, ctxExpr) evconst(l.Left) - i = nonnegintconst(l.Left) - if i < 0 && !l.Left.Diag() { - yyerror("index must be non-negative integer constant") - l.Left.SetDiag(true) + i = indexconst(l.Left) + if i < 0 { + if !l.Left.Diag() { + if i == -2 { + yyerror("index too large") + } else { + yyerror("index must be non-negative integer constant") + } + l.Left.SetDiag(true) + } i = -(1 << 30) // stay negative for a while } vp = &l.Right diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index e3fd71e389938..528aacb213c4b 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -1305,7 +1305,11 @@ opswitch: } // var arr [r]T // n = arr[:l] - t = types.NewArray(t.Elem(), nonnegintconst(r)) // [r]T + i := indexconst(r) + if i < 0 { + Fatalf("walkexpr: invalid index %v", r) + } + t = types.NewArray(t.Elem(), i) // [r]T var_ := temp(t) a := nod(OAS, var_, nil) // zero temp a = typecheck(a, ctxStmt) diff --git a/test/fixedbugs/issue23781.go b/test/fixedbugs/issue23781.go new file mode 100644 index 0000000000000..5c03cf7e4ef53 --- /dev/null +++ b/test/fixedbugs/issue23781.go @@ -0,0 +1,10 @@ +// +build amd64 +// compile + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +var _ = []int{1 << 31: 1} // ok on machines with 64bit int From e985ba80233ea5d222548f0a85370e98aaf8fa5d Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 30 Nov 2018 12:25:18 +0100 Subject: [PATCH 196/594] syscall: avoid "64"-postfixed libSystem syscalls on iOS The stat(2) man page contain this comment about the 64-bit versions of the system file functions: "Platforms that were released after these updates only have the newer variants available to them. These platforms have the macro _DARWIN_FEATURE_ONLY_64_BIT_INODE defined." It turns out that on iOS the _DARWIN_FEATURE_ONLY_64_BIT_INODE is defined and that even though the "64"-postfixed versions are accessible they are deemed private. Apps that refer to private API are not admissible on App Store, and after the Go runtime started using libSystem instead of direct syscalls, the App Store submission checks reject apps built with Go tip. The fix is simple: use the non-postfixed versions on iOS. getdirentries(2) is not changed; it is not available at all on iOS and needs replacement. Updates #28984 Change-Id: Icb8d44e271456acaa1913ba486fcf5b569722fa9 Reviewed-on: https://go-review.googlesource.com/c/151938 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/syscall/syscall_darwin.go | 6 - src/syscall/syscall_darwin_386.go | 6 + src/syscall/syscall_darwin_amd64.go | 6 + src/syscall/syscall_darwin_arm.go | 6 + src/syscall/syscall_darwin_arm64.go | 6 + src/syscall/zsyscall_darwin_386.go | 188 +++++++++++++-------------- src/syscall/zsyscall_darwin_386.s | 24 ++-- src/syscall/zsyscall_darwin_amd64.go | 188 +++++++++++++-------------- src/syscall/zsyscall_darwin_amd64.s | 24 ++-- src/syscall/zsyscall_darwin_arm.go | 188 +++++++++++++-------------- src/syscall/zsyscall_darwin_arm.s | 24 ++-- src/syscall/zsyscall_darwin_arm64.go | 188 +++++++++++++-------------- src/syscall/zsyscall_darwin_arm64.s | 24 ++-- 13 files changed, 448 insertions(+), 430 deletions(-) diff --git a/src/syscall/syscall_darwin.go b/src/syscall/syscall_darwin.go index 28cf05e0f778b..ee79fb3fb3f6f 100644 --- a/src/syscall/syscall_darwin.go +++ b/src/syscall/syscall_darwin.go @@ -267,8 +267,6 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1) //sys Fchown(fd int, uid int, gid int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) -//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64 -//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64 //sys Fsync(fd int) (err error) // Fsync is not called for os.File.Sync(). Please see internal/poll/fd_fsync_darwin.go //sys Ftruncate(fd int, length int64) (err error) @@ -291,7 +289,6 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) //sys Listen(s int, backlog int) (err error) -//sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64 //sys Mkdir(path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) @@ -324,8 +321,6 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1) //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) -//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64 -//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_statfs64 //sys Symlink(path string, link string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) @@ -346,7 +341,6 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1) //sys fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (val int, err error) = SYS_fcntl //sys unlinkat(fd int, path string, flags int) (err error) //sys openat(fd int, path string, flags int, perm uint32) (fdret int, err error) -//sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_fstatat64 func init() { execveDarwin = execve diff --git a/src/syscall/syscall_darwin_386.go b/src/syscall/syscall_darwin_386.go index 56f65e4af4fef..a8926c022a57d 100644 --- a/src/syscall/syscall_darwin_386.go +++ b/src/syscall/syscall_darwin_386.go @@ -14,7 +14,13 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } +//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64 +//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64 //sysnb Gettimeofday(tp *Timeval) (err error) +//sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64 +//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64 +//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_statfs64 +//sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_fstatat64 func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) diff --git a/src/syscall/syscall_darwin_amd64.go b/src/syscall/syscall_darwin_amd64.go index 8d7c23bb28bf0..bc3acf8d7589f 100644 --- a/src/syscall/syscall_darwin_amd64.go +++ b/src/syscall/syscall_darwin_amd64.go @@ -14,7 +14,13 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: sec, Usec: int32(usec)} } +//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64 +//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64 //sysnb Gettimeofday(tp *Timeval) (err error) +//sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64 +//sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64 +//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_statfs64 +//sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_fstatat64 func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) diff --git a/src/syscall/syscall_darwin_arm.go b/src/syscall/syscall_darwin_arm.go index b81464ae3cdc6..19c9827c093ac 100644 --- a/src/syscall/syscall_darwin_arm.go +++ b/src/syscall/syscall_darwin_arm.go @@ -14,7 +14,13 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } +//sys Fstat(fd int, stat *Stat_t) (err error) +//sys Fstatfs(fd int, stat *Statfs_t) (err error) //sysnb Gettimeofday(tp *Timeval) (err error) +//sys Lstat(path string, stat *Stat_t) (err error) +//sys Stat(path string, stat *Stat_t) (err error) +//sys Statfs(path string, stat *Statfs_t) (err error) +//sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) diff --git a/src/syscall/syscall_darwin_arm64.go b/src/syscall/syscall_darwin_arm64.go index 47298844ad2a7..95eb9465b9bd6 100644 --- a/src/syscall/syscall_darwin_arm64.go +++ b/src/syscall/syscall_darwin_arm64.go @@ -14,7 +14,13 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int64(sec), Usec: int32(usec)} } +//sys Fstat(fd int, stat *Stat_t) (err error) +//sys Fstatfs(fd int, stat *Statfs_t) (err error) //sysnb Gettimeofday(tp *Timeval) (err error) +//sys Lstat(path string, stat *Stat_t) (err error) +//sys Stat(path string, stat *Stat_t) (err error) +//sys Statfs(path string, stat *Statfs_t) (err error) +//sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) diff --git a/src/syscall/zsyscall_darwin_386.go b/src/syscall/zsyscall_darwin_386.go index 6ae6e86a50a01..ed80764398d56 100644 --- a/src/syscall/zsyscall_darwin_386.go +++ b/src/syscall/zsyscall_darwin_386.go @@ -651,34 +651,6 @@ func libc_fpathconf_trampoline() //go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstat64_trampoline() - -//go:linkname libc_fstat64 libc_fstat64 -//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstatfs64_trampoline() - -//go:linkname libc_fstatfs64 libc_fstatfs64 -//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fsync(fd int) (err error) { _, _, e1 := syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { @@ -981,25 +953,6 @@ func libc_listen_trampoline() //go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_lstat64_trampoline() - -//go:linkname libc_lstat64 libc_lstat64 -//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1553,44 +1506,6 @@ func libc_setuid_trampoline() //go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_stat64_trampoline() - -//go:linkname libc_stat64 libc_stat64 -//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_statfs64_trampoline() - -//go:linkname libc_statfs64 libc_statfs64 -//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1925,23 +1840,32 @@ func libc_openat_trampoline() //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) } - _, _, e1 := syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + return +} + +func libc_fstat64_trampoline() + +//go:linkname libc_fstat64 libc_fstat64 +//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } -func libc_fstatat64_trampoline() +func libc_fstatfs64_trampoline() -//go:linkname libc_fstatat64 libc_fstatat64 -//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" +//go:linkname libc_fstatfs64 libc_fstatfs64 +//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tp *Timeval) (err error) { @@ -1956,3 +1880,79 @@ func libc_gettimeofday_trampoline() //go:linkname libc_gettimeofday libc_gettimeofday //go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat64_trampoline() + +//go:linkname libc_lstat64 libc_lstat64 +//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat64_trampoline() + +//go:linkname libc_stat64 libc_stat64 +//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs64_trampoline() + +//go:linkname libc_statfs64 libc_statfs64 +//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat64_trampoline() + +//go:linkname libc_fstatat64 libc_fstatat64 +//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" diff --git a/src/syscall/zsyscall_darwin_386.s b/src/syscall/zsyscall_darwin_386.s index bfb3037a6a14d..2d09f0a883200 100644 --- a/src/syscall/zsyscall_darwin_386.s +++ b/src/syscall/zsyscall_darwin_386.s @@ -91,10 +91,6 @@ TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 JMP libc_flock(SB) TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) -TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstat64(SB) -TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 @@ -137,8 +133,6 @@ TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 JMP libc_link(SB) TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 JMP libc_listen(SB) -TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_lstat64(SB) TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 @@ -203,10 +197,6 @@ TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) -TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_stat64(SB) -TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_statfs64(SB) TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 @@ -243,7 +233,17 @@ TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 JMP libc_openat(SB) -TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) +TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat64(SB) +TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs64(SB) TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) +TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat64(SB) +TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat64(SB) +TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs64(SB) +TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat64(SB) diff --git a/src/syscall/zsyscall_darwin_amd64.go b/src/syscall/zsyscall_darwin_amd64.go index 6d8442dc836ba..d6676391a2269 100644 --- a/src/syscall/zsyscall_darwin_amd64.go +++ b/src/syscall/zsyscall_darwin_amd64.go @@ -651,34 +651,6 @@ func libc_fpathconf_trampoline() //go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstat64_trampoline() - -//go:linkname libc_fstat64 libc_fstat64 -//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstatfs64_trampoline() - -//go:linkname libc_fstatfs64 libc_fstatfs64 -//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fsync(fd int) (err error) { _, _, e1 := syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { @@ -981,25 +953,6 @@ func libc_listen_trampoline() //go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_lstat64_trampoline() - -//go:linkname libc_lstat64 libc_lstat64 -//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1553,44 +1506,6 @@ func libc_setuid_trampoline() //go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_stat64_trampoline() - -//go:linkname libc_stat64 libc_stat64 -//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_statfs64_trampoline() - -//go:linkname libc_statfs64 libc_statfs64 -//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1925,23 +1840,32 @@ func libc_openat_trampoline() //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) } - _, _, e1 := syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + return +} + +func libc_fstat64_trampoline() + +//go:linkname libc_fstat64 libc_fstat64 +//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } -func libc_fstatat64_trampoline() +func libc_fstatfs64_trampoline() -//go:linkname libc_fstatat64 libc_fstatat64 -//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" +//go:linkname libc_fstatfs64 libc_fstatfs64 +//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tp *Timeval) (err error) { @@ -1956,3 +1880,79 @@ func libc_gettimeofday_trampoline() //go:linkname libc_gettimeofday libc_gettimeofday //go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat64_trampoline() + +//go:linkname libc_lstat64 libc_lstat64 +//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat64_trampoline() + +//go:linkname libc_stat64 libc_stat64 +//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs64_trampoline() + +//go:linkname libc_statfs64 libc_statfs64 +//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat64_trampoline() + +//go:linkname libc_fstatat64 libc_fstatat64 +//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" diff --git a/src/syscall/zsyscall_darwin_amd64.s b/src/syscall/zsyscall_darwin_amd64.s index 6253d2801bc4c..3648a50b3bc5c 100644 --- a/src/syscall/zsyscall_darwin_amd64.s +++ b/src/syscall/zsyscall_darwin_amd64.s @@ -91,10 +91,6 @@ TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 JMP libc_flock(SB) TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) -TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstat64(SB) -TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 @@ -137,8 +133,6 @@ TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 JMP libc_link(SB) TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 JMP libc_listen(SB) -TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_lstat64(SB) TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 @@ -203,10 +197,6 @@ TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) -TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_stat64(SB) -TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_statfs64(SB) TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 @@ -243,7 +233,17 @@ TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 JMP libc_openat(SB) -TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) +TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat64(SB) +TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs64(SB) TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) +TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat64(SB) +TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat64(SB) +TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs64(SB) +TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat64(SB) diff --git a/src/syscall/zsyscall_darwin_arm.go b/src/syscall/zsyscall_darwin_arm.go index be695abff39f4..82e0f043d3a4d 100644 --- a/src/syscall/zsyscall_darwin_arm.go +++ b/src/syscall/zsyscall_darwin_arm.go @@ -651,34 +651,6 @@ func libc_fpathconf_trampoline() //go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstat64_trampoline() - -//go:linkname libc_fstat64 libc_fstat64 -//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstatfs64_trampoline() - -//go:linkname libc_fstatfs64 libc_fstatfs64 -//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fsync(fd int) (err error) { _, _, e1 := syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { @@ -981,25 +953,6 @@ func libc_listen_trampoline() //go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_lstat64_trampoline() - -//go:linkname libc_lstat64 libc_lstat64 -//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1553,44 +1506,6 @@ func libc_setuid_trampoline() //go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_stat64_trampoline() - -//go:linkname libc_stat64 libc_stat64 -//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_statfs64_trampoline() - -//go:linkname libc_statfs64 libc_statfs64 -//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1925,23 +1840,32 @@ func libc_openat_trampoline() //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) } - _, _, e1 := syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + return +} + +func libc_fstat_trampoline() + +//go:linkname libc_fstat libc_fstat +//go:cgo_import_dynamic libc_fstat fstat "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstatfs_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } -func libc_fstatat64_trampoline() +func libc_fstatfs_trampoline() -//go:linkname libc_fstatat64 libc_fstatat64 -//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" +//go:linkname libc_fstatfs libc_fstatfs +//go:cgo_import_dynamic libc_fstatfs fstatfs "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tp *Timeval) (err error) { @@ -1956,3 +1880,79 @@ func libc_gettimeofday_trampoline() //go:linkname libc_gettimeofday libc_gettimeofday //go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_lstat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat_trampoline() + +//go:linkname libc_lstat libc_lstat +//go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_stat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat_trampoline() + +//go:linkname libc_stat libc_stat +//go:cgo_import_dynamic libc_stat stat "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_statfs_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs_trampoline() + +//go:linkname libc_statfs libc_statfs +//go:cgo_import_dynamic libc_statfs statfs "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall6(funcPC(libc_fstatat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat_trampoline() + +//go:linkname libc_fstatat libc_fstatat +//go:cgo_import_dynamic libc_fstatat fstatat "/usr/lib/libSystem.B.dylib" diff --git a/src/syscall/zsyscall_darwin_arm.s b/src/syscall/zsyscall_darwin_arm.s index 8fe7d12e561c7..9a3bdbeeba492 100644 --- a/src/syscall/zsyscall_darwin_arm.s +++ b/src/syscall/zsyscall_darwin_arm.s @@ -91,10 +91,6 @@ TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 JMP libc_flock(SB) TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) -TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstat64(SB) -TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 @@ -137,8 +133,6 @@ TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 JMP libc_link(SB) TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 JMP libc_listen(SB) -TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_lstat64(SB) TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 @@ -203,10 +197,6 @@ TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) -TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_stat64(SB) -TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_statfs64(SB) TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 @@ -243,7 +233,17 @@ TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 JMP libc_openat(SB) -TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) +TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat(SB) +TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs(SB) TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) +TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat(SB) +TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat(SB) +TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs(SB) +TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat(SB) diff --git a/src/syscall/zsyscall_darwin_arm64.go b/src/syscall/zsyscall_darwin_arm64.go index 726f63d17050c..50f5fc9f3182e 100644 --- a/src/syscall/zsyscall_darwin_arm64.go +++ b/src/syscall/zsyscall_darwin_arm64.go @@ -651,34 +651,6 @@ func libc_fpathconf_trampoline() //go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstat64_trampoline() - -//go:linkname libc_fstat64 libc_fstat64 -//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fstatfs64_trampoline() - -//go:linkname libc_fstatfs64 libc_fstatfs64 -//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fsync(fd int) (err error) { _, _, e1 := syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { @@ -981,25 +953,6 @@ func libc_listen_trampoline() //go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_lstat64_trampoline() - -//go:linkname libc_lstat64 libc_lstat64 -//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1553,44 +1506,6 @@ func libc_setuid_trampoline() //go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_stat64_trampoline() - -//go:linkname libc_stat64 libc_stat64 -//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_statfs64_trampoline() - -//go:linkname libc_statfs64 libc_statfs64 -//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1925,23 +1840,32 @@ func libc_openat_trampoline() //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) } - _, _, e1 := syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + return +} + +func libc_fstat_trampoline() + +//go:linkname libc_fstat libc_fstat +//go:cgo_import_dynamic libc_fstat fstat "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall(funcPC(libc_fstatfs_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } -func libc_fstatat64_trampoline() +func libc_fstatfs_trampoline() -//go:linkname libc_fstatat64 libc_fstatat64 -//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" +//go:linkname libc_fstatfs libc_fstatfs +//go:cgo_import_dynamic libc_fstatfs fstatfs "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tp *Timeval) (err error) { @@ -1956,3 +1880,79 @@ func libc_gettimeofday_trampoline() //go:linkname libc_gettimeofday libc_gettimeofday //go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_lstat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat_trampoline() + +//go:linkname libc_lstat libc_lstat +//go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_stat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat_trampoline() + +//go:linkname libc_stat libc_stat +//go:cgo_import_dynamic libc_stat stat "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall(funcPC(libc_statfs_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs_trampoline() + +//go:linkname libc_statfs libc_statfs +//go:cgo_import_dynamic libc_statfs statfs "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall6(funcPC(libc_fstatat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat_trampoline() + +//go:linkname libc_fstatat libc_fstatat +//go:cgo_import_dynamic libc_fstatat fstatat "/usr/lib/libSystem.B.dylib" diff --git a/src/syscall/zsyscall_darwin_arm64.s b/src/syscall/zsyscall_darwin_arm64.s index 98d0bdc3a8fbe..35316d27f69ec 100644 --- a/src/syscall/zsyscall_darwin_arm64.s +++ b/src/syscall/zsyscall_darwin_arm64.s @@ -91,10 +91,6 @@ TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 JMP libc_flock(SB) TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 JMP libc_fpathconf(SB) -TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstat64(SB) -TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatfs64(SB) TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 @@ -137,8 +133,6 @@ TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 JMP libc_link(SB) TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 JMP libc_listen(SB) -TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_lstat64(SB) TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 JMP libc_mkdir(SB) TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 @@ -203,10 +197,6 @@ TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_settimeofday(SB) TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 JMP libc_setuid(SB) -TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_stat64(SB) -TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_statfs64(SB) TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 JMP libc_symlink(SB) TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 @@ -243,7 +233,17 @@ TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 JMP libc_openat(SB) -TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fstatat64(SB) +TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat(SB) +TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs(SB) TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) +TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat(SB) +TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat(SB) +TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs(SB) +TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat(SB) From 6d6c8582dfffeec70d743bb9b03b5e3cc1b0a35e Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 1 Dec 2018 00:21:29 +0000 Subject: [PATCH 197/594] net/http: update bundled x/net/http2 This updates x/net/http2 to x/net git rev 351d144f for: http2: revert Transport's strict interpretation of MAX_CONCURRENT_STREAMS https://golang.org/cl/151857 http2: don't leak streams on broken body https://golang.org/cl/132715 http2: remove support for Go 1.8 and earlier https://golang.org/cl/145677 http2: reduce init-time work & allocations https://golang.org/cl/127664 And some CLs fixing typos. Fixes #27044 Fixes #27208 Change-Id: I11cc32576c690199ceb4c0bd1448d01e3cab3097 Reviewed-on: https://go-review.googlesource.com/c/152080 Run-TryBot: Brad Fitzpatrick Reviewed-by: Emmanuel Odeke --- src/net/http/h2_bundle.go | 522 +++++++++++++++++--------------------- 1 file changed, 228 insertions(+), 294 deletions(-) diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 1a97b01db8d94..77ab0343f4222 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -954,75 +954,6 @@ func (p http2noDialClientConnPool) GetClientConn(req *Request, addr string) (*ht return p.getClientConn(req, addr, http2noDialOnMiss) } -func http2configureTransport(t1 *Transport) (*http2Transport, error) { - connPool := new(http2clientConnPool) - t2 := &http2Transport{ - ConnPool: http2noDialClientConnPool{connPool}, - t1: t1, - } - connPool.t = t2 - if err := http2registerHTTPSProtocol(t1, http2noDialH2RoundTripper{t2}); err != nil { - return nil, err - } - if t1.TLSClientConfig == nil { - t1.TLSClientConfig = new(tls.Config) - } - if !http2strSliceContains(t1.TLSClientConfig.NextProtos, "h2") { - t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...) - } - if !http2strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") { - t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1") - } - upgradeFn := func(authority string, c *tls.Conn) RoundTripper { - addr := http2authorityAddr("https", authority) - if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil { - go c.Close() - return http2erringRoundTripper{err} - } else if !used { - // Turns out we don't need this c. - // For example, two goroutines made requests to the same host - // at the same time, both kicking off TCP dials. (since protocol - // was unknown) - go c.Close() - } - return t2 - } - if m := t1.TLSNextProto; len(m) == 0 { - t1.TLSNextProto = map[string]func(string, *tls.Conn) RoundTripper{ - "h2": upgradeFn, - } - } else { - m["h2"] = upgradeFn - } - return t2, nil -} - -// registerHTTPSProtocol calls Transport.RegisterProtocol but -// converting panics into errors. -func http2registerHTTPSProtocol(t *Transport, rt http2noDialH2RoundTripper) (err error) { - defer func() { - if e := recover(); e != nil { - err = fmt.Errorf("%v", e) - } - }() - t.RegisterProtocol("https", rt) - return nil -} - -// noDialH2RoundTripper is a RoundTripper which only tries to complete the request -// if there's already has a cached connection to the host. -// (The field is exported so it can be accessed via reflect from net/http; tested -// by TestNoDialH2RoundTripperType) -type http2noDialH2RoundTripper struct{ *http2Transport } - -func (rt http2noDialH2RoundTripper) RoundTrip(req *Request) (*Response, error) { - res, err := rt.http2Transport.RoundTrip(req) - if http2isNoCachedConnError(err) { - return nil, ErrSkipAltProtocol - } - return res, err -} - // Buffer chunks are allocated from a pool to reduce pressure on GC. // The maximum wasted space per dataBuffer is 2x the largest size class, // which happens when the dataBuffer has multiple chunks and there is @@ -2788,7 +2719,7 @@ func (fr *http2Framer) maxHeaderStringLen() int { } // readMetaFrame returns 0 or more CONTINUATION frames from fr and -// merge them into into the provided hf and returns a MetaHeadersFrame +// merge them into the provided hf and returns a MetaHeadersFrame // with the decoded hpack values. func (fr *http2Framer) readMetaFrame(hf *http2HeadersFrame) (*http2MetaHeadersFrame, error) { if fr.AllowIllegalReads { @@ -2924,181 +2855,23 @@ func http2summarizeFrame(f http2Frame) string { return buf.String() } -func http2traceHasWroteHeaderField(trace *http2clientTrace) bool { +func http2traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool { return trace != nil && trace.WroteHeaderField != nil } -func http2traceWroteHeaderField(trace *http2clientTrace, k, v string) { +func http2traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) { if trace != nil && trace.WroteHeaderField != nil { trace.WroteHeaderField(k, []string{v}) } } -func http2traceGot1xxResponseFunc(trace *http2clientTrace) func(int, textproto.MIMEHeader) error { +func http2traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error { if trace != nil { return trace.Got1xxResponse } return nil } -func http2transportExpectContinueTimeout(t1 *Transport) time.Duration { - return t1.ExpectContinueTimeout -} - -type http2contextContext interface { - context.Context -} - -var http2errCanceled = context.Canceled - -func http2serverConnBaseContext(c net.Conn, opts *http2ServeConnOpts) (ctx http2contextContext, cancel func()) { - ctx, cancel = context.WithCancel(context.Background()) - ctx = context.WithValue(ctx, LocalAddrContextKey, c.LocalAddr()) - if hs := opts.baseConfig(); hs != nil { - ctx = context.WithValue(ctx, ServerContextKey, hs) - } - return -} - -func http2contextWithCancel(ctx http2contextContext) (_ http2contextContext, cancel func()) { - return context.WithCancel(ctx) -} - -func http2requestWithContext(req *Request, ctx http2contextContext) *Request { - return req.WithContext(ctx) -} - -type http2clientTrace httptrace.ClientTrace - -func http2reqContext(r *Request) context.Context { return r.Context() } - -func (t *http2Transport) idleConnTimeout() time.Duration { - if t.t1 != nil { - return t.t1.IdleConnTimeout - } - return 0 -} - -func http2setResponseUncompressed(res *Response) { res.Uncompressed = true } - -func http2traceGetConn(req *Request, hostPort string) { - trace := httptrace.ContextClientTrace(req.Context()) - if trace == nil || trace.GetConn == nil { - return - } - trace.GetConn(hostPort) -} - -func http2traceGotConn(req *Request, cc *http2ClientConn) { - trace := httptrace.ContextClientTrace(req.Context()) - if trace == nil || trace.GotConn == nil { - return - } - ci := httptrace.GotConnInfo{Conn: cc.tconn} - cc.mu.Lock() - ci.Reused = cc.nextStreamID > 1 - ci.WasIdle = len(cc.streams) == 0 && ci.Reused - if ci.WasIdle && !cc.lastActive.IsZero() { - ci.IdleTime = time.Now().Sub(cc.lastActive) - } - cc.mu.Unlock() - - trace.GotConn(ci) -} - -func http2traceWroteHeaders(trace *http2clientTrace) { - if trace != nil && trace.WroteHeaders != nil { - trace.WroteHeaders() - } -} - -func http2traceGot100Continue(trace *http2clientTrace) { - if trace != nil && trace.Got100Continue != nil { - trace.Got100Continue() - } -} - -func http2traceWait100Continue(trace *http2clientTrace) { - if trace != nil && trace.Wait100Continue != nil { - trace.Wait100Continue() - } -} - -func http2traceWroteRequest(trace *http2clientTrace, err error) { - if trace != nil && trace.WroteRequest != nil { - trace.WroteRequest(httptrace.WroteRequestInfo{Err: err}) - } -} - -func http2traceFirstResponseByte(trace *http2clientTrace) { - if trace != nil && trace.GotFirstResponseByte != nil { - trace.GotFirstResponseByte() - } -} - -func http2requestTrace(req *Request) *http2clientTrace { - trace := httptrace.ContextClientTrace(req.Context()) - return (*http2clientTrace)(trace) -} - -// Ping sends a PING frame to the server and waits for the ack. -func (cc *http2ClientConn) Ping(ctx context.Context) error { - return cc.ping(ctx) -} - -// Shutdown gracefully closes the client connection, waiting for running streams to complete. -func (cc *http2ClientConn) Shutdown(ctx context.Context) error { - return cc.shutdown(ctx) -} - -func http2cloneTLSConfig(c *tls.Config) *tls.Config { - c2 := c.Clone() - c2.GetClientCertificate = c.GetClientCertificate // golang.org/issue/19264 - return c2 -} - -var _ Pusher = (*http2responseWriter)(nil) - -// Push implements http.Pusher. -func (w *http2responseWriter) Push(target string, opts *PushOptions) error { - internalOpts := http2pushOptions{} - if opts != nil { - internalOpts.Method = opts.Method - internalOpts.Header = opts.Header - } - return w.push(target, internalOpts) -} - -func http2configureServer18(h1 *Server, h2 *http2Server) error { - if h2.IdleTimeout == 0 { - if h1.IdleTimeout != 0 { - h2.IdleTimeout = h1.IdleTimeout - } else { - h2.IdleTimeout = h1.ReadTimeout - } - } - return nil -} - -func http2shouldLogPanic(panicValue interface{}) bool { - return panicValue != nil && panicValue != ErrAbortHandler -} - -func http2reqGetBody(req *Request) func() (io.ReadCloser, error) { - return req.GetBody -} - -func http2reqBodyIsNoBody(body io.ReadCloser) bool { - return body == NoBody -} - -func http2go18httpNoBody() io.ReadCloser { return NoBody } // for tests only - -func http2configureServer19(s *Server, conf *http2Server) error { - s.RegisterOnShutdown(conf.state.startGracefulShutdown) - return nil -} - var http2DebugGoroutines = os.Getenv("DEBUG_HTTP2_GOROUTINES") == "1" type http2goroutineLock uint64 @@ -3252,12 +3025,17 @@ func http2cutoff64(base int) uint64 { } var ( - http2commonLowerHeader = map[string]string{} // Go-Canonical-Case -> lower-case - http2commonCanonHeader = map[string]string{} // lower-case -> Go-Canonical-Case + http2commonBuildOnce sync.Once + http2commonLowerHeader map[string]string // Go-Canonical-Case -> lower-case + http2commonCanonHeader map[string]string // lower-case -> Go-Canonical-Case ) -func init() { - for _, v := range []string{ +func http2buildCommonHeaderMapsOnce() { + http2commonBuildOnce.Do(http2buildCommonHeaderMaps) +} + +func http2buildCommonHeaderMaps() { + common := []string{ "accept", "accept-charset", "accept-encoding", @@ -3305,7 +3083,10 @@ func init() { "vary", "via", "www-authenticate", - } { + } + http2commonLowerHeader = make(map[string]string, len(common)) + http2commonCanonHeader = make(map[string]string, len(common)) + for _, v := range common { chk := CanonicalHeaderKey(v) http2commonLowerHeader[chk] = v http2commonCanonHeader[v] = chk @@ -3313,6 +3094,7 @@ func init() { } func http2lowerHeader(v string) string { + http2buildCommonHeaderMapsOnce() if s, ok := http2commonLowerHeader[v]; ok { return s } @@ -3488,19 +3270,12 @@ func http2validWireHeaderFieldName(v string) bool { return true } -var http2httpCodeStringCommon = map[int]string{} // n -> strconv.Itoa(n) - -func init() { - for i := 100; i <= 999; i++ { - if v := StatusText(i); v != "" { - http2httpCodeStringCommon[i] = strconv.Itoa(i) - } - } -} - func http2httpCodeString(code int) string { - if s, ok := http2httpCodeStringCommon[code]; ok { - return s + switch code { + case 200: + return "200" + case 404: + return "404" } return strconv.Itoa(code) } @@ -3993,12 +3768,14 @@ func http2ConfigureServer(s *Server, conf *http2Server) error { conf = new(http2Server) } conf.state = &http2serverInternalState{activeConns: make(map[*http2serverConn]struct{})} - if err := http2configureServer18(s, conf); err != nil { - return err - } - if err := http2configureServer19(s, conf); err != nil { - return err + if h1, h2 := s, conf; h2.IdleTimeout == 0 { + if h1.IdleTimeout != 0 { + h2.IdleTimeout = h1.IdleTimeout + } else { + h2.IdleTimeout = h1.ReadTimeout + } } + s.RegisterOnShutdown(conf.state.startGracefulShutdown) if s.TLSConfig == nil { s.TLSConfig = new(tls.Config) @@ -4219,6 +3996,15 @@ func (s *http2Server) ServeConn(c net.Conn, opts *http2ServeConnOpts) { sc.serve() } +func http2serverConnBaseContext(c net.Conn, opts *http2ServeConnOpts) (ctx context.Context, cancel func()) { + ctx, cancel = context.WithCancel(context.Background()) + ctx = context.WithValue(ctx, LocalAddrContextKey, c.LocalAddr()) + if hs := opts.baseConfig(); hs != nil { + ctx = context.WithValue(ctx, ServerContextKey, hs) + } + return +} + func (sc *http2serverConn) rejectConn(err http2ErrCode, debug string) { sc.vlogf("http2: server rejecting conn: %v, %s", err, debug) // ignoring errors. hanging up anyway. @@ -4234,7 +4020,7 @@ type http2serverConn struct { conn net.Conn bw *http2bufferedWriter // writing to conn handler Handler - baseCtx http2contextContext + baseCtx context.Context framer *http2Framer doneServing chan struct{} // closed when serverConn.serve ends readFrameCh chan http2readFrameResult // written by serverConn.readFrames @@ -4314,7 +4100,7 @@ type http2stream struct { id uint32 body *http2pipe // non-nil if expecting DATA frames cw http2closeWaiter // closed wait stream transitions to closed state - ctx http2contextContext + ctx context.Context cancelCtx func() // owned by serverConn's serve loop: @@ -4450,6 +4236,7 @@ func (sc *http2serverConn) condlogf(err error, format string, args ...interface{ func (sc *http2serverConn) canonicalHeader(v string) string { sc.serveG.check() + http2buildCommonHeaderMapsOnce() cv, ok := http2commonCanonHeader[v] if ok { return cv @@ -4898,7 +4685,7 @@ func (sc *http2serverConn) startFrameWrite(wr http2FrameWriteRequest) { // errHandlerPanicked is the error given to any callers blocked in a read from // Request.Body when the main goroutine panics. Since most handlers read in the -// the main ServeHTTP goroutine, this will show up rarely. +// main ServeHTTP goroutine, this will show up rarely. var http2errHandlerPanicked = errors.New("http2: handler panicked") // wroteFrame is called on the serve goroutine with the result of @@ -5670,7 +5457,7 @@ func (sc *http2serverConn) newStream(id, pusherID uint32, state http2streamState panic("internal error: cannot create stream with id 0") } - ctx, cancelCtx := http2contextWithCancel(sc.baseCtx) + ctx, cancelCtx := context.WithCancel(sc.baseCtx) st := &http2stream{ sc: sc, id: id, @@ -5836,7 +5623,7 @@ func (sc *http2serverConn) newWriterAndRequestNoBody(st *http2stream, rp http2re Body: body, Trailer: trailer, } - req = http2requestWithContext(req, st.ctx) + req = req.WithContext(st.ctx) rws := http2responseWriterStatePool.Get().(*http2responseWriterState) bwSave := rws.bw @@ -5864,7 +5651,7 @@ func (sc *http2serverConn) runHandler(rw *http2responseWriter, req *Request, han stream: rw.rws.stream, }) // Same as net/http: - if http2shouldLogPanic(e) { + if e != nil && e != ErrAbortHandler { const size = 64 << 10 buf := make([]byte, size) buf = buf[:runtime.Stack(buf, false)] @@ -6426,14 +6213,9 @@ var ( http2ErrPushLimitReached = errors.New("http2: push would exceed peer's SETTINGS_MAX_CONCURRENT_STREAMS") ) -// pushOptions is the internal version of http.PushOptions, which we -// cannot include here because it's only defined in Go 1.8 and later. -type http2pushOptions struct { - Method string - Header Header -} +var _ Pusher = (*http2responseWriter)(nil) -func (w *http2responseWriter) push(target string, opts http2pushOptions) error { +func (w *http2responseWriter) Push(target string, opts *PushOptions) error { st := w.rws.stream sc := st.sc sc.serveG.checkNotOn() @@ -6444,6 +6226,10 @@ func (w *http2responseWriter) push(target string, opts http2pushOptions) error { return http2ErrRecursivePush } + if opts == nil { + opts = new(PushOptions) + } + // Default options. if opts.Method == "" { opts.Method = "GET" @@ -6739,6 +6525,16 @@ type http2Transport struct { // to mean no limit. MaxHeaderListSize uint32 + // StrictMaxConcurrentStreams controls whether the server's + // SETTINGS_MAX_CONCURRENT_STREAMS should be respected + // globally. If false, new TCP connections are created to the + // server as needed to keep each under the per-connection + // SETTINGS_MAX_CONCURRENT_STREAMS limit. If true, the + // server's SETTINGS_MAX_CONCURRENT_STREAMS is interpreted as + // a global limit and callers of RoundTrip block when needed, + // waiting for their turn. + StrictMaxConcurrentStreams bool + // t1, if non-nil, is the standard library Transport using // this transport. Its settings are used (but not its // RoundTrip method, etc). @@ -6762,16 +6558,56 @@ func (t *http2Transport) disableCompression() bool { return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression) } -var http2errTransportVersion = errors.New("http2: ConfigureTransport is only supported starting at Go 1.6") - // ConfigureTransport configures a net/http HTTP/1 Transport to use HTTP/2. -// It requires Go 1.6 or later and returns an error if the net/http package is too old -// or if t1 has already been HTTP/2-enabled. +// It returns an error if t1 has already been HTTP/2-enabled. func http2ConfigureTransport(t1 *Transport) error { - _, err := http2configureTransport(t1) // in configure_transport.go (go1.6) or not_go16.go + _, err := http2configureTransport(t1) return err } +func http2configureTransport(t1 *Transport) (*http2Transport, error) { + connPool := new(http2clientConnPool) + t2 := &http2Transport{ + ConnPool: http2noDialClientConnPool{connPool}, + t1: t1, + } + connPool.t = t2 + if err := http2registerHTTPSProtocol(t1, http2noDialH2RoundTripper{t2}); err != nil { + return nil, err + } + if t1.TLSClientConfig == nil { + t1.TLSClientConfig = new(tls.Config) + } + if !http2strSliceContains(t1.TLSClientConfig.NextProtos, "h2") { + t1.TLSClientConfig.NextProtos = append([]string{"h2"}, t1.TLSClientConfig.NextProtos...) + } + if !http2strSliceContains(t1.TLSClientConfig.NextProtos, "http/1.1") { + t1.TLSClientConfig.NextProtos = append(t1.TLSClientConfig.NextProtos, "http/1.1") + } + upgradeFn := func(authority string, c *tls.Conn) RoundTripper { + addr := http2authorityAddr("https", authority) + if used, err := connPool.addConnIfNeeded(addr, t2, c); err != nil { + go c.Close() + return http2erringRoundTripper{err} + } else if !used { + // Turns out we don't need this c. + // For example, two goroutines made requests to the same host + // at the same time, both kicking off TCP dials. (since protocol + // was unknown) + go c.Close() + } + return t2 + } + if m := t1.TLSNextProto; len(m) == 0 { + t1.TLSNextProto = map[string]func(string, *tls.Conn) RoundTripper{ + "h2": upgradeFn, + } + } else { + m["h2"] = upgradeFn + } + return t2, nil +} + func (t *http2Transport) connPool() http2ClientConnPool { t.connPoolOnce.Do(t.initConnPool) return t.connPoolOrDef @@ -6836,7 +6672,7 @@ type http2ClientConn struct { type http2clientStream struct { cc *http2ClientConn req *Request - trace *http2clientTrace // or nil + trace *httptrace.ClientTrace // or nil ID uint32 resc chan http2resAndError bufPipe http2pipe // buffered pipe with the flow-controlled response payload @@ -6870,7 +6706,7 @@ type http2clientStream struct { // channel to be signaled. A non-nil error is returned only if the request was // canceled. func http2awaitRequestCancel(req *Request, done <-chan struct{}) error { - ctx := http2reqContext(req) + ctx := req.Context() if req.Cancel == nil && ctx.Done() == nil { return nil } @@ -7046,8 +6882,8 @@ func (t *http2Transport) RoundTripOpt(req *Request, opt http2RoundTripOpt) (*Res select { case <-time.After(time.Second * time.Duration(backoff)): continue - case <-http2reqContext(req).Done(): - return nil, http2reqContext(req).Err() + case <-req.Context().Done(): + return nil, req.Context().Err() } } } @@ -7084,16 +6920,15 @@ func http2shouldRetryRequest(req *Request, err error, afterBodyWrite bool) (*Req } // If the Body is nil (or http.NoBody), it's safe to reuse // this request and its Body. - if req.Body == nil || http2reqBodyIsNoBody(req.Body) { + if req.Body == nil || req.Body == NoBody { return req, nil } // If the request body can be reset back to its original // state via the optional req.GetBody, do that. - getBody := http2reqGetBody(req) // Go 1.8: getBody = req.GetBody - if getBody != nil { + if req.GetBody != nil { // TODO: consider a req.Body.Close here? or audit that all caller paths do? - body, err := getBody() + body, err := req.GetBody() if err != nil { return nil, err } @@ -7139,7 +6974,7 @@ func (t *http2Transport) dialClientConn(addr string, singleUse bool) (*http2Clie func (t *http2Transport) newTLSConfig(host string) *tls.Config { cfg := new(tls.Config) if t.TLSClientConfig != nil { - *cfg = *http2cloneTLSConfig(t.TLSClientConfig) + *cfg = *t.TLSClientConfig.Clone() } if !http2strSliceContains(cfg.NextProtos, http2NextProtoTLS) { cfg.NextProtos = append([]string{http2NextProtoTLS}, cfg.NextProtos...) @@ -7190,7 +7025,7 @@ func (t *http2Transport) expectContinueTimeout() time.Duration { if t.t1 == nil { return 0 } - return http2transportExpectContinueTimeout(t.t1) + return t.t1.ExpectContinueTimeout } func (t *http2Transport) NewClientConn(c net.Conn) (*http2ClientConn, error) { @@ -7315,8 +7150,19 @@ func (cc *http2ClientConn) idleStateLocked() (st http2clientConnIdleState) { if cc.singleUse && cc.nextStreamID > 1 { return } - st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && - int64(cc.nextStreamID)+int64(cc.pendingRequests) < math.MaxInt32 + var maxConcurrentOkay bool + if cc.t.StrictMaxConcurrentStreams { + // We'll tell the caller we can take a new request to + // prevent the caller from dialing a new TCP + // connection, but then we'll block later before + // writing it. + maxConcurrentOkay = true + } else { + maxConcurrentOkay = int64(len(cc.streams)+1) < int64(cc.maxConcurrentStreams) + } + + st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && + int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest return } @@ -7356,8 +7202,7 @@ func (cc *http2ClientConn) closeIfIdle() { var http2shutdownEnterWaitStateHook = func() {} // Shutdown gracefully close the client connection, waiting for running streams to complete. -// Public implementation is in go17.go and not_go17.go -func (cc *http2ClientConn) shutdown(ctx http2contextContext) error { +func (cc *http2ClientConn) Shutdown(ctx context.Context) error { if err := cc.sendGoAway(); err != nil { return err } @@ -7527,7 +7372,7 @@ func http2checkConnHeaders(req *Request) error { // req.ContentLength, where 0 actually means zero (not unknown) and -1 // means unknown. func http2actualContentLength(req *Request) int64 { - if req.Body == nil || http2reqBodyIsNoBody(req.Body) { + if req.Body == nil || req.Body == NoBody { return 0 } if req.ContentLength != 0 { @@ -7597,7 +7442,7 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe cs := cc.newStream() cs.req = req - cs.trace = http2requestTrace(req) + cs.trace = httptrace.ContextClientTrace(req.Context()) cs.requestedGzip = requestedGzip bodyWriter := cc.t.getBodyWriterState(cs, body) cs.on100 = bodyWriter.on100 @@ -7635,7 +7480,7 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe readLoopResCh := cs.resc bodyWritten := false - ctx := http2reqContext(req) + ctx := req.Context() handleReadLoopResponse := func(re http2resAndError) (*Response, bool, error) { res := re.res @@ -7705,6 +7550,7 @@ func (cc *http2ClientConn) roundTrip(req *Request) (res *Response, gotErrAfterRe default: } if err != nil { + cc.forgetStreamID(cs.ID) return nil, cs.getStartedWrite(), err } bodyWritten = true @@ -7826,6 +7672,7 @@ func (cs *http2clientStream) writeRequestBody(body io.Reader, bodyCloser io.Clos sawEOF = true err = nil } else if err != nil { + cc.writeStreamReset(cs.ID, http2ErrCodeCancel, err) return err } @@ -8061,7 +7908,7 @@ func (cc *http2ClientConn) encodeHeaders(req *Request, addGzipHeader bool, trail return nil, http2errRequestHeaderListSize } - trace := http2requestTrace(req) + trace := httptrace.ContextClientTrace(req.Context()) traceHeaders := http2traceHasWroteHeaderField(trace) // Header list size is ok. Write the headers. @@ -8484,7 +8331,7 @@ func (rl *http2clientConnReadLoop) handleResponse(cs *http2clientStream, f *http res.Header.Del("Content-Length") res.ContentLength = -1 res.Body = &http2gzipReader{body: res.Body} - http2setResponseUncompressed(res) + res.Uncompressed = true } return res, nil } @@ -8861,8 +8708,7 @@ func (rl *http2clientConnReadLoop) processResetStream(f *http2RSTStreamFrame) er } // Ping sends a PING frame to the server and waits for the ack. -// Public implementation is in go17.go and not_go17.go -func (cc *http2ClientConn) ping(ctx http2contextContext) error { +func (cc *http2ClientConn) Ping(ctx context.Context) error { c := make(chan struct{}) // Generate a random payload var p [8]byte @@ -9097,6 +8943,94 @@ func http2isConnectionCloseRequest(req *Request) bool { return req.Close || httpguts.HeaderValuesContainsToken(req.Header["Connection"], "close") } +// registerHTTPSProtocol calls Transport.RegisterProtocol but +// converting panics into errors. +func http2registerHTTPSProtocol(t *Transport, rt http2noDialH2RoundTripper) (err error) { + defer func() { + if e := recover(); e != nil { + err = fmt.Errorf("%v", e) + } + }() + t.RegisterProtocol("https", rt) + return nil +} + +// noDialH2RoundTripper is a RoundTripper which only tries to complete the request +// if there's already has a cached connection to the host. +// (The field is exported so it can be accessed via reflect from net/http; tested +// by TestNoDialH2RoundTripperType) +type http2noDialH2RoundTripper struct{ *http2Transport } + +func (rt http2noDialH2RoundTripper) RoundTrip(req *Request) (*Response, error) { + res, err := rt.http2Transport.RoundTrip(req) + if http2isNoCachedConnError(err) { + return nil, ErrSkipAltProtocol + } + return res, err +} + +func (t *http2Transport) idleConnTimeout() time.Duration { + if t.t1 != nil { + return t.t1.IdleConnTimeout + } + return 0 +} + +func http2traceGetConn(req *Request, hostPort string) { + trace := httptrace.ContextClientTrace(req.Context()) + if trace == nil || trace.GetConn == nil { + return + } + trace.GetConn(hostPort) +} + +func http2traceGotConn(req *Request, cc *http2ClientConn) { + trace := httptrace.ContextClientTrace(req.Context()) + if trace == nil || trace.GotConn == nil { + return + } + ci := httptrace.GotConnInfo{Conn: cc.tconn} + cc.mu.Lock() + ci.Reused = cc.nextStreamID > 1 + ci.WasIdle = len(cc.streams) == 0 && ci.Reused + if ci.WasIdle && !cc.lastActive.IsZero() { + ci.IdleTime = time.Now().Sub(cc.lastActive) + } + cc.mu.Unlock() + + trace.GotConn(ci) +} + +func http2traceWroteHeaders(trace *httptrace.ClientTrace) { + if trace != nil && trace.WroteHeaders != nil { + trace.WroteHeaders() + } +} + +func http2traceGot100Continue(trace *httptrace.ClientTrace) { + if trace != nil && trace.Got100Continue != nil { + trace.Got100Continue() + } +} + +func http2traceWait100Continue(trace *httptrace.ClientTrace) { + if trace != nil && trace.Wait100Continue != nil { + trace.Wait100Continue() + } +} + +func http2traceWroteRequest(trace *httptrace.ClientTrace, err error) { + if trace != nil && trace.WroteRequest != nil { + trace.WroteRequest(httptrace.WroteRequestInfo{Err: err}) + } +} + +func http2traceFirstResponseByte(trace *httptrace.ClientTrace) { + if trace != nil && trace.GotFirstResponseByte != nil { + trace.GotFirstResponseByte() + } +} + // writeFramer is implemented by any type that is used to write frames. type http2writeFramer interface { writeFrame(http2writeContext) error @@ -9283,7 +9217,7 @@ func (w *http2writeResHeaders) staysWithinBuffer(max int) bool { // TODO: this is a common one. It'd be nice to return true // here and get into the fast path if we could be clever and // calculate the size fast enough, or at least a conservative - // uppper bound that usually fires. (Maybe if w.h and + // upper bound that usually fires. (Maybe if w.h and // w.trailers are nil, so we don't need to enumerate it.) // Otherwise I'm afraid that just calculating the length to // answer this question would be slower than the ~2µs benefit. @@ -9413,7 +9347,7 @@ func (wu http2writeWindowUpdate) writeFrame(ctx http2writeContext) error { } // encodeHeaders encodes an http.Header. If keys is not nil, then (k, h[k]) -// is encoded only only if k is in keys. +// is encoded only if k is in keys. func http2encodeHeaders(enc *hpack.Encoder, h Header, keys []string) { if keys == nil { sorter := http2sorterPool.Get().(*http2sorter) From c042fedbc8dbbf27603a360d79d59b4969f299ec Mon Sep 17 00:00:00 2001 From: Ben Shi Date: Fri, 30 Nov 2018 09:30:36 +0000 Subject: [PATCH 198/594] test/codegen: add arithmetic tests for 386/amd64/arm/arm64 This CL adds several test cases of arithmetic operations for 386/amd64/arm/arm64. Change-Id: I362687c06249f31091458a1d8c45fc4d006b616a Reviewed-on: https://go-review.googlesource.com/c/151897 Run-TryBot: Ben Shi Reviewed-by: Keith Randall --- test/codegen/arithmetic.go | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/test/codegen/arithmetic.go b/test/codegen/arithmetic.go index 2cc294897acac..e5671774edfff 100644 --- a/test/codegen/arithmetic.go +++ b/test/codegen/arithmetic.go @@ -66,7 +66,10 @@ func Pow2Muls(n1, n2 int) (int, int) { } func Mul_96(n int) int { - // amd64:`SHLQ\t[$]5`,`LEAQ\t\(.*\)\(.*\*2\),` + // amd64:`SHLQ\t[$]5`,`LEAQ\t\(.*\)\(.*\*2\),`,-`IMULQ` + // 386:`SHLL\t[$]5`,`LEAL\t\(.*\)\(.*\*2\),`,-`IMULL` + // arm64:`LSL\t[$]5`,`ADD\sR[0-9]+<<1,\sR[0-9]+`,-`MUL` + // arm:`SLL\t[$]5`,`ADD\sR[0-9]+<<1,\sR[0-9]+`,-`MUL` return n * 96 } @@ -74,6 +77,7 @@ func MulMemSrc(a []uint32, b []float32) { // 386:`IMULL\s4\([A-Z]+\),\s[A-Z]+` a[0] *= a[1] // 386/sse2:`MULSS\s4\([A-Z]+\),\sX[0-9]+` + // amd64:`MULSS\s4\([A-Z]+\),\sX[0-9]+` b[0] *= b[1] } @@ -115,6 +119,7 @@ func MergeMuls5(a, n int) int { func DivMemSrc(a []float64) { // 386/sse2:`DIVSD\s8\([A-Z]+\),\sX[0-9]+` + // amd64:`DIVSD\s8\([A-Z]+\),\sX[0-9]+` a[0] /= a[1] } @@ -141,9 +146,15 @@ func Pow2Divs(n1 uint, n2 int) (uint, int) { // Check that constant divisions get turned into MULs func ConstDivs(n1 uint, n2 int) (uint, int) { // amd64:"MOVQ\t[$]-1085102592571150095","MULQ",-"DIVQ" + // 386:"MOVL\t[$]-252645135","MULL",-"DIVL" + // arm64:`MOVD`,`UMULH`,-`DIV` + // arm:`MOVW`,`MUL`,-`.*udiv` a := n1 / 17 // unsigned // amd64:"MOVQ\t[$]-1085102592571150095","IMULQ",-"IDIVQ" + // 386:"MOVL\t[$]-252645135","IMULL",-"IDIVL" + // arm64:`MOVD`,`SMULH`,-`DIV` + // arm:`MOVW`,`MUL`,-`.*udiv` b := n2 / 17 // signed return a, b @@ -151,6 +162,7 @@ func ConstDivs(n1 uint, n2 int) (uint, int) { func FloatDivs(a []float32) float32 { // amd64:`DIVSS\s8\([A-Z]+\),\sX[0-9]+` + // 386/sse2:`DIVSS\s8\([A-Z]+\),\sX[0-9]+` return a[1] / a[2] } @@ -175,9 +187,15 @@ func Pow2Mods(n1 uint, n2 int) (uint, int) { // Check that constant modulo divs get turned into MULs func ConstMods(n1 uint, n2 int) (uint, int) { // amd64:"MOVQ\t[$]-1085102592571150095","MULQ",-"DIVQ" + // 386:"MOVL\t[$]-252645135","MULL",-"DIVL" + // arm64:`MOVD`,`UMULH`,-`DIV` + // arm:`MOVW`,`MUL`,-`.*udiv` a := n1 % 17 // unsigned // amd64:"MOVQ\t[$]-1085102592571150095","IMULQ",-"IDIVQ" + // 386:"MOVL\t[$]-252645135","IMULL",-"IDIVL" + // arm64:`MOVD`,`SMULH`,-`DIV` + // arm:`MOVW`,`MUL`,-`.*udiv` b := n2 % 17 // signed return a, b @@ -270,6 +288,8 @@ func NoFix16B(divd int16) (int16, int16) { func LenDiv1(a []int) int { // 386:"SHRL\t[$]10" // amd64:"SHRQ\t[$]10" + // arm64:"LSR\t[$]10",-"SDIV" + // arm:"SRL\t[$]10",-".*udiv" // ppc64:"SRD"\t[$]10" // ppc64le:"SRD"\t[$]10" return len(a) / 1024 @@ -278,6 +298,8 @@ func LenDiv1(a []int) int { func LenDiv2(s string) int { // 386:"SHRL\t[$]11" // amd64:"SHRQ\t[$]11" + // arm64:"LSR\t[$]11",-"SDIV" + // arm:"SRL\t[$]11",-".*udiv" // ppc64:"SRD\t[$]11" // ppc64le:"SRD\t[$]11" return len(s) / (4097 >> 1) @@ -286,6 +308,9 @@ func LenDiv2(s string) int { func LenMod1(a []int) int { // 386:"ANDL\t[$]1023" // amd64:"ANDQ\t[$]1023" + // arm64:"AND\t[$]1023",-"SDIV" + // arm/6:"AND",-".*udiv" + // arm/7:"BFC",-".*udiv",-"AND" // ppc64:"ANDCC\t[$]1023" // ppc64le:"ANDCC\t[$]1023" return len(a) % 1024 @@ -294,6 +319,9 @@ func LenMod1(a []int) int { func LenMod2(s string) int { // 386:"ANDL\t[$]2047" // amd64:"ANDQ\t[$]2047" + // arm64:"AND\t[$]2047",-"SDIV" + // arm/6:"AND",-".*udiv" + // arm/7:"BFC",-".*udiv",-"AND" // ppc64:"ANDCC\t[$]2047" // ppc64le:"ANDCC\t[$]2047" return len(s) % (4097 >> 1) @@ -302,6 +330,8 @@ func LenMod2(s string) int { func CapDiv(a []int) int { // 386:"SHRL\t[$]12" // amd64:"SHRQ\t[$]12" + // arm64:"LSR\t[$]12",-"SDIV" + // arm:"SRL\t[$]12",-".*udiv" // ppc64:"SRD\t[$]12" // ppc64le:"SRD\t[$]12" return cap(a) / ((1 << 11) + 2048) @@ -310,6 +340,9 @@ func CapDiv(a []int) int { func CapMod(a []int) int { // 386:"ANDL\t[$]4095" // amd64:"ANDQ\t[$]4095" + // arm64:"AND\t[$]4095",-"SDIV" + // arm/6:"AND",-".*udiv" + // arm/7:"BFC",-".*udiv",-"AND" // ppc64:"ANDCC\t[$]4095" // ppc64le:"ANDCC\t[$]4095" return cap(a) % ((1 << 11) + 2048) From f70bd914353b2331a48eedb84aceb458982eaac0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 30 Nov 2018 14:21:33 -0800 Subject: [PATCH 199/594] cmd/cgo: use preprocessor macros to avoid prolog redefinitions Avoid redefinition errors when a Go file uses a cgo comment to There is no particularly good reason to do this, but there is also no particularly good reason that it should fail. Fixes #27019 Change-Id: Icd6f8197a89be4ee6b03ddae675667998a8b4189 Reviewed-on: https://go-review.googlesource.com/c/152079 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/cgo/testcshared/cshared_test.go | 43 ++++++++++++++++++++ misc/cgo/testcshared/src/go2c2go/go/shlib.go | 12 ++++++ misc/cgo/testcshared/src/go2c2go/m1/c.c | 9 ++++ misc/cgo/testcshared/src/go2c2go/m1/main.go | 22 ++++++++++ misc/cgo/testcshared/src/go2c2go/m2/main.go | 22 ++++++++++ src/cmd/cgo/out.go | 23 ++++++++++- 6 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 misc/cgo/testcshared/src/go2c2go/go/shlib.go create mode 100644 misc/cgo/testcshared/src/go2c2go/m1/c.c create mode 100644 misc/cgo/testcshared/src/go2c2go/m1/main.go create mode 100644 misc/cgo/testcshared/src/go2c2go/m2/main.go diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index 89b19d653a3d8..fa2af2842dfa6 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -602,3 +602,46 @@ func copyFile(t *testing.T, dst, src string) { t.Fatal(err) } } + +func TestGo2C2Go(t *testing.T) { + t.Parallel() + + tmpdir, err := ioutil.TempDir("", "cshared-TestGo2C2Go") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpdir) + + shlib := filepath.Join(tmpdir, "libtestgo2c2go."+libSuffix) + run(t, gopathEnv, "go", "build", "-buildmode=c-shared", "-o", shlib, "go2c2go/go") + + cgoCflags := os.Getenv("CGO_CFLAGS") + if cgoCflags != "" { + cgoCflags += " " + } + cgoCflags += "-I" + tmpdir + + cgoLdflags := os.Getenv("CGO_LDFLAGS") + if cgoLdflags != "" { + cgoLdflags += " " + } + cgoLdflags += "-L" + tmpdir + " -ltestgo2c2go" + + goenv := append(gopathEnv[:len(gopathEnv):len(gopathEnv)], "CGO_CFLAGS="+cgoCflags, "CGO_LDFLAGS="+cgoLdflags) + + ldLibPath := os.Getenv("LD_LIBRARY_PATH") + if ldLibPath != "" { + ldLibPath += ":" + } + ldLibPath += tmpdir + + runenv := append(gopathEnv[:len(gopathEnv):len(gopathEnv)], "LD_LIBRARY_PATH="+ldLibPath) + + bin := filepath.Join(tmpdir, "m1") + exeSuffix + run(t, goenv, "go", "build", "-o", bin, "go2c2go/m1") + runExe(t, runenv, bin) + + bin = filepath.Join(tmpdir, "m2") + exeSuffix + run(t, goenv, "go", "build", "-o", bin, "go2c2go/m2") + runExe(t, runenv, bin) +} diff --git a/misc/cgo/testcshared/src/go2c2go/go/shlib.go b/misc/cgo/testcshared/src/go2c2go/go/shlib.go new file mode 100644 index 0000000000000..76a5323ad2d55 --- /dev/null +++ b/misc/cgo/testcshared/src/go2c2go/go/shlib.go @@ -0,0 +1,12 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "C" + +//export GoFunc +func GoFunc() int { return 1 } + +func main() {} diff --git a/misc/cgo/testcshared/src/go2c2go/m1/c.c b/misc/cgo/testcshared/src/go2c2go/m1/c.c new file mode 100644 index 0000000000000..0e8fac4cf36f5 --- /dev/null +++ b/misc/cgo/testcshared/src/go2c2go/m1/c.c @@ -0,0 +1,9 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "libtestgo2c2go.h" + +int CFunc(void) { + return (GoFunc() << 8) + 2; +} diff --git a/misc/cgo/testcshared/src/go2c2go/m1/main.go b/misc/cgo/testcshared/src/go2c2go/m1/main.go new file mode 100644 index 0000000000000..17ba1eb0a72e5 --- /dev/null +++ b/misc/cgo/testcshared/src/go2c2go/m1/main.go @@ -0,0 +1,22 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// extern int CFunc(void); +import "C" + +import ( + "fmt" + "os" +) + +func main() { + got := C.CFunc() + const want = (1 << 8) | 2 + if got != want { + fmt.Printf("got %#x, want %#x\n", got, want) + os.Exit(1) + } +} diff --git a/misc/cgo/testcshared/src/go2c2go/m2/main.go b/misc/cgo/testcshared/src/go2c2go/m2/main.go new file mode 100644 index 0000000000000..91bf308057caa --- /dev/null +++ b/misc/cgo/testcshared/src/go2c2go/m2/main.go @@ -0,0 +1,22 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// #include "libtestgo2c2go.h" +import "C" + +import ( + "fmt" + "os" +) + +func main() { + got := C.GoFunc() + const want = 1 + if got != want { + fmt.Printf("got %#x, want %#x\n", got, want) + os.Exit(1) + } +} diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index bc0b0b63877a3..c49b51c611c94 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -1555,6 +1555,7 @@ const builtinProlog = ` /* Define intgo when compiling with GCC. */ typedef ptrdiff_t intgo; +#define GO_CGO_GOSTRING_TYPEDEF typedef struct { const char *p; intgo n; } _GoString_; typedef struct { char *p; intgo n; intgo c; } _GoBytes_; _GoString_ GoString(char *p); @@ -1806,15 +1807,20 @@ void localCgoCheckResult(Eface val) { // because _cgo_export.h defines GoString as a struct while builtinProlog // defines it as a function. We don't change this to avoid unnecessarily // breaking existing code. +// The test of GO_CGO_GOSTRING_TYPEDEF avoids a duplicate definition +// error if a Go file with a cgo comment #include's the export header +// generated by a different package. const builtinExportProlog = ` -#line 1 "cgo-builtin-prolog" +#line 1 "cgo-builtin-export-prolog" #include /* for ptrdiff_t below */ #ifndef GO_CGO_EXPORT_PROLOGUE_H #define GO_CGO_EXPORT_PROLOGUE_H +#ifndef GO_CGO_GOSTRING_TYPEDEF typedef struct { const char *p; ptrdiff_t n; } _GoString_; +#endif #endif ` @@ -1823,6 +1829,19 @@ func (p *Package) gccExportHeaderProlog() string { return strings.Replace(gccExportHeaderProlog, "GOINTBITS", fmt.Sprint(8*p.IntSize), -1) } +// gccExportHeaderProlog is written to the exported header, after the +// import "C" comment preamble but before the generated declarations +// of exported functions. This permits the generated declarations to +// use the type names that appear in goTypes, above. +// +// The test of GO_CGO_GOSTRING_TYPEDEF avoids a duplicate definition +// error if a Go file with a cgo comment #include's the export header +// generated by a different package. Unfortunately GoString means two +// different things: in this prolog it means a C name for the Go type, +// while in the prolog written into the start of the C code generated +// from a cgo-using Go file it means the C.GoString function. There is +// no way to resolve this conflict, but it also doesn't make much +// difference, as Go code never wants to refer to the latter meaning. const gccExportHeaderProlog = ` /* Start of boilerplate cgo prologue. */ #line 1 "cgo-gcc-export-header-prolog" @@ -1852,7 +1871,9 @@ typedef double _Complex GoComplex128; */ typedef char _check_for_GOINTBITS_bit_pointer_matching_GoInt[sizeof(void*)==GOINTBITS/8 ? 1:-1]; +#ifndef GO_CGO_GOSTRING_TYPEDEF typedef _GoString_ GoString; +#endif typedef void *GoMap; typedef void *GoChan; typedef struct { void *t; void *v; } GoInterface; From 624e197c71b673f0b3ebc57f774536131b4f0f26 Mon Sep 17 00:00:00 2001 From: David Chase Date: Fri, 30 Nov 2018 08:36:00 -0500 Subject: [PATCH 200/594] cmd/compile: decrease inlining call cost from 60 to 57 A Go user made a well-documented request for a slightly lower threshold. I tested against a selection of other people's benchmarks, and saw a tiny benefit (possibly noise) at equally tiny cost, and no unpleasant surprises observed in benchmarking. I.e., might help, doesn't hurt, low risk, request was delivered on a silver platter. It did, however, change the behavior of one test because now bytes.Buffer.Grow is eligible for inlining. Updates #19348. Change-Id: I85e3088a4911290872b8c6bda9601b5354c48695 Reviewed-on: https://go-review.googlesource.com/c/151977 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/inl.go | 2 +- test/fixedbugs/issue7921.go | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index 3f649be7cb0b2..4699bcfa1f5dc 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -39,7 +39,7 @@ const ( inlineMaxBudget = 80 inlineExtraAppendCost = 0 // default is to inline if there's at most one call. -l=4 overrides this by using 1 instead. - inlineExtraCallCost = inlineMaxBudget * 3 / 4 + inlineExtraCallCost = 57 // 57 was benchmarked to provided most benefit with no bad surprises; see https://github.com/golang/go/issues/19348#issuecomment-439370742 inlineExtraPanicCost = 1 // do not penalize inlining panics. inlineExtraThrowCost = inlineMaxBudget // with current (2018-05/1.11) code, inlining runtime.throw does not help. diff --git a/test/fixedbugs/issue7921.go b/test/fixedbugs/issue7921.go index 08fef0f128691..ce8d09a2769e2 100644 --- a/test/fixedbugs/issue7921.go +++ b/test/fixedbugs/issue7921.go @@ -17,41 +17,41 @@ func bufferNotEscape() string { // copied during String() call, but object "handle" itself // can be stack-allocated. var b bytes.Buffer - b.WriteString("123") // ERROR "b does not escape" - b.Write([]byte{'4'}) // ERROR "b does not escape" "\[\]byte literal does not escape" - return b.String() // ERROR "b does not escape" "inlining call" "string\(bytes\.b\.buf\[bytes.b.off:\]\) escapes to heap" + b.WriteString("123") // ERROR "bufferNotEscape b does not escape$" + b.Write([]byte{'4'}) // ERROR "bufferNotEscape \[\]byte literal does not escape$" "bufferNotEscape b does not escape$" + return b.String() // ERROR "bufferNotEscape b does not escape$" "inlining call to bytes.\(\*Buffer\).String$" "string\(bytes.b.buf\[bytes.b.off:\]\) escapes to heap$" } -func bufferNoEscape2(xs []string) int { // ERROR "xs does not escape" - b := bytes.NewBuffer(make([]byte, 0, 64)) // ERROR "inlining call" "make\(\[\]byte, 0, 64\) does not escape" "&bytes.Buffer literal does not escape" +func bufferNoEscape2(xs []string) int { // ERROR "bufferNoEscape2 xs does not escape$" + b := bytes.NewBuffer(make([]byte, 0, 64)) // ERROR "bufferNoEscape2 &bytes.Buffer literal does not escape$" "bufferNoEscape2 make\(\[\]byte, 0, 64\) does not escape$" "inlining call to bytes.NewBuffer$" for _, x := range xs { b.WriteString(x) } - return b.Len() // ERROR "inlining call" + return b.Len() // ERROR "inlining call to bytes.\(\*Buffer\).Len$" } -func bufferNoEscape3(xs []string) string { // ERROR "xs does not escape" - b := bytes.NewBuffer(make([]byte, 0, 64)) // ERROR "inlining call" "make\(\[\]byte, 0, 64\) does not escape" "&bytes.Buffer literal does not escape" +func bufferNoEscape3(xs []string) string { // ERROR "bufferNoEscape3 xs does not escape$" + b := bytes.NewBuffer(make([]byte, 0, 64)) // ERROR "bufferNoEscape3 &bytes.Buffer literal does not escape$" "bufferNoEscape3 make\(\[\]byte, 0, 64\) does not escape$" "inlining call to bytes.NewBuffer$" for _, x := range xs { b.WriteString(x) b.WriteByte(',') } - return b.String() // ERROR "inlining call" "string\(bytes.b.buf\[bytes\.b\.off:\]\) escapes to heap" + return b.String() // ERROR "inlining call to bytes.\(\*Buffer\).String$" "string\(bytes.b.buf\[bytes.b.off:\]\) escapes to heap$" } func bufferNoEscape4() []byte { var b bytes.Buffer - b.Grow(64) // ERROR "b does not escape" - useBuffer(&b) // ERROR "&b does not escape" - return b.Bytes() // ERROR "inlining call" "b does not escape" + b.Grow(64) // ERROR "bufferNoEscape4 b does not escape$" "bufferNoEscape4 ignoring self-assignment in bytes.b.buf = bytes.b.buf\[:bytes.m·3\]$" "inlining call to bytes.\(\*Buffer\).Grow$" + useBuffer(&b) // ERROR "bufferNoEscape4 &b does not escape$" + return b.Bytes() // ERROR "bufferNoEscape4 b does not escape$" "inlining call to bytes.\(\*Buffer\).Bytes$" } -func bufferNoEscape5() { // ERROR "can inline bufferNoEscape5" - b := bytes.NewBuffer(make([]byte, 0, 128)) // ERROR "inlining call" "make\(\[\]byte, 0, 128\) does not escape" "&bytes.Buffer literal does not escape" +func bufferNoEscape5() { // ERROR "can inline bufferNoEscape5$" + b := bytes.NewBuffer(make([]byte, 0, 128)) // ERROR "bufferNoEscape5 &bytes.Buffer literal does not escape$" "bufferNoEscape5 make\(\[\]byte, 0, 128\) does not escape$" "inlining call to bytes.NewBuffer$" useBuffer(b) } //go:noinline -func useBuffer(b *bytes.Buffer) { // ERROR "b does not escape" +func useBuffer(b *bytes.Buffer) { // ERROR "useBuffer b does not escape$" b.WriteString("1234") } From b397248168fcb26400ac6afb88bf6080497a819e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sat, 1 Dec 2018 16:28:27 +0000 Subject: [PATCH 201/594] cmd/compile: add Buffer.Grow to TestIntendedInlining MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit golang.org/cl/151977 slightly decreased the cost of inlining an extra call from 60 to 57, since it was a safe change that could help in some scenarios. One notable change spotted in that CL is that bytes.Buffer.Grow is now inlinable, meaning that a fixedbugs test needed updating. For consistency, add the test case to TestIntendedInlining too, alongside other commonly used bytes.Buffer methods. Change-Id: I4fb402fc684ef4c543fc65aea343ca1a4d73a189 Reviewed-on: https://go-review.googlesource.com/c/151979 Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/inl_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/compile/internal/gc/inl_test.go b/src/cmd/compile/internal/gc/inl_test.go index ba74981e9afbe..58d13f2dcf5f5 100644 --- a/src/cmd/compile/internal/gc/inl_test.go +++ b/src/cmd/compile/internal/gc/inl_test.go @@ -104,6 +104,7 @@ func TestIntendedInlining(t *testing.T) { "(*Buffer).Bytes", "(*Buffer).Cap", "(*Buffer).Len", + "(*Buffer).Grow", "(*Buffer).Next", "(*Buffer).Read", "(*Buffer).ReadByte", From 9e277f7d554455e16ba3762541c53e9bfc1d8188 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 22 Nov 2018 11:46:44 +0100 Subject: [PATCH 202/594] all: use "reports whether" consistently instead of "returns whether" Follow-up for CL 147037 and after Brad noticed the "returns whether" pattern during the review of CL 150621. Go documentation style for boolean funcs is to say: // Foo reports whether ... func Foo() bool (rather than "returns whether") Created with: $ perl -i -npe 's/returns whether/reports whether/' $(git grep -l "returns whether" | grep -v vendor) Change-Id: I15fe9ff99180ad97750cd05a10eceafdb12dc0b4 Reviewed-on: https://go-review.googlesource.com/c/150918 Run-TryBot: Tobias Klauser Reviewed-by: Brad Fitzpatrick --- src/bytes/buffer.go | 2 +- src/cmd/cgo/gcc.go | 12 ++++++------ src/cmd/cgo/out.go | 2 +- src/cmd/compile/internal/gc/reflect.go | 2 +- src/cmd/compile/internal/mips/ssa.go | 4 ++-- src/cmd/compile/internal/mips64/ssa.go | 4 ++-- src/cmd/compile/internal/ssa/biasedsparsemap.go | 2 +- src/cmd/compile/internal/ssa/config.go | 2 +- src/cmd/compile/internal/ssa/magic.go | 2 +- src/cmd/compile/internal/ssa/numberlines.go | 2 +- src/cmd/compile/internal/ssa/rewrite.go | 2 +- src/cmd/compile/internal/ssa/value.go | 2 +- src/cmd/compile/internal/ssa/writebarrier.go | 2 +- src/cmd/compile/internal/types/type.go | 2 +- src/cmd/internal/obj/arm64/asm7.go | 2 +- src/cmd/internal/objabi/reloctype.go | 2 +- src/cmd/link/internal/ld/data.go | 2 +- src/cmd/link/internal/ld/lib.go | 6 +++--- src/cmd/pprof/readlineui.go | 2 +- src/cmd/trace/annotations.go | 2 +- src/crypto/tls/common.go | 2 +- src/crypto/tls/handshake_server_tls13.go | 2 +- src/crypto/x509/pkix/pkix.go | 2 +- src/crypto/x509/verify.go | 2 +- src/crypto/x509/x509.go | 2 +- src/database/sql/sql.go | 2 +- src/debug/dwarf/line.go | 2 +- src/go/printer/nodes.go | 2 +- src/internal/goroot/gc.go | 4 ++-- src/internal/goroot/gccgo.go | 2 +- src/net/http/cookie.go | 6 +++--- src/net/http/h2_bundle.go | 2 +- src/net/http/server.go | 2 +- src/net/interface.go | 2 +- src/os/wait_unimp.go | 2 +- src/os/wait_wait6.go | 2 +- src/os/wait_waitid.go | 2 +- src/path/filepath/symlink_windows.go | 2 +- src/runtime/cgocall.go | 4 ++-- src/runtime/mbitmap.go | 2 +- src/runtime/mgcmark.go | 2 +- src/runtime/pprof/internal/profile/filter.go | 2 +- src/runtime/proc.go | 2 +- src/runtime/select.go | 2 +- src/runtime/signal_unix.go | 2 +- src/runtime/stubs.go | 2 +- src/runtime/trace/annotation.go | 2 +- src/runtime/traceback.go | 2 +- src/runtime/vdso_linux.go | 2 +- src/testing/benchmark.go | 2 +- src/time/zoneinfo.go | 2 +- 51 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/bytes/buffer.go b/src/bytes/buffer.go index 087cc0e427561..aff2db5084f11 100644 --- a/src/bytes/buffer.go +++ b/src/bytes/buffer.go @@ -68,7 +68,7 @@ func (b *Buffer) String() string { return string(b.buf[b.off:]) } -// empty returns whether the unread portion of the buffer is empty. +// empty reports whether the unread portion of the buffer is empty. func (b *Buffer) empty() bool { return len(b.buf) <= b.off } // Len returns the number of bytes of the unread portion of the buffer; diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index b5bc87dde686a..3c96af2be61bd 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -718,7 +718,7 @@ func (p *Package) mangleName(n *Name) { // rewriteCalls rewrites all calls that pass pointers to check that // they follow the rules for passing pointers between Go and C. -// This returns whether the package needs to import unsafe as _cgo_unsafe. +// This reports whether the package needs to import unsafe as _cgo_unsafe. func (p *Package) rewriteCalls(f *File) bool { needsUnsafe := false // Walk backward so that in C.f1(C.f2()) we rewrite C.f2 first. @@ -941,7 +941,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) { return sb.String(), needsUnsafe } -// needsPointerCheck returns whether the type t needs a pointer check. +// needsPointerCheck reports whether the type t needs a pointer check. // This is true if t is a pointer and if the value to which it points // might contain a pointer. func (p *Package) needsPointerCheck(f *File, t ast.Expr, arg ast.Expr) bool { @@ -958,7 +958,7 @@ func (p *Package) needsPointerCheck(f *File, t ast.Expr, arg ast.Expr) bool { // hasPointer is used by needsPointerCheck. If top is true it returns // whether t is or contains a pointer that might point to a pointer. -// If top is false it returns whether t is or contains a pointer. +// If top is false it reports whether t is or contains a pointer. // f may be nil. func (p *Package) hasPointer(f *File, t ast.Expr, top bool) bool { switch t := t.(type) { @@ -1172,7 +1172,7 @@ func (p *Package) checkAddr(sb, sbCheck *bytes.Buffer, arg ast.Expr, i int) bool return true } -// isType returns whether the expression is definitely a type. +// isType reports whether the expression is definitely a type. // This is conservative--it returns false for an unknown identifier. func (p *Package) isType(t ast.Expr) bool { switch t := t.(type) { @@ -1214,7 +1214,7 @@ func (p *Package) isType(t ast.Expr) bool { return false } -// isConst returns whether x is an untyped constant expression. +// isConst reports whether x is an untyped constant expression. func (p *Package) isConst(f *File, x ast.Expr) bool { switch x := x.(type) { case *ast.BasicLit: @@ -2827,7 +2827,7 @@ func (c *typeConv) Struct(dt *dwarf.StructType, pos token.Pos) (expr *ast.Struct return } -// dwarfHasPointer returns whether the DWARF type dt contains a pointer. +// dwarfHasPointer reports whether the DWARF type dt contains a pointer. func (c *typeConv) dwarfHasPointer(dt dwarf.Type, pos token.Pos) bool { switch dt := dt.(type) { default: diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index c49b51c611c94..401a87fecab59 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -1203,7 +1203,7 @@ func (p *Package) writeExportHeader(fgcch io.Writer) { fmt.Fprintf(fgcch, "%s\n", p.gccExportHeaderProlog()) } -// gccgoUsesNewMangling returns whether gccgo uses the new collision-free +// gccgoUsesNewMangling reports whether gccgo uses the new collision-free // packagepath mangling scheme (see determineGccgoManglingScheme for more // info). func gccgoUsesNewMangling() bool { diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 8310b8d2fc8c7..2863d4b5d0ca7 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -915,7 +915,7 @@ func dcommontype(lsym *obj.LSym, t *types.Type) int { return ot } -// typeHasNoAlg returns whether t does not have any associated hash/eq +// typeHasNoAlg reports whether t does not have any associated hash/eq // algorithms because t, or some component of t, is marked Noalg. func typeHasNoAlg(t *types.Type) bool { a, bad := algtype1(t) diff --git a/src/cmd/compile/internal/mips/ssa.go b/src/cmd/compile/internal/mips/ssa.go index 2bf17dc4151d1..97a9b20537de3 100644 --- a/src/cmd/compile/internal/mips/ssa.go +++ b/src/cmd/compile/internal/mips/ssa.go @@ -14,12 +14,12 @@ import ( "cmd/internal/obj/mips" ) -// isFPreg returns whether r is an FP register +// isFPreg reports whether r is an FP register func isFPreg(r int16) bool { return mips.REG_F0 <= r && r <= mips.REG_F31 } -// isHILO returns whether r is HI or LO register +// isHILO reports whether r is HI or LO register func isHILO(r int16) bool { return r == mips.REG_HI || r == mips.REG_LO } diff --git a/src/cmd/compile/internal/mips64/ssa.go b/src/cmd/compile/internal/mips64/ssa.go index bf2076f5fb380..8a2d2b0f7a451 100644 --- a/src/cmd/compile/internal/mips64/ssa.go +++ b/src/cmd/compile/internal/mips64/ssa.go @@ -14,12 +14,12 @@ import ( "cmd/internal/obj/mips" ) -// isFPreg returns whether r is an FP register +// isFPreg reports whether r is an FP register func isFPreg(r int16) bool { return mips.REG_F0 <= r && r <= mips.REG_F31 } -// isHILO returns whether r is HI or LO register +// isHILO reports whether r is HI or LO register func isHILO(r int16) bool { return r == mips.REG_HI || r == mips.REG_LO } diff --git a/src/cmd/compile/internal/ssa/biasedsparsemap.go b/src/cmd/compile/internal/ssa/biasedsparsemap.go index e1901f2135c28..f9d3afa745748 100644 --- a/src/cmd/compile/internal/ssa/biasedsparsemap.go +++ b/src/cmd/compile/internal/ssa/biasedsparsemap.go @@ -43,7 +43,7 @@ func (s *biasedSparseMap) size() int { return s.s.size() } -// contains returns whether x is a key in s +// contains reports whether x is a key in s func (s *biasedSparseMap) contains(x uint) bool { if s.s == nil { return false diff --git a/src/cmd/compile/internal/ssa/config.go b/src/cmd/compile/internal/ssa/config.go index 558c4b7db8fff..5d7504392c05b 100644 --- a/src/cmd/compile/internal/ssa/config.go +++ b/src/cmd/compile/internal/ssa/config.go @@ -164,7 +164,7 @@ type Frontend interface { // given name. Syslook(string) *obj.LSym - // UseWriteBarrier returns whether write barrier is enabled + // UseWriteBarrier reports whether write barrier is enabled UseWriteBarrier() bool // SetWBPos indicates that a write barrier has been inserted diff --git a/src/cmd/compile/internal/ssa/magic.go b/src/cmd/compile/internal/ssa/magic.go index 0457e90b53c93..12044111ea8b3 100644 --- a/src/cmd/compile/internal/ssa/magic.go +++ b/src/cmd/compile/internal/ssa/magic.go @@ -83,7 +83,7 @@ import "math/big" // a+b has n+1 bits in it. Nevertheless, can be done // in 2 instructions on x86.) -// umagicOK returns whether we should strength reduce a n-bit divide by c. +// umagicOK reports whether we should strength reduce a n-bit divide by c. func umagicOK(n uint, c int64) bool { // Convert from ConstX auxint values to the real uint64 constant they represent. d := uint64(c) << (64 - n) >> (64 - n) diff --git a/src/cmd/compile/internal/ssa/numberlines.go b/src/cmd/compile/internal/ssa/numberlines.go index 662f58e4b5766..3e14b9e3df38a 100644 --- a/src/cmd/compile/internal/ssa/numberlines.go +++ b/src/cmd/compile/internal/ssa/numberlines.go @@ -20,7 +20,7 @@ func isPoorStatementOp(op Op) bool { return false } -// LosesStmtMark returns whether a prog with op as loses its statement mark on the way to DWARF. +// LosesStmtMark reports whether a prog with op as loses its statement mark on the way to DWARF. // The attributes from some opcodes are lost in translation. // TODO: this is an artifact of how funcpctab combines information for instructions at a single PC. // Should try to fix it there. diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index 7ddf215478707..6ea46e7327fdb 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -320,7 +320,7 @@ func canMergeLoad(target, load *Value) bool { return true } -// isSameSym returns whether sym is the same as the given named symbol +// isSameSym reports whether sym is the same as the given named symbol func isSameSym(sym interface{}, name string) bool { s, ok := sym.(fmt.Stringer) return ok && s.String() == name diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go index 7e869f29c9211..6e35a3c7773d6 100644 --- a/src/cmd/compile/internal/ssa/value.go +++ b/src/cmd/compile/internal/ssa/value.go @@ -300,7 +300,7 @@ func (v *Value) Fatalf(msg string, args ...interface{}) { v.Block.Func.fe.Fatalf(v.Pos, msg, args...) } -// isGenericIntConst returns whether v is a generic integer constant. +// isGenericIntConst reports whether v is a generic integer constant. func (v *Value) isGenericIntConst() bool { return v != nil && (v.Op == OpConst64 || v.Op == OpConst32 || v.Op == OpConst16 || v.Op == OpConst8) } diff --git a/src/cmd/compile/internal/ssa/writebarrier.go b/src/cmd/compile/internal/ssa/writebarrier.go index 95816d2bdaa94..1024ab25abf8a 100644 --- a/src/cmd/compile/internal/ssa/writebarrier.go +++ b/src/cmd/compile/internal/ssa/writebarrier.go @@ -11,7 +11,7 @@ import ( "strings" ) -// needwb returns whether we need write barrier for store op v. +// needwb reports whether we need write barrier for store op v. // v must be Store/Move/Zero. func needwb(v *Value) bool { t, ok := v.Aux.(*types.Type) diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index 46a9b816809b5..3e5f5cbf4949f 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -1457,7 +1457,7 @@ func Haspointers1(t *Type, ignoreNotInHeap bool) bool { return true } -// HasHeapPointer returns whether t contains a heap pointer. +// HasHeapPointer reports whether t contains a heap pointer. // This is used for write barrier insertion, so it ignores // pointers to go:notinheap types. func (t *Type) HasHeapPointer() bool { diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go index 9746426d909d2..093b2228983d6 100644 --- a/src/cmd/internal/obj/arm64/asm7.go +++ b/src/cmd/internal/obj/arm64/asm7.go @@ -1183,7 +1183,7 @@ func isaddcon(v int64) bool { return v <= 0xFFF } -// isbitcon returns whether a constant can be encoded into a logical instruction. +// isbitcon reports whether a constant can be encoded into a logical instruction. // bitcon has a binary form of repetition of a bit sequence of length 2, 4, 8, 16, 32, or 64, // which itself is a rotate (w.r.t. the length of the unit) of a sequence of ones. // special cases: 0 and -1 are not bitcon. diff --git a/src/cmd/internal/objabi/reloctype.go b/src/cmd/internal/objabi/reloctype.go index a3e2868a1bc94..355882c63880a 100644 --- a/src/cmd/internal/objabi/reloctype.go +++ b/src/cmd/internal/objabi/reloctype.go @@ -198,7 +198,7 @@ const ( R_WASMIMPORT ) -// IsDirectJump returns whether r is a relocation for a direct jump. +// IsDirectJump reports whether r is a relocation for a direct jump. // A direct jump is a CALL or JMP instruction that takes the target address // as immediate. The address is embedded into the instruction, possibly // with limited width. diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index ffa20bb637574..848087d7436bb 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -48,7 +48,7 @@ import ( "sync" ) -// isRuntimeDepPkg returns whether pkg is the runtime package or its dependency +// isRuntimeDepPkg reports whether pkg is the runtime package or its dependency func isRuntimeDepPkg(pkg string) bool { switch pkg { case "runtime", diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 9b04e3ce11113..6c5bc542a77c4 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -158,7 +158,7 @@ const ( MINFUNC = 16 // minimum size for a function ) -// DynlinkingGo returns whether we are producing Go code that can live +// DynlinkingGo reports whether we are producing Go code that can live // in separate shared libraries linked together at runtime. func (ctxt *Link) DynlinkingGo() bool { if !ctxt.Loaded { @@ -167,12 +167,12 @@ func (ctxt *Link) DynlinkingGo() bool { return ctxt.BuildMode == BuildModeShared || ctxt.linkShared || ctxt.BuildMode == BuildModePlugin || ctxt.CanUsePlugins() } -// CanUsePlugins returns whether a plugins can be used +// CanUsePlugins reports whether a plugins can be used func (ctxt *Link) CanUsePlugins() bool { return ctxt.Syms.ROLookup("plugin.Open", sym.SymVerABIInternal) != nil } -// UseRelro returns whether to make use of "read only relocations" aka +// UseRelro reports whether to make use of "read only relocations" aka // relro. func (ctxt *Link) UseRelro() bool { switch ctxt.BuildMode { diff --git a/src/cmd/pprof/readlineui.go b/src/cmd/pprof/readlineui.go index bf2f321184457..5b9701a0e22f5 100644 --- a/src/cmd/pprof/readlineui.go +++ b/src/cmd/pprof/readlineui.go @@ -101,7 +101,7 @@ func colorize(msg string) string { return colorEscape + msg + colorResetEscape } -// IsTerminal returns whether the UI is known to be tied to an +// IsTerminal reports whether the UI is known to be tied to an // interactive terminal (as opposed to being redirected to a file). func (r *readlineUI) IsTerminal() bool { const stdout = 1 diff --git a/src/cmd/trace/annotations.go b/src/cmd/trace/annotations.go index 2fb1198cf6c0f..24984156811c4 100644 --- a/src/cmd/trace/annotations.go +++ b/src/cmd/trace/annotations.go @@ -538,7 +538,7 @@ func (task *taskDesc) overlappingInstant(ev *trace.Event) bool { return false } -// overlappingDuration returns whether the durational event, ev, overlaps with +// overlappingDuration reports whether the durational event, ev, overlaps with // any of the task's region if ev is a goroutine-local event, or overlaps with // the task's lifetime if ev is a global event. It returns the overlapping time // as well. diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go index b5e4ab734c1a0..0bc40ccf0b506 100644 --- a/src/crypto/tls/common.go +++ b/src/crypto/tls/common.go @@ -240,7 +240,7 @@ const ( RequireAndVerifyClientCert ) -// requiresClientCert returns whether the ClientAuthType requires a client +// requiresClientCert reports whether the ClientAuthType requires a client // certificate to be provided. func requiresClientCert(c ClientAuthType) bool { switch c { diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go index fa76f7ca06567..5f634b36aaf80 100644 --- a/src/crypto/tls/handshake_server_tls13.go +++ b/src/crypto/tls/handshake_server_tls13.go @@ -464,7 +464,7 @@ func (hs *serverHandshakeStateTLS13) doHelloRetryRequest(selectedGroup CurveID) return nil } -// illegalClientHelloChange returns whether the two ClientHello messages are +// illegalClientHelloChange reports whether the two ClientHello messages are // different, with the exception of the changes allowed before and after a // HelloRetryRequest. See RFC 8446, Section 4.1.2. func illegalClientHelloChange(ch, ch1 *clientHelloMsg) bool { diff --git a/src/crypto/x509/pkix/pkix.go b/src/crypto/x509/pkix/pkix.go index 59c3b15c8349b..0f59578087466 100644 --- a/src/crypto/x509/pkix/pkix.go +++ b/src/crypto/x509/pkix/pkix.go @@ -227,7 +227,7 @@ func (n Name) String() string { return n.ToRDNSequence().String() } -// oidInAttributeTypeAndValue returns whether a type with the given OID exists +// oidInAttributeTypeAndValue reports whether a type with the given OID exists // in atv. func oidInAttributeTypeAndValue(oid asn1.ObjectIdentifier, atv []AttributeTypeAndValue) bool { for _, a := range atv { diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go index 23ee2d251299a..ea78ab123f202 100644 --- a/src/crypto/x509/verify.go +++ b/src/crypto/x509/verify.go @@ -858,7 +858,7 @@ nextIntermediate: return } -// validHostname returns whether host is a valid hostname that can be matched or +// validHostname reports whether host is a valid hostname that can be matched or // matched against according to RFC 6125 2.2, with some leniency to accommodate // legacy values. func validHostname(host string) bool { diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index d8587aba927d9..08681a6ee2884 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -1641,7 +1641,7 @@ var ( oidAuthorityInfoAccessIssuers = asn1.ObjectIdentifier{1, 3, 6, 1, 5, 5, 7, 48, 2} ) -// oidNotInExtensions returns whether an extension with the given oid exists in +// oidNotInExtensions reports whether an extension with the given oid exists in // extensions. func oidInExtensions(oid asn1.ObjectIdentifier, extensions []pkix.Extension) bool { for _, e := range extensions { diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go index 71800aae83edb..b0353ab4dc782 100644 --- a/src/database/sql/sql.go +++ b/src/database/sql/sql.go @@ -2821,7 +2821,7 @@ func (ci *ColumnType) ScanType() reflect.Type { return ci.scanType } -// Nullable returns whether the column may be null. +// Nullable reports whether the column may be null. // If a driver does not support this property ok will be false. func (ci *ColumnType) Nullable() (nullable, ok bool) { return ci.nullable, ci.hasNullable diff --git a/src/debug/dwarf/line.go b/src/debug/dwarf/line.go index 4e6e1429d93b9..b862b49d62788 100644 --- a/src/debug/dwarf/line.go +++ b/src/debug/dwarf/line.go @@ -590,7 +590,7 @@ func (r *LineReader) SeekPC(pc uint64, entry *LineEntry) error { } } -// pathIsAbs returns whether path is an absolute path (or "full path +// pathIsAbs reports whether path is an absolute path (or "full path // name" in DWARF parlance). This is in "whatever form makes sense for // the host system", so this accepts both UNIX-style and DOS-style // absolute paths. We avoid the filepath package because we want this diff --git a/src/go/printer/nodes.go b/src/go/printer/nodes.go index d22f865652246..0f2029cadaa7d 100644 --- a/src/go/printer/nodes.go +++ b/src/go/printer/nodes.go @@ -976,7 +976,7 @@ func (p *printer) possibleSelectorExpr(expr ast.Expr, prec1, depth int) bool { return false } -// selectorExpr handles an *ast.SelectorExpr node and returns whether x spans +// selectorExpr handles an *ast.SelectorExpr node and reports whether x spans // multiple lines. func (p *printer) selectorExpr(x *ast.SelectorExpr, depth int, isMethod bool) bool { p.expr1(x.X, token.HighestPrec, depth) diff --git a/src/internal/goroot/gc.go b/src/internal/goroot/gc.go index b9da9a53014f4..9d846d8c49ac1 100644 --- a/src/internal/goroot/gc.go +++ b/src/internal/goroot/gc.go @@ -14,7 +14,7 @@ import ( "sync" ) -// IsStandardPackage returns whether path is a standard package, +// IsStandardPackage reports whether path is a standard package, // given goroot and compiler. func IsStandardPackage(goroot, compiler, path string) bool { switch compiler { @@ -95,7 +95,7 @@ func (gd *gccgoDirs) init() { gd.dirs = append(gd.dirs, lastDirs...) } -// isStandard returns whether path is a standard library for gccgo. +// isStandard reports whether path is a standard library for gccgo. func (gd *gccgoDirs) isStandard(path string) bool { // Quick check: if the first path component has a '.', it's not // in the standard library. This skips most GOPATH directories. diff --git a/src/internal/goroot/gccgo.go b/src/internal/goroot/gccgo.go index 098e77d893f4b..3530e59a15f88 100644 --- a/src/internal/goroot/gccgo.go +++ b/src/internal/goroot/gccgo.go @@ -11,7 +11,7 @@ import ( "path/filepath" ) -// IsStandardPackage returns whether path is a standard package, +// IsStandardPackage reports whether path is a standard package, // given goroot and compiler. func IsStandardPackage(goroot, compiler, path string) bool { switch compiler { diff --git a/src/net/http/cookie.go b/src/net/http/cookie.go index ad7903f074c18..63f62214db825 100644 --- a/src/net/http/cookie.go +++ b/src/net/http/cookie.go @@ -263,7 +263,7 @@ func readCookies(h Header, filter string) []*Cookie { return cookies } -// validCookieDomain returns whether v is a valid cookie domain-value. +// validCookieDomain reports whether v is a valid cookie domain-value. func validCookieDomain(v string) bool { if isCookieDomainName(v) { return true @@ -274,13 +274,13 @@ func validCookieDomain(v string) bool { return false } -// validCookieExpires returns whether v is a valid cookie expires-value. +// validCookieExpires reports whether v is a valid cookie expires-value. func validCookieExpires(t time.Time) bool { // IETF RFC 6265 Section 5.1.1.5, the year must not be less than 1601 return t.Year() >= 1601 } -// isCookieDomainName returns whether s is a valid domain name or a valid +// isCookieDomainName reports whether s is a valid domain name or a valid // domain name with a leading dot '.'. It is almost a direct copy of // package net's isDomainName. func isCookieDomainName(s string) bool { diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 77ab0343f4222..676eebdfdf9e0 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -4852,7 +4852,7 @@ func (sc *http2serverConn) resetStream(se http2StreamError) { // processFrameFromReader processes the serve loop's read from readFrameCh from the // frame-reading goroutine. -// processFrameFromReader returns whether the connection should be kept open. +// processFrameFromReader reports whether the connection should be kept open. func (sc *http2serverConn) processFrameFromReader(res http2readFrameResult) bool { sc.serveG.check() err := res.err diff --git a/src/net/http/server.go b/src/net/http/server.go index 97ed59e9fd1e8..aa9c3f5d2ebd5 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -3082,7 +3082,7 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error { } // setupHTTP2_ServeTLS conditionally configures HTTP/2 on -// srv and returns whether there was an error setting it up. If it is +// srv and reports whether there was an error setting it up. If it is // not configured for policy reasons, nil is returned. func (srv *Server) setupHTTP2_ServeTLS() error { srv.nextProtoOnce.Do(srv.onceSetNextProtoDefaults) diff --git a/src/net/interface.go b/src/net/interface.go index f68df98aa2766..8d29a44db804b 100644 --- a/src/net/interface.go +++ b/src/net/interface.go @@ -188,7 +188,7 @@ var zoneCache = ipv6ZoneCache{ } // update refreshes the network interface information if the cache was last -// updated more than 1 minute ago, or if force is set. It returns whether the +// updated more than 1 minute ago, or if force is set. It reports whether the // cache was updated. func (zc *ipv6ZoneCache) update(ift []Interface, force bool) (updated bool) { zc.Lock() diff --git a/src/os/wait_unimp.go b/src/os/wait_unimp.go index d070604600131..469abf764016b 100644 --- a/src/os/wait_unimp.go +++ b/src/os/wait_unimp.go @@ -7,7 +7,7 @@ package os // blockUntilWaitable attempts to block until a call to p.Wait will -// succeed immediately, and returns whether it has done so. +// succeed immediately, and reports whether it has done so. // It does not actually call p.Wait. // This version is used on systems that do not implement waitid, // or where we have not implemented it yet. diff --git a/src/os/wait_wait6.go b/src/os/wait_wait6.go index 891f242dacd14..45bf649015fd7 100644 --- a/src/os/wait_wait6.go +++ b/src/os/wait_wait6.go @@ -14,7 +14,7 @@ import ( const _P_PID = 0 // blockUntilWaitable attempts to block until a call to p.Wait will -// succeed immediately, and returns whether it has done so. +// succeed immediately, and reports whether it has done so. // It does not actually call p.Wait. func (p *Process) blockUntilWaitable() (bool, error) { var errno syscall.Errno diff --git a/src/os/wait_waitid.go b/src/os/wait_waitid.go index 5a62b27f191f2..946c085a50042 100644 --- a/src/os/wait_waitid.go +++ b/src/os/wait_waitid.go @@ -18,7 +18,7 @@ import ( const _P_PID = 1 // blockUntilWaitable attempts to block until a call to p.Wait will -// succeed immediately, and returns whether it has done so. +// succeed immediately, and reports whether it has done so. // It does not actually call p.Wait. func (p *Process) blockUntilWaitable() (bool, error) { // The waitid system call expects a pointer to a siginfo_t, diff --git a/src/path/filepath/symlink_windows.go b/src/path/filepath/symlink_windows.go index 78cde4aa09074..7095a6b4bd575 100644 --- a/src/path/filepath/symlink_windows.go +++ b/src/path/filepath/symlink_windows.go @@ -43,7 +43,7 @@ func normBase(path string) (string, error) { return syscall.UTF16ToString(data.FileName[:]), nil } -// baseIsDotDot returns whether the last element of path is "..". +// baseIsDotDot reports whether the last element of path is "..". // The given path should be 'Clean'-ed in advance. func baseIsDotDot(path string) bool { i := strings.LastIndexByte(path, Separator) diff --git a/src/runtime/cgocall.go b/src/runtime/cgocall.go index ca31408b50726..85b6c8289ab4e 100644 --- a/src/runtime/cgocall.go +++ b/src/runtime/cgocall.go @@ -606,7 +606,7 @@ func cgoCheckUnknownPointer(p unsafe.Pointer, msg string) (base, i uintptr) { return } -// cgoIsGoPointer returns whether the pointer is a Go pointer--a +// cgoIsGoPointer reports whether the pointer is a Go pointer--a // pointer to Go memory. We only care about Go memory that might // contain pointers. //go:nosplit @@ -629,7 +629,7 @@ func cgoIsGoPointer(p unsafe.Pointer) bool { return false } -// cgoInRange returns whether p is between start and end. +// cgoInRange reports whether p is between start and end. //go:nosplit //go:nowritebarrierrec func cgoInRange(p unsafe.Pointer, start, end uintptr) bool { diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index 67d99900a2fbd..2f00add83e43d 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -242,7 +242,7 @@ func (s *mspan) nextFreeIndex() uintptr { return result } -// isFree returns whether the index'th object in s is unallocated. +// isFree reports whether the index'th object in s is unallocated. func (s *mspan) isFree(index uintptr) bool { if index < s.freeindex { return false diff --git a/src/runtime/mgcmark.go b/src/runtime/mgcmark.go index 03c64c4b11375..86416caab5288 100644 --- a/src/runtime/mgcmark.go +++ b/src/runtime/mgcmark.go @@ -558,7 +558,7 @@ func gcWakeAllAssists() { // gcParkAssist puts the current goroutine on the assist queue and parks. // -// gcParkAssist returns whether the assist is now satisfied. If it +// gcParkAssist reports whether the assist is now satisfied. If it // returns false, the caller must retry the assist. // //go:nowritebarrier diff --git a/src/runtime/pprof/internal/profile/filter.go b/src/runtime/pprof/internal/profile/filter.go index 1baa096a49c80..9cad866df8c7f 100644 --- a/src/runtime/pprof/internal/profile/filter.go +++ b/src/runtime/pprof/internal/profile/filter.go @@ -55,7 +55,7 @@ func (p *Profile) FilterSamplesByName(focus, ignore, hide *regexp.Regexp) (fm, i return } -// matchesName returns whether the function name or file in the +// matchesName reports whether the function name or file in the // location matches the regular expression. func (loc *Location) matchesName(re *regexp.Regexp) bool { for _, ln := range loc.Line { diff --git a/src/runtime/proc.go b/src/runtime/proc.go index b78eff8ff6c52..409869fd1071e 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -4592,7 +4592,7 @@ func schedEnableUser(enable bool) { } } -// schedEnabled returns whether gp should be scheduled. It returns +// schedEnabled reports whether gp should be scheduled. It returns // false is scheduling of gp is disabled. func schedEnabled(gp *g) bool { if sched.disable.user { diff --git a/src/runtime/select.go b/src/runtime/select.go index 2729c2ecf98a2..85be1bc64da0f 100644 --- a/src/runtime/select.go +++ b/src/runtime/select.go @@ -110,7 +110,7 @@ func block() { // // selectgo returns the index of the chosen scase, which matches the // ordinal position of its respective select{recv,send,default} call. -// Also, if the chosen scase was a receive operation, it returns whether +// Also, if the chosen scase was a receive operation, it reports whether // a value was received. func selectgo(cas0 *scase, order0 *uint16, ncases int) (int, bool) { if debugSelect { diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go index 12a938c8c9307..15f1799801921 100644 --- a/src/runtime/signal_unix.go +++ b/src/runtime/signal_unix.go @@ -773,7 +773,7 @@ func unminitSignals() { } } -// blockableSig returns whether sig may be blocked by the signal mask. +// blockableSig reports whether sig may be blocked by the signal mask. // We never want to block the signals marked _SigUnblock; // these are the synchronous signals that turn into a Go panic. // In a Go program--not a c-archive/c-shared--we never want to block diff --git a/src/runtime/stubs.go b/src/runtime/stubs.go index 0d5503a6f52a7..d4698e805c7c2 100644 --- a/src/runtime/stubs.go +++ b/src/runtime/stubs.go @@ -298,7 +298,7 @@ func round(n, a uintptr) uintptr { return (n + a - 1) &^ (a - 1) } -// checkASM returns whether assembly runtime checks have passed. +// checkASM reports whether assembly runtime checks have passed. func checkASM() bool func memequal_varlen(a, b unsafe.Pointer) bool diff --git a/src/runtime/trace/annotation.go b/src/runtime/trace/annotation.go index d5a7d003fe2fc..82cb232dba95e 100644 --- a/src/runtime/trace/annotation.go +++ b/src/runtime/trace/annotation.go @@ -171,7 +171,7 @@ func (r *Region) End() { userRegion(r.id, regionEndCode, r.regionType) } -// IsEnabled returns whether tracing is enabled. +// IsEnabled reports whether tracing is enabled. // The information is advisory only. The tracing status // may have changed by the time this function returns. func IsEnabled() bool { diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 9d2f7f037c829..0328fee4e640d 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -876,7 +876,7 @@ func isExportedRuntime(name string) bool { return len(name) > n && name[:n] == "runtime." && 'A' <= name[n] && name[n] <= 'Z' } -// elideWrapperCalling returns whether a wrapper function that called +// elideWrapperCalling reports whether a wrapper function that called // function "name" should be elided from stack traces. func elideWrapperCalling(name string) bool { // If the wrapper called a panic function instead of the diff --git a/src/runtime/vdso_linux.go b/src/runtime/vdso_linux.go index 9827874beabcf..71ba4ce4161b6 100644 --- a/src/runtime/vdso_linux.go +++ b/src/runtime/vdso_linux.go @@ -280,7 +280,7 @@ func vdsoauxv(tag, val uintptr) { } } -// vdsoMarker returns whether PC is on the VDSO page. +// vdsoMarker reports whether PC is on the VDSO page. func inVDSOPage(pc uintptr) bool { for _, k := range vdsoSymbolKeys { if *k.ptr != 0 { diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go index 90f86dc373ad2..8dd8cbc17e267 100644 --- a/src/testing/benchmark.go +++ b/src/testing/benchmark.go @@ -230,7 +230,7 @@ func roundUp(n int) int { } } -// run1 runs the first iteration of benchFunc. It returns whether more +// run1 runs the first iteration of benchFunc. It reports whether more // iterations of this benchmarks should be run. func (b *B) run1() bool { if ctx := b.context; ctx != nil { diff --git a/src/time/zoneinfo.go b/src/time/zoneinfo.go index 54c76f09e1467..7dffbfad5e47d 100644 --- a/src/time/zoneinfo.go +++ b/src/time/zoneinfo.go @@ -205,7 +205,7 @@ func (l *Location) lookupFirstZone() int { return 0 } -// firstZoneUsed returns whether the first zone is used by some +// firstZoneUsed reports whether the first zone is used by some // transition. func (l *Location) firstZoneUsed() bool { for _, tx := range l.tx { From b3294d9491b898396e134bad5412d85337c37b64 Mon Sep 17 00:00:00 2001 From: David Chase Date: Thu, 1 Nov 2018 15:26:02 -0400 Subject: [PATCH 203/594] cmd/compile: for location lists, handle case where prev block is not a pred Before this change, location list construction would extend from the previous (in linear order) block, even if was not a flow predecessor. This can cause a debugger to tell lies. Fix accounts for this in block merging code by (crudely) "changing" all variables live from a previous block if it is not also a predecessor. Fixes #28486. Change-Id: I11336b0b969f0cd09f40f4e5f2bdfdeb02f377a4 Reviewed-on: https://go-review.googlesource.com/c/146718 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick --- src/cmd/compile/internal/ssa/debug.go | 92 ++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 17 deletions(-) diff --git a/src/cmd/compile/internal/ssa/debug.go b/src/cmd/compile/internal/ssa/debug.go index b6c25f6573dff..7407a75c41c33 100644 --- a/src/cmd/compile/internal/ssa/debug.go +++ b/src/cmd/compile/internal/ssa/debug.go @@ -456,7 +456,7 @@ func (state *debugState) liveness() []*BlockDebug { // Build the starting state for the block from the final // state of its predecessors. - startState, startValid := state.mergePredecessors(b, blockLocs) + startState, startValid := state.mergePredecessors(b, blockLocs, nil) changed := false if state.loggingEnabled { state.logf("Processing %v, initial state:\n%v", b, state.stateString(state.currentState)) @@ -518,9 +518,13 @@ func (state *debugState) liveness() []*BlockDebug { } // mergePredecessors takes the end state of each of b's predecessors and -// intersects them to form the starting state for b. It returns that state in -// the BlockDebug, and fills state.currentState with it. -func (state *debugState) mergePredecessors(b *Block, blockLocs []*BlockDebug) ([]liveSlot, bool) { +// intersects them to form the starting state for b. It puts that state in +// blockLocs, and fills state.currentState with it. If convenient, it returns +// a reused []liveSlot, true that represents the starting state. +// If previousBlock is non-nil, it registers changes vs. that block's end +// state in state.changedVars. Note that previousBlock will often not be a +// predecessor. +func (state *debugState) mergePredecessors(b *Block, blockLocs []*BlockDebug, previousBlock *Block) ([]liveSlot, bool) { // Filter out back branches. var predsBuf [10]*Block preds := predsBuf[:0] @@ -538,31 +542,68 @@ func (state *debugState) mergePredecessors(b *Block, blockLocs []*BlockDebug) ([ state.logf("Merging %v into %v\n", preds2, b) } + // TODO all the calls to this are overkill; only need to do this for slots that are not present in the merge. + markChangedVars := func(slots []liveSlot) { + for _, live := range slots { + state.changedVars.add(ID(state.slotVars[live.slot])) + } + } + if len(preds) == 0 { + if previousBlock != nil { + // Mark everything in previous block as changed because it is not a predecessor. + markChangedVars(blockLocs[previousBlock.ID].endState) + } state.currentState.reset(nil) return nil, true } p0 := blockLocs[preds[0].ID].endState if len(preds) == 1 { + if previousBlock != nil && preds[0].ID != previousBlock.ID { + // Mark everything in previous block as changed because it is not a predecessor. + markChangedVars(blockLocs[previousBlock.ID].endState) + } state.currentState.reset(p0) return p0, true } + baseID := preds[0].ID + baseState := p0 + + // If previous block is not a predecessor, its location information changes at boundary with this block. + previousBlockIsNotPredecessor := previousBlock != nil // If it's nil, no info to change. + + if previousBlock != nil { + // Try to use previousBlock as the base state + // if possible. + for _, pred := range preds[1:] { + if pred.ID == previousBlock.ID { + baseID = pred.ID + baseState = blockLocs[pred.ID].endState + previousBlockIsNotPredecessor = false + break + } + } + } + if state.loggingEnabled { - state.logf("Starting %v with state from %v:\n%v", b, preds[0], state.blockEndStateString(blockLocs[preds[0].ID])) + state.logf("Starting %v with state from b%v:\n%v", b, baseID, state.blockEndStateString(blockLocs[baseID])) } slotLocs := state.currentState.slots - for _, predSlot := range p0 { + for _, predSlot := range baseState { slotLocs[predSlot.slot] = VarLoc{predSlot.Registers, predSlot.StackOffset} state.liveCount[predSlot.slot] = 1 } - for i := 1; i < len(preds); i++ { + for _, pred := range preds { + if pred.ID == baseID { + continue + } if state.loggingEnabled { - state.logf("Merging in state from %v:\n%v", preds[i], state.blockEndStateString(blockLocs[preds[i].ID])) + state.logf("Merging in state from %v:\n%v", pred, state.blockEndStateString(blockLocs[pred.ID])) } - for _, predSlot := range blockLocs[preds[i].ID].endState { + for _, predSlot := range blockLocs[pred.ID].endState { state.liveCount[predSlot.slot]++ liveLoc := slotLocs[predSlot.slot] if !liveLoc.onStack() || !predSlot.onStack() || liveLoc.StackOffset != predSlot.StackOffset { @@ -577,7 +618,7 @@ func (state *debugState) mergePredecessors(b *Block, blockLocs []*BlockDebug) ([ // final state, and reuse it if so. In principle it could match any, // but it's probably not worth checking more than the first. unchanged := true - for _, predSlot := range p0 { + for _, predSlot := range baseState { if state.liveCount[predSlot.slot] != len(preds) || slotLocs[predSlot.slot].Registers != predSlot.Registers || slotLocs[predSlot.slot].StackOffset != predSlot.StackOffset { @@ -587,10 +628,14 @@ func (state *debugState) mergePredecessors(b *Block, blockLocs []*BlockDebug) ([ } if unchanged { if state.loggingEnabled { - state.logf("After merge, %v matches %v exactly.\n", b, preds[0]) + state.logf("After merge, %v matches b%v exactly.\n", b, baseID) } - state.currentState.reset(p0) - return p0, true + if previousBlockIsNotPredecessor { + // Mark everything in previous block as changed because it is not a predecessor. + markChangedVars(blockLocs[previousBlock.ID].endState) + } + state.currentState.reset(baseState) + return baseState, true } for reg := range state.currentState.registers { @@ -599,7 +644,7 @@ func (state *debugState) mergePredecessors(b *Block, blockLocs []*BlockDebug) ([ // A slot is live if it was seen in all predecessors, and they all had // some storage in common. - for _, predSlot := range p0 { + for _, predSlot := range baseState { slotLoc := slotLocs[predSlot.slot] if state.liveCount[predSlot.slot] != len(preds) { @@ -616,10 +661,15 @@ func (state *debugState) mergePredecessors(b *Block, blockLocs []*BlockDebug) ([ } reg := uint8(bits.TrailingZeros64(mask)) mask &^= 1 << reg - state.currentState.registers[reg] = append(state.currentState.registers[reg], predSlot.slot) } } + + if previousBlockIsNotPredecessor { + // Mark everything in previous block as changed because it is not a predecessor. + markChangedVars(blockLocs[previousBlock.ID].endState) + + } return nil, false } @@ -827,13 +877,19 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) { // Run through the function in program text order, building up location // lists as we go. The heavy lifting has mostly already been done. + var prevBlock *Block for _, b := range state.f.Blocks { + state.mergePredecessors(b, blockLocs, prevBlock) + + // Handle any differences among predecessor blocks and previous block (perhaps not a predecessor) + for _, varID := range state.changedVars.contents() { + state.updateVar(VarID(varID), b, BlockStart) + } + if !blockLocs[b.ID].relevant { continue } - state.mergePredecessors(b, blockLocs) - zeroWidthPending := false apcChangedSize := 0 // size of changedVars for leading Args, Phi, ClosurePtr // expect to see values in pattern (apc)* (zerowidth|real)* @@ -881,6 +937,8 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) { state.updateVar(VarID(varID), b, BlockEnd) } } + + prevBlock = b } if state.loggingEnabled { From 1adbb2bb9b256907eaf3f012d7f818765e6e2a2b Mon Sep 17 00:00:00 2001 From: Leon Klingele Date: Mon, 3 Dec 2018 04:44:48 +0000 Subject: [PATCH 204/594] net/http: add StatusTooEarly (425) StatusTooEarly can be returned to indicate that a server is unwilling to accept early data as introduced in TLS 1.3. The status code was specified in RFC 8470, section 5.2. Major supported browsers are: - Firefox as of version 58 https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/425#Browser_compatibility - Chromium as of version 73.0.3628.1 https://chromium.googlesource.com/chromium/src/+/58097ec3823e0f340ab5abfcaec1306e1d954c5a Change-Id: I3f62f4193bae198994d08fde7e92e0ccd080e59a GitHub-Last-Rev: fa885040eaf80e0e33b571567108d8a9ded67801 GitHub-Pull-Request: golang/go#29073 Reviewed-on: https://go-review.googlesource.com/c/152118 Reviewed-by: Brad Fitzpatrick --- src/net/http/status.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/net/http/status.go b/src/net/http/status.go index dd72d67be911d..086f3d1a71ed5 100644 --- a/src/net/http/status.go +++ b/src/net/http/status.go @@ -55,6 +55,7 @@ const ( StatusUnprocessableEntity = 422 // RFC 4918, 11.2 StatusLocked = 423 // RFC 4918, 11.3 StatusFailedDependency = 424 // RFC 4918, 11.4 + StatusTooEarly = 425 // RFC 8470, 5.2. StatusUpgradeRequired = 426 // RFC 7231, 6.5.15 StatusPreconditionRequired = 428 // RFC 6585, 3 StatusTooManyRequests = 429 // RFC 6585, 4 @@ -122,6 +123,7 @@ var statusText = map[int]string{ StatusUnprocessableEntity: "Unprocessable Entity", StatusLocked: "Locked", StatusFailedDependency: "Failed Dependency", + StatusTooEarly: "Too Early", StatusUpgradeRequired: "Upgrade Required", StatusPreconditionRequired: "Precondition Required", StatusTooManyRequests: "Too Many Requests", From 5bd7e9c54f946eec95d32762e7e9e1222504bfc1 Mon Sep 17 00:00:00 2001 From: Carlo Alberto Ferraris Date: Sun, 15 Apr 2018 11:34:19 +0900 Subject: [PATCH 205/594] net: enable TCP keepalives by default This is just the first step in attempting to make all network connection have timeouts as a "safe default". TCP keepalives only protect against certain classes of network and host issues (e.g. server/OS crash), but do nothing against application-level issues (e.g. an application that accepts connections but then fails to serve requests). The actual keep-alive duration (15s) is chosen to cause broken connections to be closed after 2~3 minutes (depending on the OS, see #23549 for details). We don't make the actual default value part of the public API for a number of reasons: - because it's not very useful by itself: as discussed in #23549 the actual "timeout" after which the connection is torn down is duration*(KEEPCNT+1), and we use the OS-wide value for KEEPCNT because there's currently no way to set it from Go. - because it may change in the future: if users need to rely on a specific value they should explicitly set this value instead of relying on the default. Fixes #23459 Change-Id: I348c03be97588d5001e6de0f377e7a93b51957fd Reviewed-on: https://go-review.googlesource.com/c/107196 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/dial.go | 14 ++++++++++---- src/net/dial_test.go | 27 +++++++++++++++++---------- src/net/hook.go | 7 +++++-- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/net/dial.go b/src/net/dial.go index 76dcdc164cabd..1dd8690739ef6 100644 --- a/src/net/dial.go +++ b/src/net/dial.go @@ -65,8 +65,10 @@ type Dialer struct { // KeepAlive specifies the keep-alive period for an active // network connection. - // If zero, keep-alives are not enabled. Network protocols + // If zero, keep-alives are enabled if supported by the protocol + // and operating system. Network protocols or operating systems // that do not support keep-alives ignore this field. + // If negative, keep-alives are disabled. KeepAlive time.Duration // Resolver optionally specifies an alternate resolver to use. @@ -418,10 +420,14 @@ func (d *Dialer) DialContext(ctx context.Context, network, address string) (Conn return nil, err } - if tc, ok := c.(*TCPConn); ok && d.KeepAlive > 0 { + if tc, ok := c.(*TCPConn); ok && d.KeepAlive >= 0 { setKeepAlive(tc.fd, true) - setKeepAlivePeriod(tc.fd, d.KeepAlive) - testHookSetKeepAlive() + ka := d.KeepAlive + if d.KeepAlive == 0 { + ka = 15 * time.Second + } + setKeepAlivePeriod(tc.fd, ka) + testHookSetKeepAlive(ka) } return c, nil } diff --git a/src/net/dial_test.go b/src/net/dial_test.go index 983338885dac5..3a2c59a2d1d6b 100644 --- a/src/net/dial_test.go +++ b/src/net/dial_test.go @@ -729,22 +729,29 @@ func TestDialerKeepAlive(t *testing.T) { if err := ls.buildup(handler); err != nil { t.Fatal(err) } - defer func() { testHookSetKeepAlive = func() {} }() + defer func() { testHookSetKeepAlive = func(time.Duration) {} }() - for _, keepAlive := range []bool{false, true} { - got := false - testHookSetKeepAlive = func() { got = true } - var d Dialer - if keepAlive { - d.KeepAlive = 30 * time.Second - } + tests := []struct { + ka time.Duration + expected time.Duration + }{ + {-1, -1}, + {0, 15 * time.Second}, + {5 * time.Second, 5 * time.Second}, + {30 * time.Second, 30 * time.Second}, + } + + for _, test := range tests { + var got time.Duration = -1 + testHookSetKeepAlive = func(d time.Duration) { got = d } + d := Dialer{KeepAlive: test.ka} c, err := d.Dial("tcp", ls.Listener.Addr().String()) if err != nil { t.Fatal(err) } c.Close() - if got != keepAlive { - t.Errorf("Dialer.KeepAlive = %v: SetKeepAlive called = %v, want %v", d.KeepAlive, got, !got) + if got != test.expected { + t.Errorf("Dialer.KeepAlive = %v: SetKeepAlive set to %v, want %v", d.KeepAlive, got, test.expected) } } } diff --git a/src/net/hook.go b/src/net/hook.go index 5a1156378b569..ea71803e22a70 100644 --- a/src/net/hook.go +++ b/src/net/hook.go @@ -4,7 +4,10 @@ package net -import "context" +import ( + "context" + "time" +) var ( // if non-nil, overrides dialTCP. @@ -19,5 +22,5 @@ var ( ) ([]IPAddr, error) { return fn(ctx, network, host) } - testHookSetKeepAlive = func() {} + testHookSetKeepAlive = func(time.Duration) {} ) From 4a1a783ddafd1ac2349d07292f7a00816e50a4e5 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sat, 1 Dec 2018 13:21:04 -0800 Subject: [PATCH 206/594] cmd/compile: fix static initializer staticcopy of a struct or array should recursively call itself, not staticassign. This fixes an issue where a struct with a slice in it is copied during static initialization. In this case, the backing array for the slice is duplicated, and each copy of the slice refers to a different backing array, which is incorrect. That issue has existed since at least Go 1.2. I'm not sure why this was never noticed. It seems like a pretty obvious bug if anyone modifies the resulting slice. In any case, we started to notice when the optimization in CL 140301 landed. Here is basically what happens in issue29013b.go: 1) The error above happens, so we get two backing stores for what should be the same slice. 2) The code for initializing those backing stores is reused. But not duplicated: they are the same Node structure. 3) The order pass allocates temporaries for the map operations. For the first instance, things work fine and two temporaries are allocated and stored in the OKEY nodes. For the second instance, the order pass decides new temporaries aren't needed, because the OKEY nodes already have temporaries in them. But the order pass also puts a VARKILL of the temporaries between the two instance initializations. 4) In this state, the code is technically incorrect. But before CL 140301 it happens to work because the temporaries are still correctly initialized when they are used for the second time. But then... 5) The new CL 140301 sees the VARKILLs and decides to reuse the temporary for instance 1 map 2 to initialize the instance 2 map 1 map. Because the keys aren't re-initialized, instance 2 map 1 gets the wrong key inserted into it. Fixes #29013 Change-Id: I840ce1b297d119caa706acd90e1517a5e47e9848 Reviewed-on: https://go-review.googlesource.com/c/152081 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Josh Bleecher Snyder --- src/cmd/compile/internal/gc/sinit.go | 2 +- test/fixedbugs/issue29013a.go | 24 ++++++++++++++++ test/fixedbugs/issue29013b.go | 43 ++++++++++++++++++++++++++++ test/sinit.go | 6 ---- 4 files changed, 68 insertions(+), 7 deletions(-) create mode 100644 test/fixedbugs/issue29013a.go create mode 100644 test/fixedbugs/issue29013b.go diff --git a/src/cmd/compile/internal/gc/sinit.go b/src/cmd/compile/internal/gc/sinit.go index 56c63065b222a..de0298b746fe4 100644 --- a/src/cmd/compile/internal/gc/sinit.go +++ b/src/cmd/compile/internal/gc/sinit.go @@ -350,7 +350,7 @@ func staticcopy(l *Node, r *Node, out *[]*Node) bool { continue } ll := n.sepcopy() - if staticassign(ll, e.Expr, out) { + if staticcopy(ll, e.Expr, out) { continue } // Requires computation, but we're diff --git a/test/fixedbugs/issue29013a.go b/test/fixedbugs/issue29013a.go new file mode 100644 index 0000000000000..efc50dfb1f281 --- /dev/null +++ b/test/fixedbugs/issue29013a.go @@ -0,0 +1,24 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +type TestSuite struct { + Tests []int +} + +var Suites = []TestSuite{ + Dicts, +} +var Dicts = TestSuite{ + Tests: []int{0}, +} + +func main() { + if &Dicts.Tests[0] != &Suites[0].Tests[0] { + panic("bad") + } +} diff --git a/test/fixedbugs/issue29013b.go b/test/fixedbugs/issue29013b.go new file mode 100644 index 0000000000000..b8502dad9b5a1 --- /dev/null +++ b/test/fixedbugs/issue29013b.go @@ -0,0 +1,43 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +type TestSuite struct { + Tests []Test +} +type Test struct { + Want interface{} +} +type Int struct { + i int +} + +func NewInt(v int) Int { + return Int{i: v} +} + +var Suites = []TestSuite{ + Dicts, +} +var Dicts = TestSuite{ + Tests: []Test{ + { + Want: map[Int]bool{NewInt(1): true}, + }, + { + Want: map[Int]string{ + NewInt(3): "3", + }, + }, + }, +} + +func main() { + if Suites[0].Tests[0].Want.(map[Int]bool)[NewInt(3)] { + panic("bad") + } +} diff --git a/test/sinit.go b/test/sinit.go index c4d0edf87136a..df4d50d36769c 100644 --- a/test/sinit.go +++ b/test/sinit.go @@ -43,15 +43,12 @@ var c = []int{1201, 1202, 1203} var aa = [3][3]int{[3]int{2001, 2002, 2003}, [3]int{2004, 2005, 2006}, [3]int{2007, 2008, 2009}} var as = [3]S{S{2101, 2102, 2103}, S{2104, 2105, 2106}, S{2107, 2108, 2109}} -var ac = [3][]int{[]int{2201, 2202, 2203}, []int{2204, 2205, 2206}, []int{2207, 2208, 2209}} var sa = SA{[3]int{3001, 3002, 3003}, [3]int{3004, 3005, 3006}, [3]int{3007, 3008, 3009}} var ss = SS{S{3101, 3102, 3103}, S{3104, 3105, 3106}, S{3107, 3108, 3109}} -var sc = SC{[]int{3201, 3202, 3203}, []int{3204, 3205, 3206}, []int{3207, 3208, 3209}} var ca = [][3]int{[3]int{4001, 4002, 4003}, [3]int{4004, 4005, 4006}, [3]int{4007, 4008, 4009}} var cs = []S{S{4101, 4102, 4103}, S{4104, 4105, 4106}, S{4107, 4108, 4109}} -var cc = [][]int{[]int{4201, 4202, 4203}, []int{4204, 4205, 4206}, []int{4207, 4208, 4209}} var answers = [...]int{ // s @@ -135,15 +132,12 @@ var copy_c = c var copy_aa = aa var copy_as = as -var copy_ac = ac var copy_sa = sa var copy_ss = ss -var copy_sc = sc var copy_ca = ca var copy_cs = cs -var copy_cc = cc var copy_answers = answers From cef41e0d4b121ed31173a613039c32f5dd2e07f5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Dec 2018 11:23:15 -0800 Subject: [PATCH 207/594] misc/cgo/testcshared: don't run TestGo2C2Go on Darwin Darwin doesn't support the multiple copies of the runtime package implied by linking a c-shared library into a Go program. Updates #29061 Change-Id: I6cf5d00babf82f1de05689c1345aaa5ae0b0659c Reviewed-on: https://go-review.googlesource.com/c/152159 Run-TryBot: Ian Lance Taylor Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- misc/cgo/testcshared/cshared_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index fa2af2842dfa6..7cc02f61942e7 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -604,6 +604,12 @@ func copyFile(t *testing.T, dst, src string) { } func TestGo2C2Go(t *testing.T) { + if GOOS == "darwin" { + // Darwin shared libraries don't support the multiple + // copies of the runtime package implied by this test. + t.Skip("linking c-shared into Go programs not supported on Darwin; issue 29061") + } + t.Parallel() tmpdir, err := ioutil.TempDir("", "cshared-TestGo2C2Go") From f98081e51585ebb6c321ee2145b1e38312759ea3 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 3 Dec 2018 17:01:18 +0000 Subject: [PATCH 208/594] net/http: document CanonicalHeaderKey from Header And remove some unnecessary textproto references. (The net/http package's CanonicalHeaderKey just calls textproto's CanonicalMIMEHeaderKey) Fixes #28894 Change-Id: Ibd277893a168368c593147a2677ad6130870cb88 Reviewed-on: https://go-review.googlesource.com/c/152157 Reviewed-by: Ian Lance Taylor --- src/net/http/header.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/net/http/header.go b/src/net/http/header.go index 6cf13e5c44126..b699e7ef8ffb1 100644 --- a/src/net/http/header.go +++ b/src/net/http/header.go @@ -15,12 +15,15 @@ import ( ) // A Header represents the key-value pairs in an HTTP header. +// +// The keys should be in canonical form, as returned by +// CanonicalHeaderKey. type Header map[string][]string // Add adds the key, value pair to the header. // It appends to any existing values associated with key. // The key is case insensitive; it is canonicalized by -// textproto.CanonicalMIMEHeaderKey. +// CanonicalHeaderKey. func (h Header) Add(key, value string) { textproto.MIMEHeader(h).Add(key, value) } @@ -61,7 +64,7 @@ func (h Header) has(key string) bool { // Del deletes the values associated with key. // The key is case insensitive; it is canonicalized by -// textproto.CanonicalMIMEHeaderKey. +// CanonicalHeaderKey. func (h Header) Del(key string) { textproto.MIMEHeader(h).Del(key) } From 54cbc5b4bf554742b7037308bd45da010340628d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Dec 2018 10:53:10 -0800 Subject: [PATCH 209/594] cmd/cgo: use a plausible position for typedef error messages Fixes #28069 Change-Id: I7e0f96b8b6d123de283325fcb78ec76455050f6d Reviewed-on: https://go-review.googlesource.com/c/152158 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- misc/cgo/errors/errors_test.go | 7 ++++++- misc/cgo/errors/src/issue28069.go | 26 +++++++++++++++++++++++ src/cmd/cgo/gcc.go | 35 +++++++++++++++++-------------- src/cmd/cgo/main.go | 9 +++++++- 4 files changed, 59 insertions(+), 18 deletions(-) create mode 100644 misc/cgo/errors/src/issue28069.go diff --git a/misc/cgo/errors/errors_test.go b/misc/cgo/errors/errors_test.go index 118187f23b8e7..0d7ca4cf9d89c 100644 --- a/misc/cgo/errors/errors_test.go +++ b/misc/cgo/errors/errors_test.go @@ -126,7 +126,12 @@ func TestReportsTypeErrors(t *testing.T) { } if sizeofLongDouble(t) > 8 { - check(t, "err4.go") + for _, file := range []string{ + "err4.go", + "issue28069.go", + } { + check(t, file) + } } } diff --git a/misc/cgo/errors/src/issue28069.go b/misc/cgo/errors/src/issue28069.go new file mode 100644 index 0000000000000..e19a3b45bd58c --- /dev/null +++ b/misc/cgo/errors/src/issue28069.go @@ -0,0 +1,26 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test that the error message for an unrepresentable typedef in a +// union appears on the right line. This test is only run if the size +// of long double is larger than 64. + +package main + +/* +typedef long double Float128; + +typedef struct SV { + union { + Float128 float128; + } value; +} SV; +*/ +import "C" + +type ts struct { + tv *C.SV // ERROR HERE +} + +func main() {} diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 3c96af2be61bd..4464b840dd69c 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -171,11 +171,13 @@ func (p *Package) Translate(f *File) { for len(p.typedefs) > numTypedefs { numTypedefs = len(p.typedefs) // Also ask about any typedefs we've seen so far. - for _, a := range p.typedefList { - f.Name[a] = &Name{ - Go: a, - C: a, + for _, info := range p.typedefList { + n := &Name{ + Go: info.typedef, + C: info.typedef, } + f.Name[info.typedef] = n + f.NamePos[n] = info.pos } needType := p.guessKinds(f) if len(needType) > 0 { @@ -573,7 +575,7 @@ func (p *Package) loadDWARF(f *File, names []*Name) { fatalf("malformed __cgo__ name: %s", name) } types[i] = t.Type - p.recordTypedefs(t.Type) + p.recordTypedefs(t.Type, f.NamePos[names[i]]) } if e.Tag != dwarf.TagCompileUnit { r.SkipChildren() @@ -641,10 +643,11 @@ func (p *Package) loadDWARF(f *File, names []*Name) { } // recordTypedefs remembers in p.typedefs all the typedefs used in dtypes and its children. -func (p *Package) recordTypedefs(dtype dwarf.Type) { - p.recordTypedefs1(dtype, map[dwarf.Type]bool{}) +func (p *Package) recordTypedefs(dtype dwarf.Type, pos token.Pos) { + p.recordTypedefs1(dtype, pos, map[dwarf.Type]bool{}) } -func (p *Package) recordTypedefs1(dtype dwarf.Type, visited map[dwarf.Type]bool) { + +func (p *Package) recordTypedefs1(dtype dwarf.Type, pos token.Pos, visited map[dwarf.Type]bool) { if dtype == nil { return } @@ -660,23 +663,23 @@ func (p *Package) recordTypedefs1(dtype dwarf.Type, visited map[dwarf.Type]bool) } if !p.typedefs[dt.Name] { p.typedefs[dt.Name] = true - p.typedefList = append(p.typedefList, dt.Name) - p.recordTypedefs1(dt.Type, visited) + p.typedefList = append(p.typedefList, typedefInfo{dt.Name, pos}) + p.recordTypedefs1(dt.Type, pos, visited) } case *dwarf.PtrType: - p.recordTypedefs1(dt.Type, visited) + p.recordTypedefs1(dt.Type, pos, visited) case *dwarf.ArrayType: - p.recordTypedefs1(dt.Type, visited) + p.recordTypedefs1(dt.Type, pos, visited) case *dwarf.QualType: - p.recordTypedefs1(dt.Type, visited) + p.recordTypedefs1(dt.Type, pos, visited) case *dwarf.FuncType: - p.recordTypedefs1(dt.ReturnType, visited) + p.recordTypedefs1(dt.ReturnType, pos, visited) for _, a := range dt.ParamType { - p.recordTypedefs1(a, visited) + p.recordTypedefs1(a, pos, visited) } case *dwarf.StructType: for _, f := range dt.Field { - p.recordTypedefs1(f.Type, visited) + p.recordTypedefs1(f.Type, pos, visited) } } } diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index e28a57b1481d0..7a845b17a4e77 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -47,7 +47,14 @@ type Package struct { GccFiles []string // list of gcc output files Preamble string // collected preamble for _cgo_export.h typedefs map[string]bool // type names that appear in the types of the objects we're interested in - typedefList []string + typedefList []typedefInfo +} + +// A typedefInfo is an element on Package.typedefList: a typedef name +// and the position where it was required. +type typedefInfo struct { + typedef string + pos token.Pos } // A File collects information about a single Go input file. From a48a15cd502395627293f85cdbe23aebc3e7e95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Mon, 3 Dec 2018 21:03:02 +0000 Subject: [PATCH 210/594] cmd/vendor: update to golang.org/x/tools@e5f3ab76 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To pull in the fix for #28858, which we want to include for Go 1.12. Fixes #28858. Change-Id: Id4964cfd38e3d44d6317a2ee124fe2d35038b5fd Reviewed-on: https://go-review.googlesource.com/c/152277 Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot Reviewed-by: Alan Donovan --- .../analysis/internal/analysisflags/help.go | 2 +- .../tools/go/analysis/passes/printf/printf.go | 4 +- .../tools/go/analysis/passes/printf/types.go | 13 ++-- .../x/tools/go/analysis/unitchecker/main.go | 64 +++++++++++++++++++ .../go/analysis/unitchecker/unitchecker.go | 2 +- 5 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go index 66aa624572ace..043b97896dd61 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go @@ -18,7 +18,7 @@ string. It uses heuristics that do not guarantee all reports are genuine problems, but it can find errors not caught by the compilers. ` -// Help implements the help subcommand for a multichecker or vet-lite +// Help implements the help subcommand for a multichecker or unitchecker // style command. The optional args specify the analyzers to describe. // Help calls log.Fatal if no such analyzer exists. func Help(progname string, analyzers []*analysis.Analyzer, args []string) { diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go index 9fa0a1c603c7d..c0265aafeee7f 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go @@ -714,7 +714,7 @@ var printVerbs = []printVerb{ // '#' is alternate format for several verbs. // ' ' is spacer for numbers {'%', noFlag, 0}, - {'b', numFlag, argInt | argFloat | argComplex}, + {'b', numFlag, argInt | argFloat | argComplex | argPointer}, {'c', "-", argRune | argInt}, {'d', numFlag, argInt | argPointer}, {'e', sharpNumFlag, argFloat | argComplex}, @@ -723,7 +723,7 @@ var printVerbs = []printVerb{ {'F', sharpNumFlag, argFloat | argComplex}, {'g', sharpNumFlag, argFloat | argComplex}, {'G', sharpNumFlag, argFloat | argComplex}, - {'o', sharpNumFlag, argInt}, + {'o', sharpNumFlag, argInt | argPointer}, {'p', "-#", argPointer}, {'q', " -+.0#", argRune | argInt | argString}, {'s', " -+.0", argString}, diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go index 0ebc8107f3db8..e8810464cd420 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go @@ -56,11 +56,11 @@ func matchArgTypeInternal(pass *analysis.Pass, t printfArgType, typ types.Type, switch typ := typ.(type) { case *types.Signature: - return t&argPointer != 0 + return t == argPointer case *types.Map: - // Recur: map[int]int matches %d. - return t&argPointer != 0 || + return t == argPointer || + // Recur: map[int]int matches %d. (matchArgTypeInternal(pass, t, typ.Key(), arg, inProgress) && matchArgTypeInternal(pass, t, typ.Elem(), arg, inProgress)) case *types.Chan: @@ -72,17 +72,20 @@ func matchArgTypeInternal(pass *analysis.Pass, t printfArgType, typ types.Type, return true // %s matches []byte } // Recur: []int matches %d. - return t&argPointer != 0 || matchArgTypeInternal(pass, t, typ.Elem(), arg, inProgress) + return matchArgTypeInternal(pass, t, typ.Elem(), arg, inProgress) case *types.Slice: // Same as array. if types.Identical(typ.Elem().Underlying(), types.Typ[types.Byte]) && t&argString != 0 { return true // %s matches []byte } + if t == argPointer { + return true // %p prints a slice's 0th element + } // Recur: []int matches %d. But watch out for // type T []T // If the element is a pointer type (type T[]*T), it's handled fine by the Pointer case below. - return t&argPointer != 0 || matchArgTypeInternal(pass, t, typ.Elem(), arg, inProgress) + return matchArgTypeInternal(pass, t, typ.Elem(), arg, inProgress) case *types.Pointer: // Ugly, but dealing with an edge case: a known pointer to an invalid type, diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go new file mode 100644 index 0000000000000..844e8f3dac2c4 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go @@ -0,0 +1,64 @@ +// +build ignore + +// This file provides an example command for static checkers +// conforming to the golang.org/x/tools/go/analysis API. +// It serves as a model for the behavior of the cmd/vet tool in $GOROOT. +// Being based on the unitchecker driver, it must be run by go vet: +// +// $ go build -o unitchecker main.go +// $ go vet -vettool=unitchecker my/project/... +// +// For a checker also capable of running standalone, use multichecker. +package main + +import ( + "golang.org/x/tools/go/analysis/unitchecker" + + "golang.org/x/tools/go/analysis/passes/asmdecl" + "golang.org/x/tools/go/analysis/passes/assign" + "golang.org/x/tools/go/analysis/passes/atomic" + "golang.org/x/tools/go/analysis/passes/bools" + "golang.org/x/tools/go/analysis/passes/buildtag" + "golang.org/x/tools/go/analysis/passes/cgocall" + "golang.org/x/tools/go/analysis/passes/composite" + "golang.org/x/tools/go/analysis/passes/copylock" + "golang.org/x/tools/go/analysis/passes/httpresponse" + "golang.org/x/tools/go/analysis/passes/loopclosure" + "golang.org/x/tools/go/analysis/passes/lostcancel" + "golang.org/x/tools/go/analysis/passes/nilfunc" + "golang.org/x/tools/go/analysis/passes/printf" + "golang.org/x/tools/go/analysis/passes/shift" + "golang.org/x/tools/go/analysis/passes/stdmethods" + "golang.org/x/tools/go/analysis/passes/structtag" + "golang.org/x/tools/go/analysis/passes/tests" + "golang.org/x/tools/go/analysis/passes/unmarshal" + "golang.org/x/tools/go/analysis/passes/unreachable" + "golang.org/x/tools/go/analysis/passes/unsafeptr" + "golang.org/x/tools/go/analysis/passes/unusedresult" +) + +func main() { + unitchecker.Main( + asmdecl.Analyzer, + assign.Analyzer, + atomic.Analyzer, + bools.Analyzer, + buildtag.Analyzer, + cgocall.Analyzer, + composite.Analyzer, + copylock.Analyzer, + httpresponse.Analyzer, + loopclosure.Analyzer, + lostcancel.Analyzer, + nilfunc.Analyzer, + printf.Analyzer, + shift.Analyzer, + stdmethods.Analyzer, + structtag.Analyzer, + tests.Analyzer, + unmarshal.Analyzer, + unreachable.Analyzer, + unsafeptr.Analyzer, + unusedresult.Analyzer, + ) +} diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index 59489f92da16f..ec3103b27e298 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -112,7 +112,7 @@ Usage of %[1]s: os.Exit(0) } if len(args) != 1 || !strings.HasSuffix(args[0], ".cfg") { - log.Fatalf("invalid command: want .cfg file (this reduced version of %s is intended to be run only by the 'go vet' command)", progname) + log.Fatalf(`invoking "go tool vet" directly is unsupported; use "go vet"`) } Run(args[0], analyzers) } From 48399cae9f828668bd2c010dc46e4767f2acd011 Mon Sep 17 00:00:00 2001 From: SALLEYRON Julien Date: Mon, 3 Dec 2018 20:46:23 +0000 Subject: [PATCH 211/594] net/http/httputil: fix unannounced trailers when body is empty Fix unannounced trailers when body is empty and without announced trailers. Fixes #29031 Change-Id: If49951a42fe56d4be4436a999627db4c2678659d GitHub-Last-Rev: 3469adc8f5fd977438350274134950687853a468 GitHub-Pull-Request: golang/go#29032 Reviewed-on: https://go-review.googlesource.com/c/151898 Run-TryBot: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick --- src/net/http/httputil/reverseproxy.go | 18 ++++---- src/net/http/httputil/reverseproxy_test.go | 48 ++++++++++++++++++---- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index f0607a68ea2d3..5d07ba3d36187 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -282,14 +282,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { } rw.WriteHeader(res.StatusCode) - if len(res.Trailer) > 0 { - // Force chunking if we saw a response trailer. - // This prevents net/http from calculating the length for short - // bodies and adding a Content-Length. - if fl, ok := rw.(http.Flusher); ok { - fl.Flush() - } - } + err = p.copyResponse(rw, res.Body, p.flushInterval(req, res)) if err != nil { defer res.Body.Close() @@ -304,6 +297,15 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { } res.Body.Close() // close now, instead of defer, to populate res.Trailer + if len(res.Trailer) > 0 { + // Force chunking if we saw a response trailer. + // This prevents net/http from calculating the length for short + // bodies and adding a Content-Length. + if fl, ok := rw.(http.Flusher); ok { + fl.Flush() + } + } + if len(res.Trailer) == announcedTrailers { copyHeader(rw.Header(), res.Trailer) return diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go index 039273e7c581e..588022c066bf1 100644 --- a/src/net/http/httputil/reverseproxy_test.go +++ b/src/net/http/httputil/reverseproxy_test.go @@ -7,23 +7,23 @@ package httputil import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" "io/ioutil" "log" "net/http" "net/http/httptest" "net/url" - "os" + "testing" + "time" "reflect" - "strconv" + "io" "strings" + "bufio" "sync" - "testing" - "time" + "strconv" + "bytes" + "errors" + "fmt" + "os" ) const fakeHopHeader = "X-Fake-Hop-Header-For-Test" @@ -1048,3 +1048,33 @@ func TestReverseProxyWebSocket(t *testing.T) { t.Errorf("got %#q, want %#q", got, want) } } + +func TestUnannouncedTrailer(t *testing.T) { + backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.(http.Flusher).Flush() + w.Header().Set(http.TrailerPrefix+"X-Unannounced-Trailer", "unannounced_trailer_value") + })) + defer backend.Close() + backendURL, err := url.Parse(backend.URL) + if err != nil { + t.Fatal(err) + } + proxyHandler := NewSingleHostReverseProxy(backendURL) + proxyHandler.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests + frontend := httptest.NewServer(proxyHandler) + defer frontend.Close() + frontendClient := frontend.Client() + + res, err := frontendClient.Get(frontend.URL) + if err != nil { + t.Fatalf("Get: %v", err) + } + + ioutil.ReadAll(res.Body) + + if g, w := res.Trailer.Get("X-Unannounced-Trailer"), "unannounced_trailer_value"; g != w { + t.Errorf("Trailer(X-Unannounced-Trailer) = %q; want %q", g, w) + } + +} From 13e40c76dfdc87071d9a609906d3a842ae636d6f Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 3 Dec 2018 13:46:14 -0800 Subject: [PATCH 212/594] go/types: fix interface receiver type for incremental type-checking The type checker may be called incrementally (by repeatedly calling Checker.Files), for instance when adding _test.go files to a set of already checked files. The existing code reset a cache of (already computed) interface information with each Checker.Files call, causing interfaces to be recomputed in some cases, albeit with different receiver information (see comments in this CL for details). Don't reset the interface cache to avoid this problem. While adding a test case, also factor out some common testing logic. Fixes #29029. Change-Id: I2e2d6d6bb839b3a76522fbc4ba7355c71d3bb80b Reviewed-on: https://go-review.googlesource.com/c/152259 Reviewed-by: Alan Donovan --- src/go/types/check.go | 15 ++++- src/go/types/interfaces.go | 8 +++ src/go/types/issues_test.go | 111 +++++++++++++++++++++--------------- 3 files changed, 86 insertions(+), 48 deletions(-) diff --git a/src/go/types/check.go b/src/go/types/check.go index 91df94dcbc0db..b48d09de22a07 100644 --- a/src/go/types/check.go +++ b/src/go/types/check.go @@ -85,8 +85,9 @@ type Checker struct { files []*ast.File // package files unusedDotImports map[*Scope]map[*Package]token.Pos // positions of unused dot-imported packages for each file scope - firstErr error // first error encountered - methods map[*TypeName][]*Func // maps package scope type names to associated non-blank, non-interface methods + firstErr error // first error encountered + methods map[*TypeName][]*Func // maps package scope type names to associated non-blank, non-interface methods + // TODO(gri) move interfaces up to the group of fields persistent across check.Files invocations (see also comment in Checker.initFiles) interfaces map[*TypeName]*ifaceInfo // maps interface type names to corresponding interface infos untyped map[ast.Expr]exprInfo // map of expressions without final type delayed []func() // stack of delayed actions @@ -192,7 +193,15 @@ func (check *Checker) initFiles(files []*ast.File) { check.firstErr = nil check.methods = nil - check.interfaces = nil + // Don't clear the interfaces cache! It's important that we don't recompute + // ifaceInfos repeatedly (due to multiple check.Files calls) because when + // they are recomputed, they are not used in the context of their original + // declaration (because those types are already type-checked, typically) and + // then they will get the wrong receiver types, which matters for go/types + // clients. It is also safe to not reset the interfaces cache because files + // added to a package cannot change (add methods to) existing interface types; + // they can only add new interfaces. See also the respective comment in + // checker.infoFromTypeName (interfaces.go). Was bug - see issue #29029. check.untyped = nil check.delayed = nil diff --git a/src/go/types/interfaces.go b/src/go/types/interfaces.go index 57dc1bccdcc58..e0ef83adcc507 100644 --- a/src/go/types/interfaces.go +++ b/src/go/types/interfaces.go @@ -336,6 +336,14 @@ typenameLoop: return check.infoFromQualifiedTypeName(decl.file, typ) case *ast.InterfaceType: // type tname interface{...} + // If tname is fully type-checked at this point (tname.color() == black) + // we could use infoFromType here. But in this case, the interface must + // be in the check.interfaces cache as well, which will be hit when we + // call infoFromTypeLit below, and which will be faster. It is important + // that we use that previously computed interface because its methods + // have the correct receiver type (for go/types clients). Thus, the + // check.interfaces cache must be up-to-date across even across multiple + // check.Files calls (was bug - see issue #29029). return check.infoFromTypeLit(decl.file, typ, tname, path) } // type tname X // and X is not an interface type diff --git a/src/go/types/issues_test.go b/src/go/types/issues_test.go index cf489b1c9a48e..c9f5413920614 100644 --- a/src/go/types/issues_test.go +++ b/src/go/types/issues_test.go @@ -7,6 +7,7 @@ package types_test import ( + "bytes" "fmt" "go/ast" "go/importer" @@ -19,15 +20,17 @@ import ( . "go/types" ) -func TestIssue5770(t *testing.T) { - src := `package p; type S struct{T}` +func mustParse(t *testing.T, src string) *ast.File { f, err := parser.ParseFile(fset, "", src, 0) if err != nil { t.Fatal(err) } - + return f +} +func TestIssue5770(t *testing.T) { + f := mustParse(t, `package p; type S struct{T}`) conf := Config{Importer: importer.Default()} - _, err = conf.Check(f.Name.Name, fset, []*ast.File{f}, nil) // do not crash + _, err := conf.Check(f.Name.Name, fset, []*ast.File{f}, nil) // do not crash want := "undeclared name: T" if err == nil || !strings.Contains(err.Error(), want) { t.Errorf("got: %v; want: %s", err, want) @@ -46,14 +49,11 @@ var ( _ = (interface{})("foo") _ = (interface{})(nil) )` - f, err := parser.ParseFile(fset, "", src, 0) - if err != nil { - t.Fatal(err) - } + f := mustParse(t, src) var conf Config types := make(map[ast.Expr]TypeAndValue) - _, err = conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Types: types}) + _, err := conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Types: types}) if err != nil { t.Fatal(err) } @@ -94,14 +94,11 @@ func f() int { return 0 } ` - f, err := parser.ParseFile(fset, "", src, 0) - if err != nil { - t.Fatal(err) - } + f := mustParse(t, src) var conf Config types := make(map[ast.Expr]TypeAndValue) - _, err = conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Types: types}) + _, err := conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Types: types}) if err != nil { t.Fatal(err) } @@ -128,14 +125,11 @@ package p func (T) m() (res bool) { return } type T struct{} // receiver type after method declaration ` - f, err := parser.ParseFile(fset, "", src, 0) - if err != nil { - t.Fatal(err) - } + f := mustParse(t, src) var conf Config defs := make(map[*ast.Ident]Object) - _, err = conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Defs: defs}) + _, err := conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Defs: defs}) if err != nil { t.Fatal(err) } @@ -162,6 +156,8 @@ func _() { _, _, _ = x, y, z // uses x, y, z } ` + f := mustParse(t, src) + const want = `L3 defs func p._() L4 defs const w untyped int L5 defs var x int @@ -173,16 +169,11 @@ L7 uses var x int L7 uses var y int L7 uses var z int` - f, err := parser.ParseFile(fset, "", src, 0) - if err != nil { - t.Fatal(err) - } - // don't abort at the first error conf := Config{Error: func(err error) { t.Log(err) }} defs := make(map[*ast.Ident]Object) uses := make(map[*ast.Ident]Object) - _, err = conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Defs: defs, Uses: uses}) + _, err := conf.Check(f.Name.Name, fset, []*ast.File{f}, &Info{Defs: defs, Uses: uses}) if s := fmt.Sprint(err); !strings.HasSuffix(s, "cannot assign to w") { t.Errorf("Check: unexpected error: %s", s) } @@ -261,13 +252,10 @@ func main() { } ` f := func(test, src string) { - f, err := parser.ParseFile(fset, "", src, 0) - if err != nil { - t.Fatal(err) - } + f := mustParse(t, src) cfg := Config{Importer: importer.Default()} info := Info{Uses: make(map[*ast.Ident]Object)} - _, err = cfg.Check("main", fset, []*ast.File{f}, &info) + _, err := cfg.Check("main", fset, []*ast.File{f}, &info) if err != nil { t.Fatal(err) } @@ -294,11 +282,7 @@ func main() { } func TestIssue22525(t *testing.T) { - src := `package p; func f() { var a, b, c, d, e int }` - f, err := parser.ParseFile(fset, "", src, 0) - if err != nil { - t.Fatal(err) - } + f := mustParse(t, `package p; func f() { var a, b, c, d, e int }`) got := "\n" conf := Config{Error: func(err error) { got += err.Error() + "\n" }} @@ -328,14 +312,11 @@ func TestIssue25627(t *testing.T) { `struct { *I }`, `struct { a int; b Missing; *Missing }`, } { - f, err := parser.ParseFile(fset, "", prefix+src, 0) - if err != nil { - t.Fatal(err) - } + f := mustParse(t, prefix+src) cfg := Config{Importer: importer.Default(), Error: func(err error) {}} info := &Info{Types: make(map[ast.Expr]TypeAndValue)} - _, err = cfg.Check(f.Name.Name, fset, []*ast.File{f}, info) + _, err := cfg.Check(f.Name.Name, fset, []*ast.File{f}, info) if err != nil { if _, ok := err.(Error); !ok { t.Fatal(err) @@ -368,11 +349,7 @@ func TestIssue28005(t *testing.T) { // compute original file ASTs var orig [len(sources)]*ast.File for i, src := range sources { - f, err := parser.ParseFile(fset, "", src, 0) - if err != nil { - t.Fatal(err) - } - orig[i] = f + orig[i] = mustParse(t, src) } // run the test for all order permutations of the incoming files @@ -444,3 +421,47 @@ func TestIssue28282(t *testing.T) { t.Fatalf("%s.Lookup: got %q (%p); want %q (%p)", it, obj, obj, want, want) } } + +func TestIssue29029(t *testing.T) { + f1 := mustParse(t, `package p; type A interface { M() }`) + f2 := mustParse(t, `package p; var B interface { A }`) + + // printInfo prints the *Func definitions recorded in info, one *Func per line. + printInfo := func(info *Info) string { + var buf bytes.Buffer + for _, obj := range info.Defs { + if fn, ok := obj.(*Func); ok { + fmt.Fprintln(&buf, fn) + } + } + return buf.String() + } + + // The *Func (method) definitions for package p must be the same + // independent on whether f1 and f2 are type-checked together, or + // incrementally. + + // type-check together + var conf Config + info := &Info{Defs: make(map[*ast.Ident]Object)} + check := NewChecker(&conf, fset, NewPackage("", "p"), info) + if err := check.Files([]*ast.File{f1, f2}); err != nil { + t.Fatal(err) + } + want := printInfo(info) + + // type-check incrementally + info = &Info{Defs: make(map[*ast.Ident]Object)} + check = NewChecker(&conf, fset, NewPackage("", "p"), info) + if err := check.Files([]*ast.File{f1}); err != nil { + t.Fatal(err) + } + if err := check.Files([]*ast.File{f2}); err != nil { + t.Fatal(err) + } + got := printInfo(info) + + if got != want { + t.Errorf("\ngot : %swant: %s", got, want) + } +} From 58ffe5059fa73b1f35aa354bb4d0ca97601606fb Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Dec 2018 15:12:54 -0800 Subject: [PATCH 213/594] misc/cgo/testcshared: skip TestGo2C2Go on Android Updates #29087 Change-Id: I0bab45818119176c2ba5de9c0e457b7717485d6f Reviewed-on: https://go-review.googlesource.com/c/152162 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/cgo/testcshared/cshared_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go index 7cc02f61942e7..e5b90ff194ce1 100644 --- a/misc/cgo/testcshared/cshared_test.go +++ b/misc/cgo/testcshared/cshared_test.go @@ -604,10 +604,13 @@ func copyFile(t *testing.T, dst, src string) { } func TestGo2C2Go(t *testing.T) { - if GOOS == "darwin" { + switch GOOS { + case "darwin": // Darwin shared libraries don't support the multiple // copies of the runtime package implied by this test. t.Skip("linking c-shared into Go programs not supported on Darwin; issue 29061") + case "android": + t.Skip("test fails on android; issue 29087") } t.Parallel() From c2412a7681d5beaeb5a4ceef3b2b7886361282ce Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Wed, 28 Nov 2018 16:33:23 -0500 Subject: [PATCH 214/594] cmd/go: emit go list error for local non-existant packages In CL 129061, a check was added for patterns that reference nonexistent local directories. While this prevented unnecessary network lookups (fixing #26874), it caused "go list -e" to exit with an error instead of listing packages with error messages. This change avoids the network lookup and does not exit for these kinds of packages. Errors are still reported by internal/load.LoadImport for packages that don't exist. Fixes #28023 Change-Id: I0a648269e437aed3a95bfb05461a397264f3793f Reviewed-on: https://go-review.googlesource.com/c/151800 Run-TryBot: Jay Conrod TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/modload/load.go | 20 ++++++++----------- .../go/testdata/script/mod_fs_patterns.txt | 4 ++-- src/cmd/go/testdata/script/mod_list_dir.txt | 4 +++- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/cmd/go/internal/modload/load.go b/src/cmd/go/internal/modload/load.go index dd1a370825e73..5bb943dd6decb 100644 --- a/src/cmd/go/internal/modload/load.go +++ b/src/cmd/go/internal/modload/load.go @@ -90,7 +90,7 @@ func ImportPaths(patterns []string) []*search.Match { // the exact version of a particular module increases during // the loader iterations. m.Pkgs = str.StringList(fsDirs[i]) - for i, pkg := range m.Pkgs { + for j, pkg := range m.Pkgs { dir := pkg if !filepath.IsAbs(dir) { dir = filepath.Join(cwd, pkg) @@ -124,19 +124,15 @@ func ImportPaths(patterns []string) []*search.Match { } info, err := os.Stat(dir) if err != nil || !info.IsDir() { - // If the directory does not exist, - // don't turn it into an import path - // that will trigger a lookup. - pkg = "" - if !iterating { - if err != nil { - base.Errorf("go: no such directory %v", m.Pattern) - } else { - base.Errorf("go: %s is not a directory", m.Pattern) - } + // If the directory is local but does not exist, don't return it + // while loader is iterating, since this would trigger a fetch. + // After loader is done iterating, we still need to return the + // path, so that "go list -e" produces valid output. + if iterating { + pkg = "" } } - m.Pkgs[i] = pkg + m.Pkgs[j] = pkg } case strings.Contains(m.Pattern, "..."): diff --git a/src/cmd/go/testdata/script/mod_fs_patterns.txt b/src/cmd/go/testdata/script/mod_fs_patterns.txt index d7d3e0321b53d..9341a1d08305f 100644 --- a/src/cmd/go/testdata/script/mod_fs_patterns.txt +++ b/src/cmd/go/testdata/script/mod_fs_patterns.txt @@ -34,11 +34,11 @@ stderr 'import lookup disabled' ! go build -mod=readonly ./nonexist ! stderr 'import lookup disabled' -stderr '^go: no such directory ./nonexist' +stderr 'unknown import path "m/nonexist": cannot find package' ! go build -mod=readonly ./go.mod ! stderr 'import lookup disabled' -stderr '^go: ./go.mod is not a directory' +stderr 'unknown import path "m/go.mod": cannot find package' -- x/go.mod -- module m diff --git a/src/cmd/go/testdata/script/mod_list_dir.txt b/src/cmd/go/testdata/script/mod_list_dir.txt index 800f2775591a8..903651c9d58fd 100644 --- a/src/cmd/go/testdata/script/mod_list_dir.txt +++ b/src/cmd/go/testdata/script/mod_list_dir.txt @@ -10,7 +10,9 @@ stdout ^math$ go list -f '{{.ImportPath}}' . stdout ^x$ ! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 -stderr '^go: no such directory.*quote@v1.5.2' +stderr 'unknown import path "rsc.io/quote": cannot find package' +go list -e -f '{{with .Error}}{{.}}{{end}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 +stdout 'unknown import path "rsc.io/quote": cannot find package' go mod download rsc.io/quote@v1.5.2 go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2 stdout '^rsc.io/quote$' From f91fd4f9da04f7675e5ef7dee2c70ae5059f5eed Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Dec 2018 15:45:10 -0800 Subject: [PATCH 215/594] os: increase default write size for TestClosedPipeRaceWrite The original value of 65537 consistently caused the test to fail on Solaris. The new value of 131073 consistently lets the test pass. Change-Id: If1a76ab89aa8f661ea049113addd04b23a116534 Reviewed-on: https://go-review.googlesource.com/c/152164 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/os/pipe_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/pipe_test.go b/src/os/pipe_test.go index 59d31e5837c9d..779b2bdf85b3b 100644 --- a/src/os/pipe_test.go +++ b/src/os/pipe_test.go @@ -131,7 +131,7 @@ func testClosedPipeRace(t *testing.T, read bool) { if !read { // Get the amount we have to write to overload a pipe // with no reader. - limit = 65537 + limit = 131073 if b, err := ioutil.ReadFile("/proc/sys/fs/pipe-max-size"); err == nil { if i, err := strconv.Atoi(strings.TrimSpace(string(b))); err == nil { limit = i + 1 From b0a53d22026a22864e1ca411cc0d9a2630eb5f75 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Dec 2018 14:58:38 -0800 Subject: [PATCH 216/594] doc: release notes: "go tool vet" is no longer supported Updates #28869 Change-Id: Ie152bf959af2e9cd32b1ccc031e8208e64fbe3ce Reviewed-on: https://go-review.googlesource.com/c/152161 Reviewed-by: Brad Fitzpatrick Reviewed-by: Alan Donovan --- doc/go1.12.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 9a5d4bc621c43..c398a1131681c 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -56,6 +56,19 @@

    Darwin

    Tools

    +

    go tool vet no longer supported

    + +

    + The go vet command has been rewritten to serve as the + base for a range of different source code analysis tools. See + the golang.org/x/tools/go/analysis + package for details. A side-effect is that go tool vet + is no longer supported. External tools that use go tool + vet must be changed to use go + vet. Using go vet instead of go tool + vet should work with all supported versions of Go. +

    +

    Build cache requirement

    From ea509c95e9c91bdab8f76f81545d472094eadbe8 Mon Sep 17 00:00:00 2001 From: Bobby DeSimone Date: Tue, 4 Dec 2018 00:56:04 +0000 Subject: [PATCH 217/594] net/http/httputil: add tests for singleJoiningSlash. These changes add tests for the unexported function singleJoiningSlash. Change-Id: I107905aac4a3c2544be309098b67e970ea5b542c GitHub-Last-Rev: ed6f86f619549f46ef53316b7febaac781b64e4b GitHub-Pull-Request: golang/go#29088 Reviewed-on: https://go-review.googlesource.com/c/152337 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/net/http/httputil/reverseproxy_test.go | 41 +++++++++++++++++----- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go index 588022c066bf1..5caa2060660a9 100644 --- a/src/net/http/httputil/reverseproxy_test.go +++ b/src/net/http/httputil/reverseproxy_test.go @@ -7,23 +7,23 @@ package httputil import ( + "bufio" + "bytes" + "errors" + "fmt" + "io" "io/ioutil" "log" "net/http" "net/http/httptest" "net/url" - "testing" - "time" + "os" "reflect" - "io" + "strconv" "strings" - "bufio" "sync" - "strconv" - "bytes" - "errors" - "fmt" - "os" + "testing" + "time" ) const fakeHopHeader = "X-Fake-Hop-Header-For-Test" @@ -1078,3 +1078,26 @@ func TestUnannouncedTrailer(t *testing.T) { } } + +func TestSingleJoinSlash(t *testing.T) { + tests := []struct { + slasha string + slashb string + expected string + }{ + {"https://www.google.com/", "/favicon.ico", "https://www.google.com/favicon.ico"}, + {"https://www.google.com", "/favicon.ico", "https://www.google.com/favicon.ico"}, + {"https://www.google.com", "favicon.ico", "https://www.google.com/favicon.ico"}, + {"https://www.google.com", "", "https://www.google.com/"}, + {"", "favicon.ico", "/favicon.ico"}, + } + for _, tt := range tests { + if got := singleJoiningSlash(tt.slasha, tt.slashb); got != tt.expected { + t.Errorf("singleJoiningSlash(%s,%s) want %s got %s", + tt.slasha, + tt.slashb, + tt.expected, + got) + } + } +} From ffac3d5a88352d4f6e8e47b9a2990352960eb5ca Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Mon, 3 Dec 2018 17:02:20 -0500 Subject: [PATCH 218/594] cmd/go: add missing gccgo checks for buildmodeInit Some recent failures in gccgo on linux/ppc64 identified an error in buildmodeInit when buildmode=c-archive. A fix went into gofrontend, and this is the corresponding change for master. This change also includes two other updates related to gccgo in this function that were in the file from gofrontend but missing from master. Updates #29046 Change-Id: I9a894e7d728e31fb9e9344cd61d50408df7faf4a Reviewed-on: https://go-review.googlesource.com/c/152160 Run-TryBot: Lynn Boger TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/go/internal/work/init.go | 33 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/cmd/go/internal/work/init.go b/src/cmd/go/internal/work/init.go index 8d2fd10524b06..693a53e9ab78d 100644 --- a/src/cmd/go/internal/work/init.go +++ b/src/cmd/go/internal/work/init.go @@ -82,19 +82,23 @@ func buildModeInit() { pkgsFilter = pkgsNotMain case "c-archive": pkgsFilter = oneMainPkg - switch platform { - case "darwin/arm", "darwin/arm64": - codegenArg = "-shared" - default: - switch cfg.Goos { - case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": - if platform == "linux/ppc64" { - base.Fatalf("-buildmode=c-archive not supported on %s\n", platform) - } - // Use -shared so that the result is - // suitable for inclusion in a PIE or - // shared library. + if gccgo { + codegenArg = "-fPIC" + } else { + switch platform { + case "darwin/arm", "darwin/arm64": codegenArg = "-shared" + default: + switch cfg.Goos { + case "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "solaris": + if platform == "linux/ppc64" { + base.Fatalf("-buildmode=c-archive not supported on %s\n", platform) + } + // Use -shared so that the result is + // suitable for inclusion in a PIE or + // shared library. + codegenArg = "-shared" + } } } cfg.ExeSuffix = ".a" @@ -129,6 +133,9 @@ func buildModeInit() { default: ldBuildmode = "exe" } + if gccgo { + codegenArg = "" + } case "exe": pkgsFilter = pkgsMain ldBuildmode = "exe" @@ -143,7 +150,7 @@ func buildModeInit() { base.Fatalf("-buildmode=pie not supported when -race is enabled") } if gccgo { - base.Fatalf("-buildmode=pie not supported by gccgo") + codegenArg = "-fPIE" } else { switch platform { case "linux/386", "linux/amd64", "linux/arm", "linux/arm64", "linux/ppc64le", "linux/s390x", From 7937466022627d90ffde9ddfb2499023c060c8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Tue, 4 Dec 2018 09:03:32 +0100 Subject: [PATCH 219/594] syscall, cmd/go/internal/lockedfile: remove Flock syscall for aix/ppc64 AIX doesn't provide flock() syscall, it was previously emulated by fcntl calls. However, there are some differences between a flock() syscall and a flock() using fcntl. Therefore, it's safer to remove it and just provide FcntlFlock. Thus, lockedfile implementation must be moved to use FcntlFlock on aix/ppc64. Updates #29065. Fixes #29084. Change-Id: Ic48fd9f315f24c2acdf09b91d917da131a1f2dd5 Reviewed-on: https://go-review.googlesource.com/c/152397 Reviewed-by: Tobias Klauser Reviewed-by: Bryan C. Mills --- ...{filelock_solaris.go => filelock_fcntl.go} | 6 ++-- .../internal/filelock/filelock_other.go | 2 +- .../internal/filelock/filelock_test.go | 4 +-- src/syscall/flock_aix.go | 31 +++---------------- 4 files changed, 11 insertions(+), 32 deletions(-) rename src/cmd/go/internal/lockedfile/internal/filelock/{filelock_solaris.go => filelock_fcntl.go} (97%) diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_solaris.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go similarity index 97% rename from src/cmd/go/internal/lockedfile/internal/filelock/filelock_solaris.go rename to src/cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go index b03d5f893e933..2831975c0c69e 100644 --- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_solaris.go +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build aix solaris + // This code implements the filelock API using POSIX 'fcntl' locks, which attach // to an (inode, process) pair rather than a file descriptor. To avoid unlocking // files prematurely when the same file is opened through different descriptors, @@ -13,8 +15,8 @@ // // TODO(bcmills): If we add a build tag for Illumos (see golang.org/issue/20603) // then Illumos should use F_OFD_SETLK, and the resulting code would be as -// simple as filelock_unix.go. We will still need the code in this file as long -// as Oracle Solaris provides only F_SETLK. +// simple as filelock_unix.go. We will still need the code in this file for AIX +// or as long as Oracle Solaris provides only F_SETLK. package filelock diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go index 7d60160f909ff..107611e1ce85f 100644 --- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!plan9,!solaris,!windows +// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!plan9,!solaris,!windows package filelock diff --git a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go index 0ccee07ceebd5..aa67093a48aad 100644 --- a/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go +++ b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go @@ -159,7 +159,7 @@ func TestRLockExcludesOnlyLock(t *testing.T) { f2 := mustOpen(t, f.Name()) defer f2.Close() - if runtime.GOOS == "solaris" { + if runtime.GOOS == "solaris" || runtime.GOOS == "aix" { // When using POSIX locks (as on Solaris), we can't safely read-lock the // same inode through two different descriptors at the same time: when the // first descriptor is closed, the second descriptor would still be open but @@ -176,7 +176,7 @@ func TestRLockExcludesOnlyLock(t *testing.T) { lockOther := mustBlock(t, "Lock", other) unlock(t, f2) - if runtime.GOOS != "solaris" { + if runtime.GOOS != "solaris" && runtime.GOOS != "aix" { unlock(t, f) } lockOther(t) diff --git a/src/syscall/flock_aix.go b/src/syscall/flock_aix.go index 9745236dcb8a6..c9eab43b6bc2f 100644 --- a/src/syscall/flock_aix.go +++ b/src/syscall/flock_aix.go @@ -6,36 +6,13 @@ package syscall import "unsafe" -// On AIX, there is no flock() system call, we emulate it. -// Moreover, we can't call the default fcntl syscall because the arguments -// must be integer and it's not possible to transform a pointer (lk) -// to a int value. -// It's easier to call syscall6 than to transform fcntl for every GOOS. -func fcntlFlock(fd, cmd int, lk *Flock_t) (err error) { +// On AIX, there is no flock() system call. + +// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. +func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) { _, _, e1 := syscall6(uintptr(unsafe.Pointer(&libc_fcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } - -func Flock(fd int, op int) (err error) { - lk := &Flock_t{} - if (op & LOCK_UN) != 0 { - lk.Type = F_UNLCK - } else if (op & LOCK_EX) != 0 { - lk.Type = F_WRLCK - } else if (op & LOCK_SH) != 0 { - lk.Type = F_RDLCK - } else { - return nil - } - if (op & LOCK_NB) != 0 { - err = fcntlFlock(fd, F_SETLK, lk) - if err != nil && (err == EAGAIN || err == EACCES) { - return EWOULDBLOCK - } - return err - } - return fcntlFlock(fd, F_SETLKW, lk) -} From 8e01f2bf85385c79fc807c53df8553220c3ac658 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Dec 2018 19:20:47 -0800 Subject: [PATCH 220/594] go/internal/gccgoimporter: skip /*nointerface*/ comment Support for methods marked with "//go:nointerface" was broken by CL 151557, based on CL 150061, which changed the scanner to stop skipping comments. Change-Id: I43d5e2cf51bed2dc4ed9d6136ca21aa1223e8df1 Reviewed-on: https://go-review.googlesource.com/c/152378 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Than McIntosh --- src/go/internal/gccgoimporter/importer_test.go | 1 + src/go/internal/gccgoimporter/parser.go | 8 ++++++++ .../internal/gccgoimporter/testdata/nointerface.go | 12 ++++++++++++ .../internal/gccgoimporter/testdata/nointerface.gox | 8 ++++++++ 4 files changed, 29 insertions(+) create mode 100644 src/go/internal/gccgoimporter/testdata/nointerface.go create mode 100644 src/go/internal/gccgoimporter/testdata/nointerface.gox diff --git a/src/go/internal/gccgoimporter/importer_test.go b/src/go/internal/gccgoimporter/importer_test.go index 9725fd429fb1d..b659cfc1df166 100644 --- a/src/go/internal/gccgoimporter/importer_test.go +++ b/src/go/internal/gccgoimporter/importer_test.go @@ -89,6 +89,7 @@ var importerTests = [...]importerTest{ {pkgpath: "escapeinfo", name: "NewT", want: "func NewT(data []byte) *T"}, {pkgpath: "issue27856", name: "M", want: "type M struct{E F}"}, {pkgpath: "v1reflect", name: "Type", want: "type Type interface{Align() int; AssignableTo(u Type) bool; Bits() int; ChanDir() ChanDir; Elem() Type; Field(i int) StructField; FieldAlign() int; FieldByIndex(index []int) StructField; FieldByName(name string) (StructField, bool); FieldByNameFunc(match func(string) bool) (StructField, bool); Implements(u Type) bool; In(i int) Type; IsVariadic() bool; Key() Type; Kind() Kind; Len() int; Method(int) Method; MethodByName(string) (Method, bool); Name() string; NumField() int; NumIn() int; NumMethod() int; NumOut() int; Out(i int) Type; PkgPath() string; Size() uintptr; String() string; common() *commonType; rawString() string; runtimeType() *runtimeType; uncommon() *uncommonType}"}, + {pkgpath: "nointerface", name: "I", want: "type I int"}, } func TestGoxImporter(t *testing.T) { diff --git a/src/go/internal/gccgoimporter/parser.go b/src/go/internal/gccgoimporter/parser.go index 7d075db4cef62..5414046be4ef3 100644 --- a/src/go/internal/gccgoimporter/parser.go +++ b/src/go/internal/gccgoimporter/parser.go @@ -541,6 +541,14 @@ func (p *parser) parseNamedType(nlist []int) types.Type { // collect associated methods for p.tok == scanner.Ident { p.expectKeyword("func") + if p.tok == '/' { + // Skip a /*nointerface*/ comment. + p.expect('/') + p.expect('*') + p.expect(scanner.Ident) + p.expect('*') + p.expect('/') + } p.expect('(') receiver, _ := p.parseParam(pkg) p.expect(')') diff --git a/src/go/internal/gccgoimporter/testdata/nointerface.go b/src/go/internal/gccgoimporter/testdata/nointerface.go new file mode 100644 index 0000000000000..6a545f24933fd --- /dev/null +++ b/src/go/internal/gccgoimporter/testdata/nointerface.go @@ -0,0 +1,12 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package nointerface + +type I int + +//go:nointerface +func (p *I) Get() int { return int(*p) } + +func (p *I) Set(v int) { *p = I(v) } diff --git a/src/go/internal/gccgoimporter/testdata/nointerface.gox b/src/go/internal/gccgoimporter/testdata/nointerface.gox new file mode 100644 index 0000000000000..7b73d179e393c --- /dev/null +++ b/src/go/internal/gccgoimporter/testdata/nointerface.gox @@ -0,0 +1,8 @@ +v3; +package nointerface +pkgpath nointerface +types 3 2 133 17 +type 1 "I" + func /*nointerface*/ (p ) Get () + func (p ) Set (v ) +type 2 * From 449e2f0bdf6f4880c15465fe18dc21cd8ab939df Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 10 Oct 2018 15:52:03 +0530 Subject: [PATCH 221/594] go/doc: tune factory method association logic Ignore predeclared types (such as error) in result parameter lists when determining with which result type a method should be associated with. This change will again associate common factory functions with the first result type even if there are more than one result, as long as the others are predeclared types. Fixes #27928 Change-Id: Ia2aeaed15fc4c8debdeeaf729cc7fbba1612cafb Reviewed-on: https://go-review.googlesource.com/c/141617 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/go/doc/reader.go | 34 +++++++++++++++++-------- src/go/doc/testdata/issue12839.0.golden | 18 +++++++++++++ src/go/doc/testdata/issue12839.1.golden | 18 +++++++++++++ src/go/doc/testdata/issue12839.2.golden | 18 +++++++++++++ src/go/doc/testdata/issue12839.go | 31 ++++++++++++++++++++++ 5 files changed, 109 insertions(+), 10 deletions(-) diff --git a/src/go/doc/reader.go b/src/go/doc/reader.go index 4950e7c6c3865..6db5c21c4a222 100644 --- a/src/go/doc/reader.go +++ b/src/go/doc/reader.go @@ -365,6 +365,12 @@ func (r *reader) readType(decl *ast.GenDecl, spec *ast.TypeSpec) { } } +// isPredeclared reports whether n denotes a predeclared type. +// +func (r *reader) isPredeclared(n string) bool { + return predeclaredTypes[n] && r.types[n] == nil +} + // readFunc processes a func or method declaration. // func (r *reader) readFunc(fun *ast.FuncDecl) { @@ -398,29 +404,30 @@ func (r *reader) readFunc(fun *ast.FuncDecl) { return } - // Associate factory functions with the first visible result type, if that - // is the only type returned. + // Associate factory functions with the first visible result type, as long as + // others are predeclared types. if fun.Type.Results.NumFields() >= 1 { var typ *namedType // type to associate the function with numResultTypes := 0 for _, res := range fun.Type.Results.List { - // exactly one (named or anonymous) result associated - // with the first type in result signature (there may - // be more than one result) factoryType := res.Type if t, ok := factoryType.(*ast.ArrayType); ok { // We consider functions that return slices or arrays of type // T (or pointers to T) as factory functions of T. factoryType = t.Elt } - if n, imp := baseTypeName(factoryType); !imp && r.isVisible(n) { + if n, imp := baseTypeName(factoryType); !imp && r.isVisible(n) && !r.isPredeclared(n) { if t := r.lookupType(n); t != nil { typ = t numResultTypes++ + if numResultTypes > 1 { + break + } } } } - // If there is exactly one result type, associate the function with that type. + // If there is exactly one result type, + // associate the function with that type. if numResultTypes == 1 { typ.funcs.set(fun, r.mode&PreserveAST != 0) return @@ -494,7 +501,7 @@ func (r *reader) readFile(src *ast.File) { } } - // add all declarations + // add all declarations but for functions which are processed in a separate pass for _, decl := range src.Decls { switch d := decl.(type) { case *ast.GenDecl: @@ -548,8 +555,6 @@ func (r *reader) readFile(src *ast.File) { } } } - case *ast.FuncDecl: - r.readFunc(d) } } @@ -586,6 +591,15 @@ func (r *reader) readPackage(pkg *ast.Package, mode Mode) { } r.readFile(f) } + + // process functions now that we have better type information + for _, f := range pkg.Files { + for _, decl := range f.Decls { + if d, ok := decl.(*ast.FuncDecl); ok { + r.readFunc(d) + } + } + } } // ---------------------------------------------------------------------------- diff --git a/src/go/doc/testdata/issue12839.0.golden b/src/go/doc/testdata/issue12839.0.golden index 76c285556028c..6b59774fb9350 100644 --- a/src/go/doc/testdata/issue12839.0.golden +++ b/src/go/doc/testdata/issue12839.0.golden @@ -14,9 +14,15 @@ FUNCTIONS // F1 should not be associated with T1 func F1() (*T1, *T2) + // F10 should not be associated with T1. + func F10() (T1, T2, error) + // F4 should not be associated with a type (same as F1) func F4() (a T1, b T2) + // F9 should not be associated with T1. + func F9() (int, T1, T2) + TYPES // @@ -28,6 +34,18 @@ TYPES // F3 should be associated with T1 because b.T3 is from a ... func F3() (a T1, b p.T3) + // F5 should be associated with T1. + func F5() (T1, error) + + // F6 should be associated with T1. + func F6() (*T1, error) + + // F7 should be associated with T1. + func F7() (T1, string) + + // F8 should be associated with T1. + func F8() (int, T1, string) + // type T2 struct{} diff --git a/src/go/doc/testdata/issue12839.1.golden b/src/go/doc/testdata/issue12839.1.golden index b0a327ffd6416..4b9b9f6477080 100644 --- a/src/go/doc/testdata/issue12839.1.golden +++ b/src/go/doc/testdata/issue12839.1.golden @@ -14,9 +14,15 @@ FUNCTIONS // F1 should not be associated with T1 func F1() (*T1, *T2) + // F10 should not be associated with T1. + func F10() (T1, T2, error) + // F4 should not be associated with a type (same as F1) func F4() (a T1, b T2) + // F9 should not be associated with T1. + func F9() (int, T1, T2) + TYPES // @@ -28,6 +34,18 @@ TYPES // F3 should be associated with T1 because b.T3 is from a ... func F3() (a T1, b p.T3) + // F5 should be associated with T1. + func F5() (T1, error) + + // F6 should be associated with T1. + func F6() (*T1, error) + + // F7 should be associated with T1. + func F7() (T1, string) + + // F8 should be associated with T1. + func F8() (int, T1, string) + // func (t T1) hello() string diff --git a/src/go/doc/testdata/issue12839.2.golden b/src/go/doc/testdata/issue12839.2.golden index 76c285556028c..6b59774fb9350 100644 --- a/src/go/doc/testdata/issue12839.2.golden +++ b/src/go/doc/testdata/issue12839.2.golden @@ -14,9 +14,15 @@ FUNCTIONS // F1 should not be associated with T1 func F1() (*T1, *T2) + // F10 should not be associated with T1. + func F10() (T1, T2, error) + // F4 should not be associated with a type (same as F1) func F4() (a T1, b T2) + // F9 should not be associated with T1. + func F9() (int, T1, T2) + TYPES // @@ -28,6 +34,18 @@ TYPES // F3 should be associated with T1 because b.T3 is from a ... func F3() (a T1, b p.T3) + // F5 should be associated with T1. + func F5() (T1, error) + + // F6 should be associated with T1. + func F6() (*T1, error) + + // F7 should be associated with T1. + func F7() (T1, string) + + // F8 should be associated with T1. + func F8() (int, T1, string) + // type T2 struct{} diff --git a/src/go/doc/testdata/issue12839.go b/src/go/doc/testdata/issue12839.go index 500d49511b5c5..51c7ac1268189 100644 --- a/src/go/doc/testdata/issue12839.go +++ b/src/go/doc/testdata/issue12839.go @@ -5,6 +5,7 @@ // Package issue12839 is a go/doc test to test association of a function // that returns multiple types. // See golang.org/issue/12839. +// (See also golang.org/issue/27928.) package issue12839 import "p" @@ -36,3 +37,33 @@ func F3() (a T1, b p.T3) { func F4() (a T1, b T2) { return T1{}, T2{} } + +// F5 should be associated with T1. +func F5() (T1, error) { + return T1{}, nil +} + +// F6 should be associated with T1. +func F6() (*T1, error) { + return &T1{}, nil +} + +// F7 should be associated with T1. +func F7() (T1, string) { + return T1{}, nil +} + +// F8 should be associated with T1. +func F8() (int, T1, string) { + return 0, T1{}, nil +} + +// F9 should not be associated with T1. +func F9() (int, T1, T2) { + return 0, T1{}, T2{} +} + +// F10 should not be associated with T1. +func F10() (T1, T2, error) { + return T1{}, T2{}, nil +} From 159797a5fc561b6881faf2656e330049fb11ef8c Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 2 Nov 2018 11:27:53 -0400 Subject: [PATCH 222/594] go/importer: add ForCompiler, which accepts a token.FileSet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The importer.For function logically requires a FileSet, but did not when it was first created because export data did not then record position information. This change adds a new function, ForCompiler, that has an additional FileSet parameter, and deprecates the For function. Before this change, cmd/vet would report confusing spurious positions for token.Pos values produced by the importer. The bug is essentially unfixable in cmd/vet. This CL includes a test that the FileSet is correctly populated. The changes to cmd/vendor will be applied upstream in a follow-up. Fixes #28995 Change-Id: I9271bcb1f28e96845c913e15f0304bac93d4d4c4 Reviewed-on: https://go-review.googlesource.com/c/152258 Run-TryBot: Alan Donovan Reviewed-by: Daniel Martí Reviewed-by: Robert Griesemer --- .../go/analysis/unitchecker/unitchecker.go | 7 ++++- .../go/analysis/unitchecker/unitchecker112.go | 9 +++++++ src/go/importer/importer.go | 18 ++++++++++--- src/go/importer/importer_test.go | 26 ++++++++++++++++--- src/go/internal/gcimporter/gcimporter.go | 6 +---- src/go/internal/gcimporter/gcimporter_test.go | 25 ++++++++++++------ 6 files changed, 70 insertions(+), 21 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker112.go diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index ec3103b27e298..018191a5e7a25 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -181,6 +181,11 @@ func readConfig(filename string) (*Config, error) { return cfg, nil } +var importerForCompiler = func(_ *token.FileSet, compiler string, lookup importer.Lookup) types.Importer { + // broken legacy implementation (github.com/golang/go/issues/28995) + return importer.For(compiler, lookup) +} + func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]result, error) { // Load, parse, typecheck. var files []*ast.File @@ -196,7 +201,7 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re } files = append(files, f) } - compilerImporter := importer.For(cfg.Compiler, func(path string) (io.ReadCloser, error) { + compilerImporter := importerForCompiler(fset, cfg.Compiler, func(path string) (io.ReadCloser, error) { // path is a resolved package path, not an import path. file, ok := cfg.PackageFile[path] if !ok { diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker112.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker112.go new file mode 100644 index 0000000000000..683b7e91d25e5 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker112.go @@ -0,0 +1,9 @@ +// +build go1.12 + +package unitchecker + +import "go/importer" + +func init() { + importerForCompiler = importer.ForCompiler +} diff --git a/src/go/importer/importer.go b/src/go/importer/importer.go index f0a1ca2b76a18..c809c9ab8678c 100644 --- a/src/go/importer/importer.go +++ b/src/go/importer/importer.go @@ -20,7 +20,7 @@ import ( // a given import path, or an error if no matching package is found. type Lookup func(path string) (io.ReadCloser, error) -// For returns an Importer for importing from installed packages +// ForCompiler returns an Importer for importing from installed packages // for the compilers "gc" and "gccgo", or for importing directly // from the source if the compiler argument is "source". In this // latter case, importing may fail under circumstances where the @@ -39,10 +39,11 @@ type Lookup func(path string) (io.ReadCloser, error) // (not relative or absolute ones); it is assumed that the translation // to canonical import paths is being done by the client of the // importer. -func For(compiler string, lookup Lookup) types.Importer { +func ForCompiler(fset *token.FileSet, compiler string, lookup Lookup) types.Importer { switch compiler { case "gc": return &gcimports{ + fset: fset, packages: make(map[string]*types.Package), lookup: lookup, } @@ -63,13 +64,21 @@ func For(compiler string, lookup Lookup) types.Importer { panic("source importer for custom import path lookup not supported (issue #13847).") } - return srcimporter.New(&build.Default, token.NewFileSet(), make(map[string]*types.Package)) + return srcimporter.New(&build.Default, fset, make(map[string]*types.Package)) } // compiler not supported return nil } +// For calls ForCompiler with a new FileSet. +// +// Deprecated: use ForCompiler, which populates a FileSet +// with the positions of objects created by the importer. +func For(compiler string, lookup Lookup) types.Importer { + return ForCompiler(token.NewFileSet(), compiler, lookup) +} + // Default returns an Importer for the compiler that built the running binary. // If available, the result implements types.ImporterFrom. func Default() types.Importer { @@ -79,6 +88,7 @@ func Default() types.Importer { // gc importer type gcimports struct { + fset *token.FileSet packages map[string]*types.Package lookup Lookup } @@ -91,7 +101,7 @@ func (m *gcimports) ImportFrom(path, srcDir string, mode types.ImportMode) (*typ if mode != 0 { panic("mode must be 0") } - return gcimporter.Import(m.packages, path, srcDir, m.lookup) + return gcimporter.Import(m.fset, m.packages, path, srcDir, m.lookup) } // gccgo importer diff --git a/src/go/importer/importer_test.go b/src/go/importer/importer_test.go index 56e83136fb1a0..ff6e12c0da523 100644 --- a/src/go/importer/importer_test.go +++ b/src/go/importer/importer_test.go @@ -5,15 +5,18 @@ package importer import ( + "go/token" "internal/testenv" "io" + "io/ioutil" "os" "os/exec" + "runtime" "strings" "testing" ) -func TestFor(t *testing.T) { +func TestForCompiler(t *testing.T) { testenv.MustHaveGoBuild(t) const thePackage = "math/big" @@ -32,8 +35,10 @@ func TestFor(t *testing.T) { t.Skip("golang.org/issue/22500") } + fset := token.NewFileSet() + t.Run("LookupDefault", func(t *testing.T) { - imp := For(compiler, nil) + imp := ForCompiler(fset, compiler, nil) pkg, err := imp.Import(thePackage) if err != nil { t.Fatal(err) @@ -41,6 +46,21 @@ func TestFor(t *testing.T) { if pkg.Path() != thePackage { t.Fatalf("Path() = %q, want %q", pkg.Path(), thePackage) } + + // Check that the fileset positions are accurate. + // https://github.com/golang/go#28995 + mathBigInt := pkg.Scope().Lookup("Int") + posn := fset.Position(mathBigInt.Pos()) // "$GOROOT/src/math/big/int.go:25:1" + filename := strings.Replace(posn.Filename, "$GOROOT", runtime.GOROOT(), 1) + data, err := ioutil.ReadFile(filename) + if err != nil { + t.Fatalf("can't read file containing declaration of math/big.Int: %v", err) + } + lines := strings.Split(string(data), "\n") + if posn.Line > len(lines) || !strings.HasPrefix(lines[posn.Line-1], "type Int") { + t.Fatalf("Object %v position %s does not contain its declaration", + mathBigInt, posn) + } }) t.Run("LookupCustom", func(t *testing.T) { @@ -54,7 +74,7 @@ func TestFor(t *testing.T) { } return f, nil } - imp := For(compiler, lookup) + imp := ForCompiler(fset, compiler, lookup) pkg, err := imp.Import("math/bigger") if err != nil { t.Fatal(err) diff --git a/src/go/internal/gcimporter/gcimporter.go b/src/go/internal/gcimporter/gcimporter.go index d117f6fe4d3f4..3aed6de6ae0b3 100644 --- a/src/go/internal/gcimporter/gcimporter.go +++ b/src/go/internal/gcimporter/gcimporter.go @@ -85,7 +85,7 @@ func FindPkg(path, srcDir string) (filename, id string) { // the corresponding package object to the packages map, and returns the object. // The packages map must contain all packages already imported. // -func Import(packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { +func Import(fset *token.FileSet, packages map[string]*types.Package, path, srcDir string, lookup func(path string) (io.ReadCloser, error)) (pkg *types.Package, err error) { var rc io.ReadCloser var id string if lookup != nil { @@ -152,10 +152,6 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func break } - // TODO(gri): allow clients of go/importer to provide a FileSet. - // Or, define a new standard go/types/gcexportdata package. - fset := token.NewFileSet() - // The indexed export format starts with an 'i'; the older // binary export format starts with a 'c', 'd', or 'v' // (from "version"). Select appropriate importer. diff --git a/src/go/internal/gcimporter/gcimporter_test.go b/src/go/internal/gcimporter/gcimporter_test.go index 222b36c883688..3b7636806e7e5 100644 --- a/src/go/internal/gcimporter/gcimporter_test.go +++ b/src/go/internal/gcimporter/gcimporter_test.go @@ -17,6 +17,7 @@ import ( "testing" "time" + "go/token" "go/types" ) @@ -55,7 +56,8 @@ func compile(t *testing.T, dirname, filename, outdirname string) string { func testPath(t *testing.T, path, srcDir string) *types.Package { t0 := time.Now() - pkg, err := Import(make(map[string]*types.Package), path, srcDir, nil) + fset := token.NewFileSet() + pkg, err := Import(fset, make(map[string]*types.Package), path, srcDir, nil) if err != nil { t.Errorf("testPath(%s): %s", path, err) return nil @@ -158,6 +160,8 @@ func TestVersionHandling(t *testing.T) { t.Fatal(err) } + fset := token.NewFileSet() + for _, f := range list { name := f.Name() if !strings.HasSuffix(name, ".a") { @@ -173,7 +177,7 @@ func TestVersionHandling(t *testing.T) { } // test that export data can be imported - _, err := Import(make(map[string]*types.Package), pkgpath, dir, nil) + _, err := Import(fset, make(map[string]*types.Package), pkgpath, dir, nil) if err != nil { // ok to fail if it fails with a newer version error for select files if strings.Contains(err.Error(), "newer version") { @@ -209,7 +213,7 @@ func TestVersionHandling(t *testing.T) { ioutil.WriteFile(filename, data, 0666) // test that importing the corrupted file results in an error - _, err = Import(make(map[string]*types.Package), pkgpath, corruptdir, nil) + _, err = Import(fset, make(map[string]*types.Package), pkgpath, corruptdir, nil) if err == nil { t.Errorf("import corrupted %q succeeded", pkgpath) } else if msg := err.Error(); !strings.Contains(msg, "version skew") { @@ -266,6 +270,7 @@ func TestImportedTypes(t *testing.T) { t.Skipf("gc-built packages not available (compiler = %s)", runtime.Compiler) } + fset := token.NewFileSet() for _, test := range importedObjectTests { s := strings.Split(test.name, ".") if len(s) != 2 { @@ -274,7 +279,7 @@ func TestImportedTypes(t *testing.T) { importPath := s[0] objName := s[1] - pkg, err := Import(make(map[string]*types.Package), importPath, ".", nil) + pkg, err := Import(fset, make(map[string]*types.Package), importPath, ".", nil) if err != nil { t.Error(err) continue @@ -371,7 +376,8 @@ func TestCorrectMethodPackage(t *testing.T) { } imports := make(map[string]*types.Package) - _, err := Import(imports, "net/http", ".", nil) + fset := token.NewFileSet() + _, err := Import(fset, imports, "net/http", ".", nil) if err != nil { t.Fatal(err) } @@ -433,8 +439,9 @@ func TestIssue13898(t *testing.T) { } // import go/internal/gcimporter which imports go/types partially + fset := token.NewFileSet() imports := make(map[string]*types.Package) - _, err := Import(imports, "go/internal/gcimporter", ".", nil) + _, err := Import(fset, imports, "go/internal/gcimporter", ".", nil) if err != nil { t.Fatal(err) } @@ -502,8 +509,9 @@ func TestIssue15517(t *testing.T) { // file and package path are different, exposing the problem if present. // The same issue occurs with vendoring.) imports := make(map[string]*types.Package) + fset := token.NewFileSet() for i := 0; i < 3; i++ { - if _, err := Import(imports, "./././testdata/p", tmpdir, nil); err != nil { + if _, err := Import(fset, imports, "./././testdata/p", tmpdir, nil); err != nil { t.Fatal(err) } } @@ -582,7 +590,8 @@ func TestIssue25596(t *testing.T) { } func importPkg(t *testing.T, path, srcDir string) *types.Package { - pkg, err := Import(make(map[string]*types.Package), path, srcDir, nil) + fset := token.NewFileSet() + pkg, err := Import(fset, make(map[string]*types.Package), path, srcDir, nil) if err != nil { t.Fatal(err) } From 7114e9997b8f5975bea544cb6f7b85b1cdb4c8ef Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 4 Dec 2018 10:17:33 -0800 Subject: [PATCH 223/594] go/types: use new importer.ForCompiler for gotype command This will produce better error messages (position information) for errors referring to imported objects. Change-Id: I24646ae803e6b8f78e9240310a858d4095e9463d Reviewed-on: https://go-review.googlesource.com/c/152538 Reviewed-by: Alan Donovan --- src/go/types/gotype.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/types/gotype.go b/src/go/types/gotype.go index cde373f3556c7..19dd702c45192 100644 --- a/src/go/types/gotype.go +++ b/src/go/types/gotype.go @@ -297,7 +297,7 @@ func checkPkgFiles(files []*ast.File) { } report(err) }, - Importer: importer.For(*compiler, nil), + Importer: importer.ForCompiler(fset, *compiler, nil), Sizes: types.SizesFor(build.Default.Compiler, build.Default.GOARCH), } From 805312ac8761c594c8f89e8033a32b975ed833fc Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Tue, 4 Dec 2018 10:49:27 -0500 Subject: [PATCH 224/594] doc: update 1.12 with latest relnote output Change-Id: Iac0e6671902404a149dd382af37a2be002b1e50f Reviewed-on: https://go-review.googlesource.com/c/152518 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index c398a1131681c..a26a0eac607af 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -151,6 +151,7 @@

    Minor changes to the library

    + @@ -344,6 +345,10 @@

    Minor changes to the library

    TODO: https://golang.org/cl/146659: enable RFC 6555 Fast Fallback by default

    +

    + TODO: https://golang.org/cl/107196: enable TCP keepalives by default +

    +

    net/http
    @@ -356,6 +361,10 @@

    Minor changes to the library

    TODO: https://golang.org/cl/145398: in Transport, don't error on non-chunked response with Trailer header

    +

    + TODO: https://golang.org/cl/152080: update bundled x/net/http2 +

    +
    net/http/httputil
    From bcd3385ed6fb4e9ea3b25798a542427486972967 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 4 Dec 2018 19:31:52 +0000 Subject: [PATCH 225/594] doc/go1.12: flesh out net, etc Change-Id: I081400286544d88eec83a8b332b9f7934fd76ae2 Reviewed-on: https://go-review.googlesource.com/c/152539 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 58 +++++++++++++++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index a26a0eac607af..9908829d44739 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -211,14 +211,6 @@

    Minor changes to the library

    -
    crypto/tls, net/http
    -
    -

    - TODO: https://golang.org/cl/143177: reject HTTP requests to HTTPS server -

    - -
    -
    database/sql

    @@ -337,32 +329,54 @@

    Minor changes to the library

    net
    -

    - TODO: https://golang.org/cl/113997: use splice(2) on Linux when reading from UnixConn, rework splice tests -

    -

    - TODO: https://golang.org/cl/146659: enable RFC 6555 Fast Fallback by default + The + Dialer.DualStack setting is now ignored and deprecated; + RFC 6555 Fast Fallback ("Happy Eyeballs") is now enabled by default. To disable, set + Dialer.FallbackDelay to a negative value.

    - TODO: https://golang.org/cl/107196: enable TCP keepalives by default + Similarly, TCP keep-alives are now enabled by default if + Dialer.KeepAlive is zero. + To disable, set it to a negative value.

    +

    + On Linux, the splice system call is now used when copying from a + UnixConn to a + TCPConn. +

    net/http
    +

    + The HTTP server now rejects misdirected HTTP requests to HTTPS servers with a plaintext "400 Bad Request" response. +

    +

    - TODO: https://golang.org/cl/130115: add Client.CloseIdleConnections + The new Client.CloseIdleConnections + method calls the Client's underlying Transport's CloseIdleConnections + if it has one.

    - TODO: https://golang.org/cl/145398: in Transport, don't error on non-chunked response with Trailer header + The Transport no longer rejects HTTP responses which declare + HTTP Trailers but don't use chunked encoding. Instead, the declared trailers are now just ignored.

    -

    - TODO: https://golang.org/cl/152080: update bundled x/net/http2 +

    + The Transport no longer handles MAX_CONCURRENT_STREAMS values + advertised from HTTP/2 servers as strictly as it did during Go 1.10 and Go 1.11. The default behavior is now back + to how it was in Go 1.9: each connection to a server can have up to MAX_CONCURRENT_STREAMS requests + active and then new TCP connections are created as needed. In Go 1.10 and Go 1.11 the http2 package + would block and wait for requests to finish instead of creating new connections. + To get the stricter behavior back, import the + golang.org/x/net/http2 package + directly and set + Transport.StrictMaxConcurrentStreams to + true.

    @@ -370,7 +384,8 @@

    Minor changes to the library

    net/http/httputil

    - TODO: https://golang.org/cl/146437: make ReverseProxy automatically proxy WebSocket requests + The ReverseProxy now automatically + proxies WebSocket requests.

    @@ -378,7 +393,8 @@

    Minor changes to the library

    os

    - TODO: https://golang.org/cl/125443: add ExitCode method to ProcessState + The new ProcessState.ExitCode method + returns the process's exit code.

    @@ -442,7 +458,7 @@

    Minor changes to the library

    strings

    - TODO: https://golang.org/cl/122835: add Builder.Cap + The new Builder.Cap method returns the capacity of the builder's underlying byte slice.

    From 8a5797a00e0bbe483e88aab4830e8854af55b508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 4 Dec 2018 16:25:39 +0000 Subject: [PATCH 226/594] cmd/go: revert multi-flag GOFLAGS doc example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This partially reverts https://golang.org/cl/135035. Reason for revert: multiple -ldflags=-foo flags simply override each other, since that's the logic for per-package flags. The suggested 'GOFLAGS=-ldflags=-s -ldflags=-w' has never worked for 'go build', and even breaks 'go test' and 'go vet'. There should be a way to specify -ldflags='-w -s' via GOFLAGS, which is being tracked in #29096. For now, just remove the incorrect suggestion. Fixes #29053. Change-Id: I9203056f7e5191e894bcd16595a92df2fb704ea7 Reviewed-on: https://go-review.googlesource.com/c/152479 Reviewed-by: Bryan C. Mills Reviewed-by: Alan Donovan Run-TryBot: Daniel Martí --- src/cmd/go/alldocs.go | 4 +--- src/cmd/go/internal/help/helpdoc.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 12134b21c02be..9108775e75e31 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1472,9 +1472,7 @@ // // Each entry in the GOFLAGS list must be a standalone flag. // Because the entries are space-separated, flag values must -// not contain spaces. In some cases, you can provide multiple flag -// values instead: for example, to set '-ldflags=-s -w' -// you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'. +// not contain spaces. // // Environment variables for use with cgo: // diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index c8ea66a3273d2..ba9b14a4e6e5b 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -509,9 +509,7 @@ General-purpose environment variables: Each entry in the GOFLAGS list must be a standalone flag. Because the entries are space-separated, flag values must -not contain spaces. In some cases, you can provide multiple flag -values instead: for example, to set '-ldflags=-s -w' -you can use 'GOFLAGS=-ldflags=-s -ldflags=-w'. +not contain spaces. Environment variables for use with cgo: From be09bdf589a5c25e5d8b68a546e9b84bc1a1977b Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Tue, 4 Dec 2018 15:54:14 -0500 Subject: [PATCH 227/594] cmd/compile: fix unnamed parameter handling in escape analysis For recursive functions, the parameters were iterated using fn.Name.Defn.Func.Dcl, which does not include unnamed/blank parameters. This results in a mismatch in formal-actual assignments, for example, func f(_ T, x T) f(a, b) should result in { _=a, x=b }, but the escape analysis currently sees only { x=a } and drops b on the floor. This may cause b to not escape when it should (or a escape when it should not). Fix this by using fntype.Params().FieldSlice() instead, which does include unnamed parameters. Also add a sanity check that ensures all the actual parameters are consumed. Fixes #29000 Change-Id: Icd86f2b5d71e7ebbab76e375b7702f62efcf59ae Reviewed-on: https://go-review.googlesource.com/c/152617 Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/esc.go | 98 +++++++++++++++++++----------- test/escape5.go | 17 ++++++ 2 files changed, 81 insertions(+), 34 deletions(-) diff --git a/src/cmd/compile/internal/gc/esc.go b/src/cmd/compile/internal/gc/esc.go index c003964fa7466..322b2dcd0bca2 100644 --- a/src/cmd/compile/internal/gc/esc.go +++ b/src/cmd/compile/internal/gc/esc.go @@ -1652,49 +1652,79 @@ func (e *EscState) esccall(call *Node, parent *Node) { Fatalf("graph inconsistency") } - sawRcvr := false - for _, n := range fn.Name.Defn.Func.Dcl { - switch n.Class() { - case PPARAM: - if call.Op != OCALLFUNC && !sawRcvr { - e.escassignWhyWhere(n, call.Left.Left, "call receiver", call) - sawRcvr = true - continue - } - if len(args) == 0 { - continue - } - arg := args[0] - if n.IsDDD() && !call.IsDDD() { - // Introduce ODDDARG node to represent ... allocation. - arg = nod(ODDDARG, nil, nil) - arr := types.NewArray(n.Type.Elem(), int64(len(args))) - arg.Type = types.NewPtr(arr) // make pointer so it will be tracked - arg.Pos = call.Pos - e.track(arg) - call.Right = arg + i := 0 + + // Receiver. + if call.Op != OCALLFUNC { + rf := fntype.Recv() + if rf.Sym != nil && !rf.Sym.IsBlank() { + n := fn.Name.Defn.Func.Dcl[0] + i++ + if n.Class() != PPARAM { + Fatalf("esccall: not a parameter %+v", n) } - e.escassignWhyWhere(n, arg, "arg to recursive call", call) // TODO this message needs help. - if arg == args[0] { + e.escassignWhyWhere(n, call.Left.Left, "recursive call receiver", call) + } + } + + // Parameters. + for _, param := range fntype.Params().FieldSlice() { + if param.Sym == nil || param.Sym.IsBlank() { + // Unnamed parameter is not listed in Func.Dcl. + // But we need to consume the arg. + if param.IsDDD() && !call.IsDDD() { + args = nil + } else { args = args[1:] - continue } - // "..." arguments are untracked - for _, a := range args { - if Debug['m'] > 3 { - fmt.Printf("%v::esccall:: ... <- %S, untracked\n", linestr(lineno), a) - } - e.escassignSinkWhyWhere(arg, a, "... arg to recursive call", call) + continue + } + + n := fn.Name.Defn.Func.Dcl[i] + i++ + if n.Class() != PPARAM { + Fatalf("esccall: not a parameter %+v", n) + } + if len(args) == 0 { + continue + } + arg := args[0] + if n.IsDDD() && !call.IsDDD() { + // Introduce ODDDARG node to represent ... allocation. + arg = nod(ODDDARG, nil, nil) + arr := types.NewArray(n.Type.Elem(), int64(len(args))) + arg.Type = types.NewPtr(arr) // make pointer so it will be tracked + arg.Pos = call.Pos + e.track(arg) + call.Right = arg + } + e.escassignWhyWhere(n, arg, "arg to recursive call", call) // TODO this message needs help. + if arg == args[0] { + args = args[1:] + continue + } + // "..." arguments are untracked + for _, a := range args { + if Debug['m'] > 3 { + fmt.Printf("%v::esccall:: ... <- %S, untracked\n", linestr(lineno), a) } - // No more PPARAM processing, but keep - // going for PPARAMOUT. - args = nil + e.escassignSinkWhyWhere(arg, a, "... arg to recursive call", call) + } + // ... arg consumes all remaining arguments + args = nil + } - case PPARAMOUT: + // Results. + for _, n := range fn.Name.Defn.Func.Dcl[i:] { + if n.Class() == PPARAMOUT { cE.Retval.Append(n) } } + // Sanity check: all arguments must be consumed. + if len(args) != 0 { + Fatalf("esccall not consumed all args %+v\n", call) + } return } diff --git a/test/escape5.go b/test/escape5.go index 03283a37f8470..e26ecd5275032 100644 --- a/test/escape5.go +++ b/test/escape5.go @@ -228,3 +228,20 @@ func f15730c(args ...interface{}) { // ERROR "leaking param content: args" } } } + +// Issue 29000: unnamed parameter is not handled correctly + +var sink4 interface{} +var alwaysFalse = false + +func f29000(_ int, x interface{}) { // ERROR "leaking param: x" + sink4 = x + if alwaysFalse { + g29000() + } +} + +func g29000() { + x := 1 + f29000(2, x) // ERROR "x escapes to heap" +} From a7af474359179062a82429da927407d2d5395acc Mon Sep 17 00:00:00 2001 From: smasher164 Date: Tue, 4 Dec 2018 06:41:39 -0500 Subject: [PATCH 228/594] cmd/compile: improve error message for non-final variadic parameter Previously, when a function signature had defined a non-final variadic parameter, the error message always referred to the type associated with that parameter. However, if the offending parameter's name was part of an identifier list with a variadic type, one could misinterpret the message, thinking the problem had been with one of the other names in the identifer list. func bar(a, b ...int) {} clear ~~~~~~~^ ^~~~~~~~ confusing This change updates the error message and sets the column position to that of the offending parameter's name, if it exists. Fixes #28450. Change-Id: I076f560925598ed90e218c25d70f9449ffd9b3ea Reviewed-on: https://go-review.googlesource.com/c/152417 Run-TryBot: Matthew Dempsky Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/noder.go | 6 +++++- test/fixedbugs/issue28450.go | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/fixedbugs/issue28450.go diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go index 23c9539b0a1ae..89e9ddb668b06 100644 --- a/src/cmd/compile/internal/gc/noder.go +++ b/src/cmd/compile/internal/gc/noder.go @@ -548,7 +548,11 @@ func (p *noder) param(param *syntax.Field, dddOk, final bool) *Node { if !dddOk { yyerror("cannot use ... in receiver or result parameter list") } else if !final { - yyerror("can only use ... with final parameter in list") + if param.Name == nil { + yyerror("cannot use ... with non-final parameter") + } else { + p.yyerrorpos(param.Name.Pos(), "cannot use ... with non-final parameter %s", param.Name.Value) + } } typ.Op = OTARRAY typ.Right = typ.Left diff --git a/test/fixedbugs/issue28450.go b/test/fixedbugs/issue28450.go new file mode 100644 index 0000000000000..21e5e0c5f1cab --- /dev/null +++ b/test/fixedbugs/issue28450.go @@ -0,0 +1,18 @@ +// errorcheck + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +func f(a, b, c, d ...int) {} // ERROR "non-final parameter a" "non-final parameter b" "non-final parameter c" +func g(a ...int, b ...int) {} // ERROR "non-final parameter a" +func h(...int, ...int, float32) {} // ERROR "non-final parameter" + +type a func(...float32, ...interface{}) // ERROR "non-final parameter" +type b interface { + f(...int, ...int) // ERROR "non-final parameter" + g(a ...int, b ...int, c float32) // ERROR "non-final parameter a" "non-final parameter b" + valid(...int) +} From 9be01c2eab928f9899c67eb7bcdb164728f85a2c Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Tue, 4 Dec 2018 12:05:11 +1100 Subject: [PATCH 229/594] runtime: correct isAbortPC check in isgoexception The expression passed into isAbortPC call was written specifically for windows/amd64 and windows/386 runtime.abort implementation. Adjust the code, so it also works for windows/arm. Fixes #29050 Change-Id: I3dc8ddd08031f34115396429eff512827264826f Reviewed-on: https://go-review.googlesource.com/c/152357 Reviewed-by: Ian Lance Taylor --- src/runtime/signal_windows.go | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/runtime/signal_windows.go b/src/runtime/signal_windows.go index e6a75a160f2a5..3fc1ec5886d8c 100644 --- a/src/runtime/signal_windows.go +++ b/src/runtime/signal_windows.go @@ -38,6 +38,23 @@ func initExceptionHandler() { } } +// isAbort returns true, if context r describes exception raised +// by calling runtime.abort function. +// +//go:nosplit +func isAbort(r *context) bool { + switch GOARCH { + case "386", "amd64": + // In the case of an abort, the exception IP is one byte after + // the INT3 (this differs from UNIX OSes). + return isAbortPC(r.ip() - 1) + case "arm": + return isAbortPC(r.ip()) + default: + return false + } +} + // isgoexception reports whether this exception should be translated // into a Go panic. // @@ -53,9 +70,7 @@ func isgoexception(info *exceptionrecord, r *context) bool { return false } - // In the case of an abort, the exception IP is one byte after - // the INT3 (this differs from UNIX OSes). - if isAbortPC(r.ip() - 1) { + if isAbort(r) { // Never turn abort into a panic. return false } From 897e0807c30a7b1860c15d4c05d68907fbba9262 Mon Sep 17 00:00:00 2001 From: bill_ofarrell Date: Tue, 30 Oct 2018 22:45:51 -0400 Subject: [PATCH 230/594] crypto/elliptic: utilize faster z14 multiply/square instructions (when available) In the s390x assembly implementation of NIST P-256 curve, utilize faster multiply/square instructions introduced in the z14. These new instructions are designed for crypto and are constant time. The algorithm is unchanged except for faster multiplication when run on a z14 or later. On z13, the original mutiplication (also constant time) is used. P-256 performance is critical in many applications, such as Blockchain. name old time new time delta BaseMultP256 24396 ns/op 21564 ns/op 1.13x ScalarMultP256 87546 ns/op 72813 ns/op. 1.20x Change-Id: I7e6d8b420fac56d5f9cc13c9423e2080df854bac Reviewed-on: https://go-review.googlesource.com/c/146022 Reviewed-by: Michael Munday Reviewed-by: Brad Fitzpatrick Run-TryBot: Michael Munday --- src/crypto/elliptic/p256_asm_s390x.s | 550 +++++++++++++++++++++++++-- src/crypto/elliptic/p256_s390x.go | 34 +- src/internal/cpu/cpu.go | 1 + src/internal/cpu/cpu_s390x.go | 7 + 4 files changed, 551 insertions(+), 41 deletions(-) diff --git a/src/crypto/elliptic/p256_asm_s390x.s b/src/crypto/elliptic/p256_asm_s390x.s index 2219b858b3b9b..c5b55a04c3bc7 100644 --- a/src/crypto/elliptic/p256_asm_s390x.s +++ b/src/crypto/elliptic/p256_asm_s390x.s @@ -3,6 +3,8 @@ // license that can be found in the LICENSE file. #include "textflag.h" +#include "go_asm.h" + DATA p256ordK0<>+0x00(SB)/4, $0xee00bc4f DATA p256ord<>+0x00(SB)/8, $0xffffffff00000000 @@ -44,28 +46,23 @@ GLOBL p256ord<>(SB), 8, $32 GLOBL p256<>(SB), 8, $80 GLOBL p256mul<>(SB), 8, $160 -// func hasVectorFacility() bool -TEXT ·hasVectorFacility(SB), NOSPLIT, $24-1 - MOVD $x-24(SP), R1 - XC $24, 0(R1), 0(R1) // clear the storage - MOVD $2, R0 // R0 is the number of double words stored -1 - WORD $0xB2B01000 // STFLE 0(R1) - XOR R0, R0 // reset the value of R0 - MOVBZ z-8(SP), R1 - AND $0x40, R1 - BEQ novector - -vectorinstalled: - // check if the vector instruction has been enabled - VLEIB $0, $0xF, V16 - VLGVB $0, V16, R1 - CMPBNE R1, $0xF, novector - MOVB $1, ret+0(FP) // have vx - RET - -novector: - MOVB $0, ret+0(FP) // no vx - RET +DATA p256vmsl<>+0x0(SB)/8, $0x0012131415161718 +DATA p256vmsl<>+0x8(SB)/8, $0x00191a1b1c1d1e1f +DATA p256vmsl<>+0x10(SB)/8, $0x0012131415161718 +DATA p256vmsl<>+0x18(SB)/8, $0x000b0c0d0e0f1011 +DATA p256vmsl<>+0x20(SB)/8, $0x00191a1b1c1d1e1f +DATA p256vmsl<>+0x28(SB)/8, $0x0012131415161718 +DATA p256vmsl<>+0x30(SB)/8, $0x000b0c0d0e0f1011 +DATA p256vmsl<>+0x38(SB)/8, $0x0012131415161718 +DATA p256vmsl<>+0x40(SB)/8, $0x000405060708090a +DATA p256vmsl<>+0x48(SB)/8, $0x000b0c0d0e0f1011 +DATA p256vmsl<>+0x50(SB)/8, $0x000b0c0d0e0f1011 +DATA p256vmsl<>+0x58(SB)/8, $0x000405060708090a +DATA p256vmsl<>+0x60(SB)/8, $0x1010101000010203 +DATA p256vmsl<>+0x68(SB)/8, $0x100405060708090a +DATA p256vmsl<>+0x70(SB)/8, $0x100405060708090a +DATA p256vmsl<>+0x78(SB)/8, $0x1010101000010203 +GLOBL p256vmsl<>(SB), 8, $128 // --------------------------------------- // iff cond == 1 val <- -val @@ -890,7 +887,7 @@ TEXT ·p256OrdMul(SB), NOSPLIT, $0 #undef K0 // --------------------------------------- -// p256MulInternal +// p256MulInternalVX // V0-V3,V30,V31 - Not Modified // V4-V15 - Volatile @@ -1033,7 +1030,7 @@ TEXT ·p256OrdMul(SB), NOSPLIT, $0 * * Last 'group' needs to RED2||RED1 shifted less */ -TEXT p256MulInternal<>(SB), NOSPLIT, $0-0 +TEXT ·p256MulInternalVX(SB), NOSPLIT, $0-0 VL 32(CPOOL), SEL1 VL 48(CPOOL), SEL2 VL 64(CPOOL), SEL3 @@ -1278,6 +1275,443 @@ TEXT p256MulInternal<>(SB), NOSPLIT, $0-0 #undef CAR1 #undef CAR2 +// --------------------------------------- +// p256MulInternalVMSL +// V0-V3,V30,V31 - Not Modified +// V4-V14 - Volatile + +#define CPOOL R4 +#define SCRATCH R9 + +// Parameters +#define X0 V0 // Not modified +#define X1 V1 // Not modified +#define Y0 V2 // Not modified +#define Y1 V3 // Not modified +#define T0 V4 +#define T1 V5 +#define T2 V6 +#define P0 V30 // Not modified +#define P1 V31 // Not modified + +// input: d0 +// output: h0, h1 +// temp: TEMP, ZERO, BORROW +#define OBSERVATION3(d0, h0, h1, TEMP, ZERO, BORROW) \ + VZERO ZERO \ + VSLDB $4, d0, ZERO, h0 \ + VLR h0, BORROW \ + VSLDB $12, ZERO, h0, TEMP \ + VSQ TEMP, h0, h0 \ + VSLDB $12, d0, BORROW, h1 \ + VSLDB $8, ZERO, BORROW, TEMP \ + VAQ TEMP, h0, h0 \ + +#define OBSERVATION3A(d2, h0, h1, TEMP, ZERO) \ + VZERO ZERO \ + VSLDB $8, d2, ZERO, TEMP \ + VSLDB $8, d2, TEMP, h0 \ + VSLDB $12, ZERO, TEMP, h1 \ + VSQ h1, h0, h0 \ + +TEXT ·p256MulInternalVMSL(SB), NOFRAME|NOSPLIT, $0-0 + VSTM V16, V19, (SCRATCH) + + MOVD $p256vmsl<>+0x00(SB), CPOOL + + // Divide input1 into 5 limbs + VGBM $0x007f, V14 + VZERO V12 + VSLDB $2, X1, X0, V13 + VSLDB $2, Y1, Y0, V8 + VSLDB $4, V12, X1, V11 // V11(X1): 4 bytes limb + VSLDB $4, V12, Y1, V6 // V6: 4 bytes limb + + VN V14, X0, V5 // V5: first 7 bytes limb + VN V14, Y0, V10 // V10: first 7 bytes limb + VN V14, V13, V13 // v13: third 7 bytes limb + VN V14, V8, V8 // V8: third 7 bytes limb + + VMSLG V10, V5, V12, V10 // v10: l10 x l5 (column 1) + VMSLG V8, V5, V12, V8 // v8: l8 x l5 + VMSLG V6, V13, V12, V13 // v13: l6 x l3 + VMSLG V6, V11, V12, V11 // v11: l6 x l1 (column 9) + VMSLG V6, V5, V12, V6 // v6: l6 x l5 + + MOVD $p256vmsl<>+0x00(SB), CPOOL + VGBM $0x7f7f, V14 + + VL 0(CPOOL), V4 + VL 16(CPOOL), V7 + VL 32(CPOOL), V9 + VL 48(CPOOL), V5 + VLM 64(CPOOL), V16, V19 + + VPERM V12, X0, V4, V4 // v4: limb4 | limb5 + VPERM Y1, Y0, V7, V7 + VPERM V12, Y0, V9, V9 // v9: limb10 | limb9 + VPERM X1, X0, V5, V5 + VPERM X1, X0, V16, V16 + VPERM Y1, Y0, V17, V17 + VPERM X1, V12, V18, V18 // v18: limb1 | limb2 + VPERM Y1, V12, V19, V19 // v19: limb7 | limb6 + VN V14, V7, V7 // v7: limb9 | limb8 + VN V14, V5, V5 // v5: limb3 | limb4 + VN V14, V16, V16 // v16: limb2 | limb3 + VN V14, V17, V17 // v17: limb8 | limb7 + + VMSLG V9, V4, V12, V14 // v14: l10 x l4 + l9 x l5 (column 2) + VMSLG V9, V5, V8, V8 // v8: l10 x l9 + l3 x l4 + l8 x l5 (column 3) + VMSLG V9, V16, V12, V16 // v16: l10 x l9 + l2 x l3 + VMSLG V9, V18, V12, V9 // v9: l10 x l1 + l9 x l2 + VMSLG V7, V18, V12, V7 // v7: l9 x l1 + l8 x l2 + VMSLG V17, V4, V16, V16 // v16: l8 x l4 + l7 x l5 + l10 x l9 + l2 x l3 (column 4) + VMSLG V17, V5, V9, V9 // v9: l10 x l1 + l9 x l2 + l8 x l3 + l7 x l4 + VMSLG V17, V18, V12, V17 // v18: l8 x l1 + l7 x l2 + VMSLG V19, V5, V7, V7 // v7: l9 x l1 + l8 x l2 + l7 x l3 + l6 x l4 (column 6) + VMSLG V19, V18, V12, V19 // v19: l7 x l1 + l6 x l2 (column 8) + VAQ V9, V6, V9 // v9: l10 x l1 + l9 x l2 + l8 x l3 + l7 x l4 + l6 x l5 (column 5) + VAQ V17, V13, V13 // v13: l8 x l1 + l7 x l2 + l6 x l3 (column 7) + + VSLDB $9, V12, V10, V4 + VSLDB $9, V12, V7, V5 + VAQ V4, V14, V14 + VAQ V5, V13, V13 + + VSLDB $9, V12, V14, V4 + VSLDB $9, V12, V13, V5 + VAQ V4, V8, V8 + VAQ V5, V19, V19 + + VSLDB $9, V12, V8, V4 + VSLDB $9, V12, V19, V5 + VAQ V4, V16, V16 + VAQ V5, V11, V11 + + VSLDB $9, V12, V16, V4 + VAQ V4, V9, V17 + + VGBM $0x007f, V4 + VGBM $0x00ff, V5 + + VN V10, V4, V10 + VN V14, V4, V14 + VN V8, V4, V8 + VN V16, V4, V16 + VN V17, V4, V9 + VN V7, V4, V7 + VN V13, V4, V13 + VN V19, V4, V19 + VN V11, V5, V11 + + VSLDB $7, V14, V14, V14 + VSLDB $14, V8, V12, V4 + VSLDB $14, V12, V8, V8 + VSLDB $5, V16, V16, V16 + VSLDB $12, V9, V12, V5 + + VO V14, V10, V10 + VO V8, V16, V16 + VO V4, V10, V10 // first rightmost 128bits of the multiplication result + VO V5, V16, V16 // second rightmost 128bits of the multiplication result + + // adjust v7, v13, v19, v11 + VSLDB $7, V13, V13, V13 + VSLDB $14, V19, V12, V4 + VSLDB $14, V12, V19, V19 + VSLDB $5, V11, V12, V5 + VO V13, V7, V7 + VO V4, V7, V7 + VO V19, V5, V11 + + VSLDB $9, V12, V17, V14 + VSLDB $12, V12, V9, V9 + VACCQ V7, V14, V13 + VAQ V7, V14, V7 + VAQ V11, V13, V11 + + // First reduction, 96 bits + VSLDB $4, V16, V10, T0 + VSLDB $4, V12, V16, T1 + VSLDB $3, V11, V7, V11 // fourth rightmost 128bits of the multiplication result + VSLDB $3, V7, V12, V7 + OBSERVATION3(V10, V8, T2, V17, V18, V19)// results V8 | T2 + VO V7, V9, V7 // third rightmost 128bits of the multiplication result + VACCQ T0, T2, V9 + VAQ T0, T2, T2 + VACQ T1, V8, V9, V8 + + // Second reduction 96 bits + VSLDB $4, V8, T2, T0 + VSLDB $4, V12, V8, T1 + OBSERVATION3(T2, V9, V8, V17, V18, V19)// results V9 | V8 + VACCQ T0, V8, T2 + VAQ T0, V8, V8 + VACQ T1, V9, T2, V9 + + // Third reduction 64 bits + VSLDB $8, V9, V8, T0 + VSLDB $8, V12, V9, T1 + OBSERVATION3A(V8, V14, V13, V17, V18)// results V14 | V13 + VACCQ T0, V13, V12 + VAQ T0, V13, V13 + VACQ T1, V14, V12, V14 + VACCQ V13, V7, V12 + VAQ V13, V7, T0 + VACCCQ V14, V11, V12, T2 + VACQ V14, V11, V12, T1 // results T2 | T1 | T0 + + // --------------------------------------------------- + MOVD $p256mul<>+0x00(SB), CPOOL + + VZERO V12 + VSCBIQ P0, T0, V8 + VSQ P0, T0, V7 + VSBCBIQ T1, P1, V8, V10 + VSBIQ T1, P1, V8, V9 + VSBIQ T2, V12, V10, T2 + + // what output to use, V9||V7 or T1||T0? + VSEL T0, V7, T2, T0 + VSEL T1, V9, T2, T1 + + VLM (SCRATCH), V16, V19 + + RET + +// --------------------------------------- +// p256SqrInternalVMSL +// V0-V1,V30,V31 - Not Modified +// V4-V14 - Volatile + +TEXT ·p256SqrInternalVMSL(SB), NOFRAME|NOSPLIT, $0-0 + VSTM V16, V18, (SCRATCH) + + MOVD $p256vmsl<>+0x00(SB), CPOOL + // Divide input into limbs + VGBM $0x007f, V14 + VZERO V12 + VSLDB $2, X1, X0, V13 + VSLDB $4, V12, X1, V11 // V11(X1): 4 bytes limb + + VN V14, X0, V10 // V10: first 7 bytes limb + VN V14, V13, V13 // v13: third 7 bytes limb + + VMSLG V10, V10, V12, V10 // v10: l10 x l5 (column 1) + VMSLG V13, V13, V12, V13 // v13: l8 x l3 + VMSLG V11, V11, V12, V11 // v11: l6 x l1 (column 9) + + MOVD $p256vmsl<>+0x00(SB), CPOOL + VGBM $0x7f7f, V14 + + VL 0(CPOOL), V4 + VL 16(CPOOL), V7 + VL 32(CPOOL), V9 + VL 48(CPOOL), V5 + VLM 64(CPOOL), V16, V18 + VL 112(CPOOL), V8 + + VPERM V12, X0, V4, V4 // v4: limb4 | limb5 + VPERM X1, X0, V7, V7 + VPERM V12, X0, V9, V9 // v9: limb10 | limb9 + VPERM X1, X0, V5, V5 + VPERM X1, X0, V16, V16 + VPERM X1, X0, V17, V17 + VPERM X1, V12, V18, V18 // v18: limb1 | limb2 + VPERM X1, V12, V8, V8 // v8: limb7 | limb6 + VN V14, V7, V7 // v7: limb9 | limb8 + VN V14, V5, V5 // v5: limb3 | limb4 + VN V14, V16, V16 // v16: limb2 | limb3 + VN V14, V17, V17 // v17: limb8 | limb7 + + VMSLEOG V9, V18, V13, V6 // v6: l10 x l1 + l9 x l2 + l8 x l3 + l7 x l4 + l6 x l5 (column 5) + VMSLG V9, V4, V12, V14 // v14: l10 x l4 + l9 x l5 (column 2) + VMSLEOG V9, V16, V12, V16 // v16: l10 x l2 + l9 x l3 + l8 x l4 + l7 x l5 (column 4) + VMSLEOG V7, V18, V12, V7 // v7: l9 x l1 + l8 x l2 (column 6) + VMSLEG V17, V18, V12, V13 // v13: l8 x l1 + l7 x l2 + l6 x l3 (column 7) + VMSLG V8, V18, V12, V8 // v8: l7 x l1 + l6 x l2 (column 8) + VMSLEG V9, V5, V12, V18 // v18: l10 x l3 + l9 x l4 + l8 x l5 (column 3) + + VSLDB $9, V12, V10, V4 + VSLDB $9, V12, V7, V5 + VAQ V4, V14, V14 + VAQ V5, V13, V13 + + VSLDB $9, V12, V14, V4 + VSLDB $9, V12, V13, V5 + VAQ V4, V18, V18 + VAQ V5, V8, V8 + + VSLDB $9, V12, V18, V4 + VSLDB $9, V12, V8, V5 + VAQ V4, V16, V16 + VAQ V5, V11, V11 + + VSLDB $9, V12, V16, V4 + VAQ V4, V6, V17 + + VGBM $0x007f, V4 + VGBM $0x00ff, V5 + + VN V10, V4, V10 + VN V14, V4, V14 + VN V18, V4, V18 + VN V16, V4, V16 + VN V17, V4, V9 + VN V7, V4, V7 + VN V13, V4, V13 + VN V8, V4, V8 + VN V11, V5, V11 + + VSLDB $7, V14, V14, V14 + VSLDB $14, V18, V12, V4 + VSLDB $14, V12, V18, V18 + VSLDB $5, V16, V16, V16 + VSLDB $12, V9, V12, V5 + + VO V14, V10, V10 + VO V18, V16, V16 + VO V4, V10, V10 // first rightmost 128bits of the multiplication result + VO V5, V16, V16 // second rightmost 128bits of the multiplication result + + // adjust v7, v13, v8, v11 + VSLDB $7, V13, V13, V13 + VSLDB $14, V8, V12, V4 + VSLDB $14, V12, V8, V8 + VSLDB $5, V11, V12, V5 + VO V13, V7, V7 + VO V4, V7, V7 + VO V8, V5, V11 + + VSLDB $9, V12, V17, V14 + VSLDB $12, V12, V9, V9 + VACCQ V7, V14, V13 + VAQ V7, V14, V7 + VAQ V11, V13, V11 + + // First reduction, 96 bits + VSLDB $4, V16, V10, T0 + VSLDB $4, V12, V16, T1 + VSLDB $3, V11, V7, V11 // fourth rightmost 128bits of the multiplication result + VSLDB $3, V7, V12, V7 + OBSERVATION3(V10, V8, T2, V16, V17, V18)// results V8 | T2 + VO V7, V9, V7 // third rightmost 128bits of the multiplication result + VACCQ T0, T2, V9 + VAQ T0, T2, T2 + VACQ T1, V8, V9, V8 + + // Second reduction 96 bits + VSLDB $4, V8, T2, T0 + VSLDB $4, V12, V8, T1 + OBSERVATION3(T2, V9, V8, V16, V17, V18)// results V9 | V8 + VACCQ T0, V8, T2 + VAQ T0, V8, V8 + VACQ T1, V9, T2, V9 + + // Third reduction 64 bits + VSLDB $8, V9, V8, T0 + VSLDB $8, V12, V9, T1 + OBSERVATION3A(V8, V14, V13, V17, V18)// results V14 | V13 + VACCQ T0, V13, V12 + VAQ T0, V13, V13 + VACQ T1, V14, V12, V14 + VACCQ V13, V7, V12 + VAQ V13, V7, T0 + VACCCQ V14, V11, V12, T2 + VACQ V14, V11, V12, T1 // results T2 | T1 | T0 + + // --------------------------------------------------- + MOVD $p256mul<>+0x00(SB), CPOOL + + VZERO V12 + VSCBIQ P0, T0, V8 + VSQ P0, T0, V7 + VSBCBIQ T1, P1, V8, V10 + VSBIQ T1, P1, V8, V9 + VSBIQ T2, V12, V10, T2 + + // what output to use, V9||V7 or T1||T0? + VSEL T0, V7, T2, T0 + VSEL T1, V9, T2, T1 + + VLM (SCRATCH), V16, V18 + RET + + + +#undef CPOOL +#undef SCRATCH +#undef X0 +#undef X1 +#undef Y0 +#undef Y1 +#undef T0 +#undef T1 +#undef T2 +#undef P0 +#undef P1 + +#define SCRATCH R9 + +TEXT p256MulInternal<>(SB),NOSPLIT,$64-0 + MOVD $scratch-64(SP), SCRATCH + MOVD ·p256MulInternalFacility+0x00(SB),R7 + CALL (R7) + RET + +TEXT ·p256MulInternalTrampolineSetup(SB),NOSPLIT|NOFRAME, $0 + MOVBZ internal∕cpu·S390X+const_offsetS390xHasVE1(SB), R0 + MOVD $·p256MulInternalFacility+0x00(SB), R7 + MOVD $·p256MulInternalVX(SB), R8 + CMPBEQ R0, $0, novmsl // VE1 facility = 1, VMSL supported + MOVD $·p256MulInternalVMSL(SB), R8 +novmsl: + MOVD R8, 0(R7) + BR (R8) + +GLOBL ·p256MulInternalFacility+0x00(SB), NOPTR, $8 +DATA ·p256MulInternalFacility+0x00(SB)/8, $·p256MulInternalTrampolineSetup(SB) + +// Parameters +#define X0 V0 +#define X1 V1 +#define Y0 V2 +#define Y1 V3 + +TEXT ·p256SqrInternalVX(SB), NOFRAME|NOSPLIT, $0 + VLR X0, Y0 + VLR X1, Y1 + BR ·p256MulInternalVX(SB) + +#undef X0 +#undef X1 +#undef Y0 +#undef Y1 + + +TEXT p256SqrInternal<>(SB),NOSPLIT,$48-0 + MOVD $scratch-48(SP), SCRATCH + MOVD ·p256SqrInternalFacility+0x00(SB),R7 + CALL (R7) + RET + +TEXT ·p256SqrInternalTrampolineSetup(SB),NOSPLIT|NOFRAME, $0 + MOVBZ internal∕cpu·S390X+const_offsetS390xHasVE1(SB), R0 + MOVD $·p256SqrInternalFacility+0x00(SB), R7 + MOVD $·p256SqrInternalVX(SB), R8 + CMPBEQ R0, $0, novmsl // VE1 facility = 1, VMSL supported + MOVD $·p256SqrInternalVMSL(SB), R8 +novmsl: + MOVD R8, 0(R7) + BR (R8) + + +GLOBL ·p256SqrInternalFacility+0x00(SB), NOPTR, $8 +DATA ·p256SqrInternalFacility+0x00(SB)/8, $·p256SqrInternalTrampolineSetup(SB) + +#undef SCRATCH + + #define p256SubInternal(T1, T0, X1, X0, Y1, Y0) \ VZERO ZER \ VSCBIQ Y0, X0, CAR1 \ @@ -1385,6 +1819,52 @@ TEXT ·p256MulAsm(SB), NOSPLIT, $0 #undef P0 #undef P1 +// --------------------------------------- +// func p256SqrAsm(res, in1 []byte) +#define res_ptr R1 +#define x_ptr R2 +#define y_ptr R3 +#define CPOOL R4 + +// Parameters +#define X0 V0 +#define X1 V1 +#define T0 V4 +#define T1 V5 + +// Constants +#define P0 V30 +#define P1 V31 +TEXT ·p256SqrAsm(SB), NOSPLIT, $0 + MOVD res+0(FP), res_ptr + MOVD in1+24(FP), x_ptr + + VL (1*16)(x_ptr), X0 + VL (0*16)(x_ptr), X1 + + MOVD $p256mul<>+0x00(SB), CPOOL + VL 16(CPOOL), P0 + VL 0(CPOOL), P1 + + CALL p256SqrInternal<>(SB) + + VST T0, (1*16)(res_ptr) + VST T1, (0*16)(res_ptr) + RET + +#undef res_ptr +#undef x_ptr +#undef y_ptr +#undef CPOOL + +#undef X0 +#undef X1 +#undef T0 +#undef T1 +#undef P0 +#undef P1 + + // Point add with P2 being affine point // If sign == 1 -> P2 = -P2 // If sel == 0 -> P3 = P1 @@ -1524,7 +2004,7 @@ TEXT ·p256PointAddAffineAsm(SB), NOSPLIT, $0 VL 80(P1ptr), X0 // Z1L VLR X0, Y0 VLR X1, Y1 - CALL p256MulInternal<>(SB) + CALL p256SqrInternal<>(SB) // X=T ; Y- ; MUL; T2=T // T2 = T1*Z1 T1 T2 VLR T0, X0 @@ -1570,7 +2050,7 @@ TEXT ·p256PointAddAffineAsm(SB), NOSPLIT, $0 // X=Y; Y- ; MUL; X=T // T3 = T1*T1 T2 VLR Y0, X0 VLR Y1, X1 - CALL p256MulInternal<>(SB) + CALL p256SqrInternal<>(SB) VLR T0, X0 VLR T1, X1 @@ -1594,7 +2074,7 @@ TEXT ·p256PointAddAffineAsm(SB), NOSPLIT, $0 VLR T2H, X1 VLR T2L, Y0 VLR T2H, Y1 - CALL p256MulInternal<>(SB) + CALL p256SqrInternal<>(SB) // SUB(T(SB) + CALL p256SqrInternal<>(SB) // SUB(X(SB) + CALL p256SqrInternal<>(SB) // X=T ; Y=X1; MUL; T3=T // T3 = Y3*X1 VLR T0, X0 @@ -1873,7 +2353,7 @@ TEXT ·p256PointDoubleAsm(SB), NOSPLIT, $0 // X- ; Y=X ; MUL; T- // Y3 = Y3² VLR X0, Y0 VLR X1, Y1 - CALL p256MulInternal<>(SB) + CALL p256SqrInternal<>(SB) // HAL(Y3(SB) + CALL p256SqrInternal<>(SB) // ADD(T1(SB) + CALL p256SqrInternal<>(SB) // X- ; Y=T ; MUL; R=T // R = Z1*T1 VLR T0, Y0 @@ -2085,7 +2565,7 @@ TEXT ·p256PointAddAsm(SB), NOSPLIT, $0 VL 80(P2ptr), X0 // Z2L VLR X0, Y0 VLR X1, Y1 - CALL p256MulInternal<>(SB) + CALL p256SqrInternal<>(SB) // X- ; Y=T ; MUL; S1=T // S1 = Z2*T2 VLR T0, Y0 @@ -2175,7 +2655,7 @@ TEXT ·p256PointAddAsm(SB), NOSPLIT, $0 VLR HH, X1 VLR HL, Y0 VLR HH, Y1 - CALL p256MulInternal<>(SB) + CALL p256SqrInternal<>(SB) // X- ; Y=T ; MUL; T2=T // T2 = H*T1 VLR T0, Y0 @@ -2196,7 +2676,7 @@ TEXT ·p256PointAddAsm(SB), NOSPLIT, $0 VLR RH, X1 VLR RL, Y0 VLR RH, Y1 - CALL p256MulInternal<>(SB) + CALL p256SqrInternal<>(SB) // SUB(T Date: Wed, 5 Dec 2018 08:01:07 +0900 Subject: [PATCH 231/594] cmd/cgo: reject names that are likely to be mangled C name Fixes #28721 Change-Id: I00356f3a9b0c2fb21dc9c2237dd5296fcb3b319b Reviewed-on: https://go-review.googlesource.com/c/152657 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- misc/cgo/errors/errors_test.go | 1 + misc/cgo/errors/src/issue28721.go | 29 +++++++++++++++++++++++++++++ src/cmd/cgo/ast.go | 9 +++++++++ src/cmd/cgo/gcc.go | 13 +++++++++++++ src/cmd/cgo/main.go | 4 +++- 5 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 misc/cgo/errors/src/issue28721.go diff --git a/misc/cgo/errors/errors_test.go b/misc/cgo/errors/errors_test.go index 0d7ca4cf9d89c..d2a72a46f430a 100644 --- a/misc/cgo/errors/errors_test.go +++ b/misc/cgo/errors/errors_test.go @@ -121,6 +121,7 @@ func TestReportsTypeErrors(t *testing.T) { "issue16591.go", "issue18452.go", "issue18889.go", + "issue28721.go", } { check(t, file) } diff --git a/misc/cgo/errors/src/issue28721.go b/misc/cgo/errors/src/issue28721.go new file mode 100644 index 0000000000000..0eb2a9271c29d --- /dev/null +++ b/misc/cgo/errors/src/issue28721.go @@ -0,0 +1,29 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// cgo should reject the use of mangled C names. + +package main + +/* +typedef struct a { + int i; +} a; +void fn(void) {} +*/ +import "C" + +type B _Ctype_struct_a // ERROR HERE + +var a _Ctype_struct_a // ERROR HERE + +type A struct { + a *_Ctype_struct_a // ERROR HERE +} + +var notExist _Ctype_NotExist // ERROR HERE + +func main() { + _Cfunc_fn() // ERROR HERE +} diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go index 06058cb570d4f..83d727a8a5da6 100644 --- a/src/cmd/cgo/ast.go +++ b/src/cmd/cgo/ast.go @@ -145,6 +145,7 @@ func (f *File) ParseGo(name string, src []byte) { if f.Ref == nil { f.Ref = make([]*Ref, 0, 8) } + f.walk(ast2, ctxProg, (*File).validateIdents) f.walk(ast2, ctxProg, (*File).saveExprs) // Accumulate exported functions. @@ -181,6 +182,14 @@ func commentText(g *ast.CommentGroup) string { return strings.Join(pieces, "") } +func (f *File) validateIdents(x interface{}, context astContext) { + if x, ok := x.(*ast.Ident); ok { + if f.isMangledName(x.Name) { + error_(x.Pos(), "identifier %q may conflict with identifiers generated by cgo", x.Name) + } + } +} + // Save various references we are going to need later. func (f *File) saveExprs(x interface{}, context astContext) { switch x := x.(type) { diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 4464b840dd69c..b59bfe68fe10a 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -719,6 +719,19 @@ func (p *Package) mangleName(n *Name) { n.Mangle = prefix + n.Kind + "_" + n.Go } +func (f *File) isMangledName(s string) bool { + prefix := "_C" + if strings.HasPrefix(s, prefix) { + t := s[len(prefix):] + for _, k := range nameKinds { + if strings.HasPrefix(t, k+"_") { + return true + } + } + } + return false +} + // rewriteCalls rewrites all calls that pass pointers to check that // they follow the rules for passing pointers between Go and C. // This reports whether the package needs to import unsafe as _cgo_unsafe. diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go index 7a845b17a4e77..80435b0634d90 100644 --- a/src/cmd/cgo/main.go +++ b/src/cmd/cgo/main.go @@ -106,13 +106,15 @@ func (r *Ref) Pos() token.Pos { return (*r.Expr).Pos() } +var nameKinds = []string{"iconst", "fconst", "sconst", "type", "var", "fpvar", "func", "macro", "not-type"} + // A Name collects information about C.xxx. type Name struct { Go string // name used in Go referring to package C Mangle string // name used in generated Go C string // name used in C Define string // #define expansion - Kind string // "iconst", "fconst", "sconst", "type", "var", "fpvar", "func", "macro", "not-type" + Kind string // one of the nameKinds Type *Type // the type of xxx FuncType *FuncType AddError bool From aac285c2df754f61b49baf2a35bffae0ae5bf95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 5 Dec 2018 14:15:37 +0100 Subject: [PATCH 232/594] cmd/go/internal/lockedfile: fix filelock.Unlock() called twice filelock.Unlock() was called twice for fcntl implementation if an error occurs during file.{,R}Lock(): once in the error handler, once in filelock.lock(). Change-Id: I5ad84e8ef6b5e51d79e0a7a0c51f465276cd0c57 Reviewed-on: https://go-review.googlesource.com/c/152717 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- .../lockedfile/lockedfile_filelock.go | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/cmd/go/internal/lockedfile/lockedfile_filelock.go b/src/cmd/go/internal/lockedfile/lockedfile_filelock.go index 1c390f7425d0a..f63dd8664b0ab 100644 --- a/src/cmd/go/internal/lockedfile/lockedfile_filelock.go +++ b/src/cmd/go/internal/lockedfile/lockedfile_filelock.go @@ -29,24 +29,25 @@ func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { default: err = filelock.RLock(f) } - if err == nil && flag&os.O_TRUNC == os.O_TRUNC { - if err = f.Truncate(0); err != nil { + if err != nil { + f.Close() + return nil, err + } + + if flag&os.O_TRUNC == os.O_TRUNC { + if err := f.Truncate(0); err != nil { // The documentation for os.O_TRUNC says “if possible, truncate file when // opened”, but doesn't define “possible” (golang.org/issue/28699). // We'll treat regular files (and symlinks to regular files) as “possible” // and ignore errors for the rest. - if fi, statErr := f.Stat(); statErr == nil && !fi.Mode().IsRegular() { - err = nil + if fi, statErr := f.Stat(); statErr != nil || fi.Mode().IsRegular() { + filelock.Unlock(f) + f.Close() + return nil, err } } } - if err != nil { - filelock.Unlock(f) - f.Close() - return nil, err - } - return f, nil } From ccb8735ba2ec75457b9885382d8e56325134a50a Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Tue, 4 Dec 2018 16:22:26 -0500 Subject: [PATCH 233/594] doc/go1.12: add some package release notes Change-Id: I845eab3c98a3d472c71310de4e0475045eb59d4e Reviewed-on: https://go-review.googlesource.com/c/152619 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 51 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 9908829d44739..f452d136c0883 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -171,17 +171,20 @@

    Minor changes to the library

    -
    bytes, strings
    +
    bytes

    - TODO: https://golang.org/cl/137855: add ReplaceAll + The new function ReplaceAll returns a copy of + a byte slice with all non-overlapping instances of a value replaced by another.

    - TODO: https://golang.org/cl/145098: fix Reader.UnreadRune returning without error on a zero Reader + A pointer to a zero-value Reader is now + functionally equivalent to NewReader(nil). + Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.

    -
    +
    cmd,runtime
    @@ -214,7 +217,9 @@

    Minor changes to the library

    database/sql

    - TODO: https://golang.org/cl/145738: add support for returning cursors to client + A query cursor can now be obtained by passing a + *Rows + value to the Row.Scan method.

    @@ -222,19 +227,34 @@

    Minor changes to the library

    expvar

    - TODO: https://golang.org/cl/139537: add Map.Delete + The new Delete method allows + for deletion of key/value pairs from a Map.

    fmt
    -

    - TODO: https://golang.org/cl/129777: print values for map keys with non-reflexive equality +

    + Maps are now printed in key-sorted order to ease testing. The ordering rules are: +

      +
    • When applicable, nil compares low +
    • ints, floats, and strings order by < +
    • NaN compares less than non-NaN floats +
    • bool compares false before true +
    • Complex compares real, then imaginary +
    • Pointers compare by machine address +
    • Channel values compare by machine address +
    • Structs compare each field in turn +
    • Arrays compare each element in turn +
    • Interface values compare first by reflect.Type describing the concrete type + and then by concrete value as described in the previous rules. +

    -

    - TODO: https://golang.org/cl/142737: print maps in key-sorted order +

    + When printing maps, non-reflexive key values like NaN were previously + displayed as <nil>. As of this release, the correct values are printed.

    @@ -457,6 +477,17 @@

    Minor changes to the library

    strings
    +

    + The new function ReplaceAll returns a copy of + a string with all non-overlapping instances of a value replaced by another. +

    + +

    + A pointer to a zero-value Reader is now + functionally equivalent to NewReader(nil). + Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases. +

    +

    The new Builder.Cap method returns the capacity of the builder's underlying byte slice.

    From 35435b27c406cdbe506a2eef56c6a10f208e3b9c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 5 Dec 2018 09:52:19 -0800 Subject: [PATCH 234/594] cmd/link: close input files when copying to temporary directory Fixes #29110 Change-Id: I077d1a9caa7f4545de1418cec718c4a37ac36ef8 Reviewed-on: https://go-review.googlesource.com/c/152757 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/link/internal/ld/lib.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 6c5bc542a77c4..755693b27ec74 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1017,6 +1017,7 @@ func hostobjCopy() (paths []string) { if err != nil { Exitf("cannot reopen %s: %v", h.pn, err) } + defer f.Close() if _, err := f.Seek(h.off, 0); err != nil { Exitf("cannot seek %s: %v", h.pn, err) } From 8765e89a8ac2f4f2cfb8a4aea21b563168b6b6b6 Mon Sep 17 00:00:00 2001 From: Baokun Lee Date: Tue, 20 Nov 2018 00:40:28 +0800 Subject: [PATCH 235/594] cmd/go/internal/modcmd: fix go mod edit -module replaces empty string Fixes golang/go#28820. Change-Id: Id931617efcf161ec934eb6d44062ad95e8a6ab8d Reviewed-on: https://go-review.googlesource.com/c/150277 Run-TryBot: Baokun Lee Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/modcmd/edit.go | 2 +- src/cmd/go/testdata/script/mod_edit.txt | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/internal/modcmd/edit.go b/src/cmd/go/internal/modcmd/edit.go index f13fe249937de..5066e4ddf75f9 100644 --- a/src/cmd/go/internal/modcmd/edit.go +++ b/src/cmd/go/internal/modcmd/edit.go @@ -183,7 +183,7 @@ func runEdit(cmd *base.Command, args []string) { } if *editModule != "" { - modFile.AddModuleStmt(modload.CmdModModule) + modFile.AddModuleStmt(*editModule) } if *editGo != "" { diff --git a/src/cmd/go/testdata/script/mod_edit.txt b/src/cmd/go/testdata/script/mod_edit.txt index 61801d5021bf2..aa714e8b3cd7b 100644 --- a/src/cmd/go/testdata/script/mod_edit.txt +++ b/src/cmd/go/testdata/script/mod_edit.txt @@ -42,6 +42,12 @@ go mod edit -fmt # without -print, should write file (and nothing to stdout) ! stdout . cmpenv go.mod $WORK/go.mod.edit6 +# go mod edit -module +cd $WORK/m +go mod init a.a/b/c +go mod edit -module x.x/y/z +cmpenv go.mod go.mod.edit + -- x.go -- package x @@ -159,3 +165,7 @@ exclude x.1 v1.2.0 replace x.1 => y.1/v2 v2.3.6 require x.3 v1.99.0 +-- $WORK/m/go.mod.edit -- +module x.x/y/z + +go $goversion \ No newline at end of file From 09f541173e6901a5fc86917561a2eb7c43572edf Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 5 Dec 2018 20:59:42 +0100 Subject: [PATCH 236/594] net: skip TestVariousDeadlines on Plan 9 This test is regularly failing on the plan9/386 builder running on GCE, but we haven't figured out the issue yet. Updates #26945. Change-Id: I8cbe0df43c0757e7bc68e370311f4a28cd7b049b Reviewed-on: https://go-review.googlesource.com/c/152721 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/timeout_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net/timeout_test.go b/src/net/timeout_test.go index 7c7d0c89938c9..9599fa1d3e886 100644 --- a/src/net/timeout_test.go +++ b/src/net/timeout_test.go @@ -812,6 +812,9 @@ func (b neverEnding) Read(p []byte) (int, error) { } func testVariousDeadlines(t *testing.T) { + if runtime.GOOS == "plan9" { + t.Skip("skipping test on plan9; see golang.org/issue/26945") + } type result struct { n int64 err error From cd47e8944dca019a89222b99b343d9981ac3a8e1 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 5 Dec 2018 09:52:59 -0800 Subject: [PATCH 237/594] cmd/compile: avoid multiple errors regarding misuse of ... in signatures Follow-up on #28450 (golang.org/cl/152417). Updates #28450. Fixes #29107. Change-Id: Ib4b4fe582c35315a4f71cf6dbc7f7f2f24b37ec1 Reviewed-on: https://go-review.googlesource.com/c/152758 Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/gc/noder.go | 8 +++++--- test/fixedbugs/issue28450.go | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cmd/compile/internal/gc/noder.go b/src/cmd/compile/internal/gc/noder.go index 89e9ddb668b06..3aa303c0c1c40 100644 --- a/src/cmd/compile/internal/gc/noder.go +++ b/src/cmd/compile/internal/gc/noder.go @@ -546,12 +546,14 @@ func (p *noder) param(param *syntax.Field, dddOk, final bool) *Node { // rewrite ...T parameter if typ.Op == ODDD { if !dddOk { - yyerror("cannot use ... in receiver or result parameter list") + // We mark these as syntax errors to get automatic elimination + // of multiple such errors per line (see yyerrorl in subr.go). + yyerror("syntax error: cannot use ... in receiver or result parameter list") } else if !final { if param.Name == nil { - yyerror("cannot use ... with non-final parameter") + yyerror("syntax error: cannot use ... with non-final parameter") } else { - p.yyerrorpos(param.Name.Pos(), "cannot use ... with non-final parameter %s", param.Name.Value) + p.yyerrorpos(param.Name.Pos(), "syntax error: cannot use ... with non-final parameter %s", param.Name.Value) } } typ.Op = OTARRAY diff --git a/test/fixedbugs/issue28450.go b/test/fixedbugs/issue28450.go index 21e5e0c5f1cab..1a1183b2912f6 100644 --- a/test/fixedbugs/issue28450.go +++ b/test/fixedbugs/issue28450.go @@ -6,13 +6,13 @@ package p -func f(a, b, c, d ...int) {} // ERROR "non-final parameter a" "non-final parameter b" "non-final parameter c" +func f(a, b, c, d ...int) {} // ERROR "non-final parameter a" func g(a ...int, b ...int) {} // ERROR "non-final parameter a" func h(...int, ...int, float32) {} // ERROR "non-final parameter" type a func(...float32, ...interface{}) // ERROR "non-final parameter" type b interface { f(...int, ...int) // ERROR "non-final parameter" - g(a ...int, b ...int, c float32) // ERROR "non-final parameter a" "non-final parameter b" + g(a ...int, b ...int, c float32) // ERROR "non-final parameter a" valid(...int) } From 162de6b5f0c332ca0a1ac5879682cd48c2f93ead Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Tue, 4 Dec 2018 10:29:23 -0500 Subject: [PATCH 238/594] cmd/vendor: update to golang.org/x/arch@5a4828b This updates master to fix the ppc64 objdump. There were many cases where the Go objdump was generating opcodes that didn't exist in the Go assembler, or generated operands in the wrong order. The goal is to generate a Go objdump that is acceptable to the Go assembler, or as close as possible. An additional change will be needed for the Go objdump tool to make use of this. Change-Id: Ie8d2d534e13b9a64852c99b4b864a9c08ed7e036 Reviewed-on: https://go-review.googlesource.com/c/152517 Reviewed-by: Carlos Eduardo Seo Reviewed-by: Cherry Zhang Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot --- .../x/arch/ppc64/ppc64asm/decode.go | 2 +- .../x/arch/ppc64/ppc64asm/decode_test.go | 4 +- .../golang.org/x/arch/ppc64/ppc64asm/gnu.go | 8 +- .../x/arch/ppc64/ppc64asm/objdump_test.go | 4 +- .../golang.org/x/arch/ppc64/ppc64asm/plan9.go | 129 +- .../x/arch/ppc64/ppc64asm/tables.go | 1495 +++++++++-------- .../x/arch/ppc64/ppc64asm/testdata/decode.txt | 55 +- src/cmd/vendor/vendor.json | 4 +- 8 files changed, 941 insertions(+), 760 deletions(-) diff --git a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode.go b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode.go index e1518d52e5c11..5f04ff40e450a 100644 --- a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode.go +++ b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode.go @@ -172,7 +172,7 @@ func Decode(src []byte, ord binary.ByteOrder) (inst Inst, err error) { } break } - if inst.Op == 0 { + if inst.Op == 0 && inst.Enc != 0 { return inst, errUnknown } return inst, nil diff --git a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode_test.go b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode_test.go index 71f64d64dcc63..039b3edfa0ad0 100644 --- a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode_test.go +++ b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode_test.go @@ -50,8 +50,8 @@ func TestDecode(t *testing.T) { switch syntax { case "gnu": out = GNUSyntax(inst) - //case "plan9": - // out = GoSyntax(inst, 0, nil, nil) + case "plan9": + out = GoSyntax(inst, 0, nil) default: t.Errorf("unknown syntax %q", syntax) continue diff --git a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/gnu.go b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/gnu.go index 63be379a0454b..70872bbd74335 100644 --- a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/gnu.go +++ b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/gnu.go @@ -14,8 +14,12 @@ import ( // This form typically matches the syntax defined in the Power ISA Reference Manual. func GNUSyntax(inst Inst) string { var buf bytes.Buffer - if inst.Op == 0 { - return "error: unkown instruction" + // When there are all 0s, identify them as the disassembler + // in binutils would. + if inst.Enc == 0 { + return ".long 0x0" + } else if inst.Op == 0 { + return "error: unknown instruction" } buf.WriteString(inst.Op.String()) sep := " " diff --git a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/objdump_test.go b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/objdump_test.go index ae825fd23c961..b886f7bad1a50 100644 --- a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/objdump_test.go +++ b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/objdump_test.go @@ -49,11 +49,11 @@ func allowedMismatchObjdump(text string, size int, inst *Inst, dec ExtInst) bool switch inst.Op { case BC, BCA, BL, BLA, BCL, BCLA, TDI, TWI, TW, TD: return true // TODO(minux): we lack the support for extended opcodes here - case RLWNM, RLWNM_, RLDICL, RLDICL_, RLWINM, RLWINM_, RLDCL, RLDCL_: + case RLWNM, RLWNMCC, RLDICL, RLDICLCC, RLWINM, RLWINMCC, RLDCL, RLDCLCC: return true // TODO(minux): we lack the support for extended opcodes here case DCBTST, DCBT: return true // objdump uses the embedded argument order, we use the server argument order - case MTFSF, MTFSF_: // objdump doesn't show the last two arguments + case MTFSF, MTFSFCC: // objdump doesn't show the last two arguments return true case VSPLTB, VSPLTH, VSPLTW: // objdump generates unreasonable result "vspltw v6,v19,4" for 10c49a8c, the last 4 should be 0. return true diff --git a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/plan9.go b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/plan9.go index 57a761e36faa0..d039d9d500f78 100644 --- a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/plan9.go +++ b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/plan9.go @@ -19,7 +19,9 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin if symname == nil { symname = func(uint64) (string, uint64) { return "", 0 } } - if inst.Op == 0 { + if inst.Op == 0 && inst.Enc == 0 { + return "WORD $0" + } else if inst.Op == 0 { return "?" } var args []string @@ -28,13 +30,27 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin break } if s := plan9Arg(&inst, i, pc, a, symname); s != "" { - args = append(args, s) + // In the case for some BC instructions, a CondReg arg has + // both the CR and the branch condition encoded in its value. + // plan9Arg will return a string with the string representation + // of these values separated by a blank that will be treated + // as 2 args from this point on. + if strings.IndexByte(s, ' ') > 0 { + t := strings.Split(s, " ") + args = append(args, t[0]) + args = append(args, t[1]) + } else { + args = append(args, s) + } } } var op string op = plan9OpMap[inst.Op] if op == "" { op = strings.ToUpper(inst.Op.String()) + if op[len(op)-1] == '.' { + op = op[:len(op)-1] + "CC" + } } // laid out the instruction switch inst.Op { @@ -45,15 +61,60 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin return fmt.Sprintf("%s %s", op, args[0]) } args = append(args, args[0]) - return op + " " + strings.Join(args[1:], ", ") + return op + " " + strings.Join(args[1:], ",") + case SYNC: + if args[0] == "$1" { + return "LWSYNC" + } + return "HWSYNC" + + case ISEL: + return "ISEL " + args[3] + "," + args[1] + "," + args[2] + "," + args[0] + // store instructions always have the memory operand at the end, no need to reorder - case STB, STBU, STBX, STBUX, - STH, STHU, STHX, STHUX, - STW, STWU, STWX, STWUX, - STD, STDU, STDX, STDUX, - STQ, - STHBRX, STWBRX: - return op + " " + strings.Join(args, ", ") + // indexed stores handled separately + case STB, STBU, + STH, STHU, + STW, STWU, + STD, STDU, + STQ: + return op + " " + strings.Join(args, ",") + + case CMPD, CMPDI, CMPLD, CMPLDI, CMPW, CMPWI, CMPLW, CMPLWI: + if len(args) == 2 { + return op + " " + args[0] + "," + args[1] + } else if len(args) == 3 { + return op + " " + args[0] + "," + args[1] + "," + args[2] + } + return op + " " + args[0] + " ??" + + case LIS: + return "ADDIS $0," + args[1] + "," + args[0] + // store instructions with index registers + case STBX, STBUX, STHX, STHUX, STWX, STWUX, STDX, STDUX, + STHBRX, STWBRX, STDBRX, STSWX, STFSX, STFSUX, STFDX, STFDUX, STFIWX, STFDPX: + return "MOV" + op[2:len(op)-1] + " " + args[0] + ",(" + args[2] + ")(" + args[1] + ")" + + case STDCXCC, STWCXCC, STHCXCC, STBCXCC: + return op + " " + args[0] + ",(" + args[2] + ")(" + args[1] + ")" + + case STXVD2X, STXVW4X: + return op + " " + args[0] + ",(" + args[2] + ")(" + args[1] + ")" + + // load instructions with index registers + case LBZX, LBZUX, LHZX, LHZUX, LWZX, LWZUX, LDX, LDUX, + LHBRX, LWBRX, LDBRX, LSWX, LFSX, LFSUX, LFDX, LFDUX, LFIWAX, LFIWZX: + return "MOV" + op[1:len(op)-1] + " (" + args[2] + ")(" + args[1] + ")," + args[0] + + case LDARX, LWARX, LHARX, LBARX: + return op + " (" + args[2] + ")(" + args[1] + ")," + args[0] + + case LXVD2X, LXVW4X: + return op + " (" + args[2] + ")(" + args[1] + ")," + args[0] + + case DCBT, DCBTST, DCBZ, DCBST: + return op + " (" + args[1] + ")" + // branch instructions needs additional handling case BCLR: if int(inst.Args[0].(Imm))&20 == 20 { // unconditional @@ -62,11 +123,17 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin return op + " " + strings.Join(args, ", ") case BC: if int(inst.Args[0].(Imm))&0x1c == 12 { // jump on cond bit set + if len(args) == 4 { + return fmt.Sprintf("B%s %s,%s", args[1], args[2], args[3]) + } return fmt.Sprintf("B%s %s", args[1], args[2]) } else if int(inst.Args[0].(Imm))&0x1c == 4 && revCondMap[args[1]] != "" { // jump on cond bit not set + if len(args) == 4 { + return fmt.Sprintf("B%s %s,%s", revCondMap[args[1]], args[2], args[3]) + } return fmt.Sprintf("B%s %s", revCondMap[args[1]], args[2]) } - return op + " " + strings.Join(args, ", ") + return op + " " + strings.Join(args, ",") case BCCTR: if int(inst.Args[0].(Imm))&20 == 20 { // unconditional return "BR (CTR)" @@ -76,9 +143,9 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin if int(inst.Args[0].(Imm))&20 == 20 { // unconditional return "BL (CTR)" } - return op + " " + strings.Join(args, ", ") + return op + " " + strings.Join(args, ",") case BCA, BCL, BCLA, BCLRL, BCTAR, BCTARL: - return op + " " + strings.Join(args, ", ") + return op + " " + strings.Join(args, ",") } } @@ -102,6 +169,10 @@ func plan9Arg(inst *Inst, argIndex int, pc uint64, arg Arg, symname func(uint64) } return strings.ToUpper(arg.String()) case CondReg: + // This op is left as its numerical value, not mapped onto CR + condition + if inst.Op == ISEL { + return fmt.Sprintf("$%d", (arg - Cond0LT)) + } if arg == CR0 && strings.HasPrefix(inst.Op.String(), "cmp") { return "" // don't show cr0 for cmp instructions } else if arg >= CR0 { @@ -111,7 +182,7 @@ func plan9Arg(inst *Inst, argIndex int, pc uint64, arg Arg, symname func(uint64) if arg <= Cond0SO { return bit } - return fmt.Sprintf("4*CR%d+%s", int(arg-Cond0LT)/4, bit) + return fmt.Sprintf("%s CR%d", bit, int(arg-Cond0LT)/4) case Imm: return fmt.Sprintf("$%d", arg) case SpReg: @@ -148,25 +219,27 @@ var revCondMap = map[string]string{ // plan9OpMap maps an Op to its Plan 9 mnemonics, if different than its GNU mnemonics. var plan9OpMap = map[Op]string{ - LWARX: "LWAR", STWCX_: "STWCCC", - LDARX: "LDAR", STDCX_: "STDCCC", - LHARX: "LHAR", STHCX_: "STHCCC", - LBARX: "LBAR", STBCX_: "STBCCC", - ADDI: "ADD", - ADD_: "ADDCC", - LBZ: "MOVBZ", STB: "MOVB", - LBZU: "MOVBZU", STBU: "MOVBU", // TODO(minux): indexed forms are not handled + LWARX: "LWAR", + LDARX: "LDAR", + LHARX: "LHAR", + LBARX: "LBAR", + ADDI: "ADD", + SRADI: "SRAD", + SUBF: "SUB", + LI: "MOVD", + LBZ: "MOVBZ", STB: "MOVB", + LBZU: "MOVBZU", STBU: "MOVBU", LHZ: "MOVHZ", LHA: "MOVH", STH: "MOVH", LHZU: "MOVHZU", STHU: "MOVHU", - LI: "MOVD", - LIS: "ADDIS", LWZ: "MOVWZ", LWA: "MOVW", STW: "MOVW", LWZU: "MOVWZU", STWU: "MOVWU", LD: "MOVD", STD: "MOVD", LDU: "MOVDU", STDU: "MOVDU", + CMPD: "CMP", CMPDI: "CMP", + CMPW: "CMPW", CMPWI: "CMPW", + CMPLD: "CMPU", CMPLDI: "CMPU", + CMPLW: "CMPWU", CMPLWI: "CMPWU", MTSPR: "MOVD", MFSPR: "MOVD", // the width is ambiguous for SPRs - B: "BR", - BL: "CALL", - CMPLD: "CMPU", CMPLW: "CMPWU", - CMPD: "CMP", CMPW: "CMPW", + B: "BR", + BL: "CALL", } diff --git a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/tables.go b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/tables.go index 24c745c848569..f536926dbc11a 100644 --- a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/tables.go +++ b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/tables.go @@ -6,7 +6,7 @@ package ppc64asm const ( _ Op = iota CNTLZW - CNTLZW_ + CNTLZWCC B BA BL @@ -91,101 +91,101 @@ const ( LIS ADDIS ADD - ADD_ + ADDCC ADDO - ADDO_ + ADDOCC ADDIC SUBF - SUBF_ + SUBFCC SUBFO - SUBFO_ - ADDIC_ + SUBFOCC + ADDICCC SUBFIC ADDC - ADDC_ + ADDCCC ADDCO - ADDCO_ + ADDCOCC SUBFC - SUBFC_ + SUBFCCC SUBFCO - SUBFCO_ + SUBFCOCC ADDE - ADDE_ + ADDECC ADDEO - ADDEO_ + ADDEOCC ADDME - ADDME_ + ADDMECC ADDMEO - ADDMEO_ + ADDMEOCC SUBFE - SUBFE_ + SUBFECC SUBFEO - SUBFEO_ + SUBFEOCC SUBFME - SUBFME_ + SUBFMECC SUBFMEO - SUBFMEO_ + SUBFMEOCC ADDZE - ADDZE_ + ADDZECC ADDZEO - ADDZEO_ + ADDZEOCC SUBFZE - SUBFZE_ + SUBFZECC SUBFZEO - SUBFZEO_ + SUBFZEOCC NEG - NEG_ + NEGCC NEGO - NEGO_ + NEGOCC MULLI MULLW - MULLW_ + MULLWCC MULLWO - MULLWO_ + MULLWOCC MULHW - MULHW_ + MULHWCC MULHWU - MULHWU_ + MULHWUCC DIVW - DIVW_ + DIVWCC DIVWO - DIVWO_ + DIVWOCC DIVWU - DIVWU_ + DIVWUCC DIVWUO - DIVWUO_ + DIVWUOCC DIVWE - DIVWE_ + DIVWECC DIVWEO - DIVWEO_ + DIVWEOCC DIVWEU - DIVWEU_ + DIVWEUCC DIVWEUO - DIVWEUO_ + DIVWEUOCC MULLD - MULLD_ + MULLDCC MULLDO - MULLDO_ + MULLDOCC MULHDU - MULHDU_ + MULHDUCC MULHD - MULHD_ + MULHDCC DIVD - DIVD_ + DIVDCC DIVDO - DIVDO_ + DIVDOCC DIVDU - DIVDU_ + DIVDUCC DIVDUO - DIVDUO_ + DIVDUOCC DIVDE - DIVDE_ + DIVDECC DIVDEO - DIVDEO_ + DIVDEOCC DIVDEU - DIVDEU_ + DIVDEUCC DIVDEUO - DIVDEUO_ + DIVDEUOCC CMPWI CMPDI CMPW @@ -199,77 +199,77 @@ const ( TDI ISEL TD - ANDI_ - ANDIS_ + ANDICC + ANDISCC ORI ORIS XORI XORIS AND - AND_ + ANDCC XOR - XOR_ + XORCC NAND - NAND_ + NANDCC OR - OR_ + ORCC NOR - NOR_ + NORCC ANDC - ANDC_ + ANDCCC EXTSB - EXTSB_ + EXTSBCC EQV - EQV_ + EQVCC ORC - ORC_ + ORCCC EXTSH - EXTSH_ + EXTSHCC CMPB POPCNTB POPCNTW PRTYD PRTYW EXTSW - EXTSW_ + EXTSWCC CNTLZD - CNTLZD_ + CNTLZDCC POPCNTD BPERMD RLWINM - RLWINM_ + RLWINMCC RLWNM - RLWNM_ + RLWNMCC RLWIMI - RLWIMI_ + RLWIMICC RLDICL - RLDICL_ + RLDICLCC RLDICR - RLDICR_ + RLDICRCC RLDIC - RLDIC_ + RLDICCC RLDCL - RLDCL_ + RLDCLCC RLDCR - RLDCR_ + RLDCRCC RLDIMI - RLDIMI_ + RLDIMICC SLW - SLW_ + SLWCC SRW - SRW_ + SRWCC SRAWI - SRAWI_ + SRAWICC SRAW - SRAW_ + SRAWCC SLD - SLD_ + SLDCC SRD - SRD_ + SRDCC SRADI - SRADI_ + SRADICC SRAD - SRAD_ + SRADCC CDTBCD CBCDTD ADDG6S @@ -312,112 +312,112 @@ const ( STFDP STFDPX FMR - FMR_ + FMRCC FABS - FABS_ + FABSCC FNABS - FNABS_ + FNABSCC FNEG - FNEG_ + FNEGCC FCPSGN - FCPSGN_ + FCPSGNCC FMRGEW FMRGOW FADD - FADD_ + FADDCC FADDS - FADDS_ + FADDSCC FSUB - FSUB_ + FSUBCC FSUBS - FSUBS_ + FSUBSCC FMUL - FMUL_ + FMULCC FMULS - FMULS_ + FMULSCC FDIV - FDIV_ + FDIVCC FDIVS - FDIVS_ + FDIVSCC FSQRT - FSQRT_ + FSQRTCC FSQRTS - FSQRTS_ + FSQRTSCC FRE - FRE_ + FRECC FRES - FRES_ + FRESCC FRSQRTE - FRSQRTE_ + FRSQRTECC FRSQRTES - FRSQRTES_ + FRSQRTESCC FTDIV FTSQRT FMADD - FMADD_ + FMADDCC FMADDS - FMADDS_ + FMADDSCC FMSUB - FMSUB_ + FMSUBCC FMSUBS - FMSUBS_ + FMSUBSCC FNMADD - FNMADD_ + FNMADDCC FNMADDS - FNMADDS_ + FNMADDSCC FNMSUB - FNMSUB_ + FNMSUBCC FNMSUBS - FNMSUBS_ + FNMSUBSCC FRSP - FRSP_ + FRSPCC FCTID - FCTID_ + FCTIDCC FCTIDZ - FCTIDZ_ + FCTIDZCC FCTIDU - FCTIDU_ + FCTIDUCC FCTIDUZ - FCTIDUZ_ + FCTIDUZCC FCTIW - FCTIW_ + FCTIWCC FCTIWZ - FCTIWZ_ + FCTIWZCC FCTIWU - FCTIWU_ + FCTIWUCC FCTIWUZ - FCTIWUZ_ + FCTIWUZCC FCFID - FCFID_ + FCFIDCC FCFIDU - FCFIDU_ + FCFIDUCC FCFIDS - FCFIDS_ + FCFIDSCC FCFIDUS - FCFIDUS_ + FCFIDUSCC FRIN - FRIN_ + FRINCC FRIZ - FRIZ_ + FRIZCC FRIP - FRIP_ + FRIPCC FRIM - FRIM_ + FRIMCC FCMPU FCMPO FSEL - FSEL_ + FSELCC MFFS - MFFS_ + MFFSCC MCRFS MTFSFI - MTFSFI_ + MTFSFICC MTFSF - MTFSF_ + MTFSFCC MTFSB0 - MTFSB0_ + MTFSB0CC MTFSB1 - MTFSB1_ + MTFSB1CC LVEBX LVEHX LVEWX @@ -552,29 +552,29 @@ const ( VMINUH VMINUW VCMPEQUB - VCMPEQUB_ + VCMPEQUBCC VCMPEQUH - VCMPEQUH_ + VCMPEQUHCC VCMPEQUW - VCMPEQUW_ + VCMPEQUWCC VCMPEQUD - VCMPEQUD_ + VCMPEQUDCC VCMPGTSB - VCMPGTSB_ + VCMPGTSBCC VCMPGTSD - VCMPGTSD_ + VCMPGTSDCC VCMPGTSH - VCMPGTSH_ + VCMPGTSHCC VCMPGTSW - VCMPGTSW_ + VCMPGTSWCC VCMPGTUB - VCMPGTUB_ + VCMPGTUBCC VCMPGTUD - VCMPGTUD_ + VCMPGTUDCC VCMPGTUH - VCMPGTUH_ + VCMPGTUHCC VCMPGTUW - VCMPGTUW_ + VCMPGTUWCC VAND VANDC VEQV @@ -614,13 +614,13 @@ const ( VRFIP VRFIZ VCMPBFP - VCMPBFP_ + VCMPBFPCC VCMPEQFP - VCMPEQFP_ + VCMPEQFPCC VCMPGEFP - VCMPGEFP_ + VCMPGEFPCC VCMPGTFP - VCMPGTFP_ + VCMPGTFPCC VEXPTEFP VLOGEFP VREFP @@ -647,18 +647,18 @@ const ( VPOPCNTH VPOPCNTW VBPERMQ - BCDADD_ - BCDSUB_ + BCDADDCC + BCDSUBCC MTVSCR MFVSCR DADD - DADD_ + DADDCC DSUB - DSUB_ + DSUBCC DMUL - DMUL_ + DMULCC DDIV - DDIV_ + DDIVCC DCMPU DCMPO DTSTDC @@ -666,41 +666,41 @@ const ( DTSTEX DTSTSF DQUAI - DQUAI_ + DQUAICC DQUA - DQUA_ + DQUACC DRRND - DRRND_ + DRRNDCC DRINTX - DRINTX_ + DRINTXCC DRINTN - DRINTN_ + DRINTNCC DCTDP - DCTDP_ + DCTDPCC DCTQPQ - DCTQPQ_ + DCTQPQCC DRSP - DRSP_ + DRSPCC DRDPQ - DRDPQ_ + DRDPQCC DCFFIX - DCFFIX_ + DCFFIXCC DCFFIXQ - DCFFIXQ_ + DCFFIXQCC DCTFIX - DCTFIX_ + DCTFIXCC DDEDPD - DDEDPD_ + DDEDPDCC DENBCD - DENBCD_ + DENBCDCC DXEX - DXEX_ + DXEXCC DIEX - DIEX_ + DIEXCC DSCLI - DSCLI_ + DSCLICC DSCRI - DSCRI_ + DSCRICC LXSDX LXSIWAX LXSIWZX @@ -768,17 +768,17 @@ const ( XVADDDP XVADDSP XVCMPEQDP - XVCMPEQDP_ + XVCMPEQDPCC XVCMPEQSP - XVCMPEQSP_ + XVCMPEQSPCC XVCMPGEDP - XVCMPGEDP_ + XVCMPGEDPCC XVCMPGESP - XVCMPGESP_ + XVCMPGESPCC XVCMPGTDP - XVCMPGTDP_ + XVCMPGTDPCC XVCMPGTSP - XVCMPGTSP_ + XVCMPGTSPCC XVCPSGNDP XVCPSGNSP XVCVDPSP @@ -1104,91 +1104,91 @@ const ( EFDCFS EFSCFD DLMZB - DLMZB_ + DLMZBCC MACCHW - MACCHW_ + MACCHWCC MACCHWO - MACCHWO_ + MACCHWOCC MACCHWS - MACCHWS_ + MACCHWSCC MACCHWSO - MACCHWSO_ + MACCHWSOCC MACCHWU - MACCHWU_ + MACCHWUCC MACCHWUO - MACCHWUO_ + MACCHWUOCC MACCHWSU - MACCHWSU_ + MACCHWSUCC MACCHWSUO - MACCHWSUO_ + MACCHWSUOCC MACHHW - MACHHW_ + MACHHWCC MACHHWO - MACHHWO_ + MACHHWOCC MACHHWS - MACHHWS_ + MACHHWSCC MACHHWSO - MACHHWSO_ + MACHHWSOCC MACHHWU - MACHHWU_ + MACHHWUCC MACHHWUO - MACHHWUO_ + MACHHWUOCC MACHHWSU - MACHHWSU_ + MACHHWSUCC MACHHWSUO - MACHHWSUO_ + MACHHWSUOCC MACLHW - MACLHW_ + MACLHWCC MACLHWO - MACLHWO_ + MACLHWOCC MACLHWS - MACLHWS_ + MACLHWSCC MACLHWSO - MACLHWSO_ + MACLHWSOCC MACLHWU - MACLHWU_ + MACLHWUCC MACLHWUO - MACLHWUO_ + MACLHWUOCC MULCHW - MULCHW_ + MULCHWCC MACLHWSU - MACLHWSU_ + MACLHWSUCC MACLHWSUO - MACLHWSUO_ + MACLHWSUOCC MULCHWU - MULCHWU_ + MULCHWUCC MULHHW - MULHHW_ + MULHHWCC MULLHW - MULLHW_ + MULLHWCC MULHHWU - MULHHWU_ + MULHHWUCC MULLHWU - MULLHWU_ + MULLHWUCC NMACCHW - NMACCHW_ + NMACCHWCC NMACCHWO - NMACCHWO_ + NMACCHWOCC NMACCHWS - NMACCHWS_ + NMACCHWSCC NMACCHWSO - NMACCHWSO_ + NMACCHWSOCC NMACHHW - NMACHHW_ + NMACHHWCC NMACHHWO - NMACHHWO_ + NMACHHWOCC NMACHHWS - NMACHHWS_ + NMACHHWSCC NMACHHWSO - NMACHHWSO_ + NMACHHWSOCC NMACLHW - NMACLHW_ + NMACLHWCC NMACLHWO - NMACLHWO_ + NMACLHWOCC NMACLHWS - NMACLHWS_ + NMACLHWSCC NMACLHWSO - NMACLHWSO_ + NMACLHWSOCC ICBI ICBT DCBA @@ -1201,25 +1201,25 @@ const ( LBARX LHARX LWARX - STBCX_ - STHCX_ - STWCX_ + STBCXCC + STHCXCC + STWCXCC LDARX - STDCX_ + STDCXCC LQARX - STQCX_ + STQCXCC SYNC EIEIO MBAR WAIT - TBEGIN_ - TEND_ - TABORT_ - TABORTWC_ - TABORTWCI_ - TABORTDC_ - TABORTDCI_ - TSR_ + TBEGINCC + TENDCC + TABORTCC + TABORTWCCC + TABORTWCICC + TABORTDCCC + TABORTDCICC + TSRCC TCHECK MFTB RFEBB @@ -1250,8 +1250,8 @@ const ( STWCIX STHCIX STDCIX - TRECLAIM_ - TRECHKPT_ + TRECLAIMCC + TRECHKPTCC MTMSR MTMSRD MFMSR @@ -1260,7 +1260,7 @@ const ( SLBMTE SLBMFEV SLBMFEE - SLBFEE_ + SLBFEECC MTSR MTSRIN MFSR @@ -1309,8 +1309,8 @@ const ( STVEPX STVEPXL DCBI - DCBLQ_ - ICBLQ_ + DCBLQCC + ICBLQCC DCBTLS DCBTSTLS ICBTLS @@ -1319,7 +1319,7 @@ const ( TLBIVAX TLBILX TLBSX - TLBSRX_ + TLBSRXCC TLBRE TLBWE DNH @@ -1329,11 +1329,26 @@ const ( ICREAD MFPMR MTPMR + ADDEX + DARN + MADDHD + MADDHDU + MADDLD + CMPRB + CMPEQB + EXTSWSLI + EXTSWSLICC + MFVSRLD + MTVSRDD + MTVSRWS + MCRXRX + COPY + PASTECC ) var opstr = [...]string{ CNTLZW: "cntlzw", - CNTLZW_: "cntlzw.", + CNTLZWCC: "cntlzw.", B: "b", BA: "ba", BL: "bl", @@ -1418,101 +1433,101 @@ var opstr = [...]string{ LIS: "lis", ADDIS: "addis", ADD: "add", - ADD_: "add.", + ADDCC: "add.", ADDO: "addo", - ADDO_: "addo.", + ADDOCC: "addo.", ADDIC: "addic", SUBF: "subf", - SUBF_: "subf.", + SUBFCC: "subf.", SUBFO: "subfo", - SUBFO_: "subfo.", - ADDIC_: "addic.", + SUBFOCC: "subfo.", + ADDICCC: "addic.", SUBFIC: "subfic", ADDC: "addc", - ADDC_: "addc.", + ADDCCC: "addc.", ADDCO: "addco", - ADDCO_: "addco.", + ADDCOCC: "addco.", SUBFC: "subfc", - SUBFC_: "subfc.", + SUBFCCC: "subfc.", SUBFCO: "subfco", - SUBFCO_: "subfco.", + SUBFCOCC: "subfco.", ADDE: "adde", - ADDE_: "adde.", + ADDECC: "adde.", ADDEO: "addeo", - ADDEO_: "addeo.", + ADDEOCC: "addeo.", ADDME: "addme", - ADDME_: "addme.", + ADDMECC: "addme.", ADDMEO: "addmeo", - ADDMEO_: "addmeo.", + ADDMEOCC: "addmeo.", SUBFE: "subfe", - SUBFE_: "subfe.", + SUBFECC: "subfe.", SUBFEO: "subfeo", - SUBFEO_: "subfeo.", + SUBFEOCC: "subfeo.", SUBFME: "subfme", - SUBFME_: "subfme.", + SUBFMECC: "subfme.", SUBFMEO: "subfmeo", - SUBFMEO_: "subfmeo.", + SUBFMEOCC: "subfmeo.", ADDZE: "addze", - ADDZE_: "addze.", + ADDZECC: "addze.", ADDZEO: "addzeo", - ADDZEO_: "addzeo.", + ADDZEOCC: "addzeo.", SUBFZE: "subfze", - SUBFZE_: "subfze.", + SUBFZECC: "subfze.", SUBFZEO: "subfzeo", - SUBFZEO_: "subfzeo.", + SUBFZEOCC: "subfzeo.", NEG: "neg", - NEG_: "neg.", + NEGCC: "neg.", NEGO: "nego", - NEGO_: "nego.", + NEGOCC: "nego.", MULLI: "mulli", MULLW: "mullw", - MULLW_: "mullw.", + MULLWCC: "mullw.", MULLWO: "mullwo", - MULLWO_: "mullwo.", + MULLWOCC: "mullwo.", MULHW: "mulhw", - MULHW_: "mulhw.", + MULHWCC: "mulhw.", MULHWU: "mulhwu", - MULHWU_: "mulhwu.", + MULHWUCC: "mulhwu.", DIVW: "divw", - DIVW_: "divw.", + DIVWCC: "divw.", DIVWO: "divwo", - DIVWO_: "divwo.", + DIVWOCC: "divwo.", DIVWU: "divwu", - DIVWU_: "divwu.", + DIVWUCC: "divwu.", DIVWUO: "divwuo", - DIVWUO_: "divwuo.", + DIVWUOCC: "divwuo.", DIVWE: "divwe", - DIVWE_: "divwe.", + DIVWECC: "divwe.", DIVWEO: "divweo", - DIVWEO_: "divweo.", + DIVWEOCC: "divweo.", DIVWEU: "divweu", - DIVWEU_: "divweu.", + DIVWEUCC: "divweu.", DIVWEUO: "divweuo", - DIVWEUO_: "divweuo.", + DIVWEUOCC: "divweuo.", MULLD: "mulld", - MULLD_: "mulld.", + MULLDCC: "mulld.", MULLDO: "mulldo", - MULLDO_: "mulldo.", + MULLDOCC: "mulldo.", MULHDU: "mulhdu", - MULHDU_: "mulhdu.", + MULHDUCC: "mulhdu.", MULHD: "mulhd", - MULHD_: "mulhd.", + MULHDCC: "mulhd.", DIVD: "divd", - DIVD_: "divd.", + DIVDCC: "divd.", DIVDO: "divdo", - DIVDO_: "divdo.", + DIVDOCC: "divdo.", DIVDU: "divdu", - DIVDU_: "divdu.", + DIVDUCC: "divdu.", DIVDUO: "divduo", - DIVDUO_: "divduo.", + DIVDUOCC: "divduo.", DIVDE: "divde", - DIVDE_: "divde.", + DIVDECC: "divde.", DIVDEO: "divdeo", - DIVDEO_: "divdeo.", + DIVDEOCC: "divdeo.", DIVDEU: "divdeu", - DIVDEU_: "divdeu.", + DIVDEUCC: "divdeu.", DIVDEUO: "divdeuo", - DIVDEUO_: "divdeuo.", + DIVDEUOCC: "divdeuo.", CMPWI: "cmpwi", CMPDI: "cmpdi", CMPW: "cmpw", @@ -1526,77 +1541,77 @@ var opstr = [...]string{ TDI: "tdi", ISEL: "isel", TD: "td", - ANDI_: "andi.", - ANDIS_: "andis.", + ANDICC: "andi.", + ANDISCC: "andis.", ORI: "ori", ORIS: "oris", XORI: "xori", XORIS: "xoris", AND: "and", - AND_: "and.", + ANDCC: "and.", XOR: "xor", - XOR_: "xor.", + XORCC: "xor.", NAND: "nand", - NAND_: "nand.", + NANDCC: "nand.", OR: "or", - OR_: "or.", + ORCC: "or.", NOR: "nor", - NOR_: "nor.", + NORCC: "nor.", ANDC: "andc", - ANDC_: "andc.", + ANDCCC: "andc.", EXTSB: "extsb", - EXTSB_: "extsb.", + EXTSBCC: "extsb.", EQV: "eqv", - EQV_: "eqv.", + EQVCC: "eqv.", ORC: "orc", - ORC_: "orc.", + ORCCC: "orc.", EXTSH: "extsh", - EXTSH_: "extsh.", + EXTSHCC: "extsh.", CMPB: "cmpb", POPCNTB: "popcntb", POPCNTW: "popcntw", PRTYD: "prtyd", PRTYW: "prtyw", EXTSW: "extsw", - EXTSW_: "extsw.", + EXTSWCC: "extsw.", CNTLZD: "cntlzd", - CNTLZD_: "cntlzd.", + CNTLZDCC: "cntlzd.", POPCNTD: "popcntd", BPERMD: "bpermd", RLWINM: "rlwinm", - RLWINM_: "rlwinm.", + RLWINMCC: "rlwinm.", RLWNM: "rlwnm", - RLWNM_: "rlwnm.", + RLWNMCC: "rlwnm.", RLWIMI: "rlwimi", - RLWIMI_: "rlwimi.", + RLWIMICC: "rlwimi.", RLDICL: "rldicl", - RLDICL_: "rldicl.", + RLDICLCC: "rldicl.", RLDICR: "rldicr", - RLDICR_: "rldicr.", + RLDICRCC: "rldicr.", RLDIC: "rldic", - RLDIC_: "rldic.", + RLDICCC: "rldic.", RLDCL: "rldcl", - RLDCL_: "rldcl.", + RLDCLCC: "rldcl.", RLDCR: "rldcr", - RLDCR_: "rldcr.", + RLDCRCC: "rldcr.", RLDIMI: "rldimi", - RLDIMI_: "rldimi.", + RLDIMICC: "rldimi.", SLW: "slw", - SLW_: "slw.", + SLWCC: "slw.", SRW: "srw", - SRW_: "srw.", + SRWCC: "srw.", SRAWI: "srawi", - SRAWI_: "srawi.", + SRAWICC: "srawi.", SRAW: "sraw", - SRAW_: "sraw.", + SRAWCC: "sraw.", SLD: "sld", - SLD_: "sld.", + SLDCC: "sld.", SRD: "srd", - SRD_: "srd.", + SRDCC: "srd.", SRADI: "sradi", - SRADI_: "sradi.", + SRADICC: "sradi.", SRAD: "srad", - SRAD_: "srad.", + SRADCC: "srad.", CDTBCD: "cdtbcd", CBCDTD: "cbcdtd", ADDG6S: "addg6s", @@ -1639,112 +1654,112 @@ var opstr = [...]string{ STFDP: "stfdp", STFDPX: "stfdpx", FMR: "fmr", - FMR_: "fmr.", + FMRCC: "fmr.", FABS: "fabs", - FABS_: "fabs.", + FABSCC: "fabs.", FNABS: "fnabs", - FNABS_: "fnabs.", + FNABSCC: "fnabs.", FNEG: "fneg", - FNEG_: "fneg.", + FNEGCC: "fneg.", FCPSGN: "fcpsgn", - FCPSGN_: "fcpsgn.", + FCPSGNCC: "fcpsgn.", FMRGEW: "fmrgew", FMRGOW: "fmrgow", FADD: "fadd", - FADD_: "fadd.", + FADDCC: "fadd.", FADDS: "fadds", - FADDS_: "fadds.", + FADDSCC: "fadds.", FSUB: "fsub", - FSUB_: "fsub.", + FSUBCC: "fsub.", FSUBS: "fsubs", - FSUBS_: "fsubs.", + FSUBSCC: "fsubs.", FMUL: "fmul", - FMUL_: "fmul.", + FMULCC: "fmul.", FMULS: "fmuls", - FMULS_: "fmuls.", + FMULSCC: "fmuls.", FDIV: "fdiv", - FDIV_: "fdiv.", + FDIVCC: "fdiv.", FDIVS: "fdivs", - FDIVS_: "fdivs.", + FDIVSCC: "fdivs.", FSQRT: "fsqrt", - FSQRT_: "fsqrt.", + FSQRTCC: "fsqrt.", FSQRTS: "fsqrts", - FSQRTS_: "fsqrts.", + FSQRTSCC: "fsqrts.", FRE: "fre", - FRE_: "fre.", + FRECC: "fre.", FRES: "fres", - FRES_: "fres.", + FRESCC: "fres.", FRSQRTE: "frsqrte", - FRSQRTE_: "frsqrte.", + FRSQRTECC: "frsqrte.", FRSQRTES: "frsqrtes", - FRSQRTES_: "frsqrtes.", + FRSQRTESCC: "frsqrtes.", FTDIV: "ftdiv", FTSQRT: "ftsqrt", FMADD: "fmadd", - FMADD_: "fmadd.", + FMADDCC: "fmadd.", FMADDS: "fmadds", - FMADDS_: "fmadds.", + FMADDSCC: "fmadds.", FMSUB: "fmsub", - FMSUB_: "fmsub.", + FMSUBCC: "fmsub.", FMSUBS: "fmsubs", - FMSUBS_: "fmsubs.", + FMSUBSCC: "fmsubs.", FNMADD: "fnmadd", - FNMADD_: "fnmadd.", + FNMADDCC: "fnmadd.", FNMADDS: "fnmadds", - FNMADDS_: "fnmadds.", + FNMADDSCC: "fnmadds.", FNMSUB: "fnmsub", - FNMSUB_: "fnmsub.", + FNMSUBCC: "fnmsub.", FNMSUBS: "fnmsubs", - FNMSUBS_: "fnmsubs.", + FNMSUBSCC: "fnmsubs.", FRSP: "frsp", - FRSP_: "frsp.", + FRSPCC: "frsp.", FCTID: "fctid", - FCTID_: "fctid.", + FCTIDCC: "fctid.", FCTIDZ: "fctidz", - FCTIDZ_: "fctidz.", + FCTIDZCC: "fctidz.", FCTIDU: "fctidu", - FCTIDU_: "fctidu.", + FCTIDUCC: "fctidu.", FCTIDUZ: "fctiduz", - FCTIDUZ_: "fctiduz.", + FCTIDUZCC: "fctiduz.", FCTIW: "fctiw", - FCTIW_: "fctiw.", + FCTIWCC: "fctiw.", FCTIWZ: "fctiwz", - FCTIWZ_: "fctiwz.", + FCTIWZCC: "fctiwz.", FCTIWU: "fctiwu", - FCTIWU_: "fctiwu.", + FCTIWUCC: "fctiwu.", FCTIWUZ: "fctiwuz", - FCTIWUZ_: "fctiwuz.", + FCTIWUZCC: "fctiwuz.", FCFID: "fcfid", - FCFID_: "fcfid.", + FCFIDCC: "fcfid.", FCFIDU: "fcfidu", - FCFIDU_: "fcfidu.", + FCFIDUCC: "fcfidu.", FCFIDS: "fcfids", - FCFIDS_: "fcfids.", + FCFIDSCC: "fcfids.", FCFIDUS: "fcfidus", - FCFIDUS_: "fcfidus.", + FCFIDUSCC: "fcfidus.", FRIN: "frin", - FRIN_: "frin.", + FRINCC: "frin.", FRIZ: "friz", - FRIZ_: "friz.", + FRIZCC: "friz.", FRIP: "frip", - FRIP_: "frip.", + FRIPCC: "frip.", FRIM: "frim", - FRIM_: "frim.", + FRIMCC: "frim.", FCMPU: "fcmpu", FCMPO: "fcmpo", FSEL: "fsel", - FSEL_: "fsel.", + FSELCC: "fsel.", MFFS: "mffs", - MFFS_: "mffs.", + MFFSCC: "mffs.", MCRFS: "mcrfs", MTFSFI: "mtfsfi", - MTFSFI_: "mtfsfi.", + MTFSFICC: "mtfsfi.", MTFSF: "mtfsf", - MTFSF_: "mtfsf.", + MTFSFCC: "mtfsf.", MTFSB0: "mtfsb0", - MTFSB0_: "mtfsb0.", + MTFSB0CC: "mtfsb0.", MTFSB1: "mtfsb1", - MTFSB1_: "mtfsb1.", + MTFSB1CC: "mtfsb1.", LVEBX: "lvebx", LVEHX: "lvehx", LVEWX: "lvewx", @@ -1879,29 +1894,29 @@ var opstr = [...]string{ VMINUH: "vminuh", VMINUW: "vminuw", VCMPEQUB: "vcmpequb", - VCMPEQUB_: "vcmpequb.", + VCMPEQUBCC: "vcmpequb.", VCMPEQUH: "vcmpequh", - VCMPEQUH_: "vcmpequh.", + VCMPEQUHCC: "vcmpequh.", VCMPEQUW: "vcmpequw", - VCMPEQUW_: "vcmpequw.", + VCMPEQUWCC: "vcmpequw.", VCMPEQUD: "vcmpequd", - VCMPEQUD_: "vcmpequd.", + VCMPEQUDCC: "vcmpequd.", VCMPGTSB: "vcmpgtsb", - VCMPGTSB_: "vcmpgtsb.", + VCMPGTSBCC: "vcmpgtsb.", VCMPGTSD: "vcmpgtsd", - VCMPGTSD_: "vcmpgtsd.", + VCMPGTSDCC: "vcmpgtsd.", VCMPGTSH: "vcmpgtsh", - VCMPGTSH_: "vcmpgtsh.", + VCMPGTSHCC: "vcmpgtsh.", VCMPGTSW: "vcmpgtsw", - VCMPGTSW_: "vcmpgtsw.", + VCMPGTSWCC: "vcmpgtsw.", VCMPGTUB: "vcmpgtub", - VCMPGTUB_: "vcmpgtub.", + VCMPGTUBCC: "vcmpgtub.", VCMPGTUD: "vcmpgtud", - VCMPGTUD_: "vcmpgtud.", + VCMPGTUDCC: "vcmpgtud.", VCMPGTUH: "vcmpgtuh", - VCMPGTUH_: "vcmpgtuh.", + VCMPGTUHCC: "vcmpgtuh.", VCMPGTUW: "vcmpgtuw", - VCMPGTUW_: "vcmpgtuw.", + VCMPGTUWCC: "vcmpgtuw.", VAND: "vand", VANDC: "vandc", VEQV: "veqv", @@ -1941,13 +1956,13 @@ var opstr = [...]string{ VRFIP: "vrfip", VRFIZ: "vrfiz", VCMPBFP: "vcmpbfp", - VCMPBFP_: "vcmpbfp.", + VCMPBFPCC: "vcmpbfp.", VCMPEQFP: "vcmpeqfp", - VCMPEQFP_: "vcmpeqfp.", + VCMPEQFPCC: "vcmpeqfp.", VCMPGEFP: "vcmpgefp", - VCMPGEFP_: "vcmpgefp.", + VCMPGEFPCC: "vcmpgefp.", VCMPGTFP: "vcmpgtfp", - VCMPGTFP_: "vcmpgtfp.", + VCMPGTFPCC: "vcmpgtfp.", VEXPTEFP: "vexptefp", VLOGEFP: "vlogefp", VREFP: "vrefp", @@ -1974,18 +1989,18 @@ var opstr = [...]string{ VPOPCNTH: "vpopcnth", VPOPCNTW: "vpopcntw", VBPERMQ: "vbpermq", - BCDADD_: "bcdadd.", - BCDSUB_: "bcdsub.", + BCDADDCC: "bcdadd.", + BCDSUBCC: "bcdsub.", MTVSCR: "mtvscr", MFVSCR: "mfvscr", DADD: "dadd", - DADD_: "dadd.", + DADDCC: "dadd.", DSUB: "dsub", - DSUB_: "dsub.", + DSUBCC: "dsub.", DMUL: "dmul", - DMUL_: "dmul.", + DMULCC: "dmul.", DDIV: "ddiv", - DDIV_: "ddiv.", + DDIVCC: "ddiv.", DCMPU: "dcmpu", DCMPO: "dcmpo", DTSTDC: "dtstdc", @@ -1993,41 +2008,41 @@ var opstr = [...]string{ DTSTEX: "dtstex", DTSTSF: "dtstsf", DQUAI: "dquai", - DQUAI_: "dquai.", + DQUAICC: "dquai.", DQUA: "dqua", - DQUA_: "dqua.", + DQUACC: "dqua.", DRRND: "drrnd", - DRRND_: "drrnd.", + DRRNDCC: "drrnd.", DRINTX: "drintx", - DRINTX_: "drintx.", + DRINTXCC: "drintx.", DRINTN: "drintn", - DRINTN_: "drintn.", + DRINTNCC: "drintn.", DCTDP: "dctdp", - DCTDP_: "dctdp.", + DCTDPCC: "dctdp.", DCTQPQ: "dctqpq", - DCTQPQ_: "dctqpq.", + DCTQPQCC: "dctqpq.", DRSP: "drsp", - DRSP_: "drsp.", + DRSPCC: "drsp.", DRDPQ: "drdpq", - DRDPQ_: "drdpq.", + DRDPQCC: "drdpq.", DCFFIX: "dcffix", - DCFFIX_: "dcffix.", + DCFFIXCC: "dcffix.", DCFFIXQ: "dcffixq", - DCFFIXQ_: "dcffixq.", + DCFFIXQCC: "dcffixq.", DCTFIX: "dctfix", - DCTFIX_: "dctfix.", + DCTFIXCC: "dctfix.", DDEDPD: "ddedpd", - DDEDPD_: "ddedpd.", + DDEDPDCC: "ddedpd.", DENBCD: "denbcd", - DENBCD_: "denbcd.", + DENBCDCC: "denbcd.", DXEX: "dxex", - DXEX_: "dxex.", + DXEXCC: "dxex.", DIEX: "diex", - DIEX_: "diex.", + DIEXCC: "diex.", DSCLI: "dscli", - DSCLI_: "dscli.", + DSCLICC: "dscli.", DSCRI: "dscri", - DSCRI_: "dscri.", + DSCRICC: "dscri.", LXSDX: "lxsdx", LXSIWAX: "lxsiwax", LXSIWZX: "lxsiwzx", @@ -2095,17 +2110,17 @@ var opstr = [...]string{ XVADDDP: "xvadddp", XVADDSP: "xvaddsp", XVCMPEQDP: "xvcmpeqdp", - XVCMPEQDP_: "xvcmpeqdp.", + XVCMPEQDPCC: "xvcmpeqdp.", XVCMPEQSP: "xvcmpeqsp", - XVCMPEQSP_: "xvcmpeqsp.", + XVCMPEQSPCC: "xvcmpeqsp.", XVCMPGEDP: "xvcmpgedp", - XVCMPGEDP_: "xvcmpgedp.", + XVCMPGEDPCC: "xvcmpgedp.", XVCMPGESP: "xvcmpgesp", - XVCMPGESP_: "xvcmpgesp.", + XVCMPGESPCC: "xvcmpgesp.", XVCMPGTDP: "xvcmpgtdp", - XVCMPGTDP_: "xvcmpgtdp.", + XVCMPGTDPCC: "xvcmpgtdp.", XVCMPGTSP: "xvcmpgtsp", - XVCMPGTSP_: "xvcmpgtsp.", + XVCMPGTSPCC: "xvcmpgtsp.", XVCPSGNDP: "xvcpsgndp", XVCPSGNSP: "xvcpsgnsp", XVCVDPSP: "xvcvdpsp", @@ -2431,91 +2446,91 @@ var opstr = [...]string{ EFDCFS: "efdcfs", EFSCFD: "efscfd", DLMZB: "dlmzb", - DLMZB_: "dlmzb.", + DLMZBCC: "dlmzb.", MACCHW: "macchw", - MACCHW_: "macchw.", + MACCHWCC: "macchw.", MACCHWO: "macchwo", - MACCHWO_: "macchwo.", + MACCHWOCC: "macchwo.", MACCHWS: "macchws", - MACCHWS_: "macchws.", + MACCHWSCC: "macchws.", MACCHWSO: "macchwso", - MACCHWSO_: "macchwso.", + MACCHWSOCC: "macchwso.", MACCHWU: "macchwu", - MACCHWU_: "macchwu.", + MACCHWUCC: "macchwu.", MACCHWUO: "macchwuo", - MACCHWUO_: "macchwuo.", + MACCHWUOCC: "macchwuo.", MACCHWSU: "macchwsu", - MACCHWSU_: "macchwsu.", + MACCHWSUCC: "macchwsu.", MACCHWSUO: "macchwsuo", - MACCHWSUO_: "macchwsuo.", + MACCHWSUOCC: "macchwsuo.", MACHHW: "machhw", - MACHHW_: "machhw.", + MACHHWCC: "machhw.", MACHHWO: "machhwo", - MACHHWO_: "machhwo.", + MACHHWOCC: "machhwo.", MACHHWS: "machhws", - MACHHWS_: "machhws.", + MACHHWSCC: "machhws.", MACHHWSO: "machhwso", - MACHHWSO_: "machhwso.", + MACHHWSOCC: "machhwso.", MACHHWU: "machhwu", - MACHHWU_: "machhwu.", + MACHHWUCC: "machhwu.", MACHHWUO: "machhwuo", - MACHHWUO_: "machhwuo.", + MACHHWUOCC: "machhwuo.", MACHHWSU: "machhwsu", - MACHHWSU_: "machhwsu.", + MACHHWSUCC: "machhwsu.", MACHHWSUO: "machhwsuo", - MACHHWSUO_: "machhwsuo.", + MACHHWSUOCC: "machhwsuo.", MACLHW: "maclhw", - MACLHW_: "maclhw.", + MACLHWCC: "maclhw.", MACLHWO: "maclhwo", - MACLHWO_: "maclhwo.", + MACLHWOCC: "maclhwo.", MACLHWS: "maclhws", - MACLHWS_: "maclhws.", + MACLHWSCC: "maclhws.", MACLHWSO: "maclhwso", - MACLHWSO_: "maclhwso.", + MACLHWSOCC: "maclhwso.", MACLHWU: "maclhwu", - MACLHWU_: "maclhwu.", + MACLHWUCC: "maclhwu.", MACLHWUO: "maclhwuo", - MACLHWUO_: "maclhwuo.", + MACLHWUOCC: "maclhwuo.", MULCHW: "mulchw", - MULCHW_: "mulchw.", + MULCHWCC: "mulchw.", MACLHWSU: "maclhwsu", - MACLHWSU_: "maclhwsu.", + MACLHWSUCC: "maclhwsu.", MACLHWSUO: "maclhwsuo", - MACLHWSUO_: "maclhwsuo.", + MACLHWSUOCC: "maclhwsuo.", MULCHWU: "mulchwu", - MULCHWU_: "mulchwu.", + MULCHWUCC: "mulchwu.", MULHHW: "mulhhw", - MULHHW_: "mulhhw.", + MULHHWCC: "mulhhw.", MULLHW: "mullhw", - MULLHW_: "mullhw.", + MULLHWCC: "mullhw.", MULHHWU: "mulhhwu", - MULHHWU_: "mulhhwu.", + MULHHWUCC: "mulhhwu.", MULLHWU: "mullhwu", - MULLHWU_: "mullhwu.", + MULLHWUCC: "mullhwu.", NMACCHW: "nmacchw", - NMACCHW_: "nmacchw.", + NMACCHWCC: "nmacchw.", NMACCHWO: "nmacchwo", - NMACCHWO_: "nmacchwo.", + NMACCHWOCC: "nmacchwo.", NMACCHWS: "nmacchws", - NMACCHWS_: "nmacchws.", + NMACCHWSCC: "nmacchws.", NMACCHWSO: "nmacchwso", - NMACCHWSO_: "nmacchwso.", + NMACCHWSOCC: "nmacchwso.", NMACHHW: "nmachhw", - NMACHHW_: "nmachhw.", + NMACHHWCC: "nmachhw.", NMACHHWO: "nmachhwo", - NMACHHWO_: "nmachhwo.", + NMACHHWOCC: "nmachhwo.", NMACHHWS: "nmachhws", - NMACHHWS_: "nmachhws.", + NMACHHWSCC: "nmachhws.", NMACHHWSO: "nmachhwso", - NMACHHWSO_: "nmachhwso.", + NMACHHWSOCC: "nmachhwso.", NMACLHW: "nmaclhw", - NMACLHW_: "nmaclhw.", + NMACLHWCC: "nmaclhw.", NMACLHWO: "nmaclhwo", - NMACLHWO_: "nmaclhwo.", + NMACLHWOCC: "nmaclhwo.", NMACLHWS: "nmaclhws", - NMACLHWS_: "nmaclhws.", + NMACLHWSCC: "nmaclhws.", NMACLHWSO: "nmaclhwso", - NMACLHWSO_: "nmaclhwso.", + NMACLHWSOCC: "nmaclhwso.", ICBI: "icbi", ICBT: "icbt", DCBA: "dcba", @@ -2528,25 +2543,25 @@ var opstr = [...]string{ LBARX: "lbarx", LHARX: "lharx", LWARX: "lwarx", - STBCX_: "stbcx.", - STHCX_: "sthcx.", - STWCX_: "stwcx.", + STBCXCC: "stbcx.", + STHCXCC: "sthcx.", + STWCXCC: "stwcx.", LDARX: "ldarx", - STDCX_: "stdcx.", + STDCXCC: "stdcx.", LQARX: "lqarx", - STQCX_: "stqcx.", + STQCXCC: "stqcx.", SYNC: "sync", EIEIO: "eieio", MBAR: "mbar", WAIT: "wait", - TBEGIN_: "tbegin.", - TEND_: "tend.", - TABORT_: "tabort.", - TABORTWC_: "tabortwc.", - TABORTWCI_: "tabortwci.", - TABORTDC_: "tabortdc.", - TABORTDCI_: "tabortdci.", - TSR_: "tsr.", + TBEGINCC: "tbegin.", + TENDCC: "tend.", + TABORTCC: "tabort.", + TABORTWCCC: "tabortwc.", + TABORTWCICC: "tabortwci.", + TABORTDCCC: "tabortdc.", + TABORTDCICC: "tabortdci.", + TSRCC: "tsr.", TCHECK: "tcheck", MFTB: "mftb", RFEBB: "rfebb", @@ -2577,8 +2592,8 @@ var opstr = [...]string{ STWCIX: "stwcix", STHCIX: "sthcix", STDCIX: "stdcix", - TRECLAIM_: "treclaim.", - TRECHKPT_: "trechkpt.", + TRECLAIMCC: "treclaim.", + TRECHKPTCC: "trechkpt.", MTMSR: "mtmsr", MTMSRD: "mtmsrd", MFMSR: "mfmsr", @@ -2587,7 +2602,7 @@ var opstr = [...]string{ SLBMTE: "slbmte", SLBMFEV: "slbmfev", SLBMFEE: "slbmfee", - SLBFEE_: "slbfee.", + SLBFEECC: "slbfee.", MTSR: "mtsr", MTSRIN: "mtsrin", MFSR: "mfsr", @@ -2636,8 +2651,8 @@ var opstr = [...]string{ STVEPX: "stvepx", STVEPXL: "stvepxl", DCBI: "dcbi", - DCBLQ_: "dcblq.", - ICBLQ_: "icblq.", + DCBLQCC: "dcblq.", + ICBLQCC: "icblq.", DCBTLS: "dcbtls", DCBTSTLS: "dcbtstls", ICBTLS: "icbtls", @@ -2646,7 +2661,7 @@ var opstr = [...]string{ TLBIVAX: "tlbivax", TLBILX: "tlbilx", TLBSX: "tlbsx", - TLBSRX_: "tlbsrx.", + TLBSRXCC: "tlbsrx.", TLBRE: "tlbre", TLBWE: "tlbwe", DNH: "dnh", @@ -2656,6 +2671,21 @@ var opstr = [...]string{ ICREAD: "icread", MFPMR: "mfpmr", MTPMR: "mtpmr", + ADDEX: "addex", + DARN: "darn", + MADDHD: "maddhd", + MADDHDU: "maddhdu", + MADDLD: "maddld", + CMPRB: "cmprb", + CMPEQB: "cmpeqb", + EXTSWSLI: "extswsli", + EXTSWSLICC: "extswsli.", + MFVSRLD: "mfvsrld", + MTVSRDD: "mtvsrdd", + MTVSRWS: "mtvsrws", + MCRXRX: "mcrxrx", + COPY: "copy", + PASTECC: "paste.", } var ( @@ -2729,12 +2759,13 @@ var ( ap_SpReg_12_15 = &argField{Type: TypeSpReg, Shift: 0, BitFields: BitFields{{12, 4}}} ap_ImmUnsigned_6_20 = &argField{Type: TypeImmUnsigned, Shift: 0, BitFields: BitFields{{6, 15}}} ap_ImmUnsigned_11_20 = &argField{Type: TypeImmUnsigned, Shift: 0, BitFields: BitFields{{11, 10}}} + ap_Reg_21_25 = &argField{Type: TypeReg, Shift: 0, BitFields: BitFields{{21, 5}}} ) var instFormats = [...]instFormat{ {CNTLZW, 0xfc0007ff, 0x7c000034, 0xf800, // Count Leading Zeros Word X-form (cntlzw RA, RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, - {CNTLZW_, 0xfc0007ff, 0x7c000035, 0xf800, // Count Leading Zeros Word X-form (cntlzw. RA, RS) + {CNTLZWCC, 0xfc0007ff, 0x7c000035, 0xf800, // Count Leading Zeros Word X-form (cntlzw. RA, RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, {B, 0xfc000003, 0x48000000, 0x0, // Branch I-form (b target_addr) [5]*argField{ap_PCRel_6_29_shift2}}, @@ -2904,195 +2935,195 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_ImmSigned_16_31}}, {ADD, 0xfc0007ff, 0x7c000214, 0x0, // Add XO-form (add RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ADD_, 0xfc0007ff, 0x7c000215, 0x0, // Add XO-form (add. RT,RA,RB) + {ADDCC, 0xfc0007ff, 0x7c000215, 0x0, // Add XO-form (add. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {ADDO, 0xfc0007ff, 0x7c000614, 0x0, // Add XO-form (addo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ADDO_, 0xfc0007ff, 0x7c000615, 0x0, // Add XO-form (addo. RT,RA,RB) + {ADDOCC, 0xfc0007ff, 0x7c000615, 0x0, // Add XO-form (addo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {ADDIC, 0xfc000000, 0x30000000, 0x0, // Add Immediate Carrying D-form (addic RT,RA,SI) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_ImmSigned_16_31}}, {SUBF, 0xfc0007ff, 0x7c000050, 0x0, // Subtract From XO-form (subf RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {SUBF_, 0xfc0007ff, 0x7c000051, 0x0, // Subtract From XO-form (subf. RT,RA,RB) + {SUBFCC, 0xfc0007ff, 0x7c000051, 0x0, // Subtract From XO-form (subf. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {SUBFO, 0xfc0007ff, 0x7c000450, 0x0, // Subtract From XO-form (subfo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {SUBFO_, 0xfc0007ff, 0x7c000451, 0x0, // Subtract From XO-form (subfo. RT,RA,RB) + {SUBFOCC, 0xfc0007ff, 0x7c000451, 0x0, // Subtract From XO-form (subfo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ADDIC_, 0xfc000000, 0x34000000, 0x0, // Add Immediate Carrying and Record D-form (addic. RT,RA,SI) + {ADDICCC, 0xfc000000, 0x34000000, 0x0, // Add Immediate Carrying and Record D-form (addic. RT,RA,SI) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_ImmSigned_16_31}}, {SUBFIC, 0xfc000000, 0x20000000, 0x0, // Subtract From Immediate Carrying D-form (subfic RT,RA,SI) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_ImmSigned_16_31}}, {ADDC, 0xfc0007ff, 0x7c000014, 0x0, // Add Carrying XO-form (addc RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ADDC_, 0xfc0007ff, 0x7c000015, 0x0, // Add Carrying XO-form (addc. RT,RA,RB) + {ADDCCC, 0xfc0007ff, 0x7c000015, 0x0, // Add Carrying XO-form (addc. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {ADDCO, 0xfc0007ff, 0x7c000414, 0x0, // Add Carrying XO-form (addco RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ADDCO_, 0xfc0007ff, 0x7c000415, 0x0, // Add Carrying XO-form (addco. RT,RA,RB) + {ADDCOCC, 0xfc0007ff, 0x7c000415, 0x0, // Add Carrying XO-form (addco. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {SUBFC, 0xfc0007ff, 0x7c000010, 0x0, // Subtract From Carrying XO-form (subfc RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {SUBFC_, 0xfc0007ff, 0x7c000011, 0x0, // Subtract From Carrying XO-form (subfc. RT,RA,RB) + {SUBFCCC, 0xfc0007ff, 0x7c000011, 0x0, // Subtract From Carrying XO-form (subfc. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {SUBFCO, 0xfc0007ff, 0x7c000410, 0x0, // Subtract From Carrying XO-form (subfco RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {SUBFCO_, 0xfc0007ff, 0x7c000411, 0x0, // Subtract From Carrying XO-form (subfco. RT,RA,RB) + {SUBFCOCC, 0xfc0007ff, 0x7c000411, 0x0, // Subtract From Carrying XO-form (subfco. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {ADDE, 0xfc0007ff, 0x7c000114, 0x0, // Add Extended XO-form (adde RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ADDE_, 0xfc0007ff, 0x7c000115, 0x0, // Add Extended XO-form (adde. RT,RA,RB) + {ADDECC, 0xfc0007ff, 0x7c000115, 0x0, // Add Extended XO-form (adde. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {ADDEO, 0xfc0007ff, 0x7c000514, 0x0, // Add Extended XO-form (addeo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ADDEO_, 0xfc0007ff, 0x7c000515, 0x0, // Add Extended XO-form (addeo. RT,RA,RB) + {ADDEOCC, 0xfc0007ff, 0x7c000515, 0x0, // Add Extended XO-form (addeo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {ADDME, 0xfc0007ff, 0x7c0001d4, 0xf800, // Add to Minus One Extended XO-form (addme RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {ADDME_, 0xfc0007ff, 0x7c0001d5, 0xf800, // Add to Minus One Extended XO-form (addme. RT,RA) + {ADDMECC, 0xfc0007ff, 0x7c0001d5, 0xf800, // Add to Minus One Extended XO-form (addme. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {ADDMEO, 0xfc0007ff, 0x7c0005d4, 0xf800, // Add to Minus One Extended XO-form (addmeo RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {ADDMEO_, 0xfc0007ff, 0x7c0005d5, 0xf800, // Add to Minus One Extended XO-form (addmeo. RT,RA) + {ADDMEOCC, 0xfc0007ff, 0x7c0005d5, 0xf800, // Add to Minus One Extended XO-form (addmeo. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {SUBFE, 0xfc0007ff, 0x7c000110, 0x0, // Subtract From Extended XO-form (subfe RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {SUBFE_, 0xfc0007ff, 0x7c000111, 0x0, // Subtract From Extended XO-form (subfe. RT,RA,RB) + {SUBFECC, 0xfc0007ff, 0x7c000111, 0x0, // Subtract From Extended XO-form (subfe. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {SUBFEO, 0xfc0007ff, 0x7c000510, 0x0, // Subtract From Extended XO-form (subfeo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {SUBFEO_, 0xfc0007ff, 0x7c000511, 0x0, // Subtract From Extended XO-form (subfeo. RT,RA,RB) + {SUBFEOCC, 0xfc0007ff, 0x7c000511, 0x0, // Subtract From Extended XO-form (subfeo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {SUBFME, 0xfc0007ff, 0x7c0001d0, 0xf800, // Subtract From Minus One Extended XO-form (subfme RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {SUBFME_, 0xfc0007ff, 0x7c0001d1, 0xf800, // Subtract From Minus One Extended XO-form (subfme. RT,RA) + {SUBFMECC, 0xfc0007ff, 0x7c0001d1, 0xf800, // Subtract From Minus One Extended XO-form (subfme. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {SUBFMEO, 0xfc0007ff, 0x7c0005d0, 0xf800, // Subtract From Minus One Extended XO-form (subfmeo RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {SUBFMEO_, 0xfc0007ff, 0x7c0005d1, 0xf800, // Subtract From Minus One Extended XO-form (subfmeo. RT,RA) + {SUBFMEOCC, 0xfc0007ff, 0x7c0005d1, 0xf800, // Subtract From Minus One Extended XO-form (subfmeo. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {ADDZE, 0xfc0007ff, 0x7c000194, 0xf800, // Add to Zero Extended XO-form (addze RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {ADDZE_, 0xfc0007ff, 0x7c000195, 0xf800, // Add to Zero Extended XO-form (addze. RT,RA) + {ADDZECC, 0xfc0007ff, 0x7c000195, 0xf800, // Add to Zero Extended XO-form (addze. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {ADDZEO, 0xfc0007ff, 0x7c000594, 0xf800, // Add to Zero Extended XO-form (addzeo RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {ADDZEO_, 0xfc0007ff, 0x7c000595, 0xf800, // Add to Zero Extended XO-form (addzeo. RT,RA) + {ADDZEOCC, 0xfc0007ff, 0x7c000595, 0xf800, // Add to Zero Extended XO-form (addzeo. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {SUBFZE, 0xfc0007ff, 0x7c000190, 0xf800, // Subtract From Zero Extended XO-form (subfze RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {SUBFZE_, 0xfc0007ff, 0x7c000191, 0xf800, // Subtract From Zero Extended XO-form (subfze. RT,RA) + {SUBFZECC, 0xfc0007ff, 0x7c000191, 0xf800, // Subtract From Zero Extended XO-form (subfze. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {SUBFZEO, 0xfc0007ff, 0x7c000590, 0xf800, // Subtract From Zero Extended XO-form (subfzeo RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {SUBFZEO_, 0xfc0007ff, 0x7c000591, 0xf800, // Subtract From Zero Extended XO-form (subfzeo. RT,RA) + {SUBFZEOCC, 0xfc0007ff, 0x7c000591, 0xf800, // Subtract From Zero Extended XO-form (subfzeo. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {NEG, 0xfc0007ff, 0x7c0000d0, 0xf800, // Negate XO-form (neg RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {NEG_, 0xfc0007ff, 0x7c0000d1, 0xf800, // Negate XO-form (neg. RT,RA) + {NEGCC, 0xfc0007ff, 0x7c0000d1, 0xf800, // Negate XO-form (neg. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {NEGO, 0xfc0007ff, 0x7c0004d0, 0xf800, // Negate XO-form (nego RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, - {NEGO_, 0xfc0007ff, 0x7c0004d1, 0xf800, // Negate XO-form (nego. RT,RA) + {NEGOCC, 0xfc0007ff, 0x7c0004d1, 0xf800, // Negate XO-form (nego. RT,RA) [5]*argField{ap_Reg_6_10, ap_Reg_11_15}}, {MULLI, 0xfc000000, 0x1c000000, 0x0, // Multiply Low Immediate D-form (mulli RT,RA,SI) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_ImmSigned_16_31}}, {MULLW, 0xfc0007ff, 0x7c0001d6, 0x0, // Multiply Low Word XO-form (mullw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULLW_, 0xfc0007ff, 0x7c0001d7, 0x0, // Multiply Low Word XO-form (mullw. RT,RA,RB) + {MULLWCC, 0xfc0007ff, 0x7c0001d7, 0x0, // Multiply Low Word XO-form (mullw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULLWO, 0xfc0007ff, 0x7c0005d6, 0x0, // Multiply Low Word XO-form (mullwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULLWO_, 0xfc0007ff, 0x7c0005d7, 0x0, // Multiply Low Word XO-form (mullwo. RT,RA,RB) + {MULLWOCC, 0xfc0007ff, 0x7c0005d7, 0x0, // Multiply Low Word XO-form (mullwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULHW, 0xfc0003ff, 0x7c000096, 0x400, // Multiply High Word XO-form (mulhw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULHW_, 0xfc0003ff, 0x7c000097, 0x400, // Multiply High Word XO-form (mulhw. RT,RA,RB) + {MULHWCC, 0xfc0003ff, 0x7c000097, 0x400, // Multiply High Word XO-form (mulhw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULHWU, 0xfc0003ff, 0x7c000016, 0x400, // Multiply High Word Unsigned XO-form (mulhwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULHWU_, 0xfc0003ff, 0x7c000017, 0x400, // Multiply High Word Unsigned XO-form (mulhwu. RT,RA,RB) + {MULHWUCC, 0xfc0003ff, 0x7c000017, 0x400, // Multiply High Word Unsigned XO-form (mulhwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVW, 0xfc0007ff, 0x7c0003d6, 0x0, // Divide Word XO-form (divw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVW_, 0xfc0007ff, 0x7c0003d7, 0x0, // Divide Word XO-form (divw. RT,RA,RB) + {DIVWCC, 0xfc0007ff, 0x7c0003d7, 0x0, // Divide Word XO-form (divw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVWO, 0xfc0007ff, 0x7c0007d6, 0x0, // Divide Word XO-form (divwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVWO_, 0xfc0007ff, 0x7c0007d7, 0x0, // Divide Word XO-form (divwo. RT,RA,RB) + {DIVWOCC, 0xfc0007ff, 0x7c0007d7, 0x0, // Divide Word XO-form (divwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVWU, 0xfc0007ff, 0x7c000396, 0x0, // Divide Word Unsigned XO-form (divwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVWU_, 0xfc0007ff, 0x7c000397, 0x0, // Divide Word Unsigned XO-form (divwu. RT,RA,RB) + {DIVWUCC, 0xfc0007ff, 0x7c000397, 0x0, // Divide Word Unsigned XO-form (divwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVWUO, 0xfc0007ff, 0x7c000796, 0x0, // Divide Word Unsigned XO-form (divwuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVWUO_, 0xfc0007ff, 0x7c000797, 0x0, // Divide Word Unsigned XO-form (divwuo. RT,RA,RB) + {DIVWUOCC, 0xfc0007ff, 0x7c000797, 0x0, // Divide Word Unsigned XO-form (divwuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVWE, 0xfc0007ff, 0x7c000356, 0x0, // Divide Word Extended XO-form (divwe RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVWE_, 0xfc0007ff, 0x7c000357, 0x0, // Divide Word Extended XO-form (divwe. RT,RA,RB) + {DIVWECC, 0xfc0007ff, 0x7c000357, 0x0, // Divide Word Extended XO-form (divwe. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVWEO, 0xfc0007ff, 0x7c000756, 0x0, // Divide Word Extended XO-form (divweo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVWEO_, 0xfc0007ff, 0x7c000757, 0x0, // Divide Word Extended XO-form (divweo. RT,RA,RB) + {DIVWEOCC, 0xfc0007ff, 0x7c000757, 0x0, // Divide Word Extended XO-form (divweo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVWEU, 0xfc0007ff, 0x7c000316, 0x0, // Divide Word Extended Unsigned XO-form (divweu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVWEU_, 0xfc0007ff, 0x7c000317, 0x0, // Divide Word Extended Unsigned XO-form (divweu. RT,RA,RB) + {DIVWEUCC, 0xfc0007ff, 0x7c000317, 0x0, // Divide Word Extended Unsigned XO-form (divweu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVWEUO, 0xfc0007ff, 0x7c000716, 0x0, // Divide Word Extended Unsigned XO-form (divweuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVWEUO_, 0xfc0007ff, 0x7c000717, 0x0, // Divide Word Extended Unsigned XO-form (divweuo. RT,RA,RB) + {DIVWEUOCC, 0xfc0007ff, 0x7c000717, 0x0, // Divide Word Extended Unsigned XO-form (divweuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULLD, 0xfc0007ff, 0x7c0001d2, 0x0, // Multiply Low Doubleword XO-form (mulld RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULLD_, 0xfc0007ff, 0x7c0001d3, 0x0, // Multiply Low Doubleword XO-form (mulld. RT,RA,RB) + {MULLDCC, 0xfc0007ff, 0x7c0001d3, 0x0, // Multiply Low Doubleword XO-form (mulld. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULLDO, 0xfc0007ff, 0x7c0005d2, 0x0, // Multiply Low Doubleword XO-form (mulldo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULLDO_, 0xfc0007ff, 0x7c0005d3, 0x0, // Multiply Low Doubleword XO-form (mulldo. RT,RA,RB) + {MULLDOCC, 0xfc0007ff, 0x7c0005d3, 0x0, // Multiply Low Doubleword XO-form (mulldo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULHDU, 0xfc0003ff, 0x7c000012, 0x400, // Multiply High Doubleword Unsigned XO-form (mulhdu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULHDU_, 0xfc0003ff, 0x7c000013, 0x400, // Multiply High Doubleword Unsigned XO-form (mulhdu. RT,RA,RB) + {MULHDUCC, 0xfc0003ff, 0x7c000013, 0x400, // Multiply High Doubleword Unsigned XO-form (mulhdu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULHD, 0xfc0003ff, 0x7c000092, 0x400, // Multiply High Doubleword XO-form (mulhd RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULHD_, 0xfc0003ff, 0x7c000093, 0x400, // Multiply High Doubleword XO-form (mulhd. RT,RA,RB) + {MULHDCC, 0xfc0003ff, 0x7c000093, 0x400, // Multiply High Doubleword XO-form (mulhd. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVD, 0xfc0007ff, 0x7c0003d2, 0x0, // Divide Doubleword XO-form (divd RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVD_, 0xfc0007ff, 0x7c0003d3, 0x0, // Divide Doubleword XO-form (divd. RT,RA,RB) + {DIVDCC, 0xfc0007ff, 0x7c0003d3, 0x0, // Divide Doubleword XO-form (divd. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVDO, 0xfc0007ff, 0x7c0007d2, 0x0, // Divide Doubleword XO-form (divdo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVDO_, 0xfc0007ff, 0x7c0007d3, 0x0, // Divide Doubleword XO-form (divdo. RT,RA,RB) + {DIVDOCC, 0xfc0007ff, 0x7c0007d3, 0x0, // Divide Doubleword XO-form (divdo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVDU, 0xfc0007ff, 0x7c000392, 0x0, // Divide Doubleword Unsigned XO-form (divdu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVDU_, 0xfc0007ff, 0x7c000393, 0x0, // Divide Doubleword Unsigned XO-form (divdu. RT,RA,RB) + {DIVDUCC, 0xfc0007ff, 0x7c000393, 0x0, // Divide Doubleword Unsigned XO-form (divdu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVDUO, 0xfc0007ff, 0x7c000792, 0x0, // Divide Doubleword Unsigned XO-form (divduo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVDUO_, 0xfc0007ff, 0x7c000793, 0x0, // Divide Doubleword Unsigned XO-form (divduo. RT,RA,RB) + {DIVDUOCC, 0xfc0007ff, 0x7c000793, 0x0, // Divide Doubleword Unsigned XO-form (divduo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVDE, 0xfc0007ff, 0x7c000352, 0x0, // Divide Doubleword Extended XO-form (divde RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVDE_, 0xfc0007ff, 0x7c000353, 0x0, // Divide Doubleword Extended XO-form (divde. RT,RA,RB) + {DIVDECC, 0xfc0007ff, 0x7c000353, 0x0, // Divide Doubleword Extended XO-form (divde. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVDEO, 0xfc0007ff, 0x7c000752, 0x0, // Divide Doubleword Extended XO-form (divdeo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVDEO_, 0xfc0007ff, 0x7c000753, 0x0, // Divide Doubleword Extended XO-form (divdeo. RT,RA,RB) + {DIVDEOCC, 0xfc0007ff, 0x7c000753, 0x0, // Divide Doubleword Extended XO-form (divdeo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVDEU, 0xfc0007ff, 0x7c000312, 0x0, // Divide Doubleword Extended Unsigned XO-form (divdeu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVDEU_, 0xfc0007ff, 0x7c000313, 0x0, // Divide Doubleword Extended Unsigned XO-form (divdeu. RT,RA,RB) + {DIVDEUCC, 0xfc0007ff, 0x7c000313, 0x0, // Divide Doubleword Extended Unsigned XO-form (divdeu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DIVDEUO, 0xfc0007ff, 0x7c000712, 0x0, // Divide Doubleword Extended Unsigned XO-form (divdeuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {DIVDEUO_, 0xfc0007ff, 0x7c000713, 0x0, // Divide Doubleword Extended Unsigned XO-form (divdeuo. RT,RA,RB) + {DIVDEUOCC, 0xfc0007ff, 0x7c000713, 0x0, // Divide Doubleword Extended Unsigned XO-form (divdeuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {CMPWI, 0xfc200000, 0x2c000000, 0x400000, // Compare Immediate D-form (cmpwi BF,RA,SI) [5]*argField{ap_CondRegField_6_8, ap_Reg_11_15, ap_ImmSigned_16_31}}, @@ -3120,9 +3151,9 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_CondRegBit_21_25}}, {TD, 0xfc0007fe, 0x7c000088, 0x1, // Trap Doubleword X-form (td TO,RA,RB) [5]*argField{ap_ImmUnsigned_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ANDI_, 0xfc000000, 0x70000000, 0x0, // AND Immediate D-form (andi. RA,RS,UI) + {ANDICC, 0xfc000000, 0x70000000, 0x0, // AND Immediate D-form (andi. RA,RS,UI) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_31}}, - {ANDIS_, 0xfc000000, 0x74000000, 0x0, // AND Immediate Shifted D-form (andis. RA,RS,UI) + {ANDISCC, 0xfc000000, 0x74000000, 0x0, // AND Immediate Shifted D-form (andis. RA,RS,UI) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_31}}, {ORI, 0xfc000000, 0x60000000, 0x0, // OR Immediate D-form (ori RA,RS,UI) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_31}}, @@ -3134,43 +3165,43 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_31}}, {AND, 0xfc0007ff, 0x7c000038, 0x0, // AND X-form (and RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {AND_, 0xfc0007ff, 0x7c000039, 0x0, // AND X-form (and. RA,RS,RB) + {ANDCC, 0xfc0007ff, 0x7c000039, 0x0, // AND X-form (and. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {XOR, 0xfc0007ff, 0x7c000278, 0x0, // XOR X-form (xor RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {XOR_, 0xfc0007ff, 0x7c000279, 0x0, // XOR X-form (xor. RA,RS,RB) + {XORCC, 0xfc0007ff, 0x7c000279, 0x0, // XOR X-form (xor. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {NAND, 0xfc0007ff, 0x7c0003b8, 0x0, // NAND X-form (nand RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {NAND_, 0xfc0007ff, 0x7c0003b9, 0x0, // NAND X-form (nand. RA,RS,RB) + {NANDCC, 0xfc0007ff, 0x7c0003b9, 0x0, // NAND X-form (nand. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {OR, 0xfc0007ff, 0x7c000378, 0x0, // OR X-form (or RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {OR_, 0xfc0007ff, 0x7c000379, 0x0, // OR X-form (or. RA,RS,RB) + {ORCC, 0xfc0007ff, 0x7c000379, 0x0, // OR X-form (or. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {NOR, 0xfc0007ff, 0x7c0000f8, 0x0, // NOR X-form (nor RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {NOR_, 0xfc0007ff, 0x7c0000f9, 0x0, // NOR X-form (nor. RA,RS,RB) + {NORCC, 0xfc0007ff, 0x7c0000f9, 0x0, // NOR X-form (nor. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {ANDC, 0xfc0007ff, 0x7c000078, 0x0, // AND with Complement X-form (andc RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {ANDC_, 0xfc0007ff, 0x7c000079, 0x0, // AND with Complement X-form (andc. RA,RS,RB) + {ANDCCC, 0xfc0007ff, 0x7c000079, 0x0, // AND with Complement X-form (andc. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {EXTSB, 0xfc0007ff, 0x7c000774, 0xf800, // Extend Sign Byte X-form (extsb RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, - {EXTSB_, 0xfc0007ff, 0x7c000775, 0xf800, // Extend Sign Byte X-form (extsb. RA,RS) + {EXTSBCC, 0xfc0007ff, 0x7c000775, 0xf800, // Extend Sign Byte X-form (extsb. RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, {EQV, 0xfc0007ff, 0x7c000238, 0x0, // Equivalent X-form (eqv RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {EQV_, 0xfc0007ff, 0x7c000239, 0x0, // Equivalent X-form (eqv. RA,RS,RB) + {EQVCC, 0xfc0007ff, 0x7c000239, 0x0, // Equivalent X-form (eqv. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {ORC, 0xfc0007ff, 0x7c000338, 0x0, // OR with Complement X-form (orc RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {ORC_, 0xfc0007ff, 0x7c000339, 0x0, // OR with Complement X-form (orc. RA,RS,RB) + {ORCCC, 0xfc0007ff, 0x7c000339, 0x0, // OR with Complement X-form (orc. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {EXTSH, 0xfc0007ff, 0x7c000734, 0xf800, // Extend Sign Halfword X-form (extsh RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, - {EXTSH_, 0xfc0007ff, 0x7c000735, 0xf800, // Extend Sign Halfword X-form (extsh. RA,RS) + {EXTSHCC, 0xfc0007ff, 0x7c000735, 0xf800, // Extend Sign Halfword X-form (extsh. RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, {CMPB, 0xfc0007fe, 0x7c0003f8, 0x1, // Compare Bytes X-form (cmpb RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, @@ -3184,11 +3215,11 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, {EXTSW, 0xfc0007ff, 0x7c0007b4, 0xf800, // Extend Sign Word X-form (extsw RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, - {EXTSW_, 0xfc0007ff, 0x7c0007b5, 0xf800, // Extend Sign Word X-form (extsw. RA,RS) + {EXTSWCC, 0xfc0007ff, 0x7c0007b5, 0xf800, // Extend Sign Word X-form (extsw. RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, {CNTLZD, 0xfc0007ff, 0x7c000074, 0xf800, // Count Leading Zeros Doubleword X-form (cntlzd RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, - {CNTLZD_, 0xfc0007ff, 0x7c000075, 0xf800, // Count Leading Zeros Doubleword X-form (cntlzd. RA,RS) + {CNTLZDCC, 0xfc0007ff, 0x7c000075, 0xf800, // Count Leading Zeros Doubleword X-form (cntlzd. RA,RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, {POPCNTD, 0xfc0007fe, 0x7c0003f4, 0xf801, // Population Count Doubleword X-form (popcntd RA, RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, @@ -3196,71 +3227,71 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {RLWINM, 0xfc000001, 0x54000000, 0x0, // Rotate Left Word Immediate then AND with Mask M-form (rlwinm RA,RS,SH,MB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_20, ap_ImmUnsigned_21_25, ap_ImmUnsigned_26_30}}, - {RLWINM_, 0xfc000001, 0x54000001, 0x0, // Rotate Left Word Immediate then AND with Mask M-form (rlwinm. RA,RS,SH,MB,ME) + {RLWINMCC, 0xfc000001, 0x54000001, 0x0, // Rotate Left Word Immediate then AND with Mask M-form (rlwinm. RA,RS,SH,MB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_20, ap_ImmUnsigned_21_25, ap_ImmUnsigned_26_30}}, {RLWNM, 0xfc000001, 0x5c000000, 0x0, // Rotate Left Word then AND with Mask M-form (rlwnm RA,RS,RB,MB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20, ap_ImmUnsigned_21_25, ap_ImmUnsigned_26_30}}, - {RLWNM_, 0xfc000001, 0x5c000001, 0x0, // Rotate Left Word then AND with Mask M-form (rlwnm. RA,RS,RB,MB,ME) + {RLWNMCC, 0xfc000001, 0x5c000001, 0x0, // Rotate Left Word then AND with Mask M-form (rlwnm. RA,RS,RB,MB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20, ap_ImmUnsigned_21_25, ap_ImmUnsigned_26_30}}, {RLWIMI, 0xfc000001, 0x50000000, 0x0, // Rotate Left Word Immediate then Mask Insert M-form (rlwimi RA,RS,SH,MB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_20, ap_ImmUnsigned_21_25, ap_ImmUnsigned_26_30}}, - {RLWIMI_, 0xfc000001, 0x50000001, 0x0, // Rotate Left Word Immediate then Mask Insert M-form (rlwimi. RA,RS,SH,MB,ME) + {RLWIMICC, 0xfc000001, 0x50000001, 0x0, // Rotate Left Word Immediate then Mask Insert M-form (rlwimi. RA,RS,SH,MB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_20, ap_ImmUnsigned_21_25, ap_ImmUnsigned_26_30}}, {RLDICL, 0xfc00001d, 0x78000000, 0x0, // Rotate Left Doubleword Immediate then Clear Left MD-form (rldicl RA,RS,SH,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, - {RLDICL_, 0xfc00001d, 0x78000001, 0x0, // Rotate Left Doubleword Immediate then Clear Left MD-form (rldicl. RA,RS,SH,MB) + {RLDICLCC, 0xfc00001d, 0x78000001, 0x0, // Rotate Left Doubleword Immediate then Clear Left MD-form (rldicl. RA,RS,SH,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, {RLDICR, 0xfc00001d, 0x78000004, 0x0, // Rotate Left Doubleword Immediate then Clear Right MD-form (rldicr RA,RS,SH,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, - {RLDICR_, 0xfc00001d, 0x78000005, 0x0, // Rotate Left Doubleword Immediate then Clear Right MD-form (rldicr. RA,RS,SH,ME) + {RLDICRCC, 0xfc00001d, 0x78000005, 0x0, // Rotate Left Doubleword Immediate then Clear Right MD-form (rldicr. RA,RS,SH,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, {RLDIC, 0xfc00001d, 0x78000008, 0x0, // Rotate Left Doubleword Immediate then Clear MD-form (rldic RA,RS,SH,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, - {RLDIC_, 0xfc00001d, 0x78000009, 0x0, // Rotate Left Doubleword Immediate then Clear MD-form (rldic. RA,RS,SH,MB) + {RLDICCC, 0xfc00001d, 0x78000009, 0x0, // Rotate Left Doubleword Immediate then Clear MD-form (rldic. RA,RS,SH,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, {RLDCL, 0xfc00001f, 0x78000010, 0x0, // Rotate Left Doubleword then Clear Left MDS-form (rldcl RA,RS,RB,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20, ap_ImmUnsigned_26_26_21_25}}, - {RLDCL_, 0xfc00001f, 0x78000011, 0x0, // Rotate Left Doubleword then Clear Left MDS-form (rldcl. RA,RS,RB,MB) + {RLDCLCC, 0xfc00001f, 0x78000011, 0x0, // Rotate Left Doubleword then Clear Left MDS-form (rldcl. RA,RS,RB,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20, ap_ImmUnsigned_26_26_21_25}}, {RLDCR, 0xfc00001f, 0x78000012, 0x0, // Rotate Left Doubleword then Clear Right MDS-form (rldcr RA,RS,RB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20, ap_ImmUnsigned_26_26_21_25}}, - {RLDCR_, 0xfc00001f, 0x78000013, 0x0, // Rotate Left Doubleword then Clear Right MDS-form (rldcr. RA,RS,RB,ME) + {RLDCRCC, 0xfc00001f, 0x78000013, 0x0, // Rotate Left Doubleword then Clear Right MDS-form (rldcr. RA,RS,RB,ME) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20, ap_ImmUnsigned_26_26_21_25}}, {RLDIMI, 0xfc00001d, 0x7800000c, 0x0, // Rotate Left Doubleword Immediate then Mask Insert MD-form (rldimi RA,RS,SH,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, - {RLDIMI_, 0xfc00001d, 0x7800000d, 0x0, // Rotate Left Doubleword Immediate then Mask Insert MD-form (rldimi. RA,RS,SH,MB) + {RLDIMICC, 0xfc00001d, 0x7800000d, 0x0, // Rotate Left Doubleword Immediate then Mask Insert MD-form (rldimi. RA,RS,SH,MB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20, ap_ImmUnsigned_26_26_21_25}}, {SLW, 0xfc0007ff, 0x7c000030, 0x0, // Shift Left Word X-form (slw RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {SLW_, 0xfc0007ff, 0x7c000031, 0x0, // Shift Left Word X-form (slw. RA,RS,RB) + {SLWCC, 0xfc0007ff, 0x7c000031, 0x0, // Shift Left Word X-form (slw. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {SRW, 0xfc0007ff, 0x7c000430, 0x0, // Shift Right Word X-form (srw RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {SRW_, 0xfc0007ff, 0x7c000431, 0x0, // Shift Right Word X-form (srw. RA,RS,RB) + {SRWCC, 0xfc0007ff, 0x7c000431, 0x0, // Shift Right Word X-form (srw. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {SRAWI, 0xfc0007ff, 0x7c000670, 0x0, // Shift Right Algebraic Word Immediate X-form (srawi RA,RS,SH) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_20}}, - {SRAWI_, 0xfc0007ff, 0x7c000671, 0x0, // Shift Right Algebraic Word Immediate X-form (srawi. RA,RS,SH) + {SRAWICC, 0xfc0007ff, 0x7c000671, 0x0, // Shift Right Algebraic Word Immediate X-form (srawi. RA,RS,SH) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_16_20}}, {SRAW, 0xfc0007ff, 0x7c000630, 0x0, // Shift Right Algebraic Word X-form (sraw RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {SRAW_, 0xfc0007ff, 0x7c000631, 0x0, // Shift Right Algebraic Word X-form (sraw. RA,RS,RB) + {SRAWCC, 0xfc0007ff, 0x7c000631, 0x0, // Shift Right Algebraic Word X-form (sraw. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {SLD, 0xfc0007ff, 0x7c000036, 0x0, // Shift Left Doubleword X-form (sld RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {SLD_, 0xfc0007ff, 0x7c000037, 0x0, // Shift Left Doubleword X-form (sld. RA,RS,RB) + {SLDCC, 0xfc0007ff, 0x7c000037, 0x0, // Shift Left Doubleword X-form (sld. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {SRD, 0xfc0007ff, 0x7c000436, 0x0, // Shift Right Doubleword X-form (srd RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {SRD_, 0xfc0007ff, 0x7c000437, 0x0, // Shift Right Doubleword X-form (srd. RA,RS,RB) + {SRDCC, 0xfc0007ff, 0x7c000437, 0x0, // Shift Right Doubleword X-form (srd. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {SRADI, 0xfc0007fd, 0x7c000674, 0x0, // Shift Right Algebraic Doubleword Immediate XS-form (sradi RA,RS,SH) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20}}, - {SRADI_, 0xfc0007fd, 0x7c000675, 0x0, // Shift Right Algebraic Doubleword Immediate XS-form (sradi. RA,RS,SH) + {SRADICC, 0xfc0007fd, 0x7c000675, 0x0, // Shift Right Algebraic Doubleword Immediate XS-form (sradi. RA,RS,SH) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20}}, {SRAD, 0xfc0007ff, 0x7c000634, 0x0, // Shift Right Algebraic Doubleword X-form (srad RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {SRAD_, 0xfc0007ff, 0x7c000635, 0x0, // Shift Right Algebraic Doubleword X-form (srad. RA,RS,RB) + {SRADCC, 0xfc0007ff, 0x7c000635, 0x0, // Shift Right Algebraic Doubleword X-form (srad. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {CDTBCD, 0xfc0007fe, 0x7c000234, 0xf801, // Convert Declets To Binary Coded Decimal X-form (cdtbcd RA, RS) [5]*argField{ap_Reg_11_15, ap_Reg_6_10}}, @@ -3346,23 +3377,23 @@ var instFormats = [...]instFormat{ [5]*argField{ap_FPReg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {FMR, 0xfc0007ff, 0xfc000090, 0x1f0000, // Floating Move Register X-form (fmr FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FMR_, 0xfc0007ff, 0xfc000091, 0x1f0000, // Floating Move Register X-form (fmr. FRT,FRB) + {FMRCC, 0xfc0007ff, 0xfc000091, 0x1f0000, // Floating Move Register X-form (fmr. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FABS, 0xfc0007ff, 0xfc000210, 0x1f0000, // Floating Absolute Value X-form (fabs FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FABS_, 0xfc0007ff, 0xfc000211, 0x1f0000, // Floating Absolute Value X-form (fabs. FRT,FRB) + {FABSCC, 0xfc0007ff, 0xfc000211, 0x1f0000, // Floating Absolute Value X-form (fabs. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FNABS, 0xfc0007ff, 0xfc000110, 0x1f0000, // Floating Negative Absolute Value X-form (fnabs FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FNABS_, 0xfc0007ff, 0xfc000111, 0x1f0000, // Floating Negative Absolute Value X-form (fnabs. FRT,FRB) + {FNABSCC, 0xfc0007ff, 0xfc000111, 0x1f0000, // Floating Negative Absolute Value X-form (fnabs. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FNEG, 0xfc0007ff, 0xfc000050, 0x1f0000, // Floating Negate X-form (fneg FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FNEG_, 0xfc0007ff, 0xfc000051, 0x1f0000, // Floating Negate X-form (fneg. FRT,FRB) + {FNEGCC, 0xfc0007ff, 0xfc000051, 0x1f0000, // Floating Negate X-form (fneg. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCPSGN, 0xfc0007ff, 0xfc000010, 0x0, // Floating Copy Sign X-form (fcpsgn FRT, FRA, FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {FCPSGN_, 0xfc0007ff, 0xfc000011, 0x0, // Floating Copy Sign X-form (fcpsgn. FRT, FRA, FRB) + {FCPSGNCC, 0xfc0007ff, 0xfc000011, 0x0, // Floating Copy Sign X-form (fcpsgn. FRT, FRA, FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FMRGEW, 0xfc0007fe, 0xfc00078c, 0x1, // Floating Merge Even Word X-form (fmrgew FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, @@ -3370,59 +3401,59 @@ var instFormats = [...]instFormat{ [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FADD, 0xfc00003f, 0xfc00002a, 0x7c0, // Floating Add [Single] A-form (fadd FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {FADD_, 0xfc00003f, 0xfc00002b, 0x7c0, // Floating Add [Single] A-form (fadd. FRT,FRA,FRB) + {FADDCC, 0xfc00003f, 0xfc00002b, 0x7c0, // Floating Add [Single] A-form (fadd. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FADDS, 0xfc00003f, 0xec00002a, 0x7c0, // Floating Add [Single] A-form (fadds FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {FADDS_, 0xfc00003f, 0xec00002b, 0x7c0, // Floating Add [Single] A-form (fadds. FRT,FRA,FRB) + {FADDSCC, 0xfc00003f, 0xec00002b, 0x7c0, // Floating Add [Single] A-form (fadds. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FSUB, 0xfc00003f, 0xfc000028, 0x7c0, // Floating Subtract [Single] A-form (fsub FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {FSUB_, 0xfc00003f, 0xfc000029, 0x7c0, // Floating Subtract [Single] A-form (fsub. FRT,FRA,FRB) + {FSUBCC, 0xfc00003f, 0xfc000029, 0x7c0, // Floating Subtract [Single] A-form (fsub. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FSUBS, 0xfc00003f, 0xec000028, 0x7c0, // Floating Subtract [Single] A-form (fsubs FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {FSUBS_, 0xfc00003f, 0xec000029, 0x7c0, // Floating Subtract [Single] A-form (fsubs. FRT,FRA,FRB) + {FSUBSCC, 0xfc00003f, 0xec000029, 0x7c0, // Floating Subtract [Single] A-form (fsubs. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FMUL, 0xfc00003f, 0xfc000032, 0xf800, // Floating Multiply [Single] A-form (fmul FRT,FRA,FRC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25}}, - {FMUL_, 0xfc00003f, 0xfc000033, 0xf800, // Floating Multiply [Single] A-form (fmul. FRT,FRA,FRC) + {FMULCC, 0xfc00003f, 0xfc000033, 0xf800, // Floating Multiply [Single] A-form (fmul. FRT,FRA,FRC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25}}, {FMULS, 0xfc00003f, 0xec000032, 0xf800, // Floating Multiply [Single] A-form (fmuls FRT,FRA,FRC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25}}, - {FMULS_, 0xfc00003f, 0xec000033, 0xf800, // Floating Multiply [Single] A-form (fmuls. FRT,FRA,FRC) + {FMULSCC, 0xfc00003f, 0xec000033, 0xf800, // Floating Multiply [Single] A-form (fmuls. FRT,FRA,FRC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25}}, {FDIV, 0xfc00003f, 0xfc000024, 0x7c0, // Floating Divide [Single] A-form (fdiv FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {FDIV_, 0xfc00003f, 0xfc000025, 0x7c0, // Floating Divide [Single] A-form (fdiv. FRT,FRA,FRB) + {FDIVCC, 0xfc00003f, 0xfc000025, 0x7c0, // Floating Divide [Single] A-form (fdiv. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FDIVS, 0xfc00003f, 0xec000024, 0x7c0, // Floating Divide [Single] A-form (fdivs FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {FDIVS_, 0xfc00003f, 0xec000025, 0x7c0, // Floating Divide [Single] A-form (fdivs. FRT,FRA,FRB) + {FDIVSCC, 0xfc00003f, 0xec000025, 0x7c0, // Floating Divide [Single] A-form (fdivs. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {FSQRT, 0xfc00003f, 0xfc00002c, 0x1f07c0, // Floating Square Root [Single] A-form (fsqrt FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FSQRT_, 0xfc00003f, 0xfc00002d, 0x1f07c0, // Floating Square Root [Single] A-form (fsqrt. FRT,FRB) + {FSQRTCC, 0xfc00003f, 0xfc00002d, 0x1f07c0, // Floating Square Root [Single] A-form (fsqrt. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FSQRTS, 0xfc00003f, 0xec00002c, 0x1f07c0, // Floating Square Root [Single] A-form (fsqrts FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FSQRTS_, 0xfc00003f, 0xec00002d, 0x1f07c0, // Floating Square Root [Single] A-form (fsqrts. FRT,FRB) + {FSQRTSCC, 0xfc00003f, 0xec00002d, 0x1f07c0, // Floating Square Root [Single] A-form (fsqrts. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRE, 0xfc00003f, 0xfc000030, 0x1f07c0, // Floating Reciprocal Estimate [Single] A-form (fre FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRE_, 0xfc00003f, 0xfc000031, 0x1f07c0, // Floating Reciprocal Estimate [Single] A-form (fre. FRT,FRB) + {FRECC, 0xfc00003f, 0xfc000031, 0x1f07c0, // Floating Reciprocal Estimate [Single] A-form (fre. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRES, 0xfc00003f, 0xec000030, 0x1f07c0, // Floating Reciprocal Estimate [Single] A-form (fres FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRES_, 0xfc00003f, 0xec000031, 0x1f07c0, // Floating Reciprocal Estimate [Single] A-form (fres. FRT,FRB) + {FRESCC, 0xfc00003f, 0xec000031, 0x1f07c0, // Floating Reciprocal Estimate [Single] A-form (fres. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRSQRTE, 0xfc00003f, 0xfc000034, 0x1f07c0, // Floating Reciprocal Square Root Estimate [Single] A-form (frsqrte FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRSQRTE_, 0xfc00003f, 0xfc000035, 0x1f07c0, // Floating Reciprocal Square Root Estimate [Single] A-form (frsqrte. FRT,FRB) + {FRSQRTECC, 0xfc00003f, 0xfc000035, 0x1f07c0, // Floating Reciprocal Square Root Estimate [Single] A-form (frsqrte. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRSQRTES, 0xfc00003f, 0xec000034, 0x1f07c0, // Floating Reciprocal Square Root Estimate [Single] A-form (frsqrtes FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRSQRTES_, 0xfc00003f, 0xec000035, 0x1f07c0, // Floating Reciprocal Square Root Estimate [Single] A-form (frsqrtes. FRT,FRB) + {FRSQRTESCC, 0xfc00003f, 0xec000035, 0x1f07c0, // Floating Reciprocal Square Root Estimate [Single] A-form (frsqrtes. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FTDIV, 0xfc0007fe, 0xfc000100, 0x600001, // Floating Test for software Divide X-form (ftdiv BF,FRA,FRB) [5]*argField{ap_CondRegField_6_8, ap_FPReg_11_15, ap_FPReg_16_20}}, @@ -3430,103 +3461,103 @@ var instFormats = [...]instFormat{ [5]*argField{ap_CondRegField_6_8, ap_FPReg_16_20}}, {FMADD, 0xfc00003f, 0xfc00003a, 0x0, // Floating Multiply-Add [Single] A-form (fmadd FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FMADD_, 0xfc00003f, 0xfc00003b, 0x0, // Floating Multiply-Add [Single] A-form (fmadd. FRT,FRA,FRC,FRB) + {FMADDCC, 0xfc00003f, 0xfc00003b, 0x0, // Floating Multiply-Add [Single] A-form (fmadd. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FMADDS, 0xfc00003f, 0xec00003a, 0x0, // Floating Multiply-Add [Single] A-form (fmadds FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FMADDS_, 0xfc00003f, 0xec00003b, 0x0, // Floating Multiply-Add [Single] A-form (fmadds. FRT,FRA,FRC,FRB) + {FMADDSCC, 0xfc00003f, 0xec00003b, 0x0, // Floating Multiply-Add [Single] A-form (fmadds. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FMSUB, 0xfc00003f, 0xfc000038, 0x0, // Floating Multiply-Subtract [Single] A-form (fmsub FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FMSUB_, 0xfc00003f, 0xfc000039, 0x0, // Floating Multiply-Subtract [Single] A-form (fmsub. FRT,FRA,FRC,FRB) + {FMSUBCC, 0xfc00003f, 0xfc000039, 0x0, // Floating Multiply-Subtract [Single] A-form (fmsub. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FMSUBS, 0xfc00003f, 0xec000038, 0x0, // Floating Multiply-Subtract [Single] A-form (fmsubs FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FMSUBS_, 0xfc00003f, 0xec000039, 0x0, // Floating Multiply-Subtract [Single] A-form (fmsubs. FRT,FRA,FRC,FRB) + {FMSUBSCC, 0xfc00003f, 0xec000039, 0x0, // Floating Multiply-Subtract [Single] A-form (fmsubs. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FNMADD, 0xfc00003f, 0xfc00003e, 0x0, // Floating Negative Multiply-Add [Single] A-form (fnmadd FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FNMADD_, 0xfc00003f, 0xfc00003f, 0x0, // Floating Negative Multiply-Add [Single] A-form (fnmadd. FRT,FRA,FRC,FRB) + {FNMADDCC, 0xfc00003f, 0xfc00003f, 0x0, // Floating Negative Multiply-Add [Single] A-form (fnmadd. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FNMADDS, 0xfc00003f, 0xec00003e, 0x0, // Floating Negative Multiply-Add [Single] A-form (fnmadds FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FNMADDS_, 0xfc00003f, 0xec00003f, 0x0, // Floating Negative Multiply-Add [Single] A-form (fnmadds. FRT,FRA,FRC,FRB) + {FNMADDSCC, 0xfc00003f, 0xec00003f, 0x0, // Floating Negative Multiply-Add [Single] A-form (fnmadds. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FNMSUB, 0xfc00003f, 0xfc00003c, 0x0, // Floating Negative Multiply-Subtract [Single] A-form (fnmsub FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FNMSUB_, 0xfc00003f, 0xfc00003d, 0x0, // Floating Negative Multiply-Subtract [Single] A-form (fnmsub. FRT,FRA,FRC,FRB) + {FNMSUBCC, 0xfc00003f, 0xfc00003d, 0x0, // Floating Negative Multiply-Subtract [Single] A-form (fnmsub. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FNMSUBS, 0xfc00003f, 0xec00003c, 0x0, // Floating Negative Multiply-Subtract [Single] A-form (fnmsubs FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FNMSUBS_, 0xfc00003f, 0xec00003d, 0x0, // Floating Negative Multiply-Subtract [Single] A-form (fnmsubs. FRT,FRA,FRC,FRB) + {FNMSUBSCC, 0xfc00003f, 0xec00003d, 0x0, // Floating Negative Multiply-Subtract [Single] A-form (fnmsubs. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {FRSP, 0xfc0007ff, 0xfc000018, 0x1f0000, // Floating Round to Single-Precision X-form (frsp FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRSP_, 0xfc0007ff, 0xfc000019, 0x1f0000, // Floating Round to Single-Precision X-form (frsp. FRT,FRB) + {FRSPCC, 0xfc0007ff, 0xfc000019, 0x1f0000, // Floating Round to Single-Precision X-form (frsp. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTID, 0xfc0007ff, 0xfc00065c, 0x1f0000, // Floating Convert To Integer Doubleword X-form (fctid FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTID_, 0xfc0007ff, 0xfc00065d, 0x1f0000, // Floating Convert To Integer Doubleword X-form (fctid. FRT,FRB) + {FCTIDCC, 0xfc0007ff, 0xfc00065d, 0x1f0000, // Floating Convert To Integer Doubleword X-form (fctid. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTIDZ, 0xfc0007ff, 0xfc00065e, 0x1f0000, // Floating Convert To Integer Doubleword with round toward Zero X-form (fctidz FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTIDZ_, 0xfc0007ff, 0xfc00065f, 0x1f0000, // Floating Convert To Integer Doubleword with round toward Zero X-form (fctidz. FRT,FRB) + {FCTIDZCC, 0xfc0007ff, 0xfc00065f, 0x1f0000, // Floating Convert To Integer Doubleword with round toward Zero X-form (fctidz. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTIDU, 0xfc0007ff, 0xfc00075c, 0x1f0000, // Floating Convert To Integer Doubleword Unsigned X-form (fctidu FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTIDU_, 0xfc0007ff, 0xfc00075d, 0x1f0000, // Floating Convert To Integer Doubleword Unsigned X-form (fctidu. FRT,FRB) + {FCTIDUCC, 0xfc0007ff, 0xfc00075d, 0x1f0000, // Floating Convert To Integer Doubleword Unsigned X-form (fctidu. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTIDUZ, 0xfc0007ff, 0xfc00075e, 0x1f0000, // Floating Convert To Integer Doubleword Unsigned with round toward Zero X-form (fctiduz FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTIDUZ_, 0xfc0007ff, 0xfc00075f, 0x1f0000, // Floating Convert To Integer Doubleword Unsigned with round toward Zero X-form (fctiduz. FRT,FRB) + {FCTIDUZCC, 0xfc0007ff, 0xfc00075f, 0x1f0000, // Floating Convert To Integer Doubleword Unsigned with round toward Zero X-form (fctiduz. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTIW, 0xfc0007ff, 0xfc00001c, 0x1f0000, // Floating Convert To Integer Word X-form (fctiw FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTIW_, 0xfc0007ff, 0xfc00001d, 0x1f0000, // Floating Convert To Integer Word X-form (fctiw. FRT,FRB) + {FCTIWCC, 0xfc0007ff, 0xfc00001d, 0x1f0000, // Floating Convert To Integer Word X-form (fctiw. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTIWZ, 0xfc0007ff, 0xfc00001e, 0x1f0000, // Floating Convert To Integer Word with round toward Zero X-form (fctiwz FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTIWZ_, 0xfc0007ff, 0xfc00001f, 0x1f0000, // Floating Convert To Integer Word with round toward Zero X-form (fctiwz. FRT,FRB) + {FCTIWZCC, 0xfc0007ff, 0xfc00001f, 0x1f0000, // Floating Convert To Integer Word with round toward Zero X-form (fctiwz. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTIWU, 0xfc0007ff, 0xfc00011c, 0x1f0000, // Floating Convert To Integer Word Unsigned X-form (fctiwu FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTIWU_, 0xfc0007ff, 0xfc00011d, 0x1f0000, // Floating Convert To Integer Word Unsigned X-form (fctiwu. FRT,FRB) + {FCTIWUCC, 0xfc0007ff, 0xfc00011d, 0x1f0000, // Floating Convert To Integer Word Unsigned X-form (fctiwu. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCTIWUZ, 0xfc0007ff, 0xfc00011e, 0x1f0000, // Floating Convert To Integer Word Unsigned with round toward Zero X-form (fctiwuz FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCTIWUZ_, 0xfc0007ff, 0xfc00011f, 0x1f0000, // Floating Convert To Integer Word Unsigned with round toward Zero X-form (fctiwuz. FRT,FRB) + {FCTIWUZCC, 0xfc0007ff, 0xfc00011f, 0x1f0000, // Floating Convert To Integer Word Unsigned with round toward Zero X-form (fctiwuz. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCFID, 0xfc0007ff, 0xfc00069c, 0x1f0000, // Floating Convert From Integer Doubleword X-form (fcfid FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCFID_, 0xfc0007ff, 0xfc00069d, 0x1f0000, // Floating Convert From Integer Doubleword X-form (fcfid. FRT,FRB) + {FCFIDCC, 0xfc0007ff, 0xfc00069d, 0x1f0000, // Floating Convert From Integer Doubleword X-form (fcfid. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCFIDU, 0xfc0007ff, 0xfc00079c, 0x1f0000, // Floating Convert From Integer Doubleword Unsigned X-form (fcfidu FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCFIDU_, 0xfc0007ff, 0xfc00079d, 0x1f0000, // Floating Convert From Integer Doubleword Unsigned X-form (fcfidu. FRT,FRB) + {FCFIDUCC, 0xfc0007ff, 0xfc00079d, 0x1f0000, // Floating Convert From Integer Doubleword Unsigned X-form (fcfidu. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCFIDS, 0xfc0007ff, 0xec00069c, 0x1f0000, // Floating Convert From Integer Doubleword Single X-form (fcfids FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCFIDS_, 0xfc0007ff, 0xec00069d, 0x1f0000, // Floating Convert From Integer Doubleword Single X-form (fcfids. FRT,FRB) + {FCFIDSCC, 0xfc0007ff, 0xec00069d, 0x1f0000, // Floating Convert From Integer Doubleword Single X-form (fcfids. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCFIDUS, 0xfc0007ff, 0xec00079c, 0x1f0000, // Floating Convert From Integer Doubleword Unsigned Single X-form (fcfidus FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FCFIDUS_, 0xfc0007ff, 0xec00079d, 0x1f0000, // Floating Convert From Integer Doubleword Unsigned Single X-form (fcfidus. FRT,FRB) + {FCFIDUSCC, 0xfc0007ff, 0xec00079d, 0x1f0000, // Floating Convert From Integer Doubleword Unsigned Single X-form (fcfidus. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRIN, 0xfc0007ff, 0xfc000310, 0x1f0000, // Floating Round to Integer Nearest X-form (frin FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRIN_, 0xfc0007ff, 0xfc000311, 0x1f0000, // Floating Round to Integer Nearest X-form (frin. FRT,FRB) + {FRINCC, 0xfc0007ff, 0xfc000311, 0x1f0000, // Floating Round to Integer Nearest X-form (frin. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRIZ, 0xfc0007ff, 0xfc000350, 0x1f0000, // Floating Round to Integer Toward Zero X-form (friz FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRIZ_, 0xfc0007ff, 0xfc000351, 0x1f0000, // Floating Round to Integer Toward Zero X-form (friz. FRT,FRB) + {FRIZCC, 0xfc0007ff, 0xfc000351, 0x1f0000, // Floating Round to Integer Toward Zero X-form (friz. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRIP, 0xfc0007ff, 0xfc000390, 0x1f0000, // Floating Round to Integer Plus X-form (frip FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRIP_, 0xfc0007ff, 0xfc000391, 0x1f0000, // Floating Round to Integer Plus X-form (frip. FRT,FRB) + {FRIPCC, 0xfc0007ff, 0xfc000391, 0x1f0000, // Floating Round to Integer Plus X-form (frip. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FRIM, 0xfc0007ff, 0xfc0003d0, 0x1f0000, // Floating Round to Integer Minus X-form (frim FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {FRIM_, 0xfc0007ff, 0xfc0003d1, 0x1f0000, // Floating Round to Integer Minus X-form (frim. FRT,FRB) + {FRIMCC, 0xfc0007ff, 0xfc0003d1, 0x1f0000, // Floating Round to Integer Minus X-form (frim. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {FCMPU, 0xfc0007fe, 0xfc000000, 0x600001, // Floating Compare Unordered X-form (fcmpu BF,FRA,FRB) [5]*argField{ap_CondRegField_6_8, ap_FPReg_11_15, ap_FPReg_16_20}}, @@ -3534,29 +3565,29 @@ var instFormats = [...]instFormat{ [5]*argField{ap_CondRegField_6_8, ap_FPReg_11_15, ap_FPReg_16_20}}, {FSEL, 0xfc00003f, 0xfc00002e, 0x0, // Floating Select A-form (fsel FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, - {FSEL_, 0xfc00003f, 0xfc00002f, 0x0, // Floating Select A-form (fsel. FRT,FRA,FRC,FRB) + {FSELCC, 0xfc00003f, 0xfc00002f, 0x0, // Floating Select A-form (fsel. FRT,FRA,FRC,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_21_25, ap_FPReg_16_20}}, {MFFS, 0xfc0007ff, 0xfc00048e, 0x1ff800, // Move From FPSCR X-form (mffs FRT) [5]*argField{ap_FPReg_6_10}}, - {MFFS_, 0xfc0007ff, 0xfc00048f, 0x1ff800, // Move From FPSCR X-form (mffs. FRT) + {MFFSCC, 0xfc0007ff, 0xfc00048f, 0x1ff800, // Move From FPSCR X-form (mffs. FRT) [5]*argField{ap_FPReg_6_10}}, {MCRFS, 0xfc0007fe, 0xfc000080, 0x63f801, // Move to Condition Register from FPSCR X-form (mcrfs BF,BFA) [5]*argField{ap_CondRegField_6_8, ap_CondRegField_11_13}}, {MTFSFI, 0xfc0007ff, 0xfc00010c, 0x7e0800, // Move To FPSCR Field Immediate X-form (mtfsfi BF,U,W) [5]*argField{ap_CondRegField_6_8, ap_ImmUnsigned_16_19, ap_ImmUnsigned_15_15}}, - {MTFSFI_, 0xfc0007ff, 0xfc00010d, 0x7e0800, // Move To FPSCR Field Immediate X-form (mtfsfi. BF,U,W) + {MTFSFICC, 0xfc0007ff, 0xfc00010d, 0x7e0800, // Move To FPSCR Field Immediate X-form (mtfsfi. BF,U,W) [5]*argField{ap_CondRegField_6_8, ap_ImmUnsigned_16_19, ap_ImmUnsigned_15_15}}, {MTFSF, 0xfc0007ff, 0xfc00058e, 0x0, // Move To FPSCR Fields XFL-form (mtfsf FLM,FRB,L,W) [5]*argField{ap_ImmUnsigned_7_14, ap_FPReg_16_20, ap_ImmUnsigned_6_6, ap_ImmUnsigned_15_15}}, - {MTFSF_, 0xfc0007ff, 0xfc00058f, 0x0, // Move To FPSCR Fields XFL-form (mtfsf. FLM,FRB,L,W) + {MTFSFCC, 0xfc0007ff, 0xfc00058f, 0x0, // Move To FPSCR Fields XFL-form (mtfsf. FLM,FRB,L,W) [5]*argField{ap_ImmUnsigned_7_14, ap_FPReg_16_20, ap_ImmUnsigned_6_6, ap_ImmUnsigned_15_15}}, {MTFSB0, 0xfc0007ff, 0xfc00008c, 0x1ff800, // Move To FPSCR Bit 0 X-form (mtfsb0 BT) [5]*argField{ap_CondRegBit_6_10}}, - {MTFSB0_, 0xfc0007ff, 0xfc00008d, 0x1ff800, // Move To FPSCR Bit 0 X-form (mtfsb0. BT) + {MTFSB0CC, 0xfc0007ff, 0xfc00008d, 0x1ff800, // Move To FPSCR Bit 0 X-form (mtfsb0. BT) [5]*argField{ap_CondRegBit_6_10}}, {MTFSB1, 0xfc0007ff, 0xfc00004c, 0x1ff800, // Move To FPSCR Bit 1 X-form (mtfsb1 BT) [5]*argField{ap_CondRegBit_6_10}}, - {MTFSB1_, 0xfc0007ff, 0xfc00004d, 0x1ff800, // Move To FPSCR Bit 1 X-form (mtfsb1. BT) + {MTFSB1CC, 0xfc0007ff, 0xfc00004d, 0x1ff800, // Move To FPSCR Bit 1 X-form (mtfsb1. BT) [5]*argField{ap_CondRegBit_6_10}}, {LVEBX, 0xfc0007fe, 0x7c00000e, 0x1, // Load Vector Element Byte Indexed X-form (lvebx VRT,RA,RB) [5]*argField{ap_VecReg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, @@ -3826,51 +3857,51 @@ var instFormats = [...]instFormat{ [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPEQUB, 0xfc0007ff, 0x10000006, 0x0, // Vector Compare Equal To Unsigned Byte VC-form (vcmpequb VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPEQUB_, 0xfc0007ff, 0x10000406, 0x0, // Vector Compare Equal To Unsigned Byte VC-form (vcmpequb. VRT,VRA,VRB) + {VCMPEQUBCC, 0xfc0007ff, 0x10000406, 0x0, // Vector Compare Equal To Unsigned Byte VC-form (vcmpequb. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPEQUH, 0xfc0007ff, 0x10000046, 0x0, // Vector Compare Equal To Unsigned Halfword VC-form (vcmpequh VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPEQUH_, 0xfc0007ff, 0x10000446, 0x0, // Vector Compare Equal To Unsigned Halfword VC-form (vcmpequh. VRT,VRA,VRB) + {VCMPEQUHCC, 0xfc0007ff, 0x10000446, 0x0, // Vector Compare Equal To Unsigned Halfword VC-form (vcmpequh. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPEQUW, 0xfc0007ff, 0x10000086, 0x0, // Vector Compare Equal To Unsigned Word VC-form (vcmpequw VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPEQUW_, 0xfc0007ff, 0x10000486, 0x0, // Vector Compare Equal To Unsigned Word VC-form (vcmpequw. VRT,VRA,VRB) + {VCMPEQUWCC, 0xfc0007ff, 0x10000486, 0x0, // Vector Compare Equal To Unsigned Word VC-form (vcmpequw. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPEQUD, 0xfc0007ff, 0x100000c7, 0x0, // Vector Compare Equal To Unsigned Doubleword VX-form (vcmpequd VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPEQUD_, 0xfc0007ff, 0x100004c7, 0x0, // Vector Compare Equal To Unsigned Doubleword VX-form (vcmpequd. VRT,VRA,VRB) + {VCMPEQUDCC, 0xfc0007ff, 0x100004c7, 0x0, // Vector Compare Equal To Unsigned Doubleword VX-form (vcmpequd. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTSB, 0xfc0007ff, 0x10000306, 0x0, // Vector Compare Greater Than Signed Byte VC-form (vcmpgtsb VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTSB_, 0xfc0007ff, 0x10000706, 0x0, // Vector Compare Greater Than Signed Byte VC-form (vcmpgtsb. VRT,VRA,VRB) + {VCMPGTSBCC, 0xfc0007ff, 0x10000706, 0x0, // Vector Compare Greater Than Signed Byte VC-form (vcmpgtsb. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTSD, 0xfc0007ff, 0x100003c7, 0x0, // Vector Compare Greater Than Signed Doubleword VX-form (vcmpgtsd VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTSD_, 0xfc0007ff, 0x100007c7, 0x0, // Vector Compare Greater Than Signed Doubleword VX-form (vcmpgtsd. VRT,VRA,VRB) + {VCMPGTSDCC, 0xfc0007ff, 0x100007c7, 0x0, // Vector Compare Greater Than Signed Doubleword VX-form (vcmpgtsd. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTSH, 0xfc0007ff, 0x10000346, 0x0, // Vector Compare Greater Than Signed Halfword VC-form (vcmpgtsh VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTSH_, 0xfc0007ff, 0x10000746, 0x0, // Vector Compare Greater Than Signed Halfword VC-form (vcmpgtsh. VRT,VRA,VRB) + {VCMPGTSHCC, 0xfc0007ff, 0x10000746, 0x0, // Vector Compare Greater Than Signed Halfword VC-form (vcmpgtsh. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTSW, 0xfc0007ff, 0x10000386, 0x0, // Vector Compare Greater Than Signed Word VC-form (vcmpgtsw VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTSW_, 0xfc0007ff, 0x10000786, 0x0, // Vector Compare Greater Than Signed Word VC-form (vcmpgtsw. VRT,VRA,VRB) + {VCMPGTSWCC, 0xfc0007ff, 0x10000786, 0x0, // Vector Compare Greater Than Signed Word VC-form (vcmpgtsw. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTUB, 0xfc0007ff, 0x10000206, 0x0, // Vector Compare Greater Than Unsigned Byte VC-form (vcmpgtub VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTUB_, 0xfc0007ff, 0x10000606, 0x0, // Vector Compare Greater Than Unsigned Byte VC-form (vcmpgtub. VRT,VRA,VRB) + {VCMPGTUBCC, 0xfc0007ff, 0x10000606, 0x0, // Vector Compare Greater Than Unsigned Byte VC-form (vcmpgtub. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTUD, 0xfc0007ff, 0x100002c7, 0x0, // Vector Compare Greater Than Unsigned Doubleword VX-form (vcmpgtud VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTUD_, 0xfc0007ff, 0x100006c7, 0x0, // Vector Compare Greater Than Unsigned Doubleword VX-form (vcmpgtud. VRT,VRA,VRB) + {VCMPGTUDCC, 0xfc0007ff, 0x100006c7, 0x0, // Vector Compare Greater Than Unsigned Doubleword VX-form (vcmpgtud. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTUH, 0xfc0007ff, 0x10000246, 0x0, // Vector Compare Greater Than Unsigned Halfword VC-form (vcmpgtuh VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTUH_, 0xfc0007ff, 0x10000646, 0x0, // Vector Compare Greater Than Unsigned Halfword VC-form (vcmpgtuh. VRT,VRA,VRB) + {VCMPGTUHCC, 0xfc0007ff, 0x10000646, 0x0, // Vector Compare Greater Than Unsigned Halfword VC-form (vcmpgtuh. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTUW, 0xfc0007ff, 0x10000286, 0x0, // Vector Compare Greater Than Unsigned Word VC-form (vcmpgtuw VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTUW_, 0xfc0007ff, 0x10000686, 0x0, // Vector Compare Greater Than Unsigned Word VC-form (vcmpgtuw. VRT,VRA,VRB) + {VCMPGTUWCC, 0xfc0007ff, 0x10000686, 0x0, // Vector Compare Greater Than Unsigned Word VC-form (vcmpgtuw. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VAND, 0xfc0007ff, 0x10000404, 0x0, // Vector Logical AND VX-form (vand VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, @@ -3950,19 +3981,19 @@ var instFormats = [...]instFormat{ [5]*argField{ap_VecReg_6_10, ap_VecReg_16_20}}, {VCMPBFP, 0xfc0007ff, 0x100003c6, 0x0, // Vector Compare Bounds Single-Precision VC-form (vcmpbfp VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPBFP_, 0xfc0007ff, 0x100007c6, 0x0, // Vector Compare Bounds Single-Precision VC-form (vcmpbfp. VRT,VRA,VRB) + {VCMPBFPCC, 0xfc0007ff, 0x100007c6, 0x0, // Vector Compare Bounds Single-Precision VC-form (vcmpbfp. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPEQFP, 0xfc0007ff, 0x100000c6, 0x0, // Vector Compare Equal To Single-Precision VC-form (vcmpeqfp VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPEQFP_, 0xfc0007ff, 0x100004c6, 0x0, // Vector Compare Equal To Single-Precision VC-form (vcmpeqfp. VRT,VRA,VRB) + {VCMPEQFPCC, 0xfc0007ff, 0x100004c6, 0x0, // Vector Compare Equal To Single-Precision VC-form (vcmpeqfp. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGEFP, 0xfc0007ff, 0x100001c6, 0x0, // Vector Compare Greater Than or Equal To Single-Precision VC-form (vcmpgefp VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGEFP_, 0xfc0007ff, 0x100005c6, 0x0, // Vector Compare Greater Than or Equal To Single-Precision VC-form (vcmpgefp. VRT,VRA,VRB) + {VCMPGEFPCC, 0xfc0007ff, 0x100005c6, 0x0, // Vector Compare Greater Than or Equal To Single-Precision VC-form (vcmpgefp. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VCMPGTFP, 0xfc0007ff, 0x100002c6, 0x0, // Vector Compare Greater Than Single-Precision VC-form (vcmpgtfp VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {VCMPGTFP_, 0xfc0007ff, 0x100006c6, 0x0, // Vector Compare Greater Than Single-Precision VC-form (vcmpgtfp. VRT,VRA,VRB) + {VCMPGTFPCC, 0xfc0007ff, 0x100006c6, 0x0, // Vector Compare Greater Than Single-Precision VC-form (vcmpgtfp. VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, {VEXPTEFP, 0xfc0007ff, 0x1000018a, 0x1f0000, // Vector 2 Raised to the Exponent Estimate Floating-Point VX-form (vexptefp VRT,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_16_20}}, @@ -4016,9 +4047,9 @@ var instFormats = [...]instFormat{ [5]*argField{ap_VecReg_6_10, ap_VecReg_16_20}}, {VBPERMQ, 0xfc0007ff, 0x1000054c, 0x0, // Vector Bit Permute Quadword VX-form (vbpermq VRT,VRA,VRB) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20}}, - {BCDADD_, 0xfc0005ff, 0x10000401, 0x0, // Decimal Add Modulo VX-form (bcdadd. VRT,VRA,VRB,PS) + {BCDADDCC, 0xfc0005ff, 0x10000401, 0x0, // Decimal Add Modulo VX-form (bcdadd. VRT,VRA,VRB,PS) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20, ap_ImmUnsigned_22_22}}, - {BCDSUB_, 0xfc0005ff, 0x10000441, 0x0, // Decimal Subtract Modulo VX-form (bcdsub. VRT,VRA,VRB,PS) + {BCDSUBCC, 0xfc0005ff, 0x10000441, 0x0, // Decimal Subtract Modulo VX-form (bcdsub. VRT,VRA,VRB,PS) [5]*argField{ap_VecReg_6_10, ap_VecReg_11_15, ap_VecReg_16_20, ap_ImmUnsigned_22_22}}, {MTVSCR, 0xfc0007ff, 0x10000644, 0x3ff0000, // Move To Vector Status and Control Register VX-form (mtvscr VRB) [5]*argField{ap_VecReg_16_20}}, @@ -4026,19 +4057,19 @@ var instFormats = [...]instFormat{ [5]*argField{ap_VecReg_6_10}}, {DADD, 0xfc0007ff, 0xec000004, 0x0, // DFP Add [Quad] X-form (dadd FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {DADD_, 0xfc0007ff, 0xec000005, 0x0, // DFP Add [Quad] X-form (dadd. FRT,FRA,FRB) + {DADDCC, 0xfc0007ff, 0xec000005, 0x0, // DFP Add [Quad] X-form (dadd. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {DSUB, 0xfc0007ff, 0xec000404, 0x0, // DFP Subtract [Quad] X-form (dsub FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {DSUB_, 0xfc0007ff, 0xec000405, 0x0, // DFP Subtract [Quad] X-form (dsub. FRT,FRA,FRB) + {DSUBCC, 0xfc0007ff, 0xec000405, 0x0, // DFP Subtract [Quad] X-form (dsub. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {DMUL, 0xfc0007ff, 0xec000044, 0x0, // DFP Multiply [Quad] X-form (dmul FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {DMUL_, 0xfc0007ff, 0xec000045, 0x0, // DFP Multiply [Quad] X-form (dmul. FRT,FRA,FRB) + {DMULCC, 0xfc0007ff, 0xec000045, 0x0, // DFP Multiply [Quad] X-form (dmul. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {DDIV, 0xfc0007ff, 0xec000444, 0x0, // DFP Divide [Quad] X-form (ddiv FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {DDIV_, 0xfc0007ff, 0xec000445, 0x0, // DFP Divide [Quad] X-form (ddiv. FRT,FRA,FRB) + {DDIVCC, 0xfc0007ff, 0xec000445, 0x0, // DFP Divide [Quad] X-form (ddiv. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {DCMPU, 0xfc0007fe, 0xec000504, 0x600001, // DFP Compare Unordered [Quad] X-form (dcmpu BF,FRA,FRB) [5]*argField{ap_CondRegField_6_8, ap_FPReg_11_15, ap_FPReg_16_20}}, @@ -4054,75 +4085,75 @@ var instFormats = [...]instFormat{ [5]*argField{ap_CondRegField_6_8, ap_FPReg_11_15, ap_FPReg_16_20}}, {DQUAI, 0xfc0001ff, 0xec000086, 0x0, // DFP Quantize Immediate [Quad] Z23-form (dquai TE,FRT,FRB,RMC) [5]*argField{ap_ImmSigned_11_15, ap_FPReg_6_10, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, - {DQUAI_, 0xfc0001ff, 0xec000087, 0x0, // DFP Quantize Immediate [Quad] Z23-form (dquai. TE,FRT,FRB,RMC) + {DQUAICC, 0xfc0001ff, 0xec000087, 0x0, // DFP Quantize Immediate [Quad] Z23-form (dquai. TE,FRT,FRB,RMC) [5]*argField{ap_ImmSigned_11_15, ap_FPReg_6_10, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, {DQUA, 0xfc0001ff, 0xec000006, 0x0, // DFP Quantize [Quad] Z23-form (dqua FRT,FRA,FRB,RMC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, - {DQUA_, 0xfc0001ff, 0xec000007, 0x0, // DFP Quantize [Quad] Z23-form (dqua. FRT,FRA,FRB,RMC) + {DQUACC, 0xfc0001ff, 0xec000007, 0x0, // DFP Quantize [Quad] Z23-form (dqua. FRT,FRA,FRB,RMC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, {DRRND, 0xfc0001ff, 0xec000046, 0x0, // DFP Reround [Quad] Z23-form (drrnd FRT,FRA,FRB,RMC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, - {DRRND_, 0xfc0001ff, 0xec000047, 0x0, // DFP Reround [Quad] Z23-form (drrnd. FRT,FRA,FRB,RMC) + {DRRNDCC, 0xfc0001ff, 0xec000047, 0x0, // DFP Reround [Quad] Z23-form (drrnd. FRT,FRA,FRB,RMC) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, {DRINTX, 0xfc0001ff, 0xec0000c6, 0x1e0000, // DFP Round To FP Integer With Inexact [Quad] Z23-form (drintx R,FRT,FRB,RMC) [5]*argField{ap_ImmUnsigned_15_15, ap_FPReg_6_10, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, - {DRINTX_, 0xfc0001ff, 0xec0000c7, 0x1e0000, // DFP Round To FP Integer With Inexact [Quad] Z23-form (drintx. R,FRT,FRB,RMC) + {DRINTXCC, 0xfc0001ff, 0xec0000c7, 0x1e0000, // DFP Round To FP Integer With Inexact [Quad] Z23-form (drintx. R,FRT,FRB,RMC) [5]*argField{ap_ImmUnsigned_15_15, ap_FPReg_6_10, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, {DRINTN, 0xfc0001ff, 0xec0001c6, 0x1e0000, // DFP Round To FP Integer Without Inexact [Quad] Z23-form (drintn R,FRT,FRB,RMC) [5]*argField{ap_ImmUnsigned_15_15, ap_FPReg_6_10, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, - {DRINTN_, 0xfc0001ff, 0xec0001c7, 0x1e0000, // DFP Round To FP Integer Without Inexact [Quad] Z23-form (drintn. R,FRT,FRB,RMC) + {DRINTNCC, 0xfc0001ff, 0xec0001c7, 0x1e0000, // DFP Round To FP Integer Without Inexact [Quad] Z23-form (drintn. R,FRT,FRB,RMC) [5]*argField{ap_ImmUnsigned_15_15, ap_FPReg_6_10, ap_FPReg_16_20, ap_ImmUnsigned_21_22}}, {DCTDP, 0xfc0007ff, 0xec000204, 0x1f0000, // DFP Convert To DFP Long X-form (dctdp FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DCTDP_, 0xfc0007ff, 0xec000205, 0x1f0000, // DFP Convert To DFP Long X-form (dctdp. FRT,FRB) + {DCTDPCC, 0xfc0007ff, 0xec000205, 0x1f0000, // DFP Convert To DFP Long X-form (dctdp. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DCTQPQ, 0xfc0007ff, 0xfc000204, 0x1f0000, // DFP Convert To DFP Extended X-form (dctqpq FRTp,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DCTQPQ_, 0xfc0007ff, 0xfc000205, 0x1f0000, // DFP Convert To DFP Extended X-form (dctqpq. FRTp,FRB) + {DCTQPQCC, 0xfc0007ff, 0xfc000205, 0x1f0000, // DFP Convert To DFP Extended X-form (dctqpq. FRTp,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DRSP, 0xfc0007ff, 0xec000604, 0x1f0000, // DFP Round To DFP Short X-form (drsp FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DRSP_, 0xfc0007ff, 0xec000605, 0x1f0000, // DFP Round To DFP Short X-form (drsp. FRT,FRB) + {DRSPCC, 0xfc0007ff, 0xec000605, 0x1f0000, // DFP Round To DFP Short X-form (drsp. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DRDPQ, 0xfc0007ff, 0xfc000604, 0x1f0000, // DFP Round To DFP Long X-form (drdpq FRTp,FRBp) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DRDPQ_, 0xfc0007ff, 0xfc000605, 0x1f0000, // DFP Round To DFP Long X-form (drdpq. FRTp,FRBp) + {DRDPQCC, 0xfc0007ff, 0xfc000605, 0x1f0000, // DFP Round To DFP Long X-form (drdpq. FRTp,FRBp) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DCFFIX, 0xfc0007ff, 0xec000644, 0x1f0000, // DFP Convert From Fixed X-form (dcffix FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DCFFIX_, 0xfc0007ff, 0xec000645, 0x1f0000, // DFP Convert From Fixed X-form (dcffix. FRT,FRB) + {DCFFIXCC, 0xfc0007ff, 0xec000645, 0x1f0000, // DFP Convert From Fixed X-form (dcffix. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DCFFIXQ, 0xfc0007ff, 0xfc000644, 0x1f0000, // DFP Convert From Fixed Quad X-form (dcffixq FRTp,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DCFFIXQ_, 0xfc0007ff, 0xfc000645, 0x1f0000, // DFP Convert From Fixed Quad X-form (dcffixq. FRTp,FRB) + {DCFFIXQCC, 0xfc0007ff, 0xfc000645, 0x1f0000, // DFP Convert From Fixed Quad X-form (dcffixq. FRTp,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DCTFIX, 0xfc0007ff, 0xec000244, 0x1f0000, // DFP Convert To Fixed [Quad] X-form (dctfix FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DCTFIX_, 0xfc0007ff, 0xec000245, 0x1f0000, // DFP Convert To Fixed [Quad] X-form (dctfix. FRT,FRB) + {DCTFIXCC, 0xfc0007ff, 0xec000245, 0x1f0000, // DFP Convert To Fixed [Quad] X-form (dctfix. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DDEDPD, 0xfc0007ff, 0xec000284, 0x70000, // DFP Decode DPD To BCD [Quad] X-form (ddedpd SP,FRT,FRB) [5]*argField{ap_ImmUnsigned_11_12, ap_FPReg_6_10, ap_FPReg_16_20}}, - {DDEDPD_, 0xfc0007ff, 0xec000285, 0x70000, // DFP Decode DPD To BCD [Quad] X-form (ddedpd. SP,FRT,FRB) + {DDEDPDCC, 0xfc0007ff, 0xec000285, 0x70000, // DFP Decode DPD To BCD [Quad] X-form (ddedpd. SP,FRT,FRB) [5]*argField{ap_ImmUnsigned_11_12, ap_FPReg_6_10, ap_FPReg_16_20}}, {DENBCD, 0xfc0007ff, 0xec000684, 0xf0000, // DFP Encode BCD To DPD [Quad] X-form (denbcd S,FRT,FRB) [5]*argField{ap_ImmUnsigned_11_11, ap_FPReg_6_10, ap_FPReg_16_20}}, - {DENBCD_, 0xfc0007ff, 0xec000685, 0xf0000, // DFP Encode BCD To DPD [Quad] X-form (denbcd. S,FRT,FRB) + {DENBCDCC, 0xfc0007ff, 0xec000685, 0xf0000, // DFP Encode BCD To DPD [Quad] X-form (denbcd. S,FRT,FRB) [5]*argField{ap_ImmUnsigned_11_11, ap_FPReg_6_10, ap_FPReg_16_20}}, {DXEX, 0xfc0007ff, 0xec0002c4, 0x1f0000, // DFP Extract Biased Exponent [Quad] X-form (dxex FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, - {DXEX_, 0xfc0007ff, 0xec0002c5, 0x1f0000, // DFP Extract Biased Exponent [Quad] X-form (dxex. FRT,FRB) + {DXEXCC, 0xfc0007ff, 0xec0002c5, 0x1f0000, // DFP Extract Biased Exponent [Quad] X-form (dxex. FRT,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_16_20}}, {DIEX, 0xfc0007ff, 0xec0006c4, 0x0, // DFP Insert Biased Exponent [Quad] X-form (diex FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, - {DIEX_, 0xfc0007ff, 0xec0006c5, 0x0, // DFP Insert Biased Exponent [Quad] X-form (diex. FRT,FRA,FRB) + {DIEXCC, 0xfc0007ff, 0xec0006c5, 0x0, // DFP Insert Biased Exponent [Quad] X-form (diex. FRT,FRA,FRB) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_FPReg_16_20}}, {DSCLI, 0xfc0003ff, 0xec000084, 0x0, // DFP Shift Significand Left Immediate [Quad] Z22-form (dscli FRT,FRA,SH) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_ImmUnsigned_16_21}}, - {DSCLI_, 0xfc0003ff, 0xec000085, 0x0, // DFP Shift Significand Left Immediate [Quad] Z22-form (dscli. FRT,FRA,SH) + {DSCLICC, 0xfc0003ff, 0xec000085, 0x0, // DFP Shift Significand Left Immediate [Quad] Z22-form (dscli. FRT,FRA,SH) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_ImmUnsigned_16_21}}, {DSCRI, 0xfc0003ff, 0xec0000c4, 0x0, // DFP Shift Significand Right Immediate [Quad] Z22-form (dscri FRT,FRA,SH) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_ImmUnsigned_16_21}}, - {DSCRI_, 0xfc0003ff, 0xec0000c5, 0x0, // DFP Shift Significand Right Immediate [Quad] Z22-form (dscri. FRT,FRA,SH) + {DSCRICC, 0xfc0003ff, 0xec0000c5, 0x0, // DFP Shift Significand Right Immediate [Quad] Z22-form (dscri. FRT,FRA,SH) [5]*argField{ap_FPReg_6_10, ap_FPReg_11_15, ap_ImmUnsigned_16_21}}, {LXSDX, 0xfc0007fe, 0x7c000498, 0x0, // Load VSX Scalar Doubleword Indexed XX1-form (lxsdx XT,RA,RB) [5]*argField{ap_VecSReg_31_31_6_10, ap_Reg_11_15, ap_Reg_16_20}}, @@ -4258,27 +4289,27 @@ var instFormats = [...]instFormat{ [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, {XVCMPEQDP, 0xfc0007f8, 0xf0000318, 0x0, // VSX Vector Compare Equal To Double-Precision [ & Record ] XX3-form (xvcmpeqdp XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, - {XVCMPEQDP_, 0xfc0007f8, 0xf0000718, 0x0, // VSX Vector Compare Equal To Double-Precision [ & Record ] XX3-form (xvcmpeqdp. XT,XA,XB) + {XVCMPEQDPCC, 0xfc0007f8, 0xf0000718, 0x0, // VSX Vector Compare Equal To Double-Precision [ & Record ] XX3-form (xvcmpeqdp. XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, {XVCMPEQSP, 0xfc0007f8, 0xf0000218, 0x0, // VSX Vector Compare Equal To Single-Precision [ & Record ] XX3-form (xvcmpeqsp XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, - {XVCMPEQSP_, 0xfc0007f8, 0xf0000618, 0x0, // VSX Vector Compare Equal To Single-Precision [ & Record ] XX3-form (xvcmpeqsp. XT,XA,XB) + {XVCMPEQSPCC, 0xfc0007f8, 0xf0000618, 0x0, // VSX Vector Compare Equal To Single-Precision [ & Record ] XX3-form (xvcmpeqsp. XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, {XVCMPGEDP, 0xfc0007f8, 0xf0000398, 0x0, // VSX Vector Compare Greater Than or Equal To Double-Precision [ & Record ] XX3-form (xvcmpgedp XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, - {XVCMPGEDP_, 0xfc0007f8, 0xf0000798, 0x0, // VSX Vector Compare Greater Than or Equal To Double-Precision [ & Record ] XX3-form (xvcmpgedp. XT,XA,XB) + {XVCMPGEDPCC, 0xfc0007f8, 0xf0000798, 0x0, // VSX Vector Compare Greater Than or Equal To Double-Precision [ & Record ] XX3-form (xvcmpgedp. XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, {XVCMPGESP, 0xfc0007f8, 0xf0000298, 0x0, // VSX Vector Compare Greater Than or Equal To Single-Precision [ & record CR6 ] XX3-form (xvcmpgesp XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, - {XVCMPGESP_, 0xfc0007f8, 0xf0000698, 0x0, // VSX Vector Compare Greater Than or Equal To Single-Precision [ & record CR6 ] XX3-form (xvcmpgesp. XT,XA,XB) + {XVCMPGESPCC, 0xfc0007f8, 0xf0000698, 0x0, // VSX Vector Compare Greater Than or Equal To Single-Precision [ & record CR6 ] XX3-form (xvcmpgesp. XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, {XVCMPGTDP, 0xfc0007f8, 0xf0000358, 0x0, // VSX Vector Compare Greater Than Double-Precision [ & record CR6 ] XX3-form (xvcmpgtdp XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, - {XVCMPGTDP_, 0xfc0007f8, 0xf0000758, 0x0, // VSX Vector Compare Greater Than Double-Precision [ & record CR6 ] XX3-form (xvcmpgtdp. XT,XA,XB) + {XVCMPGTDPCC, 0xfc0007f8, 0xf0000758, 0x0, // VSX Vector Compare Greater Than Double-Precision [ & record CR6 ] XX3-form (xvcmpgtdp. XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, {XVCMPGTSP, 0xfc0007f8, 0xf0000258, 0x0, // VSX Vector Compare Greater Than Single-Precision [ & record CR6 ] XX3-form (xvcmpgtsp XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, - {XVCMPGTSP_, 0xfc0007f8, 0xf0000658, 0x0, // VSX Vector Compare Greater Than Single-Precision [ & record CR6 ] XX3-form (xvcmpgtsp. XT,XA,XB) + {XVCMPGTSPCC, 0xfc0007f8, 0xf0000658, 0x0, // VSX Vector Compare Greater Than Single-Precision [ & record CR6 ] XX3-form (xvcmpgtsp. XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, {XVCPSGNDP, 0xfc0007f8, 0xf0000780, 0x0, // VSX Vector Copy Sign Double-Precision XX3-form (xvcpsgndp XT,XA,XB) [5]*argField{ap_VecSReg_31_31_6_10, ap_VecSReg_29_29_11_15, ap_VecSReg_30_30_16_20}}, @@ -4930,175 +4961,175 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_6_10, ap_Reg_16_20}}, {DLMZB, 0xfc0007ff, 0x7c00009c, 0x0, // Determine Leftmost Zero Byte X-form (dlmzb RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, - {DLMZB_, 0xfc0007ff, 0x7c00009d, 0x0, // Determine Leftmost Zero Byte X-form (dlmzb. RA,RS,RB) + {DLMZBCC, 0xfc0007ff, 0x7c00009d, 0x0, // Determine Leftmost Zero Byte X-form (dlmzb. RA,RS,RB) [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, {MACCHW, 0xfc0007ff, 0x10000158, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (macchw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHW_, 0xfc0007ff, 0x10000159, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (macchw. RT,RA,RB) + {MACCHWCC, 0xfc0007ff, 0x10000159, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (macchw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACCHWO, 0xfc0007ff, 0x10000558, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (macchwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHWO_, 0xfc0007ff, 0x10000559, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (macchwo. RT,RA,RB) + {MACCHWOCC, 0xfc0007ff, 0x10000559, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (macchwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACCHWS, 0xfc0007ff, 0x100001d8, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (macchws RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHWS_, 0xfc0007ff, 0x100001d9, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (macchws. RT,RA,RB) + {MACCHWSCC, 0xfc0007ff, 0x100001d9, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (macchws. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACCHWSO, 0xfc0007ff, 0x100005d8, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (macchwso RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHWSO_, 0xfc0007ff, 0x100005d9, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (macchwso. RT,RA,RB) + {MACCHWSOCC, 0xfc0007ff, 0x100005d9, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (macchwso. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACCHWU, 0xfc0007ff, 0x10000118, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Unsigned XO-form (macchwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHWU_, 0xfc0007ff, 0x10000119, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Unsigned XO-form (macchwu. RT,RA,RB) + {MACCHWUCC, 0xfc0007ff, 0x10000119, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Unsigned XO-form (macchwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACCHWUO, 0xfc0007ff, 0x10000518, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Unsigned XO-form (macchwuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHWUO_, 0xfc0007ff, 0x10000519, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Unsigned XO-form (macchwuo. RT,RA,RB) + {MACCHWUOCC, 0xfc0007ff, 0x10000519, 0x0, // Multiply Accumulate Cross Halfword to Word Modulo Unsigned XO-form (macchwuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACCHWSU, 0xfc0007ff, 0x10000198, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Unsigned XO-form (macchwsu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHWSU_, 0xfc0007ff, 0x10000199, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Unsigned XO-form (macchwsu. RT,RA,RB) + {MACCHWSUCC, 0xfc0007ff, 0x10000199, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Unsigned XO-form (macchwsu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACCHWSUO, 0xfc0007ff, 0x10000598, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Unsigned XO-form (macchwsuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACCHWSUO_, 0xfc0007ff, 0x10000599, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Unsigned XO-form (macchwsuo. RT,RA,RB) + {MACCHWSUOCC, 0xfc0007ff, 0x10000599, 0x0, // Multiply Accumulate Cross Halfword to Word Saturate Unsigned XO-form (macchwsuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHW, 0xfc0007ff, 0x10000058, 0x0, // Multiply Accumulate High Halfword to Word Modulo Signed XO-form (machhw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHW_, 0xfc0007ff, 0x10000059, 0x0, // Multiply Accumulate High Halfword to Word Modulo Signed XO-form (machhw. RT,RA,RB) + {MACHHWCC, 0xfc0007ff, 0x10000059, 0x0, // Multiply Accumulate High Halfword to Word Modulo Signed XO-form (machhw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHWO, 0xfc0007ff, 0x10000458, 0x0, // Multiply Accumulate High Halfword to Word Modulo Signed XO-form (machhwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHWO_, 0xfc0007ff, 0x10000459, 0x0, // Multiply Accumulate High Halfword to Word Modulo Signed XO-form (machhwo. RT,RA,RB) + {MACHHWOCC, 0xfc0007ff, 0x10000459, 0x0, // Multiply Accumulate High Halfword to Word Modulo Signed XO-form (machhwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHWS, 0xfc0007ff, 0x100000d8, 0x0, // Multiply Accumulate High Halfword to Word Saturate Signed XO-form (machhws RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHWS_, 0xfc0007ff, 0x100000d9, 0x0, // Multiply Accumulate High Halfword to Word Saturate Signed XO-form (machhws. RT,RA,RB) + {MACHHWSCC, 0xfc0007ff, 0x100000d9, 0x0, // Multiply Accumulate High Halfword to Word Saturate Signed XO-form (machhws. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHWSO, 0xfc0007ff, 0x100004d8, 0x0, // Multiply Accumulate High Halfword to Word Saturate Signed XO-form (machhwso RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHWSO_, 0xfc0007ff, 0x100004d9, 0x0, // Multiply Accumulate High Halfword to Word Saturate Signed XO-form (machhwso. RT,RA,RB) + {MACHHWSOCC, 0xfc0007ff, 0x100004d9, 0x0, // Multiply Accumulate High Halfword to Word Saturate Signed XO-form (machhwso. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHWU, 0xfc0007ff, 0x10000018, 0x0, // Multiply Accumulate High Halfword to Word Modulo Unsigned XO-form (machhwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHWU_, 0xfc0007ff, 0x10000019, 0x0, // Multiply Accumulate High Halfword to Word Modulo Unsigned XO-form (machhwu. RT,RA,RB) + {MACHHWUCC, 0xfc0007ff, 0x10000019, 0x0, // Multiply Accumulate High Halfword to Word Modulo Unsigned XO-form (machhwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHWUO, 0xfc0007ff, 0x10000418, 0x0, // Multiply Accumulate High Halfword to Word Modulo Unsigned XO-form (machhwuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHWUO_, 0xfc0007ff, 0x10000419, 0x0, // Multiply Accumulate High Halfword to Word Modulo Unsigned XO-form (machhwuo. RT,RA,RB) + {MACHHWUOCC, 0xfc0007ff, 0x10000419, 0x0, // Multiply Accumulate High Halfword to Word Modulo Unsigned XO-form (machhwuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHWSU, 0xfc0007ff, 0x10000098, 0x0, // Multiply Accumulate High Halfword to Word Saturate Unsigned XO-form (machhwsu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHWSU_, 0xfc0007ff, 0x10000099, 0x0, // Multiply Accumulate High Halfword to Word Saturate Unsigned XO-form (machhwsu. RT,RA,RB) + {MACHHWSUCC, 0xfc0007ff, 0x10000099, 0x0, // Multiply Accumulate High Halfword to Word Saturate Unsigned XO-form (machhwsu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACHHWSUO, 0xfc0007ff, 0x10000498, 0x0, // Multiply Accumulate High Halfword to Word Saturate Unsigned XO-form (machhwsuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACHHWSUO_, 0xfc0007ff, 0x10000499, 0x0, // Multiply Accumulate High Halfword to Word Saturate Unsigned XO-form (machhwsuo. RT,RA,RB) + {MACHHWSUOCC, 0xfc0007ff, 0x10000499, 0x0, // Multiply Accumulate High Halfword to Word Saturate Unsigned XO-form (machhwsuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHW, 0xfc0007ff, 0x10000358, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (maclhw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHW_, 0xfc0007ff, 0x10000359, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (maclhw. RT,RA,RB) + {MACLHWCC, 0xfc0007ff, 0x10000359, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (maclhw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHWO, 0xfc0007ff, 0x10000758, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (maclhwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHWO_, 0xfc0007ff, 0x10000759, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (maclhwo. RT,RA,RB) + {MACLHWOCC, 0xfc0007ff, 0x10000759, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (maclhwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHWS, 0xfc0007ff, 0x100003d8, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (maclhws RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHWS_, 0xfc0007ff, 0x100003d9, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (maclhws. RT,RA,RB) + {MACLHWSCC, 0xfc0007ff, 0x100003d9, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (maclhws. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHWSO, 0xfc0007ff, 0x100007d8, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (maclhwso RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHWSO_, 0xfc0007ff, 0x100007d9, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (maclhwso. RT,RA,RB) + {MACLHWSOCC, 0xfc0007ff, 0x100007d9, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (maclhwso. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHWU, 0xfc0007ff, 0x10000318, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Unsigned XO-form (maclhwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHWU_, 0xfc0007ff, 0x10000319, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Unsigned XO-form (maclhwu. RT,RA,RB) + {MACLHWUCC, 0xfc0007ff, 0x10000319, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Unsigned XO-form (maclhwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHWUO, 0xfc0007ff, 0x10000718, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Unsigned XO-form (maclhwuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHWUO_, 0xfc0007ff, 0x10000719, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Unsigned XO-form (maclhwuo. RT,RA,RB) + {MACLHWUOCC, 0xfc0007ff, 0x10000719, 0x0, // Multiply Accumulate Low Halfword to Word Modulo Unsigned XO-form (maclhwuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULCHW, 0xfc0007ff, 0x10000150, 0x0, // Multiply Cross Halfword to Word Signed X-form (mulchw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULCHW_, 0xfc0007ff, 0x10000151, 0x0, // Multiply Cross Halfword to Word Signed X-form (mulchw. RT,RA,RB) + {MULCHWCC, 0xfc0007ff, 0x10000151, 0x0, // Multiply Cross Halfword to Word Signed X-form (mulchw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHWSU, 0xfc0007ff, 0x10000398, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Unsigned XO-form (maclhwsu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHWSU_, 0xfc0007ff, 0x10000399, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Unsigned XO-form (maclhwsu. RT,RA,RB) + {MACLHWSUCC, 0xfc0007ff, 0x10000399, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Unsigned XO-form (maclhwsu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MACLHWSUO, 0xfc0007ff, 0x10000798, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Unsigned XO-form (maclhwsuo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MACLHWSUO_, 0xfc0007ff, 0x10000799, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Unsigned XO-form (maclhwsuo. RT,RA,RB) + {MACLHWSUOCC, 0xfc0007ff, 0x10000799, 0x0, // Multiply Accumulate Low Halfword to Word Saturate Unsigned XO-form (maclhwsuo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULCHWU, 0xfc0007ff, 0x10000110, 0x0, // Multiply Cross Halfword to Word Unsigned X-form (mulchwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULCHWU_, 0xfc0007ff, 0x10000111, 0x0, // Multiply Cross Halfword to Word Unsigned X-form (mulchwu. RT,RA,RB) + {MULCHWUCC, 0xfc0007ff, 0x10000111, 0x0, // Multiply Cross Halfword to Word Unsigned X-form (mulchwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULHHW, 0xfc0007ff, 0x10000050, 0x0, // Multiply High Halfword to Word Signed X-form (mulhhw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULHHW_, 0xfc0007ff, 0x10000051, 0x0, // Multiply High Halfword to Word Signed X-form (mulhhw. RT,RA,RB) + {MULHHWCC, 0xfc0007ff, 0x10000051, 0x0, // Multiply High Halfword to Word Signed X-form (mulhhw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULLHW, 0xfc0007ff, 0x10000350, 0x0, // Multiply Low Halfword to Word Signed X-form (mullhw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULLHW_, 0xfc0007ff, 0x10000351, 0x0, // Multiply Low Halfword to Word Signed X-form (mullhw. RT,RA,RB) + {MULLHWCC, 0xfc0007ff, 0x10000351, 0x0, // Multiply Low Halfword to Word Signed X-form (mullhw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULHHWU, 0xfc0007ff, 0x10000010, 0x0, // Multiply High Halfword to Word Unsigned X-form (mulhhwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULHHWU_, 0xfc0007ff, 0x10000011, 0x0, // Multiply High Halfword to Word Unsigned X-form (mulhhwu. RT,RA,RB) + {MULHHWUCC, 0xfc0007ff, 0x10000011, 0x0, // Multiply High Halfword to Word Unsigned X-form (mulhhwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {MULLHWU, 0xfc0007ff, 0x10000310, 0x0, // Multiply Low Halfword to Word Unsigned X-form (mullhwu RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {MULLHWU_, 0xfc0007ff, 0x10000311, 0x0, // Multiply Low Halfword to Word Unsigned X-form (mullhwu. RT,RA,RB) + {MULLHWUCC, 0xfc0007ff, 0x10000311, 0x0, // Multiply Low Halfword to Word Unsigned X-form (mullhwu. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACCHW, 0xfc0007ff, 0x1000015c, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (nmacchw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACCHW_, 0xfc0007ff, 0x1000015d, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (nmacchw. RT,RA,RB) + {NMACCHWCC, 0xfc0007ff, 0x1000015d, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (nmacchw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACCHWO, 0xfc0007ff, 0x1000055c, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (nmacchwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACCHWO_, 0xfc0007ff, 0x1000055d, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (nmacchwo. RT,RA,RB) + {NMACCHWOCC, 0xfc0007ff, 0x1000055d, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Modulo Signed XO-form (nmacchwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACCHWS, 0xfc0007ff, 0x100001dc, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (nmacchws RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACCHWS_, 0xfc0007ff, 0x100001dd, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (nmacchws. RT,RA,RB) + {NMACCHWSCC, 0xfc0007ff, 0x100001dd, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (nmacchws. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACCHWSO, 0xfc0007ff, 0x100005dc, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (nmacchwso RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACCHWSO_, 0xfc0007ff, 0x100005dd, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (nmacchwso. RT,RA,RB) + {NMACCHWSOCC, 0xfc0007ff, 0x100005dd, 0x0, // Negative Multiply Accumulate Cross Halfword to Word Saturate Signed XO-form (nmacchwso. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACHHW, 0xfc0007ff, 0x1000005c, 0x0, // Negative Multiply Accumulate High Halfword to Word Modulo Signed XO-form (nmachhw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACHHW_, 0xfc0007ff, 0x1000005d, 0x0, // Negative Multiply Accumulate High Halfword to Word Modulo Signed XO-form (nmachhw. RT,RA,RB) + {NMACHHWCC, 0xfc0007ff, 0x1000005d, 0x0, // Negative Multiply Accumulate High Halfword to Word Modulo Signed XO-form (nmachhw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACHHWO, 0xfc0007ff, 0x1000045c, 0x0, // Negative Multiply Accumulate High Halfword to Word Modulo Signed XO-form (nmachhwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACHHWO_, 0xfc0007ff, 0x1000045d, 0x0, // Negative Multiply Accumulate High Halfword to Word Modulo Signed XO-form (nmachhwo. RT,RA,RB) + {NMACHHWOCC, 0xfc0007ff, 0x1000045d, 0x0, // Negative Multiply Accumulate High Halfword to Word Modulo Signed XO-form (nmachhwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACHHWS, 0xfc0007ff, 0x100000dc, 0x0, // Negative Multiply Accumulate High Halfword to Word Saturate Signed XO-form (nmachhws RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACHHWS_, 0xfc0007ff, 0x100000dd, 0x0, // Negative Multiply Accumulate High Halfword to Word Saturate Signed XO-form (nmachhws. RT,RA,RB) + {NMACHHWSCC, 0xfc0007ff, 0x100000dd, 0x0, // Negative Multiply Accumulate High Halfword to Word Saturate Signed XO-form (nmachhws. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACHHWSO, 0xfc0007ff, 0x100004dc, 0x0, // Negative Multiply Accumulate High Halfword to Word Saturate Signed XO-form (nmachhwso RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACHHWSO_, 0xfc0007ff, 0x100004dd, 0x0, // Negative Multiply Accumulate High Halfword to Word Saturate Signed XO-form (nmachhwso. RT,RA,RB) + {NMACHHWSOCC, 0xfc0007ff, 0x100004dd, 0x0, // Negative Multiply Accumulate High Halfword to Word Saturate Signed XO-form (nmachhwso. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACLHW, 0xfc0007ff, 0x1000035c, 0x0, // Negative Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (nmaclhw RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACLHW_, 0xfc0007ff, 0x1000035d, 0x0, // Negative Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (nmaclhw. RT,RA,RB) + {NMACLHWCC, 0xfc0007ff, 0x1000035d, 0x0, // Negative Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (nmaclhw. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACLHWO, 0xfc0007ff, 0x1000075c, 0x0, // Negative Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (nmaclhwo RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACLHWO_, 0xfc0007ff, 0x1000075d, 0x0, // Negative Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (nmaclhwo. RT,RA,RB) + {NMACLHWOCC, 0xfc0007ff, 0x1000075d, 0x0, // Negative Multiply Accumulate Low Halfword to Word Modulo Signed XO-form (nmaclhwo. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACLHWS, 0xfc0007ff, 0x100003dc, 0x0, // Negative Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (nmaclhws RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACLHWS_, 0xfc0007ff, 0x100003dd, 0x0, // Negative Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (nmaclhws. RT,RA,RB) + {NMACLHWSCC, 0xfc0007ff, 0x100003dd, 0x0, // Negative Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (nmaclhws. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {NMACLHWSO, 0xfc0007ff, 0x100007dc, 0x0, // Negative Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (nmaclhwso RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {NMACLHWSO_, 0xfc0007ff, 0x100007dd, 0x0, // Negative Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (nmaclhwso. RT,RA,RB) + {NMACLHWSOCC, 0xfc0007ff, 0x100007dd, 0x0, // Negative Multiply Accumulate Low Halfword to Word Saturate Signed XO-form (nmaclhwso. RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {ICBI, 0xfc0007fe, 0x7c0007ac, 0x3e00001, // Instruction Cache Block Invalidate X-form (icbi RA,RB) [5]*argField{ap_Reg_11_15, ap_Reg_16_20}}, @@ -5136,23 +5167,23 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {LWARX, 0xfc0007fe, 0x7c000028, 0x0, // Load Word And Reserve Indexed X-form (lwarx RT,RA,RB,EH) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_ImmUnsigned_31_31}}, - {STBCX_, 0xfc0007ff, 0x7c00056d, 0x0, // Store Byte Conditional Indexed X-form [Category: Phased-In] (stbcx. RS,RA,RB) + {STBCXCC, 0xfc0007ff, 0x7c00056d, 0x0, // Store Byte Conditional Indexed X-form [Category: Phased-In] (stbcx. RS,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {STHCX_, 0xfc0007ff, 0x7c0005ad, 0x0, // Store Halfword Conditional Indexed X-form [Category: Phased-In] (sthcx. RS,RA,RB) + {STHCXCC, 0xfc0007ff, 0x7c0005ad, 0x0, // Store Halfword Conditional Indexed X-form [Category: Phased-In] (sthcx. RS,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {STWCX_, 0xfc0007ff, 0x7c00012d, 0x0, // Store Word Conditional Indexed X-form (stwcx. RS,RA,RB) + {STWCXCC, 0xfc0007ff, 0x7c00012d, 0x0, // Store Word Conditional Indexed X-form (stwcx. RS,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {LDARX, 0xfc0007ff, 0x7c0000a8, 0x0, // Load Doubleword And Reserve Indexed X-form (ldarx RT,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {LDARX, 0xfc0007fe, 0x7c0000a8, 0x0, // Load Doubleword And Reserve Indexed X-form (ldarx RT,RA,RB,EH) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_ImmUnsigned_31_31}}, - {STDCX_, 0xfc0007ff, 0x7c0001ad, 0x0, // Store Doubleword Conditional Indexed X-form (stdcx. RS,RA,RB) + {STDCXCC, 0xfc0007ff, 0x7c0001ad, 0x0, // Store Doubleword Conditional Indexed X-form (stdcx. RS,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {LQARX, 0xfc0007ff, 0x7c000228, 0x0, // Load Quadword And Reserve Indexed X-form (lqarx RTp,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {LQARX, 0xfc0007fe, 0x7c000228, 0x0, // Load Quadword And Reserve Indexed X-form (lqarx RTp,RA,RB,EH) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_ImmUnsigned_31_31}}, - {STQCX_, 0xfc0007ff, 0x7c00016d, 0x0, // Store Quadword Conditional Indexed X-form (stqcx. RSp,RA,RB) + {STQCXCC, 0xfc0007ff, 0x7c00016d, 0x0, // Store Quadword Conditional Indexed X-form (stqcx. RSp,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {SYNC, 0xfc0007fe, 0x7c0004ac, 0x390f801, // Synchronize X-form (sync L, E) [5]*argField{ap_ImmUnsigned_9_10, ap_ImmUnsigned_12_15}}, @@ -5162,21 +5193,21 @@ var instFormats = [...]instFormat{ [5]*argField{ap_ImmUnsigned_6_10}}, {WAIT, 0xfc0007fe, 0x7c00007c, 0x39ff801, // Wait X-form (wait WC) [5]*argField{ap_ImmUnsigned_9_10}}, - {TBEGIN_, 0xfc0007ff, 0x7c00051d, 0x1dff800, // Transaction Begin X-form (tbegin. R) + {TBEGINCC, 0xfc0007ff, 0x7c00051d, 0x1dff800, // Transaction Begin X-form (tbegin. R) [5]*argField{ap_ImmUnsigned_10_10}}, - {TEND_, 0xfc0007ff, 0x7c00055d, 0x1fff800, // Transaction End X-form (tend. A) + {TENDCC, 0xfc0007ff, 0x7c00055d, 0x1fff800, // Transaction End X-form (tend. A) [5]*argField{ap_ImmUnsigned_6_6}}, - {TABORT_, 0xfc0007ff, 0x7c00071d, 0x3e0f800, // Transaction Abort X-form (tabort. RA) + {TABORTCC, 0xfc0007ff, 0x7c00071d, 0x3e0f800, // Transaction Abort X-form (tabort. RA) [5]*argField{ap_Reg_11_15}}, - {TABORTWC_, 0xfc0007ff, 0x7c00061d, 0x0, // Transaction Abort Word Conditional X-form (tabortwc. TO,RA,RB) + {TABORTWCCC, 0xfc0007ff, 0x7c00061d, 0x0, // Transaction Abort Word Conditional X-form (tabortwc. TO,RA,RB) [5]*argField{ap_ImmUnsigned_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {TABORTWCI_, 0xfc0007ff, 0x7c00069d, 0x0, // Transaction Abort Word Conditional Immediate X-form (tabortwci. TO,RA,SI) + {TABORTWCICC, 0xfc0007ff, 0x7c00069d, 0x0, // Transaction Abort Word Conditional Immediate X-form (tabortwci. TO,RA,SI) [5]*argField{ap_ImmUnsigned_6_10, ap_Reg_11_15, ap_ImmSigned_16_20}}, - {TABORTDC_, 0xfc0007ff, 0x7c00065d, 0x0, // Transaction Abort Doubleword Conditional X-form (tabortdc. TO,RA,RB) + {TABORTDCCC, 0xfc0007ff, 0x7c00065d, 0x0, // Transaction Abort Doubleword Conditional X-form (tabortdc. TO,RA,RB) [5]*argField{ap_ImmUnsigned_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {TABORTDCI_, 0xfc0007ff, 0x7c0006dd, 0x0, // Transaction Abort Doubleword Conditional Immediate X-form (tabortdci. TO,RA, SI) + {TABORTDCICC, 0xfc0007ff, 0x7c0006dd, 0x0, // Transaction Abort Doubleword Conditional Immediate X-form (tabortdci. TO,RA, SI) [5]*argField{ap_ImmUnsigned_6_10, ap_Reg_11_15, ap_ImmSigned_16_20}}, - {TSR_, 0xfc0007ff, 0x7c0005dd, 0x3dff800, // Transaction Suspend or Resume X-form (tsr. L) + {TSRCC, 0xfc0007ff, 0x7c0005dd, 0x3dff800, // Transaction Suspend or Resume X-form (tsr. L) [5]*argField{ap_ImmUnsigned_10_10}}, {TCHECK, 0xfc0007fe, 0x7c00059c, 0x7ff801, // Transaction Check X-form (tcheck BF) [5]*argField{ap_CondRegField_6_8}}, @@ -5240,9 +5271,9 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {STDCIX, 0xfc0007fe, 0x7c0007ea, 0x1, // Store Doubleword Caching Inhibited Indexed X-form (stdcix RS,RA,RB) [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, - {TRECLAIM_, 0xfc0007ff, 0x7c00075d, 0x3e0f800, // Transaction Reclaim X-form (treclaim. RA) + {TRECLAIMCC, 0xfc0007ff, 0x7c00075d, 0x3e0f800, // Transaction Reclaim X-form (treclaim. RA) [5]*argField{ap_Reg_11_15}}, - {TRECHKPT_, 0xfc0007ff, 0x7c0007dd, 0x3fff800, // Transaction Recheckpoint X-form (trechkpt.) + {TRECHKPTCC, 0xfc0007ff, 0x7c0007dd, 0x3fff800, // Transaction Recheckpoint X-form (trechkpt.) [5]*argField{}}, {MTSPR, 0xfc0007fe, 0x7c0003a6, 0x1, // Move To Special Purpose Register XFX-form (mtspr SPR,RS) [5]*argField{ap_SpReg_16_20_11_15, ap_Reg_6_10}}, @@ -5264,7 +5295,7 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_6_10, ap_Reg_16_20}}, {SLBMFEE, 0xfc0007fe, 0x7c000726, 0x1f0001, // SLB Move From Entry ESID X-form (slbmfee RT,RB) [5]*argField{ap_Reg_6_10, ap_Reg_16_20}}, - {SLBFEE_, 0xfc0007ff, 0x7c0007a7, 0x1f0000, // SLB Find Entry ESID X-form (slbfee. RT,RB) + {SLBFEECC, 0xfc0007ff, 0x7c0007a7, 0x1f0000, // SLB Find Entry ESID X-form (slbfee. RT,RB) [5]*argField{ap_Reg_6_10, ap_Reg_16_20}}, {MTSR, 0xfc0007fe, 0x7c0001a4, 0x10f801, // Move To Segment Register X-form (mtsr SR,RS) [5]*argField{ap_SpReg_12_15, ap_Reg_6_10}}, @@ -5372,9 +5403,9 @@ var instFormats = [...]instFormat{ [5]*argField{ap_VecReg_6_10, ap_Reg_11_15, ap_Reg_16_20}}, {DCBI, 0xfc0007fe, 0x7c0003ac, 0x3e00001, // Data Cache Block Invalidate X-form (dcbi RA,RB) [5]*argField{ap_Reg_11_15, ap_Reg_16_20}}, - {DCBLQ_, 0xfc0007ff, 0x7c00034d, 0x2000000, // Data Cache Block Lock Query X-form (dcblq. CT,RA,RB) + {DCBLQCC, 0xfc0007ff, 0x7c00034d, 0x2000000, // Data Cache Block Lock Query X-form (dcblq. CT,RA,RB) [5]*argField{ap_ImmUnsigned_7_10, ap_Reg_11_15, ap_Reg_16_20}}, - {ICBLQ_, 0xfc0007ff, 0x7c00018d, 0x2000000, // Instruction Cache Block Lock Query X-form (icblq. CT,RA,RB) + {ICBLQCC, 0xfc0007ff, 0x7c00018d, 0x2000000, // Instruction Cache Block Lock Query X-form (icblq. CT,RA,RB) [5]*argField{ap_ImmUnsigned_7_10, ap_Reg_11_15, ap_Reg_16_20}}, {DCBTLS, 0xfc0007fe, 0x7c00014c, 0x2000001, // Data Cache Block Touch and Lock Set X-form (dcbtls CT,RA,RB) [5]*argField{ap_ImmUnsigned_7_10, ap_Reg_11_15, ap_Reg_16_20}}, @@ -5392,7 +5423,7 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_11_15, ap_Reg_16_20}}, {TLBSX, 0xfc0007fe, 0x7c000724, 0x3e00001, // TLB Search Indexed X-form (tlbsx RA,RB) [5]*argField{ap_Reg_11_15, ap_Reg_16_20}}, - {TLBSRX_, 0xfc0007ff, 0x7c0006a5, 0x3e00000, // TLB Search and Reserve Indexed X-form (tlbsrx. RA,RB) + {TLBSRXCC, 0xfc0007ff, 0x7c0006a5, 0x3e00000, // TLB Search and Reserve Indexed X-form (tlbsrx. RA,RB) [5]*argField{ap_Reg_11_15, ap_Reg_16_20}}, {TLBRE, 0xfc0007fe, 0x7c000764, 0x3fff801, // TLB Read Entry X-form (tlbre) [5]*argField{}}, @@ -5418,4 +5449,46 @@ var instFormats = [...]instFormat{ [5]*argField{ap_Reg_6_10, ap_SpReg_11_20}}, {MTPMR, 0xfc0007fe, 0x7c00039c, 0x1, // Move To Performance Monitor Register XFX-form (mtpmr PMRN,RS) [5]*argField{ap_SpReg_11_20, ap_Reg_6_10}}, + {ADDEX, 0xfc0001fe, 0x7c000154, 0x1, // Add Extended using alternate carry bit Z23-form (addex RT,RA,RB,CY) + [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_ImmUnsigned_21_22}}, + {DARN, 0xfc0007fe, 0x7c0005e6, 0x1cf801, // Deliver A Random Number X-form (darn RT,L) + [5]*argField{ap_Reg_6_10, ap_ImmUnsigned_14_15}}, + {MADDHD, 0xfc00003f, 0x10000030, 0x0, // Multiply-Add High Doubleword VA-form (maddhd RT,RA,RB,RC) + [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_Reg_21_25}}, + {MADDHDU, 0xfc00003f, 0x10000031, 0x0, // Multiply-Add High Doubleword Unsigned VA-form (maddhdu RT,RA,RB,RC) + [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_Reg_21_25}}, + {MADDLD, 0xfc00003f, 0x10000033, 0x0, // Multiply-Add Low Doubleword VA-form (maddld RT,RA,RB,RC) + [5]*argField{ap_Reg_6_10, ap_Reg_11_15, ap_Reg_16_20, ap_Reg_21_25}}, + {CMPRB, 0xfc0007fe, 0x7c000180, 0x400001, // Compare Ranged Byte X-form (cmprb BF,L,RA,RB) + [5]*argField{ap_CondRegField_6_8, ap_ImmUnsigned_10_10, ap_Reg_11_15, ap_Reg_16_20}}, + {CMPEQB, 0xfc0007fe, 0x7c0001c0, 0x600001, // Compare Equal Byte X-form (cmpeqb BF,RA,RB) + [5]*argField{ap_CondRegField_6_8, ap_Reg_11_15, ap_Reg_16_20}}, + {BPERMD, 0xfc0007fe, 0x7c0001f8, 0x1, // Bit Permute Doubleword X-form (bpermd RA,RS,RB]) + [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_Reg_16_20}}, + {EXTSWSLI, 0xfc0007fd, 0x7c0006f4, 0x0, // Extend-Sign Word and Shift Left Immediate XS-form (extswsli RA,RS,SH) + [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20}}, + {EXTSWSLICC, 0xfc0007fd, 0x7c0006f5, 0x0, // Extend-Sign Word and Shift Left Immediate XS-form (extswsli. RA,RS,SH) + [5]*argField{ap_Reg_11_15, ap_Reg_6_10, ap_ImmUnsigned_30_30_16_20}}, + {MFVSRD, 0xfc0007fe, 0x7c000066, 0xf800, // Move From VSR Doubleword X-form (mfvsrd RA,XS) + [5]*argField{ap_Reg_11_15, ap_VecSReg_31_31_6_10}}, + {MFVSRLD, 0xfc0007fe, 0x7c000266, 0xf800, // Move From VSR Lower Doubleword X-form (mfvsrld RA,XS) + [5]*argField{ap_Reg_11_15, ap_VecSReg_31_31_6_10}}, + {MFVSRWZ, 0xfc0007fe, 0x7c0000e6, 0xf800, // Move From VSR Word and Zero X-form (mfvsrwz RA,XS) + [5]*argField{ap_Reg_11_15, ap_VecSReg_31_31_6_10}}, + {MTVSRD, 0xfc0007fe, 0x7c000166, 0xf800, // Move To VSR Doubleword X-form (mtvsrd XT,RA) + [5]*argField{ap_VecSReg_31_31_6_10, ap_Reg_11_15}}, + {MTVSRWA, 0xfc0007fe, 0x7c0001a6, 0xf800, // Move To VSR Word Algebraic X-form (mtvsrwa XT,RA) + [5]*argField{ap_VecSReg_31_31_6_10, ap_Reg_11_15}}, + {MTVSRWZ, 0xfc0007fe, 0x7c0001e6, 0xf800, // Move To VSR Word and Zero X-form (mtvsrwz XT,RA) + [5]*argField{ap_VecSReg_31_31_6_10, ap_Reg_11_15}}, + {MTVSRDD, 0xfc0007fe, 0x7c000366, 0x0, // Move To VSR Double Doubleword X-form (mtvsrdd XT,RA,RB) + [5]*argField{ap_VecSReg_31_31_6_10, ap_Reg_11_15, ap_Reg_16_20}}, + {MTVSRWS, 0xfc0007fe, 0x7c000326, 0xf800, // Move To VSR Word & Splat X-form (mtvsrws XT,RA) + [5]*argField{ap_VecSReg_31_31_6_10, ap_Reg_11_15}}, + {MCRXRX, 0xfc0007fe, 0x7c000480, 0x7ff801, // Move to CR from XER Extended X-form (mcrxrx BF) + [5]*argField{ap_CondRegField_6_8}}, + {COPY, 0xfc2007fe, 0x7c20060c, 0x3c00001, // Copy X-form (copy RA,RB) + [5]*argField{ap_Reg_11_15, ap_Reg_16_20}}, + {PASTECC, 0xfc2007ff, 0x7c20070d, 0x3c00000, // Paste X-form (paste. RA,RB) + [5]*argField{ap_Reg_11_15, ap_Reg_16_20}}, } diff --git a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/testdata/decode.txt b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/testdata/decode.txt index b4e5db2cb2c3f..2a89de04c9132 100644 --- a/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/testdata/decode.txt +++ b/src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/testdata/decode.txt @@ -1,25 +1,56 @@ 6d746162| gnu xoris r20,r11,24930 +6d746162| plan9 XORIS R11,$24930,R20 4c040000| gnu mcrf cr0,cr1 -88000017| gnu lbz r0,23(0) -4abaa88a| gnu ba 0xfebaa888 -7d8fc2a6| gnu mfspr r12,783 -00000000| gnu error: unknown instruction +88a70002| gnu lbz r5,2(r7) +88a70002| plan9 MOVBZ 2(R7),R5 +00000000| plan9 WORD $0 +00010000| plan9 error: unknown instruction +00000000| gnu .long 0x0 +00002000| gnu error: unknown instruction a1841e80| gnu lhz r12,7808(r4) +a1841e80| plan9 MOVHZ 7808(R4),R12 42093d10| gnu bc 16,4*cr2+gt,.+0x3d10 e38d5b90| gnu lq r28,23440(r13) 84127a20| gnu lwzu r0,31264(r18) -c61bb730| gnu lfsu f16,-18640(r27) -0825f440| gnu tdi 1,r5,-3008 -a9a912c1| gnu lha r13,4801(r9) +84127a20| plan9 MOVWZU 31264(R18),R0 +a8630000| gnu lha r3,0(r3) +a8630000| plan9 MOVH 0(R3),R3 ebb24fd1| gnu ldu r29,20432(r18) +ebb24fd1| plan9 MOVDU 20432(R18),R29 b1ce0612| gnu sth r14,1554(r14) -f3c04322| gnu xvcvdpuxws vs30,vs40 +b1ce0612| plan9 MOVH R14,1554(R14) 945c62a2| gnu stwu r2,25250(r28) -9c8156e3| gnu stbu r4,22243(r1) f91b9c7a| gnu stq r8,-25480(r27) -2c1c81b4| gnu cmpwi r28,-32332 -f87b904d| gnu stdu r3,-28596(r27) -eab3c832| gnu lwa r21,-14288(r19) +2c030001| gnu cmpwi r3,1 +2c030001| plan9 CMPW R3,$1 +e8610032| gnu lwa r3,48(r1) +e8610032| plan9 MOVW 48(R1),R3 4320336b| gnu bcla 25,lt,0x3368 7e40092e| gnu stwx r18,0,r1 +7e40092e| plan9 MOVW R18,(R1)(0) 7c103c2c| gnu lwbrx r0,r16,r7 +7c103c2c| plan9 MOVWBR (R7)(R16),R0 +7c441d28| gnu stdbrx r2,r4,r3 +7c441d28| plan9 MOVDBR R2,(R3)(R4) +3d220001| gnu addis r9,r2,1 +3d220001| plan9 ADDIS R2,$1,R9 +7ce628ae| gnu lbzx r7,r6,r5 +7ce628ae| plan9 MOVBZ (R5)(R6),R7 +7c0e1e99| gnu lxvd2x vs32,r14,r3 +7c0e1e99| plan9 LXVD2X (R3)(R14),VS32 +7c00422c| gnu dcbt r0,r8,0 +7c00422c| plan9 DCBT (R8) +7fab3040| gnu cmpld cr7,r11,r6 +7fab3040| plan9 CMPU CR7,R11,R6 +2c030001| gnu cmpwi r3,1 +2c030001| plan9 CMPW R3,$1 +7c2b4840| gnu cmpld r11,r9 +7c2b4840| plan9 CMPU R11,R9 +7c6521ad| gnu stdcx. r3,r5,r4 +7c6521ad| plan9 STDCXCC R3,(R4)(R5) +fbe1ffd1| gnu stdu r31,-48(r1) +fbe1ffd1| plan9 MOVDU R31,-48(R1) +7c941f19| gnu stxvw4x vs36,r20,r3 +7c941f19| plan9 STXVW4X VS36,(R3)(R20) +7c6520a8| gnu ldarx r3,r5,r4 +7c6520a8| plan9 LDAR (R4)(R5),R3 diff --git a/src/cmd/vendor/vendor.json b/src/cmd/vendor/vendor.json index 23ff3225af9a7..89764c8c6fee3 100644 --- a/src/cmd/vendor/vendor.json +++ b/src/cmd/vendor/vendor.json @@ -116,8 +116,8 @@ }, { "path": "golang.org/x/arch/ppc64/ppc64asm", - "revision": "5099b4b992f2813e39cfe2623c6f638718bd0fc6", - "revisionTime": "2018-04-06T10:28:20Z" + "revision": "5a4828bb704534b8a2fa09c791c67d0fb372f472", + "revisionTime": "2018-12-03T22:54:21Z" }, { "path": "golang.org/x/arch/x86/x86asm", From c8ca793176cfae8a9fc501d6e37896304f483f2e Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 5 Dec 2018 15:21:17 -0500 Subject: [PATCH 239/594] cmd/compile: mark memclrHasPointers calls as write barriers There are two places where the compiler generates memclrHasPointers calls. These are effectively write barriers, but the compiler doesn't currently record them as such in the function. As a result code like for i := range a { a[i] = nil } inserts a write barrier for the assignment to a[i], but the compiler doesn't report this. Hence, it's not reported in the -d=wb output, and it's not checked against //go:nowritebarrier annotations. Change-Id: I40299ebc9824f05cf516cba494d4c086b80ffb53 Reviewed-on: https://go-review.googlesource.com/c/152722 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/range.go | 1 + src/cmd/compile/internal/gc/walk.go | 1 + 2 files changed, 2 insertions(+) diff --git a/src/cmd/compile/internal/gc/range.go b/src/cmd/compile/internal/gc/range.go index bf30d9388ec55..cbe69a1ebc16f 100644 --- a/src/cmd/compile/internal/gc/range.go +++ b/src/cmd/compile/internal/gc/range.go @@ -588,6 +588,7 @@ func arrayClear(n, v1, v2, a *Node) bool { var fn *Node if types.Haspointers(a.Type.Elem()) { // memclrHasPointers(hp, hn) + Curfn.Func.setWBPos(stmt.Pos) fn = mkcall("memclrHasPointers", nil, nil, hp, hn) } else { // memclrNoHeapPointers(hp, hn) diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index 528aacb213c4b..b84bc26e04a72 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -2860,6 +2860,7 @@ func extendslice(n *Node, init *Nodes) *Node { hasPointers := types.Haspointers(elemtype) if hasPointers { clrname = "memclrHasPointers" + Curfn.Func.setWBPos(n.Pos) } var clr Nodes From 6454a09a97ff583bd81d59733777a000caf8b79a Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 5 Dec 2018 15:23:26 -0500 Subject: [PATCH 240/594] cmd/compile: omit write barriers for slice clears of go:notinheap pointers Currently, for i := range a { a[i] = nil } will compile to have write barriers even if a is a slice of pointers to go:notinheap types. This happens because the optimization that transforms this into a memclr only asks it a's element type has pointers, and not if it specifically has heap pointers. Fix this by changing arrayClear to use HasHeapPointer instead of types.Haspointers. We probably shouldn't have both of these functions, since a pointer to a notinheap type is effectively a uintptr, but that's not going to change in this CL. Change-Id: I284b85bdec6ae1e641f894e8f577989facdb0cf1 Reviewed-on: https://go-review.googlesource.com/c/152723 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/range.go | 2 +- test/notinheap3.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/range.go b/src/cmd/compile/internal/gc/range.go index cbe69a1ebc16f..5c19d54e78d99 100644 --- a/src/cmd/compile/internal/gc/range.go +++ b/src/cmd/compile/internal/gc/range.go @@ -586,7 +586,7 @@ func arrayClear(n, v1, v2, a *Node) bool { n.Nbody.Append(nod(OAS, hn, tmp)) var fn *Node - if types.Haspointers(a.Type.Elem()) { + if a.Type.Elem().HasHeapPointer() { // memclrHasPointers(hp, hn) Curfn.Func.setWBPos(stmt.Pos) fn = mkcall("memclrHasPointers", nil, nil, hp, hn) diff --git a/test/notinheap3.go b/test/notinheap3.go index d48c2a0cc974f..5ace8d6793f21 100644 --- a/test/notinheap3.go +++ b/test/notinheap3.go @@ -58,3 +58,19 @@ func h() { _ = append(v1s, v1s...) // no barrier _ = append(v2s, v2s...) // ERROR "write barrier" } + +// Slice clearing + +var ( + sliceIH []*ih + sliceNIH []*nih +) + +func sliceClear() { + for i := range sliceIH { + sliceIH[i] = nil // ERROR "write barrier" + } + for i := range sliceNIH { + sliceNIH[i] = nil // no barrier + } +} From 352f1b77c40e2f2c0711244481e1cc25ae423830 Mon Sep 17 00:00:00 2001 From: komuW Date: Wed, 5 Dec 2018 05:39:18 +0000 Subject: [PATCH 241/594] doc/go1.11: add note about go run supporting for go run pkg or go run . Fixes golang/go#27047 Change-Id: I0dd40201fc03e87fbc674b47bdf9315f1783d6c2 GitHub-Last-Rev: f28ab6234ade814c4bc09e26417c424c843ad57b GitHub-Pull-Request: golang/go#27048 Reviewed-on: https://go-review.googlesource.com/c/129696 Reviewed-by: komu wairagu Reviewed-by: Andrew Bonventre --- doc/go1.11.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/go1.11.html b/doc/go1.11.html index 16b4c904cb332..1d85be9fe4e53 100644 --- a/doc/go1.11.html +++ b/doc/go1.11.html @@ -400,6 +400,16 @@

    Gofmt

    information.

    +

    Run

    + +

    + + The go run + command now allows a single import path, a directory name or a + pattern matching a single package. + This allows go run pkg or go run dir, most importantly go run . +

    +

    Runtime

    From fb69478ecd7a6bec18b0e77665bbaadce4b7f2e8 Mon Sep 17 00:00:00 2001 From: Katie Hockman Date: Tue, 4 Dec 2018 16:23:39 -0500 Subject: [PATCH 242/594] doc: 1.12 release notes for go/doc, go/token, and reflect packages Change-Id: I5f0ceeca2025cf19bcf610e150f7b7067fdd7397 Reviewed-on: https://go-review.googlesource.com/c/152637 Reviewed-by: Andrew Bonventre --- doc/go1.12.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index f452d136c0883..c8dd487f65fe7 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -270,7 +270,9 @@

    Minor changes to the library

    go/doc

    - TODO: https://golang.org/cl/140958: add new mode bit PreserveAST to control clearing of data in AST + To address some outstanding issues in cmd/doc, + this package has a new Mode bit, + PreserveAST, which controls whether AST data is cleared.

    @@ -278,7 +280,11 @@

    Minor changes to the library

    go/token

    - TODO: https://golang.org/cl/134075: add (*File).LineStart, which returns Pos for a given line + The File type has a new + LineStart field, + which returns the position of the start of a given line. This is especially useful + in programs that occassionally handle non-Go files, such as assembly, but wish to use + the token.Pos mechanism to identify file positions.

    @@ -442,7 +448,12 @@

    Minor changes to the library

    reflect

    - TODO: https://golang.org/cl/33572: add Value.MapRange method and MapIter type + A new MapIter type is + an iterator for ranging over a map. This type is exposed through the + Value type's new + MapRange method. + This follows the same iteration semantics as a range statment, with Next + to advance the iterator, and Key/Value to access each entry.

    From f6be1cf109a2be59b96d1fa913adfa1fbc628579 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 6 Aug 2018 15:41:34 -0400 Subject: [PATCH 243/594] crypto/x509: fix root CA extraction on macOS (cgo path) The cgo path was not taking policies into account, using the last security setting in the array whatever it was. Also, it was not aware of the defaults for empty security settings, and for security settings without a result type. Finally, certificates restricted to a hostname were considered roots. The API docs for this code are partial and not very clear, so this is a best effort, really. Updates #24652 Change-Id: I8fa2fe4706f44f3d963b32e0615d149e997b537d Reviewed-on: https://go-review.googlesource.com/c/128056 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Adam Langley Reviewed-by: Adam Langley --- src/crypto/x509/root_cgo_darwin.go | 258 ++++++++++++++++++++--------- src/crypto/x509/root_darwin.go | 18 +- 2 files changed, 192 insertions(+), 84 deletions(-) diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go index a02ac3cfe8364..a168135a33477 100644 --- a/src/crypto/x509/root_cgo_darwin.go +++ b/src/crypto/x509/root_cgo_darwin.go @@ -16,7 +16,135 @@ package x509 #include #include -// FetchPEMRoots fetches the system's list of trusted X.509 root certificates. +static bool isSSLPolicy(SecPolicyRef policyRef) { + if (!policyRef) { + return false; + } + CFDictionaryRef properties = SecPolicyCopyProperties(policyRef); + if (properties == NULL) { + return false; + } + CFTypeRef value = NULL; + if (CFDictionaryGetValueIfPresent(properties, kSecPolicyOid, (const void **)&value)) { + CFRelease(properties); + return CFEqual(value, kSecPolicyAppleSSL); + } + CFRelease(properties); + return false; +} + +// sslTrustSettingsResult obtains the final kSecTrustSettingsResult value +// for a certificate in the user or admin domain, combining usage constraints +// for the SSL SecTrustSettingsPolicy, ignoring SecTrustSettingsKeyUsage and +// kSecTrustSettingsAllowedError. +// https://developer.apple.com/documentation/security/1400261-sectrustsettingscopytrustsetting +static SInt32 sslTrustSettingsResult(SecCertificateRef cert) { + CFArrayRef trustSettings = NULL; + OSStatus err = SecTrustSettingsCopyTrustSettings(cert, kSecTrustSettingsDomainUser, &trustSettings); + + // According to Apple's SecTrustServer.c, "user trust settings overrule admin trust settings", + // but the rules of the override are unclear. Let's assume admin trust settings are applicable + // if and only if user trust settings fail to load or are NULL. + if (err != errSecSuccess || trustSettings == NULL) { + if (trustSettings != NULL) CFRelease(trustSettings); + err = SecTrustSettingsCopyTrustSettings(cert, kSecTrustSettingsDomainAdmin, &trustSettings); + } + + // > no trust settings [...] means "this certificate must be verified to a known trusted certificate” + if (err != errSecSuccess || trustSettings == NULL) { + if (trustSettings != NULL) CFRelease(trustSettings); + return kSecTrustSettingsResultUnspecified; + } + + // > An empty trust settings array means "always trust this certificate” with an + // > overall trust setting for the certificate of kSecTrustSettingsResultTrustRoot. + if (CFArrayGetCount(trustSettings) == 0) { + CFRelease(trustSettings); + return kSecTrustSettingsResultTrustRoot; + } + + // kSecTrustSettingsResult is defined as CFSTR("kSecTrustSettingsResult"), + // but the Go linker's internal linking mode can't handle CFSTR relocations. + // Create our own dynamic string instead and release it below. + CFStringRef _kSecTrustSettingsResult = CFStringCreateWithCString( + NULL, "kSecTrustSettingsResult", kCFStringEncodingUTF8); + CFStringRef _kSecTrustSettingsPolicy = CFStringCreateWithCString( + NULL, "kSecTrustSettingsPolicy", kCFStringEncodingUTF8); + CFStringRef _kSecTrustSettingsPolicyString = CFStringCreateWithCString( + NULL, "kSecTrustSettingsPolicyString", kCFStringEncodingUTF8); + + CFIndex m; SInt32 result = 0; + for (m = 0; m < CFArrayGetCount(trustSettings); m++) { + CFDictionaryRef tSetting = (CFDictionaryRef)CFArrayGetValueAtIndex(trustSettings, m); + + // First, check if this trust setting applies to our policy. We assume + // only one will. The docs suggest that there might be multiple applying + // but don't explain how to combine them. + SecPolicyRef policyRef; + if (CFDictionaryGetValueIfPresent(tSetting, _kSecTrustSettingsPolicy, (const void**)&policyRef)) { + if (!isSSLPolicy(policyRef)) { + continue; + } + } else { + continue; + } + + if (CFDictionaryContainsKey(tSetting, _kSecTrustSettingsPolicyString)) { + // Restricted to a hostname, not a root. + continue; + } + + CFNumberRef cfNum; + if (CFDictionaryGetValueIfPresent(tSetting, _kSecTrustSettingsResult, (const void**)&cfNum)) { + CFNumberGetValue(cfNum, kCFNumberSInt32Type, &result); + } else { + // > If the value of the kSecTrustSettingsResult component is not + // > kSecTrustSettingsResultUnspecified for a usage constraints dictionary that has + // > no constraints, the default value kSecTrustSettingsResultTrustRoot is assumed. + result = kSecTrustSettingsResultTrustRoot; + } + + break; + } + + // If trust settings are present, but none of them match the policy... + // the docs don't tell us what to do. + // + // "Trust settings for a given use apply if any of the dictionaries in the + // certificate’s trust settings array satisfies the specified use." suggests + // that it's as if there were no trust settings at all, so we should probably + // fallback to the admin trust settings. TODO. + if (result == 0) { + result = kSecTrustSettingsResultUnspecified; + } + + CFRelease(_kSecTrustSettingsPolicy); + CFRelease(_kSecTrustSettingsPolicyString); + CFRelease(_kSecTrustSettingsResult); + CFRelease(trustSettings); + + return result; +} + +// isRootCertificate reports whether Subject and Issuer match. +static Boolean isRootCertificate(SecCertificateRef cert, CFErrorRef *errRef) { + CFDataRef subjectName = SecCertificateCopyNormalizedSubjectContent(cert, errRef); + if (*errRef != NULL) { + return false; + } + CFDataRef issuerName = SecCertificateCopyNormalizedIssuerContent(cert, errRef); + if (*errRef != NULL) { + CFRelease(subjectName); + return false; + } + Boolean equal = CFEqual(subjectName, issuerName); + CFRelease(subjectName); + CFRelease(issuerName); + return equal; +} + +// FetchPEMRoots fetches the system's list of trusted X.509 root certificates +// for the kSecTrustSettingsPolicy SSL. // // On success it returns 0 and fills pemRoots with a CFDataRef that contains the extracted root // certificates of the system. On failure, the function returns -1. @@ -24,26 +152,28 @@ package x509 // // Note: The CFDataRef returned in pemRoots and untrustedPemRoots must // be released (using CFRelease) after we've consumed its content. -int FetchPEMRoots(CFDataRef *pemRoots, CFDataRef *untrustedPemRoots) { +int FetchPEMRoots(CFDataRef *pemRoots, CFDataRef *untrustedPemRoots, bool debugDarwinRoots) { int i; + if (debugDarwinRoots) { + printf("crypto/x509: kSecTrustSettingsResultInvalid = %d\n", kSecTrustSettingsResultInvalid); + printf("crypto/x509: kSecTrustSettingsResultTrustRoot = %d\n", kSecTrustSettingsResultTrustRoot); + printf("crypto/x509: kSecTrustSettingsResultTrustAsRoot = %d\n", kSecTrustSettingsResultTrustAsRoot); + printf("crypto/x509: kSecTrustSettingsResultDeny = %d\n", kSecTrustSettingsResultDeny); + printf("crypto/x509: kSecTrustSettingsResultUnspecified = %d\n", kSecTrustSettingsResultUnspecified); + } + // Get certificates from all domains, not just System, this lets // the user add CAs to their "login" keychain, and Admins to add // to the "System" keychain SecTrustSettingsDomain domains[] = { kSecTrustSettingsDomainSystem, - kSecTrustSettingsDomainAdmin, - kSecTrustSettingsDomainUser }; + kSecTrustSettingsDomainAdmin, kSecTrustSettingsDomainUser }; int numDomains = sizeof(domains)/sizeof(SecTrustSettingsDomain); if (pemRoots == NULL) { return -1; } - // kSecTrustSettingsResult is defined as CFSTR("kSecTrustSettingsResult"), - // but the Go linker's internal linking mode can't handle CFSTR relocations. - // Create our own dynamic string instead and release it below. - CFStringRef policy = CFStringCreateWithCString(NULL, "kSecTrustSettingsResult", kCFStringEncodingUTF8); - CFMutableDataRef combinedData = CFDataCreateMutable(kCFAllocatorDefault, 0); CFMutableDataRef combinedUntrustedData = CFDataCreateMutable(kCFAllocatorDefault, 0); for (i = 0; i < numDomains; i++) { @@ -57,102 +187,81 @@ int FetchPEMRoots(CFDataRef *pemRoots, CFDataRef *untrustedPemRoots) { CFIndex numCerts = CFArrayGetCount(certs); for (j = 0; j < numCerts; j++) { CFDataRef data = NULL; - CFErrorRef errRef = NULL; CFArrayRef trustSettings = NULL; SecCertificateRef cert = (SecCertificateRef)CFArrayGetValueAtIndex(certs, j); if (cert == NULL) { continue; } - // We only want trusted certs. - int untrusted = 0; - int trustAsRoot = 0; - int trustRoot = 0; - if (i == 0) { - trustAsRoot = 1; - } else { - int k; - CFIndex m; + SInt32 result; + if (domains[i] == kSecTrustSettingsDomainSystem) { // Certs found in the system domain are always trusted. If the user // configures "Never Trust" on such a cert, it will also be found in the // admin or user domain, causing it to be added to untrustedPemRoots. The // Go code will then clean this up. - - // Trust may be stored in any of the domains. According to Apple's - // SecTrustServer.c, "user trust settings overrule admin trust settings", - // so take the last trust settings array we find. - // Skip the system domain since it is always trusted. - for (k = i; k < numDomains; k++) { - CFArrayRef domainTrustSettings = NULL; - err = SecTrustSettingsCopyTrustSettings(cert, domains[k], &domainTrustSettings); - if (err == errSecSuccess && domainTrustSettings != NULL) { - if (trustSettings) { - CFRelease(trustSettings); - } - trustSettings = domainTrustSettings; + result = kSecTrustSettingsResultTrustRoot; + } else { + result = sslTrustSettingsResult(cert); + if (debugDarwinRoots) { + CFErrorRef errRef = NULL; + CFStringRef summary = SecCertificateCopyShortDescription(NULL, cert, &errRef); + if (errRef != NULL) { + printf("crypto/x509: SecCertificateCopyShortDescription failed\n"); + CFRelease(errRef); + continue; } - } - if (trustSettings == NULL) { - // "this certificate must be verified to a known trusted certificate"; aka not a root. - continue; - } - for (m = 0; m < CFArrayGetCount(trustSettings); m++) { - CFNumberRef cfNum; - CFDictionaryRef tSetting = (CFDictionaryRef)CFArrayGetValueAtIndex(trustSettings, m); - if (CFDictionaryGetValueIfPresent(tSetting, policy, (const void**)&cfNum)){ - SInt32 result = 0; - CFNumberGetValue(cfNum, kCFNumberSInt32Type, &result); - // TODO: The rest of the dictionary specifies conditions for evaluation. - if (result == kSecTrustSettingsResultDeny) { - untrusted = 1; - } else if (result == kSecTrustSettingsResultTrustAsRoot) { - trustAsRoot = 1; - } else if (result == kSecTrustSettingsResultTrustRoot) { - trustRoot = 1; - } + + CFIndex length = CFStringGetLength(summary); + CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1; + char *buffer = malloc(maxSize); + if (CFStringGetCString(summary, buffer, maxSize, kCFStringEncodingUTF8)) { + printf("crypto/x509: %s returned %d\n", buffer, result); } + free(buffer); + CFRelease(summary); } - CFRelease(trustSettings); } - if (trustRoot) { - // We only want to add Root CAs, so make sure Subject and Issuer Name match - CFDataRef subjectName = SecCertificateCopyNormalizedSubjectContent(cert, &errRef); - if (errRef != NULL) { - CFRelease(errRef); - continue; - } - CFDataRef issuerName = SecCertificateCopyNormalizedIssuerContent(cert, &errRef); - if (errRef != NULL) { - CFRelease(subjectName); - CFRelease(errRef); + CFMutableDataRef appendTo; + // > Note the distinction between the results kSecTrustSettingsResultTrustRoot + // > and kSecTrustSettingsResultTrustAsRoot: The former can only be applied to + // > root (self-signed) certificates; the latter can only be applied to + // > non-root certificates. + if (result == kSecTrustSettingsResultTrustRoot) { + CFErrorRef errRef = NULL; + if (!isRootCertificate(cert, &errRef) || errRef != NULL) { + if (errRef != NULL) CFRelease(errRef); continue; } - Boolean equal = CFEqual(subjectName, issuerName); - CFRelease(subjectName); - CFRelease(issuerName); - if (!equal) { + + appendTo = combinedData; + } else if (result == kSecTrustSettingsResultTrustAsRoot) { + CFErrorRef errRef = NULL; + if (isRootCertificate(cert, &errRef) || errRef != NULL) { + if (errRef != NULL) CFRelease(errRef); continue; } + + appendTo = combinedData; + } else if (result == kSecTrustSettingsResultDeny) { + appendTo = combinedUntrustedData; + } else if (result == kSecTrustSettingsResultUnspecified) { + continue; + } else { + continue; } err = SecItemExport(cert, kSecFormatX509Cert, kSecItemPemArmour, NULL, &data); if (err != noErr) { continue; } - if (data != NULL) { - if (!trustRoot && !trustAsRoot) { - untrusted = 1; - } - CFMutableDataRef appendTo = untrusted ? combinedUntrustedData : combinedData; CFDataAppendBytes(appendTo, CFDataGetBytePtr(data), CFDataGetLength(data)); CFRelease(data); } } CFRelease(certs); } - CFRelease(policy); *pemRoots = combinedData; *untrustedPemRoots = combinedUntrustedData; return 0; @@ -169,9 +278,8 @@ func loadSystemRoots() (*CertPool, error) { var data C.CFDataRef = 0 var untrustedData C.CFDataRef = 0 - err := C.FetchPEMRoots(&data, &untrustedData) + err := C.FetchPEMRoots(&data, &untrustedData, C.bool(debugDarwinRoots)) if err == -1 { - // TODO: better error message return nil, errors.New("crypto/x509: failed to load darwin system roots with cgo") } diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go index 4a02c075960c3..c27af935eb1af 100644 --- a/src/crypto/x509/root_darwin.go +++ b/src/crypto/x509/root_darwin.go @@ -21,7 +21,7 @@ import ( "sync" ) -var debugExecDarwinRoots = strings.Contains(os.Getenv("GODEBUG"), "x509roots=1") +var debugDarwinRoots = strings.Contains(os.Getenv("GODEBUG"), "x509roots=1") func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { return nil, nil @@ -57,7 +57,7 @@ func execSecurityRoots() (*CertPool, error) { if err != nil { return nil, err } - if debugExecDarwinRoots { + if debugDarwinRoots { println(fmt.Sprintf("crypto/x509: %d certs have a trust policy", len(hasPolicy))) } @@ -68,8 +68,8 @@ func execSecurityRoots() (*CertPool, error) { home, err := os.UserHomeDir() if err != nil { - if debugExecDarwinRoots { - println("crypto/x509: can't get user home directory: %v", err) + if debugDarwinRoots { + println(fmt.Sprintf("crypto/x509: can't get user home directory: %v", err)) } } else { args = append(args, @@ -147,7 +147,7 @@ func execSecurityRoots() (*CertPool, error) { close(blockCh) wg.Wait() - if debugExecDarwinRoots { + if debugDarwinRoots { mu.Lock() defer mu.Unlock() println(fmt.Sprintf("crypto/x509: ran security verify-cert %d times", numVerified)) @@ -175,16 +175,16 @@ func verifyCertWithSystem(block *pem.Block, cert *Certificate) bool { } cmd := exec.Command("/usr/bin/security", "verify-cert", "-c", f.Name(), "-l", "-L") var stderr bytes.Buffer - if debugExecDarwinRoots { + if debugDarwinRoots { cmd.Stderr = &stderr } if err := cmd.Run(); err != nil { - if debugExecDarwinRoots { + if debugDarwinRoots { println(fmt.Sprintf("crypto/x509: verify-cert rejected %s: %q", cert.Subject, bytes.TrimSpace(stderr.Bytes()))) } return false } - if debugExecDarwinRoots { + if debugDarwinRoots { println(fmt.Sprintf("crypto/x509: verify-cert approved %s", cert.Subject)) } return true @@ -217,7 +217,7 @@ func getCertsWithTrustPolicy() (map[string]bool, error) { // Rather than match on English substrings that are probably // localized on macOS, just interpret any failure to mean that // there are no trust settings. - if debugExecDarwinRoots { + if debugDarwinRoots { println(fmt.Sprintf("crypto/x509: exec %q: %v, %s", cmd.Args, err, stderr.Bytes())) } return nil From aa2415807781ba84bf917c62cb983dc1a44f2ad1 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 6 Aug 2018 18:38:18 -0400 Subject: [PATCH 244/594] crypto/x509: fix root CA extraction on macOS (no-cgo path) Certificates without any trust settings might still be in the keychain (for example if they used to have some, or if they are intermediates for offline verification), but they are not to be trusted. The only ones we can trust unconditionally are the ones in the system roots store. Moreover, the verify-cert invocation was not specifying the ssl policy, defaulting instead to the basic one. We have no way of communicating different usages in a CertPool, so stick to the WebPKI use-case as the primary one for crypto/x509. Updates #24652 Change-Id: Ife8b3d2f4026daa1223aa81fac44aeeb4f96528a Reviewed-on: https://go-review.googlesource.com/c/128116 Reviewed-by: Adam Langley Reviewed-by: Adam Langley --- src/crypto/x509/root_darwin.go | 113 ++++++++++++++++++++------------- 1 file changed, 69 insertions(+), 44 deletions(-) diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go index c27af935eb1af..9b8a1cca7dea6 100644 --- a/src/crypto/x509/root_darwin.go +++ b/src/crypto/x509/root_darwin.go @@ -39,8 +39,8 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate // // 1. Run "security trust-settings-export" and "security // trust-settings-export -d" to discover the set of certs with some -// user-tweaked trust policy. We're too lazy to parse the XML (at -// least at this stage of Go 1.8) to understand what the trust +// user-tweaked trust policy. We're too lazy to parse the XML +// (Issue 26830) to understand what the trust // policy actually is. We just learn that there is _some_ policy. // // 2. Run "security find-certificate" to dump the list of system root @@ -58,21 +58,20 @@ func execSecurityRoots() (*CertPool, error) { return nil, err } if debugDarwinRoots { - println(fmt.Sprintf("crypto/x509: %d certs have a trust policy", len(hasPolicy))) + fmt.Printf("crypto/x509: %d certs have a trust policy\n", len(hasPolicy)) } - args := []string{"find-certificate", "-a", "-p", - "/System/Library/Keychains/SystemRootCertificates.keychain", - "/Library/Keychains/System.keychain", - } + keychains := []string{"/Library/Keychains/System.keychain"} + // Note that this results in trusting roots from $HOME/... (the environment + // variable), which might not be expected. home, err := os.UserHomeDir() if err != nil { if debugDarwinRoots { - println(fmt.Sprintf("crypto/x509: can't get user home directory: %v", err)) + fmt.Printf("crypto/x509: can't get user home directory: %v\n", err) } } else { - args = append(args, + keychains = append(keychains, filepath.Join(home, "/Library/Keychains/login.keychain"), // Fresh installs of Sierra use a slightly different path for the login keychain @@ -80,21 +79,19 @@ func execSecurityRoots() (*CertPool, error) { ) } - cmd := exec.Command("/usr/bin/security", args...) - data, err := cmd.Output() - if err != nil { - return nil, err + type rootCandidate struct { + c *Certificate + system bool } var ( mu sync.Mutex roots = NewCertPool() numVerified int // number of execs of 'security verify-cert', for debug stats + wg sync.WaitGroup + verifyCh = make(chan rootCandidate) ) - blockCh := make(chan *pem.Block) - var wg sync.WaitGroup - // Using 4 goroutines to pipe into verify-cert seems to be // about the best we can do. The verify-cert binary seems to // just RPC to another server with coarse locking anyway, so @@ -108,31 +105,62 @@ func execSecurityRoots() (*CertPool, error) { wg.Add(1) go func() { defer wg.Done() - for block := range blockCh { - cert, err := ParseCertificate(block.Bytes) - if err != nil { - continue - } - sha1CapHex := fmt.Sprintf("%X", sha1.Sum(block.Bytes)) + for cert := range verifyCh { + sha1CapHex := fmt.Sprintf("%X", sha1.Sum(cert.c.Raw)) - valid := true + var valid bool verifyChecks := 0 if hasPolicy[sha1CapHex] { verifyChecks++ - if !verifyCertWithSystem(block, cert) { - valid = false - } + valid = verifyCertWithSystem(cert.c) + } else { + // Certificates not in SystemRootCertificates without user + // or admin trust settings are not trusted. + valid = cert.system } mu.Lock() numVerified += verifyChecks if valid { - roots.AddCert(cert) + roots.AddCert(cert.c) } mu.Unlock() } }() } + err = forEachCertInKeychains(keychains, func(cert *Certificate) { + verifyCh <- rootCandidate{c: cert, system: false} + }) + if err != nil { + close(verifyCh) + return nil, err + } + err = forEachCertInKeychains([]string{ + "/System/Library/Keychains/SystemRootCertificates.keychain", + }, func(cert *Certificate) { + verifyCh <- rootCandidate{c: cert, system: true} + }) + if err != nil { + close(verifyCh) + return nil, err + } + close(verifyCh) + wg.Wait() + + if debugDarwinRoots { + fmt.Printf("crypto/x509: ran security verify-cert %d times\n", numVerified) + } + + return roots, nil +} + +func forEachCertInKeychains(paths []string, f func(*Certificate)) error { + args := append([]string{"find-certificate", "-a", "-p"}, paths...) + cmd := exec.Command("/usr/bin/security", args...) + data, err := cmd.Output() + if err != nil { + return err + } for len(data) > 0 { var block *pem.Block block, data = pem.Decode(data) @@ -142,22 +170,19 @@ func execSecurityRoots() (*CertPool, error) { if block.Type != "CERTIFICATE" || len(block.Headers) != 0 { continue } - blockCh <- block - } - close(blockCh) - wg.Wait() - - if debugDarwinRoots { - mu.Lock() - defer mu.Unlock() - println(fmt.Sprintf("crypto/x509: ran security verify-cert %d times", numVerified)) + cert, err := ParseCertificate(block.Bytes) + if err != nil { + continue + } + f(cert) } - - return roots, nil + return nil } -func verifyCertWithSystem(block *pem.Block, cert *Certificate) bool { - data := pem.EncodeToMemory(block) +func verifyCertWithSystem(cert *Certificate) bool { + data := pem.EncodeToMemory(&pem.Block{ + Type: "CERTIFICATE", Bytes: cert.Raw, + }) f, err := ioutil.TempFile("", "cert") if err != nil { @@ -173,19 +198,19 @@ func verifyCertWithSystem(block *pem.Block, cert *Certificate) bool { fmt.Fprintf(os.Stderr, "can't write temporary file for cert: %v", err) return false } - cmd := exec.Command("/usr/bin/security", "verify-cert", "-c", f.Name(), "-l", "-L") + cmd := exec.Command("/usr/bin/security", "verify-cert", "-p", "ssl", "-c", f.Name(), "-l", "-L") var stderr bytes.Buffer if debugDarwinRoots { cmd.Stderr = &stderr } if err := cmd.Run(); err != nil { if debugDarwinRoots { - println(fmt.Sprintf("crypto/x509: verify-cert rejected %s: %q", cert.Subject, bytes.TrimSpace(stderr.Bytes()))) + fmt.Printf("crypto/x509: verify-cert rejected %s: %q\n", cert.Subject, bytes.TrimSpace(stderr.Bytes())) } return false } if debugDarwinRoots { - println(fmt.Sprintf("crypto/x509: verify-cert approved %s", cert.Subject)) + fmt.Printf("crypto/x509: verify-cert approved %s\n", cert.Subject) } return true } @@ -218,7 +243,7 @@ func getCertsWithTrustPolicy() (map[string]bool, error) { // localized on macOS, just interpret any failure to mean that // there are no trust settings. if debugDarwinRoots { - println(fmt.Sprintf("crypto/x509: exec %q: %v, %s", cmd.Args, err, stderr.Bytes())) + fmt.Printf("crypto/x509: exec %q: %v, %s\n", cmd.Args, err, stderr.Bytes()) } return nil } From 9536c5fa69d619395015fcd526a979e17320b4b1 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 6 Aug 2018 18:38:38 -0400 Subject: [PATCH 245/594] crypto/x509: re-enable TestSystemRoots Now that the cgo and no-cgo paths should be correct and equivalent, re-enable the TestSystemRoots test without any margin of error (which was tripping anyway when users had too many of a certain edge-case). As a last quirk, the verify-cert invocation will validate certificates that aren't roots, but are signed by valid roots. Ignore them. Fixes #24652 Change-Id: I6a8ff3c2282136d7122a4e7e387eb8014da0d28a Reviewed-on: https://go-review.googlesource.com/c/128117 TryBot-Result: Gobot Gobot Run-TryBot: Filippo Valsorda Reviewed-by: Adam Langley --- src/crypto/x509/root_darwin_test.go | 108 +++++++++++++++++++--------- 1 file changed, 74 insertions(+), 34 deletions(-) diff --git a/src/crypto/x509/root_darwin_test.go b/src/crypto/x509/root_darwin_test.go index 68300c7955714..27806538121f6 100644 --- a/src/crypto/x509/root_darwin_test.go +++ b/src/crypto/x509/root_darwin_test.go @@ -5,6 +5,9 @@ package x509 import ( + "os" + "os/exec" + "path/filepath" "runtime" "testing" "time" @@ -16,11 +19,6 @@ func TestSystemRoots(t *testing.T) { t.Skipf("skipping on %s/%s, no system root", runtime.GOOS, runtime.GOARCH) } - switch runtime.GOOS { - case "darwin": - t.Skipf("skipping on %s/%s until golang.org/issue/24652 has been resolved.", runtime.GOOS, runtime.GOARCH) - } - t0 := time.Now() sysRoots := systemRootsPool() // actual system roots sysRootsDuration := time.Since(t0) @@ -36,45 +34,87 @@ func TestSystemRoots(t *testing.T) { t.Logf(" cgo sys roots: %v", sysRootsDuration) t.Logf("non-cgo sys roots: %v", execSysRootsDuration) - for _, tt := range []*CertPool{sysRoots, execRoots} { - if tt == nil { - t.Fatal("no system roots") - } - // On Mavericks, there are 212 bundled certs, at least - // there was at one point in time on one machine. - // (Maybe it was a corp laptop with extra certs?) - // Other OS X users report - // 135, 142, 145... Let's try requiring at least 100, - // since this is just a sanity check. - t.Logf("got %d roots", len(tt.certs)) - if want, have := 100, len(tt.certs); have < want { - t.Fatalf("want at least %d system roots, have %d", want, have) - } + // On Mavericks, there are 212 bundled certs, at least there was at + // one point in time on one machine. (Maybe it was a corp laptop + // with extra certs?) Other OS X users report 135, 142, 145... + // Let's try requiring at least 100, since this is just a sanity + // check. + if want, have := 100, len(sysRoots.certs); have < want { + t.Errorf("want at least %d system roots, have %d", want, have) } - // Check that the two cert pools are roughly the same; - // |A∩B| > max(|A|, |B|) / 2 should be a reasonably robust check. + // Fetch any intermediate certificate that verify-cert might be aware of. + out, err := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", + "/Library/Keychains/System.keychain", + filepath.Join(os.Getenv("HOME"), "/Library/Keychains/login.keychain"), + filepath.Join(os.Getenv("HOME"), "/Library/Keychains/login.keychain-db")).Output() + if err != nil { + t.Fatal(err) + } + allCerts := NewCertPool() + allCerts.AppendCertsFromPEM(out) - isect := make(map[string]bool, len(sysRoots.certs)) + // Check that the two cert pools are the same. + sysPool := make(map[string]*Certificate, len(sysRoots.certs)) for _, c := range sysRoots.certs { - isect[string(c.Raw)] = true + sysPool[string(c.Raw)] = c } - - have := 0 for _, c := range execRoots.certs { - if isect[string(c.Raw)] { - have++ + if _, ok := sysPool[string(c.Raw)]; ok { + delete(sysPool, string(c.Raw)) + } else { + // verify-cert lets in certificates that are not trusted roots, but are + // signed by trusted roots. This should not be a problem, so confirm that's + // the case and skip them. + if _, err := c.Verify(VerifyOptions{ + Roots: sysRoots, + Intermediates: allCerts, + KeyUsages: []ExtKeyUsage{ExtKeyUsageAny}, + }); err != nil { + t.Errorf("certificate only present in non-cgo pool: %v (verify error: %v)", c.Subject, err) + } else { + t.Logf("signed certificate only present in non-cgo pool (acceptable): %v", c.Subject) + } } } + for _, c := range sysPool { + // The nocgo codepath uses verify-cert with the ssl policy, which also + // happens to check EKUs, so some certificates will appear only in the + // cgo pool. We can't easily make them consistent because the EKU check + // is only applied to the certificates passed to verify-cert. + var ekuOk bool + for _, eku := range c.ExtKeyUsage { + if eku == ExtKeyUsageServerAuth || eku == ExtKeyUsageNetscapeServerGatedCrypto || + eku == ExtKeyUsageMicrosoftServerGatedCrypto || eku == ExtKeyUsageAny { + ekuOk = true + } + } + if len(c.ExtKeyUsage) == 0 && len(c.UnknownExtKeyUsage) == 0 { + ekuOk = true + } + if !ekuOk { + t.Logf("off-EKU certificate only present in cgo pool (acceptable): %v", c.Subject) + continue + } + + // Same for expired certificates. We don't chain to them anyway. + now := time.Now() + if now.Before(c.NotBefore) || now.After(c.NotAfter) { + t.Logf("expired certificate only present in cgo pool (acceptable): %v", c.Subject) + continue + } - var want int - if nsys, nexec := len(sysRoots.certs), len(execRoots.certs); nsys > nexec { - want = nsys / 2 - } else { - want = nexec / 2 + t.Errorf("certificate only present in cgo pool: %v", c.Subject) } - if have < want { - t.Errorf("insufficient overlap between cgo and non-cgo roots; want at least %d, have %d", want, have) + if t.Failed() && debugDarwinRoots { + cmd := exec.Command("security", "dump-trust-settings") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + cmd.Run() + cmd = exec.Command("security", "dump-trust-settings", "-d") + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + cmd.Run() } } From 940e5bc5617ed86fcbf845fdd1973be984259a59 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Wed, 5 Dec 2018 13:22:44 -0500 Subject: [PATCH 246/594] doc/go1.12: add more release notes for various packages Change-Id: Ie11cf7d8204860f5a61ab650589d44072d6b131c Reviewed-on: https://go-review.googlesource.com/c/152740 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 51 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index c8dd487f65fe7..3afe21f3f9735 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -289,18 +289,10 @@

    Minor changes to the library

    -
    godoc, cmd/godoc
    -
    -

    - TODO: https://golang.org/cl/141397: remove CLI support -

    - -
    -
    image

    - TODO: https://golang.org/cl/118755: make RegisterFormat safe for concurrent use + The RegisterFormat function is now safe for concurrent use.

    @@ -308,7 +300,7 @@

    Minor changes to the library

    image/png

    - TODO: https://golang.org/cl/134235: pack image data for small bitdepth paletted images + Paletted images with fewer than 16 colors now encode to smaller outputs.

    @@ -332,7 +324,8 @@

    Minor changes to the library

    io

    - TODO: https://golang.org/cl/139457: export StringWriter + The new StringWriter interface wraps the + WriteString function.

    @@ -424,15 +417,19 @@

    Minor changes to the library

    - TODO: https://golang.org/cl/135075: add ModeCharDevice to ModeType + ModeCharDevice has been added to the ModeType bitmask, allowing for + ModeDevice | ModeCharDevice to be recovered when masking a + FileMode with ModeType.

    - TODO: https://golang.org/cl/139418: add UserHomeDir + The new function UserHomeDir returns the + current user's home directory.

    - TODO: https://golang.org/cl/146020: add support for long path names on unix RemoveAll + RemoveAll now supports paths longer than 4096 characters + on most Unix systems.

    @@ -440,7 +437,9 @@

    Minor changes to the library

    path/filepath

    - TODO: https://golang.org/cl/145220: change IsAbs("NUL") to return true + The IsAbs function now returns true when passed + a reserved filename on Windows such as NUL. + List of reserved names.

    @@ -504,7 +503,16 @@

    Minor changes to the library

    - TODO: https://golang.org/cl/131495: correctly handle invalid utf8 sequences in Map + The character mapping functions Map, + Title, + ToLower, + ToLowerSpecial, + ToTitle, + ToTitleSpecial, + ToUpper, and + ToUpperSpecial + now always guarantee to return valid UTF-8. In earlier releases, if the input was invalid UTF-8 but no character replacements + needed to be applied, these routines incorrectly returned the invalid UTF-8 unmodified.

    @@ -560,7 +568,16 @@

    Minor changes to the library

    text/template

    - TODO: https://golang.org/cl/142217: removed truncation of context in error message + When executing a template, long context values are no longer truncated in errors. +

    +

    + executing "tmpl" at <.very.deep.context.v...>: map has no entry for key "notpresent" +

    +

    + is now +

    +

    + executing "tmpl" at <.very.deep.context.value.notpresent>: map has no entry for key "notpresent"

    From dc7808d4f2989fa0514fc0e4014616fdb8c4a764 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 5 Dec 2018 14:42:47 -0800 Subject: [PATCH 247/594] cmd/compile/internal/syntax: remove unused field in (scanner) source The source.offs field was intended for computing line offsets which may allow a tiny optimization (see TODO in source.go). We haven't done the optimization, so for now just remove the field to avoid confusion. It's trivially added if needed. While at it, also: - Fix comment for ungetr2. - Make sure sentinel is present even if reading from the io.Reader failed. Change-Id: Ib056c6478030b3fe5fec29045362c8161ff3d19e Reviewed-on: https://go-review.googlesource.com/c/152763 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/syntax/source.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cmd/compile/internal/syntax/source.go b/src/cmd/compile/internal/syntax/source.go index 62eb0fdc30140..c6168b8594f74 100644 --- a/src/cmd/compile/internal/syntax/source.go +++ b/src/cmd/compile/internal/syntax/source.go @@ -33,7 +33,6 @@ type source struct { // source buffer buf [4 << 10]byte - offs int // source offset of buf r0, r, w int // previous/current read and write buf positions, excluding sentinel line0, line uint // previous/current line col0, col uint // previous/current column (byte offsets from line start) @@ -51,7 +50,6 @@ func (s *source) init(src io.Reader, errh func(line, pos uint, msg string)) { s.errh = errh s.buf[0] = utf8.RuneSelf // terminate with sentinel - s.offs = 0 s.r0, s.r, s.w = 0, 0, 0 s.line0, s.line = 0, linebase s.col0, s.col = 0, colbase @@ -68,7 +66,8 @@ func (s *source) ungetr() { // ungetr2 is like ungetr but enables a 2nd ungetr. // It must not be called if one of the runes seen -// was a newline. +// was a newline or had a UTF-8 encoding longer than +// 1 byte. func (s *source) ungetr2() { s.ungetr() // line must not have changed @@ -167,7 +166,6 @@ func (s *source) fill() { } n := s.r0 - 1 copy(s.buf[:], s.buf[n:s.w]) - s.offs += n s.r0 = 1 // eqv: s.r0 -= n s.r -= n s.w -= n @@ -189,6 +187,7 @@ func (s *source) fill() { } } + s.buf[s.w] = utf8.RuneSelf // sentinel s.ioerr = io.ErrNoProgress } From 9e0ec5ef5945696e90d7749d3569471c6f8b68c5 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 5 Dec 2018 17:08:27 -0800 Subject: [PATCH 248/594] go/types: better error messages for field lookup errors - follow wording of cmd/compile more closely - only print base of a package path to avoid overly long error messages Fixes #26234. Change-Id: I47a8c64b3adcf73980cd296a24cf8ac721e5df06 Reviewed-on: https://go-review.googlesource.com/c/152764 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor Reviewed-by: Alan Donovan --- src/go/types/call.go | 11 +++++++---- src/go/types/errors.go | 3 ++- src/go/types/testdata/issues.src | 27 ++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/src/go/types/call.go b/src/go/types/call.go index 52f1ac31ce1db..0ea1623903dae 100644 --- a/src/go/types/call.go +++ b/src/go/types/call.go @@ -374,11 +374,13 @@ func (check *Checker) selector(x *operand, e *ast.SelectorExpr) { switch { case index != nil: // TODO(gri) should provide actual type where the conflict happens - check.invalidOp(e.Sel.Pos(), "ambiguous selector %s", sel) + check.errorf(e.Sel.Pos(), "ambiguous selector %s", sel) case indirect: - check.invalidOp(e.Sel.Pos(), "%s is not in method set of %s", sel, x.typ) + // TODO(gri) be more specific with this error message + check.errorf(e.Sel.Pos(), "%s is not in method set of %s", sel, x.typ) default: - check.invalidOp(e.Sel.Pos(), "%s has no field or method %s", x, sel) + // TODO(gri) should check if capitalization of sel matters and provide better error message in that case + check.errorf(e.Sel.Pos(), "%s.%s undefined (type %s has no field or method %s)", x.expr, sel, x.typ, sel) } goto Error } @@ -392,7 +394,8 @@ func (check *Checker) selector(x *operand, e *ast.SelectorExpr) { // method expression m, _ := obj.(*Func) if m == nil { - check.invalidOp(e.Sel.Pos(), "%s has no method %s", x, sel) + // TODO(gri) should check if capitalization of sel matters and provide better error message in that case + check.errorf(e.Sel.Pos(), "%s.%s undefined (type %s has no method %s)", x.expr, sel, x.typ, sel) goto Error } diff --git a/src/go/types/errors.go b/src/go/types/errors.go index 4c8d8537ee6a6..68c96c037eacf 100644 --- a/src/go/types/errors.go +++ b/src/go/types/errors.go @@ -10,6 +10,7 @@ import ( "fmt" "go/ast" "go/token" + "path" "strings" ) @@ -25,7 +26,7 @@ func unreachable() { func (check *Checker) qualifier(pkg *Package) string { if pkg != check.pkg { - return pkg.path + return path.Base(pkg.path) // avoid excessively long path names in error messages } return "" } diff --git a/src/go/types/testdata/issues.src b/src/go/types/testdata/issues.src index 8260f58519d01..d02030110935e 100644 --- a/src/go/types/testdata/issues.src +++ b/src/go/types/testdata/issues.src @@ -5,6 +5,7 @@ package issues import "fmt" +import syn "cmd/compile/internal/syntax" func issue7035() { type T struct{ X int } @@ -312,4 +313,28 @@ func issue28281d(... /* ERROR can only use ... with final parameter */ int, int) func issue28281e(a, b, c ... /* ERROR can only use ... with final parameter */ int, d int) func issue28281f(... /* ERROR can only use ... with final parameter */ int, ... /* ERROR can only use ... with final parameter */ int, int) func (... /* ERROR expected type */ TT) f() -func issue28281g() (... /* ERROR expected type */ TT) \ No newline at end of file +func issue28281g() (... /* ERROR expected type */ TT) + +// Issue #26234: Make various field/method lookup errors easier to read by matching cmd/compile's output +func issue26234a(f *syn.File) { + // The error message below should refer to the actual package path base (syntax) + // not the local package name (syn). + f.foo /* ERROR f.foo undefined \(type \*syntax.File has no field or method foo\) */ +} + +type T struct { + x int + E1 + E2 +} + +type E1 struct{ f int } +type E2 struct{ f int } + +func issue26234b(x T) { + _ = x.f /* ERROR ambiguous selector f */ +} + +func issue26234c() { + T.x /* ERROR T.x undefined \(type T has no method x\) */ () +} From 02a0827d7960d0c828fad57b11c02794dec50552 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 5 Dec 2018 16:33:56 -0500 Subject: [PATCH 249/594] doc: 1.12 release notes for cmd/go Change-Id: I1a0bedc9fbd42e138eb68af8365115339e377856 Reviewed-on: https://go-review.googlesource.com/c/152742 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 72 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 3afe21f3f9735..3779c22a9d6ba 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -54,6 +54,25 @@

    Darwin

    Go 1.13 will require macOS 10.11 El Capitan or later.

    +

    Windows

    + +

    + TODO: status of ARM32 port? +

    + +

    AIX

    + +

    + TODO: status of AIX port? +

    + +

    Hurd

    + +

    + hurd is now a recognized value for GOOS, reserved + for the GNU/Hurd system for use with gccgo. +

    +

    Tools

    go tool vet no longer supported

    @@ -79,6 +98,40 @@

    Build cache requirement

    has no effect in Go 1.12.

    +

    Modules

    + +

    + When GO111MODULE is set to on, the go + command now supports module-aware operations outside of a module directory, + provided that those operations do not need to resolve import paths relative to + the current directory or explicitly edit the go.mod file. + Commands such as go get, + go list, and + go mod download behave as if in a + module with initially-empty requirements. + In this mode, go env GOMOD reports + the system's null device (/dev/null or NUL). +

    + +

    + go commands that download and extract modules are now safe to + invoke concurrently. + The module cache (GOPATH/pkg/mod) must reside in a filesystem that + supports file locking. +

    + +

    + The go directive in a go.mod file now indicates the + version of the language used by the files within that module, and + go mod tidy sets it to the + current release (go 1.12) if no existing + version is present. + If the go directive for a module specifies a + version newer than the toolchain in use, the go command + will attempt to build the packages regardless, and will note the mismatch only if + that build fails. +

    +

    Compiler toolchain

    @@ -121,6 +174,13 @@

    Compiler toolchain

    +

    + The compiler now accepts a -lang flag to set the Go language + version to use. For example, -lang=go1.8 causes the compiler to + emit an error if the program uses type aliases, which were added in Go 1.9. + Language changes made before Go 1.12 are not consistently enforced. +

    +

    Godoc

    @@ -146,12 +206,8 @@

    Minor changes to the library

    - - - - @@ -259,14 +315,6 @@

    Minor changes to the library

    -
    go/build, cmd/go
    -
    -

    - TODO: https://golang.org/cl/146023: add "hurd" as a GOOS value -

    - -
    -
    go/doc

    From fcd6117e9809a889974b50dad32002d3424ef6b2 Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Wed, 5 Dec 2018 16:23:52 -0500 Subject: [PATCH 250/594] cmd/internal/objfile: provide consistent output in objdump on ppc64x This makes a change to disasm.go so it provides consistent output with the recent updates to arch/ppc64. Change-Id: I812e5da2423fd1a84406032fd91ddf9cc86b7c69 Reviewed-on: https://go-review.googlesource.com/c/152761 Reviewed-by: Cherry Zhang Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot --- src/cmd/internal/objfile/disasm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/internal/objfile/disasm.go b/src/cmd/internal/objfile/disasm.go index fce63bfeeae0b..50fc51be87726 100644 --- a/src/cmd/internal/objfile/disasm.go +++ b/src/cmd/internal/objfile/disasm.go @@ -357,7 +357,7 @@ func disasm_ppc64(code []byte, pc uint64, lookup lookupFunc, byteOrder binary.By inst, err := ppc64asm.Decode(code, byteOrder) var text string size := inst.Len - if err != nil || size == 0 || inst.Op == 0 { + if err != nil || size == 0 { size = 4 text = "?" } else { From 6ff8c1db0bb8f0d149acf0187984f29326c10d56 Mon Sep 17 00:00:00 2001 From: Julie Qiu Date: Wed, 5 Dec 2018 16:36:18 -0500 Subject: [PATCH 251/594] doc/go1.12: release notes for lib/time Change-Id: Ic435090bda64d1061f2c3aac0aa94ed7a4800b0b Reviewed-on: https://go-review.googlesource.com/c/152743 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 3779c22a9d6ba..ec2d7146e3f2e 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -381,7 +381,7 @@

    Minor changes to the library

    lib/time

    - TODO: https://golang.org/cl/151299: update tzdata to 2018g + The time zone database in $GOROOT/lib/time/zoneinfo.zip has been updated to version 2018g. Note that this ZIP file is only used if a time zone database is not provided by the operating system.

    From 5b48ab8881928e7a23678b93836e32f961a9dddb Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 5 Dec 2018 10:20:24 -0500 Subject: [PATCH 252/594] cmd/go/internal/module: fix validation for module paths ending with /v Unlike "/v1", "/v" is not likely to be mistaken for a semantic import path. Change-Id: I024647d78c79c7761b98ddeccdc7e259ca94b568 Reviewed-on: https://go-review.googlesource.com/c/152738 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/module/module.go | 2 +- src/cmd/go/internal/module/module_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/internal/module/module.go b/src/cmd/go/internal/module/module.go index 1dbb0f5cb7996..8afd2739b86b1 100644 --- a/src/cmd/go/internal/module/module.go +++ b/src/cmd/go/internal/module/module.go @@ -284,7 +284,7 @@ func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) { } i-- } - if i <= 1 || path[i-1] != 'v' || path[i-2] != '/' { + if i <= 1 || i == len(path) || path[i-1] != 'v' || path[i-2] != '/' { return path, "", true } prefix, pathMajor = path[:i-2], path[i-2:] diff --git a/src/cmd/go/internal/module/module_test.go b/src/cmd/go/internal/module/module_test.go index f21d620d328f8..b40bd03dfa65b 100644 --- a/src/cmd/go/internal/module/module_test.go +++ b/src/cmd/go/internal/module/module_test.go @@ -214,6 +214,7 @@ var splitPathVersionTests = []struct { {"x.y/z", ""}, {"x.y/z", "/v2"}, {"x.y/z", "/v3"}, + {"x.y/v", ""}, {"gopkg.in/yaml", ".v0"}, {"gopkg.in/yaml", ".v1"}, {"gopkg.in/yaml", ".v2"}, From bae1e70ac4a963bfb167136fc6b40988bc9cd546 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 6 Dec 2018 13:54:07 -0500 Subject: [PATCH 253/594] runtime: print pointers being put in checkPut In order to further diagnose #27993, I need to see exactly what pointers are being added to the gcWork buffer too late. Change-Id: I8d92113426ffbc6e55d819c39e7ab5eafa68668d Reviewed-on: https://go-review.googlesource.com/c/152957 Run-TryBot: Austin Clements Reviewed-by: Michael Knyszek --- src/runtime/mgcwork.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go index 8a77ff55e4d1d..cdc94b8ffb11e 100644 --- a/src/runtime/mgcwork.go +++ b/src/runtime/mgcwork.go @@ -115,11 +115,19 @@ func (w *gcWork) init() { w.wbuf2 = wbuf2 } -func (w *gcWork) checkPut() { +func (w *gcWork) checkPut(ptr uintptr, ptrs []uintptr) { if debugCachedWork { for atomic.Load(&gcWorkPauseGen) == w.pauseGen { } if throwOnGCWork { + printlock() + println("runtime: late gcWork put") + if ptr != 0 { + gcDumpObject("ptr", ptr, ^uintptr(0)) + } + for _, ptr := range ptrs { + gcDumpObject("ptrs", ptr, ^uintptr(0)) + } throw("throwOnGCWork") } } @@ -129,7 +137,7 @@ func (w *gcWork) checkPut() { // obj must point to the beginning of a heap object or an oblet. //go:nowritebarrierrec func (w *gcWork) put(obj uintptr) { - w.checkPut() + w.checkPut(obj, nil) flushed := false wbuf := w.wbuf1 @@ -165,7 +173,7 @@ func (w *gcWork) put(obj uintptr) { // otherwise it returns false and the caller needs to call put. //go:nowritebarrierrec func (w *gcWork) putFast(obj uintptr) bool { - w.checkPut() + w.checkPut(obj, nil) wbuf := w.wbuf1 if wbuf == nil { @@ -188,7 +196,7 @@ func (w *gcWork) putBatch(obj []uintptr) { return } - w.checkPut() + w.checkPut(0, obj) flushed := false wbuf := w.wbuf1 @@ -311,12 +319,12 @@ func (w *gcWork) balance() { return } if wbuf := w.wbuf2; wbuf.nobj != 0 { - w.checkPut() + w.checkPut(0, wbuf.obj[:wbuf.nobj]) putfull(wbuf) w.flushedWork = true w.wbuf2 = getempty() } else if wbuf := w.wbuf1; wbuf.nobj > 4 { - w.checkPut() + w.checkPut(0, wbuf.obj[:wbuf.nobj]) w.wbuf1 = handoff(wbuf) w.flushedWork = true // handoff did putfull } else { From d6c12ec0eff53a4b11186eb0bb11cb683afe2779 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 5 Dec 2018 09:52:58 -0500 Subject: [PATCH 254/594] cmd/go/internal/modload: use replacements to resolve missing imports If the replacements specify one or more versions, we choose the latest (for consistency with the QueryPackage path, with resolves the latest version from upstream). Otherwise, we synthesize a pseudo-version with a zero timestamp and an appropriate major version. Fixes #26241 RELNOTE=yes Change-Id: I14b4c63858c8714cc3e1b05ac52c33de5a16dea9 Reviewed-on: https://go-review.googlesource.com/c/152739 Reviewed-by: Russ Cox Reviewed-by: Jay Conrod Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/go/internal/modload/import.go | 52 ++++++++- src/cmd/go/testdata/script/mod_replace.txt | 3 +- .../go/testdata/script/mod_replace_import.txt | 109 ++++++++++++++++++ 3 files changed, 161 insertions(+), 3 deletions(-) create mode 100644 src/cmd/go/testdata/script/mod_replace_import.txt diff --git a/src/cmd/go/internal/modload/import.go b/src/cmd/go/internal/modload/import.go index 96e546d6df01c..3210e16c25b08 100644 --- a/src/cmd/go/internal/modload/import.go +++ b/src/cmd/go/internal/modload/import.go @@ -12,13 +12,17 @@ import ( "internal/goroot" "os" "path/filepath" + "sort" "strings" + "time" "cmd/go/internal/cfg" + "cmd/go/internal/modfetch" "cmd/go/internal/modfetch/codehost" "cmd/go/internal/module" "cmd/go/internal/par" "cmd/go/internal/search" + "cmd/go/internal/semver" ) type ImportMissingError struct { @@ -122,14 +126,58 @@ func Import(path string) (m module.Version, dir string, err error) { return module.Version{}, "", errors.New(buf.String()) } - // Not on build list. - // Look up module containing the package, for addition to the build list. // Goal is to determine the module, download it to dir, and return m, dir, ErrMissing. if cfg.BuildMod == "readonly" { return module.Version{}, "", fmt.Errorf("import lookup disabled by -mod=%s", cfg.BuildMod) } + // Not on build list. + // To avoid spurious remote fetches, next try the latest replacement for each module. + // (golang.org/issue/26241) + if modFile != nil { + latest := map[string]string{} // path -> version + for _, r := range modFile.Replace { + if maybeInModule(path, r.Old.Path) { + latest[r.Old.Path] = semver.Max(r.Old.Version, latest[r.Old.Path]) + } + } + + mods = make([]module.Version, 0, len(latest)) + for p, v := range latest { + // If the replacement didn't specify a version, synthesize a + // pseudo-version with an appropriate major version and a timestamp below + // any real timestamp. That way, if the main module is used from within + // some other module, the user will be able to upgrade the requirement to + // any real version they choose. + if v == "" { + if _, pathMajor, ok := module.SplitPathVersion(p); ok && len(pathMajor) > 0 { + v = modfetch.PseudoVersion(pathMajor[1:], "", time.Time{}, "000000000000") + } else { + v = modfetch.PseudoVersion("v0", "", time.Time{}, "000000000000") + } + } + mods = append(mods, module.Version{Path: p, Version: v}) + } + + // Every module path in mods is a prefix of the import path. + // As in QueryPackage, prefer the longest prefix that satisfies the import. + sort.Slice(mods, func(i, j int) bool { + return len(mods[i].Path) > len(mods[j].Path) + }) + for _, m := range mods { + root, isLocal, err := fetch(m) + if err != nil { + // Report fetch error as above. + return module.Version{}, "", err + } + _, ok := dirInModule(path, m.Path, root, isLocal) + if ok { + return m, "", &ImportMissingError{ImportPath: path, Module: m} + } + } + } + m, _, err = QueryPackage(path, "latest", Allowed) if err != nil { if _, ok := err.(*codehost.VCSError); ok { diff --git a/src/cmd/go/testdata/script/mod_replace.txt b/src/cmd/go/testdata/script/mod_replace.txt index b9cf00c36cb5b..78d6729fce322 100644 --- a/src/cmd/go/testdata/script/mod_replace.txt +++ b/src/cmd/go/testdata/script/mod_replace.txt @@ -30,9 +30,10 @@ stderr 'rsc.io/quote/v3@v3.0.0 used for two different module paths \(not-rsc.io/ # Modules that do not (yet) exist upstream can be replaced too. cp go.mod.orig go.mod -go mod edit -require not-rsc.io/quote/v3@v3.0.0 -replace=not-rsc.io/quote/v3=./local/rsc.io/quote/v3 +go mod edit -replace=not-rsc.io/quote/v3@v3.1.0=./local/rsc.io/quote/v3 go build -o a5.exe ./usenewmodule ! stderr 'finding not-rsc.io/quote/v3' +grep 'not-rsc.io/quote/v3 v3.1.0' go.mod exec ./a5.exe stdout 'Concurrency is not parallelism.' diff --git a/src/cmd/go/testdata/script/mod_replace_import.txt b/src/cmd/go/testdata/script/mod_replace_import.txt new file mode 100644 index 0000000000000..0da753a1a763c --- /dev/null +++ b/src/cmd/go/testdata/script/mod_replace_import.txt @@ -0,0 +1,109 @@ +env GO111MODULE=on + +# 'go list -mod=readonly' should not add requirements even if they can be +# resolved locally. +cp go.mod go.mod.orig +! go list -mod=readonly all +cmp go.mod go.mod.orig + +# 'go list' should resolve imports using replacements. +go list all +stdout 'example.com/a/b$' +stdout 'example.com/x/v3$' +stdout 'example.com/y/z/w$' +stdout 'example.com/v' + +# The selected modules should prefer longer paths, +# but should try shorter paths if needed. +# Modules with a major-version suffix should have a corresponding pseudo-version. +# Replacements that specify a version should use the latest such version. +go list -m all +stdout 'example.com/a/b v0.0.0-00010101000000-000000000000 => ./b' +stdout 'example.com/y v0.0.0-00010101000000-000000000000 => ./y' +stdout 'example.com/x/v3 v3.0.0-00010101000000-000000000000 => ./v3' +stdout 'example.com/v v1.12.0 => ./v12' + +-- go.mod -- +module example.com/m + +replace ( + example.com/a => ./a + example.com/a/b => ./b +) + +replace ( + example.com/x => ./x + example.com/x/v3 => ./v3 +) + +replace ( + example.com/y/z/w => ./w + example.com/y => ./y +) + +replace ( + example.com/v v1.11.0 => ./v11 + example.com/v v1.12.0 => ./v12 + example.com/v => ./v +) + +-- m.go -- +package main +import ( + _ "example.com/a/b" + _ "example.com/x/v3" + _ "example.com/y/z/w" + _ "example.com/v" +) +func main() {} + +-- a/go.mod -- +module a.localhost +-- a/a.go -- +package a +-- a/b/b.go-- +package b + +-- b/go.mod -- +module a.localhost/b +-- b/b.go -- +package b + +-- x/go.mod -- +module x.localhost +-- x/x.go -- +package x +-- x/v3.go -- +package v3 +import _ "x.localhost/v3" + +-- v3/go.mod -- +module x.localhost/v3 +-- v3/x.go -- +package x + +-- w/go.mod -- +module w.localhost +-- w/skip/skip.go -- +// Package skip is nested below nonexistent package w. +package skip + +-- y/go.mod -- +module y.localhost +-- y/z/w/w.go -- +package w + +-- v12/go.mod -- +module v.localhost +-- v12/v.go -- +package v + +-- v11/go.mod -- +module v.localhost +-- v11/v.go -- +package v + +-- v/go.mod -- +module v.localhost +-- v/v.go -- +package v From ec0077c54d6261ba5cbab2c5dc2e80345068233f Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 6 Dec 2018 20:58:26 +0100 Subject: [PATCH 255/594] crypto/x509: explicitly cast printf format argument After CL 128056 the build fails on darwin/386 with src/crypto/x509/root_cgo_darwin.go:218:55: warning: values of type 'SInt32' should not be used as format arguments; add an explicit cast to 'int' instead [-Wformat] go build crypto/x509: C compiler warning promoted to error on Go builders Fix the warning by explicitly casting the argument to an int as suggested by the warning. Change-Id: Icb6bd622a543e9bc5f669fd3d7abd418b4a8e579 Reviewed-on: https://go-review.googlesource.com/c/152958 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/crypto/x509/root_cgo_darwin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go index a168135a33477..e6332072d62a5 100644 --- a/src/crypto/x509/root_cgo_darwin.go +++ b/src/crypto/x509/root_cgo_darwin.go @@ -215,7 +215,7 @@ int FetchPEMRoots(CFDataRef *pemRoots, CFDataRef *untrustedPemRoots, bool debugD CFIndex maxSize = CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8) + 1; char *buffer = malloc(maxSize); if (CFStringGetCString(summary, buffer, maxSize, kCFStringEncodingUTF8)) { - printf("crypto/x509: %s returned %d\n", buffer, result); + printf("crypto/x509: %s returned %d\n", buffer, (int)result); } free(buffer); CFRelease(summary); From 4a801cdd319dc25a2bcdced0b70377c2dfa1464f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 5 Dec 2018 17:24:41 -0800 Subject: [PATCH 256/594] cmd/cover: run tests in parallel, don't change source directory This speeds up the cmd/cover testsuite by about 40% on my laptop. Updates #26473 Updates #28386 Change-Id: I853b1b3b8c98dc89440f7b7bf5c0ade1d3d66802 Reviewed-on: https://go-review.googlesource.com/c/152817 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/cover/cover_test.go | 147 +++++++++++++++++++++++++----------- 1 file changed, 102 insertions(+), 45 deletions(-) diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index 8eb7124aad85b..a374dc4e9bb51 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -19,43 +19,103 @@ import ( "path/filepath" "regexp" "strings" + "sync" "testing" ) const ( // Data directory, also the package directory for the test. testdata = "testdata" - - // Binaries we compile. - testcover = "./testcover.exe" ) var ( - // Files we use. + // Input files. testMain = filepath.Join(testdata, "main.go") testTest = filepath.Join(testdata, "test.go") - coverInput = filepath.Join(testdata, "test_line.go") - coverOutput = filepath.Join(testdata, "test_cover.go") coverProfile = filepath.Join(testdata, "profile.cov") // The HTML test files are in a separate directory // so they are a complete package. - htmlProfile = filepath.Join(testdata, "html", "html.cov") - htmlHTML = filepath.Join(testdata, "html", "html.html") - htmlGolden = filepath.Join(testdata, "html", "html.golden") + htmlGolden = filepath.Join(testdata, "html", "html.golden") + + // Temporary files. + tmpTestMain string + coverInput string + coverOutput string + htmlProfile string + htmlHTML string +) + +var ( + // testTempDir is a temporary directory created in TestMain. + testTempDir string + + // testcover is a newly built version of the cover program. + testcover string + + // testcoverErr records an error building testcover. + testcoverErr error + + // testcoverOnce is used to build testcover once. + testcoverOnce sync.Once ) var debug = flag.Bool("debug", false, "keep rewritten files for debugging") +// We use TestMain to set up a temporary directory and remove it when +// the tests are done. +func TestMain(m *testing.M) { + dir, err := ioutil.TempDir("", "gotestcover") + if err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } + + testTempDir = dir + + tmpTestMain = filepath.Join(dir, "main.go") + coverInput = filepath.Join(dir, "test_line.go") + coverOutput = filepath.Join(dir, "test_cover.go") + htmlProfile = filepath.Join(dir, "html.cov") + htmlHTML = filepath.Join(dir, "html.html") + + status := m.Run() + + if !*debug { + os.RemoveAll(dir) + } + + os.Exit(status) +} + +// buildCover builds a version of the cover program for testing. +// This ensures that "go test cmd/cover" tests the current cmd/cover. +func buildCover(t *testing.T) { + t.Helper() + testenv.MustHaveGoBuild(t) + testcoverOnce.Do(func() { + testcover = filepath.Join(testTempDir, "testcover.exe") + t.Logf("running [go build -o %s]", testcover) + out, err := exec.Command(testenv.GoToolPath(t), "build", "-o", testcover).CombinedOutput() + t.Logf("%s", out) + testcoverErr = err + }) + if testcoverErr != nil { + t.Fatal("failed to build testcover program:", testcoverErr) + } +} + // Run this shell script, but do it in Go so it can be run by "go test". // // replace the word LINE with the line number < testdata/test.go > testdata/test_line.go -// go build -o ./testcover -// ./testcover -mode=count -var=CoverTest -o ./testdata/test_cover.go testdata/test_line.go +// go build -o testcover +// testcover -mode=count -var=CoverTest -o ./testdata/test_cover.go testdata/test_line.go // go run ./testdata/main.go ./testdata/test.go // func TestCover(t *testing.T) { - testenv.MustHaveGoBuild(t) + t.Parallel() + testenv.MustHaveGoRun(t) + buildCover(t) // Read in the test file (testTest) and write it, with LINEs specified, to coverInput. file, err := ioutil.ReadFile(testTest) @@ -81,29 +141,22 @@ func TestCover(t *testing.T) { t.Fatal(err) } - // defer removal of test_line.go - if !*debug { - defer os.Remove(coverInput) - } - - // go build -o testcover - cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", testcover) + // testcover -mode=count -var=thisNameMustBeVeryLongToCauseOverflowOfCounterIncrementStatementOntoNextLineForTest -o ./testdata/test_cover.go testdata/test_line.go + cmd := exec.Command(testcover, "-mode=count", "-var=thisNameMustBeVeryLongToCauseOverflowOfCounterIncrementStatementOntoNextLineForTest", "-o", coverOutput, coverInput) run(cmd, t) - // defer removal of testcover - defer os.Remove(testcover) - - // ./testcover -mode=count -var=thisNameMustBeVeryLongToCauseOverflowOfCounterIncrementStatementOntoNextLineForTest -o ./testdata/test_cover.go testdata/test_line.go - cmd = exec.Command(testcover, "-mode=count", "-var=thisNameMustBeVeryLongToCauseOverflowOfCounterIncrementStatementOntoNextLineForTest", "-o", coverOutput, coverInput) - run(cmd, t) - - // defer removal of ./testdata/test_cover.go - if !*debug { - defer os.Remove(coverOutput) + // Copy testmain to testTempDir, so that it is in the same directory + // as coverOutput. + b, err := ioutil.ReadFile(testMain) + if err != nil { + t.Fatal(err) + } + if err := ioutil.WriteFile(tmpTestMain, b, 0444); err != nil { + t.Fatal(err) } // go run ./testdata/main.go ./testdata/test.go - cmd = exec.Command(testenv.GoToolPath(t), "run", testMain, coverOutput) + cmd = exec.Command(testenv.GoToolPath(t), "run", tmpTestMain, coverOutput) run(cmd, t) file, err = ioutil.ReadFile(coverOutput) @@ -131,6 +184,9 @@ func TestCover(t *testing.T) { // above those declarations, even if they are not part of the block of // documentation comments. func TestDirectives(t *testing.T) { + t.Parallel() + buildCover(t) + // Read the source file and find all the directives. We'll keep // track of whether each one has been seen in the output. testDirectives := filepath.Join(testdata, "directives.go") @@ -140,8 +196,8 @@ func TestDirectives(t *testing.T) { } sourceDirectives := findDirectives(source) - // go tool cover -mode=atomic ./testdata/directives.go - cmd := exec.Command(testenv.GoToolPath(t), "tool", "cover", "-mode=atomic", testDirectives) + // testcover -mode=atomic ./testdata/directives.go + cmd := exec.Command(testcover, "-mode=atomic", testDirectives) cmd.Stderr = os.Stderr output, err := cmd.Output() if err != nil { @@ -247,8 +303,10 @@ func findDirectives(source []byte) []directiveInfo { // Makes sure that `cover -func=profile.cov` reports accurate coverage. // Issue #20515. func TestCoverFunc(t *testing.T) { - // go tool cover -func ./testdata/profile.cov - cmd := exec.Command(testenv.GoToolPath(t), "tool", "cover", "-func", coverProfile) + t.Parallel() + buildCover(t) + // testcover -func ./testdata/profile.cov + cmd := exec.Command(testcover, "-func", coverProfile) out, err := cmd.Output() if err != nil { if ee, ok := err.(*exec.ExitError); ok { @@ -266,19 +324,14 @@ func TestCoverFunc(t *testing.T) { // Check that cover produces correct HTML. // Issue #25767. func TestCoverHTML(t *testing.T) { - testenv.MustHaveGoBuild(t) - if !*debug { - defer os.Remove(testcover) - defer os.Remove(htmlProfile) - defer os.Remove(htmlHTML) - } - // go build -o testcover - cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", testcover) - run(cmd, t) + t.Parallel() + testenv.MustHaveGoRun(t) + buildCover(t) + // go test -coverprofile testdata/html/html.cov cmd/cover/testdata/html - cmd = exec.Command(testenv.GoToolPath(t), "test", "-coverprofile", htmlProfile, "cmd/cover/testdata/html") + cmd := exec.Command(testenv.GoToolPath(t), "test", "-coverprofile", htmlProfile, "cmd/cover/testdata/html") run(cmd, t) - // ./testcover -html testdata/html/html.cov -o testdata/html/html.html + // testcover -html testdata/html/html.cov -o testdata/html/html.html cmd = exec.Command(testcover, "-html", htmlProfile, "-o", htmlHTML) run(cmd, t) @@ -303,6 +356,9 @@ func TestCoverHTML(t *testing.T) { in = false } } + if scan.Err() != nil { + t.Error(scan.Err()) + } golden, err := ioutil.ReadFile(htmlGolden) if err != nil { t.Fatalf("reading golden file: %v", err) @@ -331,6 +387,7 @@ func TestCoverHTML(t *testing.T) { func run(c *exec.Cmd, t *testing.T) { t.Helper() + t.Log("running", c.Args) c.Stdout = os.Stdout c.Stderr = os.Stderr err := c.Run() From 276870d6e0ff5d22b73feee56e0bad9096f01b22 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 6 Dec 2018 13:32:50 -0800 Subject: [PATCH 257/594] math: document sign bit correspondence for floating-point/bits conversions Fixes #27736. Change-Id: Ibda7da7ec6e731626fc43abf3e8c1190117f7885 Reviewed-on: https://go-review.googlesource.com/c/153057 Reviewed-by: Ian Lance Taylor --- src/math/unsafe.go | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/math/unsafe.go b/src/math/unsafe.go index 5ae67420f4dc0..e59f50ca62e5c 100644 --- a/src/math/unsafe.go +++ b/src/math/unsafe.go @@ -6,16 +6,24 @@ package math import "unsafe" -// Float32bits returns the IEEE 754 binary representation of f. +// Float32bits returns the IEEE 754 binary representation of f, +// with the sign bit of f and the result in the same bit position. +// Float32bits(Float32frombits(x)) == x. func Float32bits(f float32) uint32 { return *(*uint32)(unsafe.Pointer(&f)) } -// Float32frombits returns the floating point number corresponding -// to the IEEE 754 binary representation b. +// Float32frombits returns the floating-point number corresponding +// to the IEEE 754 binary representation b, with the sign bit of b +// and the result in the same bit position. +// Float32frombits(Float32bits(x)) == x. func Float32frombits(b uint32) float32 { return *(*float32)(unsafe.Pointer(&b)) } -// Float64bits returns the IEEE 754 binary representation of f. +// Float64bits returns the IEEE 754 binary representation of f, +// with the sign bit of f and the result in the same bit position, +// and Float64bits(Float64frombits(x)) == x. func Float64bits(f float64) uint64 { return *(*uint64)(unsafe.Pointer(&f)) } -// Float64frombits returns the floating point number corresponding -// the IEEE 754 binary representation b. +// Float64frombits returns the floating-point number corresponding +// to the IEEE 754 binary representation b, with the sign bit of b +// and the result in the same bit position. +// Float64frombits(Float64bits(x)) == x. func Float64frombits(b uint64) float64 { return *(*float64)(unsafe.Pointer(&b)) } From e546ef123e6e3a28dc7722fb6bbf1161b7024163 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 7 Dec 2018 07:25:50 -0800 Subject: [PATCH 258/594] cmd/internal/obj/s390x: don't crash on invalid instruction I didn't bother with a test as there doesn't seem to be an existing framework for testing assembler failures, and tests for invalid code aren't all that interesting. Fixes #26700 Change-Id: I719410d83527802a09b9d38625954fdb36a3c0f7 Reviewed-on: https://go-review.googlesource.com/c/153177 Run-TryBot: Ian Lance Taylor Reviewed-by: Michael Munday TryBot-Result: Gobot Gobot --- src/cmd/internal/obj/s390x/asmz.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/internal/obj/s390x/asmz.go b/src/cmd/internal/obj/s390x/asmz.go index 4e43d27790055..7d49103be6fb6 100644 --- a/src/cmd/internal/obj/s390x/asmz.go +++ b/src/cmd/internal/obj/s390x/asmz.go @@ -2618,6 +2618,10 @@ func (c *ctxtz) branchMask(p *obj.Prog) uint32 { func (c *ctxtz) asmout(p *obj.Prog, asm *[]byte) { o := c.oplook(p) + if o == nil { + return + } + switch o.type_ { default: c.ctxt.Diag("unknown type %d", o.type_) From 6129e331acbb2158f015e3b48b82da330087621a Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 6 Dec 2018 09:03:59 -0500 Subject: [PATCH 259/594] doc: announce the end of support for binary-only packages Updates #28152 Change-Id: If859221afc683b392f649e79d7ff0a06125cbe10 Reviewed-on: https://go-review.googlesource.com/c/152918 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index ec2d7146e3f2e..291c19ace2517 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -98,6 +98,12 @@

    Build cache requirement

    has no effect in Go 1.12.

    +

    Binary-only packages

    + +

    + Go 1.12 is the last release that will support binary-only packages. +

    +

    Modules

    From f604b6ce3877bf7d612c3aaaa429a304bd2fa383 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 7 Dec 2018 10:14:42 -0500 Subject: [PATCH 260/594] doc: mention the use of replacements to resolve imports for 1.12 Updates #26241 Change-Id: I8ffac13d9cc1ee4d4de8fcd2042a7fa60fca567b Reviewed-on: https://go-review.googlesource.com/c/153157 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 291c19ace2517..4c2765021f5cd 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -138,6 +138,17 @@

    Modules

    that build fails.

    +

    + When an import cannot be resolved using the active modules, + the go command will now try to use the modules mentioned in the + main module's replace directives before consulting the module + cache and the usual network sources. + If a matching replacement is found but the replace directive does + not specify a version, the go command uses a pseudo-version + derived from the zero time.Time (such + as v0.0.0-00010101000000-000000000000). +

    +

    Compiler toolchain

    From 578667f4b534974f28909dbc34bce7fe1686c5d3 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Thu, 6 Dec 2018 21:51:51 +0000 Subject: [PATCH 261/594] runtime: enable preemption of mark termination goroutine A mark worker goroutine may attempt to preempt the mark termination goroutine to scan its stack while the mark termination goroutine is trying to preempt that worker to flush its work buffer, in rare cases. This change makes it so that, like a worker goroutine, the mark termination goroutine stack is preemptible while it is on the system stack, attempting to preempt others. Fixes #28695. Change-Id: I23bbb191f4fdad293e8a70befd51c9175f8a1171 Reviewed-on: https://go-review.googlesource.com/c/153077 Reviewed-by: Rick Hudson Reviewed-by: Austin Clements --- src/runtime/mgc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 7747e5409c9ae..622750ed2ea9e 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1417,6 +1417,12 @@ top: // Flush all local buffers and collect flushedWork flags. gcMarkDoneFlushed = 0 systemstack(func() { + gp := getg().m.curg + // Mark the user stack as preemptible so that it may be scanned. + // Otherwise, our attempt to force all P's to a safepoint could + // result in a deadlock as we attempt to preempt a worker that's + // trying to preempt us (e.g. for a stack scan). + casgstatus(gp, _Grunning, _Gwaiting) forEachP(func(_p_ *p) { // Flush the write barrier buffer, since this may add // work to the gcWork. @@ -1449,6 +1455,7 @@ top: _p_.gcw.pauseGen = gcWorkPauseGen } }) + casgstatus(gp, _Gwaiting, _Grunning) }) if gcMarkDoneFlushed != 0 { From 048988a0f14f74c0a27efe93699221bc49b7873c Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Tue, 4 Dec 2018 15:15:27 -0500 Subject: [PATCH 262/594] runtime: fix runtime-gdb.py when switching sp value After a recent change to runtime-gdb_test.go the ppc64le builder has had intermittent failures. The failures occur when trying to invoke the goroutineCmd function to display the backtrace for a selected goroutine. There is nothing wrong with the testcase but it seems to intermittently leave goroutines in a state where an error can occur. The error message indicates that the problem occurs when trying to change the sp back to the original after displaying the stacktrace for the goroutine. gdb.error: Attempt to assign to an unmodifiable value. After some searching I found that this error message can happen if the sp register is changed when on a frame that is not the top-most frame. To fix the problem, frame 0 is selected before changing the value of sp. This fixes the problem in my reproducer environment, and hopefully will fix the problem on the builder. Updates #28679 Change-Id: I329bc95b30f8c95acfb161b0d9cfdcbd917a1954 Reviewed-on: https://go-review.googlesource.com/c/152540 Run-TryBot: Lynn Boger Reviewed-by: Austin Clements TryBot-Result: Gobot Gobot --- src/runtime/runtime-gdb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runtime/runtime-gdb.py b/src/runtime/runtime-gdb.py index 510c08c286ca0..4c32c633cf1f1 100644 --- a/src/runtime/runtime-gdb.py +++ b/src/runtime/runtime-gdb.py @@ -528,11 +528,17 @@ def invoke(self, arg, _from_tty): save_frame = gdb.selected_frame() gdb.parse_and_eval('$save_sp = $sp') gdb.parse_and_eval('$save_pc = $pc') + # In GDB, assignments to sp must be done from the + # top-most frame, so select frame 0 first. + gdb.execute('select-frame 0') gdb.parse_and_eval('$sp = {0}'.format(str(sp))) gdb.parse_and_eval('$pc = {0}'.format(str(pc))) try: gdb.execute(cmd) finally: + # In GDB, assignments to sp must be done from the + # top-most frame, so select frame 0 first. + gdb.execute('select-frame 0') gdb.parse_and_eval('$sp = $save_sp') gdb.parse_and_eval('$pc = $save_pc') save_frame.select() From d20b6d8849ca3c7c1461b28418afb15ed7652712 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 7 Dec 2018 12:08:12 -0500 Subject: [PATCH 263/594] cmd/go/internal/modload: add missing build constraint in testgo.go That file is supposed to make unexpected dependencies on the main module easier to diagnose in 'go test cmd/go', but I accidentally left off the build constraint, so it was triggering outside of the test. Updates #29097 Change-Id: I1cde3fe6c1d80add37c98a8c95ce48524ea05024 Reviewed-on: https://go-review.googlesource.com/c/153159 Run-TryBot: Bryan C. Mills Reviewed-by: Jay Conrod --- src/cmd/go/internal/modload/testgo.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cmd/go/internal/modload/testgo.go b/src/cmd/go/internal/modload/testgo.go index 6cfba0c68fcf2..663b24a68d792 100644 --- a/src/cmd/go/internal/modload/testgo.go +++ b/src/cmd/go/internal/modload/testgo.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//+build testgo + package modload func init() { From 9555769aa5f706075dc5930f3dba2e3a31c110c3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 7 Dec 2018 12:18:22 -0800 Subject: [PATCH 264/594] cmd/link: use filepath.Join rather than d + "/" + f Fixes #26917 Change-Id: I676f016ed43aaa523b6d3a87b28a1d1d2ebe72c4 Reviewed-on: https://go-review.googlesource.com/c/153237 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick --- src/cmd/link/internal/ld/ld.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/link/internal/ld/ld.go b/src/cmd/link/internal/ld/ld.go index 896e1c87d242f..9e5e2f98726ef 100644 --- a/src/cmd/link/internal/ld/ld.go +++ b/src/cmd/link/internal/ld/ld.go @@ -136,13 +136,13 @@ func findlib(ctxt *Link, lib string) (string, bool) { // try dot, -L "libdir", and then goroot. for _, dir := range ctxt.Libdir { if ctxt.linkShared { - pname = dir + "/" + pkg + ".shlibname" + pname = filepath.Join(dir, pkg+".shlibname") if _, err := os.Stat(pname); err == nil { isshlib = true break } } - pname = dir + "/" + name + pname = filepath.Join(dir, name) if _, err := os.Stat(pname); err == nil { break } From 444887dde8393c3bbf94122c17ab7f005a7257c4 Mon Sep 17 00:00:00 2001 From: Julie Qiu Date: Thu, 6 Dec 2018 14:13:28 -0500 Subject: [PATCH 265/594] doc/go1.12: release notes for math/bits Change-Id: I930942c7e057a36332ac06762f6aadf07574a7d5 Reviewed-on: https://go-review.googlesource.com/c/152977 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 4c2765021f5cd..0e381eb679c1c 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -406,7 +406,7 @@

    Minor changes to the library

    math/bits

    - TODO: https://golang.org/cl/123157: add extended precision Add, Sub, Mul, Div + New extended precision operations Add, Sub, Mul, and Div are available in int, int32, and int64 versions.

    From 179909f20556262422a8b99c059eacdfcebc48ee Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Fri, 16 Nov 2018 10:46:14 -0600 Subject: [PATCH 266/594] cmd/go: disallow version string in go mod init module path To prevent confusion, go mod init should not allow version strings in the module path when provided as an argument. Instead, fail with a useful error message. Fixes #28803 Change-Id: I59272a91b042e32cef33c2e2116f760ca1def218 Reviewed-on: https://go-review.googlesource.com/c/150018 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/modcmd/init.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/go/internal/modcmd/init.go b/src/cmd/go/internal/modcmd/init.go index f510a46262b4e..0f7421e5849f2 100644 --- a/src/cmd/go/internal/modcmd/init.go +++ b/src/cmd/go/internal/modcmd/init.go @@ -10,6 +10,7 @@ import ( "cmd/go/internal/base" "cmd/go/internal/modload" "os" + "strings" ) var cmdInit = &base.Command{ @@ -37,5 +38,8 @@ func runInit(cmd *base.Command, args []string) { if _, err := os.Stat("go.mod"); err == nil { base.Fatalf("go mod init: go.mod already exists") } + if strings.Contains(modload.CmdModModule, "@") { + base.Fatalf("go mod init: module path must not contain '@'") + } modload.InitMod() // does all the hard work } From ea6259d5e9d57f247b7d877d4d04602b74ae5155 Mon Sep 17 00:00:00 2001 From: David Chase Date: Tue, 4 Dec 2018 10:00:16 -0500 Subject: [PATCH 267/594] cmd/compile: check for negative upper bound to IsSliceInBounds IsSliceInBounds(x, y) asserts that y is not negative, but there were cases where this is not true. Change code generation to ensure that this is true when it's not obviously true. Prove phase cleans a few of these out. With this change the compiler text section is 0.06% larger, that is, not very much. Benchmarking still TBD, may need to wait for access to a benchmarking box (next week). Also corrected run.go to handle '?' in -update_errors output. Fixes #28797. Change-Id: Ia8af90bc50a91ae6e934ef973def8d3f398fac7b Reviewed-on: https://go-review.googlesource.com/c/152477 Run-TryBot: David Chase Reviewed-by: Keith Randall TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/ssa.go | 21 +++++++ test/fixedbugs/issue28797.go | 53 +++++++++++++++++ test/loopbce.go | 94 +++++++++++++++--------------- test/prove.go | 18 +++--- test/run.go | 2 +- 5 files changed, 131 insertions(+), 57 deletions(-) create mode 100644 test/fixedbugs/issue28797.go diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index d7fc4adb8a86a..dcb9841042a9b 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -4022,6 +4022,18 @@ func (s *state) boundsCheck(idx, len *ssa.Value) { s.check(cmp, panicindex) } +func couldBeNegative(v *ssa.Value) bool { + switch v.Op { + case ssa.OpSliceLen, ssa.OpSliceCap, ssa.OpStringLen: + return false + case ssa.OpConst64: + return v.AuxInt < 0 + case ssa.OpConst32: + return int32(v.AuxInt) < 0 + } + return true +} + // sliceBoundsCheck generates slice bounds checking code. Checks if 0 <= idx <= len, branches to exit if not. // Starts a new block on return. // idx and len are already converted to full int width. @@ -4029,6 +4041,15 @@ func (s *state) sliceBoundsCheck(idx, len *ssa.Value) { if Debug['B'] != 0 { return } + if couldBeNegative(len) { + // OpIsSliceInBounds requires second arg not negative; if it's not obviously true, must check. + cmpop := ssa.OpGeq64 + if len.Type.Size() == 4 { + cmpop = ssa.OpGeq32 + } + cmp := s.newValue2(cmpop, types.Types[TBOOL], len, s.zeroVal(len.Type)) + s.check(cmp, panicslice) + } // bounds check cmp := s.newValue2(ssa.OpIsSliceInBounds, types.Types[TBOOL], idx, len) diff --git a/test/fixedbugs/issue28797.go b/test/fixedbugs/issue28797.go new file mode 100644 index 0000000000000..480c1059b8b25 --- /dev/null +++ b/test/fixedbugs/issue28797.go @@ -0,0 +1,53 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "fmt" +) + +// test expects f to panic, but not to run out of memory, +// which is a non-panic fatal error. OOM results from failure +// to properly check negative limit. +func test(f func()) { + defer func() { + r := recover() + if r == nil { + panic("panic wasn't recoverable") + } + }() + f() +} + +//go:noinline +func id(x int) int { + return x +} + +func main() { + test(foo) + test(bar) +} + +func foo() { + b := make([]byte, 0) + b = append(b, 1) + id(len(b)) + id(len(b) - 2) + s := string(b[1 : len(b)-2]) + fmt.Println(s) +} + +func bar() { + b := make([]byte, 1) + b = append(b, 1) + i := id(-1) + if i < len(b) { // establish value is not too large. + s := string(b[1:i]) // should check for negative also. + fmt.Println(s) + } +} diff --git a/test/loopbce.go b/test/loopbce.go index b4bf797497f0c..81f2524e95598 100644 --- a/test/loopbce.go +++ b/test/loopbce.go @@ -6,7 +6,7 @@ package main func f0a(a []int) int { x := 0 for i := range a { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - x += a[i] // ERROR "Proved IsInBounds$" + x += a[i] // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -14,7 +14,7 @@ func f0a(a []int) int { func f0b(a []int) int { x := 0 for i := range a { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - b := a[i:] // ERROR "Proved IsSliceInBounds$" + b := a[i:] // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" x += b[0] } return x @@ -23,7 +23,7 @@ func f0b(a []int) int { func f0c(a []int) int { x := 0 for i := range a { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - b := a[:i+1] // ERROR "Proved IsSliceInBounds$" + b := a[:i+1] // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" x += b[0] } return x @@ -40,7 +40,7 @@ func f1(a []int) int { func f2(a []int) int { x := 0 for i := 1; i < len(a); i++ { // ERROR "Induction variable: limits \[1,\?\), increment 1$" - x += a[i] // ERROR "Proved IsInBounds$" + x += a[i] // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -48,7 +48,7 @@ func f2(a []int) int { func f4(a [10]int) int { x := 0 for i := 0; i < len(a); i += 2 { // ERROR "Induction variable: limits \[0,10\), increment 2$" - x += a[i] // ERROR "Proved IsInBounds$" + x += a[i] // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -63,7 +63,7 @@ func f5(a [10]int) int { func f6(a []int) { for i := range a { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - b := a[0:i] // ERROR "Proved IsSliceInBounds$" + b := a[0:i] // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" "(\([0-9]+\) )?Proved Geq64$" f6(b) } } @@ -71,7 +71,7 @@ func f6(a []int) { func g0a(a string) int { x := 0 for i := 0; i < len(a); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - x += int(a[i]) // ERROR "Proved IsInBounds$" + x += int(a[i]) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -79,7 +79,7 @@ func g0a(a string) int { func g0b(a string) int { x := 0 for i := 0; len(a) > i; i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - x += int(a[i]) // ERROR "Proved IsInBounds$" + x += int(a[i]) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -87,7 +87,7 @@ func g0b(a string) int { func g0c(a string) int { x := 0 for i := len(a); i > 0; i-- { // ERROR "Induction variable: limits \(0,\?\], increment 1$" - x += int(a[i-1]) // ERROR "Proved IsInBounds$" + x += int(a[i-1]) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -95,7 +95,7 @@ func g0c(a string) int { func g0d(a string) int { x := 0 for i := len(a); 0 < i; i-- { // ERROR "Induction variable: limits \(0,\?\], increment 1$" - x += int(a[i-1]) // ERROR "Proved IsInBounds$" + x += int(a[i-1]) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -103,7 +103,7 @@ func g0d(a string) int { func g0e(a string) int { x := 0 for i := len(a) - 1; i >= 0; i-- { // ERROR "Induction variable: limits \[0,\?\], increment 1$" - x += int(a[i]) // ERROR "Proved IsInBounds$" + x += int(a[i]) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -111,7 +111,7 @@ func g0e(a string) int { func g0f(a string) int { x := 0 for i := len(a) - 1; 0 <= i; i-- { // ERROR "Induction variable: limits \[0,\?\], increment 1$" - x += int(a[i]) // ERROR "Proved IsInBounds$" + x += int(a[i]) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -120,7 +120,7 @@ func g1() int { a := "evenlength" x := 0 for i := 0; i < len(a); i += 2 { // ERROR "Induction variable: limits \[0,10\), increment 2$" - x += int(a[i]) // ERROR "Proved IsInBounds$" + x += int(a[i]) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return x } @@ -130,7 +130,7 @@ func g2() int { x := 0 for i := 0; i < len(a); i += 2 { // ERROR "Induction variable: limits \[0,10\), increment 2$" j := i - if a[i] == 'e' { // ERROR "Proved IsInBounds$" + if a[i] == 'e' { // ERROR "(\([0-9]+\) )?Proved IsInBounds$" j = j + 1 } x += int(a[j]) @@ -141,27 +141,27 @@ func g2() int { func g3a() { a := "this string has length 25" for i := 0; i < len(a); i += 5 { // ERROR "Induction variable: limits \[0,25\), increment 5$" - useString(a[i:]) // ERROR "Proved IsSliceInBounds$" + useString(a[i:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" useString(a[:i+3]) } } func g3b(a string) { for i := 0; i < len(a); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - useString(a[i+1:]) // ERROR "Proved IsSliceInBounds$" + useString(a[i+1:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" } } func g3c(a string) { for i := 0; i < len(a); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - useString(a[:i+1]) // ERROR "Proved IsSliceInBounds$" + useString(a[:i+1]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" } } func h1(a []byte) { c := a[:128] for i := range c { // ERROR "Induction variable: limits \[0,128\), increment 1$" - c[i] = byte(i) // ERROR "Proved IsInBounds$" + c[i] = byte(i) // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } } @@ -174,11 +174,11 @@ func h2(a []byte) { func k0(a [100]int) [100]int { for i := 10; i < 90; i++ { // ERROR "Induction variable: limits \[10,90\), increment 1$" a[i-11] = i - a[i-10] = i // ERROR "Proved IsInBounds$" - a[i-5] = i // ERROR "Proved IsInBounds$" - a[i] = i // ERROR "Proved IsInBounds$" - a[i+5] = i // ERROR "Proved IsInBounds$" - a[i+10] = i // ERROR "Proved IsInBounds$" + a[i-10] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" + a[i-5] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" + a[i] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" + a[i+5] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" + a[i+10] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" a[i+11] = i } return a @@ -186,13 +186,13 @@ func k0(a [100]int) [100]int { func k1(a [100]int) [100]int { for i := 10; i < 90; i++ { // ERROR "Induction variable: limits \[10,90\), increment 1$" - useSlice(a[:i-11]) - useSlice(a[:i-10]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[:i-5]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[:i]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[:i+5]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[:i+10]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[:i+11]) // ERROR "Proved IsSliceInBounds$" + useSlice(a[:i-11]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[:i-10]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[:i-5]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[:i]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" "(\([0-9]+\) )?Proved Geq64$" + useSlice(a[:i+5]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[:i+10]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[:i+11]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" useSlice(a[:i+12]) } @@ -202,12 +202,12 @@ func k1(a [100]int) [100]int { func k2(a [100]int) [100]int { for i := 10; i < 90; i++ { // ERROR "Induction variable: limits \[10,90\), increment 1$" useSlice(a[i-11:]) - useSlice(a[i-10:]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[i-5:]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[i:]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[i+5:]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[i+10:]) // ERROR "Proved IsSliceInBounds$" - useSlice(a[i+11:]) // ERROR "Proved IsSliceInBounds$" + useSlice(a[i-10:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[i-5:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[i:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[i+5:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[i+10:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" + useSlice(a[i+11:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" useSlice(a[i+12:]) } return a @@ -216,7 +216,7 @@ func k2(a [100]int) [100]int { func k3(a [100]int) [100]int { for i := -10; i < 90; i++ { // ERROR "Induction variable: limits \[-10,90\), increment 1$" a[i+9] = i - a[i+10] = i // ERROR "Proved IsInBounds$" + a[i+10] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" a[i+11] = i } return a @@ -225,7 +225,7 @@ func k3(a [100]int) [100]int { func k3neg(a [100]int) [100]int { for i := 89; i > -11; i-- { // ERROR "Induction variable: limits \(-11,89\], increment 1$" a[i+9] = i - a[i+10] = i // ERROR "Proved IsInBounds$" + a[i+10] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" a[i+11] = i } return a @@ -234,7 +234,7 @@ func k3neg(a [100]int) [100]int { func k3neg2(a [100]int) [100]int { for i := 89; i >= -10; i-- { // ERROR "Induction variable: limits \[-10,89\], increment 1$" a[i+9] = i - a[i+10] = i // ERROR "Proved IsInBounds$" + a[i+10] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" a[i+11] = i } return a @@ -243,16 +243,16 @@ func k3neg2(a [100]int) [100]int { func k4(a [100]int) [100]int { min := (-1) << 63 for i := min; i < min+50; i++ { // ERROR "Induction variable: limits \[-9223372036854775808,-9223372036854775758\), increment 1$" - a[i-min] = i // ERROR "Proved IsInBounds$" + a[i-min] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return a } func k5(a [100]int) [100]int { max := (1 << 63) - 1 - for i := max - 50; i < max; i++ { // ERROR "Induction variable: limits \[9223372036854775757,9223372036854775807\), increment 1" - a[i-max+50] = i // ERROR "Proved IsInBounds$" - a[i-(max-70)] = i // ERROR "Proved IsInBounds$" + for i := max - 50; i < max; i++ { // ERROR "Induction variable: limits \[9223372036854775757,9223372036854775807\), increment 1$" + a[i-max+50] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" + a[i-(max-70)] = i // ERROR "(\([0-9]+\) )?Proved IsInBounds$" } return a } @@ -275,17 +275,17 @@ func nobce1() { func nobce2(a string) { for i := int64(0); i < int64(len(a)); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - useString(a[i:]) // ERROR "Proved IsSliceInBounds$" + useString(a[i:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" } for i := int64(0); i < int64(len(a))-31337; i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - useString(a[i:]) // ERROR "Proved IsSliceInBounds$" + useString(a[i:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" } for i := int64(0); i < int64(len(a))+int64(-1<<63); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - useString(a[i:]) // ERROR "Proved IsSliceInBounds$" + useString(a[i:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" } j := int64(len(a)) - 123 for i := int64(0); i < j+123+int64(-1<<63); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" - useString(a[i:]) // ERROR "Proved IsSliceInBounds$" + useString(a[i:]) // ERROR "(\([0-9]+\) )?Proved IsSliceInBounds$" } for i := int64(0); i < j+122+int64(-1<<63); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" // len(a)-123+122+MinInt overflows when len(a) == 0, so a bound check is needed here diff --git a/test/prove.go b/test/prove.go index 79256893b3604..0de6bd63b4047 100644 --- a/test/prove.go +++ b/test/prove.go @@ -62,7 +62,7 @@ func f1c(a []int, i int64) int { } func f2(a []int) int { - for i := range a { // ERROR "Induction variable: limits \[0,\?\), increment 1" + for i := range a { // ERROR "Induction variable: limits \[0,\?\), increment 1$" a[i+1] = i a[i+1] = i // ERROR "Proved IsInBounds$" } @@ -269,7 +269,7 @@ func f11b(a []int, i int) { func f11c(a []int, i int) { useSlice(a[:i]) - useSlice(a[:i]) // ERROR "Proved IsSliceInBounds$" + useSlice(a[:i]) // ERROR "Proved Geq64$" "Proved IsSliceInBounds$" } func f11d(a []int, i int) { @@ -464,12 +464,12 @@ func f16(s []int) []int { } func f17(b []int) { - for i := 0; i < len(b); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1" + for i := 0; i < len(b); i++ { // ERROR "Induction variable: limits \[0,\?\), increment 1$" // This tests for i <= cap, which we can only prove // using the derived relation between len and cap. // This depends on finding the contradiction, since we // don't query this condition directly. - useSlice(b[:i]) // ERROR "Proved IsSliceInBounds$" + useSlice(b[:i]) // ERROR "Proved Geq64$" "Proved IsSliceInBounds$" } } @@ -579,18 +579,18 @@ func fence4(x, y int64) { func trans1(x, y int64) { if x > 5 { if y > x { - if y > 2 { // ERROR "Proved Greater64" + if y > 2 { // ERROR "Proved Greater64$" return } } else if y == x { - if y > 5 { // ERROR "Proved Greater64" + if y > 5 { // ERROR "Proved Greater64$" return } } } if x >= 10 { if y > x { - if y > 10 { // ERROR "Proved Greater64" + if y > 10 { // ERROR "Proved Greater64$" return } } @@ -624,7 +624,7 @@ func natcmp(x, y []uint) (r int) { } i := m - 1 - for i > 0 && // ERROR "Induction variable: limits \(0,\?\], increment 1" + for i > 0 && // ERROR "Induction variable: limits \(0,\?\], increment 1$" x[i] == // ERROR "Proved IsInBounds$" y[i] { // ERROR "Proved IsInBounds$" i-- @@ -686,7 +686,7 @@ func range2(b [][32]int) { if i < len(b) { // ERROR "Proved Less64$" println("x") } - if i >= 0 { // ERROR "Proved Geq64" + if i >= 0 { // ERROR "Proved Geq64$" println("x") } } diff --git a/test/run.go b/test/run.go index e7976657dedd2..96192937b09bc 100644 --- a/test/run.go +++ b/test/run.go @@ -1212,7 +1212,7 @@ func (t *test) updateErrors(out, file string) { msg := errStr[colon2+2:] msg = strings.Replace(msg, file, base, -1) // normalize file mentions in error itself msg = strings.TrimLeft(msg, " \t") - for _, r := range []string{`\`, `*`, `+`, `[`, `]`, `(`, `)`} { + for _, r := range []string{`\`, `*`, `+`, `?`, `[`, `]`, `(`, `)`} { msg = strings.Replace(msg, r, `\`+r, -1) } msg = strings.Replace(msg, `"`, `.`, -1) From 353795c83975d457f34c599bed20328a9b8f1cc8 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 7 Dec 2018 15:16:54 -0800 Subject: [PATCH 268/594] cmd/link/internal/ld: run tests in parallel Also skip TestNooptCgoBuild in short mode. Also fix a couple of obscure constants to use values named in cmd/internal/dwarf. This brings the time of the cmd/link/internal/ld tests down to about 1 second on my laptop. Updates #26470 Change-Id: I71c896f30fd314a81d9090f1b6d02edc4174a808 Reviewed-on: https://go-review.googlesource.com/c/153259 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/link/internal/ld/dwarf_test.go | 19 +++++++++++++++++-- src/cmd/link/internal/ld/ld_test.go | 1 + src/cmd/link/internal/ld/nooptcgolink_test.go | 5 +++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/cmd/link/internal/ld/dwarf_test.go b/src/cmd/link/internal/ld/dwarf_test.go index 42b598efefa14..4768a11c259c7 100644 --- a/src/cmd/link/internal/ld/dwarf_test.go +++ b/src/cmd/link/internal/ld/dwarf_test.go @@ -5,6 +5,7 @@ package ld import ( + intdwarf "cmd/internal/dwarf" objfilepkg "cmd/internal/objfile" // renamed to avoid conflict with objfile function "debug/dwarf" "errors" @@ -29,6 +30,7 @@ const ( ) func TestRuntimeTypesPresent(t *testing.T) { + t.Parallel() testenv.MustHaveGoBuild(t) if runtime.GOOS == "plan9" { @@ -145,6 +147,7 @@ func gobuildTestdata(t *testing.T, tdir string, gopathdir string, packtobuild st } func TestEmbeddedStructMarker(t *testing.T) { + t.Parallel() testenv.MustHaveGoBuild(t) if runtime.GOOS == "plan9" { @@ -224,7 +227,7 @@ func main() { func findMembers(rdr *dwarf.Reader) (map[string]bool, error) { memberEmbedded := map[string]bool{} // TODO(hyangah): define in debug/dwarf package - const goEmbeddedStruct = dwarf.Attr(0x2903) + const goEmbeddedStruct = dwarf.Attr(intdwarf.DW_AT_go_embedded_field) for entry, err := rdr.Next(); entry != nil; entry, err = rdr.Next() { if err != nil { return nil, err @@ -245,6 +248,7 @@ func TestSizes(t *testing.T) { if runtime.GOOS == "plan9" { t.Skip("skipping on plan9; no DWARF symbol table in executables") } + t.Parallel() // DWARF sizes should never be -1. // See issue #21097 @@ -292,6 +296,7 @@ func TestFieldOverlap(t *testing.T) { if runtime.GOOS == "plan9" { t.Skip("skipping on plan9; no DWARF symbol table in executables") } + t.Parallel() // This test grew out of issue 21094, where specific sudog DWARF types // had elem fields set to values instead of pointers. @@ -348,6 +353,7 @@ func main() { } func varDeclCoordsAndSubrogramDeclFile(t *testing.T, testpoint string, expectFile int, expectLine int, directive string) { + t.Parallel() prog := fmt.Sprintf("package main\n\nfunc main() {\n%s\nvar i int\ni = i\n}\n", directive) @@ -584,6 +590,8 @@ func TestInlinedRoutineRecords(t *testing.T) { t.Skip("skipping on solaris and darwin, pending resolution of issue #23168") } + t.Parallel() + const prog = ` package main @@ -720,6 +728,7 @@ func main() { } func abstractOriginSanity(t *testing.T, gopathdir string, flags string) { + t.Parallel() dir, err := ioutil.TempDir("", "TestAbstractOriginSanity") if err != nil { @@ -881,6 +890,8 @@ func TestRuntimeTypeAttrExternal(t *testing.T) { } func testRuntimeTypeAttr(t *testing.T, flags string) { + t.Parallel() + const prog = ` package main @@ -939,7 +950,7 @@ func main() { if len(dies) != 1 { t.Fatalf("wanted 1 DIE named *main.X, found %v", len(dies)) } - rtAttr := dies[0].Val(0x2904) + rtAttr := dies[0].Val(intdwarf.DW_AT_go_runtime_type) if rtAttr == nil { t.Fatalf("*main.X DIE had no runtime type attr. DIE: %v", dies[0]) } @@ -959,6 +970,8 @@ func TestIssue27614(t *testing.T) { t.Skip("skipping on plan9; no DWARF symbol table in executables") } + t.Parallel() + dir, err := ioutil.TempDir("", "go-build") if err != nil { t.Fatal(err) @@ -1075,6 +1088,8 @@ func TestStaticTmp(t *testing.T) { t.Skip("skipping on plan9; no DWARF symbol table in executables") } + t.Parallel() + dir, err := ioutil.TempDir("", "go-build") if err != nil { t.Fatal(err) diff --git a/src/cmd/link/internal/ld/ld_test.go b/src/cmd/link/internal/ld/ld_test.go index 4884a07d05a93..081642931652b 100644 --- a/src/cmd/link/internal/ld/ld_test.go +++ b/src/cmd/link/internal/ld/ld_test.go @@ -14,6 +14,7 @@ import ( ) func TestUndefinedRelocErrors(t *testing.T) { + t.Parallel() testenv.MustHaveGoBuild(t) dir, err := ioutil.TempDir("", "go-build") if err != nil { diff --git a/src/cmd/link/internal/ld/nooptcgolink_test.go b/src/cmd/link/internal/ld/nooptcgolink_test.go index e019a39bf7348..4d2ff1acf223f 100644 --- a/src/cmd/link/internal/ld/nooptcgolink_test.go +++ b/src/cmd/link/internal/ld/nooptcgolink_test.go @@ -15,6 +15,11 @@ import ( ) func TestNooptCgoBuild(t *testing.T) { + if testing.Short() { + t.Skip("skipping test in short mode.") + } + t.Parallel() + testenv.MustHaveGoBuild(t) testenv.MustHaveCGO(t) dir, err := ioutil.TempDir("", "go-build") From 11ce6eabd6073d342d57925af5bbfc0215540ddc Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Sun, 9 Dec 2018 13:37:17 +0100 Subject: [PATCH 269/594] math/bits: remove named return in TrailingZeros16 TrailingZeros16 is the only one of the TrailingZeros functions with a named return value in the signature. This creates a sligthly unpleasant effect in the godoc listing: func TrailingZeros(x uint) int func TrailingZeros16(x uint16) (n int) func TrailingZeros32(x uint32) int func TrailingZeros64(x uint64) int func TrailingZeros8(x uint8) int Since the named return value is not even used, remove it. Change-Id: I15c5aedb6157003911b6e0685c357ce56e466c0e Reviewed-on: https://go-review.googlesource.com/c/153340 Reviewed-by: Brad Fitzpatrick --- src/math/bits/bits.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/bits/bits.go b/src/math/bits/bits.go index 9da1c6e580a99..b06c363348449 100644 --- a/src/math/bits/bits.go +++ b/src/math/bits/bits.go @@ -65,7 +65,7 @@ func TrailingZeros8(x uint8) int { } // TrailingZeros16 returns the number of trailing zero bits in x; the result is 16 for x == 0. -func TrailingZeros16(x uint16) (n int) { +func TrailingZeros16(x uint16) int { if x == 0 { return 16 } From 033d09493d3dc03fda13801902b6e2e102b9d73c Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sun, 9 Dec 2018 00:20:50 +0200 Subject: [PATCH 270/594] crypto/ecdsa: fix NSA reference to Suite B implementer's guide to FIPS 186-3 Change-Id: I34877ac1d6d7fe9ffa7eabe46b4032af84d33794 Reviewed-on: https://go-review.googlesource.com/c/153337 Reviewed-by: Brad Fitzpatrick --- src/crypto/ecdsa/ecdsa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/ecdsa/ecdsa.go b/src/crypto/ecdsa/ecdsa.go index 2bab14cbb9e26..e059f181c7ea3 100644 --- a/src/crypto/ecdsa/ecdsa.go +++ b/src/crypto/ecdsa/ecdsa.go @@ -12,7 +12,7 @@ package ecdsa // References: // [NSA]: Suite B implementer's guide to FIPS 186-3, -// http://www.nsa.gov/ia/_files/ecdsa.pdf +// https://apps.nsa.gov/iaarchive/library/ia-guidance/ia-solutions-for-classified/algorithm-guidance/suite-b-implementers-guide-to-fips-186-3-ecdsa.cfm // [SECG]: SECG, SEC1 // http://www.secg.org/sec1-v2.pdf From e256afff51f49c872975f5a5f73faa46ee64c334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 5 Dec 2018 17:23:25 +0100 Subject: [PATCH 271/594] all: move cmd/internal/xcoff to internal/xcoff This commit moves cmd/internal/xcoff package to internal/xcoff because it will be needed to add XCOFF support in go/internal/gccgoimporter. Change-Id: Id12df0c438fb7db4a6a458fc1478480851bf7771 Reviewed-on: https://go-review.googlesource.com/c/152719 Run-TryBot: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick --- misc/nacl/testzip.proto | 6 +++--- src/cmd/cgo/gcc.go | 2 +- src/cmd/cgo/out.go | 2 +- src/cmd/compile/internal/ssa/stmtlines_test.go | 2 +- src/cmd/dist/buildtool.go | 2 +- src/cmd/internal/buildid/buildid.go | 2 +- src/cmd/internal/objfile/xcoff.go | 2 +- src/cmd/link/internal/loadxcoff/ldxcoff.go | 2 +- src/cmd/nm/nm_test.go | 2 +- src/go/build/deps_test.go | 1 + src/{cmd => }/internal/xcoff/file.go | 0 src/{cmd => }/internal/xcoff/file_test.go | 0 .../xcoff/testdata/gcc-ppc32-aix-dwarf2-exec | Bin .../xcoff/testdata/gcc-ppc64-aix-dwarf2-exec | Bin src/{cmd => }/internal/xcoff/testdata/hello.c | 0 src/{cmd => }/internal/xcoff/xcoff.go | 0 16 files changed, 12 insertions(+), 11 deletions(-) rename src/{cmd => }/internal/xcoff/file.go (100%) rename src/{cmd => }/internal/xcoff/file_test.go (100%) rename src/{cmd => }/internal/xcoff/testdata/gcc-ppc32-aix-dwarf2-exec (100%) rename src/{cmd => }/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec (100%) rename src/{cmd => }/internal/xcoff/testdata/hello.c (100%) rename src/{cmd => }/internal/xcoff/xcoff.go (100%) diff --git a/misc/nacl/testzip.proto b/misc/nacl/testzip.proto index 720663db9b463..d05219364dcb7 100644 --- a/misc/nacl/testzip.proto +++ b/misc/nacl/testzip.proto @@ -37,9 +37,6 @@ go src=.. buildid testdata + - xcoff - testdata - + gofmt gofmt.go gofmt_test.go @@ -157,6 +154,9 @@ go src=.. trace testdata + + xcoff + testdata + + io + mime diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index b59bfe68fe10a..e7766e740fd0b 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -9,7 +9,6 @@ package main import ( "bytes" - "cmd/internal/xcoff" "debug/dwarf" "debug/elf" "debug/macho" @@ -21,6 +20,7 @@ import ( "go/ast" "go/parser" "go/token" + "internal/xcoff" "math" "os" "strconv" diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 401a87fecab59..0985a7e72ead9 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -6,7 +6,6 @@ package main import ( "bytes" - "cmd/internal/xcoff" "debug/elf" "debug/macho" "debug/pe" @@ -14,6 +13,7 @@ import ( "go/ast" "go/printer" "go/token" + "internal/xcoff" "io" "io/ioutil" "os" diff --git a/src/cmd/compile/internal/ssa/stmtlines_test.go b/src/cmd/compile/internal/ssa/stmtlines_test.go index 6fc0239ffe4d7..c71f8befd9d29 100644 --- a/src/cmd/compile/internal/ssa/stmtlines_test.go +++ b/src/cmd/compile/internal/ssa/stmtlines_test.go @@ -1,13 +1,13 @@ package ssa_test import ( - "cmd/internal/xcoff" "debug/dwarf" "debug/elf" "debug/macho" "debug/pe" "fmt" "internal/testenv" + "internal/xcoff" "io" "runtime" "testing" diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go index 2db115e20ede7..71ed4ba8bc7c1 100644 --- a/src/cmd/dist/buildtool.go +++ b/src/cmd/dist/buildtool.go @@ -65,7 +65,6 @@ var bootstrapDirs = []string{ "cmd/internal/obj/wasm", "cmd/internal/src", "cmd/internal/sys", - "cmd/internal/xcoff", "cmd/link", "cmd/link/internal/amd64", "cmd/link/internal/arm", @@ -90,6 +89,7 @@ var bootstrapDirs = []string{ "debug/elf", "debug/macho", "debug/pe", + "internal/xcoff", "math/big", "math/bits", "sort", diff --git a/src/cmd/internal/buildid/buildid.go b/src/cmd/internal/buildid/buildid.go index 8205f696eb15d..ac238d70ea0cd 100644 --- a/src/cmd/internal/buildid/buildid.go +++ b/src/cmd/internal/buildid/buildid.go @@ -6,9 +6,9 @@ package buildid import ( "bytes" - "cmd/internal/xcoff" "debug/elf" "fmt" + "internal/xcoff" "io" "os" "strconv" diff --git a/src/cmd/internal/objfile/xcoff.go b/src/cmd/internal/objfile/xcoff.go index f62a7edf89fa5..d438c802264f6 100644 --- a/src/cmd/internal/objfile/xcoff.go +++ b/src/cmd/internal/objfile/xcoff.go @@ -7,9 +7,9 @@ package objfile import ( - "cmd/internal/xcoff" "debug/dwarf" "fmt" + "internal/xcoff" "io" "unicode" ) diff --git a/src/cmd/link/internal/loadxcoff/ldxcoff.go b/src/cmd/link/internal/loadxcoff/ldxcoff.go index 7204d34388875..7c863d79c5832 100644 --- a/src/cmd/link/internal/loadxcoff/ldxcoff.go +++ b/src/cmd/link/internal/loadxcoff/ldxcoff.go @@ -9,10 +9,10 @@ import ( "cmd/internal/bio" "cmd/internal/objabi" "cmd/internal/sys" - "cmd/internal/xcoff" "cmd/link/internal/sym" "errors" "fmt" + "internal/xcoff" ) // ldSection is an XCOFF section with its symbols. diff --git a/src/cmd/nm/nm_test.go b/src/cmd/nm/nm_test.go index 87baa09d38ef3..1f2ad53ef2715 100644 --- a/src/cmd/nm/nm_test.go +++ b/src/cmd/nm/nm_test.go @@ -64,7 +64,7 @@ func TestNonGoExecs(t *testing.T) { "debug/pe/testdata/gcc-386-mingw-exec", "debug/plan9obj/testdata/amd64-plan9-exec", "debug/plan9obj/testdata/386-plan9-exec", - "cmd/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec", + "internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec", } for _, f := range testfiles { exepath := filepath.Join(runtime.GOROOT(), "src", f) diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index 7251274756407..dd38cc0a6a582 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -273,6 +273,7 @@ var pkgDeps = map[string][]string{ "internal/goroot": {"L4", "OS"}, "internal/singleflight": {"sync"}, "internal/trace": {"L4", "OS", "container/heap"}, + "internal/xcoff": {"L4", "OS", "debug/dwarf"}, "math/big": {"L4"}, "mime": {"L4", "OS", "syscall", "internal/syscall/windows/registry"}, "mime/quotedprintable": {"L4"}, diff --git a/src/cmd/internal/xcoff/file.go b/src/internal/xcoff/file.go similarity index 100% rename from src/cmd/internal/xcoff/file.go rename to src/internal/xcoff/file.go diff --git a/src/cmd/internal/xcoff/file_test.go b/src/internal/xcoff/file_test.go similarity index 100% rename from src/cmd/internal/xcoff/file_test.go rename to src/internal/xcoff/file_test.go diff --git a/src/cmd/internal/xcoff/testdata/gcc-ppc32-aix-dwarf2-exec b/src/internal/xcoff/testdata/gcc-ppc32-aix-dwarf2-exec similarity index 100% rename from src/cmd/internal/xcoff/testdata/gcc-ppc32-aix-dwarf2-exec rename to src/internal/xcoff/testdata/gcc-ppc32-aix-dwarf2-exec diff --git a/src/cmd/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec b/src/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec similarity index 100% rename from src/cmd/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec rename to src/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec diff --git a/src/cmd/internal/xcoff/testdata/hello.c b/src/internal/xcoff/testdata/hello.c similarity index 100% rename from src/cmd/internal/xcoff/testdata/hello.c rename to src/internal/xcoff/testdata/hello.c diff --git a/src/cmd/internal/xcoff/xcoff.go b/src/internal/xcoff/xcoff.go similarity index 100% rename from src/cmd/internal/xcoff/xcoff.go rename to src/internal/xcoff/xcoff.go From 6182d0821c60e2ec4d85e94b5c8e476ca7f75fc6 Mon Sep 17 00:00:00 2001 From: Gn Shivakumar Date: Tue, 31 Jul 2018 06:20:02 +0530 Subject: [PATCH 272/594] go/build: improve comment on Context.CgoEnabled Fixes #25953 Change-Id: I4f3a64b42fce76cc5ea6cfe2888d103c7423457d Reviewed-on: https://go-review.googlesource.com/c/126736 Reviewed-by: Bryan C. Mills --- src/go/build/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/build/build.go b/src/go/build/build.go index 91fe4cfc744a4..5e683aef9822f 100644 --- a/src/go/build/build.go +++ b/src/go/build/build.go @@ -34,7 +34,7 @@ type Context struct { GOOS string // target operating system GOROOT string // Go root GOPATH string // Go path - CgoEnabled bool // whether cgo can be used + CgoEnabled bool // whether cgo files are included UseAllFiles bool // use files regardless of +build lines, file names Compiler string // compiler to assume when computing target paths From 89df035464e63ea7c90b981266e9a77a227c456b Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Thu, 6 Dec 2018 16:18:12 -0500 Subject: [PATCH 273/594] cmd/go: fix errors for commands run outside of modules Since CL 148517, several commands (including list and get) work when GO111MODULE=on even when no go.mod file is present. This broke an assumption made by "fix" and "generate" which caused panics when run with a list of .go files (whether or not the command was run inside a module). This change fixes those assumptions and adds test cases for other commands run outside modules. Fixes #29097 Change-Id: I7927559769c5d4617d73eb63f3b17e2f26d8c219 Reviewed-on: https://go-review.googlesource.com/c/153158 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/fix/fix.go | 2 +- src/cmd/go/internal/generate/generate.go | 2 +- src/cmd/go/testdata/script/mod_outside.txt | 31 ++++++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/internal/fix/fix.go b/src/cmd/go/internal/fix/fix.go index aab164148ff88..4d741df2b4f1a 100644 --- a/src/cmd/go/internal/fix/fix.go +++ b/src/cmd/go/internal/fix/fix.go @@ -34,7 +34,7 @@ See also: go fmt, go vet. func runFix(cmd *base.Command, args []string) { printed := false for _, pkg := range load.Packages(args) { - if modload.Enabled() && !pkg.Module.Main { + if modload.Enabled() && pkg.Module != nil && !pkg.Module.Main { if !printed { fmt.Fprintf(os.Stderr, "go: not fixing packages in dependency modules\n") printed = true diff --git a/src/cmd/go/internal/generate/generate.go b/src/cmd/go/internal/generate/generate.go index 9482be98aefb5..7cbc448e6dd7c 100644 --- a/src/cmd/go/internal/generate/generate.go +++ b/src/cmd/go/internal/generate/generate.go @@ -161,7 +161,7 @@ func runGenerate(cmd *base.Command, args []string) { // Even if the arguments are .go files, this loop suffices. printed := false for _, pkg := range load.Packages(args) { - if modload.Enabled() && !pkg.Module.Main { + if modload.Enabled() && pkg.Module != nil && !pkg.Module.Main { if !printed { fmt.Fprintf(os.Stderr, "go: not generating in packages in dependency modules\n") printed = true diff --git a/src/cmd/go/testdata/script/mod_outside.txt b/src/cmd/go/testdata/script/mod_outside.txt index cc99ed6b00cd3..25013b6271cfd 100644 --- a/src/cmd/go/testdata/script/mod_outside.txt +++ b/src/cmd/go/testdata/script/mod_outside.txt @@ -36,6 +36,9 @@ stdout '^cmd/go$' go list $GOROOT/src/fmt stdout '^fmt$' +# 'go list' should work with file arguments. +go list ./foo/foo.go +stdout 'command-line-arguments' # 'go list -m' with an explicit version should resolve that version. go list -m example.com/version@latest @@ -186,11 +189,27 @@ stdout 'path is \.$' stdout 'main is main \(devel\)' stdout 'using example.com/version v1.1.0' +# 'go generate' should work with file arguments. +[exec:touch] go generate ./foo/foo.go +[exec:touch] exists ./foo/gen.txt + +# 'go install' should work with file arguments. +go install ./foo/foo.go + +# 'go test' should work with file arguments. +go test -v ./foo/foo_test.go +stdout 'foo was tested' + +# 'go vet' should work with file arguments. +go vet ./foo/foo.go + -- README.txt -- There is no go.mod file in the working directory. -- foo/foo.go -- +//go:generate touch gen.txt + package main import ( @@ -212,3 +231,15 @@ func main() { fmt.Fprintf(os.Stdout, "using %s %s\n", m.Path, m.Version) } } + +-- foo/foo_test.go -- +package main + +import ( + "fmt" + "testing" +) + +func TestFoo(t *testing.T) { + fmt.Println("foo was tested") +} From 8c5976f8b33a4378ea18dd963317bcbd39fc309b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 3 Dec 2018 16:02:10 -0800 Subject: [PATCH 274/594] cmd/cgo: don't pass CGO_CFLAGS -g options to debug info generation Fixes #26144 Change-Id: Ie69dab1bd819eaf158be11769903b2636bbcf516 Reviewed-on: https://go-review.googlesource.com/c/152165 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Emmanuel Odeke Reviewed-by: Nikhil Benesch --- src/cmd/cgo/gcc.go | 8 +++++++- src/cmd/dist/test.go | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index e7766e740fd0b..8cbe6d329c5b5 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -91,7 +91,13 @@ func (p *Package) addToFlag(flag string, args []string) { p.CgoFlags[flag] = append(p.CgoFlags[flag], args...) if flag == "CFLAGS" { // We'll also need these when preprocessing for dwarf information. - p.GccOptions = append(p.GccOptions, args...) + // However, discard any -g options: we need to be able + // to parse the debug info, so stick to what we expect. + for _, arg := range args { + if !strings.HasPrefix(arg, "-g") { + p.GccOptions = append(p.GccOptions, arg) + } + } } } diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 2d7f7bd2f9abf..c88a7c05dfbe3 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -1038,7 +1038,10 @@ func (t *tester) cgoTest(dt *distTest) error { "linux-386", "linux-amd64", "linux-arm", "linux-ppc64le", "linux-s390x", "netbsd-386", "netbsd-amd64": - t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags", "-linkmode=external") + cmd := t.addCmd(dt, "misc/cgo/test", t.goTest(), "-ldflags", "-linkmode=external") + // A -g argument in CGO_CFLAGS should not affect how the test runs. + cmd.Env = append(os.Environ(), "CGO_CFLAGS=-g0") + t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=auto") t.addCmd(dt, "misc/cgo/testtls", t.goTest(), "-ldflags", "-linkmode=external") From ba69df63ebbf9101a35fb11a0df1e1912d285da4 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 10 Dec 2018 17:06:40 -0500 Subject: [PATCH 275/594] cmd/go/internal/modfetch: update TestCodeRepo for gopkg.in/yaml.v2 v2.2.2 I think we ought to make these tests hermetic, but in the meantime we should at least make them pass. Fixes #27692 Updates #28856 Change-Id: Ia78fa60e998dea3c871f640ffa2ece67b054f866 Reviewed-on: https://go-review.googlesource.com/c/153460 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Dmitri Shuralyov --- src/cmd/go/internal/modfetch/coderepo_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd/go/internal/modfetch/coderepo_test.go b/src/cmd/go/internal/modfetch/coderepo_test.go index e8bf8ed750e83..c93d8dbe44284 100644 --- a/src/cmd/go/internal/modfetch/coderepo_test.go +++ b/src/cmd/go/internal/modfetch/coderepo_test.go @@ -284,10 +284,10 @@ var codeRepoTests = []struct { { path: "gopkg.in/yaml.v2", rev: "v2", - version: "v2.2.1", - name: "5420a8b6744d3b0345ab293f6fcba19c978f1183", - short: "5420a8b6744d", - time: time.Date(2018, 3, 28, 19, 50, 20, 0, time.UTC), + version: "v2.2.2", + name: "51d6538a90f86fe93ac480b35f37b2be17fef232", + short: "51d6538a90f8", + time: time.Date(2018, 11, 15, 11, 05, 04, 0, time.UTC), gomod: "module \"gopkg.in/yaml.v2\"\n\nrequire (\n\t\"gopkg.in/check.v1\" v0.0.0-20161208181325-20d25e280405\n)\n", }, { From 1ccb66d1ef031ad70345d2ef1983a5814f405295 Mon Sep 17 00:00:00 2001 From: Brian Kessler Date: Thu, 6 Sep 2018 12:26:31 -0600 Subject: [PATCH 276/594] hash/fnv: use bits.Mul64 for 128-bit hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the 128-bit multiplication in 4 parts with bits.Mul64 and two single-width multiplications. This simplifies the code and increases throughput by ~50% on amd64. name old time/op new time/op delta Fnv128KB-4 9.64µs ± 0% 6.09µs ± 0% -36.89% (p=0.016 n=4+5) Fnv128aKB-4 9.11µs ± 0% 6.17µs ± 5% -32.32% (p=0.008 n=5+5) name old speed new speed delta Fnv128KB-4 106MB/s ± 0% 168MB/s ± 0% +58.44% (p=0.016 n=4+5) Fnv128aKB-4 112MB/s ± 0% 166MB/s ± 5% +47.85% (p=0.008 n=5+5) Change-Id: Id752f2a20ea3de23a41e08db89eecf2bb60b7e6d Reviewed-on: https://go-review.googlesource.com/c/133936 Run-TryBot: Matt Layher Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Matt Layher Reviewed-by: Robert Griesemer --- src/hash/fnv/fnv.go | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/src/hash/fnv/fnv.go b/src/hash/fnv/fnv.go index 7662315d43cf8..0fce177cb3379 100644 --- a/src/hash/fnv/fnv.go +++ b/src/hash/fnv/fnv.go @@ -15,6 +15,7 @@ package fnv import ( "errors" "hash" + "math/bits" ) type ( @@ -137,18 +138,12 @@ func (s *sum64a) Write(data []byte) (int, error) { func (s *sum128) Write(data []byte) (int, error) { for _, c := range data { - // Compute the multiplication in 4 parts to simplify carrying - s1l := (s[1] & 0xffffffff) * prime128Lower - s1h := (s[1] >> 32) * prime128Lower - s0l := (s[0]&0xffffffff)*prime128Lower + (s[1]&0xffffffff)<>32)*prime128Lower + (s[1]>>32)<> 32 - s0l += s1h >> 32 - s0h += s0l >> 32 + // Compute the multiplication + s0, s1 := bits.Mul64(prime128Lower, s[1]) + s0 += s[1]<> 32) * prime128Lower - s0l := (s[0]&0xffffffff)*prime128Lower + (s[1]&0xffffffff)<>32)*prime128Lower + (s[1]>>32)<> 32 - s0l += s1h >> 32 - s0h += s0l >> 32 + // Compute the multiplication + s0, s1 := bits.Mul64(prime128Lower, s[1]) + s0 += s[1]< Date: Thu, 21 Jun 2018 18:01:01 +0100 Subject: [PATCH 277/594] cmd/cover: check that the argument of -var is valid At the moment, the cover tool does not check that the argument of -var is a valid identifier. Hence, it could generate a file that fails to compile afterwards. Updates #25280 Change-Id: I6eb1872736377680900a18a4a28ba002ab5ea8ca Reviewed-on: https://go-review.googlesource.com/c/120316 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/cmd/cover/cover.go | 16 ++++++++++++++++ src/cmd/cover/cover_test.go | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/src/cmd/cover/cover.go b/src/cmd/cover/cover.go index 54cf4be25ec7f..7f473a233c419 100644 --- a/src/cmd/cover/cover.go +++ b/src/cmd/cover/cover.go @@ -16,6 +16,7 @@ import ( "log" "os" "sort" + "unicode" "cmd/internal/edit" "cmd/internal/objabi" @@ -116,6 +117,10 @@ func parseFlags() error { return fmt.Errorf("too many options") } + if *varVar != "" && !isValidIdentifier(*varVar) { + return fmt.Errorf("argument of -var is not a valid identifier: %v", *varVar) + } + if *mode != "" { switch *mode { case "set": @@ -676,3 +681,14 @@ func (f *File) addVariables(w io.Writer) { fmt.Fprintf(w, "var _ = %s.LoadUint32\n", atomicPackageName) } } + +func isValidIdentifier(ident string) bool { + first := true + for _, c := range ident { + if !unicode.IsLetter(c) && c != '_' && (first || !unicode.IsDigit(c)) { + return false // invalid identifier + } + first = false + } + return true +} diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index a374dc4e9bb51..aebe6f8cb511f 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -145,6 +145,12 @@ func TestCover(t *testing.T) { cmd := exec.Command(testcover, "-mode=count", "-var=thisNameMustBeVeryLongToCauseOverflowOfCounterIncrementStatementOntoNextLineForTest", "-o", coverOutput, coverInput) run(cmd, t) + cmd = exec.Command(testcover, "-mode=set", "-var=Not_an-identifier", "-o", coverOutput, coverInput) + err = cmd.Run() + if err == nil { + t.Error("Expected cover to fail with an error") + } + // Copy testmain to testTempDir, so that it is in the same directory // as coverOutput. b, err := ioutil.ReadFile(testMain) From 0f0b10818bd00b1c5778f7c2fbed72bb06defbba Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Fri, 30 Nov 2018 21:12:06 +1100 Subject: [PATCH 278/594] runtime: fix CGO traceback frame count Without this, each additional C frame found via SetCgoTraceback will cause a frame to be dropped from the bottom of the traceback stack. Fixes #29034 Change-Id: I90aa6b2a1dced90c69b64c5dd565fe64a25724a3 Reviewed-on: https://go-review.googlesource.com/c/151917 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/crash_cgo_test.go | 60 +++++++++++++++---- src/runtime/proc.go | 3 + src/runtime/testdata/testprogcgo/pprof.go | 8 ++- .../testdata/testprogcgo/threadpprof.go | 6 +- 4 files changed, 65 insertions(+), 12 deletions(-) diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go index 6da8341e84198..c1dd757797dea 100644 --- a/src/runtime/crash_cgo_test.go +++ b/src/runtime/crash_cgo_test.go @@ -263,7 +263,7 @@ func TestCgoTracebackContext(t *testing.T) { } } -func testCgoPprof(t *testing.T, buildArg, runArg string) { +func testCgoPprof(t *testing.T, buildArg, runArg, top, bottom string) { t.Parallel() if runtime.GOOS != "linux" || (runtime.GOARCH != "amd64" && runtime.GOARCH != "ppc64le") { t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH) @@ -287,7 +287,7 @@ func testCgoPprof(t *testing.T, buildArg, runArg string) { defer os.Remove(fn) for try := 0; try < 2; try++ { - cmd := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "tool", "pprof", "-top", "-nodecount=1")) + cmd := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "tool", "pprof", "-traces")) // Check that pprof works both with and without explicit executable on command line. if try == 0 { cmd.Args = append(cmd.Args, exe, fn) @@ -307,30 +307,38 @@ func testCgoPprof(t *testing.T, buildArg, runArg string) { cmd.Env = append(cmd.Env, "PPROF_TMPDIR="+os.TempDir()) } - top, err := cmd.CombinedOutput() - t.Logf("%s:\n%s", cmd.Args, top) + out, err := cmd.CombinedOutput() + t.Logf("%s:\n%s", cmd.Args, out) if err != nil { t.Error(err) - } else if !bytes.Contains(top, []byte("cpuHog")) { - t.Error("missing cpuHog in pprof output") + continue + } + + trace := findTrace(string(out), top) + if len(trace) == 0 { + t.Errorf("%s traceback missing.", top) + continue + } + if trace[len(trace)-1] != bottom { + t.Errorf("invalid traceback origin: got=%v; want=[%s ... %s]", trace, top, bottom) } } } func TestCgoPprof(t *testing.T) { - testCgoPprof(t, "", "CgoPprof") + testCgoPprof(t, "", "CgoPprof", "cpuHog", "runtime.main") } func TestCgoPprofPIE(t *testing.T) { - testCgoPprof(t, "-buildmode=pie", "CgoPprof") + testCgoPprof(t, "-buildmode=pie", "CgoPprof", "cpuHog", "runtime.main") } func TestCgoPprofThread(t *testing.T) { - testCgoPprof(t, "", "CgoPprofThread") + testCgoPprof(t, "", "CgoPprofThread", "cpuHogThread", "cpuHogThread2") } func TestCgoPprofThreadNoTraceback(t *testing.T) { - testCgoPprof(t, "", "CgoPprofThreadNoTraceback") + testCgoPprof(t, "", "CgoPprofThreadNoTraceback", "cpuHogThread", "runtime._ExternalCode") } func TestRaceProf(t *testing.T) { @@ -509,3 +517,35 @@ func TestBigStackCallbackCgo(t *testing.T) { t.Errorf("expected %q got %v", want, got) } } + +func nextTrace(lines []string) ([]string, []string) { + var trace []string + for n, line := range lines { + if strings.HasPrefix(line, "---") { + return trace, lines[n+1:] + } + fields := strings.Fields(strings.TrimSpace(line)) + if len(fields) == 0 { + continue + } + // Last field contains the function name. + trace = append(trace, fields[len(fields)-1]) + } + return nil, nil +} + +func findTrace(text, top string) []string { + lines := strings.Split(text, "\n") + _, lines = nextTrace(lines) // Skip the header. + for len(lines) > 0 { + var t []string + t, lines = nextTrace(lines) + if len(t) == 0 { + continue + } + if t[0] == top { + return t + } + } + return nil +} diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 409869fd1071e..fc77a964b6e3f 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -3742,6 +3742,9 @@ func sigprof(pc, sp, lr uintptr, gp *g, mp *m) { // Collect Go stack that leads to the cgo call. n = gentraceback(mp.curg.syscallpc, mp.curg.syscallsp, 0, mp.curg, 0, &stk[cgoOff], len(stk)-cgoOff, nil, nil, 0) + if n > 0 { + n += cgoOff + } } else if traceback { n = gentraceback(pc, sp, lr, gp, 0, &stk[0], len(stk), nil, nil, _TraceTrap|_TraceJumpStack) } diff --git a/src/runtime/testdata/testprogcgo/pprof.go b/src/runtime/testdata/testprogcgo/pprof.go index 4460b9304e5cf..00f2c42e93cae 100644 --- a/src/runtime/testdata/testprogcgo/pprof.go +++ b/src/runtime/testdata/testprogcgo/pprof.go @@ -26,6 +26,9 @@ void cpuHog() { salt2 = foo; } +void cpuHog2() { +} + static int cpuHogCount; struct cgoTracebackArg { @@ -37,10 +40,13 @@ struct cgoTracebackArg { // pprofCgoTraceback is passed to runtime.SetCgoTraceback. // For testing purposes it pretends that all CPU hits in C code are in cpuHog. +// Issue #29034: At least 2 frames are required to verify all frames are captured +// since runtime/pprof ignores the runtime.goexit base frame if it exists. void pprofCgoTraceback(void* parg) { struct cgoTracebackArg* arg = (struct cgoTracebackArg*)(parg); arg->buf[0] = (uintptr_t)(cpuHog) + 0x10; - arg->buf[1] = 0; + arg->buf[1] = (uintptr_t)(cpuHog2) + 0x4; + arg->buf[2] = 0; ++cpuHogCount; } diff --git a/src/runtime/testdata/testprogcgo/threadpprof.go b/src/runtime/testdata/testprogcgo/threadpprof.go index 3da82961b9b74..37a2a1ab6590a 100644 --- a/src/runtime/testdata/testprogcgo/threadpprof.go +++ b/src/runtime/testdata/testprogcgo/threadpprof.go @@ -30,6 +30,9 @@ void cpuHogThread() { threadSalt2 = foo; } +void cpuHogThread2() { +} + static int cpuHogThreadCount; struct cgoTracebackArg { @@ -44,7 +47,8 @@ struct cgoTracebackArg { void pprofCgoThreadTraceback(void* parg) { struct cgoTracebackArg* arg = (struct cgoTracebackArg*)(parg); arg->buf[0] = (uintptr_t)(cpuHogThread) + 0x10; - arg->buf[1] = 0; + arg->buf[1] = (uintptr_t)(cpuHogThread2) + 0x4; + arg->buf[2] = 0; __sync_add_and_fetch(&cpuHogThreadCount, 1); } From f64385b720e59d0cddfe5e05e830665f6ade8083 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 10 Dec 2018 14:19:33 -0800 Subject: [PATCH 279/594] cmd/compile: set correct line number for method wrappers When converting a method to a function, like this: type T ... func (t T) foo() { } var t T f := t.foo We need to build a wrapper function for the partially evaluated method. Currently that wrapper function gets the line number of the first place where t.foo appears. Instead it should have the line number of where foo is declared. Fixes #26839 Change-Id: I7dbe2094e53d5d336f329273f10f8430e0af544e Reviewed-on: https://go-review.googlesource.com/c/153498 Run-TryBot: Keith Randall Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/closure.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cmd/compile/internal/gc/closure.go b/src/cmd/compile/internal/gc/closure.go index 07064415f499e..f6b492a16f029 100644 --- a/src/cmd/compile/internal/gc/closure.go +++ b/src/cmd/compile/internal/gc/closure.go @@ -434,8 +434,15 @@ func makepartialcall(fn *Node, t0 *types.Type, meth *types.Sym) *Node { sym.SetUniq(true) savecurfn := Curfn + saveLineNo := lineno Curfn = nil + // Set line number equal to the line number where the method is declared. + var m *types.Field + if lookdot0(meth, rcvrtype, &m, false) == 1 { + lineno = m.Pos + } + tfn := nod(OTFUNC, nil, nil) tfn.List.Set(structargs(t0.Params(), true)) tfn.Rlist.Set(structargs(t0.Results(), false)) @@ -482,6 +489,7 @@ func makepartialcall(fn *Node, t0 *types.Type, meth *types.Sym) *Node { sym.Def = asTypesNode(xfunc) xtop = append(xtop, xfunc) Curfn = savecurfn + lineno = saveLineNo return xfunc } From 56b70d98f522be3c1fed7df3d0359c913a2a1bc7 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Mon, 10 Dec 2018 15:32:17 -0500 Subject: [PATCH 280/594] doc: use https scheme in oss-distros link The https scheme is supported, and should be used per best practices. The previous http link redirected to https: $ curl -i 'http://oss-security.openwall.org/wiki/mailing-lists/distros' HTTP/1.1 302 Moved Temporarily Location: https://oss-security.openwall.org/wiki/mailing-lists/distros Change-Id: I857b93eeec45996d6dc05dbf7532d1759bf4d447 Reviewed-on: https://go-review.googlesource.com/c/153457 Reviewed-by: Brad Fitzpatrick --- doc/security.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/security.html b/doc/security.html index c305ae03c1a0f..b334963222ac0 100644 --- a/doc/security.html +++ b/doc/security.html @@ -70,7 +70,7 @@

    Disclosure Process

  • Code is audited to find any potential similar problems.
  • If it is determined, in consultation with the submitter, that a CVE-ID is required, the primary handler obtains one via email to -oss-distros.
  • +oss-distros.
  • Fixes are prepared for the two most recent major releases and the head/master revision. These fixes are not yet committed to the public repository.
  • A notification is sent to the From 1ac3b0618170279474fcdf9c625b2e237bf2881c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 7 Dec 2018 18:22:04 -0800 Subject: [PATCH 281/594] cmd/compile: emit a symbol for a method expression when using -dynlink Fixes #25065 Change-Id: Ia3db518cfd9c006caf951b51342a491ac8372e9c Reviewed-on: https://go-review.googlesource.com/c/153297 Reviewed-by: Robert Griesemer --- misc/cgo/testshared/shared_test.go | 6 ++++++ misc/cgo/testshared/src/issue25065/a.go | 20 ++++++++++++++++++++ src/cmd/compile/internal/gc/typecheck.go | 6 ++++++ 3 files changed, 32 insertions(+) create mode 100644 misc/cgo/testshared/src/issue25065/a.go diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index c3c7a6aab6af4..41a24efe22c0e 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -911,3 +911,9 @@ func TestGlobal(t *testing.T) { func TestTestInstalledShared(t *testing.T) { goCmd(nil, "test", "-linkshared", "-test.short", "sync/atomic") } + +// Test generated pointer method with -linkshared. +// Issue 25065. +func TestGeneratedMethod(t *testing.T) { + goCmd(t, "install", "-buildmode=shared", "-linkshared", "issue25065") +} diff --git a/misc/cgo/testshared/src/issue25065/a.go b/misc/cgo/testshared/src/issue25065/a.go new file mode 100644 index 0000000000000..979350ff24c9c --- /dev/null +++ b/misc/cgo/testshared/src/issue25065/a.go @@ -0,0 +1,20 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package issue25065 has a type with a method that is +// 1) referenced in a method expression +// 2) not called +// 3) not converted to an interface +// 4) is a value method but the reference is to the pointer method +// These cases avoid the call to makefuncsym from typecheckfunc, but we +// still need to call makefuncsym somehow or the symbol will not be defined. +package issue25065 + +type T int + +func (t T) M() {} + +func F() func(*T) { + return (*T).M +} diff --git a/src/cmd/compile/internal/gc/typecheck.go b/src/cmd/compile/internal/gc/typecheck.go index 633c5e5061a5a..4fc1c5c73c582 100644 --- a/src/cmd/compile/internal/gc/typecheck.go +++ b/src/cmd/compile/internal/gc/typecheck.go @@ -2514,6 +2514,12 @@ func typecheckMethodExpr(n *Node) (res *Node) { n.Xoffset = 0 n.SetClass(PFUNC) // methodSym already marked n.Sym as a function. + + // Issue 25065. Make sure that we emit the symbol for a local method. + if Ctxt.Flag_dynlink && !inimport && (t.Sym == nil || t.Sym.Pkg == localpkg) { + makefuncsym(n.Sym) + } + return n } From 6d4358705301e06e71b99977b77ae2c0a6b16b86 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 5 Dec 2018 14:04:27 -0800 Subject: [PATCH 282/594] cmd/cgo: preserve type information across loadDWARF loop CL 122575 and its successors introduced a loop calling loadDWARF, whereas before we only called it once. Pass a single typeConv to each call, rather than creating a new one in loadDWARF itself. Change the maps from dwarf.Type to use string keys rather than dwarf.Type keys, since when the DWARF is reloaded the dwarf.Type pointers will be different. These changes permit typeConv.Type to return a consistent value for a given DWARF type, avoiding spurious type conversion errors due to typedefs loaded after the first loop iteration. Fixes #27340 Change-Id: Ic33467bbfca4c54e95909621b35ba2a58216d96e Reviewed-on: https://go-review.googlesource.com/c/152762 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- misc/cgo/test/issue27340.go | 12 ++++++++ misc/cgo/test/issue27340/a.go | 42 ++++++++++++++++++++++++++++ misc/cgo/test/issue9026/issue9026.go | 2 +- src/cmd/cgo/gcc.go | 35 +++++++++++++---------- 4 files changed, 75 insertions(+), 16 deletions(-) create mode 100644 misc/cgo/test/issue27340.go create mode 100644 misc/cgo/test/issue27340/a.go diff --git a/misc/cgo/test/issue27340.go b/misc/cgo/test/issue27340.go new file mode 100644 index 0000000000000..f8c8a87f20110 --- /dev/null +++ b/misc/cgo/test/issue27340.go @@ -0,0 +1,12 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Failed to resolve typedefs consistently. +// No runtime test; just make sure it compiles. + +package cgotest + +import "./issue27340" + +var issue27340Var = issue27340.Issue27340GoFunc diff --git a/misc/cgo/test/issue27340/a.go b/misc/cgo/test/issue27340/a.go new file mode 100644 index 0000000000000..f5b120c1fd824 --- /dev/null +++ b/misc/cgo/test/issue27340/a.go @@ -0,0 +1,42 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Failed to resolve typedefs consistently. +// No runtime test; just make sure it compiles. +// In separate directory to isolate #pragma GCC diagnostic. + +package issue27340 + +// We use the #pragma to avoid a compiler warning about incompatible +// pointer types, because we generate code passing a struct ptr rather +// than using the typedef. This warning is expected and does not break +// a normal build. +// We can only disable -Wincompatible-pointer-types starting with GCC 5. + +// #if __GNU_MAJOR__ >= 5 +// +// #pragma GCC diagnostic ignored "-Wincompatible-pointer-types" +// +// typedef struct { +// int a; +// } issue27340Struct, *issue27340Ptr; +// +// static void issue27340CFunc(issue27340Ptr p) {} +// +// #else /* _GNU_MAJOR_ < 5 */ +// +// typedef struct { +// int a; +// } issue27340Struct; +// +// static issue27340Struct* issue27340Ptr(issue27340Struct* p) { return p; } +// +// static void issue27340CFunc(issue27340Struct *p) {} +// #endif /* _GNU_MAJOR_ < 5 */ +import "C" + +func Issue27340GoFunc() { + var s C.issue27340Struct + C.issue27340CFunc(C.issue27340Ptr(&s)) +} diff --git a/misc/cgo/test/issue9026/issue9026.go b/misc/cgo/test/issue9026/issue9026.go index 0af86e64da487..149c26562ad4d 100644 --- a/misc/cgo/test/issue9026/issue9026.go +++ b/misc/cgo/test/issue9026/issue9026.go @@ -29,7 +29,7 @@ func Test(t *testing.T) { // Brittle: the assertion may fail spuriously when the algorithm // changes, but should remain stable otherwise. got := fmt.Sprintf("%T %T", in, opts) - want := "issue9026._Ctype_struct___0 *issue9026._Ctype_struct___1" + want := "issue9026._Ctype_struct___0 *issue9026._Ctype_struct___0" if got != want { t.Errorf("Non-deterministic type names: got %s, want %s", got, want) } diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 8cbe6d329c5b5..17a9936e6ac6b 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -170,6 +170,10 @@ func (p *Package) Translate(f *File) { // Convert C.ulong to C.unsigned long, etc. cref.Name.C = cname(cref.Name.Go) } + + var conv typeConv + conv.Init(p.PtrSize, p.IntSize) + p.loadDefines(f) p.typedefs = map[string]bool{} p.typedefList = nil @@ -187,7 +191,7 @@ func (p *Package) Translate(f *File) { } needType := p.guessKinds(f) if len(needType) > 0 { - p.loadDWARF(f, needType) + p.loadDWARF(f, &conv, needType) } // In godefs mode we're OK with the typedefs, which @@ -482,7 +486,7 @@ func (p *Package) guessKinds(f *File) []*Name { // loadDWARF parses the DWARF debug information generated // by gcc to learn the details of the constants, variables, and types // being referred to as C.xxx. -func (p *Package) loadDWARF(f *File, names []*Name) { +func (p *Package) loadDWARF(f *File, conv *typeConv, names []*Name) { // Extract the types from the DWARF section of an object // from a well-formed C program. Gcc only generates DWARF info // for symbols in the object file, so it is not enough to print the @@ -589,8 +593,6 @@ func (p *Package) loadDWARF(f *File, names []*Name) { } // Record types and typedef information. - var conv typeConv - conv.Init(p.PtrSize, p.IntSize) for i, n := range names { if strings.HasSuffix(n.Go, "GetTypeID") && types[i].String() == "func() CFTypeID" { conv.getTypeIDs[n.Go[:len(n.Go)-9]] = true @@ -2011,10 +2013,10 @@ func runGcc(stdin []byte, args []string) (string, string) { // with equivalent memory layout. type typeConv struct { // Cache of already-translated or in-progress types. - m map[dwarf.Type]*Type + m map[string]*Type // Map from types to incomplete pointers to those types. - ptrs map[dwarf.Type][]*Type + ptrs map[string][]*Type // Keys of ptrs in insertion order (deterministic worklist) // ptrKeys contains exactly the keys in ptrs. ptrKeys []dwarf.Type @@ -2049,8 +2051,8 @@ var unionWithPointer = make(map[ast.Expr]bool) func (c *typeConv) Init(ptrSize, intSize int64) { c.ptrSize = ptrSize c.intSize = intSize - c.m = make(map[dwarf.Type]*Type) - c.ptrs = make(map[dwarf.Type][]*Type) + c.m = make(map[string]*Type) + c.ptrs = make(map[string][]*Type) c.getTypeIDs = make(map[string]bool) c.bool = c.Ident("bool") c.byte = c.Ident("byte") @@ -2158,11 +2160,12 @@ func (c *typeConv) FinishType(pos token.Pos) { // Keep looping until they're all done. for len(c.ptrKeys) > 0 { dtype := c.ptrKeys[0] + dtypeKey := dtype.String() c.ptrKeys = c.ptrKeys[1:] - ptrs := c.ptrs[dtype] - delete(c.ptrs, dtype) + ptrs := c.ptrs[dtypeKey] + delete(c.ptrs, dtypeKey) - // Note Type might invalidate c.ptrs[dtype]. + // Note Type might invalidate c.ptrs[dtypeKey]. t := c.Type(dtype, pos) for _, ptr := range ptrs { ptr.Go.(*ast.StarExpr).X = t.Go @@ -2174,7 +2177,8 @@ func (c *typeConv) FinishType(pos token.Pos) { // Type returns a *Type with the same memory layout as // dtype when used as the type of a variable or a struct field. func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type { - if t, ok := c.m[dtype]; ok { + key := dtype.String() + if t, ok := c.m[key]; ok { if t.Go == nil { fatalf("%s: type conversion loop at %s", lineno(pos), dtype) } @@ -2185,7 +2189,7 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type { t.Size = dtype.Size() // note: wrong for array of pointers, corrected below t.Align = -1 t.C = &TypeRepr{Repr: dtype.Common().Name} - c.m[dtype] = t + c.m[key] = t switch dt := dtype.(type) { default: @@ -2348,10 +2352,11 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type { // Placeholder initialization; completed in FinishType. t.Go = &ast.StarExpr{} t.C.Set("*") - if _, ok := c.ptrs[dt.Type]; !ok { + key := dt.Type.String() + if _, ok := c.ptrs[key]; !ok { c.ptrKeys = append(c.ptrKeys, dt.Type) } - c.ptrs[dt.Type] = append(c.ptrs[dt.Type], t) + c.ptrs[key] = append(c.ptrs[key], t) case *dwarf.QualType: t1 := c.Type(dt.Type, pos) From a11aa2aaecff98d6b46035704d587920c10788f9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 7 Dec 2018 14:19:01 -0800 Subject: [PATCH 283/594] cmd/link: only create .init_array section if not empty This avoids a warning from old versions of the GNU linker or glibc. No test because these old versions are not readily available. I tested this by hand on CentOS 6. Fixes #28722 Change-Id: I16640c9b83a79f759ec68fac64874803e74fbbfb Reviewed-on: https://go-review.googlesource.com/c/153257 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/link/internal/ld/data.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index 848087d7436bb..5209878b78c7d 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -1313,7 +1313,7 @@ func (ctxt *Link) dodata() { case BuildModeCArchive, BuildModeCShared, BuildModeShared, BuildModePlugin: hasinitarr = true } - if hasinitarr { + if hasinitarr && len(data[sym.SINITARR]) > 0 { sect := addsection(ctxt.Arch, &Segdata, ".init_array", 06) sect.Align = dataMaxAlign[sym.SINITARR] datsize = Rnd(datsize, int64(sect.Align)) From 9b95035654d620e1aafebd461fd976fe34adb72b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 10 Dec 2018 15:47:10 -0800 Subject: [PATCH 284/594] cmd/nm: run tests in parallel, don't use Scanner on []byte Saves about 35% on total test time on my laptop. Fixes #26471 Change-Id: I15b28b1bc00f889934d577dc7996864bbab10105 Reviewed-on: https://go-review.googlesource.com/c/153499 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick --- src/cmd/nm/nm_test.go | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/cmd/nm/nm_test.go b/src/cmd/nm/nm_test.go index 1f2ad53ef2715..53c39f2f896b6 100644 --- a/src/cmd/nm/nm_test.go +++ b/src/cmd/nm/nm_test.go @@ -5,8 +5,6 @@ package main import ( - "bufio" - "bytes" "fmt" "internal/testenv" "io/ioutil" @@ -55,6 +53,7 @@ func testMain(m *testing.M) int { } func TestNonGoExecs(t *testing.T) { + t.Parallel() testfiles := []string{ "debug/elf/testdata/gcc-386-freebsd-exec", "debug/elf/testdata/gcc-amd64-linux-exec", @@ -77,6 +76,7 @@ func TestNonGoExecs(t *testing.T) { } func testGoExec(t *testing.T, iscgo, isexternallinker bool) { + t.Parallel() tmpdir, err := ioutil.TempDir("", "TestGoExec") if err != nil { t.Fatal(err) @@ -154,10 +154,9 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) { return false } - scanner := bufio.NewScanner(bytes.NewBuffer(out)) dups := make(map[string]bool) - for scanner.Scan() { - f := strings.Fields(scanner.Text()) + for _, line := range strings.Split(string(out), "\n") { + f := strings.Fields(line) if len(f) < 3 { continue } @@ -184,10 +183,6 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) { delete(runtimeSyms, name) } } - err = scanner.Err() - if err != nil { - t.Fatalf("error reading nm output: %v", err) - } if len(names) > 0 { t.Errorf("executable is missing %v symbols", names) } @@ -201,6 +196,7 @@ func TestGoExec(t *testing.T) { } func testGoLib(t *testing.T, iscgo bool) { + t.Parallel() tmpdir, err := ioutil.TempDir("", "TestGoLib") if err != nil { t.Fatal(err) @@ -269,9 +265,9 @@ func testGoLib(t *testing.T, iscgo bool) { syms = append(syms, symType{"T", "cgofunc", true, false}) } } - scanner := bufio.NewScanner(bytes.NewBuffer(out)) - for scanner.Scan() { - f := strings.Fields(scanner.Text()) + + for _, line := range strings.Split(string(out), "\n") { + f := strings.Fields(line) var typ, name string var csym bool if iscgo { @@ -298,10 +294,6 @@ func testGoLib(t *testing.T, iscgo bool) { } } } - err = scanner.Err() - if err != nil { - t.Fatalf("error reading nm output: %v", err) - } for _, sym := range syms { if !sym.Found { t.Errorf("cannot found symbol %s %s", sym.Type, sym.Name) From f6a163177f858c7158ddca55671f1cd0782b9221 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 10 Dec 2018 19:35:01 -0800 Subject: [PATCH 285/594] cmd/cover: simplify and correct isValidIdentifier Per comment on CL 120316. Updates #25280 Change-Id: I7d078de4030bd10934468e04ff696a34749bd454 Reviewed-on: https://go-review.googlesource.com/c/153500 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Rob Pike --- src/cmd/cover/cover.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cmd/cover/cover.go b/src/cmd/cover/cover.go index 7f473a233c419..425bcbdd2660a 100644 --- a/src/cmd/cover/cover.go +++ b/src/cmd/cover/cover.go @@ -118,7 +118,7 @@ func parseFlags() error { } if *varVar != "" && !isValidIdentifier(*varVar) { - return fmt.Errorf("argument of -var is not a valid identifier: %v", *varVar) + return fmt.Errorf("-var: %q is not a valid identifier", *varVar) } if *mode != "" { @@ -683,12 +683,17 @@ func (f *File) addVariables(w io.Writer) { } func isValidIdentifier(ident string) bool { - first := true - for _, c := range ident { - if !unicode.IsLetter(c) && c != '_' && (first || !unicode.IsDigit(c)) { - return false // invalid identifier + if len(ident) == 0 { + return false + } + for i, c := range ident { + if i > 0 && unicode.IsDigit(c) { + continue + } + if c == '_' || unicode.IsLetter(c) { + continue } - first = false + return false } return true } From 01e072db5d26c224dfbe7763a5b94ab23c163983 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 11 Dec 2018 07:46:10 -0800 Subject: [PATCH 286/594] cmd/cgo: don't cache bad pointer typedefs The set of bad pointer typedefs changes as we see more typedefs, so avoid looking in the cache when we find one. Fixes #29175 Change-Id: Idd82289bdd8628d11a983fa5ec96517e3a5bcbf1 Reviewed-on: https://go-review.googlesource.com/c/153597 Run-TryBot: Ian Lance Taylor Reviewed-by: Keith Randall TryBot-Result: Gobot Gobot --- src/cmd/cgo/gcc.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 17a9936e6ac6b..321d4db040d64 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -2177,12 +2177,22 @@ func (c *typeConv) FinishType(pos token.Pos) { // Type returns a *Type with the same memory layout as // dtype when used as the type of a variable or a struct field. func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type { + // Always recompute bad pointer typedefs, as the set of such + // typedefs changes as we see more types. + checkCache := true + if dtt, ok := dtype.(*dwarf.TypedefType); ok && c.badPointerTypedef(dtt) { + checkCache = false + } + key := dtype.String() - if t, ok := c.m[key]; ok { - if t.Go == nil { - fatalf("%s: type conversion loop at %s", lineno(pos), dtype) + + if checkCache { + if t, ok := c.m[key]; ok { + if t.Go == nil { + fatalf("%s: type conversion loop at %s", lineno(pos), dtype) + } + return t } - return t } t := new(Type) From 47a71d9d77e1a8a76cb5bdc951df182789bf7165 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Wed, 12 Dec 2018 02:19:50 +1100 Subject: [PATCH 287/594] runtime: revise openbsd/arm runtime defs The OpenBSD arm port switched to EABI in September 2016 - this revises the layout of the runtime definitions to match what the kernel currently uses. Change-Id: I1bca7de56979f576862a7c280631e835f7ae4278 Reviewed-on: https://go-review.googlesource.com/c/153577 Reviewed-by: Ian Lance Taylor --- src/runtime/defs_openbsd_arm.go | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/runtime/defs_openbsd_arm.go b/src/runtime/defs_openbsd_arm.go index 1eea9ad45aeac..bfccf5772e327 100644 --- a/src/runtime/defs_openbsd_arm.go +++ b/src/runtime/defs_openbsd_arm.go @@ -130,8 +130,9 @@ type stackt struct { } type timespec struct { - tv_sec int64 - tv_nsec int32 + tv_sec int64 + tv_nsec int32 + pad_cgo_0 [4]byte } func (ts *timespec) set_sec(x int64) { @@ -143,8 +144,9 @@ func (ts *timespec) set_nsec(x int32) { } type timeval struct { - tv_sec int64 - tv_usec int32 + tv_sec int64 + tv_usec int32 + pad_cgo_0 [4]byte } func (tv *timeval) set_usec(x int32) { @@ -157,10 +159,12 @@ type itimerval struct { } type keventt struct { - ident uint32 - filter int16 - flags uint16 - fflags uint32 - data int64 - udata *byte + ident uint32 + filter int16 + flags uint16 + fflags uint32 + pad_cgo_0 [4]byte + data int64 + udata *byte + pad_cgo_1 [4]byte } From 21da8e6022d1d148741ba3c08cdc555df500520e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Mon, 10 Dec 2018 10:53:39 +0100 Subject: [PATCH 288/594] internal/xcoff: add big archive support This commit adds support to read AIX big archive inside internal/xcoff package. Change-Id: I4317b40824b24312a69c918dfc6438dc3aff7be7 Reviewed-on: https://go-review.googlesource.com/c/153398 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/internal/xcoff/ar.go | 228 +++++++++++++++++++++++ src/internal/xcoff/ar_test.go | 79 ++++++++ src/internal/xcoff/testdata/bigar-empty | 2 + src/internal/xcoff/testdata/bigar-ppc64 | Bin 0 -> 2468 bytes src/internal/xcoff/testdata/printbye.c | 5 + src/internal/xcoff/testdata/printhello.c | 5 + 6 files changed, 319 insertions(+) create mode 100644 src/internal/xcoff/ar.go create mode 100644 src/internal/xcoff/ar_test.go create mode 100644 src/internal/xcoff/testdata/bigar-empty create mode 100644 src/internal/xcoff/testdata/bigar-ppc64 create mode 100644 src/internal/xcoff/testdata/printbye.c create mode 100644 src/internal/xcoff/testdata/printhello.c diff --git a/src/internal/xcoff/ar.go b/src/internal/xcoff/ar.go new file mode 100644 index 0000000000000..0fb410f7dd71d --- /dev/null +++ b/src/internal/xcoff/ar.go @@ -0,0 +1,228 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xcoff + +import ( + "encoding/binary" + "fmt" + "io" + "os" + "strconv" + "strings" +) + +const ( + SAIAMAG = 0x8 + AIAFMAG = "`\n" + AIAMAG = "\n" + AIAMAGBIG = "\n" + + // Sizeof + FL_HSZ_BIG = 0x80 + AR_HSZ_BIG = 0x70 +) + +type bigarFileHeader struct { + Flmagic [SAIAMAG]byte // Archive magic string + Flmemoff [20]byte // Member table offset + Flgstoff [20]byte // 32-bits global symtab offset + Flgst64off [20]byte // 64-bits global symtab offset + Flfstmoff [20]byte // First member offset + Fllstmoff [20]byte // Last member offset + Flfreeoff [20]byte // First member on free list offset +} + +type bigarMemberHeader struct { + Arsize [20]byte // File member size + Arnxtmem [20]byte // Next member pointer + Arprvmem [20]byte // Previous member pointer + Ardate [12]byte // File member date + Aruid [12]byte // File member uid + Argid [12]byte // File member gid + Armode [12]byte // File member mode (octal) + Arnamlen [4]byte // File member name length + // _ar_nam is removed because it's easier to get name without it. +} + +// Archive represents an open AIX big archive. +type Archive struct { + ArchiveHeader + Members []*Member + + closer io.Closer +} + +// MemberHeader holds information about a big archive file header +type ArchiveHeader struct { + magic string +} + +// Member represents a member of an AIX big archive. +type Member struct { + MemberHeader + sr *io.SectionReader +} + +// MemberHeader holds information about a big archive member +type MemberHeader struct { + Name string + Size uint64 +} + +// OpenArchive opens the named archive using os.Open and prepares it for use +// as an AIX big archive. +func OpenArchive(name string) (*Archive, error) { + f, err := os.Open(name) + if err != nil { + return nil, err + } + arch, err := NewArchive(f) + if err != nil { + f.Close() + return nil, err + } + arch.closer = f + return arch, nil +} + +// Close closes the Archive. +// If the Archive was created using NewArchive directly instead of OpenArchive, +// Close has no effect. +func (a *Archive) Close() error { + var err error + if a.closer != nil { + err = a.closer.Close() + a.closer = nil + } + return err +} + +// NewArchive creates a new Archive for accessing an AIX big archive in an underlying reader. +func NewArchive(r io.ReaderAt) (*Archive, error) { + parseDecimalBytes := func(b []byte) (int64, error) { + return strconv.ParseInt(strings.TrimSpace(string(b)), 10, 64) + } + sr := io.NewSectionReader(r, 0, 1<<63-1) + + // Read File Header + var magic [SAIAMAG]byte + if _, err := sr.ReadAt(magic[:], 0); err != nil { + return nil, err + } + + arch := new(Archive) + switch string(magic[:]) { + case AIAMAGBIG: + arch.magic = string(magic[:]) + case AIAMAG: + return nil, fmt.Errorf("small AIX archive not supported") + default: + return nil, fmt.Errorf("unrecognised archive magic: 0x%x", magic) + } + + var fhdr bigarFileHeader + if _, err := sr.Seek(0, os.SEEK_SET); err != nil { + return nil, err + } + if err := binary.Read(sr, binary.BigEndian, &fhdr); err != nil { + return nil, err + } + + off, err := parseDecimalBytes(fhdr.Flfstmoff[:]) + if err != nil { + return nil, fmt.Errorf("error parsing offset of first member in archive header(%q); %v", fhdr, err) + } + + if off == 0 { + // Occurs if the archive is empty. + return arch, nil + } + + lastoff, err := parseDecimalBytes(fhdr.Fllstmoff[:]) + if err != nil { + return nil, fmt.Errorf("error parsing offset of first member in archive header(%q); %v", fhdr, err) + } + + // Read members + for { + // Read Member Header + // The member header is normally 2 bytes larger. But it's easier + // to read the name if the header is read without _ar_nam. + // However, AIAFMAG must be read afterward. + if _, err := sr.Seek(off, os.SEEK_SET); err != nil { + return nil, err + } + + var mhdr bigarMemberHeader + if err := binary.Read(sr, binary.BigEndian, &mhdr); err != nil { + return nil, err + } + + member := new(Member) + arch.Members = append(arch.Members, member) + + size, err := parseDecimalBytes(mhdr.Arsize[:]) + if err != nil { + return nil, fmt.Errorf("error parsing size in member header(%q); %v", mhdr, err) + } + member.Size = uint64(size) + + // Read name + namlen, err := parseDecimalBytes(mhdr.Arnamlen[:]) + if err != nil { + return nil, fmt.Errorf("error parsing name length in member header(%q); %v", mhdr, err) + } + name := make([]byte, namlen) + if err := binary.Read(sr, binary.BigEndian, name); err != nil { + return nil, err + } + member.Name = string(name) + + fileoff := off + AR_HSZ_BIG + namlen + if fileoff&1 != 0 { + fileoff++ + if _, err := sr.Seek(1, os.SEEK_CUR); err != nil { + return nil, err + } + } + + // Read AIAFMAG string + var fmag [2]byte + if err := binary.Read(sr, binary.BigEndian, &fmag); err != nil { + return nil, err + } + if string(fmag[:]) != AIAFMAG { + return nil, fmt.Errorf("AIAFMAG not found after member header") + } + + fileoff += 2 // Add the two bytes of AIAFMAG + member.sr = io.NewSectionReader(sr, fileoff, size) + + if off == lastoff { + break + } + off, err = parseDecimalBytes(mhdr.Arnxtmem[:]) + if err != nil { + return nil, fmt.Errorf("error parsing offset of first member in archive header(%q); %v", fhdr, err) + } + + } + + return arch, nil + +} + +// GetFile returns the XCOFF file defined by member name. +// FIXME: This doesn't work if an archive has two members with the same +// name which can occur if a archive has both 32-bits and 64-bits files. +func (arch *Archive) GetFile(name string) (*File, error) { + for _, mem := range arch.Members { + if mem.Name == name { + return NewFile(mem.sr) + } + } + return nil, fmt.Errorf("unknown member %s in archive", name) + +} diff --git a/src/internal/xcoff/ar_test.go b/src/internal/xcoff/ar_test.go new file mode 100644 index 0000000000000..03c2fd1c5a21a --- /dev/null +++ b/src/internal/xcoff/ar_test.go @@ -0,0 +1,79 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xcoff + +import ( + "reflect" + "testing" +) + +type archiveTest struct { + file string + hdr ArchiveHeader + members []*MemberHeader + membersFileHeader []FileHeader +} + +var archTest = []archiveTest{ + { + "testdata/bigar-ppc64", + ArchiveHeader{AIAMAGBIG}, + []*MemberHeader{ + {"printbye.o", 836}, + {"printhello.o", 860}, + }, + []FileHeader{ + FileHeader{U64_TOCMAGIC}, + FileHeader{U64_TOCMAGIC}, + }, + }, + { + "testdata/bigar-empty", + ArchiveHeader{AIAMAGBIG}, + []*MemberHeader{}, + []FileHeader{}, + }, +} + +func TestOpenArchive(t *testing.T) { + for i := range archTest { + tt := &archTest[i] + arch, err := OpenArchive(tt.file) + if err != nil { + t.Error(err) + continue + } + if !reflect.DeepEqual(arch.ArchiveHeader, tt.hdr) { + t.Errorf("open archive %s:\n\thave %#v\n\twant %#v\n", tt.file, arch.ArchiveHeader, tt.hdr) + continue + } + + for i, mem := range arch.Members { + if i >= len(tt.members) { + break + } + have := &mem.MemberHeader + want := tt.members[i] + if !reflect.DeepEqual(have, want) { + t.Errorf("open %s, member %d:\n\thave %#v\n\twant %#v\n", tt.file, i, have, want) + } + + f, err := arch.GetFile(mem.Name) + if err != nil { + t.Error(err) + continue + } + if !reflect.DeepEqual(f.FileHeader, tt.membersFileHeader[i]) { + t.Errorf("open %s, member file header %d:\n\thave %#v\n\twant %#v\n", tt.file, i, f.FileHeader, tt.membersFileHeader[i]) + } + } + tn := len(tt.members) + an := len(arch.Members) + if tn != an { + t.Errorf("open %s: len(Members) = %d, want %d", tt.file, an, tn) + } + + } +} diff --git a/src/internal/xcoff/testdata/bigar-empty b/src/internal/xcoff/testdata/bigar-empty new file mode 100644 index 0000000000000..851ccc5123694 --- /dev/null +++ b/src/internal/xcoff/testdata/bigar-empty @@ -0,0 +1,2 @@ + +0 0 0 0 0 0 \ No newline at end of file diff --git a/src/internal/xcoff/testdata/bigar-ppc64 b/src/internal/xcoff/testdata/bigar-ppc64 new file mode 100644 index 0000000000000000000000000000000000000000..a8d4979d121f71266b57bc33c0e55e2b8a679cbb GIT binary patch literal 2468 zcmcIm&ubG=5T4ye3F)CxN@=}x=FfVZC|q z;8DSI>A&Tz;z96YpkkbPZ{FJ<*`^xsL3U=|``*mFdHc=gPP22+*uR%4<|`#DHu5o> z%wn-pj87MePJGHLB!A9EdG5W1&Cot<2w0SZ%Abb90G9Kq9Z%5U|;aL;l(PZ+~#dZ2QRq)RcGfFR3QLur%k~P&>q`r4t)etP-C&E(c(uv~^iaua%SS7v zEsB!X78;P6{08&DP`TPKXcEUSDa12FPm@j+9p@o4OQ${}3}=2#E`~8Hgb{wY;(UP$ zIioo*ZK-s{0Dkng&!iVb^8v-`(;po~C~@AS@-EqJ_T z+j(%xVYW#gCiRlU9`UdI#m*x#I&62lUWmcpWg(2uQeMj7F5^ylU!83d`~u*u z?NhQu7yx6LWlKu&{67rN1m|B51*=m*j=g?2oI$YuF;FAgE?X|kS&SwQ2aFz~6)^e( zS^=Xe+Qp2PcPBYLKchMGIT?LZGkOto#SvpPowcYLv??HRMib^PVP-Iz>QdK!n2EV4 zqp4ck8Y4r+8BLgH8Z*u4-HRA4ip`vsh1aZ>OTp{J?|O*Y!G}|SUK79mmwf5N{b82w zW~TmFVBEyMkq}XJD%+F2N}kpOC&6hr3w5-lo)yOZt?qJf*I#g-uasq~Chb%$=(#F) MY{~TRWa?)A0AGJZeE + +void printbye(){ + printf("Goodbye\n"); +} diff --git a/src/internal/xcoff/testdata/printhello.c b/src/internal/xcoff/testdata/printhello.c new file mode 100644 index 0000000000000..182aa09728abc --- /dev/null +++ b/src/internal/xcoff/testdata/printhello.c @@ -0,0 +1,5 @@ +#include + +void printhello(){ + printf("Helloworld\n"); +} From ba607240f76fce446e1104d034e444ec42e22c73 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 7 Dec 2018 17:36:55 -0500 Subject: [PATCH 289/594] cmd/go: add a chmod command to script_test Change-Id: I5d4f65553f6c368d101be59aae9440f5ec9573b7 Reviewed-on: https://go-review.googlesource.com/c/153461 Run-TryBot: Bryan C. Mills Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/cmd/go/script_test.go | 19 +++++++++++++++++++ src/cmd/go/testdata/script/README | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index 31ddf02fb0a00..e180080a9da0f 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -342,6 +342,7 @@ Script: var scriptCmds = map[string]func(*testScript, bool, []string){ "addcrlf": (*testScript).cmdAddcrlf, "cd": (*testScript).cmdCd, + "chmod": (*testScript).cmdChmod, "cmp": (*testScript).cmdCmp, "cmpenv": (*testScript).cmdCmpenv, "cp": (*testScript).cmdCp, @@ -400,6 +401,24 @@ func (ts *testScript) cmdCd(neg bool, args []string) { fmt.Fprintf(&ts.log, "%s\n", ts.cd) } +// chmod changes permissions for a file or directory. +func (ts *testScript) cmdChmod(neg bool, args []string) { + if neg { + ts.fatalf("unsupported: ! chmod") + } + if len(args) < 2 { + ts.fatalf("usage: chmod perm paths...") + } + perm, err := strconv.ParseUint(args[0], 0, 32) + if err != nil || perm&uint64(os.ModePerm) != perm { + ts.fatalf("invalid mode: %s", args[0]) + } + for _, path := range args[1:] { + err := os.Chmod(path, os.FileMode(perm)) + ts.check(err) + } +} + // cmp compares two files. func (ts *testScript) cmdCmp(neg bool, args []string) { if neg { diff --git a/src/cmd/go/testdata/script/README b/src/cmd/go/testdata/script/README index 22124b9fb89c6..392ff34fc2d40 100644 --- a/src/cmd/go/testdata/script/README +++ b/src/cmd/go/testdata/script/README @@ -86,6 +86,10 @@ The commands are: - cd dir Change to the given directory for future commands. +- chmod perm path... + Change the permissions of the files or directories named by the path arguments + to be equal to perm. Only numerical permissions are supported. + - cmp file1 file2 Check that the named files have the same content. By convention, file1 is the actual data and file2 the expected data. From f36a53e95ca86cc57349dc9320f9d87fef783708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 5 Dec 2018 17:27:24 +0100 Subject: [PATCH 290/594] go/internal/gccgoimporter: add XCOFF support This commit adds support to read XCOFF files and AIX big archives in go/internal/gccgoimporter. Fixes: #29113 Change-Id: Id84d40358ff98fae5a576d1ebdd65980896365b9 Reviewed-on: https://go-review.googlesource.com/c/152720 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/go/build/deps_test.go | 2 +- src/go/internal/gccgoimporter/ar.go | 27 +++++++++++++++++-- src/go/internal/gccgoimporter/importer.go | 32 ++++++++++++++++------- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index dd38cc0a6a582..3a70991639e39 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -230,7 +230,7 @@ var pkgDeps = map[string][]string{ "go/constant": {"L4", "go/token", "math/big"}, "go/importer": {"L4", "go/build", "go/internal/gccgoimporter", "go/internal/gcimporter", "go/internal/srcimporter", "go/token", "go/types"}, "go/internal/gcimporter": {"L4", "OS", "go/build", "go/constant", "go/token", "go/types", "text/scanner"}, - "go/internal/gccgoimporter": {"L4", "OS", "debug/elf", "go/constant", "go/token", "go/types", "text/scanner"}, + "go/internal/gccgoimporter": {"L4", "OS", "debug/elf", "go/constant", "go/token", "go/types", "internal/xcoff", "text/scanner"}, "go/internal/srcimporter": {"L4", "OS", "fmt", "go/ast", "go/build", "go/parser", "go/token", "go/types", "path/filepath"}, "go/types": {"L4", "GOPARSER", "container/heap", "go/constant"}, diff --git a/src/go/internal/gccgoimporter/ar.go b/src/go/internal/gccgoimporter/ar.go index ebd08b8f35957..443aa26a0cdf5 100644 --- a/src/go/internal/gccgoimporter/ar.go +++ b/src/go/internal/gccgoimporter/ar.go @@ -9,6 +9,7 @@ import ( "debug/elf" "errors" "fmt" + "internal/xcoff" "io" "strconv" "strings" @@ -65,13 +66,13 @@ func arExportData(archive io.ReadSeeker) (io.ReadSeeker, error) { case armagt: return nil, errors.New("unsupported thin archive") case armagb: - return nil, errors.New("unsupported AIX big archive") + return aixBigArExportData(archive) default: return nil, fmt.Errorf("unrecognized archive file format %q", buf[:]) } } -// standardArExportData returns export data form a standard archive. +// standardArExportData returns export data from a standard archive. func standardArExportData(archive io.ReadSeeker) (io.ReadSeeker, error) { off := int64(len(armag)) for { @@ -126,6 +127,28 @@ func elfFromAr(member *io.SectionReader) (io.ReadSeeker, error) { return sec.Open(), nil } +// aixBigArExportData returns export data from an AIX big archive. +func aixBigArExportData(archive io.ReadSeeker) (io.ReadSeeker, error) { + archiveAt := readerAtFromSeeker(archive) + arch, err := xcoff.NewArchive(archiveAt) + if err != nil { + return nil, err + } + + for _, mem := range arch.Members { + f, err := arch.GetFile(mem.Name) + if err != nil { + return nil, err + } + sdat := f.CSect(".go_export") + if sdat != nil { + return bytes.NewReader(sdat), nil + } + } + + return nil, fmt.Errorf(".go_export not found in this archive") +} + // readerAtFromSeeker turns an io.ReadSeeker into an io.ReaderAt. // This is only safe because there won't be any concurrent seeks // while this code is executing. diff --git a/src/go/internal/gccgoimporter/importer.go b/src/go/internal/gccgoimporter/importer.go index ea111136cdadb..6856611026f32 100644 --- a/src/go/internal/gccgoimporter/importer.go +++ b/src/go/internal/gccgoimporter/importer.go @@ -6,9 +6,11 @@ package gccgoimporter // import "go/internal/gccgoimporter" import ( + "bytes" "debug/elf" "fmt" "go/types" + "internal/xcoff" "io" "os" "path/filepath" @@ -65,6 +67,7 @@ const ( gccgov3Magic = "v3;\n" goimporterMagic = "\n$$ " archiveMagic = "! Date: Tue, 11 Dec 2018 11:48:01 -0500 Subject: [PATCH 291/594] cmd/go: add a [root] condition to script_test [root] reports whether the current effective user ID is 0. Updates #29127 Change-Id: I9ef42f1271ea669689011e7ceff4d918c0cecb6b Reviewed-on: https://go-review.googlesource.com/c/153637 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/go/script_test.go | 2 ++ src/cmd/go/testdata/script/README | 1 + 2 files changed, 3 insertions(+) diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index e180080a9da0f..284b3548c451c 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -274,6 +274,8 @@ Script: ok = testenv.HasExternalNetwork() case "link": ok = testenv.HasLink() + case "root": + ok = os.Geteuid() == 0 case "symlink": ok = testenv.HasSymlink() default: diff --git a/src/cmd/go/testdata/script/README b/src/cmd/go/testdata/script/README index 392ff34fc2d40..76d4b36b017ca 100644 --- a/src/cmd/go/testdata/script/README +++ b/src/cmd/go/testdata/script/README @@ -75,6 +75,7 @@ should only run when the condition is satisfied. The available conditions are: - [cgo], [msan], [race] for whether cgo, msan, and the race detector can be used - [net] for whether the external network can be used - [link] for testenv.HasLink() + - [root] for os.Geteuid() == 0 - [symlink] for testenv.HasSymlink() - [exec:prog] for whether prog is available for execution (found by exec.LookPath) From 01a1eaa10c95dbbb1decad79334a2d6f34dc6832 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 7 Dec 2018 10:00:36 -0800 Subject: [PATCH 292/594] cmd/compile: use innermost line number for -S When functions are inlined, for instructions in the inlined body, does -S print the location of the call, or the location of the body? Right now, we do the former. I'd like to do the latter by default, it makes much more sense when reading disassembly. With mid-stack inlining enabled in more cases, this quandry will come up more often. The original behavior is still available with -S=2. Some tests use this mode (so they can find assembly generated by a particular source line). This helped me with understanding what the compiler was doing while fixing #29007. Change-Id: Id14a3a41e1b18901e7c5e460aa4caf6d940ed064 Reviewed-on: https://go-review.googlesource.com/c/153241 Reviewed-by: David Chase --- src/cmd/asm/main.go | 2 +- src/cmd/compile/internal/gc/global_test.go | 17 ++++++++--------- src/cmd/compile/internal/gc/main.go | 10 +++++----- src/cmd/internal/obj/link.go | 2 +- src/cmd/internal/obj/objfile.go | 10 ++++++++-- src/cmd/internal/obj/plist.go | 2 +- src/cmd/internal/obj/util.go | 15 ++++++++++++++- test/run.go | 3 ++- 8 files changed, 40 insertions(+), 21 deletions(-) diff --git a/src/cmd/asm/main.go b/src/cmd/asm/main.go index 55ae94a6de5a6..447d1afde3a08 100644 --- a/src/cmd/asm/main.go +++ b/src/cmd/asm/main.go @@ -36,7 +36,7 @@ func main() { ctxt := obj.Linknew(architecture.LinkArch) if *flags.PrintOut { - ctxt.Debugasm = true + ctxt.Debugasm = 1 } ctxt.Flag_dynlink = *flags.Dynlink ctxt.Flag_shared = *flags.Shared || *flags.Dynlink diff --git a/src/cmd/compile/internal/gc/global_test.go b/src/cmd/compile/internal/gc/global_test.go index 857cf967502cf..56855d797a194 100644 --- a/src/cmd/compile/internal/gc/global_test.go +++ b/src/cmd/compile/internal/gc/global_test.go @@ -8,7 +8,6 @@ import ( "bytes" "internal/testenv" "io/ioutil" - "log" "os" "os/exec" "path/filepath" @@ -24,7 +23,7 @@ func TestScanfRemoval(t *testing.T) { // Make a directory to work in. dir, err := ioutil.TempDir("", "issue6853a-") if err != nil { - log.Fatalf("could not create directory: %v", err) + t.Fatalf("could not create directory: %v", err) } defer os.RemoveAll(dir) @@ -32,7 +31,7 @@ func TestScanfRemoval(t *testing.T) { src := filepath.Join(dir, "test.go") f, err := os.Create(src) if err != nil { - log.Fatalf("could not create source file: %v", err) + t.Fatalf("could not create source file: %v", err) } f.Write([]byte(` package main @@ -50,17 +49,17 @@ func main() { cmd := exec.Command(testenv.GoToolPath(t), "build", "-o", dst, src) out, err := cmd.CombinedOutput() if err != nil { - log.Fatalf("could not build target: %v", err) + t.Fatalf("could not build target: %v", err) } // Check destination to see if scanf code was included. cmd = exec.Command(testenv.GoToolPath(t), "tool", "nm", dst) out, err = cmd.CombinedOutput() if err != nil { - log.Fatalf("could not read target: %v", err) + t.Fatalf("could not read target: %v", err) } if bytes.Contains(out, []byte("scanInt")) { - log.Fatalf("scanf code not removed from helloworld") + t.Fatalf("scanf code not removed from helloworld") } } @@ -71,7 +70,7 @@ func TestDashS(t *testing.T) { // Make a directory to work in. dir, err := ioutil.TempDir("", "issue14515-") if err != nil { - log.Fatalf("could not create directory: %v", err) + t.Fatalf("could not create directory: %v", err) } defer os.RemoveAll(dir) @@ -79,7 +78,7 @@ func TestDashS(t *testing.T) { src := filepath.Join(dir, "test.go") f, err := os.Create(src) if err != nil { - log.Fatalf("could not create source file: %v", err) + t.Fatalf("could not create source file: %v", err) } f.Write([]byte(` package main @@ -94,7 +93,7 @@ func main() { cmd := exec.Command(testenv.GoToolPath(t), "build", "-gcflags", "-S", "-o", filepath.Join(dir, "test"), src) out, err := cmd.CombinedOutput() if err != nil { - log.Fatalf("could not build target: %v", err) + t.Fatalf("could not build target: %v", err) } patterns := []string{ diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index adfdd7cb376f6..f44d19b4390ef 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -39,7 +39,6 @@ var ( var ( Debug_append int - Debug_asm bool Debug_closure int Debug_compilelater int debug_dclstack int @@ -195,7 +194,7 @@ func Main(archInit func(*Arch)) { objabi.Flagcount("K", "debug missing line numbers", &Debug['K']) objabi.Flagcount("L", "show full file names in error messages", &Debug['L']) objabi.Flagcount("N", "disable optimizations", &Debug['N']) - flag.BoolVar(&Debug_asm, "S", false, "print assembly listing") + objabi.Flagcount("S", "print assembly listing", &Debug['S']) objabi.AddVersionFlag() // -V objabi.Flagcount("W", "debug parse tree after type checking", &Debug['W']) flag.StringVar(&asmhdr, "asmhdr", "", "write assembly header to `file`") @@ -265,7 +264,7 @@ func Main(archInit func(*Arch)) { Ctxt.Flag_dynlink = flag_dynlink Ctxt.Flag_optimize = Debug['N'] == 0 - Ctxt.Debugasm = Debug_asm + Ctxt.Debugasm = Debug['S'] Ctxt.Debugvlog = Debug_vlog if flagDWARF { Ctxt.DebugInfo = debuginfo @@ -1330,6 +1329,7 @@ var concurrentFlagOK = [256]bool{ 'l': true, // disable inlining 'w': true, // all printing happens before compilation 'W': true, // all printing happens before compilation + 'S': true, // printing disassembly happens at the end (but see concurrentBackendAllowed below) } func concurrentBackendAllowed() bool { @@ -1338,9 +1338,9 @@ func concurrentBackendAllowed() bool { return false } } - // Debug_asm by itself is ok, because all printing occurs + // Debug['S'] by itself is ok, because all printing occurs // while writing the object file, and that is non-concurrent. - // Adding Debug_vlog, however, causes Debug_asm to also print + // Adding Debug_vlog, however, causes Debug['S'] to also print // while flushing the plist, which happens concurrently. if Debug_vlog || debugstr != "" || debuglive > 0 { return false diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index 6cff335ddfab2..dfecdfbb37981 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -599,7 +599,7 @@ type Pcdata struct { type Link struct { Headtype objabi.HeadType Arch *LinkArch - Debugasm bool + Debugasm int Debugvlog bool Debugpcln string Flag_shared bool diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 4fbaafe3474fc..49301f04d504b 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -240,7 +240,13 @@ func (w *objWriter) writeSymDebug(s *LSym) { fmt.Fprintf(ctxt.Bso, "\n") if s.Type == objabi.STEXT { for p := s.Func.Text; p != nil; p = p.Link { - fmt.Fprintf(ctxt.Bso, "\t%#04x %v\n", uint(int(p.Pc)), p) + var s string + if ctxt.Debugasm > 1 { + s = p.String() + } else { + s = p.InnermostString() + } + fmt.Fprintf(ctxt.Bso, "\t%#04x %s\n", uint(int(p.Pc)), s) } } for i := 0; i < len(s.P); i += 16 { @@ -283,7 +289,7 @@ func (w *objWriter) writeSymDebug(s *LSym) { func (w *objWriter) writeSym(s *LSym) { ctxt := w.ctxt - if ctxt.Debugasm { + if ctxt.Debugasm > 0 { w.writeSymDebug(s) } diff --git a/src/cmd/internal/obj/plist.go b/src/cmd/internal/obj/plist.go index 6710b375f1611..9d376f739ffcb 100644 --- a/src/cmd/internal/obj/plist.go +++ b/src/cmd/internal/obj/plist.go @@ -27,7 +27,7 @@ func Flushplist(ctxt *Link, plist *Plist, newprog ProgAlloc, myimportpath string var plink *Prog for p := plist.Firstpc; p != nil; p = plink { - if ctxt.Debugasm && ctxt.Debugvlog { + if ctxt.Debugasm > 0 && ctxt.Debugvlog { fmt.Printf("obj: %v\n", p) } plink = p.Link diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go index 46c3d7b17bbd1..f1517d3d5d1df 100644 --- a/src/cmd/internal/obj/util.go +++ b/src/cmd/internal/obj/util.go @@ -17,6 +17,9 @@ const REG_NONE = 0 func (p *Prog) Line() string { return p.Ctxt.OutermostPos(p.Pos).Format(false, true) } +func (p *Prog) InnermostLine() string { + return p.Ctxt.InnermostPos(p.Pos).Format(false, true) +} // InnermostLineNumber returns a string containing the line number for the // innermost inlined function (if any inlining) at p's position @@ -118,6 +121,16 @@ func (p *Prog) String() string { return fmt.Sprintf("%.5d (%v)\t%s", p.Pc, p.Line(), p.InstructionString()) } +func (p *Prog) InnermostString() string { + if p == nil { + return "" + } + if p.Ctxt == nil { + return "" + } + return fmt.Sprintf("%.5d (%v)\t%s", p.Pc, p.InnermostLine(), p.InstructionString()) +} + // InstructionString returns a string representation of the instruction without preceding // program counter or file and line number. func (p *Prog) InstructionString() string { @@ -177,7 +190,7 @@ func (ctxt *Link) NewProg() *Prog { } func (ctxt *Link) CanReuseProgs() bool { - return !ctxt.Debugasm + return ctxt.Debugasm == 0 } func Dconv(p *Prog, a *Addr) string { diff --git a/test/run.go b/test/run.go index 96192937b09bc..ad38d420c9bbc 100644 --- a/test/run.go +++ b/test/run.go @@ -642,7 +642,8 @@ func (t *test) run() { // against a set of regexps in comments. ops := t.wantedAsmOpcodes(long) for _, env := range ops.Envs() { - cmdline := []string{"build", "-gcflags", "-S"} + // -S=2 forces outermost line numbers when disassembling inlined code. + cmdline := []string{"build", "-gcflags", "-S=2"} cmdline = append(cmdline, flags...) cmdline = append(cmdline, long) cmd := exec.Command(goTool(), cmdline...) From 353ebe721019ac833646bea829d7840e55f3da30 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 10 Dec 2018 14:58:08 -0500 Subject: [PATCH 293/594] cmd/go/internal/modfetch/codehost: return VCSError for unimplemented functions and malformed responses Updates #28943 Updates #26092 Change-Id: I07af2731ef5af046b9f7c7280ccb3976cdf41ca4 Reviewed-on: https://go-review.googlesource.com/c/153458 Run-TryBot: Bryan C. Mills Reviewed-by: Jay Conrod --- src/cmd/go/internal/modfetch/codehost/vcs.go | 39 +++++++++++++------- src/cmd/go/testdata/script/mod_get_svn.txt | 21 +++++++++++ 2 files changed, 46 insertions(+), 14 deletions(-) create mode 100644 src/cmd/go/testdata/script/mod_get_svn.txt diff --git a/src/cmd/go/internal/modfetch/codehost/vcs.go b/src/cmd/go/internal/modfetch/codehost/vcs.go index 190f47cf8d1f0..59c2b15d19a06 100644 --- a/src/cmd/go/internal/modfetch/codehost/vcs.go +++ b/src/cmd/go/internal/modfetch/codehost/vcs.go @@ -28,12 +28,19 @@ import ( // to get the code, but we can't access it due to the error. // The caller should report this error instead of continuing to probe // other possible module paths. +// +// TODO(bcmills): See if we can invert this. (Return a distinguished error for +// “repo not found” and treat everything else as terminal.) type VCSError struct { Err error } func (e *VCSError) Error() string { return e.Err.Error() } +func vcsErrorf(format string, a ...interface{}) error { + return &VCSError{Err: fmt.Errorf(format, a...)} +} + func NewRepo(vcs, remote string) (Repo, error) { type key struct { vcs string @@ -339,7 +346,7 @@ func (r *vcsRepo) fetch() { func (r *vcsRepo) statLocal(rev string) (*RevInfo, error) { out, err := Run(r.dir, r.cmd.statLocal(rev, r.remote)) if err != nil { - return nil, fmt.Errorf("unknown revision %s", rev) + return nil, vcsErrorf("unknown revision %s", rev) } return r.cmd.parseStat(rev, string(out)) } @@ -381,7 +388,7 @@ func (r *vcsRepo) ReadFileRevs(revs []string, file string, maxSize int64) (map[s } defer unlock() - return nil, fmt.Errorf("ReadFileRevs not implemented") + return nil, vcsErrorf("ReadFileRevs not implemented") } func (r *vcsRepo) RecentTag(rev, prefix string) (tag string, err error) { @@ -394,10 +401,14 @@ func (r *vcsRepo) RecentTag(rev, prefix string) (tag string, err error) { } defer unlock() - return "", fmt.Errorf("RecentTags not implemented") + return "", vcsErrorf("RecentTag not implemented") } func (r *vcsRepo) ReadZip(rev, subdir string, maxSize int64) (zip io.ReadCloser, actualSubdir string, err error) { + if r.cmd.readZip == nil { + return nil, "", vcsErrorf("ReadZip not implemented for %s", r.cmd.vcs) + } + unlock, err := r.mu.Lock() if err != nil { return nil, "", err @@ -448,7 +459,7 @@ func (d *deleteCloser) Close() error { func hgParseStat(rev, out string) (*RevInfo, error) { f := strings.Fields(string(out)) if len(f) < 3 { - return nil, fmt.Errorf("unexpected response from hg log: %q", out) + return nil, vcsErrorf("unexpected response from hg log: %q", out) } hash := f[0] version := rev @@ -457,7 +468,7 @@ func hgParseStat(rev, out string) (*RevInfo, error) { } t, err := strconv.ParseInt(f[1], 10, 64) if err != nil { - return nil, fmt.Errorf("invalid time from hg log: %q", out) + return nil, vcsErrorf("invalid time from hg log: %q", out) } var tags []string @@ -486,12 +497,12 @@ func svnParseStat(rev, out string) (*RevInfo, error) { } `xml:"logentry"` } if err := xml.Unmarshal([]byte(out), &log); err != nil { - return nil, fmt.Errorf("unexpected response from svn log --xml: %v\n%s", err, out) + return nil, vcsErrorf("unexpected response from svn log --xml: %v\n%s", err, out) } t, err := time.Parse(time.RFC3339, log.Logentry.Date) if err != nil { - return nil, fmt.Errorf("unexpected response from svn log --xml: %v\n%s", err, out) + return nil, vcsErrorf("unexpected response from svn log --xml: %v\n%s", err, out) } info := &RevInfo{ @@ -527,23 +538,23 @@ func bzrParseStat(rev, out string) (*RevInfo, error) { } i, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("unexpected revno from bzr log: %q", line) + return nil, vcsErrorf("unexpected revno from bzr log: %q", line) } revno = i case "timestamp": j := strings.Index(val, " ") if j < 0 { - return nil, fmt.Errorf("unexpected timestamp from bzr log: %q", line) + return nil, vcsErrorf("unexpected timestamp from bzr log: %q", line) } t, err := time.Parse("2006-01-02 15:04:05 -0700", val[j+1:]) if err != nil { - return nil, fmt.Errorf("unexpected timestamp from bzr log: %q", line) + return nil, vcsErrorf("unexpected timestamp from bzr log: %q", line) } tm = t.UTC() } } if revno == 0 || tm.IsZero() { - return nil, fmt.Errorf("unexpected response from bzr log: %q", out) + return nil, vcsErrorf("unexpected response from bzr log: %q", out) } info := &RevInfo{ @@ -560,11 +571,11 @@ func fossilParseStat(rev, out string) (*RevInfo, error) { if strings.HasPrefix(line, "uuid:") { f := strings.Fields(line) if len(f) != 5 || len(f[1]) != 40 || f[4] != "UTC" { - return nil, fmt.Errorf("unexpected response from fossil info: %q", line) + return nil, vcsErrorf("unexpected response from fossil info: %q", line) } t, err := time.Parse("2006-01-02 15:04:05", f[2]+" "+f[3]) if err != nil { - return nil, fmt.Errorf("unexpected response from fossil info: %q", line) + return nil, vcsErrorf("unexpected response from fossil info: %q", line) } hash := f[1] version := rev @@ -580,5 +591,5 @@ func fossilParseStat(rev, out string) (*RevInfo, error) { return info, nil } } - return nil, fmt.Errorf("unexpected response from fossil info: %q", out) + return nil, vcsErrorf("unexpected response from fossil info: %q", out) } diff --git a/src/cmd/go/testdata/script/mod_get_svn.txt b/src/cmd/go/testdata/script/mod_get_svn.txt new file mode 100644 index 0000000000000..ad96fa13575d9 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_get_svn.txt @@ -0,0 +1,21 @@ +[!net] skip +[!exec:svn] skip + +env GO111MODULE=on +env GOPROXY=direct # obtain llvm.org directory, not via svn. + +# Attempting to get a module zip using svn should fail with a reasonable +# message instead of a panic. +# TODO(golang.org/issue/26092): Really, it shouldn't fail at all. +! go get -d llvm.org/llvm/bindings/go/llvm +stderr 'ReadZip not implemented for svn' +! go install . +# TODO(bcmills): The error message here should mention ReadZip. +stderr 'cannot find module for path llvm.org' + +-- go.mod -- +module golang/go/issues/28943/main +-- main.go -- +package main +import _ "llvm.org/llvm/bindings/go/llvm" +func main() {} From cee9dfc39bef7b53ffa4ee584ec7fdec03c95a5a Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Mon, 10 Dec 2018 15:02:38 -0500 Subject: [PATCH 294/594] cmd/go: fix 'go test' and 'go fmt' with files outside a module Use the actual loader result in findModule instead of making assumptions about nesting in the build list. As a side-effect, this produces much clearer error messages for packages that (for one reason or another) failed to load. Adjust the package and module path outside a module to "command-line-arguments". That string already appears in the output of a number of (module-mode and GOPATH-mode) commands for file arguments, and as far as I can tell operation outside a module is currently the only case in which the module path of a package is not actually a prefix of the import path. Fixes #28011 Fixes #27099 Fixes #28943 Updates #27102 Updates #28459 Updates #27063 Change-Id: I61d5556df7b1b7d1efdaffa892f0e3e95b612d87 Reviewed-on: https://go-review.googlesource.com/c/153459 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- src/cmd/go/internal/load/pkg.go | 17 +++---- src/cmd/go/internal/modload/build.go | 36 ++++++++------ src/cmd/go/internal/modload/init.go | 2 +- src/cmd/go/testdata/script/mod_enabled.txt | 4 +- src/cmd/go/testdata/script/mod_get_svn.txt | 3 +- src/cmd/go/testdata/script/mod_outside.txt | 12 +++-- src/cmd/go/testdata/script/mod_test_files.txt | 49 +++++++++++++++++++ 7 files changed, 91 insertions(+), 32 deletions(-) create mode 100644 src/cmd/go/testdata/script/mod_test_files.txt diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go index 616adcc57ae80..228be07f2492a 100644 --- a/src/cmd/go/internal/load/pkg.go +++ b/src/cmd/go/internal/load/pkg.go @@ -997,10 +997,12 @@ func disallowInternal(srcDir string, importer *Package, importerPath string, p * } else { // p is in a module, so make it available based on the importer's import path instead // of the file path (https://golang.org/issue/23970). - if importerPath == "." { + if importer.Internal.CmdlineFiles { // The importer is a list of command-line files. // Pretend that the import path is the import path of the // directory containing them. + // If the directory is outside the main module, this will resolve to ".", + // which is not a prefix of any valid module. importerPath = ModDirImportPath(importer.Dir) } parentOfInternal := p.ImportPath[:i] @@ -1515,11 +1517,13 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) { } if cfg.ModulesEnabled { - if !p.Internal.CmdlineFiles { - p.Module = ModPackageModuleInfo(p.ImportPath) + mainPath := p.ImportPath + if p.Internal.CmdlineFiles { + mainPath = "command-line-arguments" } + p.Module = ModPackageModuleInfo(mainPath) if p.Name == "main" { - p.Internal.BuildInfo = ModPackageBuildInfo(p.ImportPath, p.Deps) + p.Internal.BuildInfo = ModPackageBuildInfo(mainPath, p.Deps) } } } @@ -1986,11 +1990,6 @@ func GoFilesPackage(gofiles []string) *Package { } bp, err := ctxt.ImportDir(dir, 0) - if ModDirImportPath != nil { - // Use the effective import path of the directory - // for deciding visibility during pkg.load. - bp.ImportPath = ModDirImportPath(dir) - } pkg := new(Package) pkg.Internal.Local = true pkg.Internal.CmdlineFiles = true diff --git a/src/cmd/go/internal/modload/build.go b/src/cmd/go/internal/modload/build.go index b4856a94199c0..efeb7a5fd5d05 100644 --- a/src/cmd/go/internal/modload/build.go +++ b/src/cmd/go/internal/modload/build.go @@ -17,6 +17,7 @@ import ( "internal/goroot" "os" "path/filepath" + "runtime/debug" "strings" ) @@ -98,11 +99,13 @@ func moduleInfo(m module.Version, fromBuildList bool) *modinfo.ModulePublic { Path: m.Path, Version: m.Version, Main: true, - Dir: ModRoot(), - GoMod: filepath.Join(ModRoot(), "go.mod"), } - if modFile.Go != nil { - info.GoVersion = modFile.Go.Version + if HasModRoot() { + info.Dir = ModRoot() + info.GoMod = filepath.Join(info.Dir, "go.mod") + if modFile.Go != nil { + info.GoVersion = modFile.Go.Version + } } return info } @@ -184,6 +187,7 @@ func PackageBuildInfo(path string, deps []string) string { if isStandardImportPath(path) || !Enabled() { return "" } + target := findModule(path, path) mdeps := make(map[module.Version]bool) for _, dep := range deps { @@ -223,19 +227,23 @@ func PackageBuildInfo(path string, deps []string) string { return buf.String() } +// findModule returns the module containing the package at path, +// needed to build the package at target. func findModule(target, path string) module.Version { - // TODO: This should use loaded. - if path == "." { - return buildList[0] + pkg, ok := loaded.pkgCache.Get(path).(*loadPkg) + if ok { + if pkg.err != nil { + base.Fatalf("build %v: cannot load %v: %v", target, path, pkg.err) + } + return pkg.mod } - if cfg.BuildMod == "vendor" { - readVendorList() - return vendorMap[path] + + if path == "command-line-arguments" { + return Target } - for _, mod := range buildList { - if maybeInModule(path, mod.Path) { - return mod - } + + if printStackInDie { + debug.PrintStack() } base.Fatalf("build %v: cannot find module for path %v", target, path) panic("unreachable") diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index 97c48be00e126..22d14ccce78b2 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -314,7 +314,7 @@ func InitMod() { Init() if modRoot == "" { - Target = module.Version{Path: "main"} + Target = module.Version{Path: "command-line-arguments"} buildList = []module.Version{Target} return } diff --git a/src/cmd/go/testdata/script/mod_enabled.txt b/src/cmd/go/testdata/script/mod_enabled.txt index 1de4719d53d83..ab5ee3d6dfa65 100644 --- a/src/cmd/go/testdata/script/mod_enabled.txt +++ b/src/cmd/go/testdata/script/mod_enabled.txt @@ -39,8 +39,8 @@ stdout z[/\\]go.mod cd $GOPATH/src/x/y go env GOMOD stdout 'NUL|/dev/null' -! go list -m -stderr 'cannot find main module' +go list -m +stdout '^command-line-arguments$' cd $GOPATH/foo go env GOMOD diff --git a/src/cmd/go/testdata/script/mod_get_svn.txt b/src/cmd/go/testdata/script/mod_get_svn.txt index ad96fa13575d9..b3436284aff02 100644 --- a/src/cmd/go/testdata/script/mod_get_svn.txt +++ b/src/cmd/go/testdata/script/mod_get_svn.txt @@ -10,8 +10,7 @@ env GOPROXY=direct # obtain llvm.org directory, not via svn. ! go get -d llvm.org/llvm/bindings/go/llvm stderr 'ReadZip not implemented for svn' ! go install . -# TODO(bcmills): The error message here should mention ReadZip. -stderr 'cannot find module for path llvm.org' +stderr 'ReadZip not implemented for svn' -- go.mod -- module golang/go/issues/28943/main diff --git a/src/cmd/go/testdata/script/mod_outside.txt b/src/cmd/go/testdata/script/mod_outside.txt index 25013b6271cfd..db994a1656703 100644 --- a/src/cmd/go/testdata/script/mod_outside.txt +++ b/src/cmd/go/testdata/script/mod_outside.txt @@ -12,8 +12,8 @@ stdout 'NUL|/dev/null' # which is not in a module. ! go list stderr 'cannot find main module' -! go list -m -stderr 'cannot find main module' +go list -m +stdout '^command-line-arguments$' # 'go list' in the working directory should fail even if there is a a 'package # main' present: without a main module, we do not know its package path. ! go list ./foo @@ -148,6 +148,10 @@ stderr 'no such package' stderr 'can only use path@version syntax with' +# 'go fmt' should be able to format files outside of a module. +go fmt foo/foo.go + + # The remainder of the test checks dependencies by linking and running binaries. [short] stop @@ -185,8 +189,8 @@ stdout 'using example.com/version v1.0.0' # 'go run' should use 'main' as the effective module and import path. go run ./foo/foo.go -stdout 'path is \.$' -stdout 'main is main \(devel\)' +stdout 'path is command-line-arguments$' +stdout 'main is command-line-arguments \(devel\)' stdout 'using example.com/version v1.1.0' # 'go generate' should work with file arguments. diff --git a/src/cmd/go/testdata/script/mod_test_files.txt b/src/cmd/go/testdata/script/mod_test_files.txt new file mode 100644 index 0000000000000..87aecb44f678e --- /dev/null +++ b/src/cmd/go/testdata/script/mod_test_files.txt @@ -0,0 +1,49 @@ +env GO111MODULE=on + +cd foo + +# Testing an explicit source file should use the same import visibility as the +# package in the same directory. +go list -test -deps +go list -test -deps foo_test.go + +# If the file is inside the main module's vendor directory, it should have +# visibility based on the vendor-relative import path. +mkdir vendor/example.com/foo +cp foo_test.go vendor/example.com/foo +go list -test -deps vendor/example.com/foo/foo_test.go + +# If the file is outside the main module entirely, it should be treated as outside. +cp foo_test.go ../foo_test.go +! go list -test -deps ../foo_test.go +stderr 'use of internal package' + +-- foo/go.mod -- +module example.com/foo +require example.com/internal v0.0.0 +replace example.com/internal => ../internal + +-- foo/internal.go -- +package foo +import _ "example.com/internal" + +-- foo/foo_test.go -- +package foo_test + +import ( + "testing" + "example.com/internal" +) + +func TestHacksEnabled(t *testing.T) { + if !internal.Hacks { + t.Fatal("hacks not enabled") + } +} + +-- internal/go.mod -- +module example.com/internal + +-- internal/internal.go -- +package internal +const Hacks = true From 12c0f1b3e6ace3972bb3d328b2bdcadb6dceb198 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 28 Nov 2018 14:19:28 -0800 Subject: [PATCH 295/594] cmd/cgo: set correct column for user-written code Take advantage of the new /*line*/ comments. Fixes #26745 Change-Id: I8098642e0f11f7418fe81b9a08dbe07671f930fe Reviewed-on: https://go-review.googlesource.com/c/151598 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- misc/cgo/errors/errors_test.go | 1 + misc/cgo/errors/src/issue26745.go | 17 ++++++++++++++ src/cmd/cgo/gcc.go | 37 +++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 misc/cgo/errors/src/issue26745.go diff --git a/misc/cgo/errors/errors_test.go b/misc/cgo/errors/errors_test.go index d2a72a46f430a..59054f4703a49 100644 --- a/misc/cgo/errors/errors_test.go +++ b/misc/cgo/errors/errors_test.go @@ -121,6 +121,7 @@ func TestReportsTypeErrors(t *testing.T) { "issue16591.go", "issue18452.go", "issue18889.go", + "issue26745.go", "issue28721.go", } { check(t, file) diff --git a/misc/cgo/errors/src/issue26745.go b/misc/cgo/errors/src/issue26745.go new file mode 100644 index 0000000000000..0e224538db629 --- /dev/null +++ b/misc/cgo/errors/src/issue26745.go @@ -0,0 +1,17 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +// int a; +// void CF(int i) {} +import "C" + +func F1(i int) int { + return C.a + 1 // ERROR HERE: :13 +} + +func F2(i int) { + C.CF(i) // ERROR HERE: :6 +} diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 321d4db040d64..1f257d7958ab7 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -891,6 +891,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) { // Write _cgoCheckPointer calls to sbCheck. var sbCheck bytes.Buffer for i, param := range params { + origArg := args[i] arg, nu := p.mangle(f, &args[i]) if nu { needsUnsafe = true @@ -910,7 +911,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) { } if !p.needsPointerCheck(f, param.Go, args[i]) { - fmt.Fprintf(&sb, "_cgo%d := %s; ", i, gofmtLine(arg)) + fmt.Fprintf(&sb, "_cgo%d := %s; ", i, gofmtPos(arg, origArg.Pos())) continue } @@ -924,7 +925,7 @@ func (p *Package) rewriteCall(f *File, call *Call) (string, bool) { continue } - fmt.Fprintf(&sb, "_cgo%d := %s; ", i, gofmtLine(arg)) + fmt.Fprintf(&sb, "_cgo%d := %s; ", i, gofmtPos(arg, origArg.Pos())) fmt.Fprintf(&sbCheck, "_cgoCheckPointer(_cgo%d); ", i) } @@ -1147,10 +1148,10 @@ func (p *Package) checkIndex(sb, sbCheck *bytes.Buffer, arg ast.Expr, i int) boo return false } - fmt.Fprintf(sb, "_cgoIndex%d := %s; ", i, gofmtLine(index.X)) + fmt.Fprintf(sb, "_cgoIndex%d := %s; ", i, gofmtPos(index.X, index.X.Pos())) origX := index.X index.X = ast.NewIdent(fmt.Sprintf("_cgoIndex%d", i)) - fmt.Fprintf(sb, "_cgo%d := %s; ", i, gofmtLine(arg)) + fmt.Fprintf(sb, "_cgo%d := %s; ", i, gofmtPos(arg, arg.Pos())) index.X = origX fmt.Fprintf(sbCheck, "_cgoCheckPointer(_cgo%d, _cgoIndex%d); ", i, i) @@ -1182,11 +1183,11 @@ func (p *Package) checkAddr(sb, sbCheck *bytes.Buffer, arg ast.Expr, i int) bool return false } - fmt.Fprintf(sb, "_cgoBase%d := %s; ", i, gofmtLine(*px)) + fmt.Fprintf(sb, "_cgoBase%d := %s; ", i, gofmtPos(*px, (*px).Pos())) origX := *px *px = ast.NewIdent(fmt.Sprintf("_cgoBase%d", i)) - fmt.Fprintf(sb, "_cgo%d := %s; ", i, gofmtLine(arg)) + fmt.Fprintf(sb, "_cgo%d := %s; ", i, gofmtPos(arg, arg.Pos())) *px = origX // Use "0 == 0" to do the right thing in the unlikely event @@ -1388,7 +1389,18 @@ func (p *Package) rewriteRef(f *File) { // Record source-level edit for cgo output. if !r.Done { - repl := gofmt(expr) + repl := gofmtPos(expr, old.Pos()) + end := fset.Position(old.End()) + // Subtract 1 from the column if we are going to + // append a close parenthesis. That will set the + // correct column for the following characters. + sub := 0 + if r.Name.Kind != "type" { + sub = 1 + } + if end.Column > sub { + repl = fmt.Sprintf("%s/*line :%d:%d*/", repl, end.Line, end.Column-sub) + } if r.Name.Kind != "type" { repl = "(" + repl + ")" } @@ -1506,6 +1518,17 @@ func (p *Package) rewriteName(f *File, r *Ref) ast.Expr { return expr } +// gofmtPos returns the gofmt-formatted string for an AST node, +// with a comment setting the position before the node. +func gofmtPos(n ast.Expr, pos token.Pos) string { + s := gofmtLine(n) + p := fset.Position(pos) + if p.Column == 0 { + return s + } + return fmt.Sprintf("/*line :%d:%d*/%s", p.Line, p.Column, s) +} + // gccBaseCmd returns the start of the compiler command line. // It uses $CC if set, or else $GCC, or else the compiler recorded // during the initial build as defaultCC. From 6764d7aeacd24f48875ce88a8e3c789cedfb2e28 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Tue, 11 Dec 2018 14:24:07 -0800 Subject: [PATCH 296/594] runtime: fix profiling on windows/ARM Fix profiling handler to get the correct g for the m being profiled. Store a pointer to the TLS slot holding g in the thread's m. This enables the profiling handler to get the current g for the thread, even if the thread is executing external code or system code. Updates #26148 Signed-off-by: Jordan Rhee Change-Id: Ie061284c12341c76c7d96cc0c2d5bac969230829 Reviewed-on: https://go-review.googlesource.com/c/153718 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/os_windows.go | 16 ++---- src/runtime/sys_windows_arm.s | 95 +++++++++++++++++++++++++++++++++++ src/runtime/tls_arm.s | 45 ++--------------- 3 files changed, 101 insertions(+), 55 deletions(-) diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 03dd95bf175d2..5870a342c2789 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -872,24 +872,14 @@ func profilem(mp *m, thread uintptr) { default: panic("unsupported architecture") case "arm": - // TODO(jordanrh1): this is incorrect when Go is executing - // on the system or signal stacks because curg returns - // the current user g. The true g is stored in thread - // local storage, which we cannot access from another CPU. - // We cannot pull R10 from the thread context because - // it might be executing C code, in which case R10 - // would not be g. - gp = mp.curg + tls := &mp.tls[0] + gp = **((***g)(unsafe.Pointer(tls))) case "386", "amd64": tls := &mp.tls[0] gp = *((**g)(unsafe.Pointer(tls))) } - if gp == nil { - sigprofNonGoPC(r.ip()) - } else { - sigprof(r.ip(), r.sp(), 0, gp, mp) - } + sigprof(r.ip(), r.sp(), 0, gp, mp) } func profileloop1(param uintptr) uint32 { diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s index 60a85b8ffb888..60be74b95cf02 100644 --- a/src/runtime/sys_windows_arm.s +++ b/src/runtime/sys_windows_arm.s @@ -362,6 +362,9 @@ TEXT runtime·tstart_stdcall(SB),NOSPLIT|NOFRAME,$0 MOVW R0, g_m(g) BL runtime·save_g(SB) + // do per-thread TLS initialization + BL runtime·init_thread_tls(SB) + // Layout new m scheduler stack on os stack. MOVW R13, R0 MOVW R0, g_stack+stack_hi(g) @@ -595,3 +598,95 @@ useQPC: B runtime·nanotimeQPC(SB) // tail call RET +// save_g saves the g register (R10) into thread local memory +// so that we can call externally compiled +// ARM code that will overwrite those registers. +// NOTE: runtime.gogo assumes that R1 is preserved by this function. +// runtime.mcall assumes this function only clobbers R0 and R11. +// Returns with g in R0. +// Save the value in the _TEB->TlsSlots array. +// Effectively implements TlsSetValue(). +// tls_g stores the TLS slot allocated TlsAlloc(). +TEXT runtime·save_g(SB),NOSPLIT|NOFRAME,$0 + MRC 15, 0, R0, C13, C0, 2 + ADD $0xe10, R0 + MOVW $runtime·tls_g(SB), R11 + MOVW (R11), R11 + MOVW g, R11<<2(R0) + MOVW g, R0 // preserve R0 across call to setg<> + RET + +// load_g loads the g register from thread-local memory, +// for use after calling externally compiled +// ARM code that overwrote those registers. +// Get the value from the _TEB->TlsSlots array. +// Effectively implements TlsGetValue(). +TEXT runtime·load_g(SB),NOSPLIT|NOFRAME,$0 + MRC 15, 0, R0, C13, C0, 2 + ADD $0xe10, R0 + MOVW $runtime·tls_g(SB), g + MOVW (g), g + MOVW g<<2(R0), g + RET + +// This is called from rt0_go, which runs on the system stack +// using the initial stack allocated by the OS. +// It calls back into standard C using the BL below. +// To do that, the stack pointer must be 8-byte-aligned. +TEXT runtime·_initcgo(SB),NOSPLIT|NOFRAME,$0 + MOVM.DB.W [R4, R14], (R13) // push {r4, lr} + + // Ensure stack is 8-byte aligned before calling C code + MOVW R13, R4 + BIC $0x7, R13 + + // Allocate a TLS slot to hold g across calls to external code + MOVW $runtime·_TlsAlloc(SB), R0 + MOVW (R0), R0 + BL (R0) + + // Assert that slot is less than 64 so we can use _TEB->TlsSlots + CMP $64, R0 + MOVW $runtime·abort(SB), R1 + BL.GE (R1) + + // Save Slot into tls_g + MOVW $runtime·tls_g(SB), R1 + MOVW R0, (R1) + + BL runtime·init_thread_tls(SB) + + MOVW R4, R13 + MOVM.IA.W (R13), [R4, R15] // pop {r4, pc} + +// void init_thread_tls() +// +// Does per-thread TLS initialization. Saves a pointer to the TLS slot +// holding G, in the current m. +// +// g->m->tls[0] = &_TEB->TlsSlots[tls_g] +// +// The purpose of this is to enable the profiling handler to get the +// current g associated with the thread. We cannot use m->curg because curg +// only holds the current user g. If the thread is executing system code or +// external code, m->curg will be NULL. The thread's TLS slot always holds +// the current g, so save a reference to this location so the profiling +// handler can get the real g from the thread's m. +// +// Clobbers R0-R3 +TEXT runtime·init_thread_tls(SB),NOSPLIT|NOFRAME,$0 + // compute &_TEB->TlsSlots[tls_g] + MRC 15, 0, R0, C13, C0, 2 + ADD $0xe10, R0 + MOVW $runtime·tls_g(SB), R1 + MOVW (R1), R1 + MOVW R1<<2, R1 + ADD R1, R0 + + // save in g->m->tls[0] + MOVW g_m(g), R1 + MOVW R0, m_tls(R1) + RET + +// Holds the TLS Slot, which was allocated by TlsAlloc() +GLOBL runtime·tls_g+0(SB), NOPTR, $4 diff --git a/src/runtime/tls_arm.s b/src/runtime/tls_arm.s index e2c945d183a24..400c16a177582 100644 --- a/src/runtime/tls_arm.s +++ b/src/runtime/tls_arm.s @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !windows + #include "go_asm.h" #include "go_tls.h" #include "funcdata.h" @@ -23,9 +25,6 @@ #ifdef GOOS_darwin #define TLSG_IS_VARIABLE #endif -#ifdef GOOS_windows -#define TLSG_IS_VARIABLE -#endif // save_g saves the g register into pthread-provided // thread-local memory, so that we can call externally compiled @@ -38,17 +37,6 @@ TEXT runtime·save_g(SB),NOSPLIT|NOFRAME,$0 // nothing to do as nacl/arm does not use TLS at all. MOVW g, R0 // preserve R0 across call to setg<> RET -#else -#ifdef GOOS_windows - // Save the value in the _TEB->TlsSlots array. - // Effectively implements TlsSetValue(). - MRC 15, 0, R0, C13, C0, 2 - ADD $0xe10, R0 - MOVW $runtime·tls_g(SB), R11 - MOVW (R11), R11 - MOVW g, R11<<2(R0) - MOVW g, R0 // preserve R0 accross call to setg<> - RET #else // If the host does not support MRC the linker will replace it with // a call to runtime.read_tls_fallback which jumps to __kuser_get_tls. @@ -61,7 +49,6 @@ TEXT runtime·save_g(SB),NOSPLIT|NOFRAME,$0 MOVW g, R0 // preserve R0 across call to setg<> RET #endif -#endif // load_g loads the g register from pthread-provided // thread-local memory, for use after calling externally compiled @@ -70,16 +57,6 @@ TEXT runtime·load_g(SB),NOSPLIT,$0 #ifdef GOOS_nacl // nothing to do as nacl/arm does not use TLS at all. RET -#else -#ifdef GOOS_windows - // Get the value from the _TEB->TlsSlots array. - // Effectively implements TlsGetValue(). - MRC 15, 0, R0, C13, C0, 2 - ADD $0xe10, R0 - MOVW $runtime·tls_g(SB), g - MOVW (g), g - MOVW g<<2(R0), g - RET #else // See save_g MRC 15, 0, R0, C13, C0, 3 // fetch TLS base pointer @@ -89,7 +66,6 @@ TEXT runtime·load_g(SB),NOSPLIT,$0 MOVW 0(R0), g RET #endif -#endif // This is called from rt0_go, which runs on the system stack // using the initial stack allocated by the OS. @@ -102,20 +78,6 @@ TEXT runtime·load_g(SB),NOSPLIT,$0 // Declare a dummy word ($4, not $0) to make sure the // frame is 8 bytes and stays 8-byte-aligned. TEXT runtime·_initcgo(SB),NOSPLIT,$4 -#ifdef GOOS_windows - MOVW R13, R4 - BIC $0x7, R13 - MOVW $runtime·_TlsAlloc(SB), R0 - MOVW (R0), R0 - BL (R0) - // Assert that slot is less than 64 so we can use _TEB->TlsSlots - CMP $64, R0 - MOVW $runtime·abort(SB), R1 - BL.GE (R1) - MOVW $runtime·tls_g(SB), R1 - MOVW R0, (R1) - MOVW R4, R13 -#else #ifndef GOOS_nacl // if there is an _cgo_init, call it. MOVW _cgo_init(SB), R4 @@ -131,8 +93,7 @@ TEXT runtime·_initcgo(SB),NOSPLIT,$4 MOVW $setg_gcc<>(SB), R1 // arg 1: setg MOVW g, R0 // arg 0: G BL (R4) // will clobber R0-R3 -#endif // GOOS_nacl -#endif // GOOS_windows +#endif nocgo: RET From da6294a35abfb62825da3e27b8ba998e71a4d81d Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Tue, 11 Dec 2018 14:57:59 -0800 Subject: [PATCH 297/594] runtime/pprof: fix TestCPUProfileWithFork on Windows/ARM Use smaller heap on Windows/ARM, which generally does not have page file enabled and therefore has limited virtual address space. Updates #26148 Signed-off-by: Jordan Rhee Change-Id: I4030be24a10fab7b9b659e3736b7e83f10710bfa Reviewed-on: https://go-review.googlesource.com/c/153719 Run-TryBot: Hyang-Ah Hana Kim Reviewed-by: Ian Lance Taylor --- src/runtime/pprof/pprof_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index a1089c8fdf90d..6d82b69a9d549 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -321,6 +321,10 @@ func TestCPUProfileWithFork(t *testing.T) { // Use smaller size for Android to avoid crash. heap = 100 << 20 } + if runtime.GOOS == "windows" && runtime.GOARCH == "arm" { + // Use smaller heap for Windows/ARM to avoid crash. + heap = 100 << 20 + } if testing.Short() { heap = 100 << 20 } From ba1de79a3a542b5bf25c4cc3be1c91d1ede47c55 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 11 Dec 2018 16:55:16 -0800 Subject: [PATCH 298/594] os: in RemoveAll, try Remove first Otherwise we can fail to remove a unreadable empty directory. Fixes #29178 Change-Id: I43d5c89fce57a86626abe2a1c2bbf145716e087b Reviewed-on: https://go-review.googlesource.com/c/153720 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/os/removeall_at.go | 6 ++++++ src/os/removeall_test.go | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index c42319a831282..f0fed6dc33f4c 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -25,6 +25,12 @@ func RemoveAll(path string) error { return &PathError{"RemoveAll", path, syscall.EINVAL} } + // Simple case: if Remove works, we're done. + err := Remove(path) + if err == nil || IsNotExist(err) { + return nil + } + // RemoveAll recurses by deleting the path base from // its parent directory parentDir, base := splitPath(path) diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go index 1c9f16322547a..0f7dce078a6b0 100644 --- a/src/os/removeall_test.go +++ b/src/os/removeall_test.go @@ -264,3 +264,31 @@ func TestRemoveAllDotDot(t *testing.T) { } } } + +// Issue #29178. +func TestRemoveReadOnlyDir(t *testing.T) { + t.Parallel() + + tempDir, err := ioutil.TempDir("", "TestRemoveReadOnlyDir-") + if err != nil { + t.Fatal(err) + } + defer RemoveAll(tempDir) + + subdir := filepath.Join(tempDir, "x") + if err := Mkdir(subdir, 0); err != nil { + t.Fatal(err) + } + + // If an error occurs make it more likely that removing the + // temporary directory will succeed. + defer Chmod(subdir, 0777) + + if err := RemoveAll(subdir); err != nil { + t.Fatal(err) + } + + if _, err := Stat(subdir); err == nil { + t.Error("subdirectory was not removed") + } +} From 2de2dc26b08f2781981fe3c3a1e6c7004e1caca0 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Wed, 12 Dec 2018 03:36:39 +1100 Subject: [PATCH 299/594] syscall: regenerate ztypes for openbsd/arm Regenerate ztypes for openbsd/arm - most of the changes relate to the OpenBSD armv7 port switching to EABI in September 2016. Also use signed char when generating openbsd/arm ztypes, to avoid inconsistencies between architectures impacting MI code. Change-Id: I9d2e19c1ac045922e270896861c830f94fc59c10 Reviewed-on: https://go-review.googlesource.com/c/153578 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/syscall/mkall.sh | 4 ++- src/syscall/ztypes_openbsd_arm.go | 54 +++++++++++++++++-------------- 2 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/syscall/mkall.sh b/src/syscall/mkall.sh index 19c4d591e60e7..61f45f57905b6 100755 --- a/src/syscall/mkall.sh +++ b/src/syscall/mkall.sh @@ -310,7 +310,9 @@ openbsd_arm) mksysctl="./mksysctl_openbsd.pl" zsysctl="zsysctl_openbsd.go" mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" + # Let the type of C char be signed to make the bare syscall + # API consistent between platforms. + mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; plan9_386) mkerrors= diff --git a/src/syscall/ztypes_openbsd_arm.go b/src/syscall/ztypes_openbsd_arm.go index e75043f2c67ce..acadf4b48ca1e 100644 --- a/src/syscall/ztypes_openbsd_arm.go +++ b/src/syscall/ztypes_openbsd_arm.go @@ -1,7 +1,5 @@ -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_openbsd.go - -// +build arm,openbsd +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs -- -fsigned-char types_openbsd.go package syscall @@ -21,13 +19,15 @@ type ( ) type Timespec struct { - Sec int64 - Nsec int32 + Sec int64 + Nsec int32 + Pad_cgo_0 [4]byte } type Timeval struct { - Sec int64 - Usec int32 + Sec int64 + Usec int32 + Pad_cgo_0 [4]byte } type Rusage struct { @@ -91,6 +91,7 @@ type Stat_t struct { Blksize int32 Flags uint32 Gen uint32 + Pad_cgo_0 [4]byte X__st_birthtim Timespec } @@ -98,6 +99,7 @@ type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 + Pad_cgo_0 [4]byte F_blocks uint64 F_bfree uint64 F_bavail int64 @@ -112,11 +114,11 @@ type Statfs_t struct { F_namemax uint32 F_owner uint32 F_ctime uint64 - F_fstypename [16]uint8 - F_mntonname [90]uint8 - F_mntfromname [90]uint8 - F_mntfromspec [90]uint8 - Pad_cgo_0 [2]byte + F_fstypename [16]int8 + F_mntonname [90]int8 + F_mntfromname [90]int8 + F_mntfromspec [90]int8 + Pad_cgo_1 [2]byte Mount_info [160]byte } @@ -135,7 +137,7 @@ type Dirent struct { Type uint8 Namlen uint8 X__d_padding [4]uint8 - Name [256]uint8 + Name [256]int8 } type Fsid struct { @@ -266,12 +268,14 @@ const ( ) type Kevent_t struct { - Ident uint32 - Filter int16 - Flags uint16 - Fflags uint32 - Data int64 - Udata *byte + Ident uint32 + Filter int16 + Flags uint16 + Fflags uint32 + Pad_cgo_0 [4]byte + Data int64 + Udata *byte + Pad_cgo_1 [4]byte } type FdSet struct { @@ -279,8 +283,8 @@ type FdSet struct { } const ( - SizeofIfMsghdr = 0x98 - SizeofIfData = 0x80 + SizeofIfMsghdr = 0xa8 + SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 @@ -309,7 +313,7 @@ type IfData struct { Link_state uint8 Mtu uint32 Metric uint32 - Pad uint32 + Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 @@ -321,8 +325,10 @@ type IfData struct { Imcasts uint64 Omcasts uint64 Iqdrops uint64 + Oqdrops uint64 Noproto uint64 Capabilities uint32 + Pad_cgo_0 [4]byte Lastchange Timeval } @@ -347,7 +353,7 @@ type IfAnnounceMsghdr struct { Hdrlen uint16 Index uint16 What uint16 - Name [16]uint8 + Name [16]int8 } type RtMsghdr struct { From ef780fbf1023e7a7569cb822bcafcc2252c6e25f Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Wed, 12 Dec 2018 03:43:48 +1100 Subject: [PATCH 300/594] runtime/pprof: ignore cpu profile test failures on openbsd/arm This test is currently too flakey on openbsd/arm - ignore failures for the time being. Change-Id: Ia334d188f505167e691177ebe2c7a2df54bf556a Reviewed-on: https://go-review.googlesource.com/c/153579 Reviewed-by: Brad Fitzpatrick Run-TryBot: Ian Lance Taylor --- src/runtime/pprof/pprof_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index 6d82b69a9d549..e395d153102c2 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -193,6 +193,10 @@ func testCPUProfile(t *testing.T, matches matchFunc, need []string, avoid []stri switch runtime.GOOS { case "darwin", "dragonfly", "netbsd", "solaris": t.Skipf("ignoring failure on %s; see golang.org/issue/13841", runtime.GOOS) + case "openbsd": + if runtime.GOARCH == "arm" { + t.Skipf("ignoring failure on %s/%s; see golang.org/issue/13841", runtime.GOOS, runtime.GOARCH) + } } // Ignore the failure if the tests are running in a QEMU-based emulator, // QEMU is not perfect at emulating everything. From 41d0dc49d2e6bfb96bd87c7a1ded9ed20b602281 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 11 Dec 2018 17:23:14 -0800 Subject: [PATCH 301/594] go/format: add simple benchmark framework and basic benchmark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For now, this CL adds as a first benchmark the formatting of a 10,000 element array literal. It is easy to add additional test cases as we see fit. name time/op Format/array1-10000-4 26.7ms ± 7% name speed Format/array1-10000-4 2.43MB/s ± 6% name alloc/op Format/array1-10000-4 5.52MB ± 0% name allocs/op Format/array1-10000-4 119k ± 0% Updates #26528. Change-Id: Ic8ec8f70160d122b877740412d4d4406f5f4b345 Reviewed-on: https://go-review.googlesource.com/c/153642 Reviewed-by: Ian Lance Taylor --- src/go/format/benchmark_test.go | 91 +++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/go/format/benchmark_test.go diff --git a/src/go/format/benchmark_test.go b/src/go/format/benchmark_test.go new file mode 100644 index 0000000000000..7bd45c0e95b24 --- /dev/null +++ b/src/go/format/benchmark_test.go @@ -0,0 +1,91 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This file provides a simple framework to add benchmarks +// based on generated input (source) files. + +package format_test + +import ( + "bytes" + "flag" + "fmt" + "go/format" + "io/ioutil" + "testing" +) + +var debug = flag.Bool("debug", false, "write .src files containing formatting input; for debugging") + +// array1 generates an array literal with n elements of the form: +// +// var _ = [...]byte{ +// // 0 +// 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, +// 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, +// 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, +// 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, +// 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, +// // 40 +// 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, +// 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, +// ... +// +func array1(buf *bytes.Buffer, n int) { + buf.WriteString("var _ = [...]byte{\n") + for i := 0; i < n; { + if i%10 == 0 { + fmt.Fprintf(buf, "\t// %d\n", i) + } + buf.WriteByte('\t') + for j := 0; j < 8; j++ { + fmt.Fprintf(buf, "0x%02x, ", byte(i)) + i++ + } + buf.WriteString("\n") + } + buf.WriteString("}\n") +} + +var tests = []struct { + name string + gen func(*bytes.Buffer, int) + n int +}{ + {"array1", array1, 10000}, + // add new test cases here as needed +} + +func BenchmarkFormat(b *testing.B) { + var src bytes.Buffer + for _, t := range tests { + src.Reset() + src.WriteString("package p\n") + t.gen(&src, t.n) + data := src.Bytes() + + if *debug { + filename := t.name + ".src" + err := ioutil.WriteFile(filename, data, 0660) + if err != nil { + b.Fatalf("couldn't write %s: %v", filename, err) + } + } + + b.Run(fmt.Sprintf("%s-%d", t.name, t.n), func(b *testing.B) { + b.SetBytes(int64(len(data))) + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + var err error + sink, err = format.Source(data) + if err != nil { + b.Fatal(err) + } + } + }) + } +} + +var sink []byte From 321a3d6e85e6440b5c753b3fd6a0e028dcc08143 Mon Sep 17 00:00:00 2001 From: David Chase Date: Thu, 15 Nov 2018 14:11:19 -0500 Subject: [PATCH 302/594] cmd/compile: Avoid and filter out zero-length location-lists. This change avoids creating zero length location lists by repairing an overly aggressive change in CL146718 and by explicitly checking for and filtering out any zero-length lists that are detected (building compiler+runtime creates a single one). Updates #28486. Change-Id: I01c571fee2376474c7f3038e801bd58fd9e0b820 Reviewed-on: https://go-review.googlesource.com/c/150097 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Heschi Kreinick --- src/cmd/compile/internal/ssa/debug.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/cmd/compile/internal/ssa/debug.go b/src/cmd/compile/internal/ssa/debug.go index 7407a75c41c33..c2736d837c931 100644 --- a/src/cmd/compile/internal/ssa/debug.go +++ b/src/cmd/compile/internal/ssa/debug.go @@ -881,12 +881,11 @@ func (state *debugState) buildLocationLists(blockLocs []*BlockDebug) { for _, b := range state.f.Blocks { state.mergePredecessors(b, blockLocs, prevBlock) - // Handle any differences among predecessor blocks and previous block (perhaps not a predecessor) - for _, varID := range state.changedVars.contents() { - state.updateVar(VarID(varID), b, BlockStart) - } - if !blockLocs[b.ID].relevant { + // Handle any differences among predecessor blocks and previous block (perhaps not a predecessor) + for _, varID := range state.changedVars.contents() { + state.updateVar(VarID(varID), b, BlockStart) + } continue } @@ -1019,6 +1018,14 @@ func (state *debugState) writePendingEntry(varID VarID, endBlock, endValue ID) { // they get incomplete debug info on 32-bit platforms. return } + if start == end { + if state.loggingEnabled { + // Printf not logf so not gated by GOSSAFUNC; this should fire very rarely. + fmt.Printf("Skipping empty location list for %v in %s\n", state.vars[varID], state.f.Name) + } + return + } + list := state.lists[varID] list = appendPtr(state.ctxt, list, start) list = appendPtr(state.ctxt, list, end) From d70b0ece2f208ff99efce87c07f5171617c29a13 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch Date: Tue, 11 Dec 2018 05:32:50 +0000 Subject: [PATCH 303/594] encoding/xml, encoding/json: docs and examples using custom marshalers Both the encoding/xml and encoding/json packages support custom marshalers for JSON and XML, as well as the basic encoding.TextMarshaler and encoding.TextUnmarshaler interfaces, but the docs and examples for these are missing. There are docs for how to use encoding.TextMarshaler and encoding.TextUnmarshaler in encoding/json, but not encoding/xml. There are no examples for how to use them with either json or xml. This commit includes docs for encoding/xml and examples for both encoding/json and encoding/xml. There is an example using custom marshalers MarshalJSON and UnmarshalJSON in encoding/json, but not MarshalXML and UnmarshalXML in encoding/json. These docs are more so necessary for encoding/xml because the complexities of XML documents is significantly greater than JSON documents which more often leads to the need for custom marshaling. The encoding/json package includes an example of how to write a custom marshaler, and this commit includes the same example for the xml package. All examples are mirrored off the existing custom marshaler example in encoding/json. Fixes #6859 Change-Id: Ic93abc27c0b4d5e48dea6ede4e20b1bedca4ab39 Reviewed-on: https://go-review.googlesource.com/c/76350 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- .../json/example_text_marshaling_test.go | 67 +++++++++++++++ src/encoding/xml/example_marshaling_test.go | 84 +++++++++++++++++++ .../xml/example_text_marshaling_test.go | 79 +++++++++++++++++ src/encoding/xml/marshal.go | 4 + src/encoding/xml/read.go | 5 ++ 5 files changed, 239 insertions(+) create mode 100644 src/encoding/json/example_text_marshaling_test.go create mode 100644 src/encoding/xml/example_marshaling_test.go create mode 100644 src/encoding/xml/example_text_marshaling_test.go diff --git a/src/encoding/json/example_text_marshaling_test.go b/src/encoding/json/example_text_marshaling_test.go new file mode 100644 index 0000000000000..04c7813b26783 --- /dev/null +++ b/src/encoding/json/example_text_marshaling_test.go @@ -0,0 +1,67 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package json_test + +import ( + "encoding/json" + "fmt" + "log" + "strings" +) + +type Size int + +const ( + Unrecognized Size = iota + Small + Large +) + +func (s *Size) UnmarshalText(text []byte) error { + switch strings.ToLower(string(text)) { + default: + *s = Unrecognized + case "small": + *s = Small + case "large": + *s = Large + } + return nil +} + +func (s Size) MarshalText() ([]byte, error) { + var name string + switch s { + default: + name = "unrecognized" + case Small: + name = "small" + case Large: + name = "large" + } + return []byte(name), nil +} + +func Example_textMarshalJSON() { + blob := `["small","regular","large","unrecognized","small","normal","small","large"]` + var inventory []Size + if err := json.Unmarshal([]byte(blob), &inventory); err != nil { + log.Fatal(err) + } + + counts := make(map[Size]int) + for _, size := range inventory { + counts[size] += 1 + } + + fmt.Printf("Inventory Counts:\n* Small: %d\n* Large: %d\n* Unrecognized: %d\n", + counts[Small], counts[Large], counts[Unrecognized]) + + // Output: + // Inventory Counts: + // * Small: 3 + // * Large: 2 + // * Unrecognized: 3 +} diff --git a/src/encoding/xml/example_marshaling_test.go b/src/encoding/xml/example_marshaling_test.go new file mode 100644 index 0000000000000..9f9e801e74eca --- /dev/null +++ b/src/encoding/xml/example_marshaling_test.go @@ -0,0 +1,84 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml_test + +import ( + "encoding/xml" + "fmt" + "log" + "strings" +) + +type Animal int + +const ( + Unknown Animal = iota + Gopher + Zebra +) + +func (a *Animal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + var s string + if err := d.DecodeElement(&s, &start); err != nil { + return err + } + switch strings.ToLower(s) { + default: + *a = Unknown + case "gopher": + *a = Gopher + case "zebra": + *a = Zebra + } + + return nil +} + +func (a Animal) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + var s string + switch a { + default: + s = "unknown" + case Gopher: + s = "gopher" + case Zebra: + s = "zebra" + } + return e.EncodeElement(s, start) +} + +func Example_customMarshalXML() { + blob := ` + + gopher + armadillo + zebra + unknown + gopher + bee + gopher + zebra + ` + var zoo struct { + Animals []Animal `xml:"animal"` + } + if err := xml.Unmarshal([]byte(blob), &zoo); err != nil { + log.Fatal(err) + } + + census := make(map[Animal]int) + for _, animal := range zoo.Animals { + census[animal] += 1 + } + + fmt.Printf("Zoo Census:\n* Gophers: %d\n* Zebras: %d\n* Unknown: %d\n", + census[Gopher], census[Zebra], census[Unknown]) + + // Output: + // Zoo Census: + // * Gophers: 3 + // * Zebras: 2 + // * Unknown: 3 +} diff --git a/src/encoding/xml/example_text_marshaling_test.go b/src/encoding/xml/example_text_marshaling_test.go new file mode 100644 index 0000000000000..2549cb16ae54f --- /dev/null +++ b/src/encoding/xml/example_text_marshaling_test.go @@ -0,0 +1,79 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package xml_test + +import ( + "encoding/xml" + "fmt" + "log" + "strings" +) + +type Size int + +const ( + Unrecognized Size = iota + Small + Large +) + +func (s *Size) UnmarshalText(text []byte) error { + switch strings.ToLower(string(text)) { + default: + *s = Unrecognized + case "small": + *s = Small + case "large": + *s = Large + } + return nil +} + +func (s Size) MarshalText() ([]byte, error) { + var name string + switch s { + default: + name = "unrecognized" + case Small: + name = "small" + case Large: + name = "large" + } + return []byte(name), nil +} + +func Example_textMarshalXML() { + blob := ` + + small + regular + large + unrecognized + small + normal + small + large + ` + var inventory struct { + Sizes []Size `xml:"size"` + } + if err := xml.Unmarshal([]byte(blob), &inventory); err != nil { + log.Fatal(err) + } + + counts := make(map[Size]int) + for _, size := range inventory.Sizes { + counts[size] += 1 + } + + fmt.Printf("Inventory Counts:\n* Small: %d\n* Large: %d\n* Unrecognized: %d\n", + counts[Small], counts[Large], counts[Unrecognized]) + + // Output: + // Inventory Counts: + // * Small: 3 + // * Large: 2 + // * Unrecognized: 3 +} diff --git a/src/encoding/xml/marshal.go b/src/encoding/xml/marshal.go index d393d0610bf60..add5ece78211f 100644 --- a/src/encoding/xml/marshal.go +++ b/src/encoding/xml/marshal.go @@ -61,6 +61,10 @@ const ( // string of length zero. // - an anonymous struct field is handled as if the fields of its // value were part of the outer struct. +// - a field implementing Marshaler is written by calling its MarshalXML +// method. +// - a field implementing encoding.TextMarshaler is written by encoding the +// result of its MarshalText method as text. // // If a field uses a tag "a>b>c", then the element c will be nested inside // parent elements a and b. Fields that appear next to each other that name diff --git a/src/encoding/xml/read.go b/src/encoding/xml/read.go index 36c7ba6311108..12102bc804e4e 100644 --- a/src/encoding/xml/read.go +++ b/src/encoding/xml/read.go @@ -92,6 +92,11 @@ import ( // // * A struct field with tag "-" is never unmarshaled into. // +// If Unmarshal encounters a field type that implements the Unmarshaler +// interface, Unmarshal calls its UnmarshalXML method to produce the value from +// the XML element. Otherwise, if the value implements +// encoding.TextUnmarshaler, Unmarshal calls that value's UnmarshalText method. +// // Unmarshal maps an XML element to a string or []byte by saving the // concatenation of that element's character data in the string or // []byte. The saved []byte is never nil. From 9a11b7363589a20b8ba78a1fc02027198811b109 Mon Sep 17 00:00:00 2001 From: Julie Qiu Date: Tue, 20 Nov 2018 17:42:59 -0500 Subject: [PATCH 304/594] cmd/go: link to the FAQ for errors that indicate private VCS repos. Updates #25982 Change-Id: I5a284e3844e944f9bfae31fa65b242060d4139c7 Reviewed-on: https://go-review.googlesource.com/c/150777 Run-TryBot: Julie Qiu Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/modfetch/codehost/codehost.go | 10 +++++++--- src/cmd/go/internal/modfetch/codehost/git.go | 5 +++++ src/cmd/go/testdata/script/mod_get_private_vcs.txt | 10 ++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 src/cmd/go/testdata/script/mod_get_private_vcs.txt diff --git a/src/cmd/go/internal/modfetch/codehost/codehost.go b/src/cmd/go/internal/modfetch/codehost/codehost.go index 988504f4c87c5..6c17f7886f19e 100644 --- a/src/cmd/go/internal/modfetch/codehost/codehost.go +++ b/src/cmd/go/internal/modfetch/codehost/codehost.go @@ -196,9 +196,10 @@ func WorkDir(typ, name string) (dir, lockfile string, err error) { } type RunError struct { - Cmd string - Err error - Stderr []byte + Cmd string + Err error + Stderr []byte + HelpText string } func (e *RunError) Error() string { @@ -207,6 +208,9 @@ func (e *RunError) Error() string { if len(stderr) > 0 { text += ":\n\t" + strings.ReplaceAll(string(stderr), "\n", "\n\t") } + if len(e.HelpText) > 0 { + text += "\n" + e.HelpText + } return text } diff --git a/src/cmd/go/internal/modfetch/codehost/git.go b/src/cmd/go/internal/modfetch/codehost/git.go index 7b3775779badf..588e7496cc503 100644 --- a/src/cmd/go/internal/modfetch/codehost/git.go +++ b/src/cmd/go/internal/modfetch/codehost/git.go @@ -164,6 +164,11 @@ func (r *gitRepo) loadRefs() { // Most of the time we only care about tags but sometimes we care about heads too. out, err := Run(r.dir, "git", "ls-remote", "-q", r.remote) if err != nil { + if rerr, ok := err.(*RunError); ok { + if bytes.Contains(rerr.Stderr, []byte("fatal: could not read Username")) { + rerr.HelpText = "If this is a private repository, see https://golang.org/doc/faq#git_https for additional information." + } + } r.refsErr = err return } diff --git a/src/cmd/go/testdata/script/mod_get_private_vcs.txt b/src/cmd/go/testdata/script/mod_get_private_vcs.txt new file mode 100644 index 0000000000000..86d78e8381396 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_get_private_vcs.txt @@ -0,0 +1,10 @@ +env GO111MODULE=on + +# Testing stderr for git ls-remote; turn off proxy. +[!net] skip +[!exec:git] skip +env GOPROXY= + +! go get github.com/golang/nonexist +stderr 'If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.' +! stdout . From d1882c986673b5bd5fb6775548990d4e11917c1e Mon Sep 17 00:00:00 2001 From: Julie Qiu Date: Thu, 6 Dec 2018 11:02:49 -0500 Subject: [PATCH 305/594] doc/go1.12: release notes for testing Change-Id: I81ffe7ee88354efeabb24f091db66c7c4892876c Reviewed-on: https://go-review.googlesource.com/c/152919 Reviewed-by: Andrew Bonventre --- doc/go1.12.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 0e381eb679c1c..f036180f5322b 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -620,12 +620,8 @@

    Minor changes to the library

    testing
    -

    - TODO: https://golang.org/cl/121936: exit with error if testing.Short is called before flag.Parse -

    -

    - TODO: https://golang.org/cl/139258: implement -benchtime=100x + The -benchtime flag now supports setting an explicit iteration count instead of a time when the value ends with an "x". For example, -benchtime=100x runs the benchmark 100 times.

    From 05bbec7357a22e2ddd238c2f8741f0f4c779eb80 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 11 Dec 2018 16:12:57 -0800 Subject: [PATCH 306/594] cmd/compile: don't combine load+op if the op has SymAddr arguments By combining the load+op, we may force the op to happen earlier in the store chain. That might force the SymAddr operation earlier, and in particular earlier than its corresponding VarDef. That leads to an invalid schedule, so avoid that. This is kind of a hack to work around the issue presented. I think the underlying problem, that LEAQ is not directly ordered with respect to its vardef, is the real problem. The benefit of this CL is that it fixes the immediate issue, is small, and obviously won't break anything. A real fix for this issue is much more invasive. The go binary is unchanged in size. This situation just doesn't occur very often. Fixes #28445 Change-Id: I13a765e13f075d5b6808a355ef3c43cdd7cd47b6 Reviewed-on: https://go-review.googlesource.com/c/153641 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/gc/plive.go | 2 ++ src/cmd/compile/internal/ssa/rewrite.go | 14 ++++++++++++++ test/fixedbugs/issue28445.go | 16 ++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 test/fixedbugs/issue28445.go diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index 61a749ba0dcda..b48a9ea87e799 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -306,6 +306,8 @@ func (lv *Liveness) valueEffects(v *ssa.Value) (int32, liveEffect) { // // Addr is a read also, as any subseqent holder of the pointer must be able // to see all the values (including initialization) written so far. + // This also prevents a variable from "coming back from the dead" and presenting + // stale pointers to the garbage collector. See issue 28445. if e&(ssa.SymRead|ssa.SymAddr) != 0 { effect |= uevar } diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index 6ea46e7327fdb..1fd335b3e7f0c 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -264,6 +264,20 @@ func canMergeLoad(target, load *Value) bool { // to be very rare. return false } + if v.Op.SymEffect()&SymAddr != 0 { + // This case prevents an operation that calculates the + // address of a local variable from being forced to schedule + // before its corresponding VarDef. + // See issue 28445. + // v1 = LOAD ... + // v2 = VARDEF + // v3 = LEAQ + // v4 = CMPQ v1 v3 + // We don't want to combine the CMPQ with the load, because + // that would force the CMPQ to schedule before the VARDEF, which + // in turn requires the LEAQ to schedule before the VARDEF. + return false + } if v.Type.IsMemory() { if memPreds == nil { // Initialise a map containing memory states diff --git a/test/fixedbugs/issue28445.go b/test/fixedbugs/issue28445.go new file mode 100644 index 0000000000000..572614051e141 --- /dev/null +++ b/test/fixedbugs/issue28445.go @@ -0,0 +1,16 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +var fp = (**float64)(nil) + +func f() { + switch fp { + case new(*float64): + println() + } +} From cc8ae42a12cbbd7c7de0c1195d413fed5d9c4bbc Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 11 Dec 2018 21:03:11 -0500 Subject: [PATCH 307/594] cmd/go: retain sums for replacement modules in 'go mod tidy' Fixes #27868 Change-Id: I6c2d221c4325a2f44625e797a82735d812ee0ec1 Reviewed-on: https://go-review.googlesource.com/c/153817 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- src/cmd/go/internal/modcmd/tidy.go | 12 +++++++- .../go/testdata/script/mod_sum_replaced.txt | 28 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/cmd/go/testdata/script/mod_sum_replaced.txt diff --git a/src/cmd/go/internal/modcmd/tidy.go b/src/cmd/go/internal/modcmd/tidy.go index f2063a9ea601c..839c92a0a02b4 100644 --- a/src/cmd/go/internal/modcmd/tidy.go +++ b/src/cmd/go/internal/modcmd/tidy.go @@ -77,7 +77,17 @@ func modTidyGoSum() { keep := make(map[module.Version]bool) var walk func(module.Version) walk = func(m module.Version) { - keep[m] = true + // If we build using a replacement module, keep the sum for the replacement, + // since that's the code we'll actually use during a build. + // + // TODO(golang.org/issue/29182): Perhaps we should keep both sums, and the + // sums for both sets of transitive requirements. + r := modload.Replacement(m) + if r.Path == "" { + keep[m] = true + } else { + keep[r] = true + } list, _ := reqs.Required(m) for _, r := range list { if !keep[r] { diff --git a/src/cmd/go/testdata/script/mod_sum_replaced.txt b/src/cmd/go/testdata/script/mod_sum_replaced.txt new file mode 100644 index 0000000000000..b03982d9cff44 --- /dev/null +++ b/src/cmd/go/testdata/script/mod_sum_replaced.txt @@ -0,0 +1,28 @@ +env GO111MODULE=on + +# After 'go get -d', the go.sum file should contain the sum for the module. +go get -d rsc.io/quote@v1.5.0 +grep 'rsc.io/quote v1.5.0' go.sum + +# If we replace the module and run 'go mod tidy', we should get a sum for the replacement. +go mod edit -replace rsc.io/quote@v1.5.0=rsc.io/quote@v1.5.1 +go mod tidy +grep 'rsc.io/quote v1.5.1' go.sum +cp go.sum go.sum.tidy + +# 'go mod vendor' should preserve that sum, and should not need to add any new entries. +go mod vendor +grep 'rsc.io/quote v1.5.1' go.sum +cmp go.sum go.sum.tidy + +-- go.mod -- +module golang.org/issue/27868 + +require rsc.io/quote v1.5.0 + +-- main.go -- +package main + +import _ "rsc.io/quote" + +func main() {} From c4a8a684dacbe07f5524eae07d5e9f048034bcb6 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 11 Dec 2018 22:14:37 -0500 Subject: [PATCH 308/594] cmd/go: reproduce #28680 This change encodes the current behavior in mod_clean_cache.txt. A fix for that behavior will probably have to wait for 1.13. Updates #28680 Change-Id: I216b5a783971309cc75187502bddccc58c3a9c35 Reviewed-on: https://go-review.googlesource.com/c/153818 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- .../go/testdata/script/mod_clean_cache.txt | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/testdata/script/mod_clean_cache.txt b/src/cmd/go/testdata/script/mod_clean_cache.txt index 66a0e9ea7e781..a9519f9d9086c 100644 --- a/src/cmd/go/testdata/script/mod_clean_cache.txt +++ b/src/cmd/go/testdata/script/mod_clean_cache.txt @@ -1,23 +1,59 @@ env GO111MODULE=on +# 'mod download' should download the module to the cache. go mod download rsc.io/quote@v1.5.0 exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.info exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.mod exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.zip +# '-n' should print commands but not actually execute them. go clean -modcache -n stdout '^rm -rf .*pkg.mod$' exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.info exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.mod exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.zip +# 'go clean -modcache' should actually delete the files. go clean -modcache ! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.info ! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.mod ! exists $GOPATH/pkg/mod/cache/download/rsc.io/quote/@v/v1.5.0.zip +# 'go clean -r -modcache' should clean only the dependencies that are within the +# main module. +# BUG(golang.org/issue/28680): Today, it cleans across module boundaries. +cd r +exists ./test.out +exists ../replaced/test.out +go clean -r -modcache +! exists ./test.out +! exists ../replaced/test.out # BUG: should still exist + +# 'go clean -modcache' should not download anything before cleaning. +# BUG(golang.org/issue/28680): Today, it does. +go mod edit -require rsc.io/quote@v1.99999999.0-not-a-real-version +! go clean -modcache # BUG: should succeed +stderr 'finding rsc.io' # BUG: should not resolve module +go mod edit -droprequire rsc.io/quote + -- go.mod -- module m - -- m.go -- -package m \ No newline at end of file +package m + +-- r/go.mod -- +module example.com/r +require example.com/r/replaced v0.0.0 +replace example.com/r/replaced => ../replaced +-- r/r.go -- +package r +import _ "example.com/r/replaced" +-- r/test.out -- +DELETE ME + +-- replaced/go.mod -- +module example.com/r/replaced +-- replaced/replaced.go -- +package replaced +-- replaced/test.out -- +DO NOT DELETE From 561923fa7a7d47bba99556aaa61e40dd38708773 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 11 Dec 2018 22:46:55 -0500 Subject: [PATCH 309/594] cmd/go/internal/modfetch: skip symlinks in (*coderepo).Zip MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested manually. Before: $ go mod init golang.org/issue/scratch go: creating new go.mod: module golang.org/issue/scratch $ go1.11.2 mod download github.com/rogpeppe/test2@latest go: finding github.com/rogpeppe/test2 v0.0.11 $ find $GOPATH -name goodbye /tmp/tmp.Y8a8UzX3zD/_gopath/pkg/mod/github.com/rogpeppe/test2@v0.0.11/tests/goodbye $ cat $(find $GOPATH -name goodbye) hello After: $ go mod init golang.org/issue/scratch go: creating new go.mod: module golang.org/issue/scratch $ go mod download github.com/rogpeppe/test2@latest go: finding github.com/rogpeppe/test2 v0.0.11 $ find $GOPATH -name goodbye $ find $GOPATH -name hello /tmp/tmp.Zo0jhfLaRs/_gopath/pkg/mod/github.com/rogpeppe/test2@v0.0.11/tests/hello A proper regression test would require one of: • a new entry in the vcs-test server (feasible but tedious, and not easily updated by open-source contributors), or • a way to set up an HTTPS proxy in a script_test, or • a way to explicitly populate the module cache from the contents of a local repository (#28835). Fixes #27093 Updates #28835 Change-Id: I72702a7e791f8815965f0f87c82a30df4d6f0151 Reviewed-on: https://go-review.googlesource.com/c/153819 Run-TryBot: Bryan C. Mills Reviewed-by: Jay Conrod --- src/cmd/go/internal/modfetch/coderepo.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cmd/go/internal/modfetch/coderepo.go b/src/cmd/go/internal/modfetch/coderepo.go index 737aade739b6d..5018b6d8af7c7 100644 --- a/src/cmd/go/internal/modfetch/coderepo.go +++ b/src/cmd/go/internal/modfetch/coderepo.go @@ -489,6 +489,11 @@ func (r *codeRepo) Zip(dst io.Writer, version string) error { } for _, zf := range zr.File { + if !zf.FileInfo().Mode().IsRegular() { + // Skip symlinks (golang.org/issue/27093). + continue + } + if topPrefix == "" { i := strings.Index(zf.Name, "/") if i < 0 { From a35ddcc222dc84c5a510f5440713b70c07162b0f Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Wed, 12 Dec 2018 17:05:06 -0500 Subject: [PATCH 310/594] syscall: update doc comment to match behavior for Proc.Call golang.org/cl/147117 increased the number of arguments permitted by Proc.Call on Windows, but the doc comment was never updated. Change-Id: Iea5eb9e0aafbc1025d5fcb8665d028b2254c183a Reviewed-on: https://go-review.googlesource.com/c/153825 Reviewed-by: Channing Kimble-Brown Reviewed-by: Andrew Bonventre --- src/syscall/dll_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/syscall/dll_windows.go b/src/syscall/dll_windows.go index 816334226fd8f..c57cd34f8225b 100644 --- a/src/syscall/dll_windows.go +++ b/src/syscall/dll_windows.go @@ -132,7 +132,7 @@ func (p *Proc) Addr() uintptr { //go:uintptrescapes -// Call executes procedure p with arguments a. It will panic, if more than 15 arguments +// Call executes procedure p with arguments a. It will panic if more than 18 arguments // are supplied. // // The returned error is always non-nil, constructed from the result of GetLastError. From bf141a18c6eb852834065c78c30432f86a90d345 Mon Sep 17 00:00:00 2001 From: Hana Kim Date: Tue, 11 Dec 2018 18:06:50 -0500 Subject: [PATCH 311/594] cmd/go/internal/web2: log http requests with -v It's similar to what cmd/go/internal/web package does when cfg.BuildV is set. The web2 package is what cmd/go/internal/modfetch uses, so this change allows us to trace web requests go get command in module mode sends for modfetch. Change-Id: If387efd8a8698c816bf267d1e6c6766fd357c298 Reviewed-on: https://go-review.googlesource.com/c/153640 Run-TryBot: Hyang-Ah Hana Kim Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/go/internal/web2/web.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cmd/go/internal/web2/web.go b/src/cmd/go/internal/web2/web.go index f3900379e1784..64934f1d506db 100644 --- a/src/cmd/go/internal/web2/web.go +++ b/src/cmd/go/internal/web2/web.go @@ -7,11 +7,13 @@ package web2 import ( "bytes" "cmd/go/internal/base" + "cmd/go/internal/cfg" "encoding/json" "flag" "fmt" "io" "io/ioutil" + "log" "net/http" "os" "path/filepath" @@ -187,10 +189,10 @@ func SetHTTPDoForTesting(do func(*http.Request) (*http.Response, error)) { } func Get(url string, options ...Option) error { - if TraceGET || webstack { - println("GET", url) + if TraceGET || webstack || cfg.BuildV { + log.Printf("Fetching %s", url) if webstack { - println(string(debug.Stack())) + log.Println(string(debug.Stack())) } } From 3ae2c6c52eb4b8714245b91d094e0ccdfdbe585c Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Wed, 12 Dec 2018 14:38:03 -0500 Subject: [PATCH 312/594] go/internal/gccgoimporter: permit fixups for V2 export data The changes added in https://golang.org/cl/151997 to fix problems when reading older export data introduced the ability to add "fixups" to handle references to a type whose definition has not yet been finalized. It turns out we need to allow for fixups even for more recent export data (V2 and V3); this patch removes a version guard for the fixup generation logic. Fixes #29198. Change-Id: I82136ac45b53e4a59c05ff0879ac6bb545d0ff31 Reviewed-on: https://go-review.googlesource.com/c/153821 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- .../internal/gccgoimporter/importer_test.go | 1 + src/go/internal/gccgoimporter/parser.go | 9 +- .../gccgoimporter/testdata/issue29198.go | 37 ++++++++ .../gccgoimporter/testdata/issue29198.gox | 86 +++++++++++++++++++ 4 files changed, 127 insertions(+), 6 deletions(-) create mode 100644 src/go/internal/gccgoimporter/testdata/issue29198.go create mode 100644 src/go/internal/gccgoimporter/testdata/issue29198.gox diff --git a/src/go/internal/gccgoimporter/importer_test.go b/src/go/internal/gccgoimporter/importer_test.go index b659cfc1df166..f678ddc3b59a0 100644 --- a/src/go/internal/gccgoimporter/importer_test.go +++ b/src/go/internal/gccgoimporter/importer_test.go @@ -90,6 +90,7 @@ var importerTests = [...]importerTest{ {pkgpath: "issue27856", name: "M", want: "type M struct{E F}"}, {pkgpath: "v1reflect", name: "Type", want: "type Type interface{Align() int; AssignableTo(u Type) bool; Bits() int; ChanDir() ChanDir; Elem() Type; Field(i int) StructField; FieldAlign() int; FieldByIndex(index []int) StructField; FieldByName(name string) (StructField, bool); FieldByNameFunc(match func(string) bool) (StructField, bool); Implements(u Type) bool; In(i int) Type; IsVariadic() bool; Key() Type; Kind() Kind; Len() int; Method(int) Method; MethodByName(string) (Method, bool); Name() string; NumField() int; NumIn() int; NumMethod() int; NumOut() int; Out(i int) Type; PkgPath() string; Size() uintptr; String() string; common() *commonType; rawString() string; runtimeType() *runtimeType; uncommon() *uncommonType}"}, {pkgpath: "nointerface", name: "I", want: "type I int"}, + {pkgpath: "issue29198", name: "FooServer", want: "type FooServer struct{FooServer *FooServer; user string; ctx context.Context}"}, } func TestGoxImporter(t *testing.T) { diff --git a/src/go/internal/gccgoimporter/parser.go b/src/go/internal/gccgoimporter/parser.go index 5414046be4ef3..d0081ad3b806c 100644 --- a/src/go/internal/gccgoimporter/parser.go +++ b/src/go/internal/gccgoimporter/parser.go @@ -33,9 +33,9 @@ type parser struct { initdata InitData // package init priority data } -// When reading V1 export data it's possible to encounter a defined -// type N1 with an underlying defined type N2 while we are still -// reading in that defined type N2; see issue #29006 for an instance +// When reading export data it's possible to encounter a defined type +// N1 with an underlying defined type N2 while we are still reading in +// that defined type N2; see issues #29006 and #29198 for instances // of this. Example: // // type N1 N2 @@ -526,9 +526,6 @@ func (p *parser) parseNamedType(nlist []int) types.Type { underlying := p.parseType(pkg) if nt.Underlying() == nil { if underlying.Underlying() == nil { - if p.version != "v1" { - p.errorf("internal error: unexpected fixup required for %v", nt) - } fix := fixupRecord{toUpdate: nt, target: underlying} p.fixups = append(p.fixups, fix) } else { diff --git a/src/go/internal/gccgoimporter/testdata/issue29198.go b/src/go/internal/gccgoimporter/testdata/issue29198.go new file mode 100644 index 0000000000000..75c2162d20454 --- /dev/null +++ b/src/go/internal/gccgoimporter/testdata/issue29198.go @@ -0,0 +1,37 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package server + +import ( + "context" + "errors" +) + +type A struct { + x int +} + +func (a *A) AMethod(y int) *Server { + return nil +} + +// FooServer is a server that provides Foo services +type FooServer Server + +func (f *FooServer) WriteEvents(ctx context.Context, x int) error { + return errors.New("hey!") +} + +type Server struct { + FooServer *FooServer + user string + ctx context.Context +} + +func New(sctx context.Context, u string) (*Server, error) { + s := &Server{user: u, ctx: sctx} + s.FooServer = (*FooServer)(s) + return s, nil +} diff --git a/src/go/internal/gccgoimporter/testdata/issue29198.gox b/src/go/internal/gccgoimporter/testdata/issue29198.gox new file mode 100644 index 0000000000000..905c86637ebf3 --- /dev/null +++ b/src/go/internal/gccgoimporter/testdata/issue29198.gox @@ -0,0 +1,86 @@ +v2; +package server; +pkgpath issue29198; +import context context "context"; +import errors errors "errors"; +init context context..import fmt fmt..import poll internal_poll..import testlog internal_testlog..import io io..import os os..import reflect reflect..import runtime runtime..import sys runtime_internal_sys..import strconv strconv..import sync sync..import syscall syscall..import time time..import unicode unicode..import; +init_graph 0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 13 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 1 10 1 11 1 12 1 13 2 4 2 7 2 8 2 10 2 11 2 12 4 7 4 8 4 10 5 2 5 3 5 4 5 7 5 8 5 10 5 11 5 12 6 7 6 8 6 9 6 10 6 13 7 8 9 7 9 8 10 7 10 8 11 7 11 8 11 10 12 7 12 8 12 10 12 11; +type ; }> + func (a >) AMethod (y ) + func (f >) WriteEvents (ctx ; .time.ext ; .time.loc ; .time.zone ; .time.offset ; .time.isDST ; }>>>; .time.tx ; .time.index ; .time.isstd ; .time.isutc ; }>>>; .time.cacheStart ; .time.cacheEnd ; .time.cacheZone >; }> + func (l >) String () ; + func (l ) .time.lookupFirstZone () ; + func (l ) .time.get () ; + func (l ) .time.lookup (sec ) (name , offset , isDST , start , end ); + func (l ) .time.lookupName (name , unix ) (offset , ok ); + func (l ) .time.firstZoneUsed () ; +>>; }> + func (t ) In (loc ) ; + func (t ) .time.date (full ) (year , month + func (m ) String () ; +>, day , yday ); + func (t ) Sub (u ) + func (d ) Truncate (m ) ; + func (d ) String () ; + func (d ) Round (m ) ; + func (d ) Seconds () ; + func (d ) Nanoseconds () ; + func (d ) Minutes () ; + func (d ) Hours () ; +>; + func (t ) Add (d ) ; + func (t ) UTC () ; + func (t ) AddDate (years , months , days ) ; + func (t ) MarshalBinary () (? >, ? ); + func (t ) Nanosecond () ; + func (t ) Round (d ) ; + func (t ) Minute () ; + func (t ) Clock () (hour , min , sec ); + func (t ) ISOWeek () (year , week ); + func (t ) Day () ; + func (t >) .time.mono () ; + func (t ) UnixNano () ; + func (t ) .time.sec () ; + func (t ) Second () ; + func (t ) Before (u ) ; + func (t ) UnmarshalBinary (data >) ; + func (t ) Month () ; + func (t ) YearDay () ; + func (t ) Location () ; + func (t ) Zone () (name , offset ); + func (t ) Local () ; + func (t ) .time.setLoc (loc ); + func (t ) Truncate (d ) ; + func (t ) MarshalJSON () (? >, ? ); + func (t ) AppendFormat (b >, layout ) >; + func (t ) GobDecode (data >) ; + func (t ) UnmarshalJSON (data >) ; + func (t ) MarshalText () (? >, ? ); + func (t ) GobEncode () (? >, ? ); + func (t ) .time.stripMono (); + func (t ) After (u ) ; + func (t ) Hour () ; + func (t ) UnmarshalText (data >) ; + func (t ) Equal (u ) ; + func (t ) .time.setMono (m ); + func (t ) Year () ; + func (t ) IsZero () ; + func (t ) .time.addSec (d ); + func (t ) Weekday () + func (d ) String () ; +>; + func (t ) String () ; + func (t ) .time.nsec () ; + func (t ) Format (layout ) ; + func (t ) .time.unixSec () ; + func (t ) Unix () ; + func (t ) .time.abs () ; + func (t ) .time.locabs () (name , offset , abs ); + func (t ) Date () (year , month , day ); +>, ok ); Done () >; Err () ; Value (key ) ; }>>, x ) ; +>>; .issue29198.user ; .issue29198.ctx ; }>>>; +>; +type ; +func New (sctx , u ) (? >, ? ); +type ; +checksum 86C8D76B2582F55A8BD2CA9E00060358EC1CE214; From 862ba63823e23202e50d7b756e37809c4eddf54b Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 7 Dec 2018 12:05:00 -0500 Subject: [PATCH 313/594] cmd/go: reject GOCACHE=off when the default cache is initialized Allow GOCACHE=off only for operations that never actually write anything to the cache (in which case the GOCACHE setting should not matter at all). Fixes #29127 Change-Id: I733d02cd2fbcf3671f5adcfb73522865d131e360 Reviewed-on: https://go-review.googlesource.com/c/153462 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- doc/go1.12.html | 8 +-- src/cmd/dist/test.go | 2 - src/cmd/go/go_test.go | 60 +---------------- src/cmd/go/internal/cache/default.go | 48 +++++-------- .../go/internal/cache/default_unix_test.go | 67 ------------------- src/cmd/go/testdata/script/build_GOTMPDIR.txt | 5 +- src/cmd/go/testdata/script/build_nocache.txt | 19 ++++++ .../testdata/script/build_relative_pkgdir.txt | 7 ++ .../testdata/script/build_relative_tmpdir.txt | 16 +++++ src/cmd/go/testdata/script/cache_unix.txt | 34 ++++++++++ 10 files changed, 103 insertions(+), 163 deletions(-) delete mode 100644 src/cmd/go/internal/cache/default_unix_test.go create mode 100644 src/cmd/go/testdata/script/build_nocache.txt create mode 100644 src/cmd/go/testdata/script/build_relative_pkgdir.txt create mode 100644 src/cmd/go/testdata/script/build_relative_tmpdir.txt create mode 100644 src/cmd/go/testdata/script/cache_unix.txt diff --git a/doc/go1.12.html b/doc/go1.12.html index f036180f5322b..f204c977fd8a0 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -91,11 +91,11 @@

    go tool vet no longer supported

    Build cache requirement

    - The build cache is now required as a step toward eliminating + The build cache is now + required as a step toward eliminating $GOPATH/pkg. Setting the environment variable - GOCACHE=off to disable the - build cache - has no effect in Go 1.12. + GOCACHE=off will cause go commands that write to the + cache to fail.

    Binary-only packages

    diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index c88a7c05dfbe3..ac182305529f9 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -519,7 +519,6 @@ func (t *tester) registerTests() { } // Run `go test fmt` in the moved GOROOT. - // Disable GOCACHE because it points back at the old GOROOT. cmd := exec.Command(filepath.Join(moved, "bin", "go"), "test", "fmt") cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr @@ -529,7 +528,6 @@ func (t *tester) registerTests() { cmd.Env = append(cmd.Env, e) } } - cmd.Env = append(cmd.Env, "GOCACHE=off") err := cmd.Run() if rerr := os.Rename(moved, goroot); rerr != nil { diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index 6c31f9841500f..d16ab3d76d52e 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -5011,7 +5011,8 @@ func TestExecBuildX(t *testing.T) { tg := testgo(t) defer tg.cleanup() - tg.setenv("GOCACHE", "off") + tg.tempDir("cache") + tg.setenv("GOCACHE", tg.path("cache")) tg.tempFile("main.go", `package main; import "C"; func main() { print("hello") }`) src := tg.path("main.go") @@ -5542,30 +5543,6 @@ func TestTestCacheInputs(t *testing.T) { } } -func TestNoCache(t *testing.T) { - switch runtime.GOOS { - case "windows": - t.Skipf("no unwritable directories on %s", runtime.GOOS) - } - if os.Getuid() == 0 { - t.Skip("skipping test because running as root") - } - - tg := testgo(t) - defer tg.cleanup() - tg.parallel() - tg.tempFile("triv.go", `package main; func main() {}`) - tg.must(os.MkdirAll(tg.path("unwritable"), 0555)) - home := "HOME" - if runtime.GOOS == "plan9" { - home = "home" - } - tg.setenv(home, tg.path(filepath.Join("unwritable", "home"))) - tg.unsetenv("GOCACHE") - tg.run("build", "-o", tg.path("triv"), tg.path("triv.go")) - tg.grepStderr("disabling cache", "did not disable cache") -} - func TestTestVet(t *testing.T) { tooSlow(t) tg := testgo(t) @@ -5715,17 +5692,6 @@ func TestFmtLoadErrors(t *testing.T) { tg.run("fmt", "-n", "exclude") } -func TestRelativePkgdir(t *testing.T) { - tooSlow(t) - tg := testgo(t) - defer tg.cleanup() - tg.makeTempdir() - tg.setenv("GOCACHE", "off") - tg.cd(tg.tempdir) - - tg.run("build", "-i", "-pkgdir=.", "runtime") -} - func TestGoTestMinusN(t *testing.T) { // Intent here is to verify that 'go test -n' works without crashing. // This reuses flag_test.go, but really any test would do. @@ -6107,28 +6073,6 @@ func TestDontReportRemoveOfEmptyDir(t *testing.T) { } } -// Issue 23264. -func TestNoRelativeTmpdir(t *testing.T) { - tg := testgo(t) - defer tg.cleanup() - - tg.tempFile("src/a/a.go", `package a`) - tg.cd(tg.path(".")) - tg.must(os.Mkdir("tmp", 0777)) - - tg.setenv("GOCACHE", "off") - tg.setenv("GOPATH", tg.path(".")) - tg.setenv("GOTMPDIR", "tmp") - tg.run("build", "-work", "a") - tg.grepStderr("WORK=[^t]", "work should be absolute path") - - tg.unsetenv("GOTMPDIR") - tg.setenv("TMP", "tmp") // windows - tg.setenv("TMPDIR", "tmp") // unix - tg.run("build", "-work", "a") - tg.grepStderr("WORK=[^t]", "work should be absolute path") -} - // Issue 24704. func TestLinkerTmpDirIsDeleted(t *testing.T) { skipIfGccgo(t, "gccgo does not use cmd/link") diff --git a/src/cmd/go/internal/cache/default.go b/src/cmd/go/internal/cache/default.go index 4a69bf2a443c9..52a1fc8c7a517 100644 --- a/src/cmd/go/internal/cache/default.go +++ b/src/cmd/go/internal/cache/default.go @@ -10,6 +10,8 @@ import ( "os" "path/filepath" "sync" + + "cmd/go/internal/base" ) // Default returns the default cache to use, or nil if no cache should be used. @@ -34,15 +36,12 @@ See golang.org to learn more about Go. // initDefaultCache does the work of finding the default cache // the first time Default is called. func initDefaultCache() { - dir, showWarnings := defaultDir() + dir := DefaultDir() if dir == "off" { - return + die() } if err := os.MkdirAll(dir, 0777); err != nil { - if showWarnings { - fmt.Fprintf(os.Stderr, "go: disabling cache (%s) due to initialization failure: %s\n", dir, err) - } - return + base.Fatalf("failed to initialize build cache at %s: %s\n", dir, err) } if _, err := os.Stat(filepath.Join(dir, "README")); err != nil { // Best effort. @@ -51,10 +50,7 @@ func initDefaultCache() { c, err := Open(dir) if err != nil { - if showWarnings { - fmt.Fprintf(os.Stderr, "go: disabling cache (%s) due to initialization failure: %s\n", dir, err) - } - return + base.Fatalf("failed to initialize build cache at %s: %s\n", dir, err) } defaultCache = c } @@ -62,34 +58,26 @@ func initDefaultCache() { // DefaultDir returns the effective GOCACHE setting. // It returns "off" if the cache is disabled. func DefaultDir() string { - dir, _ := defaultDir() - return dir -} - -// defaultDir returns the effective GOCACHE setting. -// It returns "off" if the cache is disabled. -// The second return value reports whether warnings should -// be shown if the cache fails to initialize. -func defaultDir() (string, bool) { dir := os.Getenv("GOCACHE") if dir != "" { - return dir, true + return dir } // Compute default location. dir, err := os.UserCacheDir() if err != nil { - return "off", true + return "off" } - dir = filepath.Join(dir, "go-build") + return filepath.Join(dir, "go-build") +} - // Do this after filepath.Join, so that the path has been cleaned. - showWarnings := true - switch dir { - case "/.cache/go-build": - // probably docker run with -u flag - // https://golang.org/issue/26280 - showWarnings = false +// die calls base.Fatalf with a message explaining why DefaultDir was "off". +func die() { + if os.Getenv("GOCACHE") == "off" { + base.Fatalf("build cache is disabled by GOCACHE=off, but required as of Go 1.12") + } + if _, err := os.UserCacheDir(); err != nil { + base.Fatalf("build cache is required, but could not be located: %v", err) } - return dir, showWarnings + panic(fmt.Sprintf("cache.die called unexpectedly with cache.DefaultDir() = %s", DefaultDir())) } diff --git a/src/cmd/go/internal/cache/default_unix_test.go b/src/cmd/go/internal/cache/default_unix_test.go deleted file mode 100644 index 1458201f4b32a..0000000000000 --- a/src/cmd/go/internal/cache/default_unix_test.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !windows,!darwin,!plan9 - -package cache - -import ( - "os" - "strings" - "testing" -) - -func TestDefaultDir(t *testing.T) { - goCacheDir := "/tmp/test-go-cache" - xdgCacheDir := "/tmp/test-xdg-cache" - homeDir := "/tmp/test-home" - - // undo env changes when finished - defer func(GOCACHE, XDG_CACHE_HOME, HOME string) { - os.Setenv("GOCACHE", GOCACHE) - os.Setenv("XDG_CACHE_HOME", XDG_CACHE_HOME) - os.Setenv("HOME", HOME) - }(os.Getenv("GOCACHE"), os.Getenv("XDG_CACHE_HOME"), os.Getenv("HOME")) - - os.Setenv("GOCACHE", goCacheDir) - os.Setenv("XDG_CACHE_HOME", xdgCacheDir) - os.Setenv("HOME", homeDir) - - dir, showWarnings := defaultDir() - if dir != goCacheDir { - t.Errorf("Cache DefaultDir %q should be $GOCACHE %q", dir, goCacheDir) - } - if !showWarnings { - t.Error("Warnings should be shown when $GOCACHE is set") - } - - os.Unsetenv("GOCACHE") - dir, showWarnings = defaultDir() - if !strings.HasPrefix(dir, xdgCacheDir+"/") { - t.Errorf("Cache DefaultDir %q should be under $XDG_CACHE_HOME %q when $GOCACHE is unset", dir, xdgCacheDir) - } - if !showWarnings { - t.Error("Warnings should be shown when $XDG_CACHE_HOME is set") - } - - os.Unsetenv("XDG_CACHE_HOME") - dir, showWarnings = defaultDir() - if !strings.HasPrefix(dir, homeDir+"/.cache/") { - t.Errorf("Cache DefaultDir %q should be under $HOME/.cache %q when $GOCACHE and $XDG_CACHE_HOME are unset", dir, homeDir+"/.cache") - } - if !showWarnings { - t.Error("Warnings should be shown when $HOME is not /") - } - - os.Unsetenv("HOME") - if dir, _ := defaultDir(); dir != "off" { - t.Error("Cache not disabled when $GOCACHE, $XDG_CACHE_HOME, and $HOME are unset") - } - - os.Setenv("HOME", "/") - if _, showWarnings := defaultDir(); showWarnings { - // https://golang.org/issue/26280 - t.Error("Cache initialization warnings should be squelched when $GOCACHE and $XDG_CACHE_HOME are unset and $HOME is /") - } -} diff --git a/src/cmd/go/testdata/script/build_GOTMPDIR.txt b/src/cmd/go/testdata/script/build_GOTMPDIR.txt index 4c387afbbabd7..ea06dcc472def 100644 --- a/src/cmd/go/testdata/script/build_GOTMPDIR.txt +++ b/src/cmd/go/testdata/script/build_GOTMPDIR.txt @@ -1,6 +1,8 @@ +# Set GOCACHE to a clean directory to ensure that 'go build' has work to report. +env GOCACHE=$WORK/gocache + # Build should use GOTMPDIR if set. env GOTMPDIR=$WORK/my-favorite-tmpdir -env GOCACHE=off mkdir $GOTMPDIR go build -work hello.go stderr ^WORK=.*my-favorite-tmpdir @@ -8,4 +10,3 @@ stderr ^WORK=.*my-favorite-tmpdir -- hello.go -- package main func main() { println("hello") } - diff --git a/src/cmd/go/testdata/script/build_nocache.txt b/src/cmd/go/testdata/script/build_nocache.txt new file mode 100644 index 0000000000000..61ea5c5dbdc51 --- /dev/null +++ b/src/cmd/go/testdata/script/build_nocache.txt @@ -0,0 +1,19 @@ +# Set GOCACHE to a directory that doesn't allow writes. +[windows] skip # Does not support unwritable directories. +[root] skip # Can write to unwritable directories. + +mkdir $WORK/unwritable/home +chmod 0555 $WORK/unwritable/home +[!plan9] env HOME=$WORK/unwritable/home +[plan9] env home=$WORK/unwritable/home + +env GOCACHE=$WORK/unwritable/home + +# As of Go 1.12, the module cache is required: +# failure to write to it should cause builds to fail. +! go build -o triv triv.go +stderr 'failed to initialize build cache.* permission denied' + +-- triv.go -- +package main +func main() {} diff --git a/src/cmd/go/testdata/script/build_relative_pkgdir.txt b/src/cmd/go/testdata/script/build_relative_pkgdir.txt new file mode 100644 index 0000000000000..76098a0662ba9 --- /dev/null +++ b/src/cmd/go/testdata/script/build_relative_pkgdir.txt @@ -0,0 +1,7 @@ +# Regression test for golang.org/issue/21309: accept relative -pkgdir argument. + +[short] skip + +mkdir $WORK/gocache +env GOCACHE=$WORK/gocache +go build -i -pkgdir=. runtime diff --git a/src/cmd/go/testdata/script/build_relative_tmpdir.txt b/src/cmd/go/testdata/script/build_relative_tmpdir.txt new file mode 100644 index 0000000000000..9490a285d34fc --- /dev/null +++ b/src/cmd/go/testdata/script/build_relative_tmpdir.txt @@ -0,0 +1,16 @@ +# If GOTMPDIR is relative, 'go build' should derive an absolute $WORK directory. +cd $WORK +mkdir tmp +env GOTMPDIR=tmp +go build -work a +stderr 'WORK=\$WORK' # the test script itself converts the absolute directory back to $WORK + +# Similarly if TMP/TMPDIR is relative. +env GOTMPDIR= +env TMP=tmp # Windows +env TMPDIR=tmp # Unix +go build -work a +stderr 'WORK=\$WORK' + +-- a/a.go -- +package a diff --git a/src/cmd/go/testdata/script/cache_unix.txt b/src/cmd/go/testdata/script/cache_unix.txt new file mode 100644 index 0000000000000..f700ebe3ed2cf --- /dev/null +++ b/src/cmd/go/testdata/script/cache_unix.txt @@ -0,0 +1,34 @@ +# Integration test for cache directory calculation (cmd/go/internal/cache). + +[windows] skip +[darwin] skip +[plan9] skip + +mkdir $WORK/gocache +mkdir $WORK/xdg +mkdir $WORK/home + +# Set GOCACHE, XDG_CACHE_HOME, and HOME. +env GOCACHE=$WORK/gocache +env XDG_CACHE_HOME=$WORK/xdg +env HOME=$WORK/home + +# With all three set, we should prefer GOCACHE. +go env GOCACHE +stdout '\$WORK/gocache$' + +# Without GOCACHE, we should prefer XDG_CACHE_HOME over HOME. +env GOCACHE= +go env GOCACHE +stdout '\$WORK/xdg/go-build$$' + +# With only HOME set, we should use $HOME/.cache. +env XDG_CACHE_HOME= +go env GOCACHE +stdout '\$WORK/home/.cache/go-build$' + +# With no guidance from the environment, we must disable the cache, but that +# should not cause commands that do not write to the cache to fail. +env HOME= +go env GOCACHE +stdout 'off' From 1ca84deeb048ac8ab850f68eb84ee7811d957676 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Wed, 12 Dec 2018 11:28:46 -0800 Subject: [PATCH 314/594] runtime: pass LR to sigprof on windows/arm TestCPUProfileLabel was failing on windows/arm because the link register was not being passed to sigprof(). The link register is required to generate a correct traceback. With this change, all tests in runtime.pprof are now passing. Updates #26148 Change-Id: Ia693b34278dc08a98023751ff1a922d9eee8fdd6 Reviewed-on: https://go-review.googlesource.com/c/153839 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/runtime/os_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 5870a342c2789..9b34589874c54 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -879,7 +879,7 @@ func profilem(mp *m, thread uintptr) { gp = *((**g)(unsafe.Pointer(tls))) } - sigprof(r.ip(), r.sp(), 0, gp, mp) + sigprof(r.ip(), r.sp(), r.lr(), gp, mp) } func profileloop1(param uintptr) uint32 { From ab02028b5af0b5d8966ac9bb092352a523314b08 Mon Sep 17 00:00:00 2001 From: Muhammad Falak R Wani Date: Wed, 29 Aug 2018 05:31:46 +0530 Subject: [PATCH 315/594] go/build: document when Context.BuildTags is used. Context.BuildTags is not set when you read go/build.Default.BuildTags. It's only used by (*BuildTags).Import, etc. Fixes: #27320 Change-Id: I97e5f1923c410b48f70be8c15938a7e04a178e3f Reviewed-on: https://go-review.googlesource.com/c/131975 Reviewed-by: Ian Lance Taylor --- src/go/build/build.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/go/build/build.go b/src/go/build/build.go index 5e683aef9822f..0fa67201f88dc 100644 --- a/src/go/build/build.go +++ b/src/go/build/build.go @@ -43,6 +43,7 @@ type Context struct { // Clients creating a new context may customize BuildTags, which // defaults to empty, but it is usually an error to customize ReleaseTags, // which defaults to the list of Go releases the current release is compatible with. + // BuildTags is not set for the Default build Context. // In addition to the BuildTags and ReleaseTags, build constraints // consider the values of GOARCH and GOOS as satisfied tags. // The last element in ReleaseTags is assumed to be the current release. From e123ccbfe0856da67446374d39e9d3e738046e9e Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 12 Dec 2018 22:28:50 +0000 Subject: [PATCH 316/594] strings: revert accidental example change from CL 153840 Change-Id: I2ff29aa9909be3062fcd5f65af261f5d8c46fbc1 Reviewed-on: https://go-review.googlesource.com/c/153843 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/strings/example_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings/example_test.go b/src/strings/example_test.go index 103ef51f29edb..607e4a0a70e7a 100644 --- a/src/strings/example_test.go +++ b/src/strings/example_test.go @@ -199,7 +199,7 @@ func ExampleRepeat() { func ExampleReplace() { fmt.Println(strings.Replace("oink oink oink", "k", "ky", 2)) - fmt.Println(strings.ReplaceAll("oink oink oink", "oink", "moo")) + fmt.Println(strings.Replace("oink oink oink", "oink", "moo", -1)) // Output: // oinky oinky oink // moo moo moo From 09da2801578519ee5597bdd4cbfa22d4d127cc6d Mon Sep 17 00:00:00 2001 From: dupoxy Date: Wed, 12 Dec 2018 22:49:31 +0000 Subject: [PATCH 317/594] strings: add ReplaceAll example Change-Id: I6b0d470bdedb92844943c8e5823e214d6a7471cf GitHub-Last-Rev: 4a135000ba9c23a588b960e5b2989710cc71e3e2 GitHub-Pull-Request: golang/go#29199 Reviewed-on: https://go-review.googlesource.com/c/153840 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/strings/example_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/strings/example_test.go b/src/strings/example_test.go index 607e4a0a70e7a..e31054a4e0b31 100644 --- a/src/strings/example_test.go +++ b/src/strings/example_test.go @@ -205,6 +205,12 @@ func ExampleReplace() { // moo moo moo } +func ExampleReplaceAll() { + fmt.Println(strings.ReplaceAll("oink oink oink", "oink", "moo")) + // Output: + // moo moo moo +} + func ExampleSplit() { fmt.Printf("%q\n", strings.Split("a,b,c", ",")) fmt.Printf("%q\n", strings.Split("a man a plan a canal panama", "a ")) From bbae8d55083d14c414f32af638d5a5174b8027cc Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Thu, 13 Dec 2018 00:38:37 +1100 Subject: [PATCH 318/594] syscall: use correct cmsg alignment for openbsd/arm The OpenBSD armv7 port requires 64-bit alignment for cmsgs. Rework the cmsg alignment code to facilitate this. Change-Id: I52cf55a8a4cda46c6ef35b0f694862b842028b42 Reviewed-on: https://go-review.googlesource.com/c/153837 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/syscall/sockcmsg_unix.go | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/src/syscall/sockcmsg_unix.go b/src/syscall/sockcmsg_unix.go index 5020033bad58a..954148012fac1 100644 --- a/src/syscall/sockcmsg_unix.go +++ b/src/syscall/sockcmsg_unix.go @@ -8,17 +8,30 @@ package syscall -import "unsafe" +import ( + "runtime" + "unsafe" +) // Round the length of a raw sockaddr up to align it properly. func cmsgAlignOf(salen int) int { salign := sizeofPtr - // NOTE: It seems like 64-bit Darwin, DragonFly BSD and - // Solaris kernels still require 32-bit aligned access to - // network subsystem. - if darwin64Bit || dragonfly64Bit || solaris64Bit { - salign = 4 + + switch runtime.GOOS { + case "darwin", "dragonfly", "solaris": + // NOTE: It seems like 64-bit Darwin, DragonFly BSD and + // Solaris kernels still require 32-bit aligned access to + // network subsystem. + if sizeofPtr == 8 { + salign = 4 + } + case "openbsd": + // OpenBSD armv7 requires 64-bit alignment. + if runtime.GOARCH == "arm" { + salign = 8 + } } + return (salen + salign - 1) & ^(salign - 1) } From cc5fb5d93dd5880ba9832b1aa5f0914cca5cc0bd Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Thu, 13 Dec 2018 00:32:47 +1100 Subject: [PATCH 319/594] cmd/vendor: update golang.org/x/sys/unix Update golang.org/x/sys/unix to revision b05ddf57801d2239d6ab0ee35f9d981e0420f4ac. Changes exist in upstream golang.org/x/sys/unix, which allow for code to work and tests to pass on openbsd/arm. Change-Id: Iecc8598681a23cb0466f94c914f0e605a6fc64d7 Reviewed-on: https://go-review.googlesource.com/c/153838 Reviewed-by: Brad Fitzpatrick --- .../vendor/golang.org/x/sys/unix/aliases.go | 14 + .../golang.org/x/sys/unix/asm_aix_ppc64.s | 17 + .../golang.org/x/sys/unix/asm_linux_ppc64x.s | 12 - .../vendor/golang.org/x/sys/unix/constants.go | 2 +- .../golang.org/x/sys/unix/dev_aix_ppc.go | 27 + .../golang.org/x/sys/unix/dev_aix_ppc64.go | 29 + .../vendor/golang.org/x/sys/unix/dirent.go | 2 +- .../vendor/golang.org/x/sys/unix/env_unix.go | 2 +- .../golang.org/x/sys/unix/example_test.go | 13 +- .../golang.org/x/sys/unix/export_test.go | 2 +- src/cmd/vendor/golang.org/x/sys/unix/gccgo.go | 1 + .../vendor/golang.org/x/sys/unix/gccgo_c.c | 1 + src/cmd/vendor/golang.org/x/sys/unix/ioctl.go | 30 + src/cmd/vendor/golang.org/x/sys/unix/mkall.sh | 42 +- .../vendor/golang.org/x/sys/unix/mkerrors.sh | 70 +- .../x/sys/unix/mksyscall_aix_ppc.pl | 384 +++ .../x/sys/unix/mksyscall_aix_ppc64.pl | 579 ++++ .../x/sys/unix/mksyscall_solaris.pl | 5 + .../golang.org/x/sys/unix/mksysctl_openbsd.pl | 1 + .../golang.org/x/sys/unix/mksysnum_freebsd.pl | 2 +- .../golang.org/x/sys/unix/mmap_unix_test.go | 12 +- .../golang.org/x/sys/unix/openbsd_pledge.go | 152 +- .../golang.org/x/sys/unix/openbsd_test.go | 2 +- .../golang.org/x/sys/unix/openbsd_unveil.go | 44 + .../golang.org/x/sys/unix/pagesize_unix.go | 2 +- src/cmd/vendor/golang.org/x/sys/unix/race0.go | 2 +- .../golang.org/x/sys/unix/sockcmsg_unix.go | 35 +- src/cmd/vendor/golang.org/x/sys/unix/str.go | 2 +- .../vendor/golang.org/x/sys/unix/syscall.go | 2 +- .../golang.org/x/sys/unix/syscall_aix.go | 547 ++++ .../golang.org/x/sys/unix/syscall_aix_ppc.go | 34 + .../x/sys/unix/syscall_aix_ppc64.go | 34 + .../golang.org/x/sys/unix/syscall_aix_test.go | 162 + .../golang.org/x/sys/unix/syscall_bsd.go | 8 +- .../golang.org/x/sys/unix/syscall_bsd_test.go | 8 +- .../golang.org/x/sys/unix/syscall_darwin.go | 36 +- .../x/sys/unix/syscall_darwin_test.go | 44 + .../x/sys/unix/syscall_dragonfly.go | 14 +- .../golang.org/x/sys/unix/syscall_freebsd.go | 559 ++-- .../golang.org/x/sys/unix/syscall_linux.go | 303 +- .../x/sys/unix/syscall_linux_amd64.go | 31 +- .../x/sys/unix/syscall_linux_arm64.go | 9 +- .../x/sys/unix/syscall_linux_mipsx.go | 7 +- .../x/sys/unix/syscall_linux_ppc64x.go | 22 +- .../x/sys/unix/syscall_linux_riscv64.go | 209 ++ .../x/sys/unix/syscall_linux_s390x.go | 13 + .../x/sys/unix/syscall_linux_test.go | 81 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 51 +- .../x/sys/unix/syscall_netbsd_test.go | 51 + .../golang.org/x/sys/unix/syscall_openbsd.go | 52 +- .../x/sys/unix/syscall_openbsd_386.go | 4 + .../x/sys/unix/syscall_openbsd_arm.go | 4 + .../x/sys/unix/syscall_openbsd_test.go | 49 + .../golang.org/x/sys/unix/syscall_solaris.go | 12 +- .../golang.org/x/sys/unix/syscall_test.go | 2 +- .../golang.org/x/sys/unix/syscall_unix.go | 14 +- .../golang.org/x/sys/unix/syscall_unix_gc.go | 2 +- .../x/sys/unix/syscall_unix_gc_ppc64x.go | 24 + .../x/sys/unix/syscall_unix_test.go | 22 +- .../golang.org/x/sys/unix/timestruct.go | 2 +- .../golang.org/x/sys/unix/timestruct_test.go | 2 +- .../vendor/golang.org/x/sys/unix/xattr_bsd.go | 240 ++ .../golang.org/x/sys/unix/xattr_test.go | 92 +- .../golang.org/x/sys/unix/zerrors_aix_ppc.go | 1372 +++++++++ .../x/sys/unix/zerrors_aix_ppc64.go | 1373 +++++++++ .../x/sys/unix/zerrors_dragonfly_amd64.go | 66 +- .../x/sys/unix/zerrors_freebsd_386.go | 29 + .../x/sys/unix/zerrors_freebsd_amd64.go | 29 + .../x/sys/unix/zerrors_freebsd_arm.go | 29 + .../x/sys/unix/zerrors_linux_386.go | 146 +- .../x/sys/unix/zerrors_linux_amd64.go | 146 +- .../x/sys/unix/zerrors_linux_arm.go | 146 +- .../x/sys/unix/zerrors_linux_arm64.go | 146 +- .../x/sys/unix/zerrors_linux_mips.go | 145 +- .../x/sys/unix/zerrors_linux_mips64.go | 145 +- .../x/sys/unix/zerrors_linux_mips64le.go | 145 +- .../x/sys/unix/zerrors_linux_mipsle.go | 145 +- .../x/sys/unix/zerrors_linux_ppc64.go | 145 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 145 +- .../x/sys/unix/zerrors_linux_riscv64.go | 2725 +++++++++++++++++ .../x/sys/unix/zerrors_linux_s390x.go | 146 +- .../x/sys/unix/zerrors_linux_sparc64.go | 350 +-- .../x/sys/unix/zerrors_netbsd_386.go | 44 + .../x/sys/unix/zerrors_netbsd_amd64.go | 44 + .../x/sys/unix/zerrors_netbsd_arm.go | 44 + .../x/sys/unix/zerrors_openbsd_386.go | 54 + .../x/sys/unix/zerrors_openbsd_amd64.go | 59 + .../x/sys/unix/zerrors_openbsd_arm.go | 54 + .../x/sys/unix/zerrors_solaris_amd64.go | 35 + .../golang.org/x/sys/unix/zsyscall_aix_ppc.go | 1450 +++++++++ .../x/sys/unix/zsyscall_aix_ppc64.go | 1408 +++++++++ .../x/sys/unix/zsyscall_aix_ppc64_gc.go | 1162 +++++++ .../x/sys/unix/zsyscall_aix_ppc64_gccgo.go | 1042 +++++++ .../x/sys/unix/zsyscall_darwin_386.go | 59 +- .../x/sys/unix/zsyscall_darwin_amd64.go | 59 +- .../x/sys/unix/zsyscall_darwin_arm.go | 59 +- .../x/sys/unix/zsyscall_darwin_arm64.go | 59 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 133 +- .../x/sys/unix/zsyscall_freebsd_386.go | 110 +- .../x/sys/unix/zsyscall_freebsd_amd64.go | 110 +- .../x/sys/unix/zsyscall_freebsd_arm.go | 110 +- .../x/sys/unix/zsyscall_linux_386.go | 174 +- .../x/sys/unix/zsyscall_linux_amd64.go | 206 +- .../x/sys/unix/zsyscall_linux_arm.go | 174 +- .../x/sys/unix/zsyscall_linux_arm64.go | 174 +- .../x/sys/unix/zsyscall_linux_mips.go | 186 +- .../x/sys/unix/zsyscall_linux_mips64.go | 174 +- .../x/sys/unix/zsyscall_linux_mips64le.go | 174 +- .../x/sys/unix/zsyscall_linux_mipsle.go | 186 +- .../x/sys/unix/zsyscall_linux_ppc64.go | 233 +- .../x/sys/unix/zsyscall_linux_ppc64le.go | 233 +- .../x/sys/unix/zsyscall_linux_riscv64.go | 2191 +++++++++++++ .../x/sys/unix/zsyscall_linux_s390x.go | 189 +- .../x/sys/unix/zsyscall_linux_sparc64.go | 204 +- .../x/sys/unix/zsyscall_netbsd_386.go | 389 ++- .../x/sys/unix/zsyscall_netbsd_amd64.go | 389 ++- .../x/sys/unix/zsyscall_netbsd_arm.go | 389 ++- .../x/sys/unix/zsyscall_openbsd_386.go | 186 +- .../x/sys/unix/zsyscall_openbsd_amd64.go | 186 +- .../x/sys/unix/zsyscall_openbsd_arm.go | 186 +- .../x/sys/unix/zsyscall_solaris_amd64.go | 256 ++ .../x/sys/unix/zsysctl_openbsd_amd64.go | 13 + .../x/sys/unix/zsysnum_freebsd_386.go | 736 ++--- .../x/sys/unix/zsysnum_freebsd_amd64.go | 736 ++--- .../x/sys/unix/zsysnum_freebsd_arm.go | 736 ++--- .../x/sys/unix/zsysnum_linux_386.go | 4 +- .../x/sys/unix/zsysnum_linux_amd64.go | 4 +- .../x/sys/unix/zsysnum_linux_arm.go | 4 +- .../x/sys/unix/zsysnum_linux_arm64.go | 4 +- .../x/sys/unix/zsysnum_linux_mips.go | 4 +- .../x/sys/unix/zsysnum_linux_mips64.go | 4 +- .../x/sys/unix/zsysnum_linux_mips64le.go | 4 +- .../x/sys/unix/zsysnum_linux_mipsle.go | 4 +- .../x/sys/unix/zsysnum_linux_ppc64.go | 4 +- .../x/sys/unix/zsysnum_linux_ppc64le.go | 4 +- .../x/sys/unix/zsysnum_linux_riscv64.go | 287 ++ .../x/sys/unix/zsysnum_linux_s390x.go | 4 +- .../x/sys/unix/zsysnum_openbsd_386.go | 25 +- .../x/sys/unix/zsysnum_openbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm.go | 13 +- .../golang.org/x/sys/unix/ztypes_aix_ppc.go | 345 +++ .../golang.org/x/sys/unix/ztypes_aix_ppc64.go | 354 +++ .../x/sys/unix/ztypes_darwin_386.go | 10 +- .../x/sys/unix/ztypes_darwin_amd64.go | 10 +- .../x/sys/unix/ztypes_darwin_arm.go | 10 +- .../x/sys/unix/ztypes_darwin_arm64.go | 10 +- .../x/sys/unix/ztypes_dragonfly_amd64.go | 27 +- .../x/sys/unix/ztypes_freebsd_386.go | 276 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 294 +- .../x/sys/unix/ztypes_freebsd_arm.go | 298 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 157 +- .../x/sys/unix/ztypes_linux_amd64.go | 159 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 158 +- .../x/sys/unix/ztypes_linux_arm64.go | 159 +- .../x/sys/unix/ztypes_linux_mips.go | 158 +- .../x/sys/unix/ztypes_linux_mips64.go | 159 +- .../x/sys/unix/ztypes_linux_mips64le.go | 159 +- .../x/sys/unix/ztypes_linux_mipsle.go | 158 +- .../x/sys/unix/ztypes_linux_ppc64.go | 159 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 159 +- .../x/sys/unix/ztypes_linux_riscv64.go | 2019 ++++++++++++ .../x/sys/unix/ztypes_linux_s390x.go | 159 +- .../x/sys/unix/ztypes_linux_sparc64.go | 10 +- .../x/sys/unix/ztypes_netbsd_386.go | 27 +- .../x/sys/unix/ztypes_netbsd_amd64.go | 27 +- .../x/sys/unix/ztypes_netbsd_arm.go | 27 +- .../x/sys/unix/ztypes_openbsd_386.go | 120 +- .../x/sys/unix/ztypes_openbsd_amd64.go | 120 +- .../x/sys/unix/ztypes_openbsd_arm.go | 204 +- .../x/sys/unix/ztypes_solaris_amd64.go | 27 +- src/cmd/vendor/vendor.json | 8 +- 171 files changed, 30448 insertions(+), 2489 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/aliases.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/ioctl.go create mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl create mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.pl create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/openbsd_unveil.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_test.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd_test.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_test.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/xattr_bsd.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go diff --git a/src/cmd/vendor/golang.org/x/sys/unix/aliases.go b/src/cmd/vendor/golang.org/x/sys/unix/aliases.go new file mode 100644 index 0000000000000..951fce4d0d93f --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/aliases.go @@ -0,0 +1,14 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +// +build go1.9 + +package unix + +import "syscall" + +type Signal = syscall.Signal +type Errno = syscall.Errno +type SysProcAttr = syscall.SysProcAttr diff --git a/src/cmd/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s b/src/cmd/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s new file mode 100644 index 0000000000000..06f84b8555800 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s @@ -0,0 +1,17 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +#include "textflag.h" + +// +// System calls for ppc64, AIX are implemented in runtime/syscall_aix.go +// + +TEXT ·syscall6(SB),NOSPLIT,$0-88 + JMP syscall·syscall6(SB) + +TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 + JMP syscall·rawSyscall6(SB) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/src/cmd/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s index 649e58714d9cb..88f712557810a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +++ b/src/cmd/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s @@ -15,12 +15,6 @@ // Just jump to package syscall's implementation for all these functions. // The runtime may know about them. -TEXT ·Syscall(SB),NOSPLIT,$0-56 - BR syscall·Syscall(SB) - -TEXT ·Syscall6(SB),NOSPLIT,$0-80 - BR syscall·Syscall6(SB) - TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 BL runtime·entersyscall(SB) MOVD a1+8(FP), R3 @@ -36,12 +30,6 @@ TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 BL runtime·exitsyscall(SB) RET -TEXT ·RawSyscall(SB),NOSPLIT,$0-56 - BR syscall·RawSyscall(SB) - -TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 - BR syscall·RawSyscall6(SB) - TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOVD a1+8(FP), R3 MOVD a2+16(FP), R4 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/constants.go b/src/cmd/vendor/golang.org/x/sys/unix/constants.go index a96f0ebc26446..3a6ac648dd596 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/constants.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/constants.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc.go b/src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc.go new file mode 100644 index 0000000000000..5e5fb451044aa --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc.go @@ -0,0 +1,27 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix +// +build ppc + +// Functions to access/create device major and minor numbers matching the +// encoding used by AIX. + +package unix + +// Major returns the major component of a Linux device number. +func Major(dev uint64) uint32 { + return uint32((dev >> 16) & 0xffff) +} + +// Minor returns the minor component of a Linux device number. +func Minor(dev uint64) uint32 { + return uint32(dev & 0xffff) +} + +// Mkdev returns a Linux device number generated from the given major and minor +// components. +func Mkdev(major, minor uint32) uint64 { + return uint64(((major) << 16) | (minor)) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go new file mode 100644 index 0000000000000..8b401244c419c --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go @@ -0,0 +1,29 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix +// +build ppc64 + +// Functions to access/create device major and minor numbers matching the +// encoding used AIX. + +package unix + +// Major returns the major component of a Linux device number. +func Major(dev uint64) uint32 { + return uint32((dev & 0x3fffffff00000000) >> 32) +} + +// Minor returns the minor component of a Linux device number. +func Minor(dev uint64) uint32 { + return uint32((dev & 0x00000000ffffffff) >> 0) +} + +// Mkdev returns a Linux device number generated from the given major and minor +// components. +func Mkdev(major, minor uint32) uint64 { + var DEVNO64 uint64 + DEVNO64 = 0x8000000000000000 + return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/dirent.go b/src/cmd/vendor/golang.org/x/sys/unix/dirent.go index 95fd353171fa8..4407c505a369c 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/dirent.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/dirent.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/env_unix.go b/src/cmd/vendor/golang.org/x/sys/unix/env_unix.go index 706b3cd1dd30a..84178b0a134a9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/env_unix.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/env_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // Unix environment variables. diff --git a/src/cmd/vendor/golang.org/x/sys/unix/example_test.go b/src/cmd/vendor/golang.org/x/sys/unix/example_test.go index 10619afddec5d..ae008f5ba6cc7 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/example_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/example_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix_test @@ -17,3 +17,14 @@ func ExampleExec() { err := unix.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ()) log.Fatal(err) } + +func ExampleFlock() { + f, _ := os.Create("example.lock") + if err := unix.Flock(int(f.Fd()), unix.LOCK_EX); err != nil { + log.Fatal(err) + } + // Do work here that requires the lock. When finished, release the lock: + if err := unix.Flock(int(f.Fd()), unix.LOCK_UN); err != nil { + log.Fatal(err) + } +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/export_test.go b/src/cmd/vendor/golang.org/x/sys/unix/export_test.go index e8024690dfde5..f8ae0e0e37172 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/export_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/export_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/gccgo.go b/src/cmd/vendor/golang.org/x/sys/unix/gccgo.go index 50062e3c7430e..cd6f5a6133fe8 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/gccgo.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/gccgo.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // +build gccgo +// +build !aix package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/gccgo_c.c b/src/cmd/vendor/golang.org/x/sys/unix/gccgo_c.c index 46523ced65d59..c44730c5e99ff 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/gccgo_c.c +++ b/src/cmd/vendor/golang.org/x/sys/unix/gccgo_c.c @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // +build gccgo +// +build !aix #include #include diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ioctl.go b/src/cmd/vendor/golang.org/x/sys/unix/ioctl.go new file mode 100644 index 0000000000000..f121a8d64b8c8 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/ioctl.go @@ -0,0 +1,30 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + +package unix + +import "runtime" + +// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. +// +// To change fd's window size, the req argument should be TIOCSWINSZ. +func IoctlSetWinsize(fd int, req uint, value *Winsize) error { + // TODO: if we get the chance, remove the req parameter and + // hardcode TIOCSWINSZ. + err := ioctlSetWinsize(fd, req, value) + runtime.KeepAlive(value) + return err +} + +// IoctlSetTermios performs an ioctl on fd with a *Termios. +// +// The req value will usually be TCSETA or TIOCSETA. +func IoctlSetTermios(fd int, req uint, value *Termios) error { + // TODO: if we get the chance, remove the req parameter. + err := ioctlSetTermios(fd, req, value) + runtime.KeepAlive(value) + return err +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh b/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh index 1715122bd4b16..4f92537caa306 100755 --- a/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh +++ b/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh @@ -10,7 +10,7 @@ GOOSARCH="${GOOS}_${GOARCH}" # defaults -mksyscall="./mksyscall.pl" +mksyscall="go run mksyscall.go" mkerrors="./mkerrors.sh" zerrors="zerrors_$GOOSARCH.go" mksysctl="" @@ -59,9 +59,19 @@ _* | *_ | _) echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 exit 1 ;; +aix_ppc) + mkerrors="$mkerrors -maix32" + mksyscall="./mksyscall_aix_ppc.pl -aix" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; +aix_ppc64) + mkerrors="$mkerrors -maix64" + mksyscall="./mksyscall_aix_ppc64.pl -aix" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; darwin_386) mkerrors="$mkerrors -m32" - mksyscall="./mksyscall.pl -l32" + mksyscall="go run mksyscall.go -l32" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; @@ -82,13 +92,13 @@ darwin_arm64) ;; dragonfly_amd64) mkerrors="$mkerrors -m64" - mksyscall="./mksyscall.pl -dragonfly" + mksyscall="go run mksyscall.go -dragonfly" mksysnum="curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_386) mkerrors="$mkerrors -m32" - mksyscall="./mksyscall.pl -l32" + mksyscall="go run mksyscall.go -l32" mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; @@ -99,7 +109,7 @@ freebsd_amd64) ;; freebsd_arm) mkerrors="$mkerrors" - mksyscall="./mksyscall.pl -l32 -arm" + mksyscall="go run mksyscall.go -l32 -arm" mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. @@ -114,19 +124,19 @@ linux_sparc64) ;; netbsd_386) mkerrors="$mkerrors -m32" - mksyscall="./mksyscall.pl -l32 -netbsd" + mksyscall="go run mksyscall.go -l32 -netbsd" mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_amd64) mkerrors="$mkerrors -m64" - mksyscall="./mksyscall.pl -netbsd" + mksyscall="go run mksyscall.go -netbsd" mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_arm) mkerrors="$mkerrors" - mksyscall="./mksyscall.pl -l32 -netbsd -arm" + mksyscall="go run mksyscall.go -l32 -netbsd -arm" mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. @@ -134,21 +144,21 @@ netbsd_arm) ;; openbsd_386) mkerrors="$mkerrors -m32" - mksyscall="./mksyscall.pl -l32 -openbsd" + mksyscall="go run mksyscall.go -l32 -openbsd" mksysctl="./mksysctl_openbsd.pl" mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_amd64) mkerrors="$mkerrors -m64" - mksyscall="./mksyscall.pl -openbsd" + mksyscall="go run mksyscall.go -openbsd" mksysctl="./mksysctl_openbsd.pl" mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_arm) mkerrors="$mkerrors" - mksyscall="./mksyscall.pl -l32 -openbsd -arm" + mksyscall="go run mksyscall.go -l32 -openbsd -arm" mksysctl="./mksysctl_openbsd.pl" mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" # Let the type of C char be signed for making the bare syscall @@ -177,8 +187,14 @@ esac syscall_goos="syscall_bsd.go $syscall_goos" ;; esac - if [ -n "$mksyscall" ]; then echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; fi - ;; + if [ -n "$mksyscall" ]; then + if [ "$GOOSARCH" == "aix_ppc64" ]; then + # aix/ppc64 script generates files instead of writing to stdin. + echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ; + else + echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; + fi + fi esac if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh b/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh index 4a2c5dc9b0968..955dd50f9af17 100755 --- a/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -25,7 +25,11 @@ if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then fi fi -CC=${CC:-cc} +if [[ "$GOOS" = "aix" ]]; then + CC=${CC:-gcc} +else + CC=${CC:-cc} +fi if [[ "$GOOS" = "solaris" ]]; then # Assumes GNU versions of utilities in PATH. @@ -34,6 +38,21 @@ fi uname=$(uname) +includes_AIX=' +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define AF_LOCAL AF_UNIX +' + includes_Darwin=' #define _DARWIN_C_SOURCE #define KERNEL @@ -65,8 +84,10 @@ includes_DragonFly=' #include #include #include +#include #include #include +#include #include #include #include @@ -80,12 +101,13 @@ includes_DragonFly=' ' includes_FreeBSD=' -#include +#include #include #include #include #include #include +#include #include #include #include @@ -165,16 +187,21 @@ struct ltchars { #include #include #include +#include #include #include #include #include #include #include +#include #include #include +#include +#include #include #include +#include #include #include #include @@ -190,10 +217,11 @@ struct ltchars { #include #include #include -#include #include #include #include +#include +#include #include #include @@ -223,13 +251,25 @@ struct ltchars { #define FS_KEY_DESC_PREFIX "fscrypt:" #define FS_KEY_DESC_PREFIX_SIZE 8 #define FS_MAX_KEY_SIZE 64 + +// XDP socket constants do not appear to be picked up otherwise. +// Copied from samples/bpf/xdpsock_user.c. +#ifndef SOL_XDP +#define SOL_XDP 283 +#endif + +#ifndef AF_XDP +#define AF_XDP 44 +#endif ' includes_NetBSD=' #include #include #include +#include #include +#include #include #include #include @@ -255,11 +295,14 @@ includes_OpenBSD=' #include #include #include +#include #include #include +#include #include #include #include +#include #include #include #include @@ -291,6 +334,7 @@ includes_SunOS=' #include #include #include +#include #include #include #include @@ -353,6 +397,7 @@ ccflags="$@" $2 ~ /^EXTATTR_NAMESPACE_NAMES/ || $2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next} + $2 !~ /^ECCAPBITS/ && $2 !~ /^ETH_/ && $2 !~ /^EPROC_/ && $2 !~ /^EQUIV_/ && @@ -388,7 +433,7 @@ ccflags="$@" $2 ~ /^TC[IO](ON|OFF)$/ || $2 ~ /^IN_/ || $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || $2 ~ /^TP_STATUS_/ || $2 ~ /^FALLOC_/ || $2 == "ICMPV6_FILTER" || @@ -399,13 +444,16 @@ ccflags="$@" $2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ || $2 ~ /^HW_MACHINE$/ || $2 ~ /^SYSCTL_VERS/ || + $2 !~ "MNT_BITS" && $2 ~ /^(MS|MNT|UMOUNT)_/ || $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || $2 ~ /^(O|F|E?FD|NAME|S|PTRACE|PT)_/ || + $2 ~ /^KEXEC_/ || $2 ~ /^LINUX_REBOOT_CMD_/ || $2 ~ /^LINUX_REBOOT_MAGIC[12]$/ || + $2 ~ /^MODULE_INIT_/ || $2 !~ "NLA_TYPE_MASK" && - $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P)_/ || + $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || $2 ~ /^TCGET/ || @@ -431,23 +479,29 @@ ccflags="$@" $2 ~ /^PERF_EVENT_IOC_/ || $2 ~ /^SECCOMP_MODE_/ || $2 ~ /^SPLICE_/ || + $2 ~ /^SYNC_FILE_RANGE_/ || $2 !~ /^AUDIT_RECORD_MAGIC/ && - $2 ~ /^[A-Z0-9_]+_MAGIC2?$/ || + $2 !~ /IOC_MAGIC/ && + $2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ || $2 ~ /^(VM|VMADDR)_/ || $2 ~ /^IOCTL_VM_SOCKETS_/ || $2 ~ /^(TASKSTATS|TS)_/ || $2 ~ /^CGROUPSTATS_/ || $2 ~ /^GENL_/ || $2 ~ /^STATX_/ || + $2 ~ /^RENAME/ || + $2 ~ /^UBI_IOC[A-Z]/ || $2 ~ /^UTIME_/ || $2 ~ /^XATTR_(CREATE|REPLACE|NO(DEFAULT|FOLLOW|SECURITY)|SHOWCOMPRESSION)/ || $2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ || $2 ~ /^FSOPT_/ || $2 ~ /^WDIOC_/ || $2 ~ /^NFN/ || + $2 ~ /^XDP_/ || $2 ~ /^(HDIO|WIN|SMART)_/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ || + $2 ~/^PPPIOC/ || $2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} $2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)} @@ -469,7 +523,7 @@ errors=$( signals=$( echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | - egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | + egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | sort ) @@ -479,7 +533,7 @@ echo '#include ' | $CC -x c - -E -dM $ccflags | sort >_error.grep echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | - egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | + egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' | sort >_signal.grep echo '// mkerrors.sh' "$@" diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl new file mode 100755 index 0000000000000..c44de8d310ef4 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl @@ -0,0 +1,384 @@ +#!/usr/bin/env perl +# Copyright 2018 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# This program reads a file containing function prototypes +# (like syscall_aix.go) and generates system call bodies. +# The prototypes are marked by lines beginning with "//sys" +# and read like func declarations if //sys is replaced by func, but: +# * The parameter lists must give a name for each argument. +# This includes return parameters. +# * The parameter lists must give a type for each argument: +# the (x, y, z int) shorthand is not allowed. +# * If the return parameter is an error number, it must be named err. +# * If go func name needs to be different than its libc name, +# * or the function is not in libc, name could be specified +# * at the end, after "=" sign, like +# //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt + +use strict; + +my $cmdline = "mksyscall_aix_ppc.pl " . join(' ', @ARGV); +my $errors = 0; +my $_32bit = ""; +my $tags = ""; # build tags +my $aix = 0; +my $solaris = 0; + +binmode STDOUT; + +if($ARGV[0] eq "-b32") { + $_32bit = "big-endian"; + shift; +} elsif($ARGV[0] eq "-l32") { + $_32bit = "little-endian"; + shift; +} +if($ARGV[0] eq "-aix") { + $aix = 1; + shift; +} +if($ARGV[0] eq "-tags") { + shift; + $tags = $ARGV[0]; + shift; +} + +if($ARGV[0] =~ /^-/) { + print STDERR "usage: mksyscall_aix.pl [-b32 | -l32] [-tags x,y] [file ...]\n"; + exit 1; +} + +sub parseparamlist($) { + my ($list) = @_; + $list =~ s/^\s*//; + $list =~ s/\s*$//; + if($list eq "") { + return (); + } + return split(/\s*,\s*/, $list); +} + +sub parseparam($) { + my ($p) = @_; + if($p !~ /^(\S*) (\S*)$/) { + print STDERR "$ARGV:$.: malformed parameter: $p\n"; + $errors = 1; + return ("xx", "int"); + } + return ($1, $2); +} + +my $package = ""; +my $text = ""; +my $c_extern = "/*\n#include \n#include \n"; +my @vars = (); +while(<>) { + chomp; + s/\s+/ /g; + s/^\s+//; + s/\s+$//; + $package = $1 if !$package && /^package (\S+)$/; + my $nonblock = /^\/\/sysnb /; + next if !/^\/\/sys / && !$nonblock; + + # Line must be of the form + # func Open(path string, mode int, perm int) (fd int, err error) + # Split into name, in params, out params. + if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) { + print STDERR "$ARGV:$.: malformed //sys declaration\n"; + $errors = 1; + next; + } + my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6); + + # Split argument lists on comma. + my @in = parseparamlist($in); + my @out = parseparamlist($out); + + $in = join(', ', @in); + $out = join(', ', @out); + + # Try in vain to keep people from editing this file. + # The theory is that they jump into the middle of the file + # without reading the header. + $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; + + # Check if value return, err return available + my $errvar = ""; + my $retvar = ""; + my $rettype = ""; + foreach my $p (@out) { + my ($name, $type) = parseparam($p); + if($type eq "error") { + $errvar = $name; + } else { + $retvar = $name; + $rettype = $type; + } + } + + # System call name. + #if($func ne "fcntl") { + + if($sysname eq "") { + $sysname = "$func"; + } + + $sysname =~ s/([a-z])([A-Z])/${1}_$2/g; + $sysname =~ y/A-Z/a-z/; # All libc functions are lowercase. + + my $C_rettype = ""; + if($rettype eq "unsafe.Pointer") { + $C_rettype = "uintptr_t"; + } elsif($rettype eq "uintptr") { + $C_rettype = "uintptr_t"; + } elsif($rettype =~ /^_/) { + $C_rettype = "uintptr_t"; + } elsif($rettype eq "int") { + $C_rettype = "int"; + } elsif($rettype eq "int32") { + $C_rettype = "int"; + } elsif($rettype eq "int64") { + $C_rettype = "long long"; + } elsif($rettype eq "uint32") { + $C_rettype = "unsigned int"; + } elsif($rettype eq "uint64") { + $C_rettype = "unsigned long long"; + } else { + $C_rettype = "int"; + } + if($sysname eq "exit") { + $C_rettype = "void"; + } + + # Change types to c + my @c_in = (); + foreach my $p (@in) { + my ($name, $type) = parseparam($p); + if($type =~ /^\*/) { + push @c_in, "uintptr_t"; + } elsif($type eq "string") { + push @c_in, "uintptr_t"; + } elsif($type =~ /^\[\](.*)/) { + push @c_in, "uintptr_t", "size_t"; + } elsif($type eq "unsafe.Pointer") { + push @c_in, "uintptr_t"; + } elsif($type eq "uintptr") { + push @c_in, "uintptr_t"; + } elsif($type =~ /^_/) { + push @c_in, "uintptr_t"; + } elsif($type eq "int") { + push @c_in, "int"; + } elsif($type eq "int32") { + push @c_in, "int"; + } elsif($type eq "int64") { + push @c_in, "long long"; + } elsif($type eq "uint32") { + push @c_in, "unsigned int"; + } elsif($type eq "uint64") { + push @c_in, "unsigned long long"; + } else { + push @c_in, "int"; + } + } + + if ($func ne "fcntl" && $func ne "FcntlInt" && $func ne "readlen" && $func ne "writelen") { + # Imports of system calls from libc + $c_extern .= "$C_rettype $sysname"; + my $c_in = join(', ', @c_in); + $c_extern .= "($c_in);\n"; + } + + # So file name. + if($aix) { + if($modname eq "") { + $modname = "libc.a/shr_64.o"; + } else { + print STDERR "$func: only syscall using libc are available\n"; + $errors = 1; + next; + } + } + + my $strconvfunc = "C.CString"; + my $strconvtype = "*byte"; + + # Go function header. + if($out ne "") { + $out = " ($out)"; + } + if($text ne "") { + $text .= "\n" + } + + $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out ; + + # Prepare arguments to call. + my @args = (); + my $n = 0; + my $arg_n = 0; + foreach my $p (@in) { + my ($name, $type) = parseparam($p); + if($type =~ /^\*/) { + push @args, "C.uintptr_t(uintptr(unsafe.Pointer($name)))"; + } elsif($type eq "string" && $errvar ne "") { + $text .= "\t_p$n := uintptr(unsafe.Pointer($strconvfunc($name)))\n"; + push @args, "C.uintptr_t(_p$n)"; + $n++; + } elsif($type eq "string") { + print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; + $text .= "\t_p$n := uintptr(unsafe.Pointer($strconvfunc($name)))\n"; + push @args, "C.uintptr_t(_p$n)"; + $n++; + } elsif($type =~ /^\[\](.*)/) { + # Convert slice into pointer, length. + # Have to be careful not to take address of &a[0] if len == 0: + # pass nil in that case. + $text .= "\tvar _p$n *$1\n"; + $text .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n"; + push @args, "C.uintptr_t(uintptr(unsafe.Pointer(_p$n)))"; + $n++; + $text .= "\tvar _p$n int\n"; + $text .= "\t_p$n = len($name)\n"; + push @args, "C.size_t(_p$n)"; + $n++; + } elsif($type eq "int64" && $_32bit ne "") { + if($_32bit eq "big-endian") { + push @args, "uintptr($name >> 32)", "uintptr($name)"; + } else { + push @args, "uintptr($name)", "uintptr($name >> 32)"; + } + $n++; + } elsif($type eq "bool") { + $text .= "\tvar _p$n uint32\n"; + $text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n"; + push @args, "_p$n"; + $n++; + } elsif($type =~ /^_/) { + push @args, "C.uintptr_t(uintptr($name))"; + } elsif($type eq "unsafe.Pointer") { + push @args, "C.uintptr_t(uintptr($name))"; + } elsif($type eq "int") { + if (($arg_n == 2) && (($func eq "readlen") || ($func eq "writelen"))) { + push @args, "C.size_t($name)"; + } elsif ($arg_n == 0 && $func eq "fcntl") { + push @args, "C.uintptr_t($name)"; + } elsif (($arg_n == 2) && (($func eq "fcntl") || ($func eq "FcntlInt"))) { + push @args, "C.uintptr_t($name)"; + } else { + push @args, "C.int($name)"; + } + } elsif($type eq "int32") { + push @args, "C.int($name)"; + } elsif($type eq "int64") { + push @args, "C.longlong($name)"; + } elsif($type eq "uint32") { + push @args, "C.uint($name)"; + } elsif($type eq "uint64") { + push @args, "C.ulonglong($name)"; + } elsif($type eq "uintptr") { + push @args, "C.uintptr_t($name)"; + } else { + push @args, "C.int($name)"; + } + $arg_n++; + } + my $nargs = @args; + + + # Determine which form to use; pad args with zeros. + if ($nonblock) { + } + + my $args = join(', ', @args); + my $call = ""; + if ($sysname eq "exit") { + if ($errvar ne "") { + $call .= "er :="; + } else { + $call .= ""; + } + } elsif ($errvar ne "") { + $call .= "r0,er :="; + } elsif ($retvar ne "") { + $call .= "r0,_ :="; + } else { + $call .= "" + } + $call .= "C.$sysname($args)"; + + # Assign return values. + my $body = ""; + my $failexpr = ""; + + for(my $i=0; $i<@out; $i++) { + my $p = $out[$i]; + my ($name, $type) = parseparam($p); + my $reg = ""; + if($name eq "err") { + $reg = "e1"; + } else { + $reg = "r0"; + } + if($reg ne "e1" ) { + $body .= "\t$name = $type($reg)\n"; + } + } + + # verify return + if ($sysname ne "exit" && $errvar ne "") { + if ($C_rettype =~ /^uintptr/) { + $body .= "\tif \(uintptr\(r0\) ==\^uintptr\(0\) && er != nil\) {\n"; + $body .= "\t\t$errvar = er\n"; + $body .= "\t}\n"; + } else { + $body .= "\tif \(r0 ==-1 && er != nil\) {\n"; + $body .= "\t\t$errvar = er\n"; + $body .= "\t}\n"; + } + } elsif ($errvar ne "") { + $body .= "\tif \(er != nil\) {\n"; + $body .= "\t\t$errvar = er\n"; + $body .= "\t}\n"; + } + + $text .= "\t$call\n"; + $text .= $body; + + $text .= "\treturn\n"; + $text .= "}\n"; +} + +if($errors) { + exit 1; +} + +print <) { + chomp; + s/\s+/ /g; + s/^\s+//; + s/\s+$//; + $package = $1 if !$package && /^package (\S+)$/; + my $nonblock = /^\/\/sysnb /; + next if !/^\/\/sys / && !$nonblock; + + # Line must be of the form + # func Open(path string, mode int, perm int) (fd int, err error) + # Split into name, in params, out params. + if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$/) { + print STDERR "$ARGV:$.: malformed //sys declaration\n"; + $errors = 1; + next; + } + my ($nb, $func, $in, $out, $modname, $sysname) = ($1, $2, $3, $4, $5, $6); + + # Split argument lists on comma. + my @in = parseparamlist($in); + my @out = parseparamlist($out); + + $in = join(', ', @in); + $out = join(', ', @out); + + if($sysname eq "") { + $sysname = "$func"; + } + + my $onlyCommon = 0; + if ($func eq "readlen" || $func eq "writelen" || $func eq "FcntlInt" || $func eq "FcntlFlock") { + # This function call another syscall which is already implemented. + # Therefore, the gc and gccgo part must not be generated. + $onlyCommon = 1 + } + + # Try in vain to keep people from editing this file. + # The theory is that they jump into the middle of the file + # without reading the header. + + $textcommon .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; + if (!$onlyCommon) { + $textgccgo .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; + $textgc .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; + } + + + # Check if value return, err return available + my $errvar = ""; + my $retvar = ""; + my $rettype = ""; + foreach my $p (@out) { + my ($name, $type) = parseparam($p); + if($type eq "error") { + $errvar = $name; + } else { + $retvar = $name; + $rettype = $type; + } + } + + + $sysname =~ s/([a-z])([A-Z])/${1}_$2/g; + $sysname =~ y/A-Z/a-z/; # All libc functions are lowercase. + + # GCCGO Prototype return type + my $C_rettype = ""; + if($rettype eq "unsafe.Pointer") { + $C_rettype = "uintptr_t"; + } elsif($rettype eq "uintptr") { + $C_rettype = "uintptr_t"; + } elsif($rettype =~ /^_/) { + $C_rettype = "uintptr_t"; + } elsif($rettype eq "int") { + $C_rettype = "int"; + } elsif($rettype eq "int32") { + $C_rettype = "int"; + } elsif($rettype eq "int64") { + $C_rettype = "long long"; + } elsif($rettype eq "uint32") { + $C_rettype = "unsigned int"; + } elsif($rettype eq "uint64") { + $C_rettype = "unsigned long long"; + } else { + $C_rettype = "int"; + } + if($sysname eq "exit") { + $C_rettype = "void"; + } + + # GCCGO Prototype arguments type + my @c_in = (); + foreach my $i (0 .. $#in) { + my ($name, $type) = parseparam($in[$i]); + if($type =~ /^\*/) { + push @c_in, "uintptr_t"; + } elsif($type eq "string") { + push @c_in, "uintptr_t"; + } elsif($type =~ /^\[\](.*)/) { + push @c_in, "uintptr_t", "size_t"; + } elsif($type eq "unsafe.Pointer") { + push @c_in, "uintptr_t"; + } elsif($type eq "uintptr") { + push @c_in, "uintptr_t"; + } elsif($type =~ /^_/) { + push @c_in, "uintptr_t"; + } elsif($type eq "int") { + if (($i == 0 || $i == 2) && $func eq "fcntl"){ + # These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock + push @c_in, "uintptr_t"; + } else { + push @c_in, "int"; + } + } elsif($type eq "int32") { + push @c_in, "int"; + } elsif($type eq "int64") { + push @c_in, "long long"; + } elsif($type eq "uint32") { + push @c_in, "unsigned int"; + } elsif($type eq "uint64") { + push @c_in, "unsigned long long"; + } else { + push @c_in, "int"; + } + } + + if (!$onlyCommon){ + # GCCGO Prototype Generation + # Imports of system calls from libc + $c_extern .= "$C_rettype $sysname"; + my $c_in = join(', ', @c_in); + $c_extern .= "($c_in);\n"; + } + + # GC Library name + if($modname eq "") { + $modname = "libc.a/shr_64.o"; + } else { + print STDERR "$func: only syscall using libc are available\n"; + $errors = 1; + next; + } + my $sysvarname = "libc_${sysname}"; + + if (!$onlyCommon){ + # GC Runtime import of function to allow cross-platform builds. + $dynimports .= "//go:cgo_import_dynamic ${sysvarname} ${sysname} \"$modname\"\n"; + # GC Link symbol to proc address variable. + $linknames .= "//go:linkname ${sysvarname} ${sysvarname}\n"; + # GC Library proc address variable. + push @vars, $sysvarname; + } + + my $strconvfunc ="BytePtrFromString"; + my $strconvtype = "*byte"; + + # Go function header. + if($out ne "") { + $out = " ($out)"; + } + if($textcommon ne "") { + $textcommon .= "\n" + } + + $textcommon .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out ; + + # Prepare arguments to call. + my @argscommun = (); # Arguments in the commun part + my @argscall = (); # Arguments for call prototype + my @argsgc = (); # Arguments for gc call (with syscall6) + my @argsgccgo = (); # Arguments for gccgo call (with C.name_of_syscall) + my $n = 0; + my $arg_n = 0; + foreach my $p (@in) { + my ($name, $type) = parseparam($p); + if($type =~ /^\*/) { + push @argscommun, "uintptr(unsafe.Pointer($name))"; + push @argscall, "$name uintptr"; + push @argsgc, "$name"; + push @argsgccgo, "C.uintptr_t($name)"; + } elsif($type eq "string" && $errvar ne "") { + $textcommon .= "\tvar _p$n $strconvtype\n"; + $textcommon .= "\t_p$n, $errvar = $strconvfunc($name)\n"; + $textcommon .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; + + push @argscommun, "uintptr(unsafe.Pointer(_p$n))"; + push @argscall, "_p$n uintptr "; + push @argsgc, "_p$n"; + push @argsgccgo, "C.uintptr_t(_p$n)"; + $n++; + } elsif($type eq "string") { + print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; + $textcommon .= "\tvar _p$n $strconvtype\n"; + $textcommon .= "\t_p$n, $errvar = $strconvfunc($name)\n"; + $textcommon .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; + + push @argscommun, "uintptr(unsafe.Pointer(_p$n))"; + push @argscall, "_p$n uintptr"; + push @argsgc, "_p$n"; + push @argsgccgo, "C.uintptr_t(_p$n)"; + $n++; + } elsif($type =~ /^\[\](.*)/) { + # Convert slice into pointer, length. + # Have to be careful not to take address of &a[0] if len == 0: + # pass nil in that case. + $textcommon .= "\tvar _p$n *$1\n"; + $textcommon .= "\tif len($name) > 0 {\n\t\t_p$n = \&$name\[0]\n\t}\n"; + push @argscommun, "uintptr(unsafe.Pointer(_p$n))", "len($name)"; + push @argscall, "_p$n uintptr", "_lenp$n int"; + push @argsgc, "_p$n", "uintptr(_lenp$n)"; + push @argsgccgo, "C.uintptr_t(_p$n)", "C.size_t(_lenp$n)"; + $n++; + } elsif($type eq "int64" && $_32bit ne "") { + print STDERR "$ARGV:$.: $func uses int64 with 32 bits mode. Case not yet implemented\n"; + # if($_32bit eq "big-endian") { + # push @args, "uintptr($name >> 32)", "uintptr($name)"; + # } else { + # push @args, "uintptr($name)", "uintptr($name >> 32)"; + # } + # $n++; + } elsif($type eq "bool") { + print STDERR "$ARGV:$.: $func uses bool. Case not yet implemented\n"; + # $text .= "\tvar _p$n uint32\n"; + # $text .= "\tif $name {\n\t\t_p$n = 1\n\t} else {\n\t\t_p$n = 0\n\t}\n"; + # push @args, "_p$n"; + # $n++; + } elsif($type =~ /^_/ ||$type eq "unsafe.Pointer") { + push @argscommun, "uintptr($name)"; + push @argscall, "$name uintptr"; + push @argsgc, "$name"; + push @argsgccgo, "C.uintptr_t($name)"; + } elsif($type eq "int") { + if (($arg_n == 0 || $arg_n == 2) && ($func eq "fcntl" || $func eq "FcntlInt" || $func eq "FcntlFlock")) { + # These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock + push @argscommun, "uintptr($name)"; + push @argscall, "$name uintptr"; + push @argsgc, "$name"; + push @argsgccgo, "C.uintptr_t($name)"; + } else { + push @argscommun, "$name"; + push @argscall, "$name int"; + push @argsgc, "uintptr($name)"; + push @argsgccgo, "C.int($name)"; + } + } elsif($type eq "int32") { + push @argscommun, "$name"; + push @argscall, "$name int32"; + push @argsgc, "uintptr($name)"; + push @argsgccgo, "C.int($name)"; + } elsif($type eq "int64") { + push @argscommun, "$name"; + push @argscall, "$name int64"; + push @argsgc, "uintptr($name)"; + push @argsgccgo, "C.longlong($name)"; + } elsif($type eq "uint32") { + push @argscommun, "$name"; + push @argscall, "$name uint32"; + push @argsgc, "uintptr($name)"; + push @argsgccgo, "C.uint($name)"; + } elsif($type eq "uint64") { + push @argscommun, "$name"; + push @argscall, "$name uint64"; + push @argsgc, "uintptr($name)"; + push @argsgccgo, "C.ulonglong($name)"; + } elsif($type eq "uintptr") { + push @argscommun, "$name"; + push @argscall, "$name uintptr"; + push @argsgc, "$name"; + push @argsgccgo, "C.uintptr_t($name)"; + } else { + push @argscommun, "int($name)"; + push @argscall, "$name int"; + push @argsgc, "uintptr($name)"; + push @argsgccgo, "C.int($name)"; + } + $arg_n++; + } + my $nargs = @argsgc; + + # COMMUN function generation + my $argscommun = join(', ', @argscommun); + my $callcommun = "call$sysname($argscommun)"; + my @ret = ("_", "_"); + my $body = ""; + my $do_errno = 0; + for(my $i=0; $i<@out; $i++) { + my $p = $out[$i]; + my ($name, $type) = parseparam($p); + my $reg = ""; + if($name eq "err") { + $reg = "e1"; + $ret[1] = $reg; + $do_errno = 1; + } else { + $reg = "r0"; + $ret[0] = $reg; + } + if($type eq "bool") { + $reg = "$reg != 0"; + } + if($reg ne "e1") { + $body .= "\t$name = $type($reg)\n"; + } + } + if ($ret[0] eq "_" && $ret[1] eq "_") { + $textcommon .= "\t$callcommun\n"; + } else { + $textcommon .= "\t$ret[0], $ret[1] := $callcommun\n"; + } + $textcommon .= $body; + + if ($do_errno) { + $textcommon .= "\tif e1 != 0 {\n"; + $textcommon .= "\t\terr = errnoErr(e1)\n"; + $textcommon .= "\t}\n"; + } + $textcommon .= "\treturn\n"; + $textcommon .= "}\n"; + + if ($onlyCommon){ + next + } + # CALL Prototype + my $callProto = sprintf "func call%s(%s) (r1 uintptr, e1 Errno) {\n", $sysname, join(', ', @argscall); + + # GC function generation + my $asm = "syscall6"; + if ($nonblock) { + $asm = "rawSyscall6"; + } + + if(@argsgc <= 6) { + while(@argsgc < 6) { + push @argsgc, "0"; + } + } else { + print STDERR "$ARGV:$.: too many arguments to system call\n"; + } + my $argsgc = join(', ', @argsgc); + my $callgc = "$asm(uintptr(unsafe.Pointer(&$sysvarname)), $nargs, $argsgc)"; + + $textgc .= $callProto; + $textgc .= "\tr1, _, e1 = $callgc\n"; + $textgc .= "\treturn\n}\n"; + + # GCCGO function generation + my $argsgccgo = join(', ', @argsgccgo); + my $callgccgo = "C.$sysname($argsgccgo)"; + $textgccgo .= $callProto; + $textgccgo .= "\tr1 = uintptr($callgccgo)\n"; + $textgccgo .= "\te1 = syscall.GetErrno()\n"; + $textgccgo .= "\treturn\n}\n"; +} + +if($errors) { + exit 1; +} + +# Print zsyscall_aix_ppc64.go +open(my $fcommun, '>', 'zsyscall_aix_ppc64.go'); +my $tofcommun = <', 'zsyscall_aix_ppc64_gc.go'); +my $tofgc = <', 'zsyscall_aix_ppc64_gccgo.go'); +my $tofgccgo = <){ - if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ + if(/^([0-9]+)\s+\S+\s+(?:NO)?STD\s+({ \S+\s+(\w+).*)$/){ my $num = $1; my $proto = $2; my $name = "SYS_$3"; diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mmap_unix_test.go b/src/cmd/vendor/golang.org/x/sys/unix/mmap_unix_test.go index 3258ca328489d..d4c4ef9264daa 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/mmap_unix_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/mmap_unix_test.go @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix_test import ( + "runtime" "testing" "golang.org/x/sys/unix" @@ -23,9 +24,14 @@ func TestMmap(t *testing.T) { b[0] = 42 - if err := unix.Msync(b, unix.MS_SYNC); err != nil { - t.Fatalf("Msync: %v", err) + if runtime.GOOS == "aix" { + t.Skip("msync returns invalid argument for AIX, skipping msync test") + } else { + if err := unix.Msync(b, unix.MS_SYNC); err != nil { + t.Fatalf("Msync: %v", err) + } } + if err := unix.Madvise(b, unix.MADV_DONTNEED); err != nil { t.Fatalf("Madvise: %v", err) } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/openbsd_pledge.go b/src/cmd/vendor/golang.org/x/sys/unix/openbsd_pledge.go index 9b1e86a12bae6..230a36d2490a3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/openbsd_pledge.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/openbsd_pledge.go @@ -8,31 +8,159 @@ package unix import ( + "errors" + "fmt" + "strconv" "syscall" "unsafe" ) -const ( - _SYS_PLEDGE = 108 -) +// Pledge implements the pledge syscall. +// +// The pledge syscall does not accept execpromises on OpenBSD releases +// before 6.3. +// +// execpromises must be empty when Pledge is called on OpenBSD +// releases predating 6.3, otherwise an error will be returned. +// +// For more information see pledge(2). +func Pledge(promises, execpromises string) error { + maj, min, err := majmin() + if err != nil { + return err + } -// Pledge implements the pledge syscall. For more information see pledge(2). -func Pledge(promises string, paths []string) error { - promisesPtr, err := syscall.BytePtrFromString(promises) + err = pledgeAvailable(maj, min, execpromises) if err != nil { return err } - promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil) - if paths != nil { - var pathsPtr []*byte - if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil { + + pptr, err := syscall.BytePtrFromString(promises) + if err != nil { + return err + } + + // This variable will hold either a nil unsafe.Pointer or + // an unsafe.Pointer to a string (execpromises). + var expr unsafe.Pointer + + // If we're running on OpenBSD > 6.2, pass execpromises to the syscall. + if maj > 6 || (maj == 6 && min > 2) { + exptr, err := syscall.BytePtrFromString(execpromises) + if err != nil { return err } - pathsUnsafe = unsafe.Pointer(&pathsPtr[0]) + expr = unsafe.Pointer(exptr) + } + + _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0) + if e != 0 { + return e + } + + return nil +} + +// PledgePromises implements the pledge syscall. +// +// This changes the promises and leaves the execpromises untouched. +// +// For more information see pledge(2). +func PledgePromises(promises string) error { + maj, min, err := majmin() + if err != nil { + return err + } + + err = pledgeAvailable(maj, min, "") + if err != nil { + return err + } + + // This variable holds the execpromises and is always nil. + var expr unsafe.Pointer + + pptr, err := syscall.BytePtrFromString(promises) + if err != nil { + return err + } + + _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0) + if e != 0 { + return e + } + + return nil +} + +// PledgeExecpromises implements the pledge syscall. +// +// This changes the execpromises and leaves the promises untouched. +// +// For more information see pledge(2). +func PledgeExecpromises(execpromises string) error { + maj, min, err := majmin() + if err != nil { + return err + } + + err = pledgeAvailable(maj, min, execpromises) + if err != nil { + return err } - _, _, e := syscall.Syscall(_SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0) + + // This variable holds the promises and is always nil. + var pptr unsafe.Pointer + + exptr, err := syscall.BytePtrFromString(execpromises) + if err != nil { + return err + } + + _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(pptr), uintptr(unsafe.Pointer(exptr)), 0) if e != 0 { return e } + + return nil +} + +// majmin returns major and minor version number for an OpenBSD system. +func majmin() (major int, minor int, err error) { + var v Utsname + err = Uname(&v) + if err != nil { + return + } + + major, err = strconv.Atoi(string(v.Release[0])) + if err != nil { + err = errors.New("cannot parse major version number returned by uname") + return + } + + minor, err = strconv.Atoi(string(v.Release[2])) + if err != nil { + err = errors.New("cannot parse minor version number returned by uname") + return + } + + return +} + +// pledgeAvailable checks for availability of the pledge(2) syscall +// based on the running OpenBSD version. +func pledgeAvailable(maj, min int, execpromises string) error { + // If OpenBSD <= 5.9, pledge is not available. + if (maj == 5 && min != 9) || maj < 5 { + return fmt.Errorf("pledge syscall is not available on OpenBSD %d.%d", maj, min) + } + + // If OpenBSD <= 6.2 and execpromises is not empty, + // return an error - execpromises is not available before 6.3 + if (maj < 6 || (maj == 6 && min <= 2)) && execpromises != "" { + return fmt.Errorf("cannot use execpromises on OpenBSD %d.%d", maj, min) + } + return nil } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/openbsd_test.go b/src/cmd/vendor/golang.org/x/sys/unix/openbsd_test.go index 734d76585753f..3ded960712a21 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/openbsd_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/openbsd_test.go @@ -87,7 +87,7 @@ func TestMain(m *testing.M) { func init() { testProcs["pledge"] = testProc{ func() { - fmt.Println(unix.Pledge("", nil)) + fmt.Println(unix.Pledge("", "")) os.Exit(0) }, func() error { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/openbsd_unveil.go b/src/cmd/vendor/golang.org/x/sys/unix/openbsd_unveil.go new file mode 100644 index 0000000000000..aebc2dc5768f4 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/openbsd_unveil.go @@ -0,0 +1,44 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build openbsd + +package unix + +import ( + "syscall" + "unsafe" +) + +// Unveil implements the unveil syscall. +// For more information see unveil(2). +// Note that the special case of blocking further +// unveil calls is handled by UnveilBlock. +func Unveil(path string, flags string) error { + pathPtr, err := syscall.BytePtrFromString(path) + if err != nil { + return err + } + flagsPtr, err := syscall.BytePtrFromString(flags) + if err != nil { + return err + } + _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) + if e != 0 { + return e + } + return nil +} + +// UnveilBlock blocks future unveil calls. +// For more information see unveil(2). +func UnveilBlock() error { + // Both pointers must be nil. + var pathUnsafe, flagsUnsafe unsafe.Pointer + _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) + if e != 0 { + return e + } + return nil +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/pagesize_unix.go b/src/cmd/vendor/golang.org/x/sys/unix/pagesize_unix.go index 83c85e0196faf..bc2f3629a7a95 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/pagesize_unix.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/pagesize_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // For Unix, get the pagesize from the runtime. diff --git a/src/cmd/vendor/golang.org/x/sys/unix/race0.go b/src/cmd/vendor/golang.org/x/sys/unix/race0.go index dd0820431e9a5..ad026678c7ca9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/race0.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/race0.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly +// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go index bb756ece15853..52b6e225e9ee9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go @@ -2,24 +2,39 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // Socket control messages package unix -import "unsafe" +import ( + "runtime" + "unsafe" +) + +var cmsgAlign = SizeofPtr + +func init() { + switch runtime.GOOS { + case "darwin", "dragonfly", "solaris": + // NOTE: It seems like 64-bit Darwin, DragonFly BSD and + // Solaris kernels still require 32-bit aligned access to + // network subsystem. + if SizeofPtr == 8 { + cmsgAlign = 4 + } + case "openbsd": + // OpenBSD armv7 requires 64-bit alignment. + if runtime.GOARCH == "arm" { + cmsgAlign = 8 + } + } +} // Round the length of a raw sockaddr up to align it properly. func cmsgAlignOf(salen int) int { - salign := sizeofPtr - // NOTE: It seems like 64-bit Darwin, DragonFly BSD and - // Solaris kernels still require 32-bit aligned access to - // network subsystem. - if darwin64Bit || dragonfly64Bit || solaris64Bit { - salign = 4 - } - return (salen + salign - 1) & ^(salign - 1) + return (salen + cmsgAlign - 1) & ^(cmsgAlign - 1) } // CmsgLen returns the value to store in the Len field of the Cmsghdr diff --git a/src/cmd/vendor/golang.org/x/sys/unix/str.go b/src/cmd/vendor/golang.org/x/sys/unix/str.go index 35ed6643536f4..17fb698683132 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/str.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/str.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall.go index ef35fce8041a1..0d4b1d7a20e6a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // Package unix contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go new file mode 100644 index 0000000000000..f8eac1742853d --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -0,0 +1,547 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix + +// Aix system calls. +// This file is compiled as ordinary Go code, +// but it is also input to mksyscall, +// which parses the //sys lines and generates system call stubs. +// Note that sometimes we use a lowercase //sys name and +// wrap it in our own nicer implementation. + +package unix + +import ( + "syscall" + "unsafe" +) + +/* + * Wrapped + */ + +//sys utimes(path string, times *[2]Timeval) (err error) +func Utimes(path string, tv []Timeval) error { + if len(tv) != 2 { + return EINVAL + } + return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) +} + +//sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) +func UtimesNano(path string, ts []Timespec) error { + if len(ts) != 2 { + return EINVAL + } + return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) +} + +func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error { + if ts == nil { + return utimensat(dirfd, path, nil, flags) + } + if len(ts) != 2 { + return EINVAL + } + return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags) +} + +func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) { + if sa.Port < 0 || sa.Port > 0xFFFF { + return nil, 0, EINVAL + } + sa.raw.Family = AF_INET + p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) + p[0] = byte(sa.Port >> 8) + p[1] = byte(sa.Port) + for i := 0; i < len(sa.Addr); i++ { + sa.raw.Addr[i] = sa.Addr[i] + } + return unsafe.Pointer(&sa.raw), SizeofSockaddrInet4, nil +} + +func (sa *SockaddrInet6) sockaddr() (unsafe.Pointer, _Socklen, error) { + if sa.Port < 0 || sa.Port > 0xFFFF { + return nil, 0, EINVAL + } + sa.raw.Family = AF_INET6 + p := (*[2]byte)(unsafe.Pointer(&sa.raw.Port)) + p[0] = byte(sa.Port >> 8) + p[1] = byte(sa.Port) + sa.raw.Scope_id = sa.ZoneId + for i := 0; i < len(sa.Addr); i++ { + sa.raw.Addr[i] = sa.Addr[i] + } + return unsafe.Pointer(&sa.raw), SizeofSockaddrInet6, nil +} + +func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { + name := sa.Name + n := len(name) + if n > len(sa.raw.Path) { + return nil, 0, EINVAL + } + if n == len(sa.raw.Path) && name[0] != '@' { + return nil, 0, EINVAL + } + sa.raw.Family = AF_UNIX + for i := 0; i < n; i++ { + sa.raw.Path[i] = uint8(name[i]) + } + // length is family (uint16), name, NUL. + sl := _Socklen(2) + if n > 0 { + sl += _Socklen(n) + 1 + } + if sa.raw.Path[0] == '@' { + sa.raw.Path[0] = 0 + // Don't count trailing NUL for abstract address. + sl-- + } + + return unsafe.Pointer(&sa.raw), sl, nil +} + +func Getsockname(fd int) (sa Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny + if err = getsockname(fd, &rsa, &len); err != nil { + return + } + return anyToSockaddr(fd, &rsa) +} + +//sys getcwd(buf []byte) (err error) + +const ImplementsGetwd = true + +func Getwd() (ret string, err error) { + for len := uint64(4096); ; len *= 2 { + b := make([]byte, len) + err := getcwd(b) + if err == nil { + i := 0 + for b[i] != 0 { + i++ + } + return string(b[0:i]), nil + } + if err != ERANGE { + return "", err + } + } +} + +func Getcwd(buf []byte) (n int, err error) { + err = getcwd(buf) + if err == nil { + i := 0 + for buf[i] != 0 { + i++ + } + n = i + 1 + } + return +} + +func Getgroups() (gids []int, err error) { + n, err := getgroups(0, nil) + if err != nil { + return nil, err + } + if n == 0 { + return nil, nil + } + + // Sanity check group count. Max is 16 on BSD. + if n < 0 || n > 1000 { + return nil, EINVAL + } + + a := make([]_Gid_t, n) + n, err = getgroups(n, &a[0]) + if err != nil { + return nil, err + } + gids = make([]int, n) + for i, v := range a[0:n] { + gids[i] = int(v) + } + return +} + +func Setgroups(gids []int) (err error) { + if len(gids) == 0 { + return setgroups(0, nil) + } + + a := make([]_Gid_t, len(gids)) + for i, v := range gids { + a[i] = _Gid_t(v) + } + return setgroups(len(a), &a[0]) +} + +/* + * Socket + */ + +//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) + +func Accept(fd int) (nfd int, sa Sockaddr, err error) { + var rsa RawSockaddrAny + var len _Socklen = SizeofSockaddrAny + nfd, err = accept(fd, &rsa, &len) + if nfd == -1 { + return + } + sa, err = anyToSockaddr(fd, &rsa) + if err != nil { + Close(nfd) + nfd = 0 + } + return +} + +func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { + // Recvmsg not implemented on AIX + sa := new(SockaddrUnix) + return -1, -1, -1, sa, ENOSYS +} + +func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) { + _, err = SendmsgN(fd, p, oob, to, flags) + return +} + +func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) { + // SendmsgN not implemented on AIX + return -1, ENOSYS +} + +func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { + switch rsa.Addr.Family { + + case AF_UNIX: + pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) + sa := new(SockaddrUnix) + + // Some versions of AIX have a bug in getsockname (see IV78655). + // We can't rely on sa.Len being set correctly. + n := SizeofSockaddrUnix - 3 // substract leading Family, Len, terminating NUL. + for i := 0; i < n; i++ { + if pp.Path[i] == 0 { + n = i + break + } + } + + bytes := (*[10000]byte)(unsafe.Pointer(&pp.Path[0]))[0:n] + sa.Name = string(bytes) + return sa, nil + + case AF_INET: + pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa)) + sa := new(SockaddrInet4) + p := (*[2]byte)(unsafe.Pointer(&pp.Port)) + sa.Port = int(p[0])<<8 + int(p[1]) + for i := 0; i < len(sa.Addr); i++ { + sa.Addr[i] = pp.Addr[i] + } + return sa, nil + + case AF_INET6: + pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa)) + sa := new(SockaddrInet6) + p := (*[2]byte)(unsafe.Pointer(&pp.Port)) + sa.Port = int(p[0])<<8 + int(p[1]) + sa.ZoneId = pp.Scope_id + for i := 0; i < len(sa.Addr); i++ { + sa.Addr[i] = pp.Addr[i] + } + return sa, nil + } + return nil, EAFNOSUPPORT +} + +func Gettimeofday(tv *Timeval) (err error) { + err = gettimeofday(tv, nil) + return +} + +// TODO +func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + return -1, ENOSYS +} + +//sys getdirent(fd int, buf []byte) (n int, err error) +func ReadDirent(fd int, buf []byte) (n int, err error) { + return getdirent(fd, buf) +} + +//sys wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) +func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) { + var status _C_int + var r Pid_t + err = ERESTART + // AIX wait4 may return with ERESTART errno, while the processus is still + // active. + for err == ERESTART { + r, err = wait4(Pid_t(pid), &status, options, rusage) + } + wpid = int(r) + if wstatus != nil { + *wstatus = WaitStatus(status) + } + return +} + +/* + * Wait + */ + +type WaitStatus uint32 + +func (w WaitStatus) Stopped() bool { return w&0x40 != 0 } +func (w WaitStatus) StopSignal() Signal { + if !w.Stopped() { + return -1 + } + return Signal(w>>8) & 0xFF +} + +func (w WaitStatus) Exited() bool { return w&0xFF == 0 } +func (w WaitStatus) ExitStatus() int { + if !w.Exited() { + return -1 + } + return int((w >> 8) & 0xFF) +} + +func (w WaitStatus) Signaled() bool { return w&0x40 == 0 && w&0xFF != 0 } +func (w WaitStatus) Signal() Signal { + if !w.Signaled() { + return -1 + } + return Signal(w>>16) & 0xFF +} + +func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 } + +func (w WaitStatus) CoreDump() bool { return w&0x200 != 0 } + +func (w WaitStatus) TrapCause() int { return -1 } + +//sys ioctl(fd int, req uint, arg uintptr) (err error) + +// ioctl itself should not be exposed directly, but additional get/set +// functions for specific types are permissible. + +// IoctlSetInt performs an ioctl operation which sets an integer value +// on fd, using the specified request number. +func IoctlSetInt(fd int, req uint, value int) error { + return ioctl(fd, req, uintptr(value)) +} + +func ioctlSetWinsize(fd int, req uint, value *Winsize) error { + return ioctl(fd, req, uintptr(unsafe.Pointer(value))) +} + +func ioctlSetTermios(fd int, req uint, value *Termios) error { + return ioctl(fd, req, uintptr(unsafe.Pointer(value))) +} + +// IoctlGetInt performs an ioctl operation which gets an integer value +// from fd, using the specified request number. +func IoctlGetInt(fd int, req uint) (int, error) { + var value int + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return value, err +} + +func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { + var value Winsize + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +func IoctlGetTermios(fd int, req uint) (*Termios, error) { + var value Termios + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + return &value, err +} + +// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX +// There is no way to create a custom fcntl and to keep //sys fcntl easily, +// Therefore, the programmer must call dup2 instead of fcntl in this case. + +// FcntlInt performs a fcntl syscall on fd with the provided command and argument. +//sys FcntlInt(fd uintptr, cmd int, arg int) (r int,err error) = fcntl + +// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. +//sys FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) = fcntl + +//sys fcntl(fd int, cmd int, arg int) (val int, err error) + +func Flock(fd int, how int) (err error) { + return syscall.Flock(fd, how) +} + +/* + * Direct access + */ + +//sys Acct(path string) (err error) +//sys Chdir(path string) (err error) +//sys Chroot(path string) (err error) +//sys Close(fd int) (err error) +//sys Dup(oldfd int) (fd int, err error) +//sys Exit(code int) +//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) +//sys Fchdir(fd int) (err error) +//sys Fchmod(fd int, mode uint32) (err error) +//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) +//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) +//sys Fdatasync(fd int) (err error) +//sys Fsync(fd int) (err error) +// readdir_r +//sysnb Getpgid(pid int) (pgid int, err error) + +//sys Getpgrp() (pid int) + +//sysnb Getpid() (pid int) +//sysnb Getppid() (ppid int) +//sys Getpriority(which int, who int) (prio int, err error) +//sysnb Getrusage(who int, rusage *Rusage) (err error) +//sysnb Getsid(pid int) (sid int, err error) +//sysnb Kill(pid int, sig Signal) (err error) +//sys Klogctl(typ int, buf []byte) (n int, err error) = syslog +//sys Mkdir(dirfd int, path string, mode uint32) (err error) +//sys Mkdirat(dirfd int, path string, mode uint32) (err error) +//sys Mkfifo(path string, mode uint32) (err error) +//sys Mknod(path string, mode uint32, dev int) (err error) +//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) +//sys Nanosleep(time *Timespec, leftover *Timespec) (err error) +//sys Open(path string, mode int, perm uint32) (fd int, err error) = open64 +//sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) +//sys read(fd int, p []byte) (n int, err error) +//sys Readlink(path string, buf []byte) (n int, err error) +//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) +//sys Setdomainname(p []byte) (err error) +//sys Sethostname(p []byte) (err error) +//sysnb Setpgid(pid int, pgid int) (err error) +//sysnb Setsid() (pid int, err error) +//sysnb Settimeofday(tv *Timeval) (err error) + +//sys Setuid(uid int) (err error) +//sys Setgid(uid int) (err error) + +//sys Setpriority(which int, who int, prio int) (err error) +//sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) +//sys Sync() +//sysnb Times(tms *Tms) (ticks uintptr, err error) +//sysnb Umask(mask int) (oldmask int) +//sysnb Uname(buf *Utsname) (err error) +//TODO umount +// //sys Unmount(target string, flags int) (err error) = umount +//sys Unlink(path string) (err error) +//sys Unlinkat(dirfd int, path string, flags int) (err error) +//sys Ustat(dev int, ubuf *Ustat_t) (err error) +//sys write(fd int, p []byte) (n int, err error) +//sys readlen(fd int, p *byte, np int) (n int, err error) = read +//sys writelen(fd int, p *byte, np int) (n int, err error) = write + +//sys Dup2(oldfd int, newfd int) (err error) +//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = posix_fadvise64 +//sys Fchown(fd int, uid int, gid int) (err error) +//sys Fstat(fd int, stat *Stat_t) (err error) +//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = fstatat +//sys Fstatfs(fd int, buf *Statfs_t) (err error) +//sys Ftruncate(fd int, length int64) (err error) +//sysnb Getegid() (egid int) +//sysnb Geteuid() (euid int) +//sysnb Getgid() (gid int) +//sysnb Getuid() (uid int) +//sys Lchown(path string, uid int, gid int) (err error) +//sys Listen(s int, n int) (err error) +//sys Lstat(path string, stat *Stat_t) (err error) +//sys Pause() (err error) +//sys Pread(fd int, p []byte, offset int64) (n int, err error) = pread64 +//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64 +//TODO Select +// //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) +//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) +//sysnb Setregid(rgid int, egid int) (err error) +//sysnb Setreuid(ruid int, euid int) (err error) +//sys Shutdown(fd int, how int) (err error) +//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) +//sys Stat(path string, stat *Stat_t) (err error) +//sys Statfs(path string, buf *Statfs_t) (err error) +//sys Truncate(path string, length int64) (err error) + +//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) +//sysnb setgroups(n int, list *_Gid_t) (err error) +//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) +//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) +//sysnb socket(domain int, typ int, proto int) (fd int, err error) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) +//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) +//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) +//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) + +//sys munmap(addr uintptr, length uintptr) (err error) + +var mapper = &mmapper{ + active: make(map[*byte][]byte), + mmap: mmap, + munmap: munmap, +} + +func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) { + return mapper.Mmap(fd, offset, length, prot, flags) +} + +func Munmap(b []byte) (err error) { + return mapper.Munmap(b) +} + +//sys Madvise(b []byte, advice int) (err error) +//sys Mprotect(b []byte, prot int) (err error) +//sys Mlock(b []byte) (err error) +//sys Mlockall(flags int) (err error) +//sys Msync(b []byte, flags int) (err error) +//sys Munlock(b []byte) (err error) +//sys Munlockall() (err error) + +//sysnb pipe(p *[2]_C_int) (err error) + +func Pipe(p []int) (err error) { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err = pipe(&pp) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +} + +//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) + +func Poll(fds []PollFd, timeout int) (n int, err error) { + if len(fds) == 0 { + return poll(nil, 0, timeout) + } + return poll(&fds[0], len(fds), timeout) +} + +//sys gettimeofday(tv *Timeval, tzp *Timezone) (err error) +//sysnb Time(t *Time_t) (tt Time_t, err error) +//sys Utime(path string, buf *Utimbuf) (err error) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go new file mode 100644 index 0000000000000..c28af1f86eb4f --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go @@ -0,0 +1,34 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix +// +build ppc + +package unix + +//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 +//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 +//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 + +//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) + +func setTimespec(sec, nsec int64) Timespec { + return Timespec{Sec: int32(sec), Nsec: int32(nsec)} +} + +func setTimeval(sec, usec int64) Timeval { + return Timeval{Sec: int32(sec), Usec: int32(usec)} +} + +func (iov *Iovec) SetLen(length int) { + iov.Len = uint32(length) +} + +func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) +} + +func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go new file mode 100644 index 0000000000000..881cacc6cc566 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go @@ -0,0 +1,34 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix +// +build ppc64 + +package unix + +//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) +//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) +//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek + +//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 + +func setTimespec(sec, nsec int64) Timespec { + return Timespec{Sec: sec, Nsec: nsec} +} + +func setTimeval(sec, usec int64) Timeval { + return Timeval{Sec: int64(sec), Usec: int32(usec)} +} + +func (iov *Iovec) SetLen(length int) { + iov.Len = uint64(length) +} + +func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint32(length) +} + +func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint32(length) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_test.go new file mode 100644 index 0000000000000..6f55c07bd14bd --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_test.go @@ -0,0 +1,162 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix + +package unix_test + +import ( + "os" + "runtime" + "testing" + "time" + + "golang.org/x/sys/unix" +) + +func TestIoctlGetInt(t *testing.T) { + f, err := os.Open("/dev/random") + if err != nil { + t.Fatalf("failed to open device: %v", err) + } + defer f.Close() + + v, err := unix.IoctlGetInt(int(f.Fd()), unix.RNDGETENTCNT) + if err != nil { + t.Fatalf("failed to perform ioctl: %v", err) + } + + t.Logf("%d bits of entropy available", v) +} + +func TestTime(t *testing.T) { + var ut unix.Time_t + ut2, err := unix.Time(&ut) + if err != nil { + t.Fatalf("Time: %v", err) + } + if ut != ut2 { + t.Errorf("Time: return value %v should be equal to argument %v", ut2, ut) + } + + var now time.Time + + for i := 0; i < 10; i++ { + ut, err = unix.Time(nil) + if err != nil { + t.Fatalf("Time: %v", err) + } + + now = time.Now() + + if int64(ut) == now.Unix() { + return + } + } + + t.Errorf("Time: return value %v should be nearly equal to time.Now().Unix() %v", ut, now.Unix()) +} + +func TestUtime(t *testing.T) { + defer chtmpdir(t)() + + touch(t, "file1") + + buf := &unix.Utimbuf{ + Modtime: 12345, + } + + err := unix.Utime("file1", buf) + if err != nil { + t.Fatalf("Utime: %v", err) + } + + fi, err := os.Stat("file1") + if err != nil { + t.Fatal(err) + } + + if fi.ModTime().Unix() != 12345 { + t.Errorf("Utime: failed to change modtime: expected %v, got %v", 12345, fi.ModTime().Unix()) + } +} + +func TestUtimesNanoAt(t *testing.T) { + defer chtmpdir(t)() + + symlink := "symlink1" + defer os.Remove(symlink) + err := os.Symlink("nonexisting", symlink) + if err != nil { + t.Fatal(err) + } + + ts := []unix.Timespec{ + {Sec: 1111, Nsec: 2222}, + {Sec: 3333, Nsec: 4444}, + } + err = unix.UtimesNanoAt(unix.AT_FDCWD, symlink, ts, unix.AT_SYMLINK_NOFOLLOW) + if err != nil { + t.Fatalf("UtimesNanoAt: %v", err) + } + + var st unix.Stat_t + err = unix.Lstat(symlink, &st) + if err != nil { + t.Fatalf("Lstat: %v", err) + } + if runtime.GOARCH == "ppc64" { + if int64(st.Atim.Sec) != int64(ts[0].Sec) || st.Atim.Nsec != int32(ts[0].Nsec) { + t.Errorf("UtimesNanoAt: wrong atime: %v", st.Atim) + } + if int64(st.Mtim.Sec) != int64(ts[1].Sec) || st.Mtim.Nsec != int32(ts[1].Nsec) { + t.Errorf("UtimesNanoAt: wrong mtime: %v", st.Mtim) + } + } else { + if int32(st.Atim.Sec) != int32(ts[0].Sec) || int32(st.Atim.Nsec) != int32(ts[0].Nsec) { + t.Errorf("UtimesNanoAt: wrong atime: %v", st.Atim) + } + if int32(st.Mtim.Sec) != int32(ts[1].Sec) || int32(st.Mtim.Nsec) != int32(ts[1].Nsec) { + t.Errorf("UtimesNanoAt: wrong mtime: %v", st.Mtim) + } + } +} + +func TestPselect(t *testing.T) { + if runtime.GOARCH == "ppc64" { + t.Skip("pselect issue with structure timespec on AIX 7.2 tl0, skipping test") + } + + _, err := unix.Pselect(0, nil, nil, nil, &unix.Timespec{Sec: 0, Nsec: 0}, nil) + if err != nil { + t.Fatalf("Pselect: %v", err) + } + + dur := 2500 * time.Microsecond + ts := unix.NsecToTimespec(int64(dur)) + start := time.Now() + _, err = unix.Pselect(0, nil, nil, nil, &ts, nil) + took := time.Since(start) + if err != nil { + t.Fatalf("Pselect: %v", err) + } + + if took < dur { + t.Errorf("Pselect: timeout should have been at least %v, got %v", dur, took) + } +} + +// stringsFromByteSlice converts a sequence of attributes to a []string. +// On Linux, each entry is a NULL-terminated string. +func stringsFromByteSlice(buf []byte) []string { + var result []string + off := 0 + for i, b := range buf { + if b == 0 { + result = append(result, string(buf[off:i])) + off = i + 1 + } + } + return result +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd.go index 53fb8518237d9..33c8b5f0db728 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -206,7 +206,7 @@ func (sa *SockaddrDatalink) sockaddr() (unsafe.Pointer, _Socklen, error) { return unsafe.Pointer(&sa.raw), SizeofSockaddrDatalink, nil } -func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { +func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_LINK: pp := (*RawSockaddrDatalink)(unsafe.Pointer(rsa)) @@ -286,7 +286,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { Close(nfd) return 0, nil, ECONNABORTED } - sa, err = anyToSockaddr(&rsa) + sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 @@ -306,7 +306,7 @@ func Getsockname(fd int) (sa Sockaddr, err error) { rsa.Addr.Family = AF_UNIX rsa.Addr.Len = SizeofSockaddrUnix } - return anyToSockaddr(&rsa) + return anyToSockaddr(fd, &rsa) } //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) @@ -356,7 +356,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from recvflags = int(msg.Flags) // source address is only specified if the socket is unconnected if rsa.Addr.Family != AF_UNSPEC { - from, err = anyToSockaddr(&rsa) + from, err = anyToSockaddr(fd, &rsa) } return } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd_test.go index 6c4e2aca04b0f..12924cb83dfa3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd_test.go @@ -15,18 +15,14 @@ import ( "golang.org/x/sys/unix" ) -const MNT_WAIT = 1 -const MNT_NOWAIT = 2 - func TestGetfsstat(t *testing.T) { - const flags = MNT_NOWAIT // see golang.org/issue/16937 - n, err := unix.Getfsstat(nil, flags) + n, err := unix.Getfsstat(nil, unix.MNT_NOWAIT) if err != nil { t.Fatal(err) } data := make([]unix.Statfs_t, n) - n2, err := unix.Getfsstat(data, flags) + n2, err := unix.Getfsstat(data, unix.MNT_NOWAIT) if err != nil { t.Fatal(err) } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go index 79e94767deb22..1aabc560d7a5a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -199,7 +199,13 @@ func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { return getxattr(link, attr, xattrPointer(dest), len(dest), 0, XATTR_NOFOLLOW) } -//sys setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) +//sys fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) + +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + return fgetxattr(fd, attr, xattrPointer(dest), len(dest), 0, 0) +} + +//sys setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) func Setxattr(path string, attr string, data []byte, flags int) (err error) { // The parameters for the OS X implementation vary slightly compared to the @@ -235,7 +241,13 @@ func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { return setxattr(link, attr, xattrPointer(data), len(data), 0, flags|XATTR_NOFOLLOW) } -//sys removexattr(path string, attr string, options int) (err error) +//sys fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) + +func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { + return fsetxattr(fd, attr, xattrPointer(data), len(data), 0, 0) +} + +//sys removexattr(path string, attr string, options int) (err error) func Removexattr(path string, attr string) (err error) { // We wrap around and explicitly zero out the options provided to the OS X @@ -248,6 +260,12 @@ func Lremovexattr(link string, attr string) (err error) { return removexattr(link, attr, XATTR_NOFOLLOW) } +//sys fremovexattr(fd int, attr string, options int) (err error) + +func Fremovexattr(fd int, attr string) (err error) { + return fremovexattr(fd, attr, 0) +} + //sys listxattr(path string, dest *byte, size int, options int) (sz int, err error) func Listxattr(path string, dest []byte) (sz int, err error) { @@ -258,6 +276,12 @@ func Llistxattr(link string, dest []byte) (sz int, err error) { return listxattr(link, xattrPointer(dest), len(dest), XATTR_NOFOLLOW) } +//sys flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + return flistxattr(fd, xattrPointer(dest), len(dest), 0) +} + func setattrlistTimes(path string, times []Timespec, flags int) error { _p0, err := BytePtrFromString(path) if err != nil { @@ -313,11 +337,11 @@ func IoctlSetInt(fd int, req uint, value int) error { return ioctl(fd, req, uintptr(value)) } -func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +func ioctlSetWinsize(fd int, req uint, value *Winsize) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } -func IoctlSetTermios(fd int, req uint, value *Termios) error { +func ioctlSetTermios(fd int, req uint, value *Termios) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } @@ -529,10 +553,6 @@ func Uname(uname *Utsname) error { // Watchevent // Waitevent // Modwatch -// Fgetxattr -// Fsetxattr -// Fremovexattr -// Flistxattr // Fsctl // Initgroups // Posix_spawn diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_test.go index 65691d5c1b2f2..7faa295fcefd1 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_test.go @@ -4,6 +4,13 @@ package unix_test +import ( + "os" + "testing" + + "golang.org/x/sys/unix" +) + // stringsFromByteSlice converts a sequence of attributes to a []string. // On Darwin, each entry is a NULL-terminated string. func stringsFromByteSlice(buf []byte) []string { @@ -17,3 +24,40 @@ func stringsFromByteSlice(buf []byte) []string { } return result } + +func TestUtimesNanoAt(t *testing.T) { + defer chtmpdir(t)() + + symlink := "symlink1" + os.Remove(symlink) + err := os.Symlink("nonexisting", symlink) + if err != nil { + t.Fatal(err) + } + + ts := []unix.Timespec{ + {Sec: 1111, Nsec: 2222}, + {Sec: 3333, Nsec: 4444}, + } + err = unix.UtimesNanoAt(unix.AT_FDCWD, symlink, ts, unix.AT_SYMLINK_NOFOLLOW) + if err != nil { + t.Fatalf("UtimesNanoAt: %v", err) + } + + var st unix.Stat_t + err = unix.Lstat(symlink, &st) + if err != nil { + t.Fatalf("Lstat: %v", err) + } + + // Only check Mtimespec, Atimespec might not be supported by the underlying filesystem + expected := ts[1] + if st.Mtimespec.Nsec == 0 { + // Some filesystems only support 1-second time stamp resolution + // and will always set Nsec to 0. + expected.Nsec = 0 + } + if st.Mtimespec != expected { + t.Errorf("UtimesNanoAt: wrong mtime: got %v, expected %v", st.Mtimespec, expected) + } +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index b5072de285353..7565105752ce6 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -87,7 +87,7 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } - sa, err = anyToSockaddr(&rsa) + sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 @@ -143,11 +143,11 @@ func IoctlSetInt(fd int, req uint, value int) error { return ioctl(fd, req, uintptr(value)) } -func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +func ioctlSetWinsize(fd int, req uint, value *Winsize) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } -func IoctlSetTermios(fd int, req uint, value *Termios) error { +func ioctlSetTermios(fd int, req uint, value *Termios) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } @@ -248,11 +248,13 @@ func Uname(uname *Utsname) error { //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) //sys Exit(code int) +//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) //sys Fchflags(fd int, flags int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) +//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) @@ -280,13 +282,17 @@ func Uname(uname *Utsname) error { //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) +//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Mkdir(path string, mode uint32) (err error) +//sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) +//sys Mknodat(fd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) +//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys read(fd int, p []byte) (n int, err error) //sys Readlink(path string, buf []byte) (n int, err error) @@ -312,11 +318,13 @@ func Uname(uname *Utsname) error { //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) //sys Symlink(path string, link string) (err error) +//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Undelete(path string) (err error) //sys Unlink(path string) (err error) +//sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go index ba9df4ac12649..085a808cc63d7 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -13,10 +13,34 @@ package unix import ( - "strings" + "sync" "unsafe" ) +const ( + SYS_FSTAT_FREEBSD12 = 551 // { int fstat(int fd, _Out_ struct stat *sb); } + SYS_FSTATAT_FREEBSD12 = 552 // { int fstatat(int fd, _In_z_ char *path, \ + SYS_GETDIRENTRIES_FREEBSD12 = 554 // { ssize_t getdirentries(int fd, \ + SYS_STATFS_FREEBSD12 = 555 // { int statfs(_In_z_ char *path, \ + SYS_FSTATFS_FREEBSD12 = 556 // { int fstatfs(int fd, \ + SYS_GETFSSTAT_FREEBSD12 = 557 // { int getfsstat( \ + SYS_MKNODAT_FREEBSD12 = 559 // { int mknodat(int fd, _In_z_ char *path, \ +) + +// See https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions.html. +var ( + osreldateOnce sync.Once + osreldate uint32 +) + +// INO64_FIRST from /usr/src/lib/libc/sys/compat-ino64.h +const _ino64First = 1200031 + +func supportsABI(ver uint32) bool { + osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") }) + return osreldate >= ver +} + // SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets. type SockaddrDatalink struct { Len uint8 @@ -58,14 +82,21 @@ func nametomib(name string) (mib []_C_int, err error) { return buf[0 : n/siz], nil } -//sysnb pipe() (r int, w int, err error) - func Pipe(p []int) (err error) { + return Pipe2(p, 0) +} + +//sysnb pipe2(p *[2]_C_int, flags int) (err error) + +func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } - p[0], p[1], err = pipe() - return + var pp [2]_C_int + err := pipe2(&pp, flags) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return err } func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { @@ -89,7 +120,7 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) { if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } - sa, err = anyToSockaddr(&rsa) + sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 @@ -115,17 +146,39 @@ func Getwd() (string, error) { } func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { - var _p0 unsafe.Pointer - var bufsize uintptr + var ( + _p0 unsafe.Pointer + bufsize uintptr + oldBuf []statfs_freebsd11_t + needsConvert bool + ) + if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) + if supportsABI(_ino64First) { + _p0 = unsafe.Pointer(&buf[0]) + bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) + } else { + n := len(buf) + oldBuf = make([]statfs_freebsd11_t, n) + _p0 = unsafe.Pointer(&oldBuf[0]) + bufsize = unsafe.Sizeof(statfs_freebsd11_t{}) * uintptr(n) + needsConvert = true + } + } + var sysno uintptr = SYS_GETFSSTAT + if supportsABI(_ino64First) { + sysno = SYS_GETFSSTAT_FREEBSD12 } - r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) + r0, _, e1 := Syscall(sysno, uintptr(_p0), bufsize, uintptr(flags)) n = int(r0) if e1 != 0 { err = e1 } + if e1 == 0 && needsConvert { + for i := range oldBuf { + buf[i].convertFrom(&oldBuf[i]) + } + } return } @@ -134,225 +187,6 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { return ENOSYS } -// Derive extattr namespace and attribute name - -func xattrnamespace(fullattr string) (ns int, attr string, err error) { - s := strings.IndexByte(fullattr, '.') - if s == -1 { - return -1, "", ENOATTR - } - - namespace := fullattr[0:s] - attr = fullattr[s+1:] - - switch namespace { - case "user": - return EXTATTR_NAMESPACE_USER, attr, nil - case "system": - return EXTATTR_NAMESPACE_SYSTEM, attr, nil - default: - return -1, "", ENOATTR - } -} - -func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) { - if len(dest) > idx { - return unsafe.Pointer(&dest[idx]) - } else { - return unsafe.Pointer(_zero) - } -} - -// FreeBSD implements its own syscalls to handle extended attributes - -func Getxattr(file string, attr string, dest []byte) (sz int, err error) { - d := initxattrdest(dest, 0) - destsize := len(dest) - - nsid, a, err := xattrnamespace(attr) - if err != nil { - return -1, err - } - - return ExtattrGetFile(file, nsid, a, uintptr(d), destsize) -} - -func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { - d := initxattrdest(dest, 0) - destsize := len(dest) - - nsid, a, err := xattrnamespace(attr) - if err != nil { - return -1, err - } - - return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize) -} - -func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { - d := initxattrdest(dest, 0) - destsize := len(dest) - - nsid, a, err := xattrnamespace(attr) - if err != nil { - return -1, err - } - - return ExtattrGetLink(link, nsid, a, uintptr(d), destsize) -} - -// flags are unused on FreeBSD - -func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { - d := unsafe.Pointer(&data[0]) - datasiz := len(data) - - nsid, a, err := xattrnamespace(attr) - if err != nil { - return - } - - _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz) - return -} - -func Setxattr(file string, attr string, data []byte, flags int) (err error) { - d := unsafe.Pointer(&data[0]) - datasiz := len(data) - - nsid, a, err := xattrnamespace(attr) - if err != nil { - return - } - - _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz) - return -} - -func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { - d := unsafe.Pointer(&data[0]) - datasiz := len(data) - - nsid, a, err := xattrnamespace(attr) - if err != nil { - return - } - - _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz) - return -} - -func Removexattr(file string, attr string) (err error) { - nsid, a, err := xattrnamespace(attr) - if err != nil { - return - } - - err = ExtattrDeleteFile(file, nsid, a) - return -} - -func Fremovexattr(fd int, attr string) (err error) { - nsid, a, err := xattrnamespace(attr) - if err != nil { - return - } - - err = ExtattrDeleteFd(fd, nsid, a) - return -} - -func Lremovexattr(link string, attr string) (err error) { - nsid, a, err := xattrnamespace(attr) - if err != nil { - return - } - - err = ExtattrDeleteLink(link, nsid, a) - return -} - -func Listxattr(file string, dest []byte) (sz int, err error) { - d := initxattrdest(dest, 0) - destsiz := len(dest) - - // FreeBSD won't allow you to list xattrs from multiple namespaces - s := 0 - for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { - stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz) - - /* Errors accessing system attrs are ignored so that - * we can implement the Linux-like behavior of omitting errors that - * we don't have read permissions on - * - * Linux will still error if we ask for user attributes on a file that - * we don't have read permissions on, so don't ignore those errors - */ - if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { - continue - } else if e != nil { - return s, e - } - - s += stmp - destsiz -= s - if destsiz < 0 { - destsiz = 0 - } - d = initxattrdest(dest, s) - } - - return s, nil -} - -func Flistxattr(fd int, dest []byte) (sz int, err error) { - d := initxattrdest(dest, 0) - destsiz := len(dest) - - s := 0 - for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { - stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz) - if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { - continue - } else if e != nil { - return s, e - } - - s += stmp - destsiz -= s - if destsiz < 0 { - destsiz = 0 - } - d = initxattrdest(dest, s) - } - - return s, nil -} - -func Llistxattr(link string, dest []byte) (sz int, err error) { - d := initxattrdest(dest, 0) - destsiz := len(dest) - - s := 0 - for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { - stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz) - if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { - continue - } else if e != nil { - return s, e - } - - s += stmp - destsiz -= s - if destsiz < 0 { - destsiz = 0 - } - d = initxattrdest(dest, s) - } - - return s, nil -} - //sys ioctl(fd int, req uint, arg uintptr) (err error) // ioctl itself should not be exposed directly, but additional get/set @@ -364,11 +198,11 @@ func IoctlSetInt(fd int, req uint, value int) error { return ioctl(fd, req, uintptr(value)) } -func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +func ioctlSetWinsize(fd int, req uint, value *Winsize) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } -func IoctlSetTermios(fd int, req uint, value *Termios) error { +func ioctlSetTermios(fd int, req uint, value *Termios) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } @@ -438,6 +272,234 @@ func Uname(uname *Utsname) error { return nil } +func Stat(path string, st *Stat_t) (err error) { + var oldStat stat_freebsd11_t + if supportsABI(_ino64First) { + return fstatat_freebsd12(AT_FDCWD, path, st, 0) + } + err = stat(path, &oldStat) + if err != nil { + return err + } + + st.convertFrom(&oldStat) + return nil +} + +func Lstat(path string, st *Stat_t) (err error) { + var oldStat stat_freebsd11_t + if supportsABI(_ino64First) { + return fstatat_freebsd12(AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW) + } + err = lstat(path, &oldStat) + if err != nil { + return err + } + + st.convertFrom(&oldStat) + return nil +} + +func Fstat(fd int, st *Stat_t) (err error) { + var oldStat stat_freebsd11_t + if supportsABI(_ino64First) { + return fstat_freebsd12(fd, st) + } + err = fstat(fd, &oldStat) + if err != nil { + return err + } + + st.convertFrom(&oldStat) + return nil +} + +func Fstatat(fd int, path string, st *Stat_t, flags int) (err error) { + var oldStat stat_freebsd11_t + if supportsABI(_ino64First) { + return fstatat_freebsd12(fd, path, st, flags) + } + err = fstatat(fd, path, &oldStat, flags) + if err != nil { + return err + } + + st.convertFrom(&oldStat) + return nil +} + +func Statfs(path string, st *Statfs_t) (err error) { + var oldStatfs statfs_freebsd11_t + if supportsABI(_ino64First) { + return statfs_freebsd12(path, st) + } + err = statfs(path, &oldStatfs) + if err != nil { + return err + } + + st.convertFrom(&oldStatfs) + return nil +} + +func Fstatfs(fd int, st *Statfs_t) (err error) { + var oldStatfs statfs_freebsd11_t + if supportsABI(_ino64First) { + return fstatfs_freebsd12(fd, st) + } + err = fstatfs(fd, &oldStatfs) + if err != nil { + return err + } + + st.convertFrom(&oldStatfs) + return nil +} + +func Getdents(fd int, buf []byte) (n int, err error) { + return Getdirentries(fd, buf, nil) +} + +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + if supportsABI(_ino64First) { + return getdirentries_freebsd12(fd, buf, basep) + } + + // The old syscall entries are smaller than the new. Use 1/4 of the original + // buffer size rounded up to DIRBLKSIZ (see /usr/src/lib/libc/sys/getdirentries.c). + oldBufLen := roundup(len(buf)/4, _dirblksiz) + oldBuf := make([]byte, oldBufLen) + n, err = getdirentries(fd, oldBuf, basep) + if err == nil && n > 0 { + n = convertFromDirents11(buf, oldBuf[:n]) + } + return +} + +func Mknod(path string, mode uint32, dev uint64) (err error) { + var oldDev int + if supportsABI(_ino64First) { + return mknodat_freebsd12(AT_FDCWD, path, mode, dev) + } + oldDev = int(dev) + return mknod(path, mode, oldDev) +} + +func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) { + var oldDev int + if supportsABI(_ino64First) { + return mknodat_freebsd12(fd, path, mode, dev) + } + oldDev = int(dev) + return mknodat(fd, path, mode, oldDev) +} + +// round x to the nearest multiple of y, larger or equal to x. +// +// from /usr/include/sys/param.h Macros for counting and rounding. +// #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) +func roundup(x, y int) int { + return ((x + y - 1) / y) * y +} + +func (s *Stat_t) convertFrom(old *stat_freebsd11_t) { + *s = Stat_t{ + Dev: uint64(old.Dev), + Ino: uint64(old.Ino), + Nlink: uint64(old.Nlink), + Mode: old.Mode, + Uid: old.Uid, + Gid: old.Gid, + Rdev: uint64(old.Rdev), + Atim: old.Atim, + Mtim: old.Mtim, + Ctim: old.Ctim, + Birthtim: old.Birthtim, + Size: old.Size, + Blocks: old.Blocks, + Blksize: old.Blksize, + Flags: old.Flags, + Gen: uint64(old.Gen), + } +} + +func (s *Statfs_t) convertFrom(old *statfs_freebsd11_t) { + *s = Statfs_t{ + Version: _statfsVersion, + Type: old.Type, + Flags: old.Flags, + Bsize: old.Bsize, + Iosize: old.Iosize, + Blocks: old.Blocks, + Bfree: old.Bfree, + Bavail: old.Bavail, + Files: old.Files, + Ffree: old.Ffree, + Syncwrites: old.Syncwrites, + Asyncwrites: old.Asyncwrites, + Syncreads: old.Syncreads, + Asyncreads: old.Asyncreads, + // Spare + Namemax: old.Namemax, + Owner: old.Owner, + Fsid: old.Fsid, + // Charspare + // Fstypename + // Mntfromname + // Mntonname + } + + sl := old.Fstypename[:] + n := clen(*(*[]byte)(unsafe.Pointer(&sl))) + copy(s.Fstypename[:], old.Fstypename[:n]) + + sl = old.Mntfromname[:] + n = clen(*(*[]byte)(unsafe.Pointer(&sl))) + copy(s.Mntfromname[:], old.Mntfromname[:n]) + + sl = old.Mntonname[:] + n = clen(*(*[]byte)(unsafe.Pointer(&sl))) + copy(s.Mntonname[:], old.Mntonname[:n]) +} + +func convertFromDirents11(buf []byte, old []byte) int { + const ( + fixedSize = int(unsafe.Offsetof(Dirent{}.Name)) + oldFixedSize = int(unsafe.Offsetof(dirent_freebsd11{}.Name)) + ) + + dstPos := 0 + srcPos := 0 + for dstPos+fixedSize < len(buf) && srcPos+oldFixedSize < len(old) { + dstDirent := (*Dirent)(unsafe.Pointer(&buf[dstPos])) + srcDirent := (*dirent_freebsd11)(unsafe.Pointer(&old[srcPos])) + + reclen := roundup(fixedSize+int(srcDirent.Namlen)+1, 8) + if dstPos+reclen > len(buf) { + break + } + + dstDirent.Fileno = uint64(srcDirent.Fileno) + dstDirent.Off = 0 + dstDirent.Reclen = uint16(reclen) + dstDirent.Type = srcDirent.Type + dstDirent.Pad0 = 0 + dstDirent.Namlen = uint16(srcDirent.Namlen) + dstDirent.Pad1 = 0 + + copy(dstDirent.Name[:], srcDirent.Name[:srcDirent.Namlen]) + padding := buf[dstPos+fixedSize+int(dstDirent.Namlen) : dstPos+reclen] + for i := range padding { + padding[i] = 0 + } + + dstPos += int(dstDirent.Reclen) + srcPos += int(srcDirent.Reclen) + } + + return dstPos +} + /* * Exposed directly */ @@ -477,13 +539,16 @@ func Uname(uname *Utsname) error { //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) -//sys Fstat(fd int, stat *Stat_t) (err error) -//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) -//sys Fstatfs(fd int, stat *Statfs_t) (err error) +//sys fstat(fd int, stat *stat_freebsd11_t) (err error) +//sys fstat_freebsd12(fd int, stat *Stat_t) (err error) +//sys fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) +//sys fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) +//sys fstatfs(fd int, stat *statfs_freebsd11_t) (err error) +//sys fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) -//sys Getdents(fd int, buf []byte) (n int, err error) -//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) +//sys getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) +//sys getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) @@ -505,11 +570,13 @@ func Uname(uname *Utsname) error { //sys Link(path string, link string) (err error) //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) -//sys Lstat(path string, stat *Stat_t) (err error) +//sys lstat(path string, stat *stat_freebsd11_t) (err error) //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) -//sys Mknod(path string, mode uint32, dev int) (err error) +//sys mknod(path string, mode uint32, dev int) (err error) +//sys mknodat(fd int, path string, mode uint32, dev int) (err error) +//sys mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) @@ -539,8 +606,9 @@ func Uname(uname *Utsname) error { //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) -//sys Stat(path string, stat *Stat_t) (err error) -//sys Statfs(path string, stat *Statfs_t) (err error) +//sys stat(path string, stat *stat_freebsd11_t) (err error) +//sys statfs(path string, stat *statfs_freebsd11_t) (err error) +//sys statfs_freebsd12(path string, stat *Statfs_t) (err error) //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) @@ -595,6 +663,7 @@ func Uname(uname *Utsname) error { // Kqueue_portset // Getattrlist // Setattrlist +// Getdents // Getdirentriesattr // Searchfs // Delete @@ -602,14 +671,6 @@ func Uname(uname *Utsname) error { // Watchevent // Waitevent // Modwatch -// Getxattr -// Fgetxattr -// Setxattr -// Fsetxattr -// Removexattr -// Fremovexattr -// Listxattr -// Flistxattr // Fsctl // Initgroups // Posix_spawn diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go index 9908030cbe320..c2c7a000e78e9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -12,6 +12,8 @@ package unix import ( + "encoding/binary" + "net" "syscall" "unsafe" ) @@ -55,17 +57,26 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { // ioctl itself should not be exposed directly, but additional get/set // functions for specific types are permissible. +// IoctlSetPointerInt performs an ioctl operation which sets an +// integer value on fd, using the specified request number. The ioctl +// argument is called with a pointer to the integer value, rather than +// passing the integer value directly. +func IoctlSetPointerInt(fd int, req uint, value int) error { + v := int32(value) + return ioctl(fd, req, uintptr(unsafe.Pointer(&v))) +} + // IoctlSetInt performs an ioctl operation which sets an integer value // on fd, using the specified request number. func IoctlSetInt(fd int, req uint, value int) error { return ioctl(fd, req, uintptr(value)) } -func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +func ioctlSetWinsize(fd int, req uint, value *Winsize) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } -func IoctlSetTermios(fd int, req uint, value *Termios) error { +func ioctlSetTermios(fd int, req uint, value *Termios) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } @@ -489,6 +500,47 @@ func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) { return unsafe.Pointer(&sa.raw), SizeofSockaddrL2, nil } +// SockaddrRFCOMM implements the Sockaddr interface for AF_BLUETOOTH type sockets +// using the RFCOMM protocol. +// +// Server example: +// +// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) +// _ = unix.Bind(fd, &unix.SockaddrRFCOMM{ +// Channel: 1, +// Addr: [6]uint8{0, 0, 0, 0, 0, 0}, // BDADDR_ANY or 00:00:00:00:00:00 +// }) +// _ = Listen(fd, 1) +// nfd, sa, _ := Accept(fd) +// fmt.Printf("conn addr=%v fd=%d", sa.(*unix.SockaddrRFCOMM).Addr, nfd) +// Read(nfd, buf) +// +// Client example: +// +// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) +// _ = Connect(fd, &SockaddrRFCOMM{ +// Channel: 1, +// Addr: [6]byte{0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc}, // CC:BB:AA:33:22:11 +// }) +// Write(fd, []byte(`hello`)) +type SockaddrRFCOMM struct { + // Addr represents a bluetooth address, byte ordering is little-endian. + Addr [6]uint8 + + // Channel is a designated bluetooth channel, only 1-30 are available for use. + // Since Linux 2.6.7 and further zero value is the first available channel. + Channel uint8 + + raw RawSockaddrRFCOMM +} + +func (sa *SockaddrRFCOMM) sockaddr() (unsafe.Pointer, _Socklen, error) { + sa.raw.Family = AF_BLUETOOTH + sa.raw.Channel = sa.Channel + sa.raw.Bdaddr = sa.Addr + return unsafe.Pointer(&sa.raw), SizeofSockaddrRFCOMM, nil +} + // SockaddrCAN implements the Sockaddr interface for AF_CAN type sockets. // The RxID and TxID fields are used for transport protocol addressing in // (CAN_TP16, CAN_TP20, CAN_MCNET, and CAN_ISOTP), they can be left with @@ -651,7 +703,70 @@ func (sa *SockaddrVM) sockaddr() (unsafe.Pointer, _Socklen, error) { return unsafe.Pointer(&sa.raw), SizeofSockaddrVM, nil } -func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { +type SockaddrXDP struct { + Flags uint16 + Ifindex uint32 + QueueID uint32 + SharedUmemFD uint32 + raw RawSockaddrXDP +} + +func (sa *SockaddrXDP) sockaddr() (unsafe.Pointer, _Socklen, error) { + sa.raw.Family = AF_XDP + sa.raw.Flags = sa.Flags + sa.raw.Ifindex = sa.Ifindex + sa.raw.Queue_id = sa.QueueID + sa.raw.Shared_umem_fd = sa.SharedUmemFD + + return unsafe.Pointer(&sa.raw), SizeofSockaddrXDP, nil +} + +// This constant mirrors the #define of PX_PROTO_OE in +// linux/if_pppox.h. We're defining this by hand here instead of +// autogenerating through mkerrors.sh because including +// linux/if_pppox.h causes some declaration conflicts with other +// includes (linux/if_pppox.h includes linux/in.h, which conflicts +// with netinet/in.h). Given that we only need a single zero constant +// out of that file, it's cleaner to just define it by hand here. +const px_proto_oe = 0 + +type SockaddrPPPoE struct { + SID uint16 + Remote net.HardwareAddr + Dev string + raw RawSockaddrPPPoX +} + +func (sa *SockaddrPPPoE) sockaddr() (unsafe.Pointer, _Socklen, error) { + if len(sa.Remote) != 6 { + return nil, 0, EINVAL + } + if len(sa.Dev) > IFNAMSIZ-1 { + return nil, 0, EINVAL + } + + *(*uint16)(unsafe.Pointer(&sa.raw[0])) = AF_PPPOX + // This next field is in host-endian byte order. We can't use the + // same unsafe pointer cast as above, because this value is not + // 32-bit aligned and some architectures don't allow unaligned + // access. + // + // However, the value of px_proto_oe is 0, so we can use + // encoding/binary helpers to write the bytes without worrying + // about the ordering. + binary.BigEndian.PutUint32(sa.raw[2:6], px_proto_oe) + // This field is deliberately big-endian, unlike the previous + // one. The kernel expects SID to be in network byte order. + binary.BigEndian.PutUint16(sa.raw[6:8], sa.SID) + copy(sa.raw[8:14], sa.Remote) + for i := 14; i < 14+IFNAMSIZ; i++ { + sa.raw[i] = 0 + } + copy(sa.raw[14:], sa.Dev) + return unsafe.Pointer(&sa.raw), SizeofSockaddrPPPoX, nil +} + +func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_NETLINK: pp := (*RawSockaddrNetlink)(unsafe.Pointer(rsa)) @@ -728,6 +843,55 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { Port: pp.Port, } return sa, nil + case AF_BLUETOOTH: + proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL) + if err != nil { + return nil, err + } + // only BTPROTO_L2CAP and BTPROTO_RFCOMM can accept connections + switch proto { + case BTPROTO_L2CAP: + pp := (*RawSockaddrL2)(unsafe.Pointer(rsa)) + sa := &SockaddrL2{ + PSM: pp.Psm, + CID: pp.Cid, + Addr: pp.Bdaddr, + AddrType: pp.Bdaddr_type, + } + return sa, nil + case BTPROTO_RFCOMM: + pp := (*RawSockaddrRFCOMM)(unsafe.Pointer(rsa)) + sa := &SockaddrRFCOMM{ + Channel: pp.Channel, + Addr: pp.Bdaddr, + } + return sa, nil + } + case AF_XDP: + pp := (*RawSockaddrXDP)(unsafe.Pointer(rsa)) + sa := &SockaddrXDP{ + Flags: pp.Flags, + Ifindex: pp.Ifindex, + QueueID: pp.Queue_id, + SharedUmemFD: pp.Shared_umem_fd, + } + return sa, nil + case AF_PPPOX: + pp := (*RawSockaddrPPPoX)(unsafe.Pointer(rsa)) + if binary.BigEndian.Uint32(pp[2:6]) != px_proto_oe { + return nil, EINVAL + } + sa := &SockaddrPPPoE{ + SID: binary.BigEndian.Uint16(pp[6:8]), + Remote: net.HardwareAddr(pp[8:14]), + } + for i := 14; i < 14+IFNAMSIZ; i++ { + if pp[i] == 0 { + sa.Dev = string(pp[14:i]) + break + } + } + return sa, nil } return nil, EAFNOSUPPORT } @@ -739,7 +903,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { if err != nil { return } - sa, err = anyToSockaddr(&rsa) + sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 @@ -757,7 +921,7 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { if len > SizeofSockaddrAny { panic("RawSockaddrAny too small") } - sa, err = anyToSockaddr(&rsa) + sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 @@ -771,7 +935,7 @@ func Getsockname(fd int) (sa Sockaddr, err error) { if err = getsockname(fd, &rsa, &len); err != nil { return } - return anyToSockaddr(&rsa) + return anyToSockaddr(fd, &rsa) } func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) { @@ -960,7 +1124,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from recvflags = int(msg.Flags) // source address is only specified if the socket is unconnected if rsa.Addr.Family != AF_UNSPEC { - from, err = anyToSockaddr(&rsa) + from, err = anyToSockaddr(fd, &rsa) } return } @@ -1030,7 +1194,7 @@ func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err erro // The ptrace syscall differs from glibc's ptrace. // Peeks returns the word in *data, not as the return value. - var buf [sizeofPtr]byte + var buf [SizeofPtr]byte // Leading edge. PEEKTEXT/PEEKDATA don't require aligned // access (PEEKUSER warns that it might), but if we don't @@ -1038,12 +1202,12 @@ func ptracePeek(req int, pid int, addr uintptr, out []byte) (count int, err erro // boundary and not get the bytes leading up to the page // boundary. n := 0 - if addr%sizeofPtr != 0 { - err = ptrace(req, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0]))) + if addr%SizeofPtr != 0 { + err = ptrace(req, pid, addr-addr%SizeofPtr, uintptr(unsafe.Pointer(&buf[0]))) if err != nil { return 0, err } - n += copy(out, buf[addr%sizeofPtr:]) + n += copy(out, buf[addr%SizeofPtr:]) out = out[n:] } @@ -1081,15 +1245,15 @@ func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (c // Leading edge. n := 0 - if addr%sizeofPtr != 0 { - var buf [sizeofPtr]byte - err = ptrace(peekReq, pid, addr-addr%sizeofPtr, uintptr(unsafe.Pointer(&buf[0]))) + if addr%SizeofPtr != 0 { + var buf [SizeofPtr]byte + err = ptrace(peekReq, pid, addr-addr%SizeofPtr, uintptr(unsafe.Pointer(&buf[0]))) if err != nil { return 0, err } - n += copy(buf[addr%sizeofPtr:], data) + n += copy(buf[addr%SizeofPtr:], data) word := *((*uintptr)(unsafe.Pointer(&buf[0]))) - err = ptrace(pokeReq, pid, addr-addr%sizeofPtr, word) + err = ptrace(pokeReq, pid, addr-addr%SizeofPtr, word) if err != nil { return 0, err } @@ -1097,19 +1261,19 @@ func ptracePoke(pokeReq int, peekReq int, pid int, addr uintptr, data []byte) (c } // Interior. - for len(data) > sizeofPtr { + for len(data) > SizeofPtr { word := *((*uintptr)(unsafe.Pointer(&data[0]))) err = ptrace(pokeReq, pid, addr+uintptr(n), word) if err != nil { return n, err } - n += sizeofPtr - data = data[sizeofPtr:] + n += SizeofPtr + data = data[SizeofPtr:] } // Trailing edge. if len(data) > 0 { - var buf [sizeofPtr]byte + var buf [SizeofPtr]byte err = ptrace(peekReq, pid, addr+uintptr(n), uintptr(unsafe.Pointer(&buf[0]))) if err != nil { return n, err @@ -1208,9 +1372,11 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri //sys Adjtimex(buf *Timex) (state int, err error) //sys Chdir(path string) (err error) //sys Chroot(path string) (err error) +//sys ClockGetres(clockid int32, res *Timespec) (err error) //sys ClockGettime(clockid int32, time *Timespec) (err error) //sys Close(fd int) (err error) //sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) +//sys DeleteModule(name string, flags int) (err error) //sys Dup(oldfd int) (fd int, err error) //sys Dup3(oldfd int, newfd int, flags int) (err error) //sysnb EpollCreate1(flag int) (fd int, err error) @@ -1223,7 +1389,12 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys fcntl(fd int, cmd int, arg int) (val int, err error) //sys Fdatasync(fd int) (err error) +//sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) +//sys FinitModule(fd int, params string, flags int) (err error) +//sys Flistxattr(fd int, dest []byte) (sz int, err error) //sys Flock(fd int, how int) (err error) +//sys Fremovexattr(fd int, attr string) (err error) +//sys Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) //sys Fsync(fd int) (err error) //sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64 //sysnb Getpgid(pid int) (pgid int, err error) @@ -1241,6 +1412,7 @@ func Getpgrp() (pid int) { //sysnb Getsid(pid int) (sid int, err error) //sysnb Gettid() (tid int) //sys Getxattr(path string, attr string, dest []byte) (sz int, err error) +//sys InitModule(moduleImage []byte, params string) (err error) //sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) //sysnb InotifyInit1(flags int) (fd int, err error) //sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) @@ -1251,6 +1423,7 @@ func Getpgrp() (pid int) { //sys Llistxattr(path string, dest []byte) (sz int, err error) //sys Lremovexattr(path string, attr string) (err error) //sys Lsetxattr(path string, attr string, data []byte, flags int) (err error) +//sys MemfdCreate(name string, flags int) (fd int, err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) @@ -1262,6 +1435,7 @@ func Getpgrp() (pid int) { //sys read(fd int, p []byte) (n int, err error) //sys Removexattr(path string, attr string) (err error) //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) +//sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) //sys RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) //sys Setdomainname(p []byte) (err error) //sys Sethostname(p []byte) (err error) @@ -1329,15 +1503,12 @@ func Munmap(b []byte) (err error) { // Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd, // using the specified flags. func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { - n, _, errno := Syscall6( - SYS_VMSPLICE, - uintptr(fd), - uintptr(unsafe.Pointer(&iovs[0])), - uintptr(len(iovs)), - uintptr(flags), - 0, - 0, - ) + var p unsafe.Pointer + if len(iovs) > 0 { + p = unsafe.Pointer(&iovs[0]) + } + + n, _, errno := Syscall6(SYS_VMSPLICE, uintptr(fd), uintptr(p), uintptr(len(iovs)), uintptr(flags), 0, 0) if errno != 0 { return 0, syscall.Errno(errno) } @@ -1350,10 +1521,70 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 { return EINVAL - } else if flags&(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 { - return EOPNOTSUPP } - return faccessat(dirfd, path, mode) + + // The Linux kernel faccessat system call does not take any flags. + // The glibc faccessat implements the flags itself; see + // https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/faccessat.c;hb=HEAD + // Because people naturally expect syscall.Faccessat to act + // like C faccessat, we do the same. + + if flags == 0 { + return faccessat(dirfd, path, mode) + } + + var st Stat_t + if err := Fstatat(dirfd, path, &st, flags&AT_SYMLINK_NOFOLLOW); err != nil { + return err + } + + mode &= 7 + if mode == 0 { + return nil + } + + var uid int + if flags&AT_EACCESS != 0 { + uid = Geteuid() + } else { + uid = Getuid() + } + + if uid == 0 { + if mode&1 == 0 { + // Root can read and write any file. + return nil + } + if st.Mode&0111 != 0 { + // Root can execute any file that anybody can execute. + return nil + } + return EACCES + } + + var fmode uint32 + if uint32(uid) == st.Uid { + fmode = (st.Mode >> 6) & 7 + } else { + var gid int + if flags&AT_EACCESS != 0 { + gid = Getegid() + } else { + gid = Getgid() + } + + if uint32(gid) == st.Gid { + fmode = (st.Mode >> 3) & 7 + } else { + fmode = st.Mode & 7 + } + } + + if fmode&mode == mode { + return nil + } + + return EACCES } /* @@ -1365,21 +1596,14 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { // Brk // Capget // Capset -// ClockGetres // ClockNanosleep // ClockSettime // Clone -// CreateModule -// DeleteModule // EpollCtlOld // EpollPwait // EpollWaitOld // Execve -// Fgetxattr -// Flistxattr // Fork -// Fremovexattr -// Fsetxattr // Futex // GetKernelSyms // GetMempolicy @@ -1418,7 +1642,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { // Pselect6 // Ptrace // Putpmsg -// QueryModule // Quotactl // Readahead // Readv diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go index 5f9b2454add9b..615f2918adac3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -20,12 +20,26 @@ package unix //sysnb Getgid() (gid int) //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) //sysnb Getuid() (uid int) -//sysnb InotifyInit() (fd int, err error) +//sysnb inotifyInit() (fd int, err error) + +func InotifyInit() (fd int, err error) { + // First try inotify_init1, because Android's seccomp policy blocks the latter. + fd, err = InotifyInit1(0) + if err == ENOSYS { + fd, err = inotifyInit() + } + return +} + //sys Ioperm(from int, num int, on int) (err error) //sys Iopl(level int) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Listen(s int, n int) (err error) -//sys Lstat(path string, stat *Stat_t) (err error) + +func Lstat(path string, stat *Stat_t) (err error) { + return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) +} + //sys Pause() (err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 @@ -160,3 +174,16 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { } return poll(&fds[0], len(fds), timeout) } + +//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) + +func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { + cmdlineLen := len(cmdline) + if cmdlineLen > 0 { + // Account for the additional NULL byte added by + // BytePtrFromString in kexecFileLoad. The kexec_file_load + // syscall expects a NULL-terminated string. + cmdlineLen++ + } + return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 646f295ade0cc..fa5a9a6f64987 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -191,12 +191,9 @@ func Dup2(oldfd int, newfd int) (err error) { return Dup3(oldfd, newfd, 0) } -func Pause() (err error) { - _, _, e1 := Syscall6(SYS_PPOLL, 0, 0, 0, 0, 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return +func Pause() error { + _, err := ppoll(nil, 0, nil, nil) + return err } func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index 0e059248209ca..99e0e999a1af5 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -124,14 +124,13 @@ func Pipe2(p []int, flags int) (err error) { return } +//sysnb pipe() (p1 int, p2 int, err error) + func Pipe(p []int) (err error) { if len(p) != 2 { return EINVAL } - var pp [2]_C_int - err = pipe2(&pp, 0) - p[0] = int(pp[0]) - p[1] = int(pp[1]) + p[0], p[1], err = pipe() return } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go index 8c6720f7f4852..41451854bc01e 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -44,7 +44,6 @@ package unix //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, buf *Statfs_t) (err error) -//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) = SYS_SYNC_FILE_RANGE2 //sys Truncate(path string, length int64) (err error) //sys Ustat(dev int, ubuf *Ustat_t) (err error) //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) @@ -129,3 +128,24 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { } return poll(&fds[0], len(fds), timeout) } + +//sys syncFileRange2(fd int, flags int, off int64, n int64) (err error) = SYS_SYNC_FILE_RANGE2 + +func SyncFileRange(fd int, off int64, n int64, flags int) error { + // The sync_file_range and sync_file_range2 syscalls differ only in the + // order of their arguments. + return syncFileRange2(fd, flags, off, n) +} + +//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) + +func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { + cmdlineLen := len(cmdline) + if cmdlineLen > 0 { + // Account for the additional NULL byte added by + // BytePtrFromString in kexecFileLoad. The kexec_file_load + // syscall expects a NULL-terminated string. + cmdlineLen++ + } + return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go new file mode 100644 index 0000000000000..44aa1227a6c2c --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -0,0 +1,209 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build riscv64,linux + +package unix + +import "unsafe" + +func EpollCreate(size int) (fd int, err error) { + if size <= 0 { + return -1, EINVAL + } + return EpollCreate1(0) +} + +//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) +//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) +//sys Fstatfs(fd int, buf *Statfs_t) (err error) +//sys Ftruncate(fd int, length int64) (err error) +//sysnb Getegid() (egid int) +//sysnb Geteuid() (euid int) +//sysnb Getgid() (gid int) +//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) +//sysnb Getuid() (uid int) +//sys Listen(s int, n int) (err error) +//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 +//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 +//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK + +func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { + var ts *Timespec + if timeout != nil { + ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000} + } + return Pselect(nfd, r, w, e, ts, nil) +} + +//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) +//sysnb Setregid(rgid int, egid int) (err error) +//sysnb Setresgid(rgid int, egid int, sgid int) (err error) +//sysnb Setresuid(ruid int, euid int, suid int) (err error) +//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) +//sysnb Setreuid(ruid int, euid int) (err error) +//sys Shutdown(fd int, how int) (err error) +//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) + +func Stat(path string, stat *Stat_t) (err error) { + return Fstatat(AT_FDCWD, path, stat, 0) +} + +func Lchown(path string, uid int, gid int) (err error) { + return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) +} + +func Lstat(path string, stat *Stat_t) (err error) { + return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) +} + +//sys Statfs(path string, buf *Statfs_t) (err error) +//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) +//sys Truncate(path string, length int64) (err error) + +func Ustat(dev int, ubuf *Ustat_t) (err error) { + return ENOSYS +} + +//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) +//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) +//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) +//sysnb getgroups(n int, list *_Gid_t) (nn int, err error) +//sysnb setgroups(n int, list *_Gid_t) (err error) +//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) +//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) +//sysnb socket(domain int, typ int, proto int) (fd int, err error) +//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) +//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) +//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) +//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) +//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) +//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) +//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) + +//sysnb Gettimeofday(tv *Timeval) (err error) + +func setTimespec(sec, nsec int64) Timespec { + return Timespec{Sec: sec, Nsec: nsec} +} + +func setTimeval(sec, usec int64) Timeval { + return Timeval{Sec: sec, Usec: usec} +} + +func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) { + if tv == nil { + return utimensat(dirfd, path, nil, 0) + } + + ts := []Timespec{ + NsecToTimespec(TimevalToNsec(tv[0])), + NsecToTimespec(TimevalToNsec(tv[1])), + } + return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) +} + +func Time(t *Time_t) (Time_t, error) { + var tv Timeval + err := Gettimeofday(&tv) + if err != nil { + return 0, err + } + if t != nil { + *t = Time_t(tv.Sec) + } + return Time_t(tv.Sec), nil +} + +func Utime(path string, buf *Utimbuf) error { + tv := []Timeval{ + {Sec: buf.Actime}, + {Sec: buf.Modtime}, + } + return Utimes(path, tv) +} + +func utimes(path string, tv *[2]Timeval) (err error) { + if tv == nil { + return utimensat(AT_FDCWD, path, nil, 0) + } + + ts := []Timespec{ + NsecToTimespec(TimevalToNsec(tv[0])), + NsecToTimespec(TimevalToNsec(tv[1])), + } + return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0) +} + +func Pipe(p []int) (err error) { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err = pipe2(&pp, 0) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +} + +//sysnb pipe2(p *[2]_C_int, flags int) (err error) + +func Pipe2(p []int, flags int) (err error) { + if len(p) != 2 { + return EINVAL + } + var pp [2]_C_int + err = pipe2(&pp, flags) + p[0] = int(pp[0]) + p[1] = int(pp[1]) + return +} + +func (r *PtraceRegs) PC() uint64 { return r.Pc } + +func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc } + +func (iov *Iovec) SetLen(length int) { + iov.Len = uint64(length) +} + +func (msghdr *Msghdr) SetControllen(length int) { + msghdr.Controllen = uint64(length) +} + +func (cmsg *Cmsghdr) SetLen(length int) { + cmsg.Len = uint64(length) +} + +func InotifyInit() (fd int, err error) { + return InotifyInit1(0) +} + +func Dup2(oldfd int, newfd int) (err error) { + return Dup3(oldfd, newfd, 0) +} + +func Pause() error { + _, err := ppoll(nil, 0, nil, nil) + return err +} + +func Poll(fds []PollFd, timeout int) (n int, err error) { + var ts *Timespec + if timeout >= 0 { + ts = new(Timespec) + *ts = NsecToTimespec(int64(timeout) * 1e6) + } + if len(fds) == 0 { + return ppoll(nil, 0, ts, nil) + } + return ppoll(&fds[0], len(fds), ts, nil) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index 6e4ee0cf2a175..f52f148f9ff35 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -322,3 +322,16 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { } return poll(&fds[0], len(fds), timeout) } + +//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) + +func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error { + cmdlineLen := len(cmdline) + if cmdlineLen > 0 { + // Account for the additional NULL byte added by + // BytePtrFromString in kexecFileLoad. The kexec_file_load + // syscall expects a NULL-terminated string. + cmdlineLen++ + } + return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_test.go index eed17268b08a1..758efa66e5795 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_test.go @@ -7,6 +7,7 @@ package unix_test import ( + "io/ioutil" "os" "runtime" "runtime/debug" @@ -177,7 +178,7 @@ func TestRlimitAs(t *testing.T) { // should fail. See 'man 2 getrlimit'. _, err = unix.Mmap(-1, 0, 2*unix.Getpagesize(), unix.PROT_NONE, unix.MAP_ANON|unix.MAP_PRIVATE) if err == nil { - t.Fatal("Mmap: unexpectedly suceeded after setting RLIMIT_AS") + t.Fatal("Mmap: unexpectedly succeeded after setting RLIMIT_AS") } err = unix.Setrlimit(unix.RLIMIT_AS, &rlim) @@ -272,6 +273,23 @@ func TestSchedSetaffinity(t *testing.T) { t.Skip("skipping setaffinity tests on android") } + // On a system like ppc64x where some cores can be disabled using ppc64_cpu, + // setaffinity should only be called with enabled cores. The valid cores + // are found from the oldMask, but if none are found then the setaffinity + // tests are skipped. Issue #27875. + if !oldMask.IsSet(cpu) { + newMask.Zero() + for i := 0; i < len(oldMask); i++ { + if oldMask.IsSet(i) { + newMask.Set(i) + break + } + } + if newMask.Count() == 0 { + t.Skip("skipping setaffinity tests if CPU not available") + } + } + err = unix.SchedSetaffinity(0, &newMask) if err != nil { t.Fatalf("SchedSetaffinity: %v", err) @@ -394,19 +412,19 @@ func TestFaccessat(t *testing.T) { defer chtmpdir(t)() touch(t, "file1") - err := unix.Faccessat(unix.AT_FDCWD, "file1", unix.O_RDONLY, 0) + err := unix.Faccessat(unix.AT_FDCWD, "file1", unix.R_OK, 0) if err != nil { t.Errorf("Faccessat: unexpected error: %v", err) } - err = unix.Faccessat(unix.AT_FDCWD, "file1", unix.O_RDONLY, 2) + err = unix.Faccessat(unix.AT_FDCWD, "file1", unix.R_OK, 2) if err != unix.EINVAL { t.Errorf("Faccessat: unexpected error: %v, want EINVAL", err) } - err = unix.Faccessat(unix.AT_FDCWD, "file1", unix.O_RDONLY, unix.AT_EACCESS) - if err != unix.EOPNOTSUPP { - t.Errorf("Faccessat: unexpected error: %v, want EOPNOTSUPP", err) + err = unix.Faccessat(unix.AT_FDCWD, "file1", unix.R_OK, unix.AT_EACCESS) + if err != nil { + t.Errorf("Faccessat: unexpected error: %v", err) } err = os.Symlink("file1", "symlink1") @@ -414,8 +432,53 @@ func TestFaccessat(t *testing.T) { t.Fatal(err) } - err = unix.Faccessat(unix.AT_FDCWD, "symlink1", unix.O_RDONLY, unix.AT_SYMLINK_NOFOLLOW) - if err != unix.EOPNOTSUPP { - t.Errorf("Faccessat: unexpected error: %v, want EOPNOTSUPP", err) + err = unix.Faccessat(unix.AT_FDCWD, "symlink1", unix.R_OK, unix.AT_SYMLINK_NOFOLLOW) + if err != nil { + t.Errorf("Faccessat SYMLINK_NOFOLLOW: unexpected error %v", err) + } + + // We can't really test AT_SYMLINK_NOFOLLOW, because there + // doesn't seem to be any way to change the mode of a symlink. + // We don't test AT_EACCESS because such tests are only + // meaningful if run as root. + + err = unix.Fchmodat(unix.AT_FDCWD, "file1", 0, 0) + if err != nil { + t.Errorf("Fchmodat: unexpected error %v", err) + } + + err = unix.Faccessat(unix.AT_FDCWD, "file1", unix.F_OK, unix.AT_SYMLINK_NOFOLLOW) + if err != nil { + t.Errorf("Faccessat: unexpected error: %v", err) + } + + err = unix.Faccessat(unix.AT_FDCWD, "file1", unix.R_OK, unix.AT_SYMLINK_NOFOLLOW) + if err != unix.EACCES { + if unix.Getuid() != 0 { + t.Errorf("Faccessat: unexpected error: %v, want EACCES", err) + } + } +} + +func TestSyncFileRange(t *testing.T) { + file, err := ioutil.TempFile("", "TestSyncFileRange") + if err != nil { + t.Fatal(err) + } + defer os.Remove(file.Name()) + defer file.Close() + + err = unix.SyncFileRange(int(file.Fd()), 0, 0, 0) + if err == unix.ENOSYS || err == unix.EPERM { + t.Skip("sync_file_range syscall is not available, skipping test") + } else if err != nil { + t.Fatalf("SyncFileRange: %v", err) + } + + // invalid flags + flags := 0xf00 + err = unix.SyncFileRange(int(file.Fd()), 0, 0, flags) + if err != unix.EINVAL { + t.Fatalf("SyncFileRange: unexpected error: %v, want EINVAL", err) } } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 369a2be2dcbde..059327a363b21 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -13,6 +13,7 @@ package unix import ( + "runtime" "syscall" "unsafe" ) @@ -93,6 +94,23 @@ func nametomib(name string) (mib []_C_int, err error) { return mib, nil } +func SysctlClockinfo(name string) (*Clockinfo, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + n := uintptr(SizeofClockinfo) + var ci Clockinfo + if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { + return nil, err + } + if n != SizeofClockinfo { + return nil, EIO + } + return &ci, nil +} + //sysnb pipe() (fd1 int, fd2 int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -145,11 +163,11 @@ func IoctlSetInt(fd int, req uint, value int) error { return ioctl(fd, req, uintptr(value)) } -func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +func ioctlSetWinsize(fd int, req uint, value *Winsize) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } -func IoctlSetTermios(fd int, req uint, value *Termios) error { +func ioctlSetTermios(fd int, req uint, value *Termios) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } @@ -173,6 +191,13 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) { return &value, err } +func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) { + var value Ptmget + err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) + runtime.KeepAlive(value) + return &value, err +} + func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} n := unsafe.Sizeof(uname.Sysname) @@ -233,6 +258,18 @@ func Uname(uname *Utsname) error { //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) //sys Exit(code int) +//sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) +//sys ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) +//sys ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) +//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) +//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE //sys Fchdir(fd int) (err error) @@ -240,6 +277,7 @@ func Uname(uname *Utsname) error { //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) +//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) @@ -264,19 +302,26 @@ func Uname(uname *Utsname) error { //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) +//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Mkdir(path string, mode uint32) (err error) +//sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) +//sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) +//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) +//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) //sys 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) //sys Rename(from string, to string) (err error) +//sys Renameat(fromfd int, from string, tofd int, to string) (err error) //sys Revoke(path string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK @@ -294,10 +339,12 @@ func Uname(uname *Utsname) error { //sysnb Setuid(uid int) (err error) //sys Stat(path string, stat *Stat_t) (err error) //sys Symlink(path string, link string) (err error) +//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Unlink(path string) (err error) +//sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd_test.go new file mode 100644 index 0000000000000..41141f96e699b --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd_test.go @@ -0,0 +1,51 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package unix_test + +import ( + "bytes" + "testing" + + "golang.org/x/sys/unix" +) + +// stringsFromByteSlice converts a sequence of attributes to a []string. +// On NetBSD, each entry consists of a single byte containing the length +// of the attribute name, followed by the attribute name. +// The name is _not_ NULL-terminated. +func stringsFromByteSlice(buf []byte) []string { + var result []string + i := 0 + for i < len(buf) { + next := i + 1 + int(buf[i]) + result = append(result, string(buf[i+1:next])) + i = next + } + return result +} + +func TestSysctlClockinfo(t *testing.T) { + ci, err := unix.SysctlClockinfo("kern.clockrate") + if err != nil { + t.Fatal(err) + } + t.Logf("tick = %v, tickadj = %v, hz = %v, profhz = %v, stathz = %v", + ci.Tick, ci.Tickadj, ci.Hz, ci.Profhz, ci.Stathz) +} + +func TestIoctlPtmget(t *testing.T) { + fd, err := unix.Open("/dev/ptmx", unix.O_NOCTTY|unix.O_RDWR, 0666) + if err != nil { + t.Skip("failed to open /dev/ptmx, skipping test") + } + defer unix.Close(fd) + + ptm, err := unix.IoctlGetPtmget(fd, unix.TIOCPTSNAME) + if err != nil { + t.Fatalf("IoctlGetPtmget: %v\n", err) + } + + t.Logf("sfd = %v, ptsname = %v", ptm.Sfd, string(ptm.Sn[:bytes.IndexByte(ptm.Sn[:], 0)])) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 9fc9c06a08b09..5a398f8170f96 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -43,6 +43,23 @@ func nametomib(name string) (mib []_C_int, err error) { return nil, EINVAL } +func SysctlUvmexp(name string) (*Uvmexp, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + n := uintptr(SizeofUvmexp) + var u Uvmexp + if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil { + return nil, err + } + if n != SizeofUvmexp { + return nil, EIO + } + return &u, nil +} + //sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -113,11 +130,11 @@ func IoctlSetInt(fd int, req uint, value int) error { return ioctl(fd, req, uintptr(value)) } -func IoctlSetWinsize(fd int, req uint, value *Winsize) error { +func ioctlSetWinsize(fd int, req uint, value *Winsize) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } -func IoctlSetTermios(fd int, req uint, value *Termios) error { +func ioctlSetTermios(fd int, req uint, value *Termios) error { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } @@ -141,6 +158,15 @@ func IoctlGetTermios(fd int, req uint) (*Termios, error) { return &value, err } +//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) + +func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + if len(fds) == 0 { + return ppoll(nil, 0, timeout, sigmask) + } + return ppoll(&fds[0], len(fds), timeout, sigmask) +} + func Uname(uname *Utsname) error { mib := []_C_int{CTL_KERN, KERN_OSTYPE} n := unsafe.Sizeof(uname.Sysname) @@ -207,6 +233,7 @@ func Uname(uname *Utsname) error { //sys Fchmod(fd int, mode uint32) (err error) //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchown(fd int, uid int, gid int) (err error) +//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) @@ -233,19 +260,26 @@ func Uname(uname *Utsname) error { //sys Kqueue() (fd int, err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) +//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) //sys Lstat(path string, stat *Stat_t) (err error) //sys Mkdir(path string, mode uint32) (err error) +//sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) +//sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) +//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) +//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) //sys Pathconf(path string, name int) (val int, err error) //sys Pread(fd int, p []byte, offset int64) (n int, err error) //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) //sys 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) //sys Rename(from string, to string) (err error) +//sys Renameat(fromfd int, from string, tofd int, to string) (err error) //sys Revoke(path string) (err error) //sys Rmdir(path string) (err error) //sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK @@ -268,10 +302,12 @@ func Uname(uname *Utsname) error { //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) //sys Symlink(path string, link string) (err error) +//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) //sys Truncate(path string, length int64) (err error) //sys Umask(newmask int) (oldmask int) //sys Unlink(path string) (err error) +//sys Unlinkat(dirfd int, path string, flags int) (err error) //sys Unmount(path string, flags int) (err error) //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) @@ -294,15 +330,11 @@ func Uname(uname *Utsname) error { // clock_settime // closefrom // execve -// faccessat -// fchmodat -// fchownat // fcntl // fhopen // fhstat // fhstatfs // fork -// fstatat // futimens // getfh // getgid @@ -316,12 +348,8 @@ func Uname(uname *Utsname) error { // lfs_markv // lfs_segclean // lfs_segwait -// linkat // mincore // minherit -// mkdirat -// mkfifoat -// mknodat // mount // mquery // msgctl @@ -330,12 +358,10 @@ func Uname(uname *Utsname) error { // msgsnd // nfssvc // nnpfspioctl -// openat // preadv // profil // pwritev // quotactl -// readlinkat // readv // reboot // renameat @@ -356,13 +382,11 @@ func Uname(uname *Utsname) error { // sigprocmask // sigreturn // sigsuspend -// symlinkat // sysarch // syscall // threxit // thrsigdivert // thrsleep // thrwakeup -// unlinkat // vfork // writev diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go index 994964a9164d8..d62da60d1ff52 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go @@ -31,3 +31,7 @@ func (msghdr *Msghdr) SetControllen(length int) { func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } + +// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions +// of openbsd/386 the syscall is called sysctl instead of __sysctl. +const SYS___SYSCTL = SYS_SYSCTL diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go index 59844f5041104..5d812aaea53e3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go @@ -31,3 +31,7 @@ func (msghdr *Msghdr) SetControllen(length int) { func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } + +// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions +// of openbsd/arm the syscall is called sysctl instead of __sysctl. +const SYS___SYSCTL = SYS_SYSCTL diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_test.go new file mode 100644 index 0000000000000..b95f334e196d3 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_test.go @@ -0,0 +1,49 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package unix_test + +import ( + "testing" + "time" + + "golang.org/x/sys/unix" +) + +func TestPpoll(t *testing.T) { + f, cleanup := mktmpfifo(t) + defer cleanup() + + const timeout = 100 * time.Millisecond + + ok := make(chan bool, 1) + go func() { + select { + case <-time.After(10 * timeout): + t.Errorf("Ppoll: failed to timeout after %d", 10*timeout) + case <-ok: + } + }() + + fds := []unix.PollFd{{Fd: int32(f.Fd()), Events: unix.POLLIN}} + timeoutTs := unix.NsecToTimespec(int64(timeout)) + n, err := unix.Ppoll(fds, &timeoutTs, nil) + ok <- true + if err != nil { + t.Errorf("Ppoll: unexpected error: %v", err) + return + } + if n != 0 { + t.Errorf("Ppoll: wrong number of events: got %v, expected %v", n, 0) + return + } +} + +func TestSysctlUvmexp(t *testing.T) { + uvm, err := unix.SysctlUvmexp("vm.uvmexp") + if err != nil { + t.Fatal(err) + } + t.Logf("free = %v", uvm.Free) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go index 820ef77af279c..53b8078282eab 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -112,7 +112,7 @@ func Getsockname(fd int) (sa Sockaddr, err error) { if err = getsockname(fd, &rsa, &len); err != nil { return } - return anyToSockaddr(&rsa) + return anyToSockaddr(fd, &rsa) } // GetsockoptString returns the string value of the socket option opt for the @@ -360,7 +360,7 @@ func Futimes(fd int, tv []Timeval) error { return futimesat(fd, nil, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } -func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { +func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_UNIX: pp := (*RawSockaddrUnix)(unsafe.Pointer(rsa)) @@ -411,7 +411,7 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) { if nfd == -1 { return } - sa, err = anyToSockaddr(&rsa) + sa, err = anyToSockaddr(fd, &rsa) if err != nil { Close(nfd) nfd = 0 @@ -448,7 +448,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from oobn = int(msg.Accrightslen) // source address is only specified if the socket is unconnected if rsa.Addr.Family != AF_UNSPEC { - from, err = anyToSockaddr(&rsa) + from, err = anyToSockaddr(fd, &rsa) } return } @@ -540,11 +540,11 @@ func IoctlSetInt(fd int, req uint, value int) (err error) { return ioctl(fd, req, uintptr(value)) } -func IoctlSetWinsize(fd int, req uint, value *Winsize) (err error) { +func ioctlSetWinsize(fd int, req uint, value *Winsize) (err error) { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } -func IoctlSetTermios(fd int, req uint, value *Termios) (err error) { +func ioctlSetTermios(fd int, req uint, value *Termios) (err error) { return ioctl(fd, req, uintptr(unsafe.Pointer(value))) } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_test.go index a8eef7cf8301b..dc857840a436c 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix_test diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go index b835bad0fe473..a21486f658c6d 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -2,13 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix import ( "bytes" - "runtime" "sort" "sync" "syscall" @@ -21,13 +20,6 @@ var ( Stderr = 2 ) -const ( - darwin64Bit = runtime.GOOS == "darwin" && sizeofPtr == 8 - dragonfly64Bit = runtime.GOOS == "dragonfly" && sizeofPtr == 8 - netbsd32Bit = runtime.GOOS == "netbsd" && sizeofPtr == 4 - solaris64Bit = runtime.GOOS == "solaris" && sizeofPtr == 8 -) - // Do the interface allocations only once for common // Errno values. var ( @@ -219,7 +211,7 @@ func Getpeername(fd int) (sa Sockaddr, err error) { if err = getpeername(fd, &rsa, &len); err != nil { return } - return anyToSockaddr(&rsa) + return anyToSockaddr(fd, &rsa) } func GetsockoptByte(fd, level, opt int) (value byte, err error) { @@ -291,7 +283,7 @@ func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) { return } if rsa.Addr.Family != AF_UNSPEC { - from, err = anyToSockaddr(&rsa) + from, err = anyToSockaddr(fd, &rsa) } return } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc.go index 4cb8e8edf1a19..1c70d1b6902b1 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc.go @@ -3,7 +3,7 @@ // license that can be found in the LICENSE file. // +build darwin dragonfly freebsd linux netbsd openbsd solaris -// +build !gccgo +// +build !gccgo,!ppc64le,!ppc64 package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go new file mode 100644 index 0000000000000..86dc765aba3e6 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go @@ -0,0 +1,24 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux +// +build ppc64le ppc64 +// +build !gccgo + +package unix + +import "syscall" + +func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { + return syscall.Syscall(trap, a1, a2, a3) +} +func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { + return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) +} +func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { + return syscall.RawSyscall(trap, a1, a2, a3) +} +func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { + return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go index d694990dbe017..0a28f6e5d48c2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix_test @@ -146,6 +146,9 @@ func TestPassFD(t *testing.T) { if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { t.Skip("cannot exec subprocess on iOS, skipping test") } + if runtime.GOOS == "aix" { + t.Skip("getsockname issue on AIX 7.2 tl1, skipping test") + } if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" { passFDChild() @@ -450,9 +453,9 @@ func TestGetwd(t *testing.T) { t.Fatalf("Open .: %s", err) } defer fd.Close() - // These are chosen carefully not to be symlinks on a Mac - // (unlike, say, /var, /etc) - dirs := []string{"/", "/usr/bin"} + // Directory list for test. Do not worry if any are symlinks or do not + // exist on some common unix desktop environments. That will be checked. + dirs := []string{"/", "/usr/bin", "/etc", "/var", "/opt"} switch runtime.GOOS { case "android": dirs = []string{"/", "/system/bin"} @@ -472,6 +475,17 @@ func TestGetwd(t *testing.T) { } oldwd := os.Getenv("PWD") for _, d := range dirs { + // Check whether d exists, is a dir and that d's path does not contain a symlink + fi, err := os.Stat(d) + if err != nil || !fi.IsDir() { + t.Logf("Test dir %s stat error (%v) or not a directory, skipping", d, err) + continue + } + check, err := filepath.EvalSymlinks(d) + if err != nil || check != d { + t.Logf("Test dir %s (%s) is symlink or other error (%v), skipping", d, check, err) + continue + } err = os.Chdir(d) if err != nil { t.Fatalf("Chdir: %v", err) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/timestruct.go b/src/cmd/vendor/golang.org/x/sys/unix/timestruct.go index 47b9011ee9636..4a672f56942ab 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/timestruct.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/timestruct.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/timestruct_test.go b/src/cmd/vendor/golang.org/x/sys/unix/timestruct_test.go index 4215f46d197c3..1a72fdb362af9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/timestruct_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/timestruct_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd solaris +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix_test diff --git a/src/cmd/vendor/golang.org/x/sys/unix/xattr_bsd.go b/src/cmd/vendor/golang.org/x/sys/unix/xattr_bsd.go new file mode 100644 index 0000000000000..30c1d71f4eddb --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/xattr_bsd.go @@ -0,0 +1,240 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build freebsd netbsd + +package unix + +import ( + "strings" + "unsafe" +) + +// Derive extattr namespace and attribute name + +func xattrnamespace(fullattr string) (ns int, attr string, err error) { + s := strings.IndexByte(fullattr, '.') + if s == -1 { + return -1, "", ENOATTR + } + + namespace := fullattr[0:s] + attr = fullattr[s+1:] + + switch namespace { + case "user": + return EXTATTR_NAMESPACE_USER, attr, nil + case "system": + return EXTATTR_NAMESPACE_SYSTEM, attr, nil + default: + return -1, "", ENOATTR + } +} + +func initxattrdest(dest []byte, idx int) (d unsafe.Pointer) { + if len(dest) > idx { + return unsafe.Pointer(&dest[idx]) + } else { + return unsafe.Pointer(_zero) + } +} + +// FreeBSD and NetBSD implement their own syscalls to handle extended attributes + +func Getxattr(file string, attr string, dest []byte) (sz int, err error) { + d := initxattrdest(dest, 0) + destsize := len(dest) + + nsid, a, err := xattrnamespace(attr) + if err != nil { + return -1, err + } + + return ExtattrGetFile(file, nsid, a, uintptr(d), destsize) +} + +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + d := initxattrdest(dest, 0) + destsize := len(dest) + + nsid, a, err := xattrnamespace(attr) + if err != nil { + return -1, err + } + + return ExtattrGetFd(fd, nsid, a, uintptr(d), destsize) +} + +func Lgetxattr(link string, attr string, dest []byte) (sz int, err error) { + d := initxattrdest(dest, 0) + destsize := len(dest) + + nsid, a, err := xattrnamespace(attr) + if err != nil { + return -1, err + } + + return ExtattrGetLink(link, nsid, a, uintptr(d), destsize) +} + +// flags are unused on FreeBSD + +func Fsetxattr(fd int, attr string, data []byte, flags int) (err error) { + var d unsafe.Pointer + if len(data) > 0 { + d = unsafe.Pointer(&data[0]) + } + datasiz := len(data) + + nsid, a, err := xattrnamespace(attr) + if err != nil { + return + } + + _, err = ExtattrSetFd(fd, nsid, a, uintptr(d), datasiz) + return +} + +func Setxattr(file string, attr string, data []byte, flags int) (err error) { + var d unsafe.Pointer + if len(data) > 0 { + d = unsafe.Pointer(&data[0]) + } + datasiz := len(data) + + nsid, a, err := xattrnamespace(attr) + if err != nil { + return + } + + _, err = ExtattrSetFile(file, nsid, a, uintptr(d), datasiz) + return +} + +func Lsetxattr(link string, attr string, data []byte, flags int) (err error) { + var d unsafe.Pointer + if len(data) > 0 { + d = unsafe.Pointer(&data[0]) + } + datasiz := len(data) + + nsid, a, err := xattrnamespace(attr) + if err != nil { + return + } + + _, err = ExtattrSetLink(link, nsid, a, uintptr(d), datasiz) + return +} + +func Removexattr(file string, attr string) (err error) { + nsid, a, err := xattrnamespace(attr) + if err != nil { + return + } + + err = ExtattrDeleteFile(file, nsid, a) + return +} + +func Fremovexattr(fd int, attr string) (err error) { + nsid, a, err := xattrnamespace(attr) + if err != nil { + return + } + + err = ExtattrDeleteFd(fd, nsid, a) + return +} + +func Lremovexattr(link string, attr string) (err error) { + nsid, a, err := xattrnamespace(attr) + if err != nil { + return + } + + err = ExtattrDeleteLink(link, nsid, a) + return +} + +func Listxattr(file string, dest []byte) (sz int, err error) { + d := initxattrdest(dest, 0) + destsiz := len(dest) + + // FreeBSD won't allow you to list xattrs from multiple namespaces + s := 0 + for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { + stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz) + + /* Errors accessing system attrs are ignored so that + * we can implement the Linux-like behavior of omitting errors that + * we don't have read permissions on + * + * Linux will still error if we ask for user attributes on a file that + * we don't have read permissions on, so don't ignore those errors + */ + if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { + continue + } else if e != nil { + return s, e + } + + s += stmp + destsiz -= s + if destsiz < 0 { + destsiz = 0 + } + d = initxattrdest(dest, s) + } + + return s, nil +} + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + d := initxattrdest(dest, 0) + destsiz := len(dest) + + s := 0 + for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { + stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz) + if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { + continue + } else if e != nil { + return s, e + } + + s += stmp + destsiz -= s + if destsiz < 0 { + destsiz = 0 + } + d = initxattrdest(dest, s) + } + + return s, nil +} + +func Llistxattr(link string, dest []byte) (sz int, err error) { + d := initxattrdest(dest, 0) + destsiz := len(dest) + + s := 0 + for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} { + stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz) + if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER { + continue + } else if e != nil { + return s, e + } + + s += stmp + destsiz -= s + if destsiz < 0 { + destsiz = 0 + } + d = initxattrdest(dest, s) + } + + return s, nil +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/xattr_test.go b/src/cmd/vendor/golang.org/x/sys/unix/xattr_test.go index b8b28d0c119e9..57fc84fb0f870 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/xattr_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/xattr_test.go @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin freebsd linux +// +build darwin freebsd linux netbsd package unix_test import ( + "io/ioutil" "os" "runtime" "strings" @@ -23,13 +24,19 @@ func TestXattr(t *testing.T) { xattrName := "user.test" xattrDataSet := "gopher" - err := unix.Setxattr(f, xattrName, []byte(xattrDataSet), 0) + + err := unix.Setxattr(f, xattrName, []byte{}, 0) if err == unix.ENOTSUP || err == unix.EOPNOTSUPP { t.Skip("filesystem does not support extended attributes, skipping test") } else if err != nil { t.Fatalf("Setxattr: %v", err) } + err = unix.Setxattr(f, xattrName, []byte(xattrDataSet), 0) + if err != nil { + t.Fatalf("Setxattr: %v", err) + } + // find size size, err := unix.Listxattr(f, nil) if err != nil { @@ -117,3 +124,84 @@ func TestXattr(t *testing.T) { } } } + +func TestFdXattr(t *testing.T) { + file, err := ioutil.TempFile("", "TestFdXattr") + if err != nil { + t.Fatal(err) + } + defer os.Remove(file.Name()) + defer file.Close() + + fd := int(file.Fd()) + xattrName := "user.test" + xattrDataSet := "gopher" + + err = unix.Fsetxattr(fd, xattrName, []byte(xattrDataSet), 0) + if err == unix.ENOTSUP || err == unix.EOPNOTSUPP { + t.Skip("filesystem does not support extended attributes, skipping test") + } else if err != nil { + t.Fatalf("Fsetxattr: %v", err) + } + + // find size + size, err := unix.Flistxattr(fd, nil) + if err != nil { + t.Fatalf("Flistxattr: %v", err) + } + + if size <= 0 { + t.Fatalf("Flistxattr returned an empty list of attributes") + } + + buf := make([]byte, size) + read, err := unix.Flistxattr(fd, buf) + if err != nil { + t.Fatalf("Flistxattr: %v", err) + } + + xattrs := stringsFromByteSlice(buf[:read]) + + xattrWant := xattrName + if runtime.GOOS == "freebsd" { + // On FreeBSD, the namespace is stored separately from the xattr + // name and Listxattr doesn't return the namespace prefix. + xattrWant = strings.TrimPrefix(xattrWant, "user.") + } + found := false + for _, name := range xattrs { + if name == xattrWant { + found = true + } + } + + if !found { + t.Errorf("Flistxattr did not return previously set attribute '%s'", xattrName) + } + + // find size + size, err = unix.Fgetxattr(fd, xattrName, nil) + if err != nil { + t.Fatalf("Fgetxattr: %v", err) + } + + if size <= 0 { + t.Fatalf("Fgetxattr returned an empty attribute") + } + + xattrDataGet := make([]byte, size) + _, err = unix.Fgetxattr(fd, xattrName, xattrDataGet) + if err != nil { + t.Fatalf("Fgetxattr: %v", err) + } + + got := string(xattrDataGet) + if got != xattrDataSet { + t.Errorf("Fgetxattr: expected attribute value %s, got %s", xattrDataSet, got) + } + + err = unix.Fremovexattr(fd, xattrName) + if err != nil { + t.Fatalf("Fremovexattr: %v", err) + } +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go new file mode 100644 index 0000000000000..4b7b965027da3 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go @@ -0,0 +1,1372 @@ +// mkerrors.sh -maix32 +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build ppc,aix + +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs -- -maix32 _const.go + +package unix + +import "syscall" + +const ( + AF_APPLETALK = 0x10 + AF_BYPASS = 0x19 + AF_CCITT = 0xa + AF_CHAOS = 0x5 + AF_DATAKIT = 0x9 + AF_DECnet = 0xc + AF_DLI = 0xd + AF_ECMA = 0x8 + AF_HYLINK = 0xf + AF_IMPLINK = 0x3 + AF_INET = 0x2 + AF_INET6 = 0x18 + AF_INTF = 0x14 + AF_ISO = 0x7 + AF_LAT = 0xe + AF_LINK = 0x12 + AF_LOCAL = 0x1 + AF_MAX = 0x1e + AF_NDD = 0x17 + AF_NETWARE = 0x16 + AF_NS = 0x6 + AF_OSI = 0x7 + AF_PUP = 0x4 + AF_RIF = 0x15 + AF_ROUTE = 0x11 + AF_SNA = 0xb + AF_UNIX = 0x1 + AF_UNSPEC = 0x0 + ALTWERASE = 0x400000 + ARPHRD_802_3 = 0x6 + ARPHRD_802_5 = 0x6 + ARPHRD_ETHER = 0x1 + ARPHRD_FDDI = 0x1 + B0 = 0x0 + B110 = 0x3 + B1200 = 0x9 + B134 = 0x4 + B150 = 0x5 + B1800 = 0xa + B19200 = 0xe + B200 = 0x6 + B2400 = 0xb + B300 = 0x7 + B38400 = 0xf + B4800 = 0xc + B50 = 0x1 + B600 = 0x8 + B75 = 0x2 + B9600 = 0xd + BRKINT = 0x2 + BS0 = 0x0 + BS1 = 0x1000 + BSDLY = 0x1000 + CAP_AACCT = 0x6 + CAP_ARM_APPLICATION = 0x5 + CAP_BYPASS_RAC_VMM = 0x3 + CAP_CLEAR = 0x0 + CAP_CREDENTIALS = 0x7 + CAP_EFFECTIVE = 0x1 + CAP_EWLM_AGENT = 0x4 + CAP_INHERITABLE = 0x2 + CAP_MAXIMUM = 0x7 + CAP_NUMA_ATTACH = 0x2 + CAP_PERMITTED = 0x3 + CAP_PROPAGATE = 0x1 + CAP_PROPOGATE = 0x1 + CAP_SET = 0x1 + CBAUD = 0xf + CFLUSH = 0xf + CIBAUD = 0xf0000 + CLOCAL = 0x800 + CLOCK_MONOTONIC = 0xa + CLOCK_PROCESS_CPUTIME_ID = 0xb + CLOCK_REALTIME = 0x9 + CLOCK_THREAD_CPUTIME_ID = 0xc + CR0 = 0x0 + CR1 = 0x100 + CR2 = 0x200 + CR3 = 0x300 + CRDLY = 0x300 + CREAD = 0x80 + CS5 = 0x0 + CS6 = 0x10 + CS7 = 0x20 + CS8 = 0x30 + CSIOCGIFCONF = -0x3ff796dc + CSIZE = 0x30 + CSMAP_DIR = "/usr/lib/nls/csmap/" + CSTART = '\021' + CSTOP = '\023' + CSTOPB = 0x40 + CSUSP = 0x1a + ECHO = 0x8 + ECHOCTL = 0x20000 + ECHOE = 0x10 + ECHOK = 0x20 + ECHOKE = 0x80000 + ECHONL = 0x40 + ECHOPRT = 0x40000 + ECH_ICMPID = 0x2 + ETHERNET_CSMACD = 0x6 + EVENP = 0x80 + EXCONTINUE = 0x0 + EXDLOK = 0x3 + EXIO = 0x2 + EXPGIO = 0x0 + EXRESUME = 0x2 + EXRETURN = 0x1 + EXSIG = 0x4 + EXTA = 0xe + EXTB = 0xf + EXTRAP = 0x1 + EYEC_RTENTRYA = 0x257274656e747241 + EYEC_RTENTRYF = 0x257274656e747246 + E_ACC = 0x0 + FD_CLOEXEC = 0x1 + FD_SETSIZE = 0xfffe + FF0 = 0x0 + FF1 = 0x2000 + FFDLY = 0x2000 + FLUSHBAND = 0x40 + FLUSHLOW = 0x8 + FLUSHO = 0x100000 + FLUSHR = 0x1 + FLUSHRW = 0x3 + FLUSHW = 0x2 + F_CLOSEM = 0xa + F_DUP2FD = 0xe + F_DUPFD = 0x0 + F_GETFD = 0x1 + F_GETFL = 0x3 + F_GETLK = 0x5 + F_GETLK64 = 0xb + F_GETOWN = 0x8 + F_LOCK = 0x1 + F_OK = 0x0 + F_RDLCK = 0x1 + F_SETFD = 0x2 + F_SETFL = 0x4 + F_SETLK = 0x6 + F_SETLK64 = 0xc + F_SETLKW = 0x7 + F_SETLKW64 = 0xd + F_SETOWN = 0x9 + F_TEST = 0x3 + F_TLOCK = 0x2 + F_TSTLK = 0xf + F_ULOCK = 0x0 + F_UNLCK = 0x3 + F_WRLCK = 0x2 + HUPCL = 0x400 + IBSHIFT = 0x10 + ICANON = 0x2 + ICMP6_FILTER = 0x26 + ICMP6_SEC_SEND_DEL = 0x46 + ICMP6_SEC_SEND_GET = 0x47 + ICMP6_SEC_SEND_SET = 0x44 + ICMP6_SEC_SEND_SET_CGA_ADDR = 0x45 + ICRNL = 0x100 + IEXTEN = 0x200000 + IFA_FIRSTALIAS = 0x2000 + IFA_ROUTE = 0x1 + IFF_64BIT = 0x4000000 + IFF_ALLCAST = 0x20000 + IFF_ALLMULTI = 0x200 + IFF_BPF = 0x8000000 + IFF_BRIDGE = 0x40000 + IFF_BROADCAST = 0x2 + IFF_CANTCHANGE = 0x80c52 + IFF_CHECKSUM_OFFLOAD = 0x10000000 + IFF_D1 = 0x8000 + IFF_D2 = 0x4000 + IFF_D3 = 0x2000 + IFF_D4 = 0x1000 + IFF_DEBUG = 0x4 + IFF_DEVHEALTH = 0x4000 + IFF_DO_HW_LOOPBACK = 0x10000 + IFF_GROUP_ROUTING = 0x2000000 + IFF_IFBUFMGT = 0x800000 + IFF_LINK0 = 0x100000 + IFF_LINK1 = 0x200000 + IFF_LINK2 = 0x400000 + IFF_LOOPBACK = 0x8 + IFF_MULTICAST = 0x80000 + IFF_NOARP = 0x80 + IFF_NOECHO = 0x800 + IFF_NOTRAILERS = 0x20 + IFF_OACTIVE = 0x400 + IFF_POINTOPOINT = 0x10 + IFF_PROMISC = 0x100 + IFF_PSEG = 0x40000000 + IFF_RUNNING = 0x40 + IFF_SIMPLEX = 0x800 + IFF_SNAP = 0x8000 + IFF_TCP_DISABLE_CKSUM = 0x20000000 + IFF_TCP_NOCKSUM = 0x1000000 + IFF_UP = 0x1 + IFF_VIPA = 0x80000000 + IFNAMSIZ = 0x10 + IFO_FLUSH = 0x1 + IFT_1822 = 0x2 + IFT_AAL5 = 0x31 + IFT_ARCNET = 0x23 + IFT_ARCNETPLUS = 0x24 + IFT_ATM = 0x25 + IFT_CEPT = 0x13 + IFT_CLUSTER = 0x3e + IFT_DS3 = 0x1e + IFT_EON = 0x19 + IFT_ETHER = 0x6 + IFT_FCS = 0x3a + IFT_FDDI = 0xf + IFT_FRELAY = 0x20 + IFT_FRELAYDCE = 0x2c + IFT_GIFTUNNEL = 0x3c + IFT_HDH1822 = 0x3 + IFT_HF = 0x3d + IFT_HIPPI = 0x2f + IFT_HSSI = 0x2e + IFT_HY = 0xe + IFT_IB = 0xc7 + IFT_ISDNBASIC = 0x14 + IFT_ISDNPRIMARY = 0x15 + IFT_ISO88022LLC = 0x29 + IFT_ISO88023 = 0x7 + IFT_ISO88024 = 0x8 + IFT_ISO88025 = 0x9 + IFT_ISO88026 = 0xa + IFT_LAPB = 0x10 + IFT_LOCALTALK = 0x2a + IFT_LOOP = 0x18 + IFT_MIOX25 = 0x26 + IFT_MODEM = 0x30 + IFT_NSIP = 0x1b + IFT_OTHER = 0x1 + IFT_P10 = 0xc + IFT_P80 = 0xd + IFT_PARA = 0x22 + IFT_PPP = 0x17 + IFT_PROPMUX = 0x36 + IFT_PROPVIRTUAL = 0x35 + IFT_PTPSERIAL = 0x16 + IFT_RS232 = 0x21 + IFT_SDLC = 0x11 + IFT_SIP = 0x1f + IFT_SLIP = 0x1c + IFT_SMDSDXI = 0x2b + IFT_SMDSICIP = 0x34 + IFT_SN = 0x38 + IFT_SONET = 0x27 + IFT_SONETPATH = 0x32 + IFT_SONETVT = 0x33 + IFT_SP = 0x39 + IFT_STARLAN = 0xb + IFT_T1 = 0x12 + IFT_TUNNEL = 0x3b + IFT_ULTRA = 0x1d + IFT_V35 = 0x2d + IFT_VIPA = 0x37 + IFT_X25 = 0x5 + IFT_X25DDN = 0x4 + IFT_X25PLE = 0x28 + IFT_XETHER = 0x1a + IGNBRK = 0x1 + IGNCR = 0x80 + IGNPAR = 0x4 + IMAXBEL = 0x10000 + INLCR = 0x40 + INPCK = 0x10 + IN_CLASSA_HOST = 0xffffff + IN_CLASSA_MAX = 0x80 + IN_CLASSA_NET = 0xff000000 + IN_CLASSA_NSHIFT = 0x18 + IN_CLASSB_HOST = 0xffff + IN_CLASSB_MAX = 0x10000 + IN_CLASSB_NET = 0xffff0000 + IN_CLASSB_NSHIFT = 0x10 + IN_CLASSC_HOST = 0xff + IN_CLASSC_NET = 0xffffff00 + IN_CLASSC_NSHIFT = 0x8 + IN_CLASSD_HOST = 0xfffffff + IN_CLASSD_NET = 0xf0000000 + IN_CLASSD_NSHIFT = 0x1c + IN_LOOPBACKNET = 0x7f + IN_USE = 0x1 + IPPROTO_AH = 0x33 + IPPROTO_BIP = 0x53 + IPPROTO_DSTOPTS = 0x3c + IPPROTO_EGP = 0x8 + IPPROTO_EON = 0x50 + IPPROTO_ESP = 0x32 + IPPROTO_FRAGMENT = 0x2c + IPPROTO_GGP = 0x3 + IPPROTO_GIF = 0x8c + IPPROTO_GRE = 0x2f + IPPROTO_HOPOPTS = 0x0 + IPPROTO_ICMP = 0x1 + IPPROTO_ICMPV6 = 0x3a + IPPROTO_IDP = 0x16 + IPPROTO_IGMP = 0x2 + IPPROTO_IP = 0x0 + IPPROTO_IPIP = 0x4 + IPPROTO_IPV6 = 0x29 + IPPROTO_LOCAL = 0x3f + IPPROTO_MAX = 0x100 + IPPROTO_MH = 0x87 + IPPROTO_NONE = 0x3b + IPPROTO_PUP = 0xc + IPPROTO_QOS = 0x2d + IPPROTO_RAW = 0xff + IPPROTO_ROUTING = 0x2b + IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 + IPPROTO_TCP = 0x6 + IPPROTO_TP = 0x1d + IPPROTO_UDP = 0x11 + IPV6_ADDRFORM = 0x16 + IPV6_ADDR_PREFERENCES = 0x4a + IPV6_ADD_MEMBERSHIP = 0xc + IPV6_AIXRAWSOCKET = 0x39 + IPV6_CHECKSUM = 0x27 + IPV6_DONTFRAG = 0x2d + IPV6_DROP_MEMBERSHIP = 0xd + IPV6_DSTOPTS = 0x36 + IPV6_FLOWINFO_FLOWLABEL = 0xffffff + IPV6_FLOWINFO_PRIFLOW = 0xfffffff + IPV6_FLOWINFO_PRIORITY = 0xf000000 + IPV6_FLOWINFO_SRFLAG = 0x10000000 + IPV6_FLOWINFO_VERSION = 0xf0000000 + IPV6_HOPLIMIT = 0x28 + IPV6_HOPOPTS = 0x34 + IPV6_JOIN_GROUP = 0xc + IPV6_LEAVE_GROUP = 0xd + IPV6_MIPDSTOPTS = 0x36 + IPV6_MULTICAST_HOPS = 0xa + IPV6_MULTICAST_IF = 0x9 + IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_NOPROBE = 0x1c + IPV6_PATHMTU = 0x2e + IPV6_PKTINFO = 0x21 + IPV6_PKTOPTIONS = 0x24 + IPV6_PRIORITY_10 = 0xa000000 + IPV6_PRIORITY_11 = 0xb000000 + IPV6_PRIORITY_12 = 0xc000000 + IPV6_PRIORITY_13 = 0xd000000 + IPV6_PRIORITY_14 = 0xe000000 + IPV6_PRIORITY_15 = 0xf000000 + IPV6_PRIORITY_8 = 0x8000000 + IPV6_PRIORITY_9 = 0x9000000 + IPV6_PRIORITY_BULK = 0x4000000 + IPV6_PRIORITY_CONTROL = 0x7000000 + IPV6_PRIORITY_FILLER = 0x1000000 + IPV6_PRIORITY_INTERACTIVE = 0x6000000 + IPV6_PRIORITY_RESERVED1 = 0x3000000 + IPV6_PRIORITY_RESERVED2 = 0x5000000 + IPV6_PRIORITY_UNATTENDED = 0x2000000 + IPV6_PRIORITY_UNCHARACTERIZED = 0x0 + IPV6_RECVDSTOPTS = 0x38 + IPV6_RECVHOPLIMIT = 0x29 + IPV6_RECVHOPOPTS = 0x35 + IPV6_RECVHOPS = 0x22 + IPV6_RECVIF = 0x1e + IPV6_RECVPATHMTU = 0x2f + IPV6_RECVPKTINFO = 0x23 + IPV6_RECVRTHDR = 0x33 + IPV6_RECVSRCRT = 0x1d + IPV6_RECVTCLASS = 0x2a + IPV6_RTHDR = 0x32 + IPV6_RTHDRDSTOPTS = 0x37 + IPV6_RTHDR_TYPE_0 = 0x0 + IPV6_RTHDR_TYPE_2 = 0x2 + IPV6_SENDIF = 0x1f + IPV6_SRFLAG_LOOSE = 0x0 + IPV6_SRFLAG_STRICT = 0x10000000 + IPV6_TCLASS = 0x2b + IPV6_TOKEN_LENGTH = 0x40 + IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2c + IPV6_V6ONLY = 0x25 + IPV6_VERSION = 0x60000000 + IP_ADDRFORM = 0x16 + IP_ADD_MEMBERSHIP = 0xc + IP_ADD_SOURCE_MEMBERSHIP = 0x3c + IP_BLOCK_SOURCE = 0x3a + IP_BROADCAST_IF = 0x10 + IP_CACHE_LINE_SIZE = 0x80 + IP_DEFAULT_MULTICAST_LOOP = 0x1 + IP_DEFAULT_MULTICAST_TTL = 0x1 + IP_DF = 0x4000 + IP_DHCPMODE = 0x11 + IP_DONTFRAG = 0x19 + IP_DROP_MEMBERSHIP = 0xd + IP_DROP_SOURCE_MEMBERSHIP = 0x3d + IP_FINDPMTU = 0x1a + IP_HDRINCL = 0x2 + IP_INC_MEMBERSHIPS = 0x14 + IP_INIT_MEMBERSHIP = 0x14 + IP_MAXPACKET = 0xffff + IP_MF = 0x2000 + IP_MSS = 0x240 + IP_MULTICAST_HOPS = 0xa + IP_MULTICAST_IF = 0x9 + IP_MULTICAST_LOOP = 0xb + IP_MULTICAST_TTL = 0xa + IP_OPT = 0x1b + IP_OPTIONS = 0x1 + IP_PMTUAGE = 0x1b + IP_RECVDSTADDR = 0x7 + IP_RECVIF = 0x14 + IP_RECVIFINFO = 0xf + IP_RECVINTERFACE = 0x20 + IP_RECVMACHDR = 0xe + IP_RECVOPTS = 0x5 + IP_RECVRETOPTS = 0x6 + IP_RECVTTL = 0x22 + IP_RETOPTS = 0x8 + IP_SOURCE_FILTER = 0x48 + IP_TOS = 0x3 + IP_TTL = 0x4 + IP_UNBLOCK_SOURCE = 0x3b + IP_UNICAST_HOPS = 0x4 + ISIG = 0x1 + ISTRIP = 0x20 + IUCLC = 0x800 + IXANY = 0x1000 + IXOFF = 0x400 + IXON = 0x200 + I_FLUSH = 0x20005305 + LNOFLSH = 0x8000 + LOCK_EX = 0x2 + LOCK_NB = 0x4 + LOCK_SH = 0x1 + LOCK_UN = 0x8 + MADV_DONTNEED = 0x4 + MADV_NORMAL = 0x0 + MADV_RANDOM = 0x1 + MADV_SEQUENTIAL = 0x2 + MADV_SPACEAVAIL = 0x5 + MADV_WILLNEED = 0x3 + MAP_ANON = 0x10 + MAP_ANONYMOUS = 0x10 + MAP_FILE = 0x0 + MAP_FIXED = 0x100 + MAP_PRIVATE = 0x2 + MAP_SHARED = 0x1 + MAP_TYPE = 0xf0 + MAP_VARIABLE = 0x0 + MCL_CURRENT = 0x100 + MCL_FUTURE = 0x200 + MSG_ANY = 0x4 + MSG_ARGEXT = 0x400 + MSG_BAND = 0x2 + MSG_COMPAT = 0x8000 + MSG_CTRUNC = 0x20 + MSG_DONTROUTE = 0x4 + MSG_EOR = 0x8 + MSG_HIPRI = 0x1 + MSG_MAXIOVLEN = 0x10 + MSG_MPEG2 = 0x80 + MSG_NONBLOCK = 0x4000 + MSG_NOSIGNAL = 0x100 + MSG_OOB = 0x1 + MSG_PEEK = 0x2 + MSG_TRUNC = 0x10 + MSG_WAITALL = 0x40 + MSG_WAITFORONE = 0x200 + MS_ASYNC = 0x10 + MS_EINTR = 0x80 + MS_INVALIDATE = 0x40 + MS_PER_SEC = 0x3e8 + MS_SYNC = 0x20 + NL0 = 0x0 + NL1 = 0x4000 + NL2 = 0x8000 + NL3 = 0xc000 + NLDLY = 0x4000 + NOFLSH = 0x80 + NOFLUSH = 0x80000000 + OCRNL = 0x8 + OFDEL = 0x80 + OFILL = 0x40 + OLCUC = 0x2 + ONLCR = 0x4 + ONLRET = 0x20 + ONOCR = 0x10 + ONOEOT = 0x80000 + OPOST = 0x1 + OXTABS = 0x40000 + O_ACCMODE = 0x23 + O_APPEND = 0x8 + O_CIO = 0x80 + O_CIOR = 0x800000000 + O_CLOEXEC = 0x800000 + O_CREAT = 0x100 + O_DEFER = 0x2000 + O_DELAY = 0x4000 + O_DIRECT = 0x8000000 + O_DIRECTORY = 0x80000 + O_DSYNC = 0x400000 + O_EFSOFF = 0x400000000 + O_EFSON = 0x200000000 + O_EXCL = 0x400 + O_EXEC = 0x20 + O_LARGEFILE = 0x4000000 + O_NDELAY = 0x8000 + O_NOCACHE = 0x100000 + O_NOCTTY = 0x800 + O_NOFOLLOW = 0x1000000 + O_NONBLOCK = 0x4 + O_NONE = 0x3 + O_NSHARE = 0x10000 + O_RAW = 0x100000000 + O_RDONLY = 0x0 + O_RDWR = 0x2 + O_RSHARE = 0x1000 + O_RSYNC = 0x200000 + O_SEARCH = 0x20 + O_SNAPSHOT = 0x40 + O_SYNC = 0x10 + O_TRUNC = 0x200 + O_TTY_INIT = 0x0 + O_WRONLY = 0x1 + PARENB = 0x100 + PAREXT = 0x100000 + PARMRK = 0x8 + PARODD = 0x200 + PENDIN = 0x20000000 + PRIO_PGRP = 0x1 + PRIO_PROCESS = 0x0 + PRIO_USER = 0x2 + PROT_EXEC = 0x4 + PROT_NONE = 0x0 + PROT_READ = 0x1 + PROT_WRITE = 0x2 + PR_64BIT = 0x20 + PR_ADDR = 0x2 + PR_ARGEXT = 0x400 + PR_ATOMIC = 0x1 + PR_CONNREQUIRED = 0x4 + PR_FASTHZ = 0x5 + PR_INP = 0x40 + PR_INTRLEVEL = 0x8000 + PR_MLS = 0x100 + PR_MLS_1_LABEL = 0x200 + PR_NOEOR = 0x4000 + PR_RIGHTS = 0x10 + PR_SLOWHZ = 0x2 + PR_WANTRCVD = 0x8 + RLIMIT_AS = 0x6 + RLIMIT_CORE = 0x4 + RLIMIT_CPU = 0x0 + RLIMIT_DATA = 0x2 + RLIMIT_FSIZE = 0x1 + RLIMIT_NOFILE = 0x7 + RLIMIT_NPROC = 0x9 + RLIMIT_RSS = 0x5 + RLIMIT_STACK = 0x3 + RLIM_INFINITY = 0x7fffffff + RTAX_AUTHOR = 0x6 + RTAX_BRD = 0x7 + RTAX_DST = 0x0 + RTAX_GATEWAY = 0x1 + RTAX_GENMASK = 0x3 + RTAX_IFA = 0x5 + RTAX_IFP = 0x4 + RTAX_MAX = 0x8 + RTAX_NETMASK = 0x2 + RTA_AUTHOR = 0x40 + RTA_BRD = 0x80 + RTA_DOWNSTREAM = 0x100 + RTA_DST = 0x1 + RTA_GATEWAY = 0x2 + RTA_GENMASK = 0x8 + RTA_IFA = 0x20 + RTA_IFP = 0x10 + RTA_NETMASK = 0x4 + RTC_IA64 = 0x3 + RTC_POWER = 0x1 + RTC_POWER_PC = 0x2 + RTF_ACTIVE_DGD = 0x1000000 + RTF_BCE = 0x80000 + RTF_BLACKHOLE = 0x1000 + RTF_BROADCAST = 0x400000 + RTF_BUL = 0x2000 + RTF_CLONE = 0x10000 + RTF_CLONED = 0x20000 + RTF_CLONING = 0x100 + RTF_DONE = 0x40 + RTF_DYNAMIC = 0x10 + RTF_FREE_IN_PROG = 0x4000000 + RTF_GATEWAY = 0x2 + RTF_HOST = 0x4 + RTF_LLINFO = 0x400 + RTF_LOCAL = 0x200000 + RTF_MASK = 0x80 + RTF_MODIFIED = 0x20 + RTF_MULTICAST = 0x800000 + RTF_PERMANENT6 = 0x8000000 + RTF_PINNED = 0x100000 + RTF_PROTO1 = 0x8000 + RTF_PROTO2 = 0x4000 + RTF_PROTO3 = 0x40000 + RTF_REJECT = 0x8 + RTF_SMALLMTU = 0x40000 + RTF_STATIC = 0x800 + RTF_STOPSRCH = 0x2000000 + RTF_UNREACHABLE = 0x10000000 + RTF_UP = 0x1 + RTF_XRESOLVE = 0x200 + RTM_ADD = 0x1 + RTM_CHANGE = 0x3 + RTM_DELADDR = 0xd + RTM_DELETE = 0x2 + RTM_EXPIRE = 0xf + RTM_GET = 0x4 + RTM_GETNEXT = 0x11 + RTM_IFINFO = 0xe + RTM_LOCK = 0x8 + RTM_LOSING = 0x5 + RTM_MISS = 0x7 + RTM_NEWADDR = 0xc + RTM_OLDADD = 0x9 + RTM_OLDDEL = 0xa + RTM_REDIRECT = 0x6 + RTM_RESOLVE = 0xb + RTM_RTLOST = 0x10 + RTM_RTTUNIT = 0xf4240 + RTM_SAMEADDR = 0x12 + RTM_SET = 0x13 + RTM_VERSION = 0x2 + RTM_VERSION_GR = 0x4 + RTM_VERSION_GR_COMPAT = 0x3 + RTM_VERSION_POLICY = 0x5 + RTM_VERSION_POLICY_EXT = 0x6 + RTM_VERSION_POLICY_PRFN = 0x7 + RTV_EXPIRE = 0x4 + RTV_HOPCOUNT = 0x2 + RTV_MTU = 0x1 + RTV_RPIPE = 0x8 + RTV_RTT = 0x40 + RTV_RTTVAR = 0x80 + RTV_SPIPE = 0x10 + RTV_SSTHRESH = 0x20 + RUSAGE_CHILDREN = -0x1 + RUSAGE_SELF = 0x0 + RUSAGE_THREAD = 0x1 + SCM_RIGHTS = 0x1 + SHUT_RD = 0x0 + SHUT_RDWR = 0x2 + SHUT_WR = 0x1 + SIGMAX64 = 0xff + SIGQUEUE_MAX = 0x20 + SIOCADDIFVIPA = 0x20006942 + SIOCADDMTU = -0x7ffb9690 + SIOCADDMULTI = -0x7fdf96cf + SIOCADDNETID = -0x7fd796a9 + SIOCADDRT = -0x7fcf8df6 + SIOCAIFADDR = -0x7fbf96e6 + SIOCATMARK = 0x40047307 + SIOCDARP = -0x7fb396e0 + SIOCDELIFVIPA = 0x20006943 + SIOCDELMTU = -0x7ffb968f + SIOCDELMULTI = -0x7fdf96ce + SIOCDELPMTU = -0x7fd78ff6 + SIOCDELRT = -0x7fcf8df5 + SIOCDIFADDR = -0x7fd796e7 + SIOCDNETOPT = -0x3ffe9680 + SIOCDX25XLATE = -0x7fd7969b + SIOCFIFADDR = -0x7fdf966d + SIOCGARP = -0x3fb396da + SIOCGETMTUS = 0x2000696f + SIOCGETSGCNT = -0x3feb8acc + SIOCGETVIFCNT = -0x3feb8acd + SIOCGHIWAT = 0x40047301 + SIOCGIFADDR = -0x3fd796df + SIOCGIFADDRS = 0x2000698c + SIOCGIFBAUDRATE = -0x3fd79693 + SIOCGIFBRDADDR = -0x3fd796dd + SIOCGIFCONF = -0x3ff796bb + SIOCGIFCONFGLOB = -0x3ff79670 + SIOCGIFDSTADDR = -0x3fd796de + SIOCGIFFLAGS = -0x3fd796ef + SIOCGIFGIDLIST = 0x20006968 + SIOCGIFHWADDR = -0x3fab966b + SIOCGIFMETRIC = -0x3fd796e9 + SIOCGIFMTU = -0x3fd796aa + SIOCGIFNETMASK = -0x3fd796db + SIOCGIFOPTIONS = -0x3fd796d6 + SIOCGISNO = -0x3fd79695 + SIOCGLOADF = -0x3ffb967e + SIOCGLOWAT = 0x40047303 + SIOCGNETOPT = -0x3ffe96a5 + SIOCGNETOPT1 = -0x3fdf967f + SIOCGNMTUS = 0x2000696e + SIOCGPGRP = 0x40047309 + SIOCGSIZIFCONF = 0x4004696a + SIOCGSRCFILTER = -0x3fe796cb + SIOCGTUNEPHASE = -0x3ffb9676 + SIOCGX25XLATE = -0x3fd7969c + SIOCIFATTACH = -0x7fdf9699 + SIOCIFDETACH = -0x7fdf969a + SIOCIFGETPKEY = -0x7fdf969b + SIOCIF_ATM_DARP = -0x7fdf9683 + SIOCIF_ATM_DUMPARP = -0x7fdf9685 + SIOCIF_ATM_GARP = -0x7fdf9682 + SIOCIF_ATM_IDLE = -0x7fdf9686 + SIOCIF_ATM_SARP = -0x7fdf9681 + SIOCIF_ATM_SNMPARP = -0x7fdf9687 + SIOCIF_ATM_SVC = -0x7fdf9684 + SIOCIF_ATM_UBR = -0x7fdf9688 + SIOCIF_DEVHEALTH = -0x7ffb966c + SIOCIF_IB_ARP_INCOMP = -0x7fdf9677 + SIOCIF_IB_ARP_TIMER = -0x7fdf9678 + SIOCIF_IB_CLEAR_PINFO = -0x3fdf966f + SIOCIF_IB_DEL_ARP = -0x7fdf967f + SIOCIF_IB_DEL_PINFO = -0x3fdf9670 + SIOCIF_IB_DUMP_ARP = -0x7fdf9680 + SIOCIF_IB_GET_ARP = -0x7fdf967e + SIOCIF_IB_GET_INFO = -0x3f879675 + SIOCIF_IB_GET_STATS = -0x3f879672 + SIOCIF_IB_NOTIFY_ADDR_REM = -0x3f87966a + SIOCIF_IB_RESET_STATS = -0x3f879671 + SIOCIF_IB_RESIZE_CQ = -0x7fdf9679 + SIOCIF_IB_SET_ARP = -0x7fdf967d + SIOCIF_IB_SET_PKEY = -0x7fdf967c + SIOCIF_IB_SET_PORT = -0x7fdf967b + SIOCIF_IB_SET_QKEY = -0x7fdf9676 + SIOCIF_IB_SET_QSIZE = -0x7fdf967a + SIOCLISTIFVIPA = 0x20006944 + SIOCSARP = -0x7fb396e2 + SIOCSHIWAT = 0x80047300 + SIOCSIFADDR = -0x7fd796f4 + SIOCSIFADDRORI = -0x7fdb9673 + SIOCSIFBRDADDR = -0x7fd796ed + SIOCSIFDSTADDR = -0x7fd796f2 + SIOCSIFFLAGS = -0x7fd796f0 + SIOCSIFGIDLIST = 0x20006969 + SIOCSIFMETRIC = -0x7fd796e8 + SIOCSIFMTU = -0x7fd796a8 + SIOCSIFNETDUMP = -0x7fd796e4 + SIOCSIFNETMASK = -0x7fd796ea + SIOCSIFOPTIONS = -0x7fd796d7 + SIOCSIFSUBCHAN = -0x7fd796e5 + SIOCSISNO = -0x7fd79694 + SIOCSLOADF = -0x3ffb967d + SIOCSLOWAT = 0x80047302 + SIOCSNETOPT = -0x7ffe96a6 + SIOCSPGRP = 0x80047308 + SIOCSX25XLATE = -0x7fd7969d + SOCK_CONN_DGRAM = 0x6 + SOCK_DGRAM = 0x2 + SOCK_RAW = 0x3 + SOCK_RDM = 0x4 + SOCK_SEQPACKET = 0x5 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0xffff + SOMAXCONN = 0x400 + SO_ACCEPTCONN = 0x2 + SO_AUDIT = 0x8000 + SO_BROADCAST = 0x20 + SO_CKSUMRECV = 0x800 + SO_DEBUG = 0x1 + SO_DONTROUTE = 0x10 + SO_ERROR = 0x1007 + SO_KEEPALIVE = 0x8 + SO_KERNACCEPT = 0x2000 + SO_LINGER = 0x80 + SO_NOMULTIPATH = 0x4000 + SO_NOREUSEADDR = 0x1000 + SO_OOBINLINE = 0x100 + SO_PEERID = 0x1009 + SO_RCVBUF = 0x1002 + SO_RCVLOWAT = 0x1004 + SO_RCVTIMEO = 0x1006 + SO_REUSEADDR = 0x4 + SO_REUSEPORT = 0x200 + SO_SNDBUF = 0x1001 + SO_SNDLOWAT = 0x1003 + SO_SNDTIMEO = 0x1005 + SO_TIMESTAMPNS = 0x100a + SO_TYPE = 0x1008 + SO_USELOOPBACK = 0x40 + SO_USE_IFBUFS = 0x400 + S_BANDURG = 0x400 + S_EMODFMT = 0x3c000000 + S_ENFMT = 0x400 + S_ERROR = 0x100 + S_HANGUP = 0x200 + S_HIPRI = 0x2 + S_ICRYPTO = 0x80000 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFJOURNAL = 0x10000 + S_IFLNK = 0xa000 + S_IFMPX = 0x2200 + S_IFMT = 0xf000 + S_IFPDIR = 0x4000000 + S_IFPSDIR = 0x8000000 + S_IFPSSDIR = 0xc000000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IFSYSEA = 0x30000000 + S_INPUT = 0x1 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_ITCB = 0x1000000 + S_ITP = 0x800000 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXACL = 0x2000000 + S_IXATTR = 0x40000 + S_IXGRP = 0x8 + S_IXINTERFACE = 0x100000 + S_IXMOD = 0x40000000 + S_IXOTH = 0x1 + S_IXUSR = 0x40 + S_MSG = 0x8 + S_OUTPUT = 0x4 + S_RDBAND = 0x20 + S_RDNORM = 0x10 + S_RESERVED1 = 0x20000 + S_RESERVED2 = 0x200000 + S_RESERVED3 = 0x400000 + S_RESERVED4 = 0x80000000 + S_RESFMT1 = 0x10000000 + S_RESFMT10 = 0x34000000 + S_RESFMT11 = 0x38000000 + S_RESFMT12 = 0x3c000000 + S_RESFMT2 = 0x14000000 + S_RESFMT3 = 0x18000000 + S_RESFMT4 = 0x1c000000 + S_RESFMT5 = 0x20000000 + S_RESFMT6 = 0x24000000 + S_RESFMT7 = 0x28000000 + S_RESFMT8 = 0x2c000000 + S_WRBAND = 0x80 + S_WRNORM = 0x40 + TAB0 = 0x0 + TAB1 = 0x400 + TAB2 = 0x800 + TAB3 = 0xc00 + TABDLY = 0xc00 + TCFLSH = 0x540c + TCGETA = 0x5405 + TCGETS = 0x5401 + TCIFLUSH = 0x0 + TCIOFF = 0x2 + TCIOFLUSH = 0x2 + TCION = 0x3 + TCOFLUSH = 0x1 + TCOOFF = 0x0 + TCOON = 0x1 + TCP_24DAYS_WORTH_OF_SLOWTICKS = 0x3f4800 + TCP_ACLADD = 0x23 + TCP_ACLBIND = 0x26 + TCP_ACLCLEAR = 0x22 + TCP_ACLDEL = 0x24 + TCP_ACLDENY = 0x8 + TCP_ACLFLUSH = 0x21 + TCP_ACLGID = 0x1 + TCP_ACLLS = 0x25 + TCP_ACLSUBNET = 0x4 + TCP_ACLUID = 0x2 + TCP_CWND_DF = 0x16 + TCP_CWND_IF = 0x15 + TCP_DELAY_ACK_FIN = 0x2 + TCP_DELAY_ACK_SYN = 0x1 + TCP_FASTNAME = 0x101080a + TCP_KEEPCNT = 0x13 + TCP_KEEPIDLE = 0x11 + TCP_KEEPINTVL = 0x12 + TCP_LSPRIV = 0x29 + TCP_LUID = 0x20 + TCP_MAXBURST = 0x8 + TCP_MAXDF = 0x64 + TCP_MAXIF = 0x64 + TCP_MAXSEG = 0x2 + TCP_MAXWIN = 0xffff + TCP_MAXWINDOWSCALE = 0xe + TCP_MAX_SACK = 0x4 + TCP_MSS = 0x5b4 + TCP_NODELAY = 0x1 + TCP_NODELAYACK = 0x14 + TCP_NOREDUCE_CWND_EXIT_FRXMT = 0x19 + TCP_NOREDUCE_CWND_IN_FRXMT = 0x18 + TCP_NOTENTER_SSTART = 0x17 + TCP_OPT = 0x19 + TCP_RFC1323 = 0x4 + TCP_SETPRIV = 0x27 + TCP_STDURG = 0x10 + TCP_TIMESTAMP_OPTLEN = 0xc + TCP_UNSETPRIV = 0x28 + TCSAFLUSH = 0x2 + TCSBRK = 0x5409 + TCSETA = 0x5406 + TCSETAF = 0x5408 + TCSETAW = 0x5407 + TCSETS = 0x5402 + TCSETSF = 0x5404 + TCSETSW = 0x5403 + TCXONC = 0x540b + TIOC = 0x5400 + TIOCCBRK = 0x2000747a + TIOCCDTR = 0x20007478 + TIOCCONS = 0x80047462 + TIOCEXCL = 0x2000740d + TIOCFLUSH = 0x80047410 + TIOCGETC = 0x40067412 + TIOCGETD = 0x40047400 + TIOCGETP = 0x40067408 + TIOCGLTC = 0x40067474 + TIOCGPGRP = 0x40047477 + TIOCGSID = 0x40047448 + TIOCGSIZE = 0x40087468 + TIOCGWINSZ = 0x40087468 + TIOCHPCL = 0x20007402 + TIOCLBIC = 0x8004747e + TIOCLBIS = 0x8004747f + TIOCLGET = 0x4004747c + TIOCLSET = 0x8004747d + TIOCMBIC = 0x8004746b + TIOCMBIS = 0x8004746c + TIOCMGET = 0x4004746a + TIOCMIWAIT = 0x80047464 + TIOCMODG = 0x40047403 + TIOCMODS = 0x80047404 + TIOCMSET = 0x8004746d + TIOCM_CAR = 0x40 + TIOCM_CD = 0x40 + TIOCM_CTS = 0x20 + TIOCM_DSR = 0x100 + TIOCM_DTR = 0x2 + TIOCM_LE = 0x1 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_RTS = 0x4 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x20007471 + TIOCNXCL = 0x2000740e + TIOCOUTQ = 0x40047473 + TIOCPKT = 0x80047470 + TIOCPKT_DATA = 0x0 + TIOCPKT_DOSTOP = 0x20 + TIOCPKT_FLUSHREAD = 0x1 + TIOCPKT_FLUSHWRITE = 0x2 + TIOCPKT_NOSTOP = 0x10 + TIOCPKT_START = 0x8 + TIOCPKT_STOP = 0x4 + TIOCREMOTE = 0x80047469 + TIOCSBRK = 0x2000747b + TIOCSDTR = 0x20007479 + TIOCSETC = 0x80067411 + TIOCSETD = 0x80047401 + TIOCSETN = 0x8006740a + TIOCSETP = 0x80067409 + TIOCSLTC = 0x80067475 + TIOCSPGRP = 0x80047476 + TIOCSSIZE = 0x80087467 + TIOCSTART = 0x2000746e + TIOCSTI = 0x80017472 + TIOCSTOP = 0x2000746f + TIOCSWINSZ = 0x80087467 + TIOCUCNTL = 0x80047466 + TOSTOP = 0x10000 + UTIME_NOW = -0x2 + UTIME_OMIT = -0x3 + VDISCRD = 0xc + VDSUSP = 0xa + VEOF = 0x4 + VEOL = 0x5 + VEOL2 = 0x6 + VERASE = 0x2 + VINTR = 0x0 + VKILL = 0x3 + VLNEXT = 0xe + VMIN = 0x4 + VQUIT = 0x1 + VREPRINT = 0xb + VSTART = 0x7 + VSTOP = 0x8 + VSTRT = 0x7 + VSUSP = 0x9 + VT0 = 0x0 + VT1 = 0x8000 + VTDELAY = 0x2000 + VTDLY = 0x8000 + VTIME = 0x5 + VWERSE = 0xd + WPARSTART = 0x1 + WPARSTOP = 0x2 + WPARTTYNAME = "Global" + XCASE = 0x4 + XTABS = 0xc00 + _FDATAFLUSH = 0x2000000000 +) + +// Errors +const ( + E2BIG = syscall.Errno(0x7) + EACCES = syscall.Errno(0xd) + EADDRINUSE = syscall.Errno(0x43) + EADDRNOTAVAIL = syscall.Errno(0x44) + EAFNOSUPPORT = syscall.Errno(0x42) + EAGAIN = syscall.Errno(0xb) + EALREADY = syscall.Errno(0x38) + EBADF = syscall.Errno(0x9) + EBADMSG = syscall.Errno(0x78) + EBUSY = syscall.Errno(0x10) + ECANCELED = syscall.Errno(0x75) + ECHILD = syscall.Errno(0xa) + ECHRNG = syscall.Errno(0x25) + ECLONEME = syscall.Errno(0x52) + ECONNABORTED = syscall.Errno(0x48) + ECONNREFUSED = syscall.Errno(0x4f) + ECONNRESET = syscall.Errno(0x49) + ECORRUPT = syscall.Errno(0x59) + EDEADLK = syscall.Errno(0x2d) + EDESTADDREQ = syscall.Errno(0x3a) + EDESTADDRREQ = syscall.Errno(0x3a) + EDIST = syscall.Errno(0x35) + EDOM = syscall.Errno(0x21) + EDQUOT = syscall.Errno(0x58) + EEXIST = syscall.Errno(0x11) + EFAULT = syscall.Errno(0xe) + EFBIG = syscall.Errno(0x1b) + EFORMAT = syscall.Errno(0x30) + EHOSTDOWN = syscall.Errno(0x50) + EHOSTUNREACH = syscall.Errno(0x51) + EIDRM = syscall.Errno(0x24) + EILSEQ = syscall.Errno(0x74) + EINPROGRESS = syscall.Errno(0x37) + EINTR = syscall.Errno(0x4) + EINVAL = syscall.Errno(0x16) + EIO = syscall.Errno(0x5) + EISCONN = syscall.Errno(0x4b) + EISDIR = syscall.Errno(0x15) + EL2HLT = syscall.Errno(0x2c) + EL2NSYNC = syscall.Errno(0x26) + EL3HLT = syscall.Errno(0x27) + EL3RST = syscall.Errno(0x28) + ELNRNG = syscall.Errno(0x29) + ELOOP = syscall.Errno(0x55) + EMEDIA = syscall.Errno(0x6e) + EMFILE = syscall.Errno(0x18) + EMLINK = syscall.Errno(0x1f) + EMSGSIZE = syscall.Errno(0x3b) + EMULTIHOP = syscall.Errno(0x7d) + ENAMETOOLONG = syscall.Errno(0x56) + ENETDOWN = syscall.Errno(0x45) + ENETRESET = syscall.Errno(0x47) + ENETUNREACH = syscall.Errno(0x46) + ENFILE = syscall.Errno(0x17) + ENOATTR = syscall.Errno(0x70) + ENOBUFS = syscall.Errno(0x4a) + ENOCONNECT = syscall.Errno(0x32) + ENOCSI = syscall.Errno(0x2b) + ENODATA = syscall.Errno(0x7a) + ENODEV = syscall.Errno(0x13) + ENOENT = syscall.Errno(0x2) + ENOEXEC = syscall.Errno(0x8) + ENOLCK = syscall.Errno(0x31) + ENOLINK = syscall.Errno(0x7e) + ENOMEM = syscall.Errno(0xc) + ENOMSG = syscall.Errno(0x23) + ENOPROTOOPT = syscall.Errno(0x3d) + ENOSPC = syscall.Errno(0x1c) + ENOSR = syscall.Errno(0x76) + ENOSTR = syscall.Errno(0x7b) + ENOSYS = syscall.Errno(0x6d) + ENOTBLK = syscall.Errno(0xf) + ENOTCONN = syscall.Errno(0x4c) + ENOTDIR = syscall.Errno(0x14) + ENOTEMPTY = syscall.Errno(0x11) + ENOTREADY = syscall.Errno(0x2e) + ENOTRECOVERABLE = syscall.Errno(0x5e) + ENOTRUST = syscall.Errno(0x72) + ENOTSOCK = syscall.Errno(0x39) + ENOTSUP = syscall.Errno(0x7c) + ENOTTY = syscall.Errno(0x19) + ENXIO = syscall.Errno(0x6) + EOPNOTSUPP = syscall.Errno(0x40) + EOVERFLOW = syscall.Errno(0x7f) + EOWNERDEAD = syscall.Errno(0x5f) + EPERM = syscall.Errno(0x1) + EPFNOSUPPORT = syscall.Errno(0x41) + EPIPE = syscall.Errno(0x20) + EPROCLIM = syscall.Errno(0x53) + EPROTO = syscall.Errno(0x79) + EPROTONOSUPPORT = syscall.Errno(0x3e) + EPROTOTYPE = syscall.Errno(0x3c) + ERANGE = syscall.Errno(0x22) + EREMOTE = syscall.Errno(0x5d) + ERESTART = syscall.Errno(0x52) + EROFS = syscall.Errno(0x1e) + ESAD = syscall.Errno(0x71) + ESHUTDOWN = syscall.Errno(0x4d) + ESOCKTNOSUPPORT = syscall.Errno(0x3f) + ESOFT = syscall.Errno(0x6f) + ESPIPE = syscall.Errno(0x1d) + ESRCH = syscall.Errno(0x3) + ESTALE = syscall.Errno(0x34) + ESYSERROR = syscall.Errno(0x5a) + ETIME = syscall.Errno(0x77) + ETIMEDOUT = syscall.Errno(0x4e) + ETOOMANYREFS = syscall.Errno(0x73) + ETXTBSY = syscall.Errno(0x1a) + EUNATCH = syscall.Errno(0x2a) + EUSERS = syscall.Errno(0x54) + EWOULDBLOCK = syscall.Errno(0xb) + EWRPROTECT = syscall.Errno(0x2f) + EXDEV = syscall.Errno(0x12) +) + +// Signals +const ( + SIGABRT = syscall.Signal(0x6) + SIGAIO = syscall.Signal(0x17) + SIGALRM = syscall.Signal(0xe) + SIGALRM1 = syscall.Signal(0x26) + SIGBUS = syscall.Signal(0xa) + SIGCAPI = syscall.Signal(0x31) + SIGCHLD = syscall.Signal(0x14) + SIGCLD = syscall.Signal(0x14) + SIGCONT = syscall.Signal(0x13) + SIGCPUFAIL = syscall.Signal(0x3b) + SIGDANGER = syscall.Signal(0x21) + SIGEMT = syscall.Signal(0x7) + SIGFPE = syscall.Signal(0x8) + SIGGRANT = syscall.Signal(0x3c) + SIGHUP = syscall.Signal(0x1) + SIGILL = syscall.Signal(0x4) + SIGINT = syscall.Signal(0x2) + SIGIO = syscall.Signal(0x17) + SIGIOINT = syscall.Signal(0x10) + SIGIOT = syscall.Signal(0x6) + SIGKAP = syscall.Signal(0x3c) + SIGKILL = syscall.Signal(0x9) + SIGLOST = syscall.Signal(0x6) + SIGMAX = syscall.Signal(0x3f) + SIGMAX32 = syscall.Signal(0x3f) + SIGMIGRATE = syscall.Signal(0x23) + SIGMSG = syscall.Signal(0x1b) + SIGPIPE = syscall.Signal(0xd) + SIGPOLL = syscall.Signal(0x17) + SIGPRE = syscall.Signal(0x24) + SIGPROF = syscall.Signal(0x20) + SIGPTY = syscall.Signal(0x17) + SIGPWR = syscall.Signal(0x1d) + SIGQUIT = syscall.Signal(0x3) + SIGRECONFIG = syscall.Signal(0x3a) + SIGRETRACT = syscall.Signal(0x3d) + SIGSAK = syscall.Signal(0x3f) + SIGSEGV = syscall.Signal(0xb) + SIGSOUND = syscall.Signal(0x3e) + SIGSTOP = syscall.Signal(0x11) + SIGSYS = syscall.Signal(0xc) + SIGSYSERROR = syscall.Signal(0x30) + SIGTALRM = syscall.Signal(0x26) + SIGTERM = syscall.Signal(0xf) + SIGTRAP = syscall.Signal(0x5) + SIGTSTP = syscall.Signal(0x12) + SIGTTIN = syscall.Signal(0x15) + SIGTTOU = syscall.Signal(0x16) + SIGURG = syscall.Signal(0x10) + SIGUSR1 = syscall.Signal(0x1e) + SIGUSR2 = syscall.Signal(0x1f) + SIGVIRT = syscall.Signal(0x25) + SIGVTALRM = syscall.Signal(0x22) + SIGWAITING = syscall.Signal(0x27) + SIGWINCH = syscall.Signal(0x1c) + SIGXCPU = syscall.Signal(0x18) + SIGXFSZ = syscall.Signal(0x19) +) + +// Error table +var errorList = [...]struct { + num syscall.Errno + name string + desc string +}{ + {1, "EPERM", "not owner"}, + {2, "ENOENT", "no such file or directory"}, + {3, "ESRCH", "no such process"}, + {4, "EINTR", "interrupted system call"}, + {5, "EIO", "I/O error"}, + {6, "ENXIO", "no such device or address"}, + {7, "E2BIG", "arg list too long"}, + {8, "ENOEXEC", "exec format error"}, + {9, "EBADF", "bad file number"}, + {10, "ECHILD", "no child processes"}, + {11, "EWOULDBLOCK", "resource temporarily unavailable"}, + {12, "ENOMEM", "not enough space"}, + {13, "EACCES", "permission denied"}, + {14, "EFAULT", "bad address"}, + {15, "ENOTBLK", "block device required"}, + {16, "EBUSY", "device busy"}, + {17, "ENOTEMPTY", "file exists"}, + {18, "EXDEV", "cross-device link"}, + {19, "ENODEV", "no such device"}, + {20, "ENOTDIR", "not a directory"}, + {21, "EISDIR", "is a directory"}, + {22, "EINVAL", "invalid argument"}, + {23, "ENFILE", "file table overflow"}, + {24, "EMFILE", "too many open files"}, + {25, "ENOTTY", "not a typewriter"}, + {26, "ETXTBSY", "text file busy"}, + {27, "EFBIG", "file too large"}, + {28, "ENOSPC", "no space left on device"}, + {29, "ESPIPE", "illegal seek"}, + {30, "EROFS", "read-only file system"}, + {31, "EMLINK", "too many links"}, + {32, "EPIPE", "broken pipe"}, + {33, "EDOM", "argument out of domain"}, + {34, "ERANGE", "result too large"}, + {35, "ENOMSG", "no message of desired type"}, + {36, "EIDRM", "identifier removed"}, + {37, "ECHRNG", "channel number out of range"}, + {38, "EL2NSYNC", "level 2 not synchronized"}, + {39, "EL3HLT", "level 3 halted"}, + {40, "EL3RST", "level 3 reset"}, + {41, "ELNRNG", "link number out of range"}, + {42, "EUNATCH", "protocol driver not attached"}, + {43, "ENOCSI", "no CSI structure available"}, + {44, "EL2HLT", "level 2 halted"}, + {45, "EDEADLK", "deadlock condition if locked"}, + {46, "ENOTREADY", "device not ready"}, + {47, "EWRPROTECT", "write-protected media"}, + {48, "EFORMAT", "unformatted or incompatible media"}, + {49, "ENOLCK", "no locks available"}, + {50, "ENOCONNECT", "cannot Establish Connection"}, + {52, "ESTALE", "missing file or filesystem"}, + {53, "EDIST", "requests blocked by Administrator"}, + {55, "EINPROGRESS", "operation now in progress"}, + {56, "EALREADY", "operation already in progress"}, + {57, "ENOTSOCK", "socket operation on non-socket"}, + {58, "EDESTADDREQ", "destination address required"}, + {59, "EMSGSIZE", "message too long"}, + {60, "EPROTOTYPE", "protocol wrong type for socket"}, + {61, "ENOPROTOOPT", "protocol not available"}, + {62, "EPROTONOSUPPORT", "protocol not supported"}, + {63, "ESOCKTNOSUPPORT", "socket type not supported"}, + {64, "EOPNOTSUPP", "operation not supported on socket"}, + {65, "EPFNOSUPPORT", "protocol family not supported"}, + {66, "EAFNOSUPPORT", "addr family not supported by protocol"}, + {67, "EADDRINUSE", "address already in use"}, + {68, "EADDRNOTAVAIL", "can't assign requested address"}, + {69, "ENETDOWN", "network is down"}, + {70, "ENETUNREACH", "network is unreachable"}, + {71, "ENETRESET", "network dropped connection on reset"}, + {72, "ECONNABORTED", "software caused connection abort"}, + {73, "ECONNRESET", "connection reset by peer"}, + {74, "ENOBUFS", "no buffer space available"}, + {75, "EISCONN", "socket is already connected"}, + {76, "ENOTCONN", "socket is not connected"}, + {77, "ESHUTDOWN", "can't send after socket shutdown"}, + {78, "ETIMEDOUT", "connection timed out"}, + {79, "ECONNREFUSED", "connection refused"}, + {80, "EHOSTDOWN", "host is down"}, + {81, "EHOSTUNREACH", "no route to host"}, + {82, "ERESTART", "restart the system call"}, + {83, "EPROCLIM", "too many processes"}, + {84, "EUSERS", "too many users"}, + {85, "ELOOP", "too many levels of symbolic links"}, + {86, "ENAMETOOLONG", "file name too long"}, + {88, "EDQUOT", "disk quota exceeded"}, + {89, "ECORRUPT", "invalid file system control data detected"}, + {90, "ESYSERROR", "for future use "}, + {93, "EREMOTE", "item is not local to host"}, + {94, "ENOTRECOVERABLE", "state not recoverable "}, + {95, "EOWNERDEAD", "previous owner died "}, + {109, "ENOSYS", "function not implemented"}, + {110, "EMEDIA", "media surface error"}, + {111, "ESOFT", "I/O completed, but needs relocation"}, + {112, "ENOATTR", "no attribute found"}, + {113, "ESAD", "security Authentication Denied"}, + {114, "ENOTRUST", "not a Trusted Program"}, + {115, "ETOOMANYREFS", "too many references: can't splice"}, + {116, "EILSEQ", "invalid wide character"}, + {117, "ECANCELED", "asynchronous I/O cancelled"}, + {118, "ENOSR", "out of STREAMS resources"}, + {119, "ETIME", "system call timed out"}, + {120, "EBADMSG", "next message has wrong type"}, + {121, "EPROTO", "error in protocol"}, + {122, "ENODATA", "no message on stream head read q"}, + {123, "ENOSTR", "fd not associated with a stream"}, + {124, "ENOTSUP", "unsupported attribute value"}, + {125, "EMULTIHOP", "multihop is not allowed"}, + {126, "ENOLINK", "the server link has been severed"}, + {127, "EOVERFLOW", "value too large to be stored in data type"}, +} + +// Signal table +var signalList = [...]struct { + num syscall.Signal + name string + desc string +}{ + {1, "SIGHUP", "hangup"}, + {2, "SIGINT", "interrupt"}, + {3, "SIGQUIT", "quit"}, + {4, "SIGILL", "illegal instruction"}, + {5, "SIGTRAP", "trace/BPT trap"}, + {6, "SIGIOT", "IOT/Abort trap"}, + {7, "SIGEMT", "EMT trap"}, + {8, "SIGFPE", "floating point exception"}, + {9, "SIGKILL", "killed"}, + {10, "SIGBUS", "bus error"}, + {11, "SIGSEGV", "segmentation fault"}, + {12, "SIGSYS", "bad system call"}, + {13, "SIGPIPE", "broken pipe"}, + {14, "SIGALRM", "alarm clock"}, + {15, "SIGTERM", "terminated"}, + {16, "SIGURG", "urgent I/O condition"}, + {17, "SIGSTOP", "stopped (signal)"}, + {18, "SIGTSTP", "stopped"}, + {19, "SIGCONT", "continued"}, + {20, "SIGCHLD", "child exited"}, + {21, "SIGTTIN", "stopped (tty input)"}, + {22, "SIGTTOU", "stopped (tty output)"}, + {23, "SIGIO", "I/O possible/complete"}, + {24, "SIGXCPU", "cputime limit exceeded"}, + {25, "SIGXFSZ", "filesize limit exceeded"}, + {27, "SIGMSG", "input device data"}, + {28, "SIGWINCH", "window size changes"}, + {29, "SIGPWR", "power-failure"}, + {30, "SIGUSR1", "user defined signal 1"}, + {31, "SIGUSR2", "user defined signal 2"}, + {32, "SIGPROF", "profiling timer expired"}, + {33, "SIGDANGER", "paging space low"}, + {34, "SIGVTALRM", "virtual timer expired"}, + {35, "SIGMIGRATE", "signal 35"}, + {36, "SIGPRE", "signal 36"}, + {37, "SIGVIRT", "signal 37"}, + {38, "SIGTALRM", "signal 38"}, + {39, "SIGWAITING", "signal 39"}, + {48, "SIGSYSERROR", "signal 48"}, + {49, "SIGCAPI", "signal 49"}, + {58, "SIGRECONFIG", "signal 58"}, + {59, "SIGCPUFAIL", "CPU Failure Predicted"}, + {60, "SIGKAP", "monitor mode granted"}, + {61, "SIGRETRACT", "monitor mode retracted"}, + {62, "SIGSOUND", "sound completed"}, + {63, "SIGSAK", "secure attention"}, +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go new file mode 100644 index 0000000000000..ed04fd1b77db9 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go @@ -0,0 +1,1373 @@ +// mkerrors.sh -maix64 +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build ppc64,aix + +// Created by cgo -godefs - DO NOT EDIT +// cgo -godefs -- -maix64 _const.go + +package unix + +import "syscall" + +const ( + AF_APPLETALK = 0x10 + AF_BYPASS = 0x19 + AF_CCITT = 0xa + AF_CHAOS = 0x5 + AF_DATAKIT = 0x9 + AF_DECnet = 0xc + AF_DLI = 0xd + AF_ECMA = 0x8 + AF_HYLINK = 0xf + AF_IMPLINK = 0x3 + AF_INET = 0x2 + AF_INET6 = 0x18 + AF_INTF = 0x14 + AF_ISO = 0x7 + AF_LAT = 0xe + AF_LINK = 0x12 + AF_LOCAL = 0x1 + AF_MAX = 0x1e + AF_NDD = 0x17 + AF_NETWARE = 0x16 + AF_NS = 0x6 + AF_OSI = 0x7 + AF_PUP = 0x4 + AF_RIF = 0x15 + AF_ROUTE = 0x11 + AF_SNA = 0xb + AF_UNIX = 0x1 + AF_UNSPEC = 0x0 + ALTWERASE = 0x400000 + ARPHRD_802_3 = 0x6 + ARPHRD_802_5 = 0x6 + ARPHRD_ETHER = 0x1 + ARPHRD_FDDI = 0x1 + B0 = 0x0 + B110 = 0x3 + B1200 = 0x9 + B134 = 0x4 + B150 = 0x5 + B1800 = 0xa + B19200 = 0xe + B200 = 0x6 + B2400 = 0xb + B300 = 0x7 + B38400 = 0xf + B4800 = 0xc + B50 = 0x1 + B600 = 0x8 + B75 = 0x2 + B9600 = 0xd + BRKINT = 0x2 + BS0 = 0x0 + BS1 = 0x1000 + BSDLY = 0x1000 + CAP_AACCT = 0x6 + CAP_ARM_APPLICATION = 0x5 + CAP_BYPASS_RAC_VMM = 0x3 + CAP_CLEAR = 0x0 + CAP_CREDENTIALS = 0x7 + CAP_EFFECTIVE = 0x1 + CAP_EWLM_AGENT = 0x4 + CAP_INHERITABLE = 0x2 + CAP_MAXIMUM = 0x7 + CAP_NUMA_ATTACH = 0x2 + CAP_PERMITTED = 0x3 + CAP_PROPAGATE = 0x1 + CAP_PROPOGATE = 0x1 + CAP_SET = 0x1 + CBAUD = 0xf + CFLUSH = 0xf + CIBAUD = 0xf0000 + CLOCAL = 0x800 + CLOCK_MONOTONIC = 0xa + CLOCK_PROCESS_CPUTIME_ID = 0xb + CLOCK_REALTIME = 0x9 + CLOCK_THREAD_CPUTIME_ID = 0xc + CR0 = 0x0 + CR1 = 0x100 + CR2 = 0x200 + CR3 = 0x300 + CRDLY = 0x300 + CREAD = 0x80 + CS5 = 0x0 + CS6 = 0x10 + CS7 = 0x20 + CS8 = 0x30 + CSIOCGIFCONF = -0x3fef96dc + CSIZE = 0x30 + CSMAP_DIR = "/usr/lib/nls/csmap/" + CSTART = '\021' + CSTOP = '\023' + CSTOPB = 0x40 + CSUSP = 0x1a + ECHO = 0x8 + ECHOCTL = 0x20000 + ECHOE = 0x10 + ECHOK = 0x20 + ECHOKE = 0x80000 + ECHONL = 0x40 + ECHOPRT = 0x40000 + ECH_ICMPID = 0x2 + ETHERNET_CSMACD = 0x6 + EVENP = 0x80 + EXCONTINUE = 0x0 + EXDLOK = 0x3 + EXIO = 0x2 + EXPGIO = 0x0 + EXRESUME = 0x2 + EXRETURN = 0x1 + EXSIG = 0x4 + EXTA = 0xe + EXTB = 0xf + EXTRAP = 0x1 + EYEC_RTENTRYA = 0x257274656e747241 + EYEC_RTENTRYF = 0x257274656e747246 + E_ACC = 0x0 + FD_CLOEXEC = 0x1 + FD_SETSIZE = 0xfffe + FF0 = 0x0 + FF1 = 0x2000 + FFDLY = 0x2000 + FLUSHBAND = 0x40 + FLUSHLOW = 0x8 + FLUSHO = 0x100000 + FLUSHR = 0x1 + FLUSHRW = 0x3 + FLUSHW = 0x2 + F_CLOSEM = 0xa + F_DUP2FD = 0xe + F_DUPFD = 0x0 + F_GETFD = 0x1 + F_GETFL = 0x3 + F_GETLK = 0xb + F_GETLK64 = 0xb + F_GETOWN = 0x8 + F_LOCK = 0x1 + F_OK = 0x0 + F_RDLCK = 0x1 + F_SETFD = 0x2 + F_SETFL = 0x4 + F_SETLK = 0xc + F_SETLK64 = 0xc + F_SETLKW = 0xd + F_SETLKW64 = 0xd + F_SETOWN = 0x9 + F_TEST = 0x3 + F_TLOCK = 0x2 + F_TSTLK = 0xf + F_ULOCK = 0x0 + F_UNLCK = 0x3 + F_WRLCK = 0x2 + HUPCL = 0x400 + IBSHIFT = 0x10 + ICANON = 0x2 + ICMP6_FILTER = 0x26 + ICMP6_SEC_SEND_DEL = 0x46 + ICMP6_SEC_SEND_GET = 0x47 + ICMP6_SEC_SEND_SET = 0x44 + ICMP6_SEC_SEND_SET_CGA_ADDR = 0x45 + ICRNL = 0x100 + IEXTEN = 0x200000 + IFA_FIRSTALIAS = 0x2000 + IFA_ROUTE = 0x1 + IFF_64BIT = 0x4000000 + IFF_ALLCAST = 0x20000 + IFF_ALLMULTI = 0x200 + IFF_BPF = 0x8000000 + IFF_BRIDGE = 0x40000 + IFF_BROADCAST = 0x2 + IFF_CANTCHANGE = 0x80c52 + IFF_CHECKSUM_OFFLOAD = 0x10000000 + IFF_D1 = 0x8000 + IFF_D2 = 0x4000 + IFF_D3 = 0x2000 + IFF_D4 = 0x1000 + IFF_DEBUG = 0x4 + IFF_DEVHEALTH = 0x4000 + IFF_DO_HW_LOOPBACK = 0x10000 + IFF_GROUP_ROUTING = 0x2000000 + IFF_IFBUFMGT = 0x800000 + IFF_LINK0 = 0x100000 + IFF_LINK1 = 0x200000 + IFF_LINK2 = 0x400000 + IFF_LOOPBACK = 0x8 + IFF_MULTICAST = 0x80000 + IFF_NOARP = 0x80 + IFF_NOECHO = 0x800 + IFF_NOTRAILERS = 0x20 + IFF_OACTIVE = 0x400 + IFF_POINTOPOINT = 0x10 + IFF_PROMISC = 0x100 + IFF_PSEG = 0x40000000 + IFF_RUNNING = 0x40 + IFF_SIMPLEX = 0x800 + IFF_SNAP = 0x8000 + IFF_TCP_DISABLE_CKSUM = 0x20000000 + IFF_TCP_NOCKSUM = 0x1000000 + IFF_UP = 0x1 + IFF_VIPA = 0x80000000 + IFNAMSIZ = 0x10 + IFO_FLUSH = 0x1 + IFT_1822 = 0x2 + IFT_AAL5 = 0x31 + IFT_ARCNET = 0x23 + IFT_ARCNETPLUS = 0x24 + IFT_ATM = 0x25 + IFT_CEPT = 0x13 + IFT_CLUSTER = 0x3e + IFT_DS3 = 0x1e + IFT_EON = 0x19 + IFT_ETHER = 0x6 + IFT_FCS = 0x3a + IFT_FDDI = 0xf + IFT_FRELAY = 0x20 + IFT_FRELAYDCE = 0x2c + IFT_GIFTUNNEL = 0x3c + IFT_HDH1822 = 0x3 + IFT_HF = 0x3d + IFT_HIPPI = 0x2f + IFT_HSSI = 0x2e + IFT_HY = 0xe + IFT_IB = 0xc7 + IFT_ISDNBASIC = 0x14 + IFT_ISDNPRIMARY = 0x15 + IFT_ISO88022LLC = 0x29 + IFT_ISO88023 = 0x7 + IFT_ISO88024 = 0x8 + IFT_ISO88025 = 0x9 + IFT_ISO88026 = 0xa + IFT_LAPB = 0x10 + IFT_LOCALTALK = 0x2a + IFT_LOOP = 0x18 + IFT_MIOX25 = 0x26 + IFT_MODEM = 0x30 + IFT_NSIP = 0x1b + IFT_OTHER = 0x1 + IFT_P10 = 0xc + IFT_P80 = 0xd + IFT_PARA = 0x22 + IFT_PPP = 0x17 + IFT_PROPMUX = 0x36 + IFT_PROPVIRTUAL = 0x35 + IFT_PTPSERIAL = 0x16 + IFT_RS232 = 0x21 + IFT_SDLC = 0x11 + IFT_SIP = 0x1f + IFT_SLIP = 0x1c + IFT_SMDSDXI = 0x2b + IFT_SMDSICIP = 0x34 + IFT_SN = 0x38 + IFT_SONET = 0x27 + IFT_SONETPATH = 0x32 + IFT_SONETVT = 0x33 + IFT_SP = 0x39 + IFT_STARLAN = 0xb + IFT_T1 = 0x12 + IFT_TUNNEL = 0x3b + IFT_ULTRA = 0x1d + IFT_V35 = 0x2d + IFT_VIPA = 0x37 + IFT_X25 = 0x5 + IFT_X25DDN = 0x4 + IFT_X25PLE = 0x28 + IFT_XETHER = 0x1a + IGNBRK = 0x1 + IGNCR = 0x80 + IGNPAR = 0x4 + IMAXBEL = 0x10000 + INLCR = 0x40 + INPCK = 0x10 + IN_CLASSA_HOST = 0xffffff + IN_CLASSA_MAX = 0x80 + IN_CLASSA_NET = 0xff000000 + IN_CLASSA_NSHIFT = 0x18 + IN_CLASSB_HOST = 0xffff + IN_CLASSB_MAX = 0x10000 + IN_CLASSB_NET = 0xffff0000 + IN_CLASSB_NSHIFT = 0x10 + IN_CLASSC_HOST = 0xff + IN_CLASSC_NET = 0xffffff00 + IN_CLASSC_NSHIFT = 0x8 + IN_CLASSD_HOST = 0xfffffff + IN_CLASSD_NET = 0xf0000000 + IN_CLASSD_NSHIFT = 0x1c + IN_LOOPBACKNET = 0x7f + IN_USE = 0x1 + IPPROTO_AH = 0x33 + IPPROTO_BIP = 0x53 + IPPROTO_DSTOPTS = 0x3c + IPPROTO_EGP = 0x8 + IPPROTO_EON = 0x50 + IPPROTO_ESP = 0x32 + IPPROTO_FRAGMENT = 0x2c + IPPROTO_GGP = 0x3 + IPPROTO_GIF = 0x8c + IPPROTO_GRE = 0x2f + IPPROTO_HOPOPTS = 0x0 + IPPROTO_ICMP = 0x1 + IPPROTO_ICMPV6 = 0x3a + IPPROTO_IDP = 0x16 + IPPROTO_IGMP = 0x2 + IPPROTO_IP = 0x0 + IPPROTO_IPIP = 0x4 + IPPROTO_IPV6 = 0x29 + IPPROTO_LOCAL = 0x3f + IPPROTO_MAX = 0x100 + IPPROTO_MH = 0x87 + IPPROTO_NONE = 0x3b + IPPROTO_PUP = 0xc + IPPROTO_QOS = 0x2d + IPPROTO_RAW = 0xff + IPPROTO_ROUTING = 0x2b + IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 + IPPROTO_TCP = 0x6 + IPPROTO_TP = 0x1d + IPPROTO_UDP = 0x11 + IPV6_ADDRFORM = 0x16 + IPV6_ADDR_PREFERENCES = 0x4a + IPV6_ADD_MEMBERSHIP = 0xc + IPV6_AIXRAWSOCKET = 0x39 + IPV6_CHECKSUM = 0x27 + IPV6_DONTFRAG = 0x2d + IPV6_DROP_MEMBERSHIP = 0xd + IPV6_DSTOPTS = 0x36 + IPV6_FLOWINFO_FLOWLABEL = 0xffffff + IPV6_FLOWINFO_PRIFLOW = 0xfffffff + IPV6_FLOWINFO_PRIORITY = 0xf000000 + IPV6_FLOWINFO_SRFLAG = 0x10000000 + IPV6_FLOWINFO_VERSION = 0xf0000000 + IPV6_HOPLIMIT = 0x28 + IPV6_HOPOPTS = 0x34 + IPV6_JOIN_GROUP = 0xc + IPV6_LEAVE_GROUP = 0xd + IPV6_MIPDSTOPTS = 0x36 + IPV6_MULTICAST_HOPS = 0xa + IPV6_MULTICAST_IF = 0x9 + IPV6_MULTICAST_LOOP = 0xb + IPV6_NEXTHOP = 0x30 + IPV6_NOPROBE = 0x1c + IPV6_PATHMTU = 0x2e + IPV6_PKTINFO = 0x21 + IPV6_PKTOPTIONS = 0x24 + IPV6_PRIORITY_10 = 0xa000000 + IPV6_PRIORITY_11 = 0xb000000 + IPV6_PRIORITY_12 = 0xc000000 + IPV6_PRIORITY_13 = 0xd000000 + IPV6_PRIORITY_14 = 0xe000000 + IPV6_PRIORITY_15 = 0xf000000 + IPV6_PRIORITY_8 = 0x8000000 + IPV6_PRIORITY_9 = 0x9000000 + IPV6_PRIORITY_BULK = 0x4000000 + IPV6_PRIORITY_CONTROL = 0x7000000 + IPV6_PRIORITY_FILLER = 0x1000000 + IPV6_PRIORITY_INTERACTIVE = 0x6000000 + IPV6_PRIORITY_RESERVED1 = 0x3000000 + IPV6_PRIORITY_RESERVED2 = 0x5000000 + IPV6_PRIORITY_UNATTENDED = 0x2000000 + IPV6_PRIORITY_UNCHARACTERIZED = 0x0 + IPV6_RECVDSTOPTS = 0x38 + IPV6_RECVHOPLIMIT = 0x29 + IPV6_RECVHOPOPTS = 0x35 + IPV6_RECVHOPS = 0x22 + IPV6_RECVIF = 0x1e + IPV6_RECVPATHMTU = 0x2f + IPV6_RECVPKTINFO = 0x23 + IPV6_RECVRTHDR = 0x33 + IPV6_RECVSRCRT = 0x1d + IPV6_RECVTCLASS = 0x2a + IPV6_RTHDR = 0x32 + IPV6_RTHDRDSTOPTS = 0x37 + IPV6_RTHDR_TYPE_0 = 0x0 + IPV6_RTHDR_TYPE_2 = 0x2 + IPV6_SENDIF = 0x1f + IPV6_SRFLAG_LOOSE = 0x0 + IPV6_SRFLAG_STRICT = 0x10000000 + IPV6_TCLASS = 0x2b + IPV6_TOKEN_LENGTH = 0x40 + IPV6_UNICAST_HOPS = 0x4 + IPV6_USE_MIN_MTU = 0x2c + IPV6_V6ONLY = 0x25 + IPV6_VERSION = 0x60000000 + IP_ADDRFORM = 0x16 + IP_ADD_MEMBERSHIP = 0xc + IP_ADD_SOURCE_MEMBERSHIP = 0x3c + IP_BLOCK_SOURCE = 0x3a + IP_BROADCAST_IF = 0x10 + IP_CACHE_LINE_SIZE = 0x80 + IP_DEFAULT_MULTICAST_LOOP = 0x1 + IP_DEFAULT_MULTICAST_TTL = 0x1 + IP_DF = 0x4000 + IP_DHCPMODE = 0x11 + IP_DONTFRAG = 0x19 + IP_DROP_MEMBERSHIP = 0xd + IP_DROP_SOURCE_MEMBERSHIP = 0x3d + IP_FINDPMTU = 0x1a + IP_HDRINCL = 0x2 + IP_INC_MEMBERSHIPS = 0x14 + IP_INIT_MEMBERSHIP = 0x14 + IP_MAXPACKET = 0xffff + IP_MF = 0x2000 + IP_MSS = 0x240 + IP_MULTICAST_HOPS = 0xa + IP_MULTICAST_IF = 0x9 + IP_MULTICAST_LOOP = 0xb + IP_MULTICAST_TTL = 0xa + IP_OPT = 0x1b + IP_OPTIONS = 0x1 + IP_PMTUAGE = 0x1b + IP_RECVDSTADDR = 0x7 + IP_RECVIF = 0x14 + IP_RECVIFINFO = 0xf + IP_RECVINTERFACE = 0x20 + IP_RECVMACHDR = 0xe + IP_RECVOPTS = 0x5 + IP_RECVRETOPTS = 0x6 + IP_RECVTTL = 0x22 + IP_RETOPTS = 0x8 + IP_SOURCE_FILTER = 0x48 + IP_TOS = 0x3 + IP_TTL = 0x4 + IP_UNBLOCK_SOURCE = 0x3b + IP_UNICAST_HOPS = 0x4 + ISIG = 0x1 + ISTRIP = 0x20 + IUCLC = 0x800 + IXANY = 0x1000 + IXOFF = 0x400 + IXON = 0x200 + I_FLUSH = 0x20005305 + LNOFLSH = 0x8000 + LOCK_EX = 0x2 + LOCK_NB = 0x4 + LOCK_SH = 0x1 + LOCK_UN = 0x8 + MADV_DONTNEED = 0x4 + MADV_NORMAL = 0x0 + MADV_RANDOM = 0x1 + MADV_SEQUENTIAL = 0x2 + MADV_SPACEAVAIL = 0x5 + MADV_WILLNEED = 0x3 + MAP_ANON = 0x10 + MAP_ANONYMOUS = 0x10 + MAP_FILE = 0x0 + MAP_FIXED = 0x100 + MAP_PRIVATE = 0x2 + MAP_SHARED = 0x1 + MAP_TYPE = 0xf0 + MAP_VARIABLE = 0x0 + MCL_CURRENT = 0x100 + MCL_FUTURE = 0x200 + MSG_ANY = 0x4 + MSG_ARGEXT = 0x400 + MSG_BAND = 0x2 + MSG_COMPAT = 0x8000 + MSG_CTRUNC = 0x20 + MSG_DONTROUTE = 0x4 + MSG_EOR = 0x8 + MSG_HIPRI = 0x1 + MSG_MAXIOVLEN = 0x10 + MSG_MPEG2 = 0x80 + MSG_NONBLOCK = 0x4000 + MSG_NOSIGNAL = 0x100 + MSG_OOB = 0x1 + MSG_PEEK = 0x2 + MSG_TRUNC = 0x10 + MSG_WAITALL = 0x40 + MSG_WAITFORONE = 0x200 + MS_ASYNC = 0x10 + MS_EINTR = 0x80 + MS_INVALIDATE = 0x40 + MS_PER_SEC = 0x3e8 + MS_SYNC = 0x20 + NL0 = 0x0 + NL1 = 0x4000 + NL2 = 0x8000 + NL3 = 0xc000 + NLDLY = 0x4000 + NOFLSH = 0x80 + NOFLUSH = 0x80000000 + OCRNL = 0x8 + OFDEL = 0x80 + OFILL = 0x40 + OLCUC = 0x2 + ONLCR = 0x4 + ONLRET = 0x20 + ONOCR = 0x10 + ONOEOT = 0x80000 + OPOST = 0x1 + OXTABS = 0x40000 + O_ACCMODE = 0x23 + O_APPEND = 0x8 + O_CIO = 0x80 + O_CIOR = 0x800000000 + O_CLOEXEC = 0x800000 + O_CREAT = 0x100 + O_DEFER = 0x2000 + O_DELAY = 0x4000 + O_DIRECT = 0x8000000 + O_DIRECTORY = 0x80000 + O_DSYNC = 0x400000 + O_EFSOFF = 0x400000000 + O_EFSON = 0x200000000 + O_EXCL = 0x400 + O_EXEC = 0x20 + O_LARGEFILE = 0x4000000 + O_NDELAY = 0x8000 + O_NOCACHE = 0x100000 + O_NOCTTY = 0x800 + O_NOFOLLOW = 0x1000000 + O_NONBLOCK = 0x4 + O_NONE = 0x3 + O_NSHARE = 0x10000 + O_RAW = 0x100000000 + O_RDONLY = 0x0 + O_RDWR = 0x2 + O_RSHARE = 0x1000 + O_RSYNC = 0x200000 + O_SEARCH = 0x20 + O_SNAPSHOT = 0x40 + O_SYNC = 0x10 + O_TRUNC = 0x200 + O_TTY_INIT = 0x0 + O_WRONLY = 0x1 + PARENB = 0x100 + PAREXT = 0x100000 + PARMRK = 0x8 + PARODD = 0x200 + PENDIN = 0x20000000 + PRIO_PGRP = 0x1 + PRIO_PROCESS = 0x0 + PRIO_USER = 0x2 + PROT_EXEC = 0x4 + PROT_NONE = 0x0 + PROT_READ = 0x1 + PROT_WRITE = 0x2 + PR_64BIT = 0x20 + PR_ADDR = 0x2 + PR_ARGEXT = 0x400 + PR_ATOMIC = 0x1 + PR_CONNREQUIRED = 0x4 + PR_FASTHZ = 0x5 + PR_INP = 0x40 + PR_INTRLEVEL = 0x8000 + PR_MLS = 0x100 + PR_MLS_1_LABEL = 0x200 + PR_NOEOR = 0x4000 + PR_RIGHTS = 0x10 + PR_SLOWHZ = 0x2 + PR_WANTRCVD = 0x8 + RLIMIT_AS = 0x6 + RLIMIT_CORE = 0x4 + RLIMIT_CPU = 0x0 + RLIMIT_DATA = 0x2 + RLIMIT_FSIZE = 0x1 + RLIMIT_NOFILE = 0x7 + RLIMIT_NPROC = 0x9 + RLIMIT_RSS = 0x5 + RLIMIT_STACK = 0x3 + RLIM_INFINITY = 0x7fffffffffffffff + RTAX_AUTHOR = 0x6 + RTAX_BRD = 0x7 + RTAX_DST = 0x0 + RTAX_GATEWAY = 0x1 + RTAX_GENMASK = 0x3 + RTAX_IFA = 0x5 + RTAX_IFP = 0x4 + RTAX_MAX = 0x8 + RTAX_NETMASK = 0x2 + RTA_AUTHOR = 0x40 + RTA_BRD = 0x80 + RTA_DOWNSTREAM = 0x100 + RTA_DST = 0x1 + RTA_GATEWAY = 0x2 + RTA_GENMASK = 0x8 + RTA_IFA = 0x20 + RTA_IFP = 0x10 + RTA_NETMASK = 0x4 + RTC_IA64 = 0x3 + RTC_POWER = 0x1 + RTC_POWER_PC = 0x2 + RTF_ACTIVE_DGD = 0x1000000 + RTF_BCE = 0x80000 + RTF_BLACKHOLE = 0x1000 + RTF_BROADCAST = 0x400000 + RTF_BUL = 0x2000 + RTF_CLONE = 0x10000 + RTF_CLONED = 0x20000 + RTF_CLONING = 0x100 + RTF_DONE = 0x40 + RTF_DYNAMIC = 0x10 + RTF_FREE_IN_PROG = 0x4000000 + RTF_GATEWAY = 0x2 + RTF_HOST = 0x4 + RTF_LLINFO = 0x400 + RTF_LOCAL = 0x200000 + RTF_MASK = 0x80 + RTF_MODIFIED = 0x20 + RTF_MULTICAST = 0x800000 + RTF_PERMANENT6 = 0x8000000 + RTF_PINNED = 0x100000 + RTF_PROTO1 = 0x8000 + RTF_PROTO2 = 0x4000 + RTF_PROTO3 = 0x40000 + RTF_REJECT = 0x8 + RTF_SMALLMTU = 0x40000 + RTF_STATIC = 0x800 + RTF_STOPSRCH = 0x2000000 + RTF_UNREACHABLE = 0x10000000 + RTF_UP = 0x1 + RTF_XRESOLVE = 0x200 + RTM_ADD = 0x1 + RTM_CHANGE = 0x3 + RTM_DELADDR = 0xd + RTM_DELETE = 0x2 + RTM_EXPIRE = 0xf + RTM_GET = 0x4 + RTM_GETNEXT = 0x11 + RTM_IFINFO = 0xe + RTM_LOCK = 0x8 + RTM_LOSING = 0x5 + RTM_MISS = 0x7 + RTM_NEWADDR = 0xc + RTM_OLDADD = 0x9 + RTM_OLDDEL = 0xa + RTM_REDIRECT = 0x6 + RTM_RESOLVE = 0xb + RTM_RTLOST = 0x10 + RTM_RTTUNIT = 0xf4240 + RTM_SAMEADDR = 0x12 + RTM_SET = 0x13 + RTM_VERSION = 0x2 + RTM_VERSION_GR = 0x4 + RTM_VERSION_GR_COMPAT = 0x3 + RTM_VERSION_POLICY = 0x5 + RTM_VERSION_POLICY_EXT = 0x6 + RTM_VERSION_POLICY_PRFN = 0x7 + RTV_EXPIRE = 0x4 + RTV_HOPCOUNT = 0x2 + RTV_MTU = 0x1 + RTV_RPIPE = 0x8 + RTV_RTT = 0x40 + RTV_RTTVAR = 0x80 + RTV_SPIPE = 0x10 + RTV_SSTHRESH = 0x20 + RUSAGE_CHILDREN = -0x1 + RUSAGE_SELF = 0x0 + RUSAGE_THREAD = 0x1 + SCM_RIGHTS = 0x1 + SHUT_RD = 0x0 + SHUT_RDWR = 0x2 + SHUT_WR = 0x1 + SIGMAX64 = 0xff + SIGQUEUE_MAX = 0x20 + SIOCADDIFVIPA = 0x20006942 + SIOCADDMTU = -0x7ffb9690 + SIOCADDMULTI = -0x7fdf96cf + SIOCADDNETID = -0x7fd796a9 + SIOCADDRT = -0x7fc78df6 + SIOCAIFADDR = -0x7fbf96e6 + SIOCATMARK = 0x40047307 + SIOCDARP = -0x7fb396e0 + SIOCDELIFVIPA = 0x20006943 + SIOCDELMTU = -0x7ffb968f + SIOCDELMULTI = -0x7fdf96ce + SIOCDELPMTU = -0x7fd78ff6 + SIOCDELRT = -0x7fc78df5 + SIOCDIFADDR = -0x7fd796e7 + SIOCDNETOPT = -0x3ffe9680 + SIOCDX25XLATE = -0x7fd7969b + SIOCFIFADDR = -0x7fdf966d + SIOCGARP = -0x3fb396da + SIOCGETMTUS = 0x2000696f + SIOCGETSGCNT = -0x3feb8acc + SIOCGETVIFCNT = -0x3feb8acd + SIOCGHIWAT = 0x40047301 + SIOCGIFADDR = -0x3fd796df + SIOCGIFADDRS = 0x2000698c + SIOCGIFBAUDRATE = -0x3fd79693 + SIOCGIFBRDADDR = -0x3fd796dd + SIOCGIFCONF = -0x3fef96bb + SIOCGIFCONFGLOB = -0x3fef9670 + SIOCGIFDSTADDR = -0x3fd796de + SIOCGIFFLAGS = -0x3fd796ef + SIOCGIFGIDLIST = 0x20006968 + SIOCGIFHWADDR = -0x3fab966b + SIOCGIFMETRIC = -0x3fd796e9 + SIOCGIFMTU = -0x3fd796aa + SIOCGIFNETMASK = -0x3fd796db + SIOCGIFOPTIONS = -0x3fd796d6 + SIOCGISNO = -0x3fd79695 + SIOCGLOADF = -0x3ffb967e + SIOCGLOWAT = 0x40047303 + SIOCGNETOPT = -0x3ffe96a5 + SIOCGNETOPT1 = -0x3fdf967f + SIOCGNMTUS = 0x2000696e + SIOCGPGRP = 0x40047309 + SIOCGSIZIFCONF = 0x4004696a + SIOCGSRCFILTER = -0x3fe796cb + SIOCGTUNEPHASE = -0x3ffb9676 + SIOCGX25XLATE = -0x3fd7969c + SIOCIFATTACH = -0x7fdf9699 + SIOCIFDETACH = -0x7fdf969a + SIOCIFGETPKEY = -0x7fdf969b + SIOCIF_ATM_DARP = -0x7fdf9683 + SIOCIF_ATM_DUMPARP = -0x7fdf9685 + SIOCIF_ATM_GARP = -0x7fdf9682 + SIOCIF_ATM_IDLE = -0x7fdf9686 + SIOCIF_ATM_SARP = -0x7fdf9681 + SIOCIF_ATM_SNMPARP = -0x7fdf9687 + SIOCIF_ATM_SVC = -0x7fdf9684 + SIOCIF_ATM_UBR = -0x7fdf9688 + SIOCIF_DEVHEALTH = -0x7ffb966c + SIOCIF_IB_ARP_INCOMP = -0x7fdf9677 + SIOCIF_IB_ARP_TIMER = -0x7fdf9678 + SIOCIF_IB_CLEAR_PINFO = -0x3fdf966f + SIOCIF_IB_DEL_ARP = -0x7fdf967f + SIOCIF_IB_DEL_PINFO = -0x3fdf9670 + SIOCIF_IB_DUMP_ARP = -0x7fdf9680 + SIOCIF_IB_GET_ARP = -0x7fdf967e + SIOCIF_IB_GET_INFO = -0x3f879675 + SIOCIF_IB_GET_STATS = -0x3f879672 + SIOCIF_IB_NOTIFY_ADDR_REM = -0x3f87966a + SIOCIF_IB_RESET_STATS = -0x3f879671 + SIOCIF_IB_RESIZE_CQ = -0x7fdf9679 + SIOCIF_IB_SET_ARP = -0x7fdf967d + SIOCIF_IB_SET_PKEY = -0x7fdf967c + SIOCIF_IB_SET_PORT = -0x7fdf967b + SIOCIF_IB_SET_QKEY = -0x7fdf9676 + SIOCIF_IB_SET_QSIZE = -0x7fdf967a + SIOCLISTIFVIPA = 0x20006944 + SIOCSARP = -0x7fb396e2 + SIOCSHIWAT = 0xffffffff80047300 + SIOCSIFADDR = -0x7fd796f4 + SIOCSIFADDRORI = -0x7fdb9673 + SIOCSIFBRDADDR = -0x7fd796ed + SIOCSIFDSTADDR = -0x7fd796f2 + SIOCSIFFLAGS = -0x7fd796f0 + SIOCSIFGIDLIST = 0x20006969 + SIOCSIFMETRIC = -0x7fd796e8 + SIOCSIFMTU = -0x7fd796a8 + SIOCSIFNETDUMP = -0x7fd796e4 + SIOCSIFNETMASK = -0x7fd796ea + SIOCSIFOPTIONS = -0x7fd796d7 + SIOCSIFSUBCHAN = -0x7fd796e5 + SIOCSISNO = -0x7fd79694 + SIOCSLOADF = -0x3ffb967d + SIOCSLOWAT = 0xffffffff80047302 + SIOCSNETOPT = -0x7ffe96a6 + SIOCSPGRP = 0xffffffff80047308 + SIOCSX25XLATE = -0x7fd7969d + SOCK_CONN_DGRAM = 0x6 + SOCK_DGRAM = 0x2 + SOCK_RAW = 0x3 + SOCK_RDM = 0x4 + SOCK_SEQPACKET = 0x5 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0xffff + SOMAXCONN = 0x400 + SO_ACCEPTCONN = 0x2 + SO_AUDIT = 0x8000 + SO_BROADCAST = 0x20 + SO_CKSUMRECV = 0x800 + SO_DEBUG = 0x1 + SO_DONTROUTE = 0x10 + SO_ERROR = 0x1007 + SO_KEEPALIVE = 0x8 + SO_KERNACCEPT = 0x2000 + SO_LINGER = 0x80 + SO_NOMULTIPATH = 0x4000 + SO_NOREUSEADDR = 0x1000 + SO_OOBINLINE = 0x100 + SO_PEERID = 0x1009 + SO_RCVBUF = 0x1002 + SO_RCVLOWAT = 0x1004 + SO_RCVTIMEO = 0x1006 + SO_REUSEADDR = 0x4 + SO_REUSEPORT = 0x200 + SO_SNDBUF = 0x1001 + SO_SNDLOWAT = 0x1003 + SO_SNDTIMEO = 0x1005 + SO_TIMESTAMPNS = 0x100a + SO_TYPE = 0x1008 + SO_USELOOPBACK = 0x40 + SO_USE_IFBUFS = 0x400 + S_BANDURG = 0x400 + S_EMODFMT = 0x3c000000 + S_ENFMT = 0x400 + S_ERROR = 0x100 + S_HANGUP = 0x200 + S_HIPRI = 0x2 + S_ICRYPTO = 0x80000 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFJOURNAL = 0x10000 + S_IFLNK = 0xa000 + S_IFMPX = 0x2200 + S_IFMT = 0xf000 + S_IFPDIR = 0x4000000 + S_IFPSDIR = 0x8000000 + S_IFPSSDIR = 0xc000000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IFSYSEA = 0x30000000 + S_INPUT = 0x1 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_ITCB = 0x1000000 + S_ITP = 0x800000 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXACL = 0x2000000 + S_IXATTR = 0x40000 + S_IXGRP = 0x8 + S_IXINTERFACE = 0x100000 + S_IXMOD = 0x40000000 + S_IXOTH = 0x1 + S_IXUSR = 0x40 + S_MSG = 0x8 + S_OUTPUT = 0x4 + S_RDBAND = 0x20 + S_RDNORM = 0x10 + S_RESERVED1 = 0x20000 + S_RESERVED2 = 0x200000 + S_RESERVED3 = 0x400000 + S_RESERVED4 = 0x80000000 + S_RESFMT1 = 0x10000000 + S_RESFMT10 = 0x34000000 + S_RESFMT11 = 0x38000000 + S_RESFMT12 = 0x3c000000 + S_RESFMT2 = 0x14000000 + S_RESFMT3 = 0x18000000 + S_RESFMT4 = 0x1c000000 + S_RESFMT5 = 0x20000000 + S_RESFMT6 = 0x24000000 + S_RESFMT7 = 0x28000000 + S_RESFMT8 = 0x2c000000 + S_WRBAND = 0x80 + S_WRNORM = 0x40 + TAB0 = 0x0 + TAB1 = 0x400 + TAB2 = 0x800 + TAB3 = 0xc00 + TABDLY = 0xc00 + TCFLSH = 0x540c + TCGETA = 0x5405 + TCGETS = 0x5401 + TCIFLUSH = 0x0 + TCIOFF = 0x2 + TCIOFLUSH = 0x2 + TCION = 0x3 + TCOFLUSH = 0x1 + TCOOFF = 0x0 + TCOON = 0x1 + TCP_24DAYS_WORTH_OF_SLOWTICKS = 0x3f4800 + TCP_ACLADD = 0x23 + TCP_ACLBIND = 0x26 + TCP_ACLCLEAR = 0x22 + TCP_ACLDEL = 0x24 + TCP_ACLDENY = 0x8 + TCP_ACLFLUSH = 0x21 + TCP_ACLGID = 0x1 + TCP_ACLLS = 0x25 + TCP_ACLSUBNET = 0x4 + TCP_ACLUID = 0x2 + TCP_CWND_DF = 0x16 + TCP_CWND_IF = 0x15 + TCP_DELAY_ACK_FIN = 0x2 + TCP_DELAY_ACK_SYN = 0x1 + TCP_FASTNAME = 0x101080a + TCP_KEEPCNT = 0x13 + TCP_KEEPIDLE = 0x11 + TCP_KEEPINTVL = 0x12 + TCP_LSPRIV = 0x29 + TCP_LUID = 0x20 + TCP_MAXBURST = 0x8 + TCP_MAXDF = 0x64 + TCP_MAXIF = 0x64 + TCP_MAXSEG = 0x2 + TCP_MAXWIN = 0xffff + TCP_MAXWINDOWSCALE = 0xe + TCP_MAX_SACK = 0x4 + TCP_MSS = 0x5b4 + TCP_NODELAY = 0x1 + TCP_NODELAYACK = 0x14 + TCP_NOREDUCE_CWND_EXIT_FRXMT = 0x19 + TCP_NOREDUCE_CWND_IN_FRXMT = 0x18 + TCP_NOTENTER_SSTART = 0x17 + TCP_OPT = 0x19 + TCP_RFC1323 = 0x4 + TCP_SETPRIV = 0x27 + TCP_STDURG = 0x10 + TCP_TIMESTAMP_OPTLEN = 0xc + TCP_UNSETPRIV = 0x28 + TCSAFLUSH = 0x2 + TCSBRK = 0x5409 + TCSETA = 0x5406 + TCSETAF = 0x5408 + TCSETAW = 0x5407 + TCSETS = 0x5402 + TCSETSF = 0x5404 + TCSETSW = 0x5403 + TCXONC = 0x540b + TIOC = 0x5400 + TIOCCBRK = 0x2000747a + TIOCCDTR = 0x20007478 + TIOCCONS = 0xffffffff80047462 + TIOCEXCL = 0x2000740d + TIOCFLUSH = 0xffffffff80047410 + TIOCGETC = 0x40067412 + TIOCGETD = 0x40047400 + TIOCGETP = 0x40067408 + TIOCGLTC = 0x40067474 + TIOCGPGRP = 0x40047477 + TIOCGSID = 0x40047448 + TIOCGSIZE = 0x40087468 + TIOCGWINSZ = 0x40087468 + TIOCHPCL = 0x20007402 + TIOCLBIC = 0xffffffff8004747e + TIOCLBIS = 0xffffffff8004747f + TIOCLGET = 0x4004747c + TIOCLSET = 0xffffffff8004747d + TIOCMBIC = 0xffffffff8004746b + TIOCMBIS = 0xffffffff8004746c + TIOCMGET = 0x4004746a + TIOCMIWAIT = 0xffffffff80047464 + TIOCMODG = 0x40047403 + TIOCMODS = 0xffffffff80047404 + TIOCMSET = 0xffffffff8004746d + TIOCM_CAR = 0x40 + TIOCM_CD = 0x40 + TIOCM_CTS = 0x20 + TIOCM_DSR = 0x100 + TIOCM_DTR = 0x2 + TIOCM_LE = 0x1 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_RTS = 0x4 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x20007471 + TIOCNXCL = 0x2000740e + TIOCOUTQ = 0x40047473 + TIOCPKT = 0xffffffff80047470 + TIOCPKT_DATA = 0x0 + TIOCPKT_DOSTOP = 0x20 + TIOCPKT_FLUSHREAD = 0x1 + TIOCPKT_FLUSHWRITE = 0x2 + TIOCPKT_NOSTOP = 0x10 + TIOCPKT_START = 0x8 + TIOCPKT_STOP = 0x4 + TIOCREMOTE = 0xffffffff80047469 + TIOCSBRK = 0x2000747b + TIOCSDTR = 0x20007479 + TIOCSETC = 0xffffffff80067411 + TIOCSETD = 0xffffffff80047401 + TIOCSETN = 0xffffffff8006740a + TIOCSETP = 0xffffffff80067409 + TIOCSLTC = 0xffffffff80067475 + TIOCSPGRP = 0xffffffff80047476 + TIOCSSIZE = 0xffffffff80087467 + TIOCSTART = 0x2000746e + TIOCSTI = 0xffffffff80017472 + TIOCSTOP = 0x2000746f + TIOCSWINSZ = 0xffffffff80087467 + TIOCUCNTL = 0xffffffff80047466 + TOSTOP = 0x10000 + UTIME_NOW = -0x2 + UTIME_OMIT = -0x3 + VDISCRD = 0xc + VDSUSP = 0xa + VEOF = 0x4 + VEOL = 0x5 + VEOL2 = 0x6 + VERASE = 0x2 + VINTR = 0x0 + VKILL = 0x3 + VLNEXT = 0xe + VMIN = 0x4 + VQUIT = 0x1 + VREPRINT = 0xb + VSTART = 0x7 + VSTOP = 0x8 + VSTRT = 0x7 + VSUSP = 0x9 + VT0 = 0x0 + VT1 = 0x8000 + VTDELAY = 0x2000 + VTDLY = 0x8000 + VTIME = 0x5 + VWERSE = 0xd + WPARSTART = 0x1 + WPARSTOP = 0x2 + WPARTTYNAME = "Global" + XCASE = 0x4 + XTABS = 0xc00 + _FDATAFLUSH = 0x2000000000 +) + +// Errors +const ( + E2BIG = syscall.Errno(0x7) + EACCES = syscall.Errno(0xd) + EADDRINUSE = syscall.Errno(0x43) + EADDRNOTAVAIL = syscall.Errno(0x44) + EAFNOSUPPORT = syscall.Errno(0x42) + EAGAIN = syscall.Errno(0xb) + EALREADY = syscall.Errno(0x38) + EBADF = syscall.Errno(0x9) + EBADMSG = syscall.Errno(0x78) + EBUSY = syscall.Errno(0x10) + ECANCELED = syscall.Errno(0x75) + ECHILD = syscall.Errno(0xa) + ECHRNG = syscall.Errno(0x25) + ECLONEME = syscall.Errno(0x52) + ECONNABORTED = syscall.Errno(0x48) + ECONNREFUSED = syscall.Errno(0x4f) + ECONNRESET = syscall.Errno(0x49) + ECORRUPT = syscall.Errno(0x59) + EDEADLK = syscall.Errno(0x2d) + EDESTADDREQ = syscall.Errno(0x3a) + EDESTADDRREQ = syscall.Errno(0x3a) + EDIST = syscall.Errno(0x35) + EDOM = syscall.Errno(0x21) + EDQUOT = syscall.Errno(0x58) + EEXIST = syscall.Errno(0x11) + EFAULT = syscall.Errno(0xe) + EFBIG = syscall.Errno(0x1b) + EFORMAT = syscall.Errno(0x30) + EHOSTDOWN = syscall.Errno(0x50) + EHOSTUNREACH = syscall.Errno(0x51) + EIDRM = syscall.Errno(0x24) + EILSEQ = syscall.Errno(0x74) + EINPROGRESS = syscall.Errno(0x37) + EINTR = syscall.Errno(0x4) + EINVAL = syscall.Errno(0x16) + EIO = syscall.Errno(0x5) + EISCONN = syscall.Errno(0x4b) + EISDIR = syscall.Errno(0x15) + EL2HLT = syscall.Errno(0x2c) + EL2NSYNC = syscall.Errno(0x26) + EL3HLT = syscall.Errno(0x27) + EL3RST = syscall.Errno(0x28) + ELNRNG = syscall.Errno(0x29) + ELOOP = syscall.Errno(0x55) + EMEDIA = syscall.Errno(0x6e) + EMFILE = syscall.Errno(0x18) + EMLINK = syscall.Errno(0x1f) + EMSGSIZE = syscall.Errno(0x3b) + EMULTIHOP = syscall.Errno(0x7d) + ENAMETOOLONG = syscall.Errno(0x56) + ENETDOWN = syscall.Errno(0x45) + ENETRESET = syscall.Errno(0x47) + ENETUNREACH = syscall.Errno(0x46) + ENFILE = syscall.Errno(0x17) + ENOATTR = syscall.Errno(0x70) + ENOBUFS = syscall.Errno(0x4a) + ENOCONNECT = syscall.Errno(0x32) + ENOCSI = syscall.Errno(0x2b) + ENODATA = syscall.Errno(0x7a) + ENODEV = syscall.Errno(0x13) + ENOENT = syscall.Errno(0x2) + ENOEXEC = syscall.Errno(0x8) + ENOLCK = syscall.Errno(0x31) + ENOLINK = syscall.Errno(0x7e) + ENOMEM = syscall.Errno(0xc) + ENOMSG = syscall.Errno(0x23) + ENOPROTOOPT = syscall.Errno(0x3d) + ENOSPC = syscall.Errno(0x1c) + ENOSR = syscall.Errno(0x76) + ENOSTR = syscall.Errno(0x7b) + ENOSYS = syscall.Errno(0x6d) + ENOTBLK = syscall.Errno(0xf) + ENOTCONN = syscall.Errno(0x4c) + ENOTDIR = syscall.Errno(0x14) + ENOTEMPTY = syscall.Errno(0x11) + ENOTREADY = syscall.Errno(0x2e) + ENOTRECOVERABLE = syscall.Errno(0x5e) + ENOTRUST = syscall.Errno(0x72) + ENOTSOCK = syscall.Errno(0x39) + ENOTSUP = syscall.Errno(0x7c) + ENOTTY = syscall.Errno(0x19) + ENXIO = syscall.Errno(0x6) + EOPNOTSUPP = syscall.Errno(0x40) + EOVERFLOW = syscall.Errno(0x7f) + EOWNERDEAD = syscall.Errno(0x5f) + EPERM = syscall.Errno(0x1) + EPFNOSUPPORT = syscall.Errno(0x41) + EPIPE = syscall.Errno(0x20) + EPROCLIM = syscall.Errno(0x53) + EPROTO = syscall.Errno(0x79) + EPROTONOSUPPORT = syscall.Errno(0x3e) + EPROTOTYPE = syscall.Errno(0x3c) + ERANGE = syscall.Errno(0x22) + EREMOTE = syscall.Errno(0x5d) + ERESTART = syscall.Errno(0x52) + EROFS = syscall.Errno(0x1e) + ESAD = syscall.Errno(0x71) + ESHUTDOWN = syscall.Errno(0x4d) + ESOCKTNOSUPPORT = syscall.Errno(0x3f) + ESOFT = syscall.Errno(0x6f) + ESPIPE = syscall.Errno(0x1d) + ESRCH = syscall.Errno(0x3) + ESTALE = syscall.Errno(0x34) + ESYSERROR = syscall.Errno(0x5a) + ETIME = syscall.Errno(0x77) + ETIMEDOUT = syscall.Errno(0x4e) + ETOOMANYREFS = syscall.Errno(0x73) + ETXTBSY = syscall.Errno(0x1a) + EUNATCH = syscall.Errno(0x2a) + EUSERS = syscall.Errno(0x54) + EWOULDBLOCK = syscall.Errno(0xb) + EWRPROTECT = syscall.Errno(0x2f) + EXDEV = syscall.Errno(0x12) +) + +// Signals +const ( + SIGABRT = syscall.Signal(0x6) + SIGAIO = syscall.Signal(0x17) + SIGALRM = syscall.Signal(0xe) + SIGALRM1 = syscall.Signal(0x26) + SIGBUS = syscall.Signal(0xa) + SIGCAPI = syscall.Signal(0x31) + SIGCHLD = syscall.Signal(0x14) + SIGCLD = syscall.Signal(0x14) + SIGCONT = syscall.Signal(0x13) + SIGCPUFAIL = syscall.Signal(0x3b) + SIGDANGER = syscall.Signal(0x21) + SIGEMT = syscall.Signal(0x7) + SIGFPE = syscall.Signal(0x8) + SIGGRANT = syscall.Signal(0x3c) + SIGHUP = syscall.Signal(0x1) + SIGILL = syscall.Signal(0x4) + SIGINT = syscall.Signal(0x2) + SIGIO = syscall.Signal(0x17) + SIGIOINT = syscall.Signal(0x10) + SIGIOT = syscall.Signal(0x6) + SIGKAP = syscall.Signal(0x3c) + SIGKILL = syscall.Signal(0x9) + SIGLOST = syscall.Signal(0x6) + SIGMAX = syscall.Signal(0xff) + SIGMAX32 = syscall.Signal(0x3f) + SIGMIGRATE = syscall.Signal(0x23) + SIGMSG = syscall.Signal(0x1b) + SIGPIPE = syscall.Signal(0xd) + SIGPOLL = syscall.Signal(0x17) + SIGPRE = syscall.Signal(0x24) + SIGPROF = syscall.Signal(0x20) + SIGPTY = syscall.Signal(0x17) + SIGPWR = syscall.Signal(0x1d) + SIGQUIT = syscall.Signal(0x3) + SIGRECONFIG = syscall.Signal(0x3a) + SIGRETRACT = syscall.Signal(0x3d) + SIGSAK = syscall.Signal(0x3f) + SIGSEGV = syscall.Signal(0xb) + SIGSOUND = syscall.Signal(0x3e) + SIGSTOP = syscall.Signal(0x11) + SIGSYS = syscall.Signal(0xc) + SIGSYSERROR = syscall.Signal(0x30) + SIGTALRM = syscall.Signal(0x26) + SIGTERM = syscall.Signal(0xf) + SIGTRAP = syscall.Signal(0x5) + SIGTSTP = syscall.Signal(0x12) + SIGTTIN = syscall.Signal(0x15) + SIGTTOU = syscall.Signal(0x16) + SIGURG = syscall.Signal(0x10) + SIGUSR1 = syscall.Signal(0x1e) + SIGUSR2 = syscall.Signal(0x1f) + SIGVIRT = syscall.Signal(0x25) + SIGVTALRM = syscall.Signal(0x22) + SIGWAITING = syscall.Signal(0x27) + SIGWINCH = syscall.Signal(0x1c) + SIGXCPU = syscall.Signal(0x18) + SIGXFSZ = syscall.Signal(0x19) +) + +// Error table +var errorList = [...]struct { + num syscall.Errno + name string + desc string +}{ + {1, "EPERM", "not owner"}, + {2, "ENOENT", "no such file or directory"}, + {3, "ESRCH", "no such process"}, + {4, "EINTR", "interrupted system call"}, + {5, "EIO", "I/O error"}, + {6, "ENXIO", "no such device or address"}, + {7, "E2BIG", "arg list too long"}, + {8, "ENOEXEC", "exec format error"}, + {9, "EBADF", "bad file number"}, + {10, "ECHILD", "no child processes"}, + {11, "EWOULDBLOCK", "resource temporarily unavailable"}, + {12, "ENOMEM", "not enough space"}, + {13, "EACCES", "permission denied"}, + {14, "EFAULT", "bad address"}, + {15, "ENOTBLK", "block device required"}, + {16, "EBUSY", "device busy"}, + {17, "ENOTEMPTY", "file exists"}, + {18, "EXDEV", "cross-device link"}, + {19, "ENODEV", "no such device"}, + {20, "ENOTDIR", "not a directory"}, + {21, "EISDIR", "is a directory"}, + {22, "EINVAL", "invalid argument"}, + {23, "ENFILE", "file table overflow"}, + {24, "EMFILE", "too many open files"}, + {25, "ENOTTY", "not a typewriter"}, + {26, "ETXTBSY", "text file busy"}, + {27, "EFBIG", "file too large"}, + {28, "ENOSPC", "no space left on device"}, + {29, "ESPIPE", "illegal seek"}, + {30, "EROFS", "read-only file system"}, + {31, "EMLINK", "too many links"}, + {32, "EPIPE", "broken pipe"}, + {33, "EDOM", "argument out of domain"}, + {34, "ERANGE", "result too large"}, + {35, "ENOMSG", "no message of desired type"}, + {36, "EIDRM", "identifier removed"}, + {37, "ECHRNG", "channel number out of range"}, + {38, "EL2NSYNC", "level 2 not synchronized"}, + {39, "EL3HLT", "level 3 halted"}, + {40, "EL3RST", "level 3 reset"}, + {41, "ELNRNG", "link number out of range"}, + {42, "EUNATCH", "protocol driver not attached"}, + {43, "ENOCSI", "no CSI structure available"}, + {44, "EL2HLT", "level 2 halted"}, + {45, "EDEADLK", "deadlock condition if locked"}, + {46, "ENOTREADY", "device not ready"}, + {47, "EWRPROTECT", "write-protected media"}, + {48, "EFORMAT", "unformatted or incompatible media"}, + {49, "ENOLCK", "no locks available"}, + {50, "ENOCONNECT", "cannot Establish Connection"}, + {52, "ESTALE", "missing file or filesystem"}, + {53, "EDIST", "requests blocked by Administrator"}, + {55, "EINPROGRESS", "operation now in progress"}, + {56, "EALREADY", "operation already in progress"}, + {57, "ENOTSOCK", "socket operation on non-socket"}, + {58, "EDESTADDREQ", "destination address required"}, + {59, "EMSGSIZE", "message too long"}, + {60, "EPROTOTYPE", "protocol wrong type for socket"}, + {61, "ENOPROTOOPT", "protocol not available"}, + {62, "EPROTONOSUPPORT", "protocol not supported"}, + {63, "ESOCKTNOSUPPORT", "socket type not supported"}, + {64, "EOPNOTSUPP", "operation not supported on socket"}, + {65, "EPFNOSUPPORT", "protocol family not supported"}, + {66, "EAFNOSUPPORT", "addr family not supported by protocol"}, + {67, "EADDRINUSE", "address already in use"}, + {68, "EADDRNOTAVAIL", "can't assign requested address"}, + {69, "ENETDOWN", "network is down"}, + {70, "ENETUNREACH", "network is unreachable"}, + {71, "ENETRESET", "network dropped connection on reset"}, + {72, "ECONNABORTED", "software caused connection abort"}, + {73, "ECONNRESET", "connection reset by peer"}, + {74, "ENOBUFS", "no buffer space available"}, + {75, "EISCONN", "socket is already connected"}, + {76, "ENOTCONN", "socket is not connected"}, + {77, "ESHUTDOWN", "can't send after socket shutdown"}, + {78, "ETIMEDOUT", "connection timed out"}, + {79, "ECONNREFUSED", "connection refused"}, + {80, "EHOSTDOWN", "host is down"}, + {81, "EHOSTUNREACH", "no route to host"}, + {82, "ERESTART", "restart the system call"}, + {83, "EPROCLIM", "too many processes"}, + {84, "EUSERS", "too many users"}, + {85, "ELOOP", "too many levels of symbolic links"}, + {86, "ENAMETOOLONG", "file name too long"}, + {88, "EDQUOT", "disk quota exceeded"}, + {89, "ECORRUPT", "invalid file system control data detected"}, + {90, "ESYSERROR", "for future use "}, + {93, "EREMOTE", "item is not local to host"}, + {94, "ENOTRECOVERABLE", "state not recoverable "}, + {95, "EOWNERDEAD", "previous owner died "}, + {109, "ENOSYS", "function not implemented"}, + {110, "EMEDIA", "media surface error"}, + {111, "ESOFT", "I/O completed, but needs relocation"}, + {112, "ENOATTR", "no attribute found"}, + {113, "ESAD", "security Authentication Denied"}, + {114, "ENOTRUST", "not a Trusted Program"}, + {115, "ETOOMANYREFS", "too many references: can't splice"}, + {116, "EILSEQ", "invalid wide character"}, + {117, "ECANCELED", "asynchronous I/O cancelled"}, + {118, "ENOSR", "out of STREAMS resources"}, + {119, "ETIME", "system call timed out"}, + {120, "EBADMSG", "next message has wrong type"}, + {121, "EPROTO", "error in protocol"}, + {122, "ENODATA", "no message on stream head read q"}, + {123, "ENOSTR", "fd not associated with a stream"}, + {124, "ENOTSUP", "unsupported attribute value"}, + {125, "EMULTIHOP", "multihop is not allowed"}, + {126, "ENOLINK", "the server link has been severed"}, + {127, "EOVERFLOW", "value too large to be stored in data type"}, +} + +// Signal table +var signalList = [...]struct { + num syscall.Signal + name string + desc string +}{ + {1, "SIGHUP", "hangup"}, + {2, "SIGINT", "interrupt"}, + {3, "SIGQUIT", "quit"}, + {4, "SIGILL", "illegal instruction"}, + {5, "SIGTRAP", "trace/BPT trap"}, + {6, "SIGIOT", "IOT/Abort trap"}, + {7, "SIGEMT", "EMT trap"}, + {8, "SIGFPE", "floating point exception"}, + {9, "SIGKILL", "killed"}, + {10, "SIGBUS", "bus error"}, + {11, "SIGSEGV", "segmentation fault"}, + {12, "SIGSYS", "bad system call"}, + {13, "SIGPIPE", "broken pipe"}, + {14, "SIGALRM", "alarm clock"}, + {15, "SIGTERM", "terminated"}, + {16, "SIGURG", "urgent I/O condition"}, + {17, "SIGSTOP", "stopped (signal)"}, + {18, "SIGTSTP", "stopped"}, + {19, "SIGCONT", "continued"}, + {20, "SIGCHLD", "child exited"}, + {21, "SIGTTIN", "stopped (tty input)"}, + {22, "SIGTTOU", "stopped (tty output)"}, + {23, "SIGIO", "I/O possible/complete"}, + {24, "SIGXCPU", "cputime limit exceeded"}, + {25, "SIGXFSZ", "filesize limit exceeded"}, + {27, "SIGMSG", "input device data"}, + {28, "SIGWINCH", "window size changes"}, + {29, "SIGPWR", "power-failure"}, + {30, "SIGUSR1", "user defined signal 1"}, + {31, "SIGUSR2", "user defined signal 2"}, + {32, "SIGPROF", "profiling timer expired"}, + {33, "SIGDANGER", "paging space low"}, + {34, "SIGVTALRM", "virtual timer expired"}, + {35, "SIGMIGRATE", "signal 35"}, + {36, "SIGPRE", "signal 36"}, + {37, "SIGVIRT", "signal 37"}, + {38, "SIGTALRM", "signal 38"}, + {39, "SIGWAITING", "signal 39"}, + {48, "SIGSYSERROR", "signal 48"}, + {49, "SIGCAPI", "signal 49"}, + {58, "SIGRECONFIG", "signal 58"}, + {59, "SIGCPUFAIL", "CPU Failure Predicted"}, + {60, "SIGGRANT", "monitor mode granted"}, + {61, "SIGRETRACT", "monitor mode retracted"}, + {62, "SIGSOUND", "sound completed"}, + {63, "SIGMAX32", "secure attention"}, + {255, "SIGMAX", "signal 255"}, +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go index 46a082b6d59f2..bbe6089bb7ecb 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go @@ -3,7 +3,7 @@ // +build amd64,dragonfly -// Created by cgo -godefs - DO NOT EDIT +// Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go package unix @@ -880,6 +880,40 @@ const ( MAP_VPAGETABLE = 0x2000 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_ASYNC = 0x40 + MNT_AUTOMOUNTED = 0x20 + MNT_CMDFLAGS = 0xf0000 + MNT_DEFEXPORTED = 0x200 + MNT_DELEXPORT = 0x20000 + MNT_EXKERB = 0x800 + MNT_EXPORTANON = 0x400 + MNT_EXPORTED = 0x100 + MNT_EXPUBLIC = 0x20000000 + MNT_EXRDONLY = 0x80 + MNT_FORCE = 0x80000 + MNT_IGNORE = 0x800000 + MNT_LAZY = 0x4 + MNT_LOCAL = 0x1000 + MNT_NOATIME = 0x10000000 + MNT_NOCLUSTERR = 0x40000000 + MNT_NOCLUSTERW = 0x80000000 + MNT_NODEV = 0x10 + MNT_NOEXEC = 0x4 + MNT_NOSUID = 0x8 + MNT_NOSYMFOLLOW = 0x400000 + MNT_NOWAIT = 0x2 + MNT_QUOTA = 0x2000 + MNT_RDONLY = 0x1 + MNT_RELOAD = 0x40000 + MNT_ROOTFS = 0x4000 + MNT_SOFTDEP = 0x200000 + MNT_SUIDDIR = 0x100000 + MNT_SYNCHRONOUS = 0x2 + MNT_TRIM = 0x1000000 + MNT_UPDATE = 0x10000 + MNT_USER = 0x8000 + MNT_VISFLAGMASK = 0xf1f0ffff + MNT_WAIT = 0x1 MSG_CMSG_CLOEXEC = 0x1000 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 @@ -1168,6 +1202,36 @@ const ( SO_TIMESTAMP = 0x400 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDB = 0x9000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IFWHT = 0xe000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISTXT = 0x200 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go index 2947dc0382e4d..d2bbaabc87faa 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go @@ -1345,6 +1345,35 @@ const ( SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IFWHT = 0xe000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISTXT = 0x200 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go index c600d012d069d..4f8db783d3cc0 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go @@ -1346,6 +1346,35 @@ const ( SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IFWHT = 0xe000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISTXT = 0x200 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go index e8240d2397b2e..53e5de605184a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go @@ -1354,6 +1354,35 @@ const ( SO_USELOOPBACK = 0x40 SO_USER_COOKIE = 0x1015 SO_VENDOR = 0x80000000 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IFWHT = 0xe000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISTXT = 0x200 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TAB0 = 0x0 TAB3 = 0x4 TABDLY = 0x4 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 2f0091bbc9204..db3c31ef88095 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -499,6 +500,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -636,7 +639,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -763,6 +766,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -875,6 +879,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -956,6 +980,7 @@ const ( MAP_EXECUTABLE = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -966,11 +991,30 @@ const ( MAP_POPULATE = 0x8000 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -979,6 +1023,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1076,6 +1122,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1245,6 +1293,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8008743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40087446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x400c744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40087447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1427,6 +1505,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x9 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1469,7 +1550,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1537,6 +1618,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1557,6 +1639,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1571,11 +1654,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1590,8 +1674,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1605,17 +1689,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1635,7 +1724,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1691,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1780,6 +1874,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 @@ -1838,6 +1933,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1875,6 +1971,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1938,6 +2037,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2105,6 +2206,21 @@ const ( 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_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2242,6 +2358,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index a80c7ae5fb433..4785835b6bd99 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -499,6 +500,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -636,7 +639,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -763,6 +766,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -875,6 +879,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -956,6 +980,7 @@ const ( MAP_EXECUTABLE = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -966,11 +991,30 @@ const ( MAP_POPULATE = 0x8000 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -979,6 +1023,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1076,6 +1122,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1245,6 +1293,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1428,6 +1506,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x9 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1470,7 +1551,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1538,6 +1619,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1558,6 +1640,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1572,11 +1655,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1591,8 +1675,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1606,17 +1690,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1636,7 +1725,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1692,6 +1783,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1781,6 +1875,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 @@ -1839,6 +1934,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1876,6 +1972,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1939,6 +2038,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2106,6 +2207,21 @@ const ( 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_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2242,6 +2358,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 49a9b0133bb31..5e902423a10ff 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -964,11 +989,30 @@ const ( MAP_POPULATE = 0x8000 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -977,6 +1021,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1074,6 +1120,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1243,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40042406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8008743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40087446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x400c744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40087447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1434,6 +1512,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x9 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1476,7 +1557,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1544,6 +1625,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1564,6 +1646,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1578,11 +1661,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1597,8 +1681,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1612,17 +1696,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1642,7 +1731,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1698,6 +1789,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1787,6 +1881,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 @@ -1845,6 +1940,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1882,6 +1978,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1945,6 +2044,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2112,6 +2213,21 @@ const ( 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_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2248,6 +2364,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 8d70233b260b5..ebe9d8b411ac0 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -501,6 +502,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -638,7 +641,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -765,6 +768,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -877,6 +881,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -957,6 +981,7 @@ const ( MAP_EXECUTABLE = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -967,11 +992,30 @@ const ( MAP_POPULATE = 0x8000 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -980,6 +1024,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1077,6 +1123,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1246,6 +1294,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1418,6 +1496,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x9 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1460,7 +1541,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1528,6 +1609,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1548,6 +1630,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1562,11 +1645,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1581,8 +1665,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1596,17 +1680,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1626,7 +1715,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1682,6 +1773,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1771,6 +1865,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 @@ -1829,6 +1924,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1867,6 +1963,9 @@ const ( STATX_UID = 0x8 STATX__RESERVED = 0x80000000 SVE_MAGIC = 0x53564501 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1930,6 +2029,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2097,6 +2198,21 @@ const ( 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_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2233,6 +2349,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 410ab56b095b6..d467d211b5199 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_HUGE_MASK = 0x3f @@ -965,11 +990,29 @@ const ( MAP_PRIVATE = 0x2 MAP_RENAME = 0x800 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -978,6 +1021,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1075,6 +1120,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1244,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4008743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80087446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x800c744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80087447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1428,6 +1505,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x6 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1470,7 +1550,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1538,6 +1618,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1558,6 +1639,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1572,11 +1654,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1591,8 +1674,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1606,17 +1689,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1636,7 +1724,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1692,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1781,6 +1874,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 @@ -1840,6 +1934,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1877,6 +1972,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1939,6 +2037,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2108,6 +2208,21 @@ const ( TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2245,6 +2360,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index dac4d90fada6d..9c293ed13c57a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_HUGE_MASK = 0x3f @@ -965,11 +990,29 @@ const ( MAP_PRIVATE = 0x2 MAP_RENAME = 0x800 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -978,6 +1021,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1075,6 +1120,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1244,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1428,6 +1505,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x6 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1470,7 +1550,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1538,6 +1618,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1558,6 +1639,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1572,11 +1654,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1591,8 +1674,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1606,17 +1689,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1636,7 +1724,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1692,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1781,6 +1874,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 @@ -1840,6 +1934,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1877,6 +1972,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1939,6 +2037,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2108,6 +2208,21 @@ const ( TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2245,6 +2360,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 1d2f0e6382b78..e2162508c8e98 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_HUGE_MASK = 0x3f @@ -965,11 +990,29 @@ const ( MAP_PRIVATE = 0x2 MAP_RENAME = 0x800 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -978,6 +1021,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1075,6 +1120,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1244,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1428,6 +1505,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x6 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1470,7 +1550,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1538,6 +1618,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1558,6 +1639,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1572,11 +1654,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1591,8 +1674,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1606,17 +1689,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1636,7 +1724,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1692,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1781,6 +1874,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 @@ -1840,6 +1934,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1877,6 +1972,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1939,6 +2037,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2108,6 +2208,21 @@ const ( TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2245,6 +2360,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 33b9940234979..836c0c654edba 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x4000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x1000 MAP_HUGETLB = 0x80000 MAP_HUGE_MASK = 0x3f @@ -965,11 +990,29 @@ const ( MAP_PRIVATE = 0x2 MAP_RENAME = 0x800 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x40000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -978,6 +1021,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1075,6 +1120,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1244,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80042406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4008743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80087446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x800c744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80087447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1428,6 +1505,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x6 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1470,7 +1550,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1538,6 +1618,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1558,6 +1639,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1572,11 +1654,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1591,8 +1674,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1606,17 +1689,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1636,7 +1724,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1692,6 +1782,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x40047309 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1781,6 +1874,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1009 SO_ATTACH_BPF = 0x32 @@ -1840,6 +1934,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x1008 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1877,6 +1972,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1939,6 +2037,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2108,6 +2208,21 @@ const ( TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2245,6 +2360,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index c78d669761b39..7ca61843172d7 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x400 IXON = 0x200 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -964,11 +989,29 @@ const ( MAP_POPULATE = 0x8000 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 MAP_TYPE = 0xf MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -977,6 +1020,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1074,6 +1119,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1245,6 +1292,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1484,6 +1561,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x9 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1526,7 +1606,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1594,6 +1674,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1614,6 +1695,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1628,11 +1710,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1647,8 +1730,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1662,17 +1745,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1692,7 +1780,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1748,6 +1838,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1837,6 +1930,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 @@ -1895,6 +1989,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1932,6 +2027,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1993,6 +2091,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2166,6 +2266,21 @@ const ( TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2302,6 +2417,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4000 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0xc00 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 63493756d89b6..839ac214cd183 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x400 IXON = 0x200 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -964,11 +989,29 @@ const ( MAP_POPULATE = 0x8000 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 MAP_TYPE = 0xf MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -977,6 +1020,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1074,6 +1119,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1245,6 +1292,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1484,6 +1561,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x9 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1526,7 +1606,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1594,6 +1674,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1614,6 +1695,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1628,11 +1710,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1647,8 +1730,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1662,17 +1745,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1692,7 +1780,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1748,6 +1838,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1837,6 +1930,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 @@ -1895,6 +1989,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1932,6 +2027,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1993,6 +2091,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2166,6 +2266,21 @@ const ( TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2302,6 +2417,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4000 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0xc00 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go new file mode 100644 index 0000000000000..a747aa1b71337 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -0,0 +1,2725 @@ +// mkerrors.sh -Wall -Werror -static -I/tmp/include +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build riscv64,linux + +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go + +package unix + +import "syscall" + +const ( + AAFS_MAGIC = 0x5a3c69f0 + ADFS_SUPER_MAGIC = 0xadf5 + AFFS_SUPER_MAGIC = 0xadff + AFS_FS_MAGIC = 0x6b414653 + AFS_SUPER_MAGIC = 0x5346414f + AF_ALG = 0x26 + AF_APPLETALK = 0x5 + AF_ASH = 0x12 + AF_ATMPVC = 0x8 + AF_ATMSVC = 0x14 + AF_AX25 = 0x3 + AF_BLUETOOTH = 0x1f + AF_BRIDGE = 0x7 + AF_CAIF = 0x25 + AF_CAN = 0x1d + AF_DECnet = 0xc + AF_ECONET = 0x13 + AF_FILE = 0x1 + AF_IB = 0x1b + AF_IEEE802154 = 0x24 + AF_INET = 0x2 + AF_INET6 = 0xa + AF_IPX = 0x4 + AF_IRDA = 0x17 + AF_ISDN = 0x22 + AF_IUCV = 0x20 + AF_KCM = 0x29 + AF_KEY = 0xf + AF_LLC = 0x1a + AF_LOCAL = 0x1 + AF_MAX = 0x2c + AF_MPLS = 0x1c + AF_NETBEUI = 0xd + AF_NETLINK = 0x10 + AF_NETROM = 0x6 + AF_NFC = 0x27 + AF_PACKET = 0x11 + AF_PHONET = 0x23 + AF_PPPOX = 0x18 + AF_QIPCRTR = 0x2a + AF_RDS = 0x15 + AF_ROSE = 0xb + AF_ROUTE = 0x10 + AF_RXRPC = 0x21 + AF_SECURITY = 0xe + AF_SMC = 0x2b + AF_SNA = 0x16 + AF_TIPC = 0x1e + AF_UNIX = 0x1 + AF_UNSPEC = 0x0 + AF_VSOCK = 0x28 + AF_WANPIPE = 0x19 + AF_X25 = 0x9 + AF_XDP = 0x2c + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 + ANON_INODE_FS_MAGIC = 0x9041934 + ARPHRD_6LOWPAN = 0x339 + ARPHRD_ADAPT = 0x108 + ARPHRD_APPLETLK = 0x8 + ARPHRD_ARCNET = 0x7 + ARPHRD_ASH = 0x30d + ARPHRD_ATM = 0x13 + ARPHRD_AX25 = 0x3 + ARPHRD_BIF = 0x307 + ARPHRD_CAIF = 0x336 + ARPHRD_CAN = 0x118 + ARPHRD_CHAOS = 0x5 + ARPHRD_CISCO = 0x201 + ARPHRD_CSLIP = 0x101 + ARPHRD_CSLIP6 = 0x103 + ARPHRD_DDCMP = 0x205 + ARPHRD_DLCI = 0xf + ARPHRD_ECONET = 0x30e + ARPHRD_EETHER = 0x2 + ARPHRD_ETHER = 0x1 + ARPHRD_EUI64 = 0x1b + ARPHRD_FCAL = 0x311 + ARPHRD_FCFABRIC = 0x313 + ARPHRD_FCPL = 0x312 + ARPHRD_FCPP = 0x310 + ARPHRD_FDDI = 0x306 + ARPHRD_FRAD = 0x302 + ARPHRD_HDLC = 0x201 + ARPHRD_HIPPI = 0x30c + ARPHRD_HWX25 = 0x110 + ARPHRD_IEEE1394 = 0x18 + ARPHRD_IEEE802 = 0x6 + ARPHRD_IEEE80211 = 0x321 + ARPHRD_IEEE80211_PRISM = 0x322 + ARPHRD_IEEE80211_RADIOTAP = 0x323 + ARPHRD_IEEE802154 = 0x324 + ARPHRD_IEEE802154_MONITOR = 0x325 + ARPHRD_IEEE802_TR = 0x320 + ARPHRD_INFINIBAND = 0x20 + ARPHRD_IP6GRE = 0x337 + ARPHRD_IPDDP = 0x309 + ARPHRD_IPGRE = 0x30a + ARPHRD_IRDA = 0x30f + ARPHRD_LAPB = 0x204 + ARPHRD_LOCALTLK = 0x305 + ARPHRD_LOOPBACK = 0x304 + ARPHRD_METRICOM = 0x17 + ARPHRD_NETLINK = 0x338 + ARPHRD_NETROM = 0x0 + ARPHRD_NONE = 0xfffe + ARPHRD_PHONET = 0x334 + ARPHRD_PHONET_PIPE = 0x335 + ARPHRD_PIMREG = 0x30b + ARPHRD_PPP = 0x200 + ARPHRD_PRONET = 0x4 + ARPHRD_RAWHDLC = 0x206 + ARPHRD_RAWIP = 0x207 + ARPHRD_ROSE = 0x10e + ARPHRD_RSRVD = 0x104 + ARPHRD_SIT = 0x308 + ARPHRD_SKIP = 0x303 + ARPHRD_SLIP = 0x100 + ARPHRD_SLIP6 = 0x102 + ARPHRD_TUNNEL = 0x300 + ARPHRD_TUNNEL6 = 0x301 + ARPHRD_VOID = 0xffff + ARPHRD_VSOCKMON = 0x33a + ARPHRD_X25 = 0x10f + AUTOFS_SUPER_MAGIC = 0x187 + B0 = 0x0 + B1000000 = 0x1008 + B110 = 0x3 + B115200 = 0x1002 + B1152000 = 0x1009 + B1200 = 0x9 + B134 = 0x4 + B150 = 0x5 + B1500000 = 0x100a + B1800 = 0xa + B19200 = 0xe + B200 = 0x6 + B2000000 = 0x100b + B230400 = 0x1003 + B2400 = 0xb + B2500000 = 0x100c + B300 = 0x7 + B3000000 = 0x100d + B3500000 = 0x100e + B38400 = 0xf + B4000000 = 0x100f + B460800 = 0x1004 + B4800 = 0xc + B50 = 0x1 + B500000 = 0x1005 + B57600 = 0x1001 + B576000 = 0x1006 + B600 = 0x8 + B75 = 0x2 + B921600 = 0x1007 + B9600 = 0xd + BALLOON_KVM_MAGIC = 0x13661366 + BDEVFS_MAGIC = 0x62646576 + BINFMTFS_MAGIC = 0x42494e4d + BLKBSZGET = 0x80081270 + BLKBSZSET = 0x40081271 + BLKFLSBUF = 0x1261 + BLKFRAGET = 0x1265 + BLKFRASET = 0x1264 + BLKGETSIZE = 0x1260 + BLKGETSIZE64 = 0x80081272 + BLKPBSZGET = 0x127b + BLKRAGET = 0x1263 + BLKRASET = 0x1262 + BLKROGET = 0x125e + BLKROSET = 0x125d + BLKRRPART = 0x125f + BLKSECTGET = 0x1267 + BLKSECTSET = 0x1266 + BLKSSZGET = 0x1268 + BOTHER = 0x1000 + BPF_A = 0x10 + BPF_ABS = 0x20 + BPF_ADD = 0x0 + BPF_ALU = 0x4 + BPF_AND = 0x50 + BPF_B = 0x10 + BPF_DIV = 0x30 + BPF_FS_MAGIC = 0xcafe4a11 + BPF_H = 0x8 + BPF_IMM = 0x0 + BPF_IND = 0x40 + BPF_JA = 0x0 + BPF_JEQ = 0x10 + BPF_JGE = 0x30 + BPF_JGT = 0x20 + BPF_JMP = 0x5 + BPF_JSET = 0x40 + BPF_K = 0x0 + BPF_LD = 0x0 + BPF_LDX = 0x1 + BPF_LEN = 0x80 + BPF_LL_OFF = -0x200000 + BPF_LSH = 0x60 + BPF_MAJOR_VERSION = 0x1 + BPF_MAXINSNS = 0x1000 + BPF_MEM = 0x60 + BPF_MEMWORDS = 0x10 + BPF_MINOR_VERSION = 0x1 + BPF_MISC = 0x7 + BPF_MOD = 0x90 + BPF_MSH = 0xa0 + BPF_MUL = 0x20 + BPF_NEG = 0x80 + BPF_NET_OFF = -0x100000 + BPF_OR = 0x40 + BPF_RET = 0x6 + BPF_RSH = 0x70 + BPF_ST = 0x2 + BPF_STX = 0x3 + BPF_SUB = 0x10 + BPF_TAX = 0x0 + BPF_TXA = 0x80 + BPF_W = 0x0 + BPF_X = 0x8 + BPF_XOR = 0xa0 + BRKINT = 0x2 + BS0 = 0x0 + BS1 = 0x2000 + BSDLY = 0x2000 + BTRFS_SUPER_MAGIC = 0x9123683e + BTRFS_TEST_MAGIC = 0x73727279 + CAN_BCM = 0x2 + CAN_EFF_FLAG = 0x80000000 + CAN_EFF_ID_BITS = 0x1d + CAN_EFF_MASK = 0x1fffffff + CAN_ERR_FLAG = 0x20000000 + CAN_ERR_MASK = 0x1fffffff + CAN_INV_FILTER = 0x20000000 + CAN_ISOTP = 0x6 + CAN_MAX_DLC = 0x8 + CAN_MAX_DLEN = 0x8 + CAN_MCNET = 0x5 + CAN_MTU = 0x10 + CAN_NPROTO = 0x7 + CAN_RAW = 0x1 + CAN_RAW_FILTER_MAX = 0x200 + CAN_RTR_FLAG = 0x40000000 + CAN_SFF_ID_BITS = 0xb + CAN_SFF_MASK = 0x7ff + CAN_TP16 = 0x3 + CAN_TP20 = 0x4 + CBAUD = 0x100f + CBAUDEX = 0x1000 + CFLUSH = 0xf + CGROUP2_SUPER_MAGIC = 0x63677270 + CGROUP_SUPER_MAGIC = 0x27e0eb + CIBAUD = 0x100f0000 + CLOCAL = 0x800 + CLOCK_BOOTTIME = 0x7 + CLOCK_BOOTTIME_ALARM = 0x9 + CLOCK_DEFAULT = 0x0 + CLOCK_EXT = 0x1 + CLOCK_INT = 0x2 + CLOCK_MONOTONIC = 0x1 + CLOCK_MONOTONIC_COARSE = 0x6 + CLOCK_MONOTONIC_RAW = 0x4 + CLOCK_PROCESS_CPUTIME_ID = 0x2 + CLOCK_REALTIME = 0x0 + CLOCK_REALTIME_ALARM = 0x8 + CLOCK_REALTIME_COARSE = 0x5 + CLOCK_TAI = 0xb + CLOCK_THREAD_CPUTIME_ID = 0x3 + CLOCK_TXFROMRX = 0x4 + CLOCK_TXINT = 0x3 + CLONE_CHILD_CLEARTID = 0x200000 + CLONE_CHILD_SETTID = 0x1000000 + CLONE_DETACHED = 0x400000 + CLONE_FILES = 0x400 + CLONE_FS = 0x200 + CLONE_IO = 0x80000000 + CLONE_NEWCGROUP = 0x2000000 + CLONE_NEWIPC = 0x8000000 + CLONE_NEWNET = 0x40000000 + CLONE_NEWNS = 0x20000 + CLONE_NEWPID = 0x20000000 + CLONE_NEWUSER = 0x10000000 + CLONE_NEWUTS = 0x4000000 + CLONE_PARENT = 0x8000 + CLONE_PARENT_SETTID = 0x100000 + CLONE_PTRACE = 0x2000 + CLONE_SETTLS = 0x80000 + CLONE_SIGHAND = 0x800 + CLONE_SYSVSEM = 0x40000 + CLONE_THREAD = 0x10000 + CLONE_UNTRACED = 0x800000 + CLONE_VFORK = 0x4000 + CLONE_VM = 0x100 + CMSPAR = 0x40000000 + CODA_SUPER_MAGIC = 0x73757245 + CR0 = 0x0 + CR1 = 0x200 + CR2 = 0x400 + CR3 = 0x600 + CRAMFS_MAGIC = 0x28cd3d45 + CRDLY = 0x600 + CREAD = 0x80 + CRTSCTS = 0x80000000 + CS5 = 0x0 + CS6 = 0x10 + CS7 = 0x20 + CS8 = 0x30 + CSIGNAL = 0xff + CSIZE = 0x30 + CSTART = 0x11 + CSTATUS = 0x0 + CSTOP = 0x13 + CSTOPB = 0x40 + CSUSP = 0x1a + DAXFS_MAGIC = 0x64646178 + DEBUGFS_MAGIC = 0x64626720 + DEVPTS_SUPER_MAGIC = 0x1cd1 + DT_BLK = 0x6 + DT_CHR = 0x2 + DT_DIR = 0x4 + DT_FIFO = 0x1 + DT_LNK = 0xa + DT_REG = 0x8 + DT_SOCK = 0xc + DT_UNKNOWN = 0x0 + DT_WHT = 0xe + ECHO = 0x8 + ECHOCTL = 0x200 + ECHOE = 0x10 + ECHOK = 0x20 + ECHOKE = 0x800 + ECHONL = 0x40 + ECHOPRT = 0x400 + ECRYPTFS_SUPER_MAGIC = 0xf15f + EFD_CLOEXEC = 0x80000 + EFD_NONBLOCK = 0x800 + EFD_SEMAPHORE = 0x1 + EFIVARFS_MAGIC = 0xde5e81e4 + EFS_SUPER_MAGIC = 0x414a53 + ENCODING_DEFAULT = 0x0 + ENCODING_FM_MARK = 0x3 + ENCODING_FM_SPACE = 0x4 + ENCODING_MANCHESTER = 0x5 + ENCODING_NRZ = 0x1 + ENCODING_NRZI = 0x2 + EPOLLERR = 0x8 + EPOLLET = 0x80000000 + EPOLLEXCLUSIVE = 0x10000000 + EPOLLHUP = 0x10 + EPOLLIN = 0x1 + EPOLLMSG = 0x400 + EPOLLONESHOT = 0x40000000 + EPOLLOUT = 0x4 + EPOLLPRI = 0x2 + EPOLLRDBAND = 0x80 + EPOLLRDHUP = 0x2000 + EPOLLRDNORM = 0x40 + EPOLLWAKEUP = 0x20000000 + EPOLLWRBAND = 0x200 + EPOLLWRNORM = 0x100 + EPOLL_CLOEXEC = 0x80000 + EPOLL_CTL_ADD = 0x1 + EPOLL_CTL_DEL = 0x2 + EPOLL_CTL_MOD = 0x3 + ETH_P_1588 = 0x88f7 + ETH_P_8021AD = 0x88a8 + ETH_P_8021AH = 0x88e7 + ETH_P_8021Q = 0x8100 + ETH_P_80221 = 0x8917 + ETH_P_802_2 = 0x4 + ETH_P_802_3 = 0x1 + ETH_P_802_3_MIN = 0x600 + ETH_P_802_EX1 = 0x88b5 + ETH_P_AARP = 0x80f3 + ETH_P_AF_IUCV = 0xfbfb + ETH_P_ALL = 0x3 + ETH_P_AOE = 0x88a2 + ETH_P_ARCNET = 0x1a + ETH_P_ARP = 0x806 + ETH_P_ATALK = 0x809b + ETH_P_ATMFATE = 0x8884 + ETH_P_ATMMPOA = 0x884c + ETH_P_AX25 = 0x2 + ETH_P_BATMAN = 0x4305 + ETH_P_BPQ = 0x8ff + ETH_P_CAIF = 0xf7 + ETH_P_CAN = 0xc + ETH_P_CANFD = 0xd + ETH_P_CONTROL = 0x16 + ETH_P_CUST = 0x6006 + ETH_P_DDCMP = 0x6 + ETH_P_DEC = 0x6000 + ETH_P_DIAG = 0x6005 + ETH_P_DNA_DL = 0x6001 + ETH_P_DNA_RC = 0x6002 + ETH_P_DNA_RT = 0x6003 + ETH_P_DSA = 0x1b + ETH_P_ECONET = 0x18 + ETH_P_EDSA = 0xdada + ETH_P_ERSPAN = 0x88be + ETH_P_ERSPAN2 = 0x22eb + ETH_P_FCOE = 0x8906 + ETH_P_FIP = 0x8914 + ETH_P_HDLC = 0x19 + ETH_P_HSR = 0x892f + ETH_P_IBOE = 0x8915 + ETH_P_IEEE802154 = 0xf6 + ETH_P_IEEEPUP = 0xa00 + ETH_P_IEEEPUPAT = 0xa01 + ETH_P_IFE = 0xed3e + ETH_P_IP = 0x800 + ETH_P_IPV6 = 0x86dd + ETH_P_IPX = 0x8137 + ETH_P_IRDA = 0x17 + ETH_P_LAT = 0x6004 + ETH_P_LINK_CTL = 0x886c + ETH_P_LOCALTALK = 0x9 + ETH_P_LOOP = 0x60 + ETH_P_LOOPBACK = 0x9000 + ETH_P_MACSEC = 0x88e5 + ETH_P_MAP = 0xf9 + ETH_P_MOBITEX = 0x15 + ETH_P_MPLS_MC = 0x8848 + ETH_P_MPLS_UC = 0x8847 + ETH_P_MVRP = 0x88f5 + ETH_P_NCSI = 0x88f8 + ETH_P_NSH = 0x894f + ETH_P_PAE = 0x888e + ETH_P_PAUSE = 0x8808 + ETH_P_PHONET = 0xf5 + ETH_P_PPPTALK = 0x10 + ETH_P_PPP_DISC = 0x8863 + ETH_P_PPP_MP = 0x8 + ETH_P_PPP_SES = 0x8864 + ETH_P_PREAUTH = 0x88c7 + ETH_P_PRP = 0x88fb + ETH_P_PUP = 0x200 + ETH_P_PUPAT = 0x201 + ETH_P_QINQ1 = 0x9100 + ETH_P_QINQ2 = 0x9200 + ETH_P_QINQ3 = 0x9300 + ETH_P_RARP = 0x8035 + ETH_P_SCA = 0x6007 + ETH_P_SLOW = 0x8809 + ETH_P_SNAP = 0x5 + ETH_P_TDLS = 0x890d + ETH_P_TEB = 0x6558 + ETH_P_TIPC = 0x88ca + ETH_P_TRAILER = 0x1c + ETH_P_TR_802_2 = 0x11 + ETH_P_TSN = 0x22f0 + ETH_P_WAN_PPP = 0x7 + ETH_P_WCCP = 0x883e + ETH_P_X25 = 0x805 + ETH_P_XDSA = 0xf8 + EXABYTE_ENABLE_NEST = 0xf0 + EXT2_SUPER_MAGIC = 0xef53 + EXT3_SUPER_MAGIC = 0xef53 + EXT4_SUPER_MAGIC = 0xef53 + EXTA = 0xe + EXTB = 0xf + EXTPROC = 0x10000 + F2FS_SUPER_MAGIC = 0xf2f52010 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_UNSHARE_RANGE = 0x40 + FALLOC_FL_ZERO_RANGE = 0x10 + FD_CLOEXEC = 0x1 + FD_SETSIZE = 0x400 + FF0 = 0x0 + FF1 = 0x8000 + FFDLY = 0x8000 + FLUSHO = 0x1000 + FS_ENCRYPTION_MODE_AES_128_CBC = 0x5 + FS_ENCRYPTION_MODE_AES_128_CTS = 0x6 + FS_ENCRYPTION_MODE_AES_256_CBC = 0x3 + FS_ENCRYPTION_MODE_AES_256_CTS = 0x4 + FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 + FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 + FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 + FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 + FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 + FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 + FS_KEY_DESCRIPTOR_SIZE = 0x8 + FS_KEY_DESC_PREFIX = "fscrypt:" + FS_KEY_DESC_PREFIX_SIZE = 0x8 + FS_MAX_KEY_SIZE = 0x40 + FS_POLICY_FLAGS_PAD_16 = 0x2 + FS_POLICY_FLAGS_PAD_32 = 0x3 + FS_POLICY_FLAGS_PAD_4 = 0x0 + FS_POLICY_FLAGS_PAD_8 = 0x1 + FS_POLICY_FLAGS_PAD_MASK = 0x3 + FS_POLICY_FLAGS_VALID = 0x3 + FUTEXFS_SUPER_MAGIC = 0xbad1dea + F_ADD_SEALS = 0x409 + F_DUPFD = 0x0 + F_DUPFD_CLOEXEC = 0x406 + F_EXLCK = 0x4 + F_GETFD = 0x1 + F_GETFL = 0x3 + F_GETLEASE = 0x401 + F_GETLK = 0x5 + F_GETLK64 = 0x5 + F_GETOWN = 0x9 + F_GETOWN_EX = 0x10 + F_GETPIPE_SZ = 0x408 + F_GETSIG = 0xb + F_GET_FILE_RW_HINT = 0x40d + F_GET_RW_HINT = 0x40b + F_GET_SEALS = 0x40a + F_LOCK = 0x1 + F_NOTIFY = 0x402 + F_OFD_GETLK = 0x24 + F_OFD_SETLK = 0x25 + F_OFD_SETLKW = 0x26 + F_OK = 0x0 + F_RDLCK = 0x0 + F_SEAL_GROW = 0x4 + F_SEAL_SEAL = 0x1 + F_SEAL_SHRINK = 0x2 + F_SEAL_WRITE = 0x8 + F_SETFD = 0x2 + F_SETFL = 0x4 + F_SETLEASE = 0x400 + F_SETLK = 0x6 + F_SETLK64 = 0x6 + F_SETLKW = 0x7 + F_SETLKW64 = 0x7 + F_SETOWN = 0x8 + F_SETOWN_EX = 0xf + F_SETPIPE_SZ = 0x407 + F_SETSIG = 0xa + F_SET_FILE_RW_HINT = 0x40e + F_SET_RW_HINT = 0x40c + F_SHLCK = 0x8 + F_TEST = 0x3 + F_TLOCK = 0x2 + F_ULOCK = 0x0 + F_UNLCK = 0x2 + F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 + GRND_NONBLOCK = 0x1 + GRND_RANDOM = 0x2 + HDIO_DRIVE_CMD = 0x31f + HDIO_DRIVE_CMD_AEB = 0x31e + HDIO_DRIVE_CMD_HDR_SIZE = 0x4 + HDIO_DRIVE_HOB_HDR_SIZE = 0x8 + HDIO_DRIVE_RESET = 0x31c + HDIO_DRIVE_TASK = 0x31e + HDIO_DRIVE_TASKFILE = 0x31d + HDIO_DRIVE_TASK_HDR_SIZE = 0x8 + HDIO_GETGEO = 0x301 + HDIO_GET_32BIT = 0x309 + HDIO_GET_ACOUSTIC = 0x30f + HDIO_GET_ADDRESS = 0x310 + HDIO_GET_BUSSTATE = 0x31a + HDIO_GET_DMA = 0x30b + HDIO_GET_IDENTITY = 0x30d + HDIO_GET_KEEPSETTINGS = 0x308 + HDIO_GET_MULTCOUNT = 0x304 + HDIO_GET_NICE = 0x30c + HDIO_GET_NOWERR = 0x30a + HDIO_GET_QDMA = 0x305 + HDIO_GET_UNMASKINTR = 0x302 + HDIO_GET_WCACHE = 0x30e + HDIO_OBSOLETE_IDENTITY = 0x307 + HDIO_SCAN_HWIF = 0x328 + HDIO_SET_32BIT = 0x324 + HDIO_SET_ACOUSTIC = 0x32c + HDIO_SET_ADDRESS = 0x32f + HDIO_SET_BUSSTATE = 0x32d + HDIO_SET_DMA = 0x326 + HDIO_SET_KEEPSETTINGS = 0x323 + HDIO_SET_MULTCOUNT = 0x321 + HDIO_SET_NICE = 0x329 + HDIO_SET_NOWERR = 0x325 + HDIO_SET_PIO_MODE = 0x327 + HDIO_SET_QDMA = 0x32e + HDIO_SET_UNMASKINTR = 0x322 + HDIO_SET_WCACHE = 0x32b + HDIO_SET_XFER = 0x306 + HDIO_TRISTATE_HWIF = 0x31b + HDIO_UNREGISTER_HWIF = 0x32a + HOSTFS_SUPER_MAGIC = 0xc0ffee + HPFS_SUPER_MAGIC = 0xf995e849 + HUGETLBFS_MAGIC = 0x958458f6 + HUPCL = 0x400 + IBSHIFT = 0x10 + ICANON = 0x2 + ICMPV6_FILTER = 0x1 + ICRNL = 0x100 + IEXTEN = 0x8000 + IFA_F_DADFAILED = 0x8 + IFA_F_DEPRECATED = 0x20 + IFA_F_HOMEADDRESS = 0x10 + IFA_F_MANAGETEMPADDR = 0x100 + IFA_F_MCAUTOJOIN = 0x400 + IFA_F_NODAD = 0x2 + IFA_F_NOPREFIXROUTE = 0x200 + IFA_F_OPTIMISTIC = 0x4 + IFA_F_PERMANENT = 0x80 + IFA_F_SECONDARY = 0x1 + IFA_F_STABLE_PRIVACY = 0x800 + IFA_F_TEMPORARY = 0x1 + IFA_F_TENTATIVE = 0x40 + IFA_MAX = 0x9 + IFF_ALLMULTI = 0x200 + IFF_ATTACH_QUEUE = 0x200 + IFF_AUTOMEDIA = 0x4000 + IFF_BROADCAST = 0x2 + IFF_DEBUG = 0x4 + IFF_DETACH_QUEUE = 0x400 + IFF_DORMANT = 0x20000 + IFF_DYNAMIC = 0x8000 + IFF_ECHO = 0x40000 + IFF_LOOPBACK = 0x8 + IFF_LOWER_UP = 0x10000 + IFF_MASTER = 0x400 + IFF_MULTICAST = 0x1000 + IFF_MULTI_QUEUE = 0x100 + IFF_NAPI = 0x10 + IFF_NAPI_FRAGS = 0x20 + IFF_NOARP = 0x80 + IFF_NOFILTER = 0x1000 + IFF_NOTRAILERS = 0x20 + IFF_NO_PI = 0x1000 + IFF_ONE_QUEUE = 0x2000 + IFF_PERSIST = 0x800 + IFF_POINTOPOINT = 0x10 + IFF_PORTSEL = 0x2000 + IFF_PROMISC = 0x100 + IFF_RUNNING = 0x40 + IFF_SLAVE = 0x800 + IFF_TAP = 0x2 + IFF_TUN = 0x1 + IFF_TUN_EXCL = 0x8000 + IFF_UP = 0x1 + IFF_VNET_HDR = 0x4000 + IFF_VOLATILE = 0x70c5a + IFNAMSIZ = 0x10 + IGNBRK = 0x1 + IGNCR = 0x80 + IGNPAR = 0x4 + IMAXBEL = 0x2000 + INLCR = 0x40 + INPCK = 0x10 + IN_ACCESS = 0x1 + IN_ALL_EVENTS = 0xfff + IN_ATTRIB = 0x4 + IN_CLASSA_HOST = 0xffffff + IN_CLASSA_MAX = 0x80 + IN_CLASSA_NET = 0xff000000 + IN_CLASSA_NSHIFT = 0x18 + IN_CLASSB_HOST = 0xffff + IN_CLASSB_MAX = 0x10000 + IN_CLASSB_NET = 0xffff0000 + IN_CLASSB_NSHIFT = 0x10 + IN_CLASSC_HOST = 0xff + IN_CLASSC_NET = 0xffffff00 + IN_CLASSC_NSHIFT = 0x8 + IN_CLOEXEC = 0x80000 + IN_CLOSE = 0x18 + IN_CLOSE_NOWRITE = 0x10 + IN_CLOSE_WRITE = 0x8 + IN_CREATE = 0x100 + IN_DELETE = 0x200 + IN_DELETE_SELF = 0x400 + IN_DONT_FOLLOW = 0x2000000 + IN_EXCL_UNLINK = 0x4000000 + IN_IGNORED = 0x8000 + IN_ISDIR = 0x40000000 + IN_LOOPBACKNET = 0x7f + IN_MASK_ADD = 0x20000000 + IN_MODIFY = 0x2 + IN_MOVE = 0xc0 + IN_MOVED_FROM = 0x40 + IN_MOVED_TO = 0x80 + IN_MOVE_SELF = 0x800 + IN_NONBLOCK = 0x800 + IN_ONESHOT = 0x80000000 + IN_ONLYDIR = 0x1000000 + IN_OPEN = 0x20 + IN_Q_OVERFLOW = 0x4000 + IN_UNMOUNT = 0x2000 + IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPPROTO_AH = 0x33 + IPPROTO_BEETPH = 0x5e + IPPROTO_COMP = 0x6c + IPPROTO_DCCP = 0x21 + IPPROTO_DSTOPTS = 0x3c + IPPROTO_EGP = 0x8 + IPPROTO_ENCAP = 0x62 + IPPROTO_ESP = 0x32 + IPPROTO_FRAGMENT = 0x2c + IPPROTO_GRE = 0x2f + IPPROTO_HOPOPTS = 0x0 + IPPROTO_ICMP = 0x1 + IPPROTO_ICMPV6 = 0x3a + IPPROTO_IDP = 0x16 + IPPROTO_IGMP = 0x2 + IPPROTO_IP = 0x0 + IPPROTO_IPIP = 0x4 + IPPROTO_IPV6 = 0x29 + IPPROTO_MH = 0x87 + IPPROTO_MPLS = 0x89 + IPPROTO_MTP = 0x5c + IPPROTO_NONE = 0x3b + IPPROTO_PIM = 0x67 + IPPROTO_PUP = 0xc + IPPROTO_RAW = 0xff + IPPROTO_ROUTING = 0x2b + IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 + IPPROTO_TCP = 0x6 + IPPROTO_TP = 0x1d + IPPROTO_UDP = 0x11 + IPPROTO_UDPLITE = 0x88 + IPV6_2292DSTOPTS = 0x4 + IPV6_2292HOPLIMIT = 0x8 + IPV6_2292HOPOPTS = 0x3 + IPV6_2292PKTINFO = 0x2 + IPV6_2292PKTOPTIONS = 0x6 + IPV6_2292RTHDR = 0x5 + IPV6_ADDRFORM = 0x1 + IPV6_ADDR_PREFERENCES = 0x48 + IPV6_ADD_MEMBERSHIP = 0x14 + IPV6_AUTHHDR = 0xa + IPV6_AUTOFLOWLABEL = 0x46 + IPV6_CHECKSUM = 0x7 + IPV6_DONTFRAG = 0x3e + IPV6_DROP_MEMBERSHIP = 0x15 + IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e + IPV6_HDRINCL = 0x24 + IPV6_HOPLIMIT = 0x34 + IPV6_HOPOPTS = 0x36 + IPV6_IPSEC_POLICY = 0x22 + IPV6_JOIN_ANYCAST = 0x1b + IPV6_JOIN_GROUP = 0x14 + IPV6_LEAVE_ANYCAST = 0x1c + IPV6_LEAVE_GROUP = 0x15 + IPV6_MINHOPCOUNT = 0x49 + IPV6_MTU = 0x18 + IPV6_MTU_DISCOVER = 0x17 + IPV6_MULTICAST_HOPS = 0x12 + IPV6_MULTICAST_IF = 0x11 + IPV6_MULTICAST_LOOP = 0x13 + IPV6_NEXTHOP = 0x9 + IPV6_ORIGDSTADDR = 0x4a + IPV6_PATHMTU = 0x3d + IPV6_PKTINFO = 0x32 + IPV6_PMTUDISC_DO = 0x2 + IPV6_PMTUDISC_DONT = 0x0 + IPV6_PMTUDISC_INTERFACE = 0x4 + IPV6_PMTUDISC_OMIT = 0x5 + IPV6_PMTUDISC_PROBE = 0x3 + IPV6_PMTUDISC_WANT = 0x1 + IPV6_RECVDSTOPTS = 0x3a + IPV6_RECVERR = 0x19 + IPV6_RECVFRAGSIZE = 0x4d + IPV6_RECVHOPLIMIT = 0x33 + IPV6_RECVHOPOPTS = 0x35 + IPV6_RECVORIGDSTADDR = 0x4a + IPV6_RECVPATHMTU = 0x3c + IPV6_RECVPKTINFO = 0x31 + IPV6_RECVRTHDR = 0x38 + IPV6_RECVTCLASS = 0x42 + IPV6_ROUTER_ALERT = 0x16 + IPV6_RTHDR = 0x39 + IPV6_RTHDRDSTOPTS = 0x37 + IPV6_RTHDR_LOOSE = 0x0 + IPV6_RTHDR_STRICT = 0x1 + IPV6_RTHDR_TYPE_0 = 0x0 + IPV6_RXDSTOPTS = 0x3b + IPV6_RXHOPOPTS = 0x36 + IPV6_TCLASS = 0x43 + IPV6_TRANSPARENT = 0x4b + IPV6_UNICAST_HOPS = 0x10 + IPV6_UNICAST_IF = 0x4c + IPV6_V6ONLY = 0x1a + IPV6_XFRM_POLICY = 0x23 + IP_ADD_MEMBERSHIP = 0x23 + IP_ADD_SOURCE_MEMBERSHIP = 0x27 + IP_BIND_ADDRESS_NO_PORT = 0x18 + IP_BLOCK_SOURCE = 0x26 + IP_CHECKSUM = 0x17 + IP_DEFAULT_MULTICAST_LOOP = 0x1 + IP_DEFAULT_MULTICAST_TTL = 0x1 + IP_DF = 0x4000 + IP_DROP_MEMBERSHIP = 0x24 + IP_DROP_SOURCE_MEMBERSHIP = 0x28 + IP_FREEBIND = 0xf + IP_HDRINCL = 0x3 + IP_IPSEC_POLICY = 0x10 + IP_MAXPACKET = 0xffff + IP_MAX_MEMBERSHIPS = 0x14 + IP_MF = 0x2000 + IP_MINTTL = 0x15 + IP_MSFILTER = 0x29 + IP_MSS = 0x240 + IP_MTU = 0xe + IP_MTU_DISCOVER = 0xa + IP_MULTICAST_ALL = 0x31 + IP_MULTICAST_IF = 0x20 + IP_MULTICAST_LOOP = 0x22 + IP_MULTICAST_TTL = 0x21 + IP_NODEFRAG = 0x16 + IP_OFFMASK = 0x1fff + IP_OPTIONS = 0x4 + IP_ORIGDSTADDR = 0x14 + IP_PASSSEC = 0x12 + IP_PKTINFO = 0x8 + IP_PKTOPTIONS = 0x9 + IP_PMTUDISC = 0xa + IP_PMTUDISC_DO = 0x2 + IP_PMTUDISC_DONT = 0x0 + IP_PMTUDISC_INTERFACE = 0x4 + IP_PMTUDISC_OMIT = 0x5 + IP_PMTUDISC_PROBE = 0x3 + IP_PMTUDISC_WANT = 0x1 + IP_RECVERR = 0xb + IP_RECVFRAGSIZE = 0x19 + IP_RECVOPTS = 0x6 + IP_RECVORIGDSTADDR = 0x14 + IP_RECVRETOPTS = 0x7 + IP_RECVTOS = 0xd + IP_RECVTTL = 0xc + IP_RETOPTS = 0x7 + IP_RF = 0x8000 + IP_ROUTER_ALERT = 0x5 + IP_TOS = 0x1 + IP_TRANSPARENT = 0x13 + IP_TTL = 0x2 + IP_UNBLOCK_SOURCE = 0x25 + IP_UNICAST_IF = 0x32 + IP_XFRM_POLICY = 0x11 + ISIG = 0x1 + ISOFS_SUPER_MAGIC = 0x9660 + ISTRIP = 0x20 + IUCLC = 0x200 + IUTF8 = 0x4000 + IXANY = 0x800 + IXOFF = 0x1000 + IXON = 0x400 + JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 + KEYCTL_ASSUME_AUTHORITY = 0x10 + KEYCTL_CHOWN = 0x4 + KEYCTL_CLEAR = 0x7 + KEYCTL_DESCRIBE = 0x6 + KEYCTL_DH_COMPUTE = 0x17 + KEYCTL_GET_KEYRING_ID = 0x0 + KEYCTL_GET_PERSISTENT = 0x16 + KEYCTL_GET_SECURITY = 0x11 + KEYCTL_INSTANTIATE = 0xc + KEYCTL_INSTANTIATE_IOV = 0x14 + KEYCTL_INVALIDATE = 0x15 + KEYCTL_JOIN_SESSION_KEYRING = 0x1 + KEYCTL_LINK = 0x8 + KEYCTL_NEGATE = 0xd + KEYCTL_READ = 0xb + KEYCTL_REJECT = 0x13 + KEYCTL_RESTRICT_KEYRING = 0x1d + KEYCTL_REVOKE = 0x3 + KEYCTL_SEARCH = 0xa + KEYCTL_SESSION_TO_PARENT = 0x12 + KEYCTL_SETPERM = 0x5 + KEYCTL_SET_REQKEY_KEYRING = 0xe + KEYCTL_SET_TIMEOUT = 0xf + KEYCTL_UNLINK = 0x9 + KEYCTL_UPDATE = 0x2 + KEY_REQKEY_DEFL_DEFAULT = 0x0 + KEY_REQKEY_DEFL_GROUP_KEYRING = 0x6 + KEY_REQKEY_DEFL_NO_CHANGE = -0x1 + KEY_REQKEY_DEFL_PROCESS_KEYRING = 0x2 + KEY_REQKEY_DEFL_REQUESTOR_KEYRING = 0x7 + KEY_REQKEY_DEFL_SESSION_KEYRING = 0x3 + KEY_REQKEY_DEFL_THREAD_KEYRING = 0x1 + KEY_REQKEY_DEFL_USER_KEYRING = 0x4 + KEY_REQKEY_DEFL_USER_SESSION_KEYRING = 0x5 + KEY_SPEC_GROUP_KEYRING = -0x6 + KEY_SPEC_PROCESS_KEYRING = -0x2 + KEY_SPEC_REQKEY_AUTH_KEY = -0x7 + KEY_SPEC_REQUESTOR_KEYRING = -0x8 + KEY_SPEC_SESSION_KEYRING = -0x3 + KEY_SPEC_THREAD_KEYRING = -0x1 + KEY_SPEC_USER_KEYRING = -0x4 + KEY_SPEC_USER_SESSION_KEYRING = -0x5 + LINUX_REBOOT_CMD_CAD_OFF = 0x0 + LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef + LINUX_REBOOT_CMD_HALT = 0xcdef0123 + LINUX_REBOOT_CMD_KEXEC = 0x45584543 + LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc + LINUX_REBOOT_CMD_RESTART = 0x1234567 + LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4 + LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 + LINUX_REBOOT_MAGIC1 = 0xfee1dead + LINUX_REBOOT_MAGIC2 = 0x28121969 + LOCK_EX = 0x2 + LOCK_NB = 0x4 + LOCK_SH = 0x1 + LOCK_UN = 0x8 + MADV_DODUMP = 0x11 + MADV_DOFORK = 0xb + MADV_DONTDUMP = 0x10 + MADV_DONTFORK = 0xa + MADV_DONTNEED = 0x4 + MADV_FREE = 0x8 + MADV_HUGEPAGE = 0xe + MADV_HWPOISON = 0x64 + MADV_KEEPONFORK = 0x13 + MADV_MERGEABLE = 0xc + MADV_NOHUGEPAGE = 0xf + MADV_NORMAL = 0x0 + MADV_RANDOM = 0x1 + MADV_REMOVE = 0x9 + MADV_SEQUENTIAL = 0x2 + MADV_UNMERGEABLE = 0xd + MADV_WILLNEED = 0x3 + MADV_WIPEONFORK = 0x12 + MAP_ANON = 0x20 + MAP_ANONYMOUS = 0x20 + MAP_DENYWRITE = 0x800 + MAP_EXECUTABLE = 0x1000 + MAP_FILE = 0x0 + MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 + MAP_GROWSDOWN = 0x100 + MAP_HUGETLB = 0x40000 + MAP_HUGE_MASK = 0x3f + MAP_HUGE_SHIFT = 0x1a + MAP_LOCKED = 0x2000 + MAP_NONBLOCK = 0x10000 + MAP_NORESERVE = 0x4000 + MAP_POPULATE = 0x8000 + MAP_PRIVATE = 0x2 + MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 + MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 + MAP_TYPE = 0xf + MCL_CURRENT = 0x1 + MCL_FUTURE = 0x2 + MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a + MINIX2_SUPER_MAGIC = 0x2468 + MINIX2_SUPER_MAGIC2 = 0x2478 + MINIX3_SUPER_MAGIC = 0x4d5a + MINIX_SUPER_MAGIC = 0x137f + MINIX_SUPER_MAGIC2 = 0x138f + MNT_DETACH = 0x2 + MNT_EXPIRE = 0x4 + MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 + MSDOS_SUPER_MAGIC = 0x4d44 + MSG_BATCH = 0x40000 + MSG_CMSG_CLOEXEC = 0x40000000 + MSG_CONFIRM = 0x800 + MSG_CTRUNC = 0x8 + MSG_DONTROUTE = 0x4 + MSG_DONTWAIT = 0x40 + MSG_EOR = 0x80 + MSG_ERRQUEUE = 0x2000 + MSG_FASTOPEN = 0x20000000 + MSG_FIN = 0x200 + MSG_MORE = 0x8000 + MSG_NOSIGNAL = 0x4000 + MSG_OOB = 0x1 + MSG_PEEK = 0x2 + MSG_PROXY = 0x10 + MSG_RST = 0x1000 + MSG_SYN = 0x400 + MSG_TRUNC = 0x20 + MSG_TRYHARD = 0x4 + MSG_WAITALL = 0x100 + MSG_WAITFORONE = 0x10000 + MSG_ZEROCOPY = 0x4000000 + MS_ACTIVE = 0x40000000 + MS_ASYNC = 0x1 + MS_BIND = 0x1000 + MS_BORN = 0x20000000 + MS_DIRSYNC = 0x80 + MS_INVALIDATE = 0x2 + MS_I_VERSION = 0x800000 + MS_KERNMOUNT = 0x400000 + MS_LAZYTIME = 0x2000000 + MS_MANDLOCK = 0x40 + MS_MGC_MSK = 0xffff0000 + MS_MGC_VAL = 0xc0ed0000 + MS_MOVE = 0x2000 + MS_NOATIME = 0x400 + MS_NODEV = 0x4 + MS_NODIRATIME = 0x800 + MS_NOEXEC = 0x8 + MS_NOREMOTELOCK = 0x8000000 + MS_NOSEC = 0x10000000 + MS_NOSUID = 0x2 + MS_NOUSER = -0x80000000 + MS_POSIXACL = 0x10000 + MS_PRIVATE = 0x40000 + MS_RDONLY = 0x1 + MS_REC = 0x4000 + MS_RELATIME = 0x200000 + MS_REMOUNT = 0x20 + MS_RMT_MASK = 0x2800051 + MS_SHARED = 0x100000 + MS_SILENT = 0x8000 + MS_SLAVE = 0x80000 + MS_STRICTATIME = 0x1000000 + MS_SUBMOUNT = 0x4000000 + MS_SYNC = 0x4 + MS_SYNCHRONOUS = 0x10 + MS_UNBINDABLE = 0x20000 + MS_VERBOSE = 0x8000 + MTD_INODE_FS_MAGIC = 0x11307854 + NAME_MAX = 0xff + NCP_SUPER_MAGIC = 0x564c + NETLINK_ADD_MEMBERSHIP = 0x1 + NETLINK_AUDIT = 0x9 + NETLINK_BROADCAST_ERROR = 0x4 + NETLINK_CAP_ACK = 0xa + NETLINK_CONNECTOR = 0xb + NETLINK_CRYPTO = 0x15 + NETLINK_DNRTMSG = 0xe + NETLINK_DROP_MEMBERSHIP = 0x2 + NETLINK_ECRYPTFS = 0x13 + NETLINK_EXT_ACK = 0xb + NETLINK_FIB_LOOKUP = 0xa + NETLINK_FIREWALL = 0x3 + NETLINK_GENERIC = 0x10 + NETLINK_INET_DIAG = 0x4 + NETLINK_IP6_FW = 0xd + NETLINK_ISCSI = 0x8 + NETLINK_KOBJECT_UEVENT = 0xf + NETLINK_LISTEN_ALL_NSID = 0x8 + NETLINK_LIST_MEMBERSHIPS = 0x9 + NETLINK_NETFILTER = 0xc + NETLINK_NFLOG = 0x5 + NETLINK_NO_ENOBUFS = 0x5 + NETLINK_PKTINFO = 0x3 + NETLINK_RDMA = 0x14 + NETLINK_ROUTE = 0x0 + NETLINK_RX_RING = 0x6 + NETLINK_SCSITRANSPORT = 0x12 + NETLINK_SELINUX = 0x7 + NETLINK_SMC = 0x16 + NETLINK_SOCK_DIAG = 0x4 + NETLINK_TX_RING = 0x7 + NETLINK_UNUSED = 0x1 + NETLINK_USERSOCK = 0x2 + NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 + NFNETLINK_V0 = 0x0 + NFNLGRP_ACCT_QUOTA = 0x8 + NFNLGRP_CONNTRACK_DESTROY = 0x3 + NFNLGRP_CONNTRACK_EXP_DESTROY = 0x6 + NFNLGRP_CONNTRACK_EXP_NEW = 0x4 + NFNLGRP_CONNTRACK_EXP_UPDATE = 0x5 + NFNLGRP_CONNTRACK_NEW = 0x1 + NFNLGRP_CONNTRACK_UPDATE = 0x2 + NFNLGRP_MAX = 0x9 + NFNLGRP_NFTABLES = 0x7 + NFNLGRP_NFTRACE = 0x9 + NFNLGRP_NONE = 0x0 + NFNL_BATCH_MAX = 0x1 + NFNL_MSG_BATCH_BEGIN = 0x10 + NFNL_MSG_BATCH_END = 0x11 + NFNL_NFA_NEST = 0x8000 + NFNL_SUBSYS_ACCT = 0x7 + NFNL_SUBSYS_COUNT = 0xc + NFNL_SUBSYS_CTHELPER = 0x9 + NFNL_SUBSYS_CTNETLINK = 0x1 + NFNL_SUBSYS_CTNETLINK_EXP = 0x2 + NFNL_SUBSYS_CTNETLINK_TIMEOUT = 0x8 + NFNL_SUBSYS_IPSET = 0x6 + NFNL_SUBSYS_NFTABLES = 0xa + NFNL_SUBSYS_NFT_COMPAT = 0xb + NFNL_SUBSYS_NONE = 0x0 + NFNL_SUBSYS_OSF = 0x5 + NFNL_SUBSYS_QUEUE = 0x3 + NFNL_SUBSYS_ULOG = 0x4 + NFS_SUPER_MAGIC = 0x6969 + NILFS_SUPER_MAGIC = 0x3434 + NL0 = 0x0 + NL1 = 0x100 + NLA_ALIGNTO = 0x4 + NLA_F_NESTED = 0x8000 + NLA_F_NET_BYTEORDER = 0x4000 + NLA_HDRLEN = 0x4 + NLDLY = 0x100 + NLMSG_ALIGNTO = 0x4 + NLMSG_DONE = 0x3 + NLMSG_ERROR = 0x2 + NLMSG_HDRLEN = 0x10 + NLMSG_MIN_TYPE = 0x10 + NLMSG_NOOP = 0x1 + NLMSG_OVERRUN = 0x4 + NLM_F_ACK = 0x4 + NLM_F_ACK_TLVS = 0x200 + NLM_F_APPEND = 0x800 + NLM_F_ATOMIC = 0x400 + NLM_F_CAPPED = 0x100 + NLM_F_CREATE = 0x400 + NLM_F_DUMP = 0x300 + NLM_F_DUMP_FILTERED = 0x20 + NLM_F_DUMP_INTR = 0x10 + NLM_F_ECHO = 0x8 + NLM_F_EXCL = 0x200 + NLM_F_MATCH = 0x200 + NLM_F_MULTI = 0x2 + NLM_F_NONREC = 0x100 + NLM_F_REPLACE = 0x100 + NLM_F_REQUEST = 0x1 + NLM_F_ROOT = 0x100 + NOFLSH = 0x80 + NSFS_MAGIC = 0x6e736673 + OCFS2_SUPER_MAGIC = 0x7461636f + OCRNL = 0x8 + OFDEL = 0x80 + OFILL = 0x40 + OLCUC = 0x2 + ONLCR = 0x4 + ONLRET = 0x20 + ONOCR = 0x10 + OPENPROM_SUPER_MAGIC = 0x9fa1 + OPOST = 0x1 + OVERLAYFS_SUPER_MAGIC = 0x794c7630 + O_ACCMODE = 0x3 + O_APPEND = 0x400 + O_ASYNC = 0x2000 + 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_RDONLY = 0x0 + O_RDWR = 0x2 + O_RSYNC = 0x101000 + O_SYNC = 0x101000 + O_TMPFILE = 0x410000 + O_TRUNC = 0x200 + O_WRONLY = 0x1 + PACKET_ADD_MEMBERSHIP = 0x1 + PACKET_AUXDATA = 0x8 + PACKET_BROADCAST = 0x1 + PACKET_COPY_THRESH = 0x7 + PACKET_DROP_MEMBERSHIP = 0x2 + PACKET_FANOUT = 0x12 + PACKET_FANOUT_CBPF = 0x6 + PACKET_FANOUT_CPU = 0x2 + PACKET_FANOUT_DATA = 0x16 + PACKET_FANOUT_EBPF = 0x7 + PACKET_FANOUT_FLAG_DEFRAG = 0x8000 + PACKET_FANOUT_FLAG_ROLLOVER = 0x1000 + PACKET_FANOUT_FLAG_UNIQUEID = 0x2000 + PACKET_FANOUT_HASH = 0x0 + PACKET_FANOUT_LB = 0x1 + PACKET_FANOUT_QM = 0x5 + PACKET_FANOUT_RND = 0x4 + PACKET_FANOUT_ROLLOVER = 0x3 + PACKET_FASTROUTE = 0x6 + PACKET_HDRLEN = 0xb + PACKET_HOST = 0x0 + PACKET_KERNEL = 0x7 + PACKET_LOOPBACK = 0x5 + PACKET_LOSS = 0xe + PACKET_MR_ALLMULTI = 0x2 + PACKET_MR_MULTICAST = 0x0 + PACKET_MR_PROMISC = 0x1 + PACKET_MR_UNICAST = 0x3 + PACKET_MULTICAST = 0x2 + PACKET_ORIGDEV = 0x9 + PACKET_OTHERHOST = 0x3 + PACKET_OUTGOING = 0x4 + PACKET_QDISC_BYPASS = 0x14 + PACKET_RECV_OUTPUT = 0x3 + PACKET_RESERVE = 0xc + PACKET_ROLLOVER_STATS = 0x15 + PACKET_RX_RING = 0x5 + PACKET_STATISTICS = 0x6 + PACKET_TIMESTAMP = 0x11 + PACKET_TX_HAS_OFF = 0x13 + PACKET_TX_RING = 0xd + PACKET_TX_TIMESTAMP = 0x10 + PACKET_USER = 0x6 + PACKET_VERSION = 0xa + PACKET_VNET_HDR = 0xf + PARENB = 0x100 + PARITY_CRC16_PR0 = 0x2 + PARITY_CRC16_PR0_CCITT = 0x4 + PARITY_CRC16_PR1 = 0x3 + PARITY_CRC16_PR1_CCITT = 0x5 + PARITY_CRC32_PR0_CCITT = 0x6 + PARITY_CRC32_PR1_CCITT = 0x7 + PARITY_DEFAULT = 0x0 + PARITY_NONE = 0x1 + PARMRK = 0x8 + 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 + PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e + PRIO_PGRP = 0x1 + PRIO_PROCESS = 0x0 + PRIO_USER = 0x2 + PROC_SUPER_MAGIC = 0x9fa0 + PROT_EXEC = 0x4 + PROT_GROWSDOWN = 0x1000000 + PROT_GROWSUP = 0x2000000 + PROT_NONE = 0x0 + PROT_READ = 0x1 + PROT_WRITE = 0x2 + PR_CAPBSET_DROP = 0x18 + PR_CAPBSET_READ = 0x17 + PR_CAP_AMBIENT = 0x2f + PR_CAP_AMBIENT_CLEAR_ALL = 0x4 + PR_CAP_AMBIENT_IS_SET = 0x1 + PR_CAP_AMBIENT_LOWER = 0x3 + PR_CAP_AMBIENT_RAISE = 0x2 + PR_ENDIAN_BIG = 0x0 + PR_ENDIAN_LITTLE = 0x1 + PR_ENDIAN_PPC_LITTLE = 0x2 + PR_FPEMU_NOPRINT = 0x1 + PR_FPEMU_SIGFPE = 0x2 + PR_FP_EXC_ASYNC = 0x2 + PR_FP_EXC_DISABLED = 0x0 + PR_FP_EXC_DIV = 0x10000 + PR_FP_EXC_INV = 0x100000 + PR_FP_EXC_NONRECOV = 0x1 + PR_FP_EXC_OVF = 0x20000 + PR_FP_EXC_PRECISE = 0x3 + PR_FP_EXC_RES = 0x80000 + PR_FP_EXC_SW_ENABLE = 0x80 + PR_FP_EXC_UND = 0x40000 + PR_FP_MODE_FR = 0x1 + PR_FP_MODE_FRE = 0x2 + PR_GET_CHILD_SUBREAPER = 0x25 + PR_GET_DUMPABLE = 0x3 + PR_GET_ENDIAN = 0x13 + PR_GET_FPEMU = 0x9 + PR_GET_FPEXC = 0xb + PR_GET_FP_MODE = 0x2e + PR_GET_KEEPCAPS = 0x7 + PR_GET_NAME = 0x10 + PR_GET_NO_NEW_PRIVS = 0x27 + PR_GET_PDEATHSIG = 0x2 + PR_GET_SECCOMP = 0x15 + PR_GET_SECUREBITS = 0x1b + PR_GET_SPECULATION_CTRL = 0x34 + PR_GET_THP_DISABLE = 0x2a + PR_GET_TID_ADDRESS = 0x28 + PR_GET_TIMERSLACK = 0x1e + PR_GET_TIMING = 0xd + PR_GET_TSC = 0x19 + PR_GET_UNALIGN = 0x5 + PR_MCE_KILL = 0x21 + PR_MCE_KILL_CLEAR = 0x0 + PR_MCE_KILL_DEFAULT = 0x2 + PR_MCE_KILL_EARLY = 0x1 + PR_MCE_KILL_GET = 0x22 + PR_MCE_KILL_LATE = 0x0 + PR_MCE_KILL_SET = 0x1 + PR_MPX_DISABLE_MANAGEMENT = 0x2c + PR_MPX_ENABLE_MANAGEMENT = 0x2b + PR_SET_CHILD_SUBREAPER = 0x24 + PR_SET_DUMPABLE = 0x4 + PR_SET_ENDIAN = 0x14 + PR_SET_FPEMU = 0xa + PR_SET_FPEXC = 0xc + PR_SET_FP_MODE = 0x2d + PR_SET_KEEPCAPS = 0x8 + PR_SET_MM = 0x23 + PR_SET_MM_ARG_END = 0x9 + PR_SET_MM_ARG_START = 0x8 + PR_SET_MM_AUXV = 0xc + PR_SET_MM_BRK = 0x7 + PR_SET_MM_END_CODE = 0x2 + PR_SET_MM_END_DATA = 0x4 + PR_SET_MM_ENV_END = 0xb + PR_SET_MM_ENV_START = 0xa + PR_SET_MM_EXE_FILE = 0xd + PR_SET_MM_MAP = 0xe + PR_SET_MM_MAP_SIZE = 0xf + PR_SET_MM_START_BRK = 0x6 + PR_SET_MM_START_CODE = 0x1 + PR_SET_MM_START_DATA = 0x3 + PR_SET_MM_START_STACK = 0x5 + PR_SET_NAME = 0xf + PR_SET_NO_NEW_PRIVS = 0x26 + PR_SET_PDEATHSIG = 0x1 + PR_SET_PTRACER = 0x59616d61 + PR_SET_PTRACER_ANY = 0xffffffffffffffff + PR_SET_SECCOMP = 0x16 + PR_SET_SECUREBITS = 0x1c + PR_SET_SPECULATION_CTRL = 0x35 + PR_SET_THP_DISABLE = 0x29 + PR_SET_TIMERSLACK = 0x1d + PR_SET_TIMING = 0xe + PR_SET_TSC = 0x1a + PR_SET_UNALIGN = 0x6 + PR_SPEC_DISABLE = 0x4 + PR_SPEC_ENABLE = 0x2 + PR_SPEC_FORCE_DISABLE = 0x8 + PR_SPEC_NOT_AFFECTED = 0x0 + PR_SPEC_PRCTL = 0x1 + PR_SPEC_STORE_BYPASS = 0x0 + PR_SVE_GET_VL = 0x33 + PR_SVE_SET_VL = 0x32 + PR_SVE_SET_VL_ONEXEC = 0x40000 + PR_SVE_VL_INHERIT = 0x20000 + PR_SVE_VL_LEN_MASK = 0xffff + PR_TASK_PERF_EVENTS_DISABLE = 0x1f + PR_TASK_PERF_EVENTS_ENABLE = 0x20 + PR_TIMING_STATISTICAL = 0x0 + PR_TIMING_TIMESTAMP = 0x1 + PR_TSC_ENABLE = 0x1 + PR_TSC_SIGSEGV = 0x2 + PR_UNALIGN_NOPRINT = 0x1 + PR_UNALIGN_SIGBUS = 0x2 + PSTOREFS_MAGIC = 0x6165676c + PTRACE_ATTACH = 0x10 + PTRACE_CONT = 0x7 + PTRACE_DETACH = 0x11 + PTRACE_EVENT_CLONE = 0x3 + PTRACE_EVENT_EXEC = 0x4 + PTRACE_EVENT_EXIT = 0x6 + PTRACE_EVENT_FORK = 0x1 + PTRACE_EVENT_SECCOMP = 0x7 + PTRACE_EVENT_STOP = 0x80 + PTRACE_EVENT_VFORK = 0x2 + PTRACE_EVENT_VFORK_DONE = 0x5 + PTRACE_GETEVENTMSG = 0x4201 + PTRACE_GETREGS = 0xc + PTRACE_GETREGSET = 0x4204 + PTRACE_GETSIGINFO = 0x4202 + PTRACE_GETSIGMASK = 0x420a + PTRACE_INTERRUPT = 0x4207 + PTRACE_KILL = 0x8 + PTRACE_LISTEN = 0x4208 + PTRACE_O_EXITKILL = 0x100000 + PTRACE_O_MASK = 0x3000ff + PTRACE_O_SUSPEND_SECCOMP = 0x200000 + PTRACE_O_TRACECLONE = 0x8 + PTRACE_O_TRACEEXEC = 0x10 + PTRACE_O_TRACEEXIT = 0x40 + PTRACE_O_TRACEFORK = 0x2 + PTRACE_O_TRACESECCOMP = 0x80 + PTRACE_O_TRACESYSGOOD = 0x1 + PTRACE_O_TRACEVFORK = 0x4 + PTRACE_O_TRACEVFORKDONE = 0x20 + PTRACE_PEEKDATA = 0x2 + PTRACE_PEEKSIGINFO = 0x4209 + PTRACE_PEEKSIGINFO_SHARED = 0x1 + PTRACE_PEEKTEXT = 0x1 + PTRACE_PEEKUSR = 0x3 + PTRACE_POKEDATA = 0x5 + PTRACE_POKETEXT = 0x4 + PTRACE_POKEUSR = 0x6 + PTRACE_SECCOMP_GET_FILTER = 0x420c + PTRACE_SECCOMP_GET_METADATA = 0x420d + PTRACE_SEIZE = 0x4206 + PTRACE_SETOPTIONS = 0x4200 + PTRACE_SETREGS = 0xd + PTRACE_SETREGSET = 0x4205 + PTRACE_SETSIGINFO = 0x4203 + PTRACE_SETSIGMASK = 0x420b + PTRACE_SINGLESTEP = 0x9 + PTRACE_SYSCALL = 0x18 + PTRACE_TRACEME = 0x0 + QNX4_SUPER_MAGIC = 0x2f + QNX6_SUPER_MAGIC = 0x68191122 + RAMFS_MAGIC = 0x858458f6 + RDTGROUP_SUPER_MAGIC = 0x7655821 + REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 + RLIMIT_AS = 0x9 + RLIMIT_CORE = 0x4 + RLIMIT_CPU = 0x0 + RLIMIT_DATA = 0x2 + RLIMIT_FSIZE = 0x1 + RLIMIT_LOCKS = 0xa + RLIMIT_MEMLOCK = 0x8 + RLIMIT_MSGQUEUE = 0xc + RLIMIT_NICE = 0xd + RLIMIT_NOFILE = 0x7 + RLIMIT_NPROC = 0x6 + RLIMIT_RSS = 0x5 + RLIMIT_RTPRIO = 0xe + RLIMIT_RTTIME = 0xf + RLIMIT_SIGPENDING = 0xb + RLIMIT_STACK = 0x3 + RLIM_INFINITY = 0xffffffffffffffff + RTAX_ADVMSS = 0x8 + RTAX_CC_ALGO = 0x10 + RTAX_CWND = 0x7 + RTAX_FASTOPEN_NO_COOKIE = 0x11 + RTAX_FEATURES = 0xc + RTAX_FEATURE_ALLFRAG = 0x8 + RTAX_FEATURE_ECN = 0x1 + RTAX_FEATURE_MASK = 0xf + RTAX_FEATURE_SACK = 0x2 + RTAX_FEATURE_TIMESTAMP = 0x4 + RTAX_HOPLIMIT = 0xa + RTAX_INITCWND = 0xb + RTAX_INITRWND = 0xe + RTAX_LOCK = 0x1 + RTAX_MAX = 0x11 + RTAX_MTU = 0x2 + RTAX_QUICKACK = 0xf + RTAX_REORDERING = 0x9 + RTAX_RTO_MIN = 0xd + RTAX_RTT = 0x4 + RTAX_RTTVAR = 0x5 + RTAX_SSTHRESH = 0x6 + RTAX_UNSPEC = 0x0 + RTAX_WINDOW = 0x3 + RTA_ALIGNTO = 0x4 + RTA_MAX = 0x1d + RTCF_DIRECTSRC = 0x4000000 + RTCF_DOREDIRECT = 0x1000000 + RTCF_LOG = 0x2000000 + RTCF_MASQ = 0x400000 + RTCF_NAT = 0x800000 + RTCF_VALVE = 0x200000 + RTC_AF = 0x20 + 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_IRQF = 0x80 + RTC_IRQP_READ = 0x8008700b + RTC_IRQP_SET = 0x4008700c + RTC_MAX_FREQ = 0x2000 + RTC_PF = 0x40 + 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_UF = 0x10 + 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 + RTF_ADDRCLASSMASK = 0xf8000000 + RTF_ADDRCONF = 0x40000 + RTF_ALLONLINK = 0x20000 + RTF_BROADCAST = 0x10000000 + RTF_CACHE = 0x1000000 + RTF_DEFAULT = 0x10000 + RTF_DYNAMIC = 0x10 + RTF_FLOW = 0x2000000 + RTF_GATEWAY = 0x2 + RTF_HOST = 0x4 + RTF_INTERFACE = 0x40000000 + RTF_IRTT = 0x100 + RTF_LINKRT = 0x100000 + RTF_LOCAL = 0x80000000 + RTF_MODIFIED = 0x20 + RTF_MSS = 0x40 + RTF_MTU = 0x40 + RTF_MULTICAST = 0x20000000 + RTF_NAT = 0x8000000 + RTF_NOFORWARD = 0x1000 + RTF_NONEXTHOP = 0x200000 + RTF_NOPMTUDISC = 0x4000 + RTF_POLICY = 0x4000000 + RTF_REINSTATE = 0x8 + RTF_REJECT = 0x200 + RTF_STATIC = 0x400 + RTF_THROW = 0x2000 + RTF_UP = 0x1 + RTF_WINDOW = 0x80 + RTF_XRESOLVE = 0x800 + RTM_BASE = 0x10 + RTM_DELACTION = 0x31 + RTM_DELADDR = 0x15 + RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 + RTM_DELLINK = 0x11 + RTM_DELMDB = 0x55 + RTM_DELNEIGH = 0x1d + RTM_DELNETCONF = 0x51 + RTM_DELNSID = 0x59 + RTM_DELQDISC = 0x25 + RTM_DELROUTE = 0x19 + RTM_DELRULE = 0x21 + RTM_DELTCLASS = 0x29 + RTM_DELTFILTER = 0x2d + RTM_F_CLONED = 0x200 + RTM_F_EQUALIZE = 0x400 + RTM_F_FIB_MATCH = 0x2000 + RTM_F_LOOKUP_TABLE = 0x1000 + RTM_F_NOTIFY = 0x100 + RTM_F_PREFIX = 0x800 + RTM_GETACTION = 0x32 + RTM_GETADDR = 0x16 + RTM_GETADDRLABEL = 0x4a + RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 + RTM_GETDCB = 0x4e + RTM_GETLINK = 0x12 + RTM_GETMDB = 0x56 + RTM_GETMULTICAST = 0x3a + RTM_GETNEIGH = 0x1e + RTM_GETNEIGHTBL = 0x42 + RTM_GETNETCONF = 0x52 + RTM_GETNSID = 0x5a + RTM_GETQDISC = 0x26 + RTM_GETROUTE = 0x1a + RTM_GETRULE = 0x22 + RTM_GETSTATS = 0x5e + RTM_GETTCLASS = 0x2a + RTM_GETTFILTER = 0x2e + RTM_MAX = 0x67 + RTM_NEWACTION = 0x30 + RTM_NEWADDR = 0x14 + RTM_NEWADDRLABEL = 0x48 + RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 + RTM_NEWLINK = 0x10 + RTM_NEWMDB = 0x54 + RTM_NEWNDUSEROPT = 0x44 + RTM_NEWNEIGH = 0x1c + RTM_NEWNEIGHTBL = 0x40 + RTM_NEWNETCONF = 0x50 + RTM_NEWNSID = 0x58 + RTM_NEWPREFIX = 0x34 + RTM_NEWQDISC = 0x24 + RTM_NEWROUTE = 0x18 + RTM_NEWRULE = 0x20 + RTM_NEWSTATS = 0x5c + RTM_NEWTCLASS = 0x28 + RTM_NEWTFILTER = 0x2c + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 + RTM_SETDCB = 0x4f + RTM_SETLINK = 0x13 + RTM_SETNEIGHTBL = 0x43 + RTNH_ALIGNTO = 0x4 + RTNH_COMPARE_MASK = 0x19 + RTNH_F_DEAD = 0x1 + RTNH_F_LINKDOWN = 0x10 + RTNH_F_OFFLOAD = 0x8 + RTNH_F_ONLINK = 0x4 + RTNH_F_PERVASIVE = 0x2 + RTNH_F_UNRESOLVED = 0x20 + RTN_MAX = 0xb + RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba + RTPROT_BIRD = 0xc + RTPROT_BOOT = 0x3 + RTPROT_DHCP = 0x10 + RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 + RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb + RTPROT_KERNEL = 0x2 + RTPROT_MROUTED = 0x11 + RTPROT_MRT = 0xa + RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc + RTPROT_RA = 0x9 + RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd + RTPROT_STATIC = 0x4 + RTPROT_UNSPEC = 0x0 + RTPROT_XORP = 0xe + RTPROT_ZEBRA = 0xb + RT_CLASS_DEFAULT = 0xfd + RT_CLASS_LOCAL = 0xff + RT_CLASS_MAIN = 0xfe + RT_CLASS_MAX = 0xff + RT_CLASS_UNSPEC = 0x0 + RUSAGE_CHILDREN = -0x1 + RUSAGE_SELF = 0x0 + RUSAGE_THREAD = 0x1 + SCM_CREDENTIALS = 0x2 + SCM_RIGHTS = 0x1 + SCM_TIMESTAMP = 0x1d + SCM_TIMESTAMPING = 0x25 + SCM_TIMESTAMPING_OPT_STATS = 0x36 + SCM_TIMESTAMPING_PKTINFO = 0x3a + SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d + SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 + SECCOMP_MODE_DISABLED = 0x0 + SECCOMP_MODE_FILTER = 0x2 + SECCOMP_MODE_STRICT = 0x1 + SECURITYFS_MAGIC = 0x73636673 + SELINUX_MAGIC = 0xf97cff8c + SHUT_RD = 0x0 + SHUT_RDWR = 0x2 + SHUT_WR = 0x1 + SIOCADDDLCI = 0x8980 + SIOCADDMULTI = 0x8931 + SIOCADDRT = 0x890b + SIOCATMARK = 0x8905 + SIOCBONDCHANGEACTIVE = 0x8995 + SIOCBONDENSLAVE = 0x8990 + SIOCBONDINFOQUERY = 0x8994 + SIOCBONDRELEASE = 0x8991 + SIOCBONDSETHWADDR = 0x8992 + SIOCBONDSLAVEINFOQUERY = 0x8993 + SIOCBRADDBR = 0x89a0 + SIOCBRADDIF = 0x89a2 + SIOCBRDELBR = 0x89a1 + SIOCBRDELIF = 0x89a3 + SIOCDARP = 0x8953 + SIOCDELDLCI = 0x8981 + SIOCDELMULTI = 0x8932 + SIOCDELRT = 0x890c + SIOCDEVPRIVATE = 0x89f0 + SIOCDIFADDR = 0x8936 + SIOCDRARP = 0x8960 + SIOCETHTOOL = 0x8946 + SIOCGARP = 0x8954 + SIOCGHWTSTAMP = 0x89b1 + SIOCGIFADDR = 0x8915 + SIOCGIFBR = 0x8940 + SIOCGIFBRDADDR = 0x8919 + SIOCGIFCONF = 0x8912 + SIOCGIFCOUNT = 0x8938 + SIOCGIFDSTADDR = 0x8917 + SIOCGIFENCAP = 0x8925 + SIOCGIFFLAGS = 0x8913 + SIOCGIFHWADDR = 0x8927 + SIOCGIFINDEX = 0x8933 + SIOCGIFMAP = 0x8970 + SIOCGIFMEM = 0x891f + SIOCGIFMETRIC = 0x891d + SIOCGIFMTU = 0x8921 + SIOCGIFNAME = 0x8910 + SIOCGIFNETMASK = 0x891b + SIOCGIFPFLAGS = 0x8935 + SIOCGIFSLAVE = 0x8929 + SIOCGIFTXQLEN = 0x8942 + SIOCGIFVLAN = 0x8982 + SIOCGMIIPHY = 0x8947 + SIOCGMIIREG = 0x8948 + SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 + SIOCGRARP = 0x8961 + SIOCGSKNS = 0x894c + SIOCGSTAMP = 0x8906 + SIOCGSTAMPNS = 0x8907 + SIOCINQ = 0x541b + SIOCOUTQ = 0x5411 + SIOCOUTQNSD = 0x894b + SIOCPROTOPRIVATE = 0x89e0 + SIOCRTMSG = 0x890d + SIOCSARP = 0x8955 + SIOCSHWTSTAMP = 0x89b0 + SIOCSIFADDR = 0x8916 + SIOCSIFBR = 0x8941 + SIOCSIFBRDADDR = 0x891a + SIOCSIFDSTADDR = 0x8918 + SIOCSIFENCAP = 0x8926 + SIOCSIFFLAGS = 0x8914 + SIOCSIFHWADDR = 0x8924 + SIOCSIFHWBROADCAST = 0x8937 + SIOCSIFLINK = 0x8911 + SIOCSIFMAP = 0x8971 + SIOCSIFMEM = 0x8920 + SIOCSIFMETRIC = 0x891e + SIOCSIFMTU = 0x8922 + SIOCSIFNAME = 0x8923 + SIOCSIFNETMASK = 0x891c + SIOCSIFPFLAGS = 0x8934 + SIOCSIFSLAVE = 0x8930 + SIOCSIFTXQLEN = 0x8943 + SIOCSIFVLAN = 0x8983 + SIOCSMIIREG = 0x8949 + SIOCSPGRP = 0x8902 + SIOCSRARP = 0x8962 + SIOCWANDEV = 0x894a + SMACK_MAGIC = 0x43415d53 + SMART_AUTOSAVE = 0xd2 + SMART_AUTO_OFFLINE = 0xdb + SMART_DISABLE = 0xd9 + SMART_ENABLE = 0xd8 + SMART_HCYL_PASS = 0xc2 + SMART_IMMEDIATE_OFFLINE = 0xd4 + SMART_LCYL_PASS = 0x4f + SMART_READ_LOG_SECTOR = 0xd5 + SMART_READ_THRESHOLDS = 0xd1 + SMART_READ_VALUES = 0xd0 + SMART_SAVE = 0xd3 + SMART_STATUS = 0xda + SMART_WRITE_LOG_SECTOR = 0xd6 + SMART_WRITE_THRESHOLDS = 0xd7 + SMB_SUPER_MAGIC = 0x517b + SOCKFS_MAGIC = 0x534f434b + SOCK_CLOEXEC = 0x80000 + SOCK_DCCP = 0x6 + SOCK_DGRAM = 0x2 + SOCK_IOC_TYPE = 0x89 + SOCK_NONBLOCK = 0x800 + SOCK_PACKET = 0xa + SOCK_RAW = 0x3 + SOCK_RDM = 0x4 + SOCK_SEQPACKET = 0x5 + SOCK_STREAM = 0x1 + SOL_AAL = 0x109 + SOL_ALG = 0x117 + SOL_ATM = 0x108 + SOL_CAIF = 0x116 + SOL_CAN_BASE = 0x64 + SOL_DCCP = 0x10d + SOL_DECNET = 0x105 + SOL_ICMPV6 = 0x3a + SOL_IP = 0x0 + SOL_IPV6 = 0x29 + SOL_IRDA = 0x10a + SOL_IUCV = 0x115 + SOL_KCM = 0x119 + SOL_LLC = 0x10c + SOL_NETBEUI = 0x10b + SOL_NETLINK = 0x10e + SOL_NFC = 0x118 + SOL_PACKET = 0x107 + SOL_PNPIPE = 0x113 + SOL_PPPOL2TP = 0x111 + SOL_RAW = 0xff + SOL_RDS = 0x114 + SOL_RXRPC = 0x110 + SOL_SOCKET = 0x1 + SOL_TCP = 0x6 + SOL_TIPC = 0x10f + SOL_TLS = 0x11a + SOL_X25 = 0x106 + SOL_XDP = 0x11b + SOMAXCONN = 0x80 + SO_ACCEPTCONN = 0x1e + SO_ATTACH_BPF = 0x32 + SO_ATTACH_FILTER = 0x1a + SO_ATTACH_REUSEPORT_CBPF = 0x33 + SO_ATTACH_REUSEPORT_EBPF = 0x34 + SO_BINDTODEVICE = 0x19 + SO_BPF_EXTENSIONS = 0x30 + SO_BROADCAST = 0x6 + SO_BSDCOMPAT = 0xe + SO_BUSY_POLL = 0x2e + SO_CNX_ADVICE = 0x35 + SO_COOKIE = 0x39 + SO_DEBUG = 0x1 + SO_DETACH_BPF = 0x1b + SO_DETACH_FILTER = 0x1b + SO_DOMAIN = 0x27 + SO_DONTROUTE = 0x5 + SO_ERROR = 0x4 + SO_GET_FILTER = 0x1a + 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_NOFCS = 0x2b + SO_NO_CHECK = 0xb + SO_OOBINLINE = 0xa + SO_PASSCRED = 0x10 + SO_PASSSEC = 0x22 + SO_PEEK_OFF = 0x2a + SO_PEERCRED = 0x11 + SO_PEERGROUPS = 0x3b + SO_PEERNAME = 0x1c + SO_PEERSEC = 0x1f + SO_PRIORITY = 0xc + SO_PROTOCOL = 0x26 + SO_RCVBUF = 0x8 + SO_RCVBUFFORCE = 0x21 + SO_RCVLOWAT = 0x12 + SO_RCVTIMEO = 0x14 + 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_TIMESTAMP = 0x1d + SO_TIMESTAMPING = 0x25 + SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d + SO_TYPE = 0x3 + SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 + SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 + SO_VM_SOCKETS_BUFFER_SIZE = 0x0 + SO_VM_SOCKETS_CONNECT_TIMEOUT = 0x6 + SO_VM_SOCKETS_NONBLOCK_TXRX = 0x7 + SO_VM_SOCKETS_PEER_HOST_VM_ID = 0x3 + SO_VM_SOCKETS_TRUSTED = 0x5 + SO_WIFI_STATUS = 0x29 + SO_ZEROCOPY = 0x3c + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 + SQUASHFS_MAGIC = 0x73717368 + STACK_END_MAGIC = 0x57ac6e9d + STATX_ALL = 0xfff + STATX_ATIME = 0x20 + STATX_ATTR_APPEND = 0x20 + STATX_ATTR_AUTOMOUNT = 0x1000 + STATX_ATTR_COMPRESSED = 0x4 + STATX_ATTR_ENCRYPTED = 0x800 + STATX_ATTR_IMMUTABLE = 0x10 + STATX_ATTR_NODUMP = 0x40 + STATX_BASIC_STATS = 0x7ff + STATX_BLOCKS = 0x400 + STATX_BTIME = 0x800 + STATX_CTIME = 0x80 + STATX_GID = 0x10 + STATX_INO = 0x100 + STATX_MODE = 0x2 + STATX_MTIME = 0x40 + STATX_NLINK = 0x4 + STATX_SIZE = 0x200 + STATX_TYPE = 0x1 + STATX_UID = 0x8 + STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 + SYSFS_MAGIC = 0x62656572 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 + TAB0 = 0x0 + TAB1 = 0x800 + TAB2 = 0x1000 + TAB3 = 0x1800 + TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 + TCFLSH = 0x540b + TCGETA = 0x5405 + TCGETS = 0x5401 + TCGETS2 = 0x802c542a + TCGETX = 0x5432 + TCIFLUSH = 0x0 + TCIOFF = 0x2 + TCIOFLUSH = 0x2 + TCION = 0x3 + TCOFLUSH = 0x1 + TCOOFF = 0x0 + TCOON = 0x1 + TCP_CC_INFO = 0x1a + TCP_CONGESTION = 0xd + TCP_COOKIE_IN_ALWAYS = 0x1 + TCP_COOKIE_MAX = 0x10 + TCP_COOKIE_MIN = 0x8 + TCP_COOKIE_OUT_NEVER = 0x2 + TCP_COOKIE_PAIR_SIZE = 0x20 + TCP_COOKIE_TRANSACTIONS = 0xf + TCP_CORK = 0x3 + TCP_DEFER_ACCEPT = 0x9 + TCP_FASTOPEN = 0x17 + TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 + TCP_INFO = 0xb + TCP_KEEPCNT = 0x6 + TCP_KEEPIDLE = 0x4 + TCP_KEEPINTVL = 0x5 + TCP_LINGER2 = 0x8 + TCP_MAXSEG = 0x2 + TCP_MAXWIN = 0xffff + TCP_MAX_WINSHIFT = 0xe + TCP_MD5SIG = 0xe + TCP_MD5SIG_EXT = 0x20 + TCP_MD5SIG_FLAG_PREFIX = 0x1 + TCP_MD5SIG_MAXKEYLEN = 0x50 + TCP_MSS = 0x200 + TCP_MSS_DEFAULT = 0x218 + TCP_MSS_DESIRED = 0x4c4 + TCP_NODELAY = 0x1 + TCP_NOTSENT_LOWAT = 0x19 + TCP_QUEUE_SEQ = 0x15 + TCP_QUICKACK = 0xc + TCP_REPAIR = 0x13 + TCP_REPAIR_OPTIONS = 0x16 + TCP_REPAIR_QUEUE = 0x14 + TCP_REPAIR_WINDOW = 0x1d + TCP_SAVED_SYN = 0x1c + TCP_SAVE_SYN = 0x1b + TCP_SYNCNT = 0x7 + TCP_S_DATA_IN = 0x4 + TCP_S_DATA_OUT = 0x8 + TCP_THIN_DUPACK = 0x11 + TCP_THIN_LINEAR_TIMEOUTS = 0x10 + TCP_TIMESTAMP = 0x18 + TCP_ULP = 0x1f + TCP_USER_TIMEOUT = 0x12 + TCP_WINDOW_CLAMP = 0xa + 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 + TIOCCBRK = 0x5428 + TIOCCONS = 0x541d + TIOCEXCL = 0x540c + TIOCGDEV = 0x80045432 + TIOCGETD = 0x5424 + TIOCGEXCL = 0x80045440 + TIOCGICOUNT = 0x545d + 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_DTR = 0x2 + TIOCM_LE = 0x1 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_RTS = 0x4 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x5422 + TIOCNXCL = 0x540d + TIOCOUTQ = 0x5411 + TIOCPKT = 0x5420 + TIOCPKT_DATA = 0x0 + TIOCPKT_DOSTOP = 0x20 + TIOCPKT_FLUSHREAD = 0x1 + TIOCPKT_FLUSHWRITE = 0x2 + TIOCPKT_IOCTL = 0x40 + TIOCPKT_NOSTOP = 0x10 + TIOCPKT_START = 0x8 + TIOCPKT_STOP = 0x4 + 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 + TIOCSLCKTRMIOS = 0x5457 + TIOCSPGRP = 0x5410 + TIOCSPTLCK = 0x40045431 + TIOCSRS485 = 0x542f + TIOCSSERIAL = 0x541f + TIOCSSOFTCAR = 0x541a + TIOCSTI = 0x5412 + TIOCSWINSZ = 0x5414 + TIOCVHANGUP = 0x5437 + TMPFS_MAGIC = 0x1021994 + TOSTOP = 0x100 + TPACKET_ALIGNMENT = 0x10 + TPACKET_HDRLEN = 0x34 + TP_STATUS_AVAILABLE = 0x0 + TP_STATUS_BLK_TMO = 0x20 + TP_STATUS_COPY = 0x2 + TP_STATUS_CSUMNOTREADY = 0x8 + TP_STATUS_CSUM_VALID = 0x80 + TP_STATUS_KERNEL = 0x0 + TP_STATUS_LOSING = 0x4 + TP_STATUS_SENDING = 0x2 + TP_STATUS_SEND_REQUEST = 0x1 + TP_STATUS_TS_RAW_HARDWARE = -0x80000000 + TP_STATUS_TS_SOFTWARE = 0x20000000 + TP_STATUS_TS_SYS_HARDWARE = 0x40000000 + TP_STATUS_USER = 0x1 + TP_STATUS_VLAN_TPID_VALID = 0x40 + TP_STATUS_VLAN_VALID = 0x10 + TP_STATUS_WRONG_FORMAT = 0x4 + TRACEFS_MAGIC = 0x74726163 + TS_COMM_LEN = 0x20 + TUNATTACHFILTER = 0x401054d5 + TUNDETACHFILTER = 0x401054d6 + TUNGETFEATURES = 0x800454cf + TUNGETFILTER = 0x801054db + TUNGETIFF = 0x800454d2 + TUNGETSNDBUF = 0x800454d3 + TUNGETVNETBE = 0x800454df + TUNGETVNETHDRSZ = 0x800454d7 + TUNGETVNETLE = 0x800454dd + 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_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 + UDF_SUPER_MAGIC = 0x15013346 + UMOUNT_NOFOLLOW = 0x8 + USBDEVICE_SUPER_MAGIC = 0x9fa2 + UTIME_NOW = 0x3fffffff + UTIME_OMIT = 0x3ffffffe + V9FS_MAGIC = 0x1021997 + VDISCARD = 0xd + VEOF = 0x4 + VEOL = 0xb + VEOL2 = 0x10 + VERASE = 0x2 + VINTR = 0x0 + VKILL = 0x3 + VLNEXT = 0xf + VMADDR_CID_ANY = 0xffffffff + VMADDR_CID_HOST = 0x2 + VMADDR_CID_HYPERVISOR = 0x0 + VMADDR_CID_RESERVED = 0x1 + VMADDR_PORT_ANY = 0xffffffff + VMIN = 0x6 + VM_SOCKETS_INVALID_VERSION = 0xffffffff + VQUIT = 0x1 + VREPRINT = 0xc + VSTART = 0x8 + VSTOP = 0x9 + VSUSP = 0xa + VSWTC = 0x7 + VT0 = 0x0 + VT1 = 0x4000 + VTDLY = 0x4000 + VTIME = 0x5 + VWERASE = 0xe + WALL = 0x40000000 + WCLONE = 0x80000000 + WCONTINUED = 0x8 + 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 + WDIOC_SETPRETIMEOUT = 0xc0045708 + WDIOC_SETTIMEOUT = 0xc0045706 + WEXITED = 0x4 + WIN_ACKMEDIACHANGE = 0xdb + WIN_CHECKPOWERMODE1 = 0xe5 + WIN_CHECKPOWERMODE2 = 0x98 + WIN_DEVICE_RESET = 0x8 + WIN_DIAGNOSE = 0x90 + WIN_DOORLOCK = 0xde + WIN_DOORUNLOCK = 0xdf + WIN_DOWNLOAD_MICROCODE = 0x92 + WIN_FLUSH_CACHE = 0xe7 + WIN_FLUSH_CACHE_EXT = 0xea + WIN_FORMAT = 0x50 + WIN_GETMEDIASTATUS = 0xda + WIN_IDENTIFY = 0xec + WIN_IDENTIFY_DMA = 0xee + WIN_IDLEIMMEDIATE = 0xe1 + WIN_INIT = 0x60 + WIN_MEDIAEJECT = 0xed + WIN_MULTREAD = 0xc4 + WIN_MULTREAD_EXT = 0x29 + WIN_MULTWRITE = 0xc5 + WIN_MULTWRITE_EXT = 0x39 + WIN_NOP = 0x0 + WIN_PACKETCMD = 0xa0 + WIN_PIDENTIFY = 0xa1 + WIN_POSTBOOT = 0xdc + WIN_PREBOOT = 0xdd + WIN_QUEUED_SERVICE = 0xa2 + WIN_READ = 0x20 + WIN_READDMA = 0xc8 + WIN_READDMA_EXT = 0x25 + WIN_READDMA_ONCE = 0xc9 + WIN_READDMA_QUEUED = 0xc7 + WIN_READDMA_QUEUED_EXT = 0x26 + WIN_READ_BUFFER = 0xe4 + WIN_READ_EXT = 0x24 + WIN_READ_LONG = 0x22 + WIN_READ_LONG_ONCE = 0x23 + WIN_READ_NATIVE_MAX = 0xf8 + WIN_READ_NATIVE_MAX_EXT = 0x27 + WIN_READ_ONCE = 0x21 + WIN_RECAL = 0x10 + WIN_RESTORE = 0x10 + WIN_SECURITY_DISABLE = 0xf6 + WIN_SECURITY_ERASE_PREPARE = 0xf3 + WIN_SECURITY_ERASE_UNIT = 0xf4 + WIN_SECURITY_FREEZE_LOCK = 0xf5 + WIN_SECURITY_SET_PASS = 0xf1 + WIN_SECURITY_UNLOCK = 0xf2 + WIN_SEEK = 0x70 + WIN_SETFEATURES = 0xef + WIN_SETIDLE1 = 0xe3 + WIN_SETIDLE2 = 0x97 + WIN_SETMULT = 0xc6 + WIN_SET_MAX = 0xf9 + WIN_SET_MAX_EXT = 0x37 + WIN_SLEEPNOW1 = 0xe6 + WIN_SLEEPNOW2 = 0x99 + WIN_SMART = 0xb0 + WIN_SPECIFY = 0x91 + WIN_SRST = 0x8 + WIN_STANDBY = 0xe2 + WIN_STANDBY2 = 0x96 + WIN_STANDBYNOW1 = 0xe0 + WIN_STANDBYNOW2 = 0x94 + WIN_VERIFY = 0x40 + WIN_VERIFY_EXT = 0x42 + WIN_VERIFY_ONCE = 0x41 + WIN_WRITE = 0x30 + WIN_WRITEDMA = 0xca + WIN_WRITEDMA_EXT = 0x35 + WIN_WRITEDMA_ONCE = 0xcb + WIN_WRITEDMA_QUEUED = 0xcc + WIN_WRITEDMA_QUEUED_EXT = 0x36 + WIN_WRITE_BUFFER = 0xe8 + WIN_WRITE_EXT = 0x34 + WIN_WRITE_LONG = 0x32 + WIN_WRITE_LONG_ONCE = 0x33 + WIN_WRITE_ONCE = 0x31 + WIN_WRITE_SAME = 0xe9 + WIN_WRITE_VERIFY = 0x3c + WNOHANG = 0x1 + WNOTHREAD = 0x20000000 + WNOWAIT = 0x1000000 + WORDSIZE = 0x40 + WSTOPPED = 0x2 + WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 + XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 + XENFS_SUPER_MAGIC = 0xabba1974 + XTABS = 0x1800 + ZSMALLOC_MAGIC = 0x58295829 +) + +// Errors +const ( + E2BIG = syscall.Errno(0x7) + EACCES = syscall.Errno(0xd) + EADDRINUSE = syscall.Errno(0x62) + EADDRNOTAVAIL = syscall.Errno(0x63) + EADV = syscall.Errno(0x44) + EAFNOSUPPORT = syscall.Errno(0x61) + EAGAIN = syscall.Errno(0xb) + EALREADY = syscall.Errno(0x72) + EBADE = syscall.Errno(0x34) + EBADF = syscall.Errno(0x9) + EBADFD = syscall.Errno(0x4d) + EBADMSG = syscall.Errno(0x4a) + EBADR = syscall.Errno(0x35) + EBADRQC = syscall.Errno(0x38) + EBADSLT = syscall.Errno(0x39) + EBFONT = syscall.Errno(0x3b) + EBUSY = syscall.Errno(0x10) + ECANCELED = syscall.Errno(0x7d) + ECHILD = syscall.Errno(0xa) + ECHRNG = syscall.Errno(0x2c) + ECOMM = syscall.Errno(0x46) + ECONNABORTED = syscall.Errno(0x67) + ECONNREFUSED = syscall.Errno(0x6f) + ECONNRESET = syscall.Errno(0x68) + EDEADLK = syscall.Errno(0x23) + EDEADLOCK = syscall.Errno(0x23) + EDESTADDRREQ = syscall.Errno(0x59) + EDOM = syscall.Errno(0x21) + EDOTDOT = syscall.Errno(0x49) + EDQUOT = syscall.Errno(0x7a) + EEXIST = syscall.Errno(0x11) + EFAULT = syscall.Errno(0xe) + EFBIG = syscall.Errno(0x1b) + EHOSTDOWN = syscall.Errno(0x70) + EHOSTUNREACH = syscall.Errno(0x71) + EHWPOISON = syscall.Errno(0x85) + EIDRM = syscall.Errno(0x2b) + EILSEQ = syscall.Errno(0x54) + EINPROGRESS = syscall.Errno(0x73) + EINTR = syscall.Errno(0x4) + EINVAL = syscall.Errno(0x16) + EIO = syscall.Errno(0x5) + EISCONN = syscall.Errno(0x6a) + EISDIR = syscall.Errno(0x15) + EISNAM = syscall.Errno(0x78) + EKEYEXPIRED = syscall.Errno(0x7f) + EKEYREJECTED = syscall.Errno(0x81) + EKEYREVOKED = syscall.Errno(0x80) + EL2HLT = syscall.Errno(0x33) + EL2NSYNC = syscall.Errno(0x2d) + EL3HLT = syscall.Errno(0x2e) + EL3RST = syscall.Errno(0x2f) + ELIBACC = syscall.Errno(0x4f) + ELIBBAD = syscall.Errno(0x50) + ELIBEXEC = syscall.Errno(0x53) + ELIBMAX = syscall.Errno(0x52) + ELIBSCN = syscall.Errno(0x51) + ELNRNG = syscall.Errno(0x30) + ELOOP = syscall.Errno(0x28) + EMEDIUMTYPE = syscall.Errno(0x7c) + EMFILE = syscall.Errno(0x18) + EMLINK = syscall.Errno(0x1f) + EMSGSIZE = syscall.Errno(0x5a) + EMULTIHOP = syscall.Errno(0x48) + ENAMETOOLONG = syscall.Errno(0x24) + ENAVAIL = syscall.Errno(0x77) + ENETDOWN = syscall.Errno(0x64) + ENETRESET = syscall.Errno(0x66) + ENETUNREACH = syscall.Errno(0x65) + ENFILE = syscall.Errno(0x17) + ENOANO = syscall.Errno(0x37) + ENOBUFS = syscall.Errno(0x69) + ENOCSI = syscall.Errno(0x32) + ENODATA = syscall.Errno(0x3d) + ENODEV = syscall.Errno(0x13) + ENOENT = syscall.Errno(0x2) + ENOEXEC = syscall.Errno(0x8) + ENOKEY = syscall.Errno(0x7e) + ENOLCK = syscall.Errno(0x25) + ENOLINK = syscall.Errno(0x43) + ENOMEDIUM = syscall.Errno(0x7b) + ENOMEM = syscall.Errno(0xc) + ENOMSG = syscall.Errno(0x2a) + ENONET = syscall.Errno(0x40) + ENOPKG = syscall.Errno(0x41) + ENOPROTOOPT = syscall.Errno(0x5c) + ENOSPC = syscall.Errno(0x1c) + ENOSR = syscall.Errno(0x3f) + ENOSTR = syscall.Errno(0x3c) + ENOSYS = syscall.Errno(0x26) + ENOTBLK = syscall.Errno(0xf) + ENOTCONN = syscall.Errno(0x6b) + ENOTDIR = syscall.Errno(0x14) + ENOTEMPTY = syscall.Errno(0x27) + ENOTNAM = syscall.Errno(0x76) + ENOTRECOVERABLE = syscall.Errno(0x83) + ENOTSOCK = syscall.Errno(0x58) + ENOTSUP = syscall.Errno(0x5f) + ENOTTY = syscall.Errno(0x19) + ENOTUNIQ = syscall.Errno(0x4c) + ENXIO = syscall.Errno(0x6) + EOPNOTSUPP = syscall.Errno(0x5f) + EOVERFLOW = syscall.Errno(0x4b) + EOWNERDEAD = syscall.Errno(0x82) + EPERM = syscall.Errno(0x1) + EPFNOSUPPORT = syscall.Errno(0x60) + EPIPE = syscall.Errno(0x20) + EPROTO = syscall.Errno(0x47) + EPROTONOSUPPORT = syscall.Errno(0x5d) + EPROTOTYPE = syscall.Errno(0x5b) + ERANGE = syscall.Errno(0x22) + EREMCHG = syscall.Errno(0x4e) + EREMOTE = syscall.Errno(0x42) + EREMOTEIO = syscall.Errno(0x79) + ERESTART = syscall.Errno(0x55) + ERFKILL = syscall.Errno(0x84) + EROFS = syscall.Errno(0x1e) + ESHUTDOWN = syscall.Errno(0x6c) + ESOCKTNOSUPPORT = syscall.Errno(0x5e) + ESPIPE = syscall.Errno(0x1d) + ESRCH = syscall.Errno(0x3) + ESRMNT = syscall.Errno(0x45) + ESTALE = syscall.Errno(0x74) + ESTRPIPE = syscall.Errno(0x56) + ETIME = syscall.Errno(0x3e) + ETIMEDOUT = syscall.Errno(0x6e) + ETOOMANYREFS = syscall.Errno(0x6d) + ETXTBSY = syscall.Errno(0x1a) + EUCLEAN = syscall.Errno(0x75) + EUNATCH = syscall.Errno(0x31) + EUSERS = syscall.Errno(0x57) + EWOULDBLOCK = syscall.Errno(0xb) + EXDEV = syscall.Errno(0x12) + EXFULL = syscall.Errno(0x36) +) + +// Signals +const ( + SIGABRT = syscall.Signal(0x6) + SIGALRM = syscall.Signal(0xe) + SIGBUS = syscall.Signal(0x7) + SIGCHLD = syscall.Signal(0x11) + SIGCLD = syscall.Signal(0x11) + SIGCONT = syscall.Signal(0x12) + SIGFPE = syscall.Signal(0x8) + SIGHUP = syscall.Signal(0x1) + SIGILL = syscall.Signal(0x4) + SIGINT = syscall.Signal(0x2) + SIGIO = syscall.Signal(0x1d) + SIGIOT = syscall.Signal(0x6) + SIGKILL = syscall.Signal(0x9) + SIGPIPE = syscall.Signal(0xd) + SIGPOLL = syscall.Signal(0x1d) + SIGPROF = syscall.Signal(0x1b) + SIGPWR = syscall.Signal(0x1e) + SIGQUIT = syscall.Signal(0x3) + SIGSEGV = syscall.Signal(0xb) + SIGSTKFLT = syscall.Signal(0x10) + SIGSTOP = syscall.Signal(0x13) + SIGSYS = syscall.Signal(0x1f) + SIGTERM = syscall.Signal(0xf) + SIGTRAP = syscall.Signal(0x5) + SIGTSTP = syscall.Signal(0x14) + SIGTTIN = syscall.Signal(0x15) + SIGTTOU = syscall.Signal(0x16) + SIGURG = syscall.Signal(0x17) + SIGUSR1 = syscall.Signal(0xa) + SIGUSR2 = syscall.Signal(0xc) + SIGVTALRM = syscall.Signal(0x1a) + SIGWINCH = syscall.Signal(0x1c) + SIGXCPU = syscall.Signal(0x18) + SIGXFSZ = syscall.Signal(0x19) +) + +// Error table +var errorList = [...]struct { + num syscall.Errno + name string + desc string +}{ + {1, "EPERM", "operation not permitted"}, + {2, "ENOENT", "no such file or directory"}, + {3, "ESRCH", "no such process"}, + {4, "EINTR", "interrupted system call"}, + {5, "EIO", "input/output error"}, + {6, "ENXIO", "no such device or address"}, + {7, "E2BIG", "argument list too long"}, + {8, "ENOEXEC", "exec format error"}, + {9, "EBADF", "bad file descriptor"}, + {10, "ECHILD", "no child processes"}, + {11, "EAGAIN", "resource temporarily unavailable"}, + {12, "ENOMEM", "cannot allocate memory"}, + {13, "EACCES", "permission denied"}, + {14, "EFAULT", "bad address"}, + {15, "ENOTBLK", "block device required"}, + {16, "EBUSY", "device or resource busy"}, + {17, "EEXIST", "file exists"}, + {18, "EXDEV", "invalid cross-device link"}, + {19, "ENODEV", "no such device"}, + {20, "ENOTDIR", "not a directory"}, + {21, "EISDIR", "is a directory"}, + {22, "EINVAL", "invalid argument"}, + {23, "ENFILE", "too many open files in system"}, + {24, "EMFILE", "too many open files"}, + {25, "ENOTTY", "inappropriate ioctl for device"}, + {26, "ETXTBSY", "text file busy"}, + {27, "EFBIG", "file too large"}, + {28, "ENOSPC", "no space left on device"}, + {29, "ESPIPE", "illegal seek"}, + {30, "EROFS", "read-only file system"}, + {31, "EMLINK", "too many links"}, + {32, "EPIPE", "broken pipe"}, + {33, "EDOM", "numerical argument out of domain"}, + {34, "ERANGE", "numerical result out of range"}, + {35, "EDEADLK", "resource deadlock avoided"}, + {36, "ENAMETOOLONG", "file name too long"}, + {37, "ENOLCK", "no locks available"}, + {38, "ENOSYS", "function not implemented"}, + {39, "ENOTEMPTY", "directory not empty"}, + {40, "ELOOP", "too many levels of symbolic links"}, + {42, "ENOMSG", "no message of desired type"}, + {43, "EIDRM", "identifier removed"}, + {44, "ECHRNG", "channel number out of range"}, + {45, "EL2NSYNC", "level 2 not synchronized"}, + {46, "EL3HLT", "level 3 halted"}, + {47, "EL3RST", "level 3 reset"}, + {48, "ELNRNG", "link number out of range"}, + {49, "EUNATCH", "protocol driver not attached"}, + {50, "ENOCSI", "no CSI structure available"}, + {51, "EL2HLT", "level 2 halted"}, + {52, "EBADE", "invalid exchange"}, + {53, "EBADR", "invalid request descriptor"}, + {54, "EXFULL", "exchange full"}, + {55, "ENOANO", "no anode"}, + {56, "EBADRQC", "invalid request code"}, + {57, "EBADSLT", "invalid slot"}, + {59, "EBFONT", "bad font file format"}, + {60, "ENOSTR", "device not a stream"}, + {61, "ENODATA", "no data available"}, + {62, "ETIME", "timer expired"}, + {63, "ENOSR", "out of streams resources"}, + {64, "ENONET", "machine is not on the network"}, + {65, "ENOPKG", "package not installed"}, + {66, "EREMOTE", "object is remote"}, + {67, "ENOLINK", "link has been severed"}, + {68, "EADV", "advertise error"}, + {69, "ESRMNT", "srmount error"}, + {70, "ECOMM", "communication error on send"}, + {71, "EPROTO", "protocol error"}, + {72, "EMULTIHOP", "multihop attempted"}, + {73, "EDOTDOT", "RFS specific error"}, + {74, "EBADMSG", "bad message"}, + {75, "EOVERFLOW", "value too large for defined data type"}, + {76, "ENOTUNIQ", "name not unique on network"}, + {77, "EBADFD", "file descriptor in bad state"}, + {78, "EREMCHG", "remote address changed"}, + {79, "ELIBACC", "can not access a needed shared library"}, + {80, "ELIBBAD", "accessing a corrupted shared library"}, + {81, "ELIBSCN", ".lib section in a.out corrupted"}, + {82, "ELIBMAX", "attempting to link in too many shared libraries"}, + {83, "ELIBEXEC", "cannot exec a shared library directly"}, + {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, + {85, "ERESTART", "interrupted system call should be restarted"}, + {86, "ESTRPIPE", "streams pipe error"}, + {87, "EUSERS", "too many users"}, + {88, "ENOTSOCK", "socket operation on non-socket"}, + {89, "EDESTADDRREQ", "destination address required"}, + {90, "EMSGSIZE", "message too long"}, + {91, "EPROTOTYPE", "protocol wrong type for socket"}, + {92, "ENOPROTOOPT", "protocol not available"}, + {93, "EPROTONOSUPPORT", "protocol not supported"}, + {94, "ESOCKTNOSUPPORT", "socket type not supported"}, + {95, "ENOTSUP", "operation not supported"}, + {96, "EPFNOSUPPORT", "protocol family not supported"}, + {97, "EAFNOSUPPORT", "address family not supported by protocol"}, + {98, "EADDRINUSE", "address already in use"}, + {99, "EADDRNOTAVAIL", "cannot assign requested address"}, + {100, "ENETDOWN", "network is down"}, + {101, "ENETUNREACH", "network is unreachable"}, + {102, "ENETRESET", "network dropped connection on reset"}, + {103, "ECONNABORTED", "software caused connection abort"}, + {104, "ECONNRESET", "connection reset by peer"}, + {105, "ENOBUFS", "no buffer space available"}, + {106, "EISCONN", "transport endpoint is already connected"}, + {107, "ENOTCONN", "transport endpoint is not connected"}, + {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, + {109, "ETOOMANYREFS", "too many references: cannot splice"}, + {110, "ETIMEDOUT", "connection timed out"}, + {111, "ECONNREFUSED", "connection refused"}, + {112, "EHOSTDOWN", "host is down"}, + {113, "EHOSTUNREACH", "no route to host"}, + {114, "EALREADY", "operation already in progress"}, + {115, "EINPROGRESS", "operation now in progress"}, + {116, "ESTALE", "stale file handle"}, + {117, "EUCLEAN", "structure needs cleaning"}, + {118, "ENOTNAM", "not a XENIX named type file"}, + {119, "ENAVAIL", "no XENIX semaphores available"}, + {120, "EISNAM", "is a named type file"}, + {121, "EREMOTEIO", "remote I/O error"}, + {122, "EDQUOT", "disk quota exceeded"}, + {123, "ENOMEDIUM", "no medium found"}, + {124, "EMEDIUMTYPE", "wrong medium type"}, + {125, "ECANCELED", "operation canceled"}, + {126, "ENOKEY", "required key not available"}, + {127, "EKEYEXPIRED", "key has expired"}, + {128, "EKEYREVOKED", "key has been revoked"}, + {129, "EKEYREJECTED", "key was rejected by service"}, + {130, "EOWNERDEAD", "owner died"}, + {131, "ENOTRECOVERABLE", "state not recoverable"}, + {132, "ERFKILL", "operation not possible due to RF-kill"}, + {133, "EHWPOISON", "memory page has hardware error"}, +} + +// Signal table +var signalList = [...]struct { + num syscall.Signal + name string + desc string +}{ + {1, "SIGHUP", "hangup"}, + {2, "SIGINT", "interrupt"}, + {3, "SIGQUIT", "quit"}, + {4, "SIGILL", "illegal instruction"}, + {5, "SIGTRAP", "trace/breakpoint trap"}, + {6, "SIGABRT", "aborted"}, + {7, "SIGBUS", "bus error"}, + {8, "SIGFPE", "floating point exception"}, + {9, "SIGKILL", "killed"}, + {10, "SIGUSR1", "user defined signal 1"}, + {11, "SIGSEGV", "segmentation fault"}, + {12, "SIGUSR2", "user defined signal 2"}, + {13, "SIGPIPE", "broken pipe"}, + {14, "SIGALRM", "alarm clock"}, + {15, "SIGTERM", "terminated"}, + {16, "SIGSTKFLT", "stack fault"}, + {17, "SIGCHLD", "child exited"}, + {18, "SIGCONT", "continued"}, + {19, "SIGSTOP", "stopped (signal)"}, + {20, "SIGTSTP", "stopped"}, + {21, "SIGTTIN", "stopped (tty input)"}, + {22, "SIGTTOU", "stopped (tty output)"}, + {23, "SIGURG", "urgent I/O condition"}, + {24, "SIGXCPU", "CPU time limit exceeded"}, + {25, "SIGXFSZ", "file size limit exceeded"}, + {26, "SIGVTALRM", "virtual timer expired"}, + {27, "SIGPROF", "profiling timer expired"}, + {28, "SIGWINCH", "window changed"}, + {29, "SIGIO", "I/O possible"}, + {30, "SIGPWR", "power failure"}, + {31, "SIGSYS", "bad system call"}, +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 3814df854935e..96aff508322f8 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -64,6 +64,7 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + AF_XDP = 0x2c ALG_OP_DECRYPT = 0x0 ALG_OP_ENCRYPT = 0x1 ALG_SET_AEAD_ASSOCLEN = 0x4 @@ -498,6 +499,8 @@ const ( FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 @@ -635,7 +638,7 @@ const ( IFA_F_STABLE_PRIVACY = 0x800 IFA_F_TEMPORARY = 0x1 IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 + IFA_MAX = 0x9 IFF_ALLMULTI = 0x200 IFF_ATTACH_QUEUE = 0x200 IFF_AUTOMEDIA = 0x4000 @@ -762,6 +765,7 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 IPV6_HOPOPTS = 0x36 @@ -874,6 +878,26 @@ const ( IXOFF = 0x1000 IXON = 0x400 JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CHOWN = 0x4 KEYCTL_CLEAR = 0x7 @@ -954,6 +978,7 @@ const ( MAP_EXECUTABLE = 0x1000 MAP_FILE = 0x0 MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_HUGE_MASK = 0x3f @@ -964,11 +989,30 @@ const ( MAP_POPULATE = 0x8000 MAP_PRIVATE = 0x2 MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 MAP_TYPE = 0xf MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 MCL_ONFAULT = 0x4 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a MINIX2_SUPER_MAGIC = 0x2468 MINIX2_SUPER_MAGIC2 = 0x2478 MINIX3_SUPER_MAGIC = 0x4d5a @@ -977,6 +1021,8 @@ const ( MNT_DETACH = 0x2 MNT_EXPIRE = 0x4 MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 MSDOS_SUPER_MAGIC = 0x4d44 MSG_BATCH = 0x40000 MSG_CMSG_CLOEXEC = 0x40000000 @@ -1074,6 +1120,8 @@ const ( NETLINK_UNUSED = 0x1 NETLINK_USERSOCK = 0x2 NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 NFNETLINK_V0 = 0x0 NFNLGRP_ACCT_QUOTA = 0x8 NFNLGRP_CONNTRACK_DESTROY = 0x3 @@ -1243,6 +1291,36 @@ const ( PERF_EVENT_IOC_SET_FILTER = 0x40082406 PERF_EVENT_IOC_SET_OUTPUT = 0x2405 PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCXFERUNIT = 0x744e PRIO_PGRP = 0x1 PRIO_PROCESS = 0x0 PRIO_USER = 0x2 @@ -1488,6 +1566,9 @@ const ( RAMFS_MAGIC = 0x858458f6 RDTGROUP_SUPER_MAGIC = 0x7655821 REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 RLIMIT_AS = 0x9 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 @@ -1530,7 +1611,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1a + RTA_MAX = 0x1d RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -1598,6 +1679,7 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELMDB = 0x55 RTM_DELNEIGH = 0x1d @@ -1618,6 +1700,7 @@ const ( RTM_GETADDR = 0x16 RTM_GETADDRLABEL = 0x4a RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 RTM_GETDCB = 0x4e RTM_GETLINK = 0x12 RTM_GETMDB = 0x56 @@ -1632,11 +1715,12 @@ const ( RTM_GETSTATS = 0x5e RTM_GETTCLASS = 0x2a RTM_GETTFILTER = 0x2e - RTM_MAX = 0x63 + RTM_MAX = 0x67 RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWMDB = 0x54 RTM_NEWNDUSEROPT = 0x44 @@ -1651,8 +1735,8 @@ const ( RTM_NEWSTATS = 0x5c RTM_NEWTCLASS = 0x28 RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x15 - RTM_NR_MSGTYPES = 0x54 + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 RTM_SETDCB = 0x4f RTM_SETLINK = 0x13 RTM_SETNEIGHTBL = 0x43 @@ -1666,17 +1750,22 @@ const ( RTNH_F_UNRESOLVED = 0x20 RTN_MAX = 0xb RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba RTPROT_BIRD = 0xc RTPROT_BOOT = 0x3 RTPROT_DHCP = 0x10 RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb RTPROT_KERNEL = 0x2 RTPROT_MROUTED = 0x11 RTPROT_MRT = 0xa RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd RTPROT_STATIC = 0x4 RTPROT_UNSPEC = 0x0 RTPROT_XORP = 0xe @@ -1696,7 +1785,9 @@ const ( SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 + SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 + SC_LOG_FLUSH = 0x100000 SECCOMP_MODE_DISABLED = 0x0 SECCOMP_MODE_FILTER = 0x2 SECCOMP_MODE_STRICT = 0x1 @@ -1752,6 +1843,9 @@ const ( SIOCGMIIPHY = 0x8947 SIOCGMIIREG = 0x8948 SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 SIOCGRARP = 0x8961 SIOCGSKNS = 0x894c SIOCGSTAMP = 0x8906 @@ -1841,6 +1935,7 @@ const ( SOL_TIPC = 0x10f SOL_TLS = 0x11a SOL_X25 = 0x106 + SOL_XDP = 0x11b SOMAXCONN = 0x80 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 @@ -1899,6 +1994,7 @@ const ( SO_TIMESTAMP = 0x1d SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 + SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 @@ -1936,6 +2032,9 @@ const ( STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 SYSFS_MAGIC = 0x62656572 S_BLKSIZE = 0x200 S_IEXEC = 0x40 @@ -1999,6 +2098,8 @@ const ( TCP_DEFER_ACCEPT = 0x9 TCP_FASTOPEN = 0x17 TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 TCP_INFO = 0xb TCP_KEEPCNT = 0x6 TCP_KEEPIDLE = 0x4 @@ -2166,6 +2267,21 @@ const ( 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_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 UDF_SUPER_MAGIC = 0x15013346 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 @@ -2302,6 +2418,26 @@ const ( XATTR_CREATE = 0x1 XATTR_REPLACE = 0x2 XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XTABS = 0x1800 ZSMALLOC_MAGIC = 0x58295829 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 7fdc85b172609..ba93f3e53c193 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -1,10 +1,10 @@ -// mkerrors.sh -m64 -// Code generated by the command above; DO NOT EDIT. +// mkerrors.sh -Wall -Werror -static -I/tmp/include +// Code generated by the command above; see README.md. DO NOT EDIT. // +build sparc64,linux -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs -- -m64 _const.go +// Code generated by cmd/cgo -godefs; DO NOT EDIT. +// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go package unix @@ -1969,174 +1969,182 @@ const ( ) // Error table -var errors = [...]string{ - 1: "operation not permitted", - 2: "no such file or directory", - 3: "no such process", - 4: "interrupted system call", - 5: "input/output error", - 6: "no such device or address", - 7: "argument list too long", - 8: "exec format error", - 9: "bad file descriptor", - 10: "no child processes", - 11: "resource temporarily unavailable", - 12: "cannot allocate memory", - 13: "permission denied", - 14: "bad address", - 15: "block device required", - 16: "device or resource busy", - 17: "file exists", - 18: "invalid cross-device link", - 19: "no such device", - 20: "not a directory", - 21: "is a directory", - 22: "invalid argument", - 23: "too many open files in system", - 24: "too many open files", - 25: "inappropriate ioctl for device", - 26: "text file busy", - 27: "file too large", - 28: "no space left on device", - 29: "illegal seek", - 30: "read-only file system", - 31: "too many links", - 32: "broken pipe", - 33: "numerical argument out of domain", - 34: "numerical result out of range", - 36: "operation now in progress", - 37: "operation already in progress", - 38: "socket operation on non-socket", - 39: "destination address required", - 40: "message too long", - 41: "protocol wrong type for socket", - 42: "protocol not available", - 43: "protocol not supported", - 44: "socket type not supported", - 45: "operation not supported", - 46: "protocol family not supported", - 47: "address family not supported by protocol", - 48: "address already in use", - 49: "cannot assign requested address", - 50: "network is down", - 51: "network is unreachable", - 52: "network dropped connection on reset", - 53: "software caused connection abort", - 54: "connection reset by peer", - 55: "no buffer space available", - 56: "transport endpoint is already connected", - 57: "transport endpoint is not connected", - 58: "cannot send after transport endpoint shutdown", - 59: "too many references: cannot splice", - 60: "connection timed out", - 61: "connection refused", - 62: "too many levels of symbolic links", - 63: "file name too long", - 64: "host is down", - 65: "no route to host", - 66: "directory not empty", - 67: "too many processes", - 68: "too many users", - 69: "disk quota exceeded", - 70: "stale file handle", - 71: "object is remote", - 72: "device not a stream", - 73: "timer expired", - 74: "out of streams resources", - 75: "no message of desired type", - 76: "bad message", - 77: "identifier removed", - 78: "resource deadlock avoided", - 79: "no locks available", - 80: "machine is not on the network", - 81: "unknown error 81", - 82: "link has been severed", - 83: "advertise error", - 84: "srmount error", - 85: "communication error on send", - 86: "protocol error", - 87: "multihop attempted", - 88: "RFS specific error", - 89: "remote address changed", - 90: "function not implemented", - 91: "streams pipe error", - 92: "value too large for defined data type", - 93: "file descriptor in bad state", - 94: "channel number out of range", - 95: "level 2 not synchronized", - 96: "level 3 halted", - 97: "level 3 reset", - 98: "link number out of range", - 99: "protocol driver not attached", - 100: "no CSI structure available", - 101: "level 2 halted", - 102: "invalid exchange", - 103: "invalid request descriptor", - 104: "exchange full", - 105: "no anode", - 106: "invalid request code", - 107: "invalid slot", - 108: "file locking deadlock error", - 109: "bad font file format", - 110: "cannot exec a shared library directly", - 111: "no data available", - 112: "accessing a corrupted shared library", - 113: "package not installed", - 114: "can not access a needed shared library", - 115: "name not unique on network", - 116: "interrupted system call should be restarted", - 117: "structure needs cleaning", - 118: "not a XENIX named type file", - 119: "no XENIX semaphores available", - 120: "is a named type file", - 121: "remote I/O error", - 122: "invalid or incomplete multibyte or wide character", - 123: "attempting to link in too many shared libraries", - 124: ".lib section in a.out corrupted", - 125: "no medium found", - 126: "wrong medium type", - 127: "operation canceled", - 128: "required key not available", - 129: "key has expired", - 130: "key has been revoked", - 131: "key was rejected by service", - 132: "owner died", - 133: "state not recoverable", - 134: "operation not possible due to RF-kill", - 135: "memory page has hardware error", +var errorList = [...]struct { + num syscall.Errno + name string + desc string +}{ + {1, "EPERM", "operation not permitted"}, + {2, "ENOENT", "no such file or directory"}, + {3, "ESRCH", "no such process"}, + {4, "EINTR", "interrupted system call"}, + {5, "EIO", "input/output error"}, + {6, "ENXIO", "no such device or address"}, + {7, "E2BIG", "argument list too long"}, + {8, "ENOEXEC", "exec format error"}, + {9, "EBADF", "bad file descriptor"}, + {10, "ECHILD", "no child processes"}, + {11, "EAGAIN", "resource temporarily unavailable"}, + {12, "ENOMEM", "cannot allocate memory"}, + {13, "EACCES", "permission denied"}, + {14, "EFAULT", "bad address"}, + {15, "ENOTBLK", "block device required"}, + {16, "EBUSY", "device or resource busy"}, + {17, "EEXIST", "file exists"}, + {18, "EXDEV", "invalid cross-device link"}, + {19, "ENODEV", "no such device"}, + {20, "ENOTDIR", "not a directory"}, + {21, "EISDIR", "is a directory"}, + {22, "EINVAL", "invalid argument"}, + {23, "ENFILE", "too many open files in system"}, + {24, "EMFILE", "too many open files"}, + {25, "ENOTTY", "inappropriate ioctl for device"}, + {26, "ETXTBSY", "text file busy"}, + {27, "EFBIG", "file too large"}, + {28, "ENOSPC", "no space left on device"}, + {29, "ESPIPE", "illegal seek"}, + {30, "EROFS", "read-only file system"}, + {31, "EMLINK", "too many links"}, + {32, "EPIPE", "broken pipe"}, + {33, "EDOM", "numerical argument out of domain"}, + {34, "ERANGE", "numerical result out of range"}, + {36, "EINPROGRESS", "operation now in progress"}, + {37, "EALREADY", "operation already in progress"}, + {38, "ENOTSOCK", "socket operation on non-socket"}, + {39, "EDESTADDRREQ", "destination address required"}, + {40, "EMSGSIZE", "message too long"}, + {41, "EPROTOTYPE", "protocol wrong type for socket"}, + {42, "ENOPROTOOPT", "protocol not available"}, + {43, "EPROTONOSUPPORT", "protocol not supported"}, + {44, "ESOCKTNOSUPPORT", "socket type not supported"}, + {45, "ENOTSUP", "operation not supported"}, + {46, "EPFNOSUPPORT", "protocol family not supported"}, + {47, "EAFNOSUPPORT", "address family not supported by protocol"}, + {48, "EADDRINUSE", "address already in use"}, + {49, "EADDRNOTAVAIL", "cannot assign requested address"}, + {50, "ENETDOWN", "network is down"}, + {51, "ENETUNREACH", "network is unreachable"}, + {52, "ENETRESET", "network dropped connection on reset"}, + {53, "ECONNABORTED", "software caused connection abort"}, + {54, "ECONNRESET", "connection reset by peer"}, + {55, "ENOBUFS", "no buffer space available"}, + {56, "EISCONN", "transport endpoint is already connected"}, + {57, "ENOTCONN", "transport endpoint is not connected"}, + {58, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, + {59, "ETOOMANYREFS", "too many references: cannot splice"}, + {60, "ETIMEDOUT", "connection timed out"}, + {61, "ECONNREFUSED", "connection refused"}, + {62, "ELOOP", "too many levels of symbolic links"}, + {63, "ENAMETOOLONG", "file name too long"}, + {64, "EHOSTDOWN", "host is down"}, + {65, "EHOSTUNREACH", "no route to host"}, + {66, "ENOTEMPTY", "directory not empty"}, + {67, "EPROCLIM", "too many processes"}, + {68, "EUSERS", "too many users"}, + {69, "EDQUOT", "disk quota exceeded"}, + {70, "ESTALE", "stale file handle"}, + {71, "EREMOTE", "object is remote"}, + {72, "ENOSTR", "device not a stream"}, + {73, "ETIME", "timer expired"}, + {74, "ENOSR", "out of streams resources"}, + {75, "ENOMSG", "no message of desired type"}, + {76, "EBADMSG", "bad message"}, + {77, "EIDRM", "identifier removed"}, + {78, "EDEADLK", "resource deadlock avoided"}, + {79, "ENOLCK", "no locks available"}, + {80, "ENONET", "machine is not on the network"}, + {81, "ERREMOTE", "unknown error 81"}, + {82, "ENOLINK", "link has been severed"}, + {83, "EADV", "advertise error"}, + {84, "ESRMNT", "srmount error"}, + {85, "ECOMM", "communication error on send"}, + {86, "EPROTO", "protocol error"}, + {87, "EMULTIHOP", "multihop attempted"}, + {88, "EDOTDOT", "RFS specific error"}, + {89, "EREMCHG", "remote address changed"}, + {90, "ENOSYS", "function not implemented"}, + {91, "ESTRPIPE", "streams pipe error"}, + {92, "EOVERFLOW", "value too large for defined data type"}, + {93, "EBADFD", "file descriptor in bad state"}, + {94, "ECHRNG", "channel number out of range"}, + {95, "EL2NSYNC", "level 2 not synchronized"}, + {96, "EL3HLT", "level 3 halted"}, + {97, "EL3RST", "level 3 reset"}, + {98, "ELNRNG", "link number out of range"}, + {99, "EUNATCH", "protocol driver not attached"}, + {100, "ENOCSI", "no CSI structure available"}, + {101, "EL2HLT", "level 2 halted"}, + {102, "EBADE", "invalid exchange"}, + {103, "EBADR", "invalid request descriptor"}, + {104, "EXFULL", "exchange full"}, + {105, "ENOANO", "no anode"}, + {106, "EBADRQC", "invalid request code"}, + {107, "EBADSLT", "invalid slot"}, + {108, "EDEADLOCK", "file locking deadlock error"}, + {109, "EBFONT", "bad font file format"}, + {110, "ELIBEXEC", "cannot exec a shared library directly"}, + {111, "ENODATA", "no data available"}, + {112, "ELIBBAD", "accessing a corrupted shared library"}, + {113, "ENOPKG", "package not installed"}, + {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"}, + {118, "ENOTNAM", "not a XENIX named type file"}, + {119, "ENAVAIL", "no XENIX semaphores available"}, + {120, "EISNAM", "is a named type file"}, + {121, "EREMOTEIO", "remote I/O error"}, + {122, "EILSEQ", "invalid or incomplete multibyte or wide character"}, + {123, "ELIBMAX", "attempting to link in too many shared libraries"}, + {124, "ELIBSCN", ".lib section in a.out corrupted"}, + {125, "ENOMEDIUM", "no medium found"}, + {126, "EMEDIUMTYPE", "wrong medium type"}, + {127, "ECANCELED", "operation canceled"}, + {128, "ENOKEY", "required key not available"}, + {129, "EKEYEXPIRED", "key has expired"}, + {130, "EKEYREVOKED", "key has been revoked"}, + {131, "EKEYREJECTED", "key was rejected by service"}, + {132, "EOWNERDEAD", "owner died"}, + {133, "ENOTRECOVERABLE", "state not recoverable"}, + {134, "ERFKILL", "operation not possible due to RF-kill"}, + {135, "EHWPOISON", "memory page has hardware error"}, } // Signal table -var signals = [...]string{ - 1: "hangup", - 2: "interrupt", - 3: "quit", - 4: "illegal instruction", - 5: "trace/breakpoint trap", - 6: "aborted", - 7: "EMT trap", - 8: "floating point exception", - 9: "killed", - 10: "bus error", - 11: "segmentation fault", - 12: "bad system call", - 13: "broken pipe", - 14: "alarm clock", - 15: "terminated", - 16: "urgent I/O condition", - 17: "stopped (signal)", - 18: "stopped", - 19: "continued", - 20: "child exited", - 21: "stopped (tty input)", - 22: "stopped (tty output)", - 23: "I/O possible", - 24: "CPU time limit exceeded", - 25: "file size limit exceeded", - 26: "virtual timer expired", - 27: "profiling timer expired", - 28: "window changed", - 29: "resource lost", - 30: "user defined signal 1", - 31: "user defined signal 2", +var signalList = [...]struct { + num syscall.Signal + name string + desc string +}{ + {1, "SIGHUP", "hangup"}, + {2, "SIGINT", "interrupt"}, + {3, "SIGQUIT", "quit"}, + {4, "SIGILL", "illegal instruction"}, + {5, "SIGTRAP", "trace/breakpoint trap"}, + {6, "SIGABRT", "aborted"}, + {7, "SIGEMT", "EMT trap"}, + {8, "SIGFPE", "floating point exception"}, + {9, "SIGKILL", "killed"}, + {10, "SIGBUS", "bus error"}, + {11, "SIGSEGV", "segmentation fault"}, + {12, "SIGSYS", "bad system call"}, + {13, "SIGPIPE", "broken pipe"}, + {14, "SIGALRM", "alarm clock"}, + {15, "SIGTERM", "terminated"}, + {16, "SIGURG", "urgent I/O condition"}, + {17, "SIGSTOP", "stopped (signal)"}, + {18, "SIGTSTP", "stopped"}, + {19, "SIGCONT", "continued"}, + {20, "SIGCHLD", "child exited"}, + {21, "SIGTTIN", "stopped (tty input)"}, + {22, "SIGTTOU", "stopped (tty output)"}, + {23, "SIGIO", "I/O possible"}, + {24, "SIGXCPU", "CPU time limit exceeded"}, + {25, "SIGXFSZ", "file size limit exceeded"}, + {26, "SIGVTALRM", "virtual timer expired"}, + {27, "SIGPROF", "profiling timer expired"}, + {28, "SIGWINCH", "window changed"}, + {29, "SIGLOST", "power failure"}, + {30, "SIGUSR1", "user defined signal 1"}, + {31, "SIGUSR2", "user defined signal 2"}, } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go index cd93ce0d85e53..78cc04ea6df16 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go @@ -550,6 +550,10 @@ const ( EV_ONESHOT = 0x10 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 + EXTATTR_CMD_START = 0x1 + EXTATTR_CMD_STOP = 0x2 + EXTATTR_NAMESPACE_SYSTEM = 0x2 + EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 @@ -1016,6 +1020,43 @@ const ( MAP_WIRED = 0x800 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_ASYNC = 0x40 + MNT_BASIC_FLAGS = 0xe782807f + MNT_DEFEXPORTED = 0x200 + MNT_DISCARD = 0x800000 + MNT_EXKERB = 0x800 + MNT_EXNORESPORT = 0x8000000 + MNT_EXPORTANON = 0x400 + MNT_EXPORTED = 0x100 + MNT_EXPUBLIC = 0x10000000 + MNT_EXRDONLY = 0x80 + MNT_EXTATTR = 0x1000000 + MNT_FORCE = 0x80000 + MNT_GETARGS = 0x400000 + MNT_IGNORE = 0x100000 + MNT_LAZY = 0x3 + MNT_LOCAL = 0x1000 + MNT_LOG = 0x2000000 + MNT_NOATIME = 0x4000000 + MNT_NOCOREDUMP = 0x8000 + MNT_NODEV = 0x10 + MNT_NODEVMTIME = 0x40000000 + MNT_NOEXEC = 0x4 + MNT_NOSUID = 0x8 + MNT_NOWAIT = 0x2 + MNT_OP_FLAGS = 0x4d0000 + MNT_QUOTA = 0x2000 + MNT_RDONLY = 0x1 + MNT_RELATIME = 0x20000 + MNT_RELOAD = 0x40000 + MNT_ROOTFS = 0x4000 + MNT_SOFTDEP = 0x80000000 + MNT_SYMPERM = 0x20000000 + MNT_SYNCHRONOUS = 0x2 + MNT_UNION = 0x20 + MNT_UPDATE = 0x10000 + MNT_VISFLAGMASK = 0xff90ffff + MNT_WAIT = 0x1 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CONTROLMBUF = 0x2000000 @@ -1109,7 +1150,10 @@ const ( RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 + RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 + RLIMIT_NPROC = 0x7 + RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go index 071701c41181c..92185e693ff01 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go @@ -540,6 +540,10 @@ const ( EV_ONESHOT = 0x10 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 + EXTATTR_CMD_START = 0x1 + EXTATTR_CMD_STOP = 0x2 + EXTATTR_NAMESPACE_SYSTEM = 0x2 + EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 @@ -1006,6 +1010,43 @@ const ( MAP_WIRED = 0x800 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_ASYNC = 0x40 + MNT_BASIC_FLAGS = 0xe782807f + MNT_DEFEXPORTED = 0x200 + MNT_DISCARD = 0x800000 + MNT_EXKERB = 0x800 + MNT_EXNORESPORT = 0x8000000 + MNT_EXPORTANON = 0x400 + MNT_EXPORTED = 0x100 + MNT_EXPUBLIC = 0x10000000 + MNT_EXRDONLY = 0x80 + MNT_EXTATTR = 0x1000000 + MNT_FORCE = 0x80000 + MNT_GETARGS = 0x400000 + MNT_IGNORE = 0x100000 + MNT_LAZY = 0x3 + MNT_LOCAL = 0x1000 + MNT_LOG = 0x2000000 + MNT_NOATIME = 0x4000000 + MNT_NOCOREDUMP = 0x8000 + MNT_NODEV = 0x10 + MNT_NODEVMTIME = 0x40000000 + MNT_NOEXEC = 0x4 + MNT_NOSUID = 0x8 + MNT_NOWAIT = 0x2 + MNT_OP_FLAGS = 0x4d0000 + MNT_QUOTA = 0x2000 + MNT_RDONLY = 0x1 + MNT_RELATIME = 0x20000 + MNT_RELOAD = 0x40000 + MNT_ROOTFS = 0x4000 + MNT_SOFTDEP = 0x80000000 + MNT_SYMPERM = 0x20000000 + MNT_SYNCHRONOUS = 0x2 + MNT_UNION = 0x20 + MNT_UPDATE = 0x10000 + MNT_VISFLAGMASK = 0xff90ffff + MNT_WAIT = 0x1 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CONTROLMBUF = 0x2000000 @@ -1099,7 +1140,10 @@ const ( RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 + RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 + RLIMIT_NPROC = 0x7 + RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go index 5fe56ae8c7241..373ad4543d831 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go @@ -532,6 +532,10 @@ const ( EV_ONESHOT = 0x10 EV_SYSFLAGS = 0xf000 EXTA = 0x4b00 + EXTATTR_CMD_START = 0x1 + EXTATTR_CMD_STOP = 0x2 + EXTATTR_NAMESPACE_SYSTEM = 0x2 + EXTATTR_NAMESPACE_USER = 0x1 EXTB = 0x9600 EXTPROC = 0x800 FD_CLOEXEC = 0x1 @@ -996,6 +1000,43 @@ const ( MAP_STACK = 0x2000 MAP_TRYFIXED = 0x400 MAP_WIRED = 0x800 + MNT_ASYNC = 0x40 + MNT_BASIC_FLAGS = 0xe782807f + MNT_DEFEXPORTED = 0x200 + MNT_DISCARD = 0x800000 + MNT_EXKERB = 0x800 + MNT_EXNORESPORT = 0x8000000 + MNT_EXPORTANON = 0x400 + MNT_EXPORTED = 0x100 + MNT_EXPUBLIC = 0x10000000 + MNT_EXRDONLY = 0x80 + MNT_EXTATTR = 0x1000000 + MNT_FORCE = 0x80000 + MNT_GETARGS = 0x400000 + MNT_IGNORE = 0x100000 + MNT_LAZY = 0x3 + MNT_LOCAL = 0x1000 + MNT_LOG = 0x2000000 + MNT_NOATIME = 0x4000000 + MNT_NOCOREDUMP = 0x8000 + MNT_NODEV = 0x10 + MNT_NODEVMTIME = 0x40000000 + MNT_NOEXEC = 0x4 + MNT_NOSUID = 0x8 + MNT_NOWAIT = 0x2 + MNT_OP_FLAGS = 0x4d0000 + MNT_QUOTA = 0x2000 + MNT_RDONLY = 0x1 + MNT_RELATIME = 0x20000 + MNT_RELOAD = 0x40000 + MNT_ROOTFS = 0x4000 + MNT_SOFTDEP = 0x80000000 + MNT_SYMPERM = 0x20000000 + MNT_SYNCHRONOUS = 0x2 + MNT_UNION = 0x20 + MNT_UPDATE = 0x10000 + MNT_VISFLAGMASK = 0xff90ffff + MNT_WAIT = 0x1 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CONTROLMBUF = 0x2000000 @@ -1089,7 +1130,10 @@ const ( RLIMIT_CPU = 0x0 RLIMIT_DATA = 0x2 RLIMIT_FSIZE = 0x1 + RLIMIT_MEMLOCK = 0x6 RLIMIT_NOFILE = 0x8 + RLIMIT_NPROC = 0x7 + RLIMIT_RSS = 0x5 RLIMIT_STACK = 0x3 RLIM_INFINITY = 0x7fffffffffffffff RTAX_AUTHOR = 0x6 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go index 0a1c3e7e8c3b6..d8be045189b34 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go @@ -899,6 +899,32 @@ const ( MAP_TRYFIXED = 0x400 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_ASYNC = 0x40 + MNT_DEFEXPORTED = 0x200 + MNT_DELEXPORT = 0x20000 + MNT_DOOMED = 0x8000000 + MNT_EXPORTANON = 0x400 + MNT_EXPORTED = 0x100 + MNT_EXRDONLY = 0x80 + MNT_FORCE = 0x80000 + MNT_LAZY = 0x3 + MNT_LOCAL = 0x1000 + MNT_NOATIME = 0x8000 + MNT_NODEV = 0x10 + MNT_NOEXEC = 0x4 + MNT_NOSUID = 0x8 + MNT_NOWAIT = 0x2 + MNT_QUOTA = 0x2000 + MNT_RDONLY = 0x1 + MNT_RELOAD = 0x40000 + MNT_ROOTFS = 0x4000 + MNT_SOFTDEP = 0x4000000 + MNT_SYNCHRONOUS = 0x2 + MNT_UPDATE = 0x10000 + MNT_VISFLAGMASK = 0x400ffff + MNT_WAIT = 0x1 + MNT_WANTRDWR = 0x2000000 + MNT_WXALLOWED = 0x800 MSG_BCAST = 0x100 MSG_CTRUNC = 0x20 MSG_DONTROUTE = 0x4 @@ -1218,6 +1244,34 @@ const ( SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISTXT = 0x200 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFLUSH = 0x3 TCOFLUSH = 0x2 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go index acfc664691942..1f9e8a29ea9e9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go @@ -472,6 +472,7 @@ const ( F_GETLK = 0x7 F_GETOWN = 0x5 F_ISATTY = 0xb + F_OK = 0x0 F_RDLCK = 0x1 F_SETFD = 0x2 F_SETFL = 0x4 @@ -938,6 +939,34 @@ const ( MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_ASYNC = 0x40 + MNT_DEFEXPORTED = 0x200 + MNT_DELEXPORT = 0x20000 + MNT_DOOMED = 0x8000000 + MNT_EXPORTANON = 0x400 + MNT_EXPORTED = 0x100 + MNT_EXRDONLY = 0x80 + MNT_FORCE = 0x80000 + MNT_LAZY = 0x3 + MNT_LOCAL = 0x1000 + MNT_NOATIME = 0x8000 + MNT_NODEV = 0x10 + MNT_NOEXEC = 0x4 + MNT_NOPERM = 0x20 + MNT_NOSUID = 0x8 + MNT_NOWAIT = 0x2 + MNT_QUOTA = 0x2000 + MNT_RDONLY = 0x1 + MNT_RELOAD = 0x40000 + MNT_ROOTFS = 0x4000 + MNT_SOFTDEP = 0x4000000 + MNT_STALLED = 0x100000 + MNT_SYNCHRONOUS = 0x2 + MNT_UPDATE = 0x10000 + MNT_VISFLAGMASK = 0x400ffff + MNT_WAIT = 0x1 + MNT_WANTRDWR = 0x2000000 + MNT_WXALLOWED = 0x800 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 @@ -1296,6 +1325,34 @@ const ( SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 SO_ZEROIZE = 0x2000 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISTXT = 0x200 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFF = 0x3 TCIOFLUSH = 0x3 @@ -1386,6 +1443,8 @@ const ( TIOCUCNTL_CBRK = 0x7a TIOCUCNTL_SBRK = 0x7b TOSTOP = 0x400000 + UTIME_NOW = -0x2 + UTIME_OMIT = -0x1 VDISCARD = 0xf VDSUSP = 0xb VEOF = 0x0 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go index 93e37c4b289ed..79d5695c376fb 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go @@ -899,6 +899,32 @@ const ( MAP_TRYFIXED = 0x0 MCL_CURRENT = 0x1 MCL_FUTURE = 0x2 + MNT_ASYNC = 0x40 + MNT_DEFEXPORTED = 0x200 + MNT_DELEXPORT = 0x20000 + MNT_DOOMED = 0x8000000 + MNT_EXPORTANON = 0x400 + MNT_EXPORTED = 0x100 + MNT_EXRDONLY = 0x80 + MNT_FORCE = 0x80000 + MNT_LAZY = 0x3 + MNT_LOCAL = 0x1000 + MNT_NOATIME = 0x8000 + MNT_NODEV = 0x10 + MNT_NOEXEC = 0x4 + MNT_NOSUID = 0x8 + MNT_NOWAIT = 0x2 + MNT_QUOTA = 0x2000 + MNT_RDONLY = 0x1 + MNT_RELOAD = 0x40000 + MNT_ROOTFS = 0x4000 + MNT_SOFTDEP = 0x4000000 + MNT_SYNCHRONOUS = 0x2 + MNT_UPDATE = 0x10000 + MNT_VISFLAGMASK = 0x400ffff + MNT_WAIT = 0x1 + MNT_WANTRDWR = 0x2000000 + MNT_WXALLOWED = 0x800 MSG_BCAST = 0x100 MSG_CMSG_CLOEXEC = 0x800 MSG_CTRUNC = 0x20 @@ -1221,6 +1247,34 @@ const ( SO_TIMESTAMP = 0x800 SO_TYPE = 0x1008 SO_USELOOPBACK = 0x40 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISTXT = 0x200 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TCIFLUSH = 0x1 TCIOFLUSH = 0x3 TCOFLUSH = 0x2 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go index be42830cf3d38..22569db31d3ce 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go @@ -996,6 +996,39 @@ const ( SO_USELOOPBACK = 0x40 SO_VRRP = 0x1017 SO_WROFF = 0x2 + S_ENFMT = 0x400 + S_IAMB = 0x1ff + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFDOOR = 0xd000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFNAM = 0x5000 + S_IFPORT = 0xe000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_INSEM = 0x1 + S_INSHD = 0x2 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 TAB0 = 0x0 TAB1 = 0x800 TAB2 = 0x1000 @@ -1102,6 +1135,8 @@ const ( TIOCSTOP = 0x746f TIOCSWINSZ = 0x5467 TOSTOP = 0x100 + UTIME_NOW = -0x1 + UTIME_OMIT = -0x2 VCEOF = 0x8 VCEOL = 0x9 VDISCARD = 0xd diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go new file mode 100644 index 0000000000000..6bae21e5d8949 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go @@ -0,0 +1,1450 @@ +// mksyscall_aix_ppc.pl -aix -tags aix,ppc syscall_aix.go syscall_aix_ppc.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build aix,ppc + +package unix + +/* +#include +#include +int utimes(uintptr_t, uintptr_t); +int utimensat(int, uintptr_t, uintptr_t, int); +int getcwd(uintptr_t, size_t); +int accept(int, uintptr_t, uintptr_t); +int getdirent(int, uintptr_t, size_t); +int wait4(int, uintptr_t, int, uintptr_t); +int ioctl(int, int, uintptr_t); +int fcntl(uintptr_t, int, uintptr_t); +int acct(uintptr_t); +int chdir(uintptr_t); +int chroot(uintptr_t); +int close(int); +int dup(int); +void exit(int); +int faccessat(int, uintptr_t, unsigned int, int); +int fchdir(int); +int fchmod(int, unsigned int); +int fchmodat(int, uintptr_t, unsigned int, int); +int fchownat(int, uintptr_t, int, int, int); +int fdatasync(int); +int fsync(int); +int getpgid(int); +int getpgrp(); +int getpid(); +int getppid(); +int getpriority(int, int); +int getrusage(int, uintptr_t); +int getsid(int); +int kill(int, int); +int syslog(int, uintptr_t, size_t); +int mkdir(int, uintptr_t, unsigned int); +int mkdirat(int, uintptr_t, unsigned int); +int mkfifo(uintptr_t, unsigned int); +int mknod(uintptr_t, unsigned int, int); +int mknodat(int, uintptr_t, unsigned int, int); +int nanosleep(uintptr_t, uintptr_t); +int open64(uintptr_t, int, unsigned int); +int openat(int, uintptr_t, int, unsigned int); +int read(int, uintptr_t, size_t); +int readlink(uintptr_t, uintptr_t, size_t); +int renameat(int, uintptr_t, int, uintptr_t); +int setdomainname(uintptr_t, size_t); +int sethostname(uintptr_t, size_t); +int setpgid(int, int); +int setsid(); +int settimeofday(uintptr_t); +int setuid(int); +int setgid(int); +int setpriority(int, int, int); +int statx(int, uintptr_t, int, int, uintptr_t); +int sync(); +uintptr_t times(uintptr_t); +int umask(int); +int uname(uintptr_t); +int unlink(uintptr_t); +int unlinkat(int, uintptr_t, int); +int ustat(int, uintptr_t); +int write(int, uintptr_t, size_t); +int dup2(int, int); +int posix_fadvise64(int, long long, long long, int); +int fchown(int, int, int); +int fstat(int, uintptr_t); +int fstatat(int, uintptr_t, uintptr_t, int); +int fstatfs(int, uintptr_t); +int ftruncate(int, long long); +int getegid(); +int geteuid(); +int getgid(); +int getuid(); +int lchown(uintptr_t, int, int); +int listen(int, int); +int lstat(uintptr_t, uintptr_t); +int pause(); +int pread64(int, uintptr_t, size_t, long long); +int pwrite64(int, uintptr_t, size_t, long long); +int pselect(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +int setregid(int, int); +int setreuid(int, int); +int shutdown(int, int); +long long splice(int, uintptr_t, int, uintptr_t, int, int); +int stat(uintptr_t, uintptr_t); +int statfs(uintptr_t, uintptr_t); +int truncate(uintptr_t, long long); +int bind(int, uintptr_t, uintptr_t); +int connect(int, uintptr_t, uintptr_t); +int getgroups(int, uintptr_t); +int setgroups(int, uintptr_t); +int getsockopt(int, int, int, uintptr_t, uintptr_t); +int setsockopt(int, int, int, uintptr_t, uintptr_t); +int socket(int, int, int); +int socketpair(int, int, int, uintptr_t); +int getpeername(int, uintptr_t, uintptr_t); +int getsockname(int, uintptr_t, uintptr_t); +int recvfrom(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); +int sendto(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); +int recvmsg(int, uintptr_t, int); +int sendmsg(int, uintptr_t, int); +int munmap(uintptr_t, uintptr_t); +int madvise(uintptr_t, size_t, int); +int mprotect(uintptr_t, size_t, int); +int mlock(uintptr_t, size_t); +int mlockall(int); +int msync(uintptr_t, size_t, int); +int munlock(uintptr_t, size_t); +int munlockall(); +int pipe(uintptr_t); +int poll(uintptr_t, int, int); +int gettimeofday(uintptr_t, uintptr_t); +int time(uintptr_t); +int utime(uintptr_t, uintptr_t); +int getrlimit64(int, uintptr_t); +int setrlimit64(int, uintptr_t); +long long lseek64(int, long long, int); +uintptr_t mmap(uintptr_t, uintptr_t, int, int, int, long long); + +*/ +import "C" +import ( + "unsafe" +) + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, times *[2]Timeval) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.utimes(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(times)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.utimensat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(times))), C.int(flag)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getcwd(buf []byte) (err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + var _p1 int + _p1 = len(buf) + r0, er := C.getcwd(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, er := C.accept(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen)))) + fd = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getdirent(fd int, buf []byte) (n int, err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + var _p1 int + _p1 = len(buf) + r0, er := C.getdirent(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) { + r0, er := C.wait4(C.int(pid), C.uintptr_t(uintptr(unsafe.Pointer(status))), C.int(options), C.uintptr_t(uintptr(unsafe.Pointer(rusage)))) + wpid = Pid_t(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + r0, er := C.ioctl(C.int(fd), C.int(req), C.uintptr_t(arg)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FcntlInt(fd uintptr, cmd int, arg int) (r int, err error) { + r0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg)) + r = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) { + r0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(uintptr(unsafe.Pointer(lk)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, er := C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg)) + val = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Acct(path string) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.acct(C.uintptr_t(_p0)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.chdir(C.uintptr_t(_p0)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.chroot(C.uintptr_t(_p0)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + r0, er := C.close(C.int(fd)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(oldfd int) (fd int, err error) { + r0, er := C.dup(C.int(oldfd)) + fd = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + C.exit(C.int(code)) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.faccessat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + r0, er := C.fchdir(C.int(fd)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + r0, er := C.fchmod(C.int(fd), C.uint(mode)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.fchmodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.fchownat(C.int(dirfd), C.uintptr_t(_p0), C.int(uid), C.int(gid), C.int(flags)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fdatasync(fd int) (err error) { + r0, er := C.fdatasync(C.int(fd)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + r0, er := C.fsync(C.int(fd)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, er := C.getpgid(C.int(pid)) + pgid = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgrp() (pid int) { + r0, _ := C.getpgrp() + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _ := C.getpid() + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _ := C.getppid() + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, er := C.getpriority(C.int(which), C.int(who)) + prio = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + r0, er := C.getrusage(C.int(who), C.uintptr_t(uintptr(unsafe.Pointer(rusage)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, er := C.getsid(C.int(pid)) + sid = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kill(pid int, sig Signal) (err error) { + r0, er := C.kill(C.int(pid), C.int(sig)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Klogctl(typ int, buf []byte) (n int, err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + var _p1 int + _p1 = len(buf) + r0, er := C.syslog(C.int(typ), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(dirfd int, path string, mode uint32) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.mkdir(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.mkdirat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.mkfifo(C.uintptr_t(_p0), C.uint(mode)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.mknod(C.uintptr_t(_p0), C.uint(mode), C.int(dev)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.mknodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(dev)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Nanosleep(time *Timespec, leftover *Timespec) (err error) { + r0, er := C.nanosleep(C.uintptr_t(uintptr(unsafe.Pointer(time))), C.uintptr_t(uintptr(unsafe.Pointer(leftover)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int, perm uint32) (fd int, err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.open64(C.uintptr_t(_p0), C.int(mode), C.uint(perm)) + fd = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.openat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.uint(mode)) + fd = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// 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 *byte + if len(p) > 0 { + _p0 = &p[0] + } + var _p1 int + _p1 = len(p) + r0, er := C.read(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + var _p1 *byte + if len(buf) > 0 { + _p1 = &buf[0] + } + var _p2 int + _p2 = len(buf) + r0, er := C.readlink(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(_p1))), C.size_t(_p2)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(oldpath))) + _p1 := uintptr(unsafe.Pointer(C.CString(newpath))) + r0, er := C.renameat(C.int(olddirfd), C.uintptr_t(_p0), C.int(newdirfd), C.uintptr_t(_p1)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setdomainname(p []byte) (err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + var _p1 int + _p1 = len(p) + r0, er := C.setdomainname(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sethostname(p []byte) (err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + var _p1 int + _p1 = len(p) + r0, er := C.sethostname(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + r0, er := C.setpgid(C.int(pid), C.int(pgid)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, er := C.setsid() + pid = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tv *Timeval) (err error) { + r0, er := C.settimeofday(C.uintptr_t(uintptr(unsafe.Pointer(tv)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + r0, er := C.setuid(C.int(uid)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(uid int) (err error) { + r0, er := C.setgid(C.int(uid)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + r0, er := C.setpriority(C.int(which), C.int(who), C.int(prio)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.statx(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.int(mask), C.uintptr_t(uintptr(unsafe.Pointer(stat)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() { + C.sync() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Times(tms *Tms) (ticks uintptr, err error) { + r0, er := C.times(C.uintptr_t(uintptr(unsafe.Pointer(tms)))) + ticks = uintptr(r0) + if uintptr(r0) == ^uintptr(0) && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(mask int) (oldmask int) { + r0, _ := C.umask(C.int(mask)) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Uname(buf *Utsname) (err error) { + r0, er := C.uname(C.uintptr_t(uintptr(unsafe.Pointer(buf)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.unlink(C.uintptr_t(_p0)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.unlinkat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ustat(dev int, ubuf *Ustat_t) (err error) { + r0, er := C.ustat(C.int(dev), C.uintptr_t(uintptr(unsafe.Pointer(ubuf)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + var _p1 int + _p1 = len(p) + r0, er := C.write(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, p *byte, np int) (n int, err error) { + r0, er := C.read(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(p))), C.size_t(np)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, p *byte, np int) (n int, err error) { + r0, er := C.write(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(p))), C.size_t(np)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(oldfd int, newfd int) (err error) { + r0, er := C.dup2(C.int(oldfd), C.int(newfd)) + if r0 == -1 && er != nil { + err = er + } + 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) { + r0, er := C.posix_fadvise64(C.int(fd), C.longlong(offset), C.longlong(length), C.int(advice)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchown(fd int, uid int, gid int) (err error) { + r0, er := C.fchown(C.int(fd), C.int(uid), C.int(gid)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + r0, er := C.fstat(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(stat)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.fstatat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(stat))), C.int(flags)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, buf *Statfs_t) (err error) { + r0, er := C.fstatfs(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(buf)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + r0, er := C.ftruncate(C.int(fd), C.longlong(length)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _ := C.getegid() + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (euid int) { + r0, _ := C.geteuid() + euid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _ := C.getgid() + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _ := C.getuid() + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.lchown(C.uintptr_t(_p0), C.int(uid), C.int(gid)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, n int) (err error) { + r0, er := C.listen(C.int(s), C.int(n)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.lstat(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(stat)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pause() (err error) { + r0, er := C.pause() + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + var _p1 int + _p1 = len(p) + r0, er := C.pread64(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.longlong(offset)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + var _p1 int + _p1 = len(p) + r0, er := C.pwrite64(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.longlong(offset)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + r0, er := C.pselect(C.int(nfd), C.uintptr_t(uintptr(unsafe.Pointer(r))), C.uintptr_t(uintptr(unsafe.Pointer(w))), C.uintptr_t(uintptr(unsafe.Pointer(e))), C.uintptr_t(uintptr(unsafe.Pointer(timeout))), C.uintptr_t(uintptr(unsafe.Pointer(sigmask)))) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + r0, er := C.setregid(C.int(rgid), C.int(egid)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + r0, er := C.setreuid(C.int(ruid), C.int(euid)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(fd int, how int) (err error) { + r0, er := C.shutdown(C.int(fd), C.int(how)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { + r0, er := C.splice(C.int(rfd), C.uintptr_t(uintptr(unsafe.Pointer(roff))), C.int(wfd), C.uintptr_t(uintptr(unsafe.Pointer(woff))), C.int(len), C.int(flags)) + n = int64(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.stat(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(stat)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, buf *Statfs_t) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.statfs(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(buf)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.truncate(C.uintptr_t(_p0), C.longlong(length)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + r0, er := C.bind(C.int(s), C.uintptr_t(uintptr(addr)), C.uintptr_t(uintptr(addrlen))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + r0, er := C.connect(C.int(s), C.uintptr_t(uintptr(addr)), C.uintptr_t(uintptr(addrlen))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(n int, list *_Gid_t) (nn int, err error) { + r0, er := C.getgroups(C.int(n), C.uintptr_t(uintptr(unsafe.Pointer(list)))) + nn = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setgroups(n int, list *_Gid_t) (err error) { + r0, er := C.setgroups(C.int(n), C.uintptr_t(uintptr(unsafe.Pointer(list)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + r0, er := C.getsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(uintptr(val)), C.uintptr_t(uintptr(unsafe.Pointer(vallen)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + r0, er := C.setsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(uintptr(val)), C.uintptr_t(vallen)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, er := C.socket(C.int(domain), C.int(typ), C.int(proto)) + fd = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + r0, er := C.socketpair(C.int(domain), C.int(typ), C.int(proto), C.uintptr_t(uintptr(unsafe.Pointer(fd)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + r0, er := C.getpeername(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + r0, er := C.getsockname(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(rsa))), C.uintptr_t(uintptr(unsafe.Pointer(addrlen)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + var _p1 int + _p1 = len(p) + r0, er := C.recvfrom(C.int(fd), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags), C.uintptr_t(uintptr(unsafe.Pointer(from))), C.uintptr_t(uintptr(unsafe.Pointer(fromlen)))) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + var _p1 int + _p1 = len(buf) + r0, er := C.sendto(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags), C.uintptr_t(uintptr(to)), C.uintptr_t(uintptr(addrlen))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, er := C.recvmsg(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(msg))), C.int(flags)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, er := C.sendmsg(C.int(s), C.uintptr_t(uintptr(unsafe.Pointer(msg))), C.int(flags)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + r0, er := C.munmap(C.uintptr_t(addr), C.uintptr_t(length)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, advice int) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + var _p1 int + _p1 = len(b) + r0, er := C.madvise(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(advice)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + var _p1 int + _p1 = len(b) + r0, er := C.mprotect(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(prot)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + var _p1 int + _p1 = len(b) + r0, er := C.mlock(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + r0, er := C.mlockall(C.int(flags)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + var _p1 int + _p1 = len(b) + r0, er := C.msync(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1), C.int(flags)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + var _p1 int + _p1 = len(b) + r0, er := C.munlock(C.uintptr_t(uintptr(unsafe.Pointer(_p0))), C.size_t(_p1)) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + r0, er := C.munlockall() + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + r0, er := C.pipe(C.uintptr_t(uintptr(unsafe.Pointer(p)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, er := C.poll(C.uintptr_t(uintptr(unsafe.Pointer(fds))), C.int(nfds), C.int(timeout)) + n = int(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func gettimeofday(tv *Timeval, tzp *Timezone) (err error) { + r0, er := C.gettimeofday(C.uintptr_t(uintptr(unsafe.Pointer(tv))), C.uintptr_t(uintptr(unsafe.Pointer(tzp)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Time(t *Time_t) (tt Time_t, err error) { + r0, er := C.time(C.uintptr_t(uintptr(unsafe.Pointer(t)))) + tt = Time_t(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Utime(path string, buf *Utimbuf) (err error) { + _p0 := uintptr(unsafe.Pointer(C.CString(path))) + r0, er := C.utime(C.uintptr_t(_p0), C.uintptr_t(uintptr(unsafe.Pointer(buf)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(resource int, rlim *Rlimit) (err error) { + r0, er := C.getrlimit64(C.int(resource), C.uintptr_t(uintptr(unsafe.Pointer(rlim)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(resource int, rlim *Rlimit) (err error) { + r0, er := C.setrlimit64(C.int(resource), C.uintptr_t(uintptr(unsafe.Pointer(rlim)))) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (off int64, err error) { + r0, er := C.lseek64(C.int(fd), C.longlong(offset), C.int(whence)) + off = int64(r0) + if r0 == -1 && er != nil { + err = er + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { + r0, er := C.mmap(C.uintptr_t(addr), C.uintptr_t(length), C.int(prot), C.int(flags), C.int(fd), C.longlong(offset)) + xaddr = uintptr(r0) + if uintptr(r0) == ^uintptr(0) && er != nil { + err = er + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go new file mode 100644 index 0000000000000..3e929e520e080 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go @@ -0,0 +1,1408 @@ +// mksyscall_aix_ppc64.pl -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build aix,ppc64 + +package unix + +import ( + "unsafe" +) + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, times *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callutimes(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callutimensat(dirfd, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), flag) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getcwd(buf []byte) (err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + _, e1 := callgetcwd(uintptr(unsafe.Pointer(_p0)), len(buf)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, e1 := callaccept(s, uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getdirent(fd int, buf []byte) (n int, err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + r0, e1 := callgetdirent(fd, uintptr(unsafe.Pointer(_p0)), len(buf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error) { + r0, e1 := callwait4(int(pid), uintptr(unsafe.Pointer(status)), options, uintptr(unsafe.Pointer(rusage))) + wpid = Pid_t(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, e1 := callioctl(fd, int(req), arg) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FcntlInt(fd uintptr, cmd int, arg int) (r int, err error) { + r0, e1 := callfcntl(fd, cmd, uintptr(arg)) + r = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) (err error) { + _, e1 := callfcntl(fd, cmd, uintptr(unsafe.Pointer(lk))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, e1 := callfcntl(uintptr(fd), cmd, uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Acct(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callacct(uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callchdir(uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callchroot(uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + _, e1 := callclose(fd) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(oldfd int) (fd int, err error) { + r0, e1 := calldup(oldfd) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + callexit(code) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callfaccessat(dirfd, uintptr(unsafe.Pointer(_p0)), mode, flags) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, e1 := callfchdir(fd) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, e1 := callfchmod(fd, mode) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callfchmodat(dirfd, uintptr(unsafe.Pointer(_p0)), mode, flags) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callfchownat(dirfd, uintptr(unsafe.Pointer(_p0)), uid, gid, flags) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fdatasync(fd int) (err error) { + _, e1 := callfdatasync(fd) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, e1 := callfsync(fd) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, e1 := callgetpgid(pid) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgrp() (pid int) { + r0, _ := callgetpgrp() + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _ := callgetpid() + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _ := callgetppid() + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, e1 := callgetpriority(which, who) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + _, e1 := callgetrusage(who, uintptr(unsafe.Pointer(rusage))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, e1 := callgetsid(pid) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kill(pid int, sig Signal) (err error) { + _, e1 := callkill(pid, int(sig)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Klogctl(typ int, buf []byte) (n int, err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + r0, e1 := callsyslog(typ, uintptr(unsafe.Pointer(_p0)), len(buf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callmkdir(dirfd, uintptr(unsafe.Pointer(_p0)), mode) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callmkdirat(dirfd, uintptr(unsafe.Pointer(_p0)), mode) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callmkfifo(uintptr(unsafe.Pointer(_p0)), mode) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callmknod(uintptr(unsafe.Pointer(_p0)), mode, dev) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callmknodat(dirfd, uintptr(unsafe.Pointer(_p0)), mode, dev) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Nanosleep(time *Timespec, leftover *Timespec) (err error) { + _, e1 := callnanosleep(uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, e1 := callopen64(uintptr(unsafe.Pointer(_p0)), mode, perm) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, e1 := callopenat(dirfd, uintptr(unsafe.Pointer(_p0)), flags, mode) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// 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 *byte + if len(p) > 0 { + _p0 = &p[0] + } + r0, e1 := callread(fd, uintptr(unsafe.Pointer(_p0)), len(p)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + if len(buf) > 0 { + _p1 = &buf[0] + } + r0, e1 := callreadlink(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), len(buf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, e1 := callrenameat(olddirfd, uintptr(unsafe.Pointer(_p0)), newdirfd, uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setdomainname(p []byte) (err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + _, e1 := callsetdomainname(uintptr(unsafe.Pointer(_p0)), len(p)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sethostname(p []byte) (err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + _, e1 := callsethostname(uintptr(unsafe.Pointer(_p0)), len(p)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, e1 := callsetpgid(pid, pgid) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, e1 := callsetsid() + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tv *Timeval) (err error) { + _, e1 := callsettimeofday(uintptr(unsafe.Pointer(tv))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + _, e1 := callsetuid(uid) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(uid int) (err error) { + _, e1 := callsetgid(uid) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, e1 := callsetpriority(which, who, prio) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callstatx(dirfd, uintptr(unsafe.Pointer(_p0)), flags, mask, uintptr(unsafe.Pointer(stat))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() { + callsync() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Times(tms *Tms) (ticks uintptr, err error) { + r0, e1 := calltimes(uintptr(unsafe.Pointer(tms))) + ticks = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(mask int) (oldmask int) { + r0, _ := callumask(mask) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Uname(buf *Utsname) (err error) { + _, e1 := calluname(uintptr(unsafe.Pointer(buf))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callunlink(uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callunlinkat(dirfd, uintptr(unsafe.Pointer(_p0)), flags) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ustat(dev int, ubuf *Ustat_t) (err error) { + _, e1 := callustat(dev, uintptr(unsafe.Pointer(ubuf))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + r0, e1 := callwrite(fd, uintptr(unsafe.Pointer(_p0)), len(p)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, p *byte, np int) (n int, err error) { + r0, e1 := callread(fd, uintptr(unsafe.Pointer(p)), np) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, p *byte, np int) (n int, err error) { + r0, e1 := callwrite(fd, uintptr(unsafe.Pointer(p)), np) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(oldfd int, newfd int) (err error) { + _, e1 := calldup2(oldfd, newfd) + 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 := callposix_fadvise64(fd, offset, length, advice) + 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 := callfchown(fd, uid, gid) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, e1 := callfstat(fd, uintptr(unsafe.Pointer(stat))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callfstatat(dirfd, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), flags) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, buf *Statfs_t) (err error) { + _, e1 := callfstatfs(fd, uintptr(unsafe.Pointer(buf))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, e1 := callftruncate(fd, length) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _ := callgetegid() + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (euid int) { + r0, _ := callgeteuid() + euid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _ := callgetgid() + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _ := callgetuid() + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := calllchown(uintptr(unsafe.Pointer(_p0)), uid, gid) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, n int) (err error) { + _, e1 := calllisten(s, n) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := calllstat(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pause() (err error) { + _, e1 := callpause() + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + r0, e1 := callpread64(fd, uintptr(unsafe.Pointer(_p0)), len(p), offset) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + r0, e1 := callpwrite64(fd, uintptr(unsafe.Pointer(_p0)), len(p), offset) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + r0, e1 := callpselect(nfd, uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, e1 := callsetregid(rgid, egid) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, e1 := callsetreuid(ruid, euid) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(fd int, how int) (err error) { + _, e1 := callshutdown(fd, how) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { + r0, e1 := callsplice(rfd, uintptr(unsafe.Pointer(roff)), wfd, uintptr(unsafe.Pointer(woff)), len, flags) + n = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callstat(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, buf *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callstatfs(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := calltruncate(uintptr(unsafe.Pointer(_p0)), length) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, e1 := callbind(s, uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, e1 := callconnect(s, uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(n int, list *_Gid_t) (nn int, err error) { + r0, e1 := callgetgroups(n, uintptr(unsafe.Pointer(list))) + nn = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setgroups(n int, list *_Gid_t) (err error) { + _, e1 := callsetgroups(n, uintptr(unsafe.Pointer(list))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, e1 := callgetsockopt(s, level, name, uintptr(val), uintptr(unsafe.Pointer(vallen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, e1 := callsetsockopt(s, level, name, uintptr(val), vallen) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, e1 := callsocket(domain, typ, proto) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, e1 := callsocketpair(domain, typ, proto, uintptr(unsafe.Pointer(fd))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, e1 := callgetpeername(fd, uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, e1 := callgetsockname(fd, uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 *byte + if len(p) > 0 { + _p0 = &p[0] + } + r0, e1 := callrecvfrom(fd, uintptr(unsafe.Pointer(_p0)), len(p), flags, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 *byte + if len(buf) > 0 { + _p0 = &buf[0] + } + _, e1 := callsendto(s, uintptr(unsafe.Pointer(_p0)), len(buf), flags, uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, e1 := callrecvmsg(s, uintptr(unsafe.Pointer(msg)), flags) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, e1 := callsendmsg(s, uintptr(unsafe.Pointer(msg)), flags) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, e1 := callmunmap(addr, length) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, advice int) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + _, e1 := callmadvise(uintptr(unsafe.Pointer(_p0)), len(b), advice) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + _, e1 := callmprotect(uintptr(unsafe.Pointer(_p0)), len(b), prot) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + _, e1 := callmlock(uintptr(unsafe.Pointer(_p0)), len(b)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + _, e1 := callmlockall(flags) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + _, e1 := callmsync(uintptr(unsafe.Pointer(_p0)), len(b), flags) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 *byte + if len(b) > 0 { + _p0 = &b[0] + } + _, e1 := callmunlock(uintptr(unsafe.Pointer(_p0)), len(b)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + _, e1 := callmunlockall() + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + _, e1 := callpipe(uintptr(unsafe.Pointer(p))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, e1 := callpoll(uintptr(unsafe.Pointer(fds)), nfds, timeout) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func gettimeofday(tv *Timeval, tzp *Timezone) (err error) { + _, e1 := callgettimeofday(uintptr(unsafe.Pointer(tv)), uintptr(unsafe.Pointer(tzp))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Time(t *Time_t) (tt Time_t, err error) { + r0, e1 := calltime(uintptr(unsafe.Pointer(t))) + tt = Time_t(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Utime(path string, buf *Utimbuf) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, e1 := callutime(uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(resource int, rlim *Rlimit) (err error) { + _, e1 := callgetrlimit(resource, uintptr(unsafe.Pointer(rlim))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(resource int, rlim *Rlimit) (err error) { + _, e1 := callsetrlimit(resource, uintptr(unsafe.Pointer(rlim))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (off int64, err error) { + r0, e1 := calllseek(fd, offset, whence) + off = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { + r0, e1 := callmmap64(addr, length, prot, flags, fd, offset) + xaddr = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go new file mode 100644 index 0000000000000..a185ee842412a --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go @@ -0,0 +1,1162 @@ +// mksyscall_aix_ppc64.pl -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build aix,ppc64 +// +build !gccgo + +package unix + +import ( + "unsafe" +) + +//go:cgo_import_dynamic libc_utimes utimes "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_utimensat utimensat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getcwd getcwd "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_accept accept "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getdirent getdirent "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_wait4 wait4 "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_ioctl ioctl "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fcntl fcntl "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_acct acct "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_chdir chdir "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_chroot chroot "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_close close "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_dup dup "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_exit exit "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_faccessat faccessat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fchdir fchdir "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fchmod fchmod "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fchmodat fchmodat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fchownat fchownat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fdatasync fdatasync "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fsync fsync "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getpgid getpgid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getpgrp getpgrp "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getpid getpid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getppid getppid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getpriority getpriority "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getrusage getrusage "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getsid getsid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_kill kill "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_syslog syslog "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mkdir mkdir "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mkdirat mkdirat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mkfifo mkfifo "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mknod mknod "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mknodat mknodat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_nanosleep nanosleep "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_open64 open64 "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_openat openat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_read read "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_readlink readlink "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_renameat renameat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setdomainname setdomainname "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_sethostname sethostname "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setpgid setpgid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setsid setsid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_settimeofday settimeofday "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setuid setuid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setgid setgid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setpriority setpriority "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_statx statx "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_sync sync "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_times times "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_umask umask "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_uname uname "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_unlink unlink "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_unlinkat unlinkat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_ustat ustat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_write write "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_dup2 dup2 "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_posix_fadvise64 posix_fadvise64 "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fchown fchown "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fstat fstat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fstatat fstatat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_fstatfs fstatfs "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_ftruncate ftruncate "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getegid getegid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_geteuid geteuid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getgid getgid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getuid getuid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_lchown lchown "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_listen listen "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_lstat lstat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_pause pause "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_pread64 pread64 "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_pwrite64 pwrite64 "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_pselect pselect "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setregid setregid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setreuid setreuid "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_shutdown shutdown "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_splice splice "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_stat stat "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_statfs statfs "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_truncate truncate "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_bind bind "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_connect connect "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getgroups getgroups "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setgroups setgroups "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getsockopt getsockopt "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setsockopt setsockopt "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_socket socket "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_socketpair socketpair "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getpeername getpeername "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getsockname getsockname "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_recvfrom recvfrom "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_sendto sendto "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_recvmsg recvmsg "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_sendmsg sendmsg "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_munmap munmap "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_madvise madvise "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mprotect mprotect "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mlock mlock "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mlockall mlockall "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_msync msync "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_munlock munlock "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_munlockall munlockall "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_pipe pipe "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_poll poll "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_time time "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_utime utime "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_getrlimit getrlimit "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_setrlimit setrlimit "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_lseek lseek "libc.a/shr_64.o" +//go:cgo_import_dynamic libc_mmap64 mmap64 "libc.a/shr_64.o" + +//go:linkname libc_utimes libc_utimes +//go:linkname libc_utimensat libc_utimensat +//go:linkname libc_getcwd libc_getcwd +//go:linkname libc_accept libc_accept +//go:linkname libc_getdirent libc_getdirent +//go:linkname libc_wait4 libc_wait4 +//go:linkname libc_ioctl libc_ioctl +//go:linkname libc_fcntl libc_fcntl +//go:linkname libc_acct libc_acct +//go:linkname libc_chdir libc_chdir +//go:linkname libc_chroot libc_chroot +//go:linkname libc_close libc_close +//go:linkname libc_dup libc_dup +//go:linkname libc_exit libc_exit +//go:linkname libc_faccessat libc_faccessat +//go:linkname libc_fchdir libc_fchdir +//go:linkname libc_fchmod libc_fchmod +//go:linkname libc_fchmodat libc_fchmodat +//go:linkname libc_fchownat libc_fchownat +//go:linkname libc_fdatasync libc_fdatasync +//go:linkname libc_fsync libc_fsync +//go:linkname libc_getpgid libc_getpgid +//go:linkname libc_getpgrp libc_getpgrp +//go:linkname libc_getpid libc_getpid +//go:linkname libc_getppid libc_getppid +//go:linkname libc_getpriority libc_getpriority +//go:linkname libc_getrusage libc_getrusage +//go:linkname libc_getsid libc_getsid +//go:linkname libc_kill libc_kill +//go:linkname libc_syslog libc_syslog +//go:linkname libc_mkdir libc_mkdir +//go:linkname libc_mkdirat libc_mkdirat +//go:linkname libc_mkfifo libc_mkfifo +//go:linkname libc_mknod libc_mknod +//go:linkname libc_mknodat libc_mknodat +//go:linkname libc_nanosleep libc_nanosleep +//go:linkname libc_open64 libc_open64 +//go:linkname libc_openat libc_openat +//go:linkname libc_read libc_read +//go:linkname libc_readlink libc_readlink +//go:linkname libc_renameat libc_renameat +//go:linkname libc_setdomainname libc_setdomainname +//go:linkname libc_sethostname libc_sethostname +//go:linkname libc_setpgid libc_setpgid +//go:linkname libc_setsid libc_setsid +//go:linkname libc_settimeofday libc_settimeofday +//go:linkname libc_setuid libc_setuid +//go:linkname libc_setgid libc_setgid +//go:linkname libc_setpriority libc_setpriority +//go:linkname libc_statx libc_statx +//go:linkname libc_sync libc_sync +//go:linkname libc_times libc_times +//go:linkname libc_umask libc_umask +//go:linkname libc_uname libc_uname +//go:linkname libc_unlink libc_unlink +//go:linkname libc_unlinkat libc_unlinkat +//go:linkname libc_ustat libc_ustat +//go:linkname libc_write libc_write +//go:linkname libc_dup2 libc_dup2 +//go:linkname libc_posix_fadvise64 libc_posix_fadvise64 +//go:linkname libc_fchown libc_fchown +//go:linkname libc_fstat libc_fstat +//go:linkname libc_fstatat libc_fstatat +//go:linkname libc_fstatfs libc_fstatfs +//go:linkname libc_ftruncate libc_ftruncate +//go:linkname libc_getegid libc_getegid +//go:linkname libc_geteuid libc_geteuid +//go:linkname libc_getgid libc_getgid +//go:linkname libc_getuid libc_getuid +//go:linkname libc_lchown libc_lchown +//go:linkname libc_listen libc_listen +//go:linkname libc_lstat libc_lstat +//go:linkname libc_pause libc_pause +//go:linkname libc_pread64 libc_pread64 +//go:linkname libc_pwrite64 libc_pwrite64 +//go:linkname libc_pselect libc_pselect +//go:linkname libc_setregid libc_setregid +//go:linkname libc_setreuid libc_setreuid +//go:linkname libc_shutdown libc_shutdown +//go:linkname libc_splice libc_splice +//go:linkname libc_stat libc_stat +//go:linkname libc_statfs libc_statfs +//go:linkname libc_truncate libc_truncate +//go:linkname libc_bind libc_bind +//go:linkname libc_connect libc_connect +//go:linkname libc_getgroups libc_getgroups +//go:linkname libc_setgroups libc_setgroups +//go:linkname libc_getsockopt libc_getsockopt +//go:linkname libc_setsockopt libc_setsockopt +//go:linkname libc_socket libc_socket +//go:linkname libc_socketpair libc_socketpair +//go:linkname libc_getpeername libc_getpeername +//go:linkname libc_getsockname libc_getsockname +//go:linkname libc_recvfrom libc_recvfrom +//go:linkname libc_sendto libc_sendto +//go:linkname libc_recvmsg libc_recvmsg +//go:linkname libc_sendmsg libc_sendmsg +//go:linkname libc_munmap libc_munmap +//go:linkname libc_madvise libc_madvise +//go:linkname libc_mprotect libc_mprotect +//go:linkname libc_mlock libc_mlock +//go:linkname libc_mlockall libc_mlockall +//go:linkname libc_msync libc_msync +//go:linkname libc_munlock libc_munlock +//go:linkname libc_munlockall libc_munlockall +//go:linkname libc_pipe libc_pipe +//go:linkname libc_poll libc_poll +//go:linkname libc_gettimeofday libc_gettimeofday +//go:linkname libc_time libc_time +//go:linkname libc_utime libc_utime +//go:linkname libc_getrlimit libc_getrlimit +//go:linkname libc_setrlimit libc_setrlimit +//go:linkname libc_lseek libc_lseek +//go:linkname libc_mmap64 libc_mmap64 + +type syscallFunc uintptr + +var ( + libc_utimes, + libc_utimensat, + libc_getcwd, + libc_accept, + libc_getdirent, + libc_wait4, + libc_ioctl, + libc_fcntl, + libc_acct, + libc_chdir, + libc_chroot, + libc_close, + libc_dup, + libc_exit, + libc_faccessat, + libc_fchdir, + libc_fchmod, + libc_fchmodat, + libc_fchownat, + libc_fdatasync, + libc_fsync, + libc_getpgid, + libc_getpgrp, + libc_getpid, + libc_getppid, + libc_getpriority, + libc_getrusage, + libc_getsid, + libc_kill, + libc_syslog, + libc_mkdir, + libc_mkdirat, + libc_mkfifo, + libc_mknod, + libc_mknodat, + libc_nanosleep, + libc_open64, + libc_openat, + libc_read, + libc_readlink, + libc_renameat, + libc_setdomainname, + libc_sethostname, + libc_setpgid, + libc_setsid, + libc_settimeofday, + libc_setuid, + libc_setgid, + libc_setpriority, + libc_statx, + libc_sync, + libc_times, + libc_umask, + libc_uname, + libc_unlink, + libc_unlinkat, + libc_ustat, + libc_write, + libc_dup2, + libc_posix_fadvise64, + libc_fchown, + libc_fstat, + libc_fstatat, + libc_fstatfs, + libc_ftruncate, + libc_getegid, + libc_geteuid, + libc_getgid, + libc_getuid, + libc_lchown, + libc_listen, + libc_lstat, + libc_pause, + libc_pread64, + libc_pwrite64, + libc_pselect, + libc_setregid, + libc_setreuid, + libc_shutdown, + libc_splice, + libc_stat, + libc_statfs, + libc_truncate, + libc_bind, + libc_connect, + libc_getgroups, + libc_setgroups, + libc_getsockopt, + libc_setsockopt, + libc_socket, + libc_socketpair, + libc_getpeername, + libc_getsockname, + libc_recvfrom, + libc_sendto, + libc_recvmsg, + libc_sendmsg, + libc_munmap, + libc_madvise, + libc_mprotect, + libc_mlock, + libc_mlockall, + libc_msync, + libc_munlock, + libc_munlockall, + libc_pipe, + libc_poll, + libc_gettimeofday, + libc_time, + libc_utime, + libc_getrlimit, + libc_setrlimit, + libc_lseek, + libc_mmap64 syscallFunc +) + +// Implemented in runtime/syscall_aix.go. +func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) +func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callutimes(_p0 uintptr, times uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_utimes)), 2, _p0, times, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callutimensat(dirfd int, _p0 uintptr, times uintptr, flag int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_utimensat)), 4, uintptr(dirfd), _p0, times, uintptr(flag), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetcwd(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getcwd)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callaccept(s int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_accept)), 3, uintptr(s), rsa, addrlen, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetdirent(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getdirent)), 3, uintptr(fd), _p0, uintptr(_lenp0), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callwait4(pid int, status uintptr, options int, rusage uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_wait4)), 4, uintptr(pid), status, uintptr(options), rusage, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callioctl(fd int, req int, arg uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_ioctl)), 3, uintptr(fd), uintptr(req), arg, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfcntl(fd uintptr, cmd int, arg uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fcntl)), 3, fd, uintptr(cmd), arg, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callacct(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_acct)), 1, _p0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callchdir(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_chdir)), 1, _p0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callchroot(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_chroot)), 1, _p0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callclose(fd int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_close)), 1, uintptr(fd), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calldup(oldfd int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_dup)), 1, uintptr(oldfd), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callexit(code int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_exit)), 1, uintptr(code), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfaccessat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_faccessat)), 4, uintptr(dirfd), _p0, uintptr(mode), uintptr(flags), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchdir(fd int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchmod(fd int, mode uint32) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchmodat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchmodat)), 4, uintptr(dirfd), _p0, uintptr(mode), uintptr(flags), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchownat(dirfd int, _p0 uintptr, uid int, gid int, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchownat)), 5, uintptr(dirfd), _p0, uintptr(uid), uintptr(gid), uintptr(flags), 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfdatasync(fd int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfsync(fd int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fsync)), 1, uintptr(fd), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpgid(pid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpgrp() (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getpgrp)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpid() (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getpid)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetppid() (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getppid)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpriority(which int, who int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetrusage(who int, rusage uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getrusage)), 2, uintptr(who), rusage, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetsid(pid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getsid)), 1, uintptr(pid), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callkill(pid int, sig int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_kill)), 2, uintptr(pid), uintptr(sig), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsyslog(typ int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_syslog)), 3, uintptr(typ), _p0, uintptr(_lenp0), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmkdir(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mkdir)), 3, uintptr(dirfd), _p0, uintptr(mode), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmkdirat(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mkdirat)), 3, uintptr(dirfd), _p0, uintptr(mode), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmkfifo(_p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mkfifo)), 2, _p0, uintptr(mode), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmknod(_p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mknod)), 3, _p0, uintptr(mode), uintptr(dev), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmknodat(dirfd int, _p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mknodat)), 4, uintptr(dirfd), _p0, uintptr(mode), uintptr(dev), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callnanosleep(time uintptr, leftover uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_nanosleep)), 2, time, leftover, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callopen64(_p0 uintptr, mode int, perm uint32) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_open64)), 3, _p0, uintptr(mode), uintptr(perm), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callopenat(dirfd int, _p0 uintptr, flags int, mode uint32) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_openat)), 4, uintptr(dirfd), _p0, uintptr(flags), uintptr(mode), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callread(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_read)), 3, uintptr(fd), _p0, uintptr(_lenp0), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callreadlink(_p0 uintptr, _p1 uintptr, _lenp1 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_readlink)), 3, _p0, _p1, uintptr(_lenp1), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callrenameat(olddirfd int, _p0 uintptr, newdirfd int, _p1 uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_renameat)), 4, uintptr(olddirfd), _p0, uintptr(newdirfd), _p1, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetdomainname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setdomainname)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsethostname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_sethostname)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetpgid(pid int, pgid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetsid() (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setsid)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsettimeofday(tv uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_settimeofday)), 1, tv, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetuid(uid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setuid)), 1, uintptr(uid), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetgid(uid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setgid)), 1, uintptr(uid), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetpriority(which int, who int, prio int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callstatx(dirfd int, _p0 uintptr, flags int, mask int, stat uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_statx)), 5, uintptr(dirfd), _p0, uintptr(flags), uintptr(mask), stat, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsync() (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_sync)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calltimes(tms uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_times)), 1, tms, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callumask(mask int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_umask)), 1, uintptr(mask), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calluname(buf uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_uname)), 1, buf, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callunlink(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_unlink)), 1, _p0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callunlinkat(dirfd int, _p0 uintptr, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_unlinkat)), 3, uintptr(dirfd), _p0, uintptr(flags), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callustat(dev int, ubuf uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_ustat)), 2, uintptr(dev), ubuf, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callwrite(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_write)), 3, uintptr(fd), _p0, uintptr(_lenp0), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calldup2(oldfd int, newfd int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_dup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callposix_fadvise64(fd int, offset int64, length int64, advice int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_posix_fadvise64)), 4, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchown(fd int, uid int, gid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfstat(fd int, stat uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fstat)), 2, uintptr(fd), stat, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfstatat(dirfd int, _p0 uintptr, stat uintptr, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fstatat)), 4, uintptr(dirfd), _p0, stat, uintptr(flags), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfstatfs(fd int, buf uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_fstatfs)), 2, uintptr(fd), buf, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callftruncate(fd int, length int64) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_ftruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetegid() (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getegid)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgeteuid() (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_geteuid)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetgid() (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getgid)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetuid() (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getuid)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllchown(_p0 uintptr, uid int, gid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_lchown)), 3, _p0, uintptr(uid), uintptr(gid), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllisten(s int, n int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_listen)), 2, uintptr(s), uintptr(n), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllstat(_p0 uintptr, stat uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_lstat)), 2, _p0, stat, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpause() (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pause)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpread64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pread64)), 4, uintptr(fd), _p0, uintptr(_lenp0), uintptr(offset), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpwrite64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pwrite64)), 4, uintptr(fd), _p0, uintptr(_lenp0), uintptr(offset), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpselect(nfd int, r uintptr, w uintptr, e uintptr, timeout uintptr, sigmask uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_pselect)), 6, uintptr(nfd), r, w, e, timeout, sigmask) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetregid(rgid int, egid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetreuid(ruid int, euid int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callshutdown(fd int, how int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_shutdown)), 2, uintptr(fd), uintptr(how), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsplice(rfd int, roff uintptr, wfd int, woff uintptr, len int, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_splice)), 6, uintptr(rfd), roff, uintptr(wfd), woff, uintptr(len), uintptr(flags)) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callstat(_p0 uintptr, stat uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_stat)), 2, _p0, stat, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callstatfs(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_statfs)), 2, _p0, buf, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calltruncate(_p0 uintptr, length int64) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_truncate)), 2, _p0, uintptr(length), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callbind(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_bind)), 3, uintptr(s), addr, addrlen, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callconnect(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_connect)), 3, uintptr(s), addr, addrlen, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getgroups)), 2, uintptr(n), list, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setgroups)), 2, uintptr(n), list, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), val, vallen, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_setsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), val, vallen, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsocket(domain int, typ int, proto int) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsocketpair(domain int, typ int, proto int, fd uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), fd, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpeername(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getpeername)), 3, uintptr(fd), rsa, addrlen, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetsockname(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getsockname)), 3, uintptr(fd), rsa, addrlen, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callrecvfrom(fd int, _p0 uintptr, _lenp0 int, flags int, from uintptr, fromlen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_recvfrom)), 6, uintptr(fd), _p0, uintptr(_lenp0), uintptr(flags), from, fromlen) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsendto(s int, _p0 uintptr, _lenp0 int, flags int, to uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_sendto)), 6, uintptr(s), _p0, uintptr(_lenp0), uintptr(flags), to, addrlen) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callrecvmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_recvmsg)), 3, uintptr(s), msg, uintptr(flags), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsendmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_sendmsg)), 3, uintptr(s), msg, uintptr(flags), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmunmap(addr uintptr, length uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_munmap)), 2, addr, length, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmadvise(_p0 uintptr, _lenp0 int, advice int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_madvise)), 3, _p0, uintptr(_lenp0), uintptr(advice), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmprotect(_p0 uintptr, _lenp0 int, prot int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mprotect)), 3, _p0, uintptr(_lenp0), uintptr(prot), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mlock)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmlockall(flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmsync(_p0 uintptr, _lenp0 int, flags int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_msync)), 3, _p0, uintptr(_lenp0), uintptr(flags), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmunlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_munlock)), 2, _p0, uintptr(_lenp0), 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmunlockall() (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_munlockall)), 0, 0, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpipe(p uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_pipe)), 1, p, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpoll(fds uintptr, nfds int, timeout int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_poll)), 3, fds, uintptr(nfds), uintptr(timeout), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgettimeofday(tv uintptr, tzp uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_gettimeofday)), 2, tv, tzp, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calltime(t uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_time)), 1, t, 0, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callutime(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_utime)), 2, _p0, buf, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetrlimit(resource int, rlim uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_getrlimit)), 2, uintptr(resource), rlim, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetrlimit(resource int, rlim uintptr) (r1 uintptr, e1 Errno) { + r1, _, e1 = rawSyscall6(uintptr(unsafe.Pointer(&libc_setrlimit)), 2, uintptr(resource), rlim, 0, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllseek(fd int, offset int64, whence int) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_lseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmmap64(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (r1 uintptr, e1 Errno) { + r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_mmap64)), 6, addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go new file mode 100644 index 0000000000000..aef7c0e784658 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go @@ -0,0 +1,1042 @@ +// mksyscall_aix_ppc64.pl -aix -tags aix,ppc64 syscall_aix.go syscall_aix_ppc64.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build aix,ppc64 +// +build gccgo + +package unix + +/* +#include +int utimes(uintptr_t, uintptr_t); +int utimensat(int, uintptr_t, uintptr_t, int); +int getcwd(uintptr_t, size_t); +int accept(int, uintptr_t, uintptr_t); +int getdirent(int, uintptr_t, size_t); +int wait4(int, uintptr_t, int, uintptr_t); +int ioctl(int, int, uintptr_t); +int fcntl(uintptr_t, int, uintptr_t); +int acct(uintptr_t); +int chdir(uintptr_t); +int chroot(uintptr_t); +int close(int); +int dup(int); +void exit(int); +int faccessat(int, uintptr_t, unsigned int, int); +int fchdir(int); +int fchmod(int, unsigned int); +int fchmodat(int, uintptr_t, unsigned int, int); +int fchownat(int, uintptr_t, int, int, int); +int fdatasync(int); +int fsync(int); +int getpgid(int); +int getpgrp(); +int getpid(); +int getppid(); +int getpriority(int, int); +int getrusage(int, uintptr_t); +int getsid(int); +int kill(int, int); +int syslog(int, uintptr_t, size_t); +int mkdir(int, uintptr_t, unsigned int); +int mkdirat(int, uintptr_t, unsigned int); +int mkfifo(uintptr_t, unsigned int); +int mknod(uintptr_t, unsigned int, int); +int mknodat(int, uintptr_t, unsigned int, int); +int nanosleep(uintptr_t, uintptr_t); +int open64(uintptr_t, int, unsigned int); +int openat(int, uintptr_t, int, unsigned int); +int read(int, uintptr_t, size_t); +int readlink(uintptr_t, uintptr_t, size_t); +int renameat(int, uintptr_t, int, uintptr_t); +int setdomainname(uintptr_t, size_t); +int sethostname(uintptr_t, size_t); +int setpgid(int, int); +int setsid(); +int settimeofday(uintptr_t); +int setuid(int); +int setgid(int); +int setpriority(int, int, int); +int statx(int, uintptr_t, int, int, uintptr_t); +int sync(); +uintptr_t times(uintptr_t); +int umask(int); +int uname(uintptr_t); +int unlink(uintptr_t); +int unlinkat(int, uintptr_t, int); +int ustat(int, uintptr_t); +int write(int, uintptr_t, size_t); +int dup2(int, int); +int posix_fadvise64(int, long long, long long, int); +int fchown(int, int, int); +int fstat(int, uintptr_t); +int fstatat(int, uintptr_t, uintptr_t, int); +int fstatfs(int, uintptr_t); +int ftruncate(int, long long); +int getegid(); +int geteuid(); +int getgid(); +int getuid(); +int lchown(uintptr_t, int, int); +int listen(int, int); +int lstat(uintptr_t, uintptr_t); +int pause(); +int pread64(int, uintptr_t, size_t, long long); +int pwrite64(int, uintptr_t, size_t, long long); +int pselect(int, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +int setregid(int, int); +int setreuid(int, int); +int shutdown(int, int); +long long splice(int, uintptr_t, int, uintptr_t, int, int); +int stat(uintptr_t, uintptr_t); +int statfs(uintptr_t, uintptr_t); +int truncate(uintptr_t, long long); +int bind(int, uintptr_t, uintptr_t); +int connect(int, uintptr_t, uintptr_t); +int getgroups(int, uintptr_t); +int setgroups(int, uintptr_t); +int getsockopt(int, int, int, uintptr_t, uintptr_t); +int setsockopt(int, int, int, uintptr_t, uintptr_t); +int socket(int, int, int); +int socketpair(int, int, int, uintptr_t); +int getpeername(int, uintptr_t, uintptr_t); +int getsockname(int, uintptr_t, uintptr_t); +int recvfrom(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); +int sendto(int, uintptr_t, size_t, int, uintptr_t, uintptr_t); +int recvmsg(int, uintptr_t, int); +int sendmsg(int, uintptr_t, int); +int munmap(uintptr_t, uintptr_t); +int madvise(uintptr_t, size_t, int); +int mprotect(uintptr_t, size_t, int); +int mlock(uintptr_t, size_t); +int mlockall(int); +int msync(uintptr_t, size_t, int); +int munlock(uintptr_t, size_t); +int munlockall(); +int pipe(uintptr_t); +int poll(uintptr_t, int, int); +int gettimeofday(uintptr_t, uintptr_t); +int time(uintptr_t); +int utime(uintptr_t, uintptr_t); +int getrlimit(int, uintptr_t); +int setrlimit(int, uintptr_t); +long long lseek(int, long long, int); +uintptr_t mmap64(uintptr_t, uintptr_t, int, int, int, long long); + +*/ +import "C" +import ( + "syscall" +) + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callutimes(_p0 uintptr, times uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.utimes(C.uintptr_t(_p0), C.uintptr_t(times))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callutimensat(dirfd int, _p0 uintptr, times uintptr, flag int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.utimensat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(times), C.int(flag))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetcwd(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getcwd(C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callaccept(s int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.accept(C.int(s), C.uintptr_t(rsa), C.uintptr_t(addrlen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetdirent(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getdirent(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callwait4(pid int, status uintptr, options int, rusage uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.wait4(C.int(pid), C.uintptr_t(status), C.int(options), C.uintptr_t(rusage))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callioctl(fd int, req int, arg uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.ioctl(C.int(fd), C.int(req), C.uintptr_t(arg))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfcntl(fd uintptr, cmd int, arg uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fcntl(C.uintptr_t(fd), C.int(cmd), C.uintptr_t(arg))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callacct(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.acct(C.uintptr_t(_p0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callchdir(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.chdir(C.uintptr_t(_p0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callchroot(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.chroot(C.uintptr_t(_p0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callclose(fd int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.close(C.int(fd))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calldup(oldfd int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.dup(C.int(oldfd))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callexit(code int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.exit(C.int(code))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfaccessat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.faccessat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchdir(fd int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fchdir(C.int(fd))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchmod(fd int, mode uint32) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fchmod(C.int(fd), C.uint(mode))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchmodat(dirfd int, _p0 uintptr, mode uint32, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fchmodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchownat(dirfd int, _p0 uintptr, uid int, gid int, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fchownat(C.int(dirfd), C.uintptr_t(_p0), C.int(uid), C.int(gid), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfdatasync(fd int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fdatasync(C.int(fd))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfsync(fd int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fsync(C.int(fd))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpgid(pid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getpgid(C.int(pid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpgrp() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getpgrp()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpid() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getpid()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetppid() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getppid()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpriority(which int, who int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getpriority(C.int(which), C.int(who))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetrusage(who int, rusage uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getrusage(C.int(who), C.uintptr_t(rusage))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetsid(pid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getsid(C.int(pid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callkill(pid int, sig int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.kill(C.int(pid), C.int(sig))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsyslog(typ int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.syslog(C.int(typ), C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmkdir(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mkdir(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmkdirat(dirfd int, _p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mkdirat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmkfifo(_p0 uintptr, mode uint32) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mkfifo(C.uintptr_t(_p0), C.uint(mode))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmknod(_p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mknod(C.uintptr_t(_p0), C.uint(mode), C.int(dev))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmknodat(dirfd int, _p0 uintptr, mode uint32, dev int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mknodat(C.int(dirfd), C.uintptr_t(_p0), C.uint(mode), C.int(dev))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callnanosleep(time uintptr, leftover uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.nanosleep(C.uintptr_t(time), C.uintptr_t(leftover))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callopen64(_p0 uintptr, mode int, perm uint32) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.open64(C.uintptr_t(_p0), C.int(mode), C.uint(perm))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callopenat(dirfd int, _p0 uintptr, flags int, mode uint32) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.openat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.uint(mode))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callread(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.read(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callreadlink(_p0 uintptr, _p1 uintptr, _lenp1 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.readlink(C.uintptr_t(_p0), C.uintptr_t(_p1), C.size_t(_lenp1))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callrenameat(olddirfd int, _p0 uintptr, newdirfd int, _p1 uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.renameat(C.int(olddirfd), C.uintptr_t(_p0), C.int(newdirfd), C.uintptr_t(_p1))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetdomainname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setdomainname(C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsethostname(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.sethostname(C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetpgid(pid int, pgid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setpgid(C.int(pid), C.int(pgid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetsid() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setsid()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsettimeofday(tv uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.settimeofday(C.uintptr_t(tv))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetuid(uid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setuid(C.int(uid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetgid(uid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setgid(C.int(uid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetpriority(which int, who int, prio int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setpriority(C.int(which), C.int(who), C.int(prio))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callstatx(dirfd int, _p0 uintptr, flags int, mask int, stat uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.statx(C.int(dirfd), C.uintptr_t(_p0), C.int(flags), C.int(mask), C.uintptr_t(stat))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsync() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.sync()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calltimes(tms uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.times(C.uintptr_t(tms))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callumask(mask int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.umask(C.int(mask))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calluname(buf uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.uname(C.uintptr_t(buf))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callunlink(_p0 uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.unlink(C.uintptr_t(_p0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callunlinkat(dirfd int, _p0 uintptr, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.unlinkat(C.int(dirfd), C.uintptr_t(_p0), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callustat(dev int, ubuf uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.ustat(C.int(dev), C.uintptr_t(ubuf))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callwrite(fd int, _p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.write(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calldup2(oldfd int, newfd int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.dup2(C.int(oldfd), C.int(newfd))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callposix_fadvise64(fd int, offset int64, length int64, advice int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.posix_fadvise64(C.int(fd), C.longlong(offset), C.longlong(length), C.int(advice))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfchown(fd int, uid int, gid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fchown(C.int(fd), C.int(uid), C.int(gid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfstat(fd int, stat uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fstat(C.int(fd), C.uintptr_t(stat))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfstatat(dirfd int, _p0 uintptr, stat uintptr, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fstatat(C.int(dirfd), C.uintptr_t(_p0), C.uintptr_t(stat), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callfstatfs(fd int, buf uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.fstatfs(C.int(fd), C.uintptr_t(buf))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callftruncate(fd int, length int64) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.ftruncate(C.int(fd), C.longlong(length))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetegid() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getegid()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgeteuid() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.geteuid()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetgid() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getgid()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetuid() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getuid()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllchown(_p0 uintptr, uid int, gid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.lchown(C.uintptr_t(_p0), C.int(uid), C.int(gid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllisten(s int, n int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.listen(C.int(s), C.int(n))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllstat(_p0 uintptr, stat uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.lstat(C.uintptr_t(_p0), C.uintptr_t(stat))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpause() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.pause()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpread64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.pread64(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0), C.longlong(offset))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpwrite64(fd int, _p0 uintptr, _lenp0 int, offset int64) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.pwrite64(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0), C.longlong(offset))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpselect(nfd int, r uintptr, w uintptr, e uintptr, timeout uintptr, sigmask uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.pselect(C.int(nfd), C.uintptr_t(r), C.uintptr_t(w), C.uintptr_t(e), C.uintptr_t(timeout), C.uintptr_t(sigmask))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetregid(rgid int, egid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setregid(C.int(rgid), C.int(egid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetreuid(ruid int, euid int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setreuid(C.int(ruid), C.int(euid))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callshutdown(fd int, how int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.shutdown(C.int(fd), C.int(how))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsplice(rfd int, roff uintptr, wfd int, woff uintptr, len int, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.splice(C.int(rfd), C.uintptr_t(roff), C.int(wfd), C.uintptr_t(woff), C.int(len), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callstat(_p0 uintptr, stat uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.stat(C.uintptr_t(_p0), C.uintptr_t(stat))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callstatfs(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.statfs(C.uintptr_t(_p0), C.uintptr_t(buf))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calltruncate(_p0 uintptr, length int64) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.truncate(C.uintptr_t(_p0), C.longlong(length))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callbind(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.bind(C.int(s), C.uintptr_t(addr), C.uintptr_t(addrlen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callconnect(s int, addr uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.connect(C.int(s), C.uintptr_t(addr), C.uintptr_t(addrlen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getgroups(C.int(n), C.uintptr_t(list))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetgroups(n int, list uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setgroups(C.int(n), C.uintptr_t(list))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(val), C.uintptr_t(vallen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetsockopt(s int, level int, name int, val uintptr, vallen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setsockopt(C.int(s), C.int(level), C.int(name), C.uintptr_t(val), C.uintptr_t(vallen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsocket(domain int, typ int, proto int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.socket(C.int(domain), C.int(typ), C.int(proto))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsocketpair(domain int, typ int, proto int, fd uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.socketpair(C.int(domain), C.int(typ), C.int(proto), C.uintptr_t(fd))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetpeername(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getpeername(C.int(fd), C.uintptr_t(rsa), C.uintptr_t(addrlen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetsockname(fd int, rsa uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getsockname(C.int(fd), C.uintptr_t(rsa), C.uintptr_t(addrlen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callrecvfrom(fd int, _p0 uintptr, _lenp0 int, flags int, from uintptr, fromlen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.recvfrom(C.int(fd), C.uintptr_t(_p0), C.size_t(_lenp0), C.int(flags), C.uintptr_t(from), C.uintptr_t(fromlen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsendto(s int, _p0 uintptr, _lenp0 int, flags int, to uintptr, addrlen uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.sendto(C.int(s), C.uintptr_t(_p0), C.size_t(_lenp0), C.int(flags), C.uintptr_t(to), C.uintptr_t(addrlen))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callrecvmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.recvmsg(C.int(s), C.uintptr_t(msg), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsendmsg(s int, msg uintptr, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.sendmsg(C.int(s), C.uintptr_t(msg), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmunmap(addr uintptr, length uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.munmap(C.uintptr_t(addr), C.uintptr_t(length))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmadvise(_p0 uintptr, _lenp0 int, advice int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.madvise(C.uintptr_t(_p0), C.size_t(_lenp0), C.int(advice))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmprotect(_p0 uintptr, _lenp0 int, prot int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mprotect(C.uintptr_t(_p0), C.size_t(_lenp0), C.int(prot))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mlock(C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmlockall(flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mlockall(C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmsync(_p0 uintptr, _lenp0 int, flags int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.msync(C.uintptr_t(_p0), C.size_t(_lenp0), C.int(flags))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmunlock(_p0 uintptr, _lenp0 int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.munlock(C.uintptr_t(_p0), C.size_t(_lenp0))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmunlockall() (r1 uintptr, e1 Errno) { + r1 = uintptr(C.munlockall()) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpipe(p uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.pipe(C.uintptr_t(p))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callpoll(fds uintptr, nfds int, timeout int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.poll(C.uintptr_t(fds), C.int(nfds), C.int(timeout))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgettimeofday(tv uintptr, tzp uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.gettimeofday(C.uintptr_t(tv), C.uintptr_t(tzp))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calltime(t uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.time(C.uintptr_t(t))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callutime(_p0 uintptr, buf uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.utime(C.uintptr_t(_p0), C.uintptr_t(buf))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callgetrlimit(resource int, rlim uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.getrlimit(C.int(resource), C.uintptr_t(rlim))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callsetrlimit(resource int, rlim uintptr) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.setrlimit(C.int(resource), C.uintptr_t(rlim))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func calllseek(fd int, offset int64, whence int) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.lseek(C.int(fd), C.longlong(offset), C.int(whence))) + e1 = syscall.GetErrno() + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func callmmap64(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (r1 uintptr, e1 Errno) { + r1 = uintptr(C.mmap64(C.uintptr_t(addr), C.uintptr_t(length), C.int(prot), C.int(flags), C.int(fd), C.longlong(offset))) + e1 = syscall.GetErrno() + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go index ac02d4d8419e6..8b7f27309b12d 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -tags darwin,386 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go +// go run mksyscall.go -l32 -tags darwin,386 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build darwin,386 @@ -420,6 +420,22 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -440,6 +456,21 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func removexattr(path string, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -460,6 +491,21 @@ func removexattr(path string, attr string, options int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -476,6 +522,17 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 1dd3cfa0e17ab..285646462c4aa 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags darwin,amd64 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go +// go run mksyscall.go -tags darwin,amd64 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build darwin,amd64 @@ -420,6 +420,22 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -440,6 +456,21 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func removexattr(path string, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -460,6 +491,21 @@ func removexattr(path string, attr string, options int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -476,6 +522,17 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go index cab46e74ba447..37e3c692504df 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -tags darwin,arm syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go +// go run mksyscall.go -l32 -tags darwin,arm syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build darwin,arm @@ -420,6 +420,22 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -440,6 +456,21 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func removexattr(path string, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -460,6 +491,21 @@ func removexattr(path string, attr string, options int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -476,6 +522,17 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 13478dd0bcf3d..67f3b4e5e5747 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags darwin,arm64 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go +// go run mksyscall.go -tags darwin,arm64 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build darwin,arm64 @@ -420,6 +420,22 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -440,6 +456,21 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func removexattr(path string, attr string, options int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -460,6 +491,21 @@ func removexattr(path string, attr string, options int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -476,6 +522,17 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go index 91f36e9ec30f2..da9986dd213c4 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go +// go run mksyscall.go -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build dragonfly,amd64 @@ -588,6 +588,21 @@ func Exit(code int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { @@ -643,6 +658,21 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -927,6 +957,26 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { @@ -967,6 +1017,21 @@ func Mkdir(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -997,6 +1062,21 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mknodat(fd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1023,6 +1103,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1345,6 +1441,26 @@ func Symlink(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { @@ -1408,6 +1524,21 @@ func Unlink(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index a86434a7ba8f2..80903e47b65c2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go +// go run mksyscall.go -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build freebsd,386 @@ -377,10 +377,8 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (r int, w int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) - r = int(r0) - w = int(r1) +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } @@ -914,7 +912,7 @@ func Fpathconf(fd int, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstat(fd int, stat *Stat_t) (err error) { +func fstat(fd int, stat *stat_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) @@ -924,7 +922,17 @@ func Fstat(fd int, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { +func fstat_freebsd12(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -939,7 +947,22 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatfs(fd int, stat *Statfs_t) (err error) { +func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) @@ -949,6 +972,16 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -969,14 +1002,14 @@ func Ftruncate(fd int, length int64) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdents(fd int, buf []byte) (n int, err error) { +func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -986,14 +1019,14 @@ func Getdents(fd int, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { +func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1224,7 +1257,7 @@ func Listen(s int, backlog int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { +func lstat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1284,7 +1317,7 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mknod(path string, mode uint32, dev int) (err error) { +func mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1299,6 +1332,36 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mknodat(fd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1689,7 +1752,7 @@ func Setuid(uid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { +func stat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1704,7 +1767,7 @@ func Stat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Statfs(path string, stat *Statfs_t) (err error) { +func statfs(path string, stat *statfs_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1719,6 +1782,21 @@ func Statfs(path string, stat *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func statfs_freebsd12(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index 040e2f760cd41..cd250ff0e240e 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go +// go run mksyscall.go -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build freebsd,amd64 @@ -377,10 +377,8 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (r int, w int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) - r = int(r0) - w = int(r1) +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } @@ -914,7 +912,7 @@ func Fpathconf(fd int, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstat(fd int, stat *Stat_t) (err error) { +func fstat(fd int, stat *stat_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) @@ -924,7 +922,17 @@ func Fstat(fd int, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { +func fstat_freebsd12(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -939,7 +947,22 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatfs(fd int, stat *Statfs_t) (err error) { +func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) @@ -949,6 +972,16 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -969,14 +1002,14 @@ func Ftruncate(fd int, length int64) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdents(fd int, buf []byte) (n int, err error) { +func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -986,14 +1019,14 @@ func Getdents(fd int, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { +func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1224,7 +1257,7 @@ func Listen(s int, backlog int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { +func lstat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1284,7 +1317,7 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mknod(path string, mode uint32, dev int) (err error) { +func mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1299,6 +1332,36 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mknodat(fd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1689,7 +1752,7 @@ func Setuid(uid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { +func stat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1704,7 +1767,7 @@ func Stat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Statfs(path string, stat *Statfs_t) (err error) { +func statfs(path string, stat *statfs_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1719,6 +1782,21 @@ func Statfs(path string, stat *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func statfs_freebsd12(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index cddc5e86b1976..290a9c2cb06c3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go +// go run mksyscall.go -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build freebsd,arm @@ -377,10 +377,8 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe() (r int, w int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) - r = int(r0) - w = int(r1) +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } @@ -914,7 +912,7 @@ func Fpathconf(fd int, name int) (val int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstat(fd int, stat *Stat_t) (err error) { +func fstat(fd int, stat *stat_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) @@ -924,7 +922,17 @@ func Fstat(fd int, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { +func fstat_freebsd12(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -939,7 +947,22 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatfs(fd int, stat *Statfs_t) (err error) { +func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) @@ -949,6 +972,16 @@ func Fstatfs(fd int, stat *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -969,14 +1002,14 @@ func Ftruncate(fd int, length int64) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdents(fd int, buf []byte) (n int, err error) { +func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(_p0), uintptr(len(buf))) + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -986,14 +1019,14 @@ func Getdents(fd int, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { +func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1224,7 +1257,7 @@ func Listen(s int, backlog int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { +func lstat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1284,7 +1317,7 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Mknod(path string, mode uint32, dev int) (err error) { +func mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1299,6 +1332,36 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func mknodat(fd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1689,7 +1752,7 @@ func Setuid(uid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { +func stat(path string, stat *stat_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1704,7 +1767,7 @@ func Stat(path string, stat *Stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Statfs(path string, stat *Statfs_t) (err error) { +func statfs(path string, stat *statfs_freebsd11_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { @@ -1719,6 +1782,21 @@ func Statfs(path string, stat *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func statfs_freebsd12(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index 237e960959e97..5356a517594d2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go +// go run mksyscall.go -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,386 @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index 9b40f580b083f..0f6d265d8b070 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go +// go run mksyscall.go -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,amd64 @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) @@ -1634,7 +1806,7 @@ func Getuid() (uid int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func InotifyInit() (fd int, err error) { +func inotifyInit() (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) fd = int(r0) if e1 != 0 { @@ -1690,21 +1862,6 @@ func Listen(s int, n int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { @@ -2175,3 +2332,18 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(cmdline) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index d93cc2f3b172d..75db4c0c1579c 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go +// go run mksyscall.go -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,arm @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 5f7d0213b275a..b890cb03c6e15 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go +// go run mksyscall.go -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,arm64 @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index e761705282551..cc17b43d35564 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -1,4 +1,4 @@ -// mksyscall.pl -b32 -arm -tags linux,mips syscall_linux.go syscall_linux_mipsx.go +// go run mksyscall.go -b32 -arm -tags linux,mips syscall_linux.go syscall_linux_mipsx.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,mips @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) @@ -2137,6 +2309,18 @@ func pipe2(p *[2]_C_int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pipe() (p1 int, p2 int, err error) { + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + p1 = int(r0) + p2 = int(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index 382e072f5e552..caf1408ec4e53 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,mips64 syscall_linux.go syscall_linux_mips64x.go +// go run mksyscall.go -tags linux,mips64 syscall_linux.go syscall_linux_mips64x.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,mips64 @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index da33eb12b072b..266be8b4abbf9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go +// go run mksyscall.go -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,mips64le @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index f6e45189ae530..b16b3e102989f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -arm -tags linux,mipsle syscall_linux.go syscall_linux_mipsx.go +// go run mksyscall.go -l32 -arm -tags linux,mipsle syscall_linux.go syscall_linux_mipsx.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,mipsle @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) @@ -2137,6 +2309,18 @@ func pipe2(p *[2]_C_int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pipe() (p1 int, p2 int, err error) { + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + p1 = int(r0) + p2 = int(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index 0ae2aa842254a..27b6a6bf0e395 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,ppc64 syscall_linux.go syscall_linux_ppc64x.go +// go run mksyscall.go -tags linux,ppc64 syscall_linux.go syscall_linux_ppc64x.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,ppc64 @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) @@ -1474,8 +1646,13 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) +func faccessat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } @@ -1484,9 +1661,8 @@ func Dup2(oldfd int, newfd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollCreate(size int) (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) - fd = int(r0) +func Dup2(oldfd int, newfd int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) } @@ -1495,13 +1671,9 @@ func EpollCreate(size int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func faccessat(dirfd int, path string, mode uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) +func EpollCreate(size int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) + fd = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -1903,16 +2075,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { - _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2222,3 +2384,28 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func syncFileRange2(fd int, flags int, off int64, n int64) (err error) { + _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(flags), uintptr(off), uintptr(n), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(cmdline) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index fa16c165e1179..f7ecc9afda571 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,ppc64le syscall_linux.go syscall_linux_ppc64x.go +// go run mksyscall.go -tags linux,ppc64le syscall_linux.go syscall_linux_ppc64x.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,ppc64le @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) @@ -1474,8 +1646,13 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup2(oldfd int, newfd int) (err error) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) +func faccessat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } @@ -1484,9 +1661,8 @@ func Dup2(oldfd int, newfd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollCreate(size int) (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) - fd = int(r0) +func Dup2(oldfd int, newfd int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) } @@ -1495,13 +1671,9 @@ func EpollCreate(size int) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func faccessat(dirfd int, path string, mode uint32) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) +func EpollCreate(size int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) + fd = int(r0) if e1 != 0 { err = errnoErr(e1) } @@ -1903,16 +2075,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { - _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2222,3 +2384,28 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func syncFileRange2(fd int, flags int, off int64, n int64) (err error) { + _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE2, uintptr(fd), uintptr(flags), uintptr(off), uintptr(n), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(cmdline) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go new file mode 100644 index 0000000000000..e3cd4e53f9949 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -0,0 +1,2191 @@ +// go run mksyscall.go -tags linux,riscv64 syscall_linux.go syscall_linux_riscv64.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build linux,riscv64 + +package unix + +import ( + "syscall" + "unsafe" +) + +var _ syscall.Errno + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fchmodat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 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 Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getcwd(buf []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 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 wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { + r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + wpid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { + r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func keyctlJoin(cmd int, arg2 string) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(arg2) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(arg3) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(arg4) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) { + var _p0 unsafe.Pointer + if len(payload) > 0 { + _p0 = unsafe.Pointer(&payload[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(arg) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(source) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(target) + if err != nil { + return + } + var _p2 *byte + _p2, err = BytePtrFromString(fstype) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Acct(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(keyType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(description) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(payload) > 0 { + _p2 = unsafe.Pointer(&payload[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0) + id = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Adjtimex(buf *Timex) (state int, err error) { + r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) + state = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ClockGettime(clockid int32, time *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { + r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(oldfd int) (fd int, err error) { + r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup3(oldfd int, newfd int, flags int) (err error) { + _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func EpollCreate1(flag int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { + _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) + 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) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { + _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fdatasync(fd int) (err error) { + _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flock(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdents(fd int, buf []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0) + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrandom(buf []byte, flags int) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Gettid() (tid int) { + r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0) + tid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getxattr(path string, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(dest) > 0 { + _p2 = unsafe.Pointer(&dest[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(pathname) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) + watchdesc = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func InotifyInit1(flags int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { + r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) + success = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kill(pid int, sig syscall.Signal) (err error) { + _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Klogctl(typ int, buf []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(dest) > 0 { + _p2 = unsafe.Pointer(&dest[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listxattr(path string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Llistxattr(path string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lremovexattr(path string, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(data) > 0 { + _p2 = unsafe.Pointer(&data[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Nanosleep(time *Timespec, leftover *Timespec) (err error) { + _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) { + r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func PivotRoot(newroot string, putold string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(newroot) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(putold) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { + _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { + _, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// 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 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Removexattr(path string, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(keyType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(description) + if err != nil { + return + } + var _p2 *byte + _p2, err = BytePtrFromString(callback) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0) + id = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setdomainname(p []byte) (err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sethostname(p []byte) (err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tv *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setns(fd int, nstype int) (err error) { + _, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setxattr(path string, attr string, data []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p2 unsafe.Pointer + if len(data) > 0 { + _p2 = unsafe.Pointer(&data[0]) + } else { + _p2 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() { + SyscallNoError(SYS_SYNC, 0, 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Syncfs(fd int) (err error) { + _, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sysinfo(info *Sysinfo_t) (err error) { + _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { + r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) + n = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { + _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Times(tms *Tms) (ticks uintptr, err error) { + r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) + ticks = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(mask int) (oldmask int) { + r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Uname(buf *Utsname) (err error) { + _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unmount(target string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(target) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unshare(flags int) (err error) { + _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func exitThread(code int) (err error) { + _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, p *byte, np int) (n int, err error) { + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, p *byte, np int) (n int, err error) { + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, advice int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func faccessat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// 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 { + 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 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, buf *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (euid int) { + r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0) + euid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(resource int, rlim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, n int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 Seek(fd int, offset int64, whence int) (off int64, err error) { + r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + off = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) + written = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresgid(rgid int, egid int, sgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresuid(ruid int, euid int, suid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(resource int, rlim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { + r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) + n = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, buf *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { + _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { + r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(n int, list *_Gid_t) (nn int, err error) { + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + nn = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setgroups(n int, list *_Gid_t) (err error) { + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) + xaddr = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Gettimeofday(tv *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index 38f903cd3e1f6..3001d3798198a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,s390x syscall_linux.go syscall_linux_s390x.go +// go run mksyscall.go -tags linux,s390x syscall_linux.go syscall_linux_s390x.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,s390x @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -574,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -584,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -722,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -904,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1063,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) @@ -1992,3 +2164,18 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(cmdline) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_KEXEC_FILE_LOAD, uintptr(kernelFd), uintptr(initrdFd), uintptr(cmdlineLen), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index b26aee9579a63..aafe3660fa28e 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go +// go run mksyscall.go -tags linux,sparc64 syscall_linux.go syscall_linux_sparc64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,sparc64 @@ -417,6 +417,16 @@ func Chroot(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ClockGetres(clockid int32, res *Timespec) (err error) { + _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { @@ -448,6 +458,21 @@ func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags in // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func DeleteModule(name string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) @@ -508,21 +533,6 @@ func Exit(code int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { @@ -589,6 +599,60 @@ func Fdatasync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func FinitModule(fd int, params string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flistxattr(fd int, dest []byte) (sz int, err error) { + var _p0 unsafe.Pointer + if len(dest) > 0 { + _p0 = unsafe.Pointer(&dest[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -599,6 +663,42 @@ func Flock(fd int, how int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fremovexattr(fd int, attr string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(dest) > 0 { + _p1 = unsafe.Pointer(&dest[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -737,6 +837,27 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func InitModule(moduleImage []byte, params string) (err error) { + var _p0 unsafe.Pointer + if len(moduleImage) > 0 { + _p0 = unsafe.Pointer(&moduleImage[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + var _p1 *byte + _p1, err = BytePtrFromString(params) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) @@ -919,6 +1040,22 @@ func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func MemfdCreate(name string, flags int) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1078,6 +1215,26 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) @@ -1489,6 +1646,21 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func faccessat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// 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 { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index b3298930e7422..642db7670a209 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -netbsd -tags netbsd,386 syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go +// go run mksyscall.go -l32 -netbsd -tags netbsd,386 syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build netbsd,386 @@ -571,6 +571,220 @@ func Exit(code int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -651,6 +865,21 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -900,6 +1129,26 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { @@ -940,6 +1189,21 @@ func Mkdir(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -955,6 +1219,21 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -970,6 +1249,21 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -996,6 +1290,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1085,6 +1395,28 @@ func Readlink(path string, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) @@ -1105,6 +1437,26 @@ func Rename(from string, to string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1302,6 +1654,26 @@ func Symlink(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { @@ -1350,6 +1722,21 @@ func Unlink(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index 5096ef07e4902..59585fee3541f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -netbsd -tags netbsd,amd64 syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go +// go run mksyscall.go -netbsd -tags netbsd,amd64 syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build netbsd,amd64 @@ -571,6 +571,220 @@ func Exit(code int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -651,6 +865,21 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -900,6 +1129,26 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { @@ -940,6 +1189,21 @@ func Mkdir(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -955,6 +1219,21 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -970,6 +1249,21 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -996,6 +1290,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1085,6 +1395,28 @@ func Readlink(path string, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) @@ -1105,6 +1437,26 @@ func Rename(from string, to string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1302,6 +1654,26 @@ func Symlink(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { @@ -1350,6 +1722,21 @@ func Unlink(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index b7141c63f9f4b..6ec31434b214b 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -netbsd -arm -tags netbsd,arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go +// go run mksyscall.go -l32 -netbsd -arm -tags netbsd,arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build netbsd,arm @@ -571,6 +571,220 @@ func Exit(code int) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -651,6 +865,21 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -900,6 +1129,26 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { @@ -940,6 +1189,21 @@ func Mkdir(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -955,6 +1219,21 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -970,6 +1249,21 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -996,6 +1290,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1085,6 +1395,28 @@ func Readlink(path string, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) @@ -1105,6 +1437,26 @@ func Rename(from string, to string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1302,6 +1654,26 @@ func Symlink(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { @@ -1350,6 +1722,21 @@ func Unlink(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 1942049b0f893..6a489fac0a69e 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -openbsd -tags openbsd,386 syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go +// go run mksyscall.go -l32 -openbsd -tags openbsd,386 syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build openbsd,386 @@ -431,6 +431,17 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 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 Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -639,6 +650,21 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -909,6 +935,26 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { @@ -949,6 +995,21 @@ func Mkdir(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -964,6 +1025,21 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -979,6 +1055,21 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1005,6 +1096,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1094,6 +1201,28 @@ func Readlink(path string, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) @@ -1114,6 +1243,26 @@ func Rename(from string, to string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1371,6 +1520,26 @@ func Symlink(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { @@ -1419,6 +1588,21 @@ func Unlink(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index d351c72cb716f..30cba4347c121 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1,4 +1,4 @@ -// mksyscall.pl -openbsd -tags openbsd,amd64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go +// go run mksyscall.go -openbsd -tags openbsd,amd64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build openbsd,amd64 @@ -431,6 +431,17 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 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 Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -639,6 +650,21 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -909,6 +935,26 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { @@ -949,6 +995,21 @@ func Mkdir(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -964,6 +1025,21 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -979,6 +1055,21 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1005,6 +1096,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1094,6 +1201,28 @@ func Readlink(path string, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) @@ -1114,6 +1243,26 @@ func Rename(from string, to string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1371,6 +1520,26 @@ func Symlink(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { @@ -1419,6 +1588,21 @@ func Unlink(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index 617d47f0f311b..fa1beda33e38d 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1,4 +1,4 @@ -// mksyscall.pl -l32 -openbsd -arm -tags openbsd,arm syscall_bsd.go syscall_openbsd.go syscall_openbsd_arm.go +// go run mksyscall.go -l32 -openbsd -arm -tags openbsd,arm syscall_bsd.go syscall_openbsd.go syscall_openbsd_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build openbsd,arm @@ -431,6 +431,17 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { + r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 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 Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -639,6 +650,21 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { @@ -909,6 +935,26 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { @@ -949,6 +995,21 @@ func Mkdir(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -964,6 +1025,21 @@ func Mkfifo(path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mkfifoat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFOAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -979,6 +1055,21 @@ func Mknod(path string, mode uint32, dev int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { @@ -1005,6 +1096,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1094,6 +1201,28 @@ func Readlink(path string, buf []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) @@ -1114,6 +1243,26 @@ func Rename(from string, to string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1371,6 +1520,26 @@ func Symlink(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { @@ -1419,6 +1588,21 @@ func Unlink(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index e2e5fc5e0a6b1..97b22a499ed3b 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -399,6 +399,8 @@ var ( procrecvfrom syscallFunc ) +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func pipe(p *[2]_C_int) (n int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe)), 1, uintptr(unsafe.Pointer(p)), 0, 0, 0, 0, 0) n = int(r0) @@ -408,6 +410,8 @@ func pipe(p *[2]_C_int) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procgetsockname)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) if e1 != 0 { @@ -416,6 +420,8 @@ func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getcwd(buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { @@ -429,6 +435,8 @@ func Getcwd(buf []byte) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0) n = int(r0) @@ -438,6 +446,8 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procsetgroups)), 2, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0, 0, 0, 0) if e1 != 0 { @@ -446,6 +456,8 @@ func setgroups(ngid int, gid *_Gid_t) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procwait4)), 4, uintptr(pid), uintptr(unsafe.Pointer(statusp)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int32(r0) @@ -455,6 +467,8 @@ func wait4(pid int32, statusp *_C_int, options int, rusage *Rusage) (wpid int32, return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func gethostname(buf []byte) (n int, err error) { var _p0 *byte if len(buf) > 0 { @@ -468,6 +482,8 @@ func gethostname(buf []byte) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -481,6 +497,8 @@ func utimes(path string, times *[2]Timeval) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -494,6 +512,8 @@ func utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0) val = int(r0) @@ -503,6 +523,8 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func futimesat(fildes int, path *byte, times *[2]Timeval) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfutimesat)), 3, uintptr(fildes), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times)), 0, 0, 0) if e1 != 0 { @@ -511,6 +533,8 @@ func futimesat(fildes int, path *byte, times *[2]Timeval) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept)), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) fd = int(r0) @@ -520,6 +544,8 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_recvmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) n = int(r0) @@ -529,6 +555,8 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_sendmsg)), 3, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags), 0, 0, 0) n = int(r0) @@ -538,6 +566,8 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func acct(path *byte) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procacct)), 1, uintptr(unsafe.Pointer(path)), 0, 0, 0, 0, 0) if e1 != 0 { @@ -546,24 +576,32 @@ func acct(path *byte) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func __makedev(version int, major uint, minor uint) (val uint64) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__makedev)), 3, uintptr(version), uintptr(major), uintptr(minor), 0, 0, 0) val = uint64(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func __major(version int, dev uint64) (val uint) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__major)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0) val = uint(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func __minor(version int, dev uint64) (val uint) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&proc__minor)), 2, uintptr(version), uintptr(dev), 0, 0, 0, 0) val = uint(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procioctl)), 3, uintptr(fd), uintptr(req), uintptr(arg), 0, 0, 0) if e1 != 0 { @@ -572,6 +610,8 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procpoll)), 3, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout), 0, 0, 0) n = int(r0) @@ -581,6 +621,8 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -594,6 +636,8 @@ func Access(path string, mode uint32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAdjtime)), 2, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0, 0, 0, 0) if e1 != 0 { @@ -602,6 +646,8 @@ func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -615,6 +661,8 @@ func Chdir(path string) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -628,6 +676,8 @@ func Chmod(path string, mode uint32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -641,6 +691,8 @@ func Chown(path string, uid int, gid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -654,6 +706,8 @@ func Chroot(path string) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Close(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procClose)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { @@ -662,6 +716,8 @@ func Close(fd int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Creat(path string, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -676,6 +732,8 @@ func Creat(path string, mode uint32) (fd int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup(fd int) (nfd int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup)), 1, uintptr(fd), 0, 0, 0, 0, 0) nfd = int(r0) @@ -685,6 +743,8 @@ func Dup(fd int) (nfd int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Dup2(oldfd int, newfd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procDup2)), 2, uintptr(oldfd), uintptr(newfd), 0, 0, 0, 0) if e1 != 0 { @@ -693,11 +753,15 @@ func Dup2(oldfd int, newfd int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Exit(code int) { sysvicall6(uintptr(unsafe.Pointer(&procExit)), 1, uintptr(code), 0, 0, 0, 0, 0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -711,6 +775,8 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fchdir(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchdir)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { @@ -719,6 +785,8 @@ func Fchdir(fd int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmod)), 2, uintptr(fd), uintptr(mode), 0, 0, 0, 0) if e1 != 0 { @@ -727,6 +795,8 @@ func Fchmod(fd int, mode uint32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -740,6 +810,8 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { 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 := sysvicall6(uintptr(unsafe.Pointer(&procFchown)), 3, uintptr(fd), uintptr(uid), uintptr(gid), 0, 0, 0) if e1 != 0 { @@ -748,6 +820,8 @@ func Fchown(fd int, uid int, gid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -761,6 +835,8 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFdatasync)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { @@ -769,6 +845,8 @@ func Fdatasync(fd int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Flock(fd int, how int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFlock)), 2, uintptr(fd), uintptr(how), 0, 0, 0, 0) if e1 != 0 { @@ -777,6 +855,8 @@ func Flock(fd int, how int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFpathconf)), 2, uintptr(fd), uintptr(name), 0, 0, 0, 0) val = int(r0) @@ -786,6 +866,8 @@ func Fpathconf(fd int, name int) (val int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstat)), 2, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) if e1 != 0 { @@ -794,6 +876,8 @@ func Fstat(fd int, stat *Stat_t) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -807,6 +891,8 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFstatvfs)), 2, uintptr(fd), uintptr(unsafe.Pointer(vfsstat)), 0, 0, 0, 0) if e1 != 0 { @@ -815,6 +901,8 @@ func Fstatvfs(fd int, vfsstat *Statvfs_t) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 *byte if len(buf) > 0 { @@ -828,18 +916,24 @@ func Getdents(fd int, buf []byte, basep *uintptr) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getgid() (gid int) { r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetgid)), 0, 0, 0, 0, 0, 0, 0) gid = int(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getpid() (pid int) { r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpid)), 0, 0, 0, 0, 0, 0, 0) pid = int(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgid)), 1, uintptr(pid), 0, 0, 0, 0, 0) pgid = int(r0) @@ -849,6 +943,8 @@ func Getpgid(pid int) (pgid int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getpgrp() (pgid int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetpgrp)), 0, 0, 0, 0, 0, 0, 0) pgid = int(r0) @@ -858,24 +954,32 @@ func Getpgrp() (pgid int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Geteuid() (euid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGeteuid)), 0, 0, 0, 0, 0, 0, 0) euid = int(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getegid() (egid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetegid)), 0, 0, 0, 0, 0, 0, 0) egid = int(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getppid() (ppid int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procGetppid)), 0, 0, 0, 0, 0, 0, 0) ppid = int(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getpriority(which int, who int) (n int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procGetpriority)), 2, uintptr(which), uintptr(who), 0, 0, 0, 0) n = int(r0) @@ -885,6 +989,8 @@ func Getpriority(which int, who int) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0) if e1 != 0 { @@ -893,6 +999,8 @@ func Getrlimit(which int, lim *Rlimit) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetrusage)), 2, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0, 0, 0, 0) if e1 != 0 { @@ -901,6 +1009,8 @@ func Getrusage(who int, rusage *Rusage) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0) if e1 != 0 { @@ -909,12 +1019,16 @@ func Gettimeofday(tv *Timeval) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Getuid() (uid int) { r0, _, _ := rawSysvicall6(uintptr(unsafe.Pointer(&procGetuid)), 0, 0, 0, 0, 0, 0, 0) uid = int(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procKill)), 2, uintptr(pid), uintptr(signum), 0, 0, 0, 0) if e1 != 0 { @@ -923,6 +1037,8 @@ func Kill(pid int, signum syscall.Signal) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -936,6 +1052,8 @@ func Lchown(path string, uid int, gid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -954,6 +1072,8 @@ func Link(path string, link string) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Listen(s int, backlog int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0) if e1 != 0 { @@ -962,6 +1082,8 @@ func Listen(s int, backlog int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -975,6 +1097,8 @@ func Lstat(path string, stat *Stat_t) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Madvise(b []byte, advice int) (err error) { var _p0 *byte if len(b) > 0 { @@ -987,6 +1111,8 @@ func Madvise(b []byte, advice int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1000,6 +1126,8 @@ func Mkdir(path string, mode uint32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1013,6 +1141,8 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1026,6 +1156,8 @@ func Mkfifo(path string, mode uint32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mkfifoat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1039,6 +1171,8 @@ func Mkfifoat(dirfd int, path string, mode uint32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1052,6 +1186,8 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1065,6 +1201,8 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { @@ -1077,6 +1215,8 @@ func Mlock(b []byte) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mlockall(flags int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMlockall)), 1, uintptr(flags), 0, 0, 0, 0, 0) if e1 != 0 { @@ -1085,6 +1225,8 @@ func Mlockall(flags int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Mprotect(b []byte, prot int) (err error) { var _p0 *byte if len(b) > 0 { @@ -1097,6 +1239,8 @@ func Mprotect(b []byte, prot int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Msync(b []byte, flags int) (err error) { var _p0 *byte if len(b) > 0 { @@ -1109,6 +1253,8 @@ func Msync(b []byte, flags int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Munlock(b []byte) (err error) { var _p0 *byte if len(b) > 0 { @@ -1121,6 +1267,8 @@ func Munlock(b []byte) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Munlockall() (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMunlockall)), 0, 0, 0, 0, 0, 0, 0) if e1 != 0 { @@ -1129,6 +1277,8 @@ func Munlockall() (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procNanosleep)), 2, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0, 0, 0, 0) if e1 != 0 { @@ -1137,6 +1287,8 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1151,6 +1303,8 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1165,6 +1319,8 @@ func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1179,6 +1335,8 @@ func Pathconf(path string, name int) (val int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pause() (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPause)), 0, 0, 0, 0, 0, 0, 0) if e1 != 0 { @@ -1187,6 +1345,8 @@ func Pause() (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { @@ -1200,6 +1360,8 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 *byte if len(p) > 0 { @@ -1213,6 +1375,8 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { return } +// 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 *byte if len(p) > 0 { @@ -1226,6 +1390,8 @@ func read(fd int, p []byte) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1244,6 +1410,8 @@ func Readlink(path string, buf []byte) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) @@ -1262,6 +1430,8 @@ func Rename(from string, to string) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) @@ -1280,6 +1450,8 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1293,6 +1465,8 @@ func Rmdir(path string) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proclseek)), 3, uintptr(fd), uintptr(offset), uintptr(whence), 0, 0, 0) newoffset = int64(r0) @@ -1302,6 +1476,8 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSelect)), 5, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) if e1 != 0 { @@ -1310,6 +1486,8 @@ func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setegid(egid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetegid)), 1, uintptr(egid), 0, 0, 0, 0, 0) if e1 != 0 { @@ -1318,6 +1496,8 @@ func Setegid(egid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Seteuid(euid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSeteuid)), 1, uintptr(euid), 0, 0, 0, 0, 0) if e1 != 0 { @@ -1326,6 +1506,8 @@ func Seteuid(euid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setgid(gid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetgid)), 1, uintptr(gid), 0, 0, 0, 0, 0) if e1 != 0 { @@ -1334,6 +1516,8 @@ func Setgid(gid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sethostname(p []byte) (err error) { var _p0 *byte if len(p) > 0 { @@ -1346,6 +1530,8 @@ func Sethostname(p []byte) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setpgid(pid int, pgid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetpgid)), 2, uintptr(pid), uintptr(pgid), 0, 0, 0, 0) if e1 != 0 { @@ -1354,6 +1540,8 @@ func Setpgid(pid int, pgid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSetpriority)), 3, uintptr(which), uintptr(who), uintptr(prio), 0, 0, 0) if e1 != 0 { @@ -1362,6 +1550,8 @@ func Setpriority(which int, who int, prio int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setregid(rgid int, egid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetregid)), 2, uintptr(rgid), uintptr(egid), 0, 0, 0, 0) if e1 != 0 { @@ -1370,6 +1560,8 @@ func Setregid(rgid int, egid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setreuid(ruid int, euid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetreuid)), 2, uintptr(ruid), uintptr(euid), 0, 0, 0, 0) if e1 != 0 { @@ -1378,6 +1570,8 @@ func Setreuid(ruid int, euid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetrlimit)), 2, uintptr(which), uintptr(unsafe.Pointer(lim)), 0, 0, 0, 0) if e1 != 0 { @@ -1386,6 +1580,8 @@ func Setrlimit(which int, lim *Rlimit) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setsid() (pid int, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetsid)), 0, 0, 0, 0, 0, 0, 0) pid = int(r0) @@ -1395,6 +1591,8 @@ func Setsid() (pid int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Setuid(uid int) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procSetuid)), 1, uintptr(uid), 0, 0, 0, 0, 0) if e1 != 0 { @@ -1403,6 +1601,8 @@ func Setuid(uid int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Shutdown(s int, how int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procshutdown)), 2, uintptr(s), uintptr(how), 0, 0, 0, 0) if e1 != 0 { @@ -1411,6 +1611,8 @@ func Shutdown(s int, how int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1424,6 +1626,8 @@ func Stat(path string, stat *Stat_t) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Statvfs(path string, vfsstat *Statvfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1437,6 +1641,8 @@ func Statvfs(path string, vfsstat *Statvfs_t) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1455,6 +1661,8 @@ func Symlink(path string, link string) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Sync() (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSync)), 0, 0, 0, 0, 0, 0, 0) if e1 != 0 { @@ -1463,6 +1671,8 @@ func Sync() (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procTimes)), 1, uintptr(unsafe.Pointer(tms)), 0, 0, 0, 0, 0) ticks = uintptr(r0) @@ -1472,6 +1682,8 @@ func Times(tms *Tms) (ticks uintptr, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1485,6 +1697,8 @@ func Truncate(path string, length int64) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fsync(fd int) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFsync)), 1, uintptr(fd), 0, 0, 0, 0, 0) if e1 != 0 { @@ -1493,6 +1707,8 @@ func Fsync(fd int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Ftruncate(fd int, length int64) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFtruncate)), 2, uintptr(fd), uintptr(length), 0, 0, 0, 0) if e1 != 0 { @@ -1501,12 +1717,16 @@ func Ftruncate(fd int, length int64) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Umask(mask int) (oldmask int) { r0, _, _ := sysvicall6(uintptr(unsafe.Pointer(&procUmask)), 1, uintptr(mask), 0, 0, 0, 0, 0) oldmask = int(r0) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Uname(buf *Utsname) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procUname)), 1, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0) if e1 != 0 { @@ -1515,6 +1735,8 @@ func Uname(buf *Utsname) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) @@ -1528,6 +1750,8 @@ func Unmount(target string, flags int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1541,6 +1765,8 @@ func Unlink(path string) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1554,6 +1780,8 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUstat)), 2, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0, 0, 0, 0) if e1 != 0 { @@ -1562,6 +1790,8 @@ func Ustat(dev int, ubuf *Ustat_t) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -1575,6 +1805,8 @@ func Utime(path string, buf *Utimbuf) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_bind)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) if e1 != 0 { @@ -1583,6 +1815,8 @@ func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_connect)), 3, uintptr(s), uintptr(addr), uintptr(addrlen), 0, 0, 0) if e1 != 0 { @@ -1591,6 +1825,8 @@ func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmmap)), 6, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) @@ -1600,6 +1836,8 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procmunmap)), 2, uintptr(addr), uintptr(length), 0, 0, 0, 0) if e1 != 0 { @@ -1608,6 +1846,8 @@ func munmap(addr uintptr, length uintptr) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsendfile)), 4, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) @@ -1617,6 +1857,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 *byte if len(buf) > 0 { @@ -1629,6 +1871,8 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socket)), 3, uintptr(domain), uintptr(typ), uintptr(proto), 0, 0, 0) fd = int(r0) @@ -1638,6 +1882,8 @@ func socket(domain int, typ int, proto int) (fd int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&proc__xnet_socketpair)), 4, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { @@ -1646,6 +1892,8 @@ func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func write(fd int, p []byte) (n int, err error) { var _p0 *byte if len(p) > 0 { @@ -1659,6 +1907,8 @@ func write(fd int, p []byte) (n int, err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_getsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { @@ -1667,6 +1917,8 @@ func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procgetpeername)), 3, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0) if e1 != 0 { @@ -1675,6 +1927,8 @@ func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procsetsockopt)), 5, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { @@ -1683,6 +1937,8 @@ func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) return } +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 *byte if len(p) > 0 { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go index 90c95c2c75cd4..d014451c9d8e9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go @@ -254,4 +254,17 @@ var sysctlMib = []mibentry{ {"net.mpls.ttl", []_C_int{4, 33, 2}}, {"net.pflow.stats", []_C_int{4, 34, 1}}, {"net.pipex.enable", []_C_int{4, 35, 1}}, + {"vm.anonmin", []_C_int{2, 7}}, + {"vm.loadavg", []_C_int{2, 2}}, + {"vm.maxslp", []_C_int{2, 10}}, + {"vm.nkmempages", []_C_int{2, 6}}, + {"vm.psstrings", []_C_int{2, 3}}, + {"vm.swapencrypt.enable", []_C_int{2, 5, 0}}, + {"vm.swapencrypt.keyscreated", []_C_int{2, 5, 1}}, + {"vm.swapencrypt.keysdeleted", []_C_int{2, 5, 2}}, + {"vm.uspace", []_C_int{2, 11}}, + {"vm.uvmexp", []_C_int{2, 4}}, + {"vm.vmmeter", []_C_int{2, 1}}, + {"vm.vnodemin", []_C_int{2, 9}}, + {"vm.vtextmin", []_C_int{2, 8}}, } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go index b64a8122ce4c3..1ab8780c3b0b3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go @@ -7,347 +7,397 @@ package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int - SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ - SYS_FORK = 2 // { int fork(void); } - SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ - SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ - SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } - SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ - SYS_LINK = 9 // { int link(char *path, char *link); } - SYS_UNLINK = 10 // { int unlink(char *path); } - SYS_CHDIR = 12 // { int chdir(char *path); } - SYS_FCHDIR = 13 // { int fchdir(int fd); } - SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } - SYS_CHMOD = 15 // { int chmod(char *path, int mode); } - SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } - SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ - SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, \ - SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } - SYS_SETUID = 23 // { int setuid(uid_t uid); } - SYS_GETUID = 24 // { uid_t getuid(void); } - SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ - SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ - SYS_ACCEPT = 30 // { int accept(int s, \ - SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ - SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ - SYS_ACCESS = 33 // { int access(char *path, int amode); } - SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } - SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } - SYS_SYNC = 36 // { int sync(void); } - SYS_KILL = 37 // { int kill(int pid, int signum); } - SYS_GETPPID = 39 // { pid_t getppid(void); } - SYS_DUP = 41 // { int dup(u_int fd); } - SYS_PIPE = 42 // { int pipe(void); } - SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ - SYS_GETGID = 47 // { gid_t getgid(void); } - SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ - SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } - SYS_ACCT = 51 // { int acct(char *path); } - SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ - SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ - SYS_REBOOT = 55 // { int reboot(int opt); } - SYS_REVOKE = 56 // { int revoke(char *path); } - SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } - SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ - SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ - SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ - SYS_CHROOT = 61 // { int chroot(char *path); } - SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ - SYS_VFORK = 66 // { int vfork(void); } - SYS_SBRK = 69 // { int sbrk(int incr); } - SYS_SSTK = 70 // { int sstk(int incr); } - SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ - SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ - SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ - SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ - SYS_GETPGRP = 81 // { int getpgrp(void); } - SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ - SYS_SWAPON = 85 // { int swapon(char *name); } - SYS_GETITIMER = 86 // { int getitimer(u_int which, \ - SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } - SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } - SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ - SYS_FSYNC = 95 // { int fsync(int fd); } - SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ - SYS_SOCKET = 97 // { int socket(int domain, int type, \ - SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ - SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } - SYS_BIND = 104 // { int bind(int s, caddr_t name, \ - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ - SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ - SYS_GETRUSAGE = 117 // { int getrusage(int who, \ - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ - SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ - SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } - SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } - SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } - SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } - SYS_RENAME = 128 // { int rename(char *from, char *to); } - SYS_FLOCK = 131 // { int flock(int fd, int how); } - SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ - SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ - SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } - SYS_RMDIR = 137 // { int rmdir(char *path); } - SYS_UTIMES = 138 // { int utimes(char *path, \ - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ - SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ - SYS_LGETFH = 160 // { int lgetfh(char *fname, \ - SYS_GETFH = 161 // { int getfh(char *fname, \ - SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ - SYS_SETFIB = 175 // { int setfib(int fibnum); } - SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } - SYS_SETGID = 181 // { int setgid(gid_t gid); } - SYS_SETEGID = 182 // { int setegid(gid_t egid); } - SYS_SETEUID = 183 // { int seteuid(uid_t euid); } - SYS_STAT = 188 // { int stat(char *path, struct stat *ub); } - SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); } - SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } - SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } - SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ - SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } - SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } - SYS_UNDELETE = 205 // { int undelete(char *path); } - SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } - SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ - SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } - SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ - SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ - SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ - SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } - SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ - SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ - SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ - SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } - SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ - SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ - SYS_ISSETUGID = 253 // { int issetugid(void); } - SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } - SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ - SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } - SYS_LUTIMES = 276 // { int lutimes(char *path, \ - SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } - SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } - SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } - SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ - SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ - SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ - SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ - SYS_MODNEXT = 300 // { int modnext(int modid); } - SYS_MODSTAT = 301 // { int modstat(int modid, \ - SYS_MODFNEXT = 302 // { int modfnext(int modid); } - SYS_MODFIND = 303 // { int modfind(const char *name); } - SYS_KLDLOAD = 304 // { int kldload(const char *file); } - SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } - SYS_KLDFIND = 306 // { int kldfind(const char *file); } - SYS_KLDNEXT = 307 // { int kldnext(int fileid); } - SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ - SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } - SYS_GETSID = 310 // { int getsid(pid_t pid); } - SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ - SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ - SYS_YIELD = 321 // { int yield(void); } - SYS_MLOCKALL = 324 // { int mlockall(int how); } - SYS_MUNLOCKALL = 325 // { int munlockall(void); } - SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } - SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ - SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ - SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ - SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } - SYS_SCHED_YIELD = 331 // { int sched_yield (void); } - SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } - SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } - SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ - SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } - SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ - SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ - SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } - SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ - SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ - SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ - SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ - SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ - SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ - SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ - SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ - SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ - SYS___SETUGID = 374 // { int __setugid(int flag); } - SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } - SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ - SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } - SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } - SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ - SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ - SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ - SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ - SYS_KENV = 390 // { int kenv(int what, const char *name, \ - SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ - SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ - SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ - SYS_STATFS = 396 // { int statfs(char *path, \ - SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ - SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ - SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ - SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ - SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ - SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ - SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ - SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ - SYS_SIGACTION = 416 // { int sigaction(int sig, \ - SYS_SIGRETURN = 417 // { int sigreturn( \ - SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } - SYS_SETCONTEXT = 422 // { int setcontext( \ - SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ - SYS_SWAPOFF = 424 // { int swapoff(const char *name); } - SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ - SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ - SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ - SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ - SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ - SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ - SYS_THR_EXIT = 431 // { void thr_exit(long *state); } - SYS_THR_SELF = 432 // { int thr_self(long *id); } - SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } - SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } - SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } - SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } - SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ - SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ - SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ - SYS_THR_SUSPEND = 442 // { int thr_suspend( \ - SYS_THR_WAKE = 443 // { int thr_wake(long id); } - SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } - SYS_AUDIT = 445 // { int audit(const void *record, \ - SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ - SYS_GETAUID = 447 // { int getauid(uid_t *auid); } - SYS_SETAUID = 448 // { int setauid(uid_t *auid); } - SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } - SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } - SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ - SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ - SYS_AUDITCTL = 453 // { int auditctl(char *path); } - SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ - SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ - SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } - SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } - SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } - SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ - SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ - SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ - SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ - SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ - SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } - SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } - SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } - SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ - SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } - SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } - SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ - SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ - SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ - SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ - SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ - SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ - SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ - SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ - SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ - SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ - SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ - SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } - SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ - SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ - SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ - SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ - SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } - SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } - SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ - SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ - SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } - SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } - SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } - SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ - SYS_CAP_ENTER = 516 // { int cap_enter(void); } - SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } - SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } - SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } - SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } - SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ - SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ - SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } - SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ - SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ - SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ - SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ - SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ - SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ - SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ - SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ - SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ - SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ - SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ - SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ - SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ - SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ - SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ - SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ - SYS_ACCEPT4 = 541 // { int accept4(int s, \ - SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } - SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ - SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ - SYS_FUTIMENS = 546 // { int futimens(int fd, \ - SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ + SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_FORK = 2 // { int fork(void); } + SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } + SYS_CLOSE = 6 // { int close(int fd); } + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_LINK = 9 // { int link(char *path, char *link); } + SYS_UNLINK = 10 // { int unlink(char *path); } + SYS_CHDIR = 12 // { int chdir(char *path); } + SYS_FCHDIR = 13 // { int fchdir(int fd); } + SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } + SYS_CHMOD = 15 // { int chmod(char *path, int mode); } + SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } + SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_GETPID = 20 // { pid_t getpid(void); } + SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } + SYS_SETUID = 23 // { int setuid(uid_t uid); } + SYS_GETUID = 24 // { uid_t getuid(void); } + SYS_GETEUID = 25 // { uid_t geteuid(void); } + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ + SYS_ACCEPT = 30 // { int accept(int s, \ + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_ACCESS = 33 // { int access(char *path, int amode); } + SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } + SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } + SYS_SYNC = 36 // { int sync(void); } + SYS_KILL = 37 // { int kill(int pid, int signum); } + SYS_GETPPID = 39 // { pid_t getppid(void); } + SYS_DUP = 41 // { int dup(u_int fd); } + SYS_PIPE = 42 // { int pipe(void); } + SYS_GETEGID = 43 // { gid_t getegid(void); } + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_GETGID = 47 // { gid_t getgid(void); } + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } + SYS_ACCT = 51 // { int acct(char *path); } + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_REBOOT = 55 // { int reboot(int opt); } + SYS_REVOKE = 56 // { int revoke(char *path); } + SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_CHROOT = 61 // { int chroot(char *path); } + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_VFORK = 66 // { int vfork(void); } + SYS_SBRK = 69 // { int sbrk(int incr); } + SYS_SSTK = 70 // { int sstk(int incr); } + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_GETPGRP = 81 // { int getpgrp(void); } + SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SWAPON = 85 // { int swapon(char *name); } + SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } + SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } + SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_FSYNC = 95 // { int fsync(int fd); } + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ + SYS_SOCKET = 97 // { int socket(int domain, int type, \ + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } + SYS_BIND = 104 // { int bind(int s, caddr_t name, \ + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_LISTEN = 106 // { int listen(int s, int backlog); } + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ + SYS_GETRUSAGE = 117 // { int getrusage(int who, \ + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } + SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } + SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } + SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } + SYS_RENAME = 128 // { int rename(char *from, char *to); } + SYS_FLOCK = 131 // { int flock(int fd, int how); } + SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } + SYS_RMDIR = 137 // { int rmdir(char *path); } + SYS_UTIMES = 138 // { int utimes(char *path, \ + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_SETSID = 147 // { int setsid(void); } + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } + SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } + SYS_LGETFH = 160 // { int lgetfh(char *fname, \ + SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ + SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ + SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ + SYS_SETFIB = 175 // { int setfib(int fibnum); } + SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } + SYS_SETGID = 181 // { int setgid(gid_t gid); } + SYS_SETEGID = 182 // { int setegid(gid_t egid); } + SYS_SETEUID = 183 // { int seteuid(uid_t euid); } + SYS_STAT = 188 // { int stat(char *path, struct stat *ub); } + SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); } + SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } + SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } + SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ + SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ + SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ + SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ + SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } + SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } + SYS_UNDELETE = 205 // { int undelete(char *path); } + SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } + SYS_GETPGID = 207 // { int getpgid(pid_t pid); } + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ + SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_RFORK = 251 // { int rfork(int flags); } + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_ISSETUGID = 253 // { int issetugid(void); } + SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } + SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } + SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } + SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } + SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } + SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_MODNEXT = 300 // { int modnext(int modid); } + SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODFNEXT = 302 // { int modfnext(int modid); } + SYS_MODFIND = 303 // { int modfind(const char *name); } + SYS_KLDLOAD = 304 // { int kldload(const char *file); } + SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } + SYS_KLDFIND = 306 // { int kldfind(const char *file); } + SYS_KLDNEXT = 307 // { int kldnext(int fileid); } + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } + SYS_GETSID = 310 // { int getsid(pid_t pid); } + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } + SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } + SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } + SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } + SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, \ + SYS_YIELD = 321 // { int yield(void); } + SYS_MLOCKALL = 324 // { int mlockall(int how); } + SYS_MUNLOCKALL = 325 // { int munlockall(void); } + SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } + SYS_SCHED_YIELD = 331 // { int sched_yield (void); } + SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } + SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_JAIL = 338 // { int jail(struct jail *jail); } + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } + SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ + SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( \ + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_KQUEUE = 362 // { int kqueue(void); } + SYS_KEVENT = 363 // { int kevent(int fd, \ + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS___SETUGID = 374 // { int __setugid(int flag); } + SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } + SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ + SYS_KENV = 390 // { int kenv(int what, const char *name, \ + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ + SYS_STATFS = 396 // { int statfs(char *path, \ + SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } + SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } + SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } + SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } + SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } + SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ + SYS_SIGACTION = 416 // { int sigaction(int sig, \ + SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } + SYS_SETCONTEXT = 422 // { int setcontext( \ + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SWAPOFF = 424 // { int swapoff(const char *name); } + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS_THR_EXIT = 431 // { void thr_exit(long *state); } + SYS_THR_SELF = 432 // { int thr_self(long *id); } + SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } + SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } + SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } + SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ + SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_THR_WAKE = 443 // { int thr_wake(long id); } + SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } + SYS_AUDIT = 445 // { int audit(const void *record, \ + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_GETAUID = 447 // { int getauid(uid_t *auid); } + SYS_SETAUID = 448 // { int setauid(uid_t *auid); } + SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } + SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_AUDITCTL = 453 // { int auditctl(char *path); } + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } + SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } + SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } + SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } + SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } + SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } + SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } + SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } + SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } + SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } + SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS_CAP_ENTER = 516 // { int cap_enter(void); } + SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } + SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } + SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } + SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ + SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } + SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ + SYS_FUTIMENS = 546 // { int futimens(int fd, \ + SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go index 81722ac9f3bdd..b66f900dff768 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go @@ -7,347 +7,397 @@ package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int - SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ - SYS_FORK = 2 // { int fork(void); } - SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ - SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ - SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } - SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ - SYS_LINK = 9 // { int link(char *path, char *link); } - SYS_UNLINK = 10 // { int unlink(char *path); } - SYS_CHDIR = 12 // { int chdir(char *path); } - SYS_FCHDIR = 13 // { int fchdir(int fd); } - SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } - SYS_CHMOD = 15 // { int chmod(char *path, int mode); } - SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } - SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ - SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, \ - SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } - SYS_SETUID = 23 // { int setuid(uid_t uid); } - SYS_GETUID = 24 // { uid_t getuid(void); } - SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ - SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ - SYS_ACCEPT = 30 // { int accept(int s, \ - SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ - SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ - SYS_ACCESS = 33 // { int access(char *path, int amode); } - SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } - SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } - SYS_SYNC = 36 // { int sync(void); } - SYS_KILL = 37 // { int kill(int pid, int signum); } - SYS_GETPPID = 39 // { pid_t getppid(void); } - SYS_DUP = 41 // { int dup(u_int fd); } - SYS_PIPE = 42 // { int pipe(void); } - SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ - SYS_GETGID = 47 // { gid_t getgid(void); } - SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ - SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } - SYS_ACCT = 51 // { int acct(char *path); } - SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ - SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ - SYS_REBOOT = 55 // { int reboot(int opt); } - SYS_REVOKE = 56 // { int revoke(char *path); } - SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } - SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ - SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ - SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ - SYS_CHROOT = 61 // { int chroot(char *path); } - SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ - SYS_VFORK = 66 // { int vfork(void); } - SYS_SBRK = 69 // { int sbrk(int incr); } - SYS_SSTK = 70 // { int sstk(int incr); } - SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ - SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ - SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ - SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ - SYS_GETPGRP = 81 // { int getpgrp(void); } - SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ - SYS_SWAPON = 85 // { int swapon(char *name); } - SYS_GETITIMER = 86 // { int getitimer(u_int which, \ - SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } - SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } - SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ - SYS_FSYNC = 95 // { int fsync(int fd); } - SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ - SYS_SOCKET = 97 // { int socket(int domain, int type, \ - SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ - SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } - SYS_BIND = 104 // { int bind(int s, caddr_t name, \ - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ - SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ - SYS_GETRUSAGE = 117 // { int getrusage(int who, \ - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ - SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ - SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } - SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } - SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } - SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } - SYS_RENAME = 128 // { int rename(char *from, char *to); } - SYS_FLOCK = 131 // { int flock(int fd, int how); } - SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ - SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ - SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } - SYS_RMDIR = 137 // { int rmdir(char *path); } - SYS_UTIMES = 138 // { int utimes(char *path, \ - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ - SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ - SYS_LGETFH = 160 // { int lgetfh(char *fname, \ - SYS_GETFH = 161 // { int getfh(char *fname, \ - SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ - SYS_SETFIB = 175 // { int setfib(int fibnum); } - SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } - SYS_SETGID = 181 // { int setgid(gid_t gid); } - SYS_SETEGID = 182 // { int setegid(gid_t egid); } - SYS_SETEUID = 183 // { int seteuid(uid_t euid); } - SYS_STAT = 188 // { int stat(char *path, struct stat *ub); } - SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); } - SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } - SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } - SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ - SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } - SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } - SYS_UNDELETE = 205 // { int undelete(char *path); } - SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } - SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ - SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } - SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ - SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ - SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ - SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } - SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ - SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ - SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ - SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } - SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ - SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ - SYS_ISSETUGID = 253 // { int issetugid(void); } - SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } - SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ - SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } - SYS_LUTIMES = 276 // { int lutimes(char *path, \ - SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } - SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } - SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } - SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ - SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ - SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ - SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ - SYS_MODNEXT = 300 // { int modnext(int modid); } - SYS_MODSTAT = 301 // { int modstat(int modid, \ - SYS_MODFNEXT = 302 // { int modfnext(int modid); } - SYS_MODFIND = 303 // { int modfind(const char *name); } - SYS_KLDLOAD = 304 // { int kldload(const char *file); } - SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } - SYS_KLDFIND = 306 // { int kldfind(const char *file); } - SYS_KLDNEXT = 307 // { int kldnext(int fileid); } - SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ - SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } - SYS_GETSID = 310 // { int getsid(pid_t pid); } - SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ - SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ - SYS_YIELD = 321 // { int yield(void); } - SYS_MLOCKALL = 324 // { int mlockall(int how); } - SYS_MUNLOCKALL = 325 // { int munlockall(void); } - SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } - SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ - SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ - SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ - SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } - SYS_SCHED_YIELD = 331 // { int sched_yield (void); } - SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } - SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } - SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ - SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } - SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ - SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ - SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } - SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ - SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ - SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ - SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ - SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ - SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ - SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ - SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ - SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ - SYS___SETUGID = 374 // { int __setugid(int flag); } - SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } - SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ - SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } - SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } - SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ - SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ - SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ - SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ - SYS_KENV = 390 // { int kenv(int what, const char *name, \ - SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ - SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ - SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ - SYS_STATFS = 396 // { int statfs(char *path, \ - SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ - SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ - SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ - SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ - SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ - SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ - SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ - SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ - SYS_SIGACTION = 416 // { int sigaction(int sig, \ - SYS_SIGRETURN = 417 // { int sigreturn( \ - SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } - SYS_SETCONTEXT = 422 // { int setcontext( \ - SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ - SYS_SWAPOFF = 424 // { int swapoff(const char *name); } - SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ - SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ - SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ - SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ - SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ - SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ - SYS_THR_EXIT = 431 // { void thr_exit(long *state); } - SYS_THR_SELF = 432 // { int thr_self(long *id); } - SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } - SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } - SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } - SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } - SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ - SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ - SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ - SYS_THR_SUSPEND = 442 // { int thr_suspend( \ - SYS_THR_WAKE = 443 // { int thr_wake(long id); } - SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } - SYS_AUDIT = 445 // { int audit(const void *record, \ - SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ - SYS_GETAUID = 447 // { int getauid(uid_t *auid); } - SYS_SETAUID = 448 // { int setauid(uid_t *auid); } - SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } - SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } - SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ - SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ - SYS_AUDITCTL = 453 // { int auditctl(char *path); } - SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ - SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ - SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } - SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } - SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } - SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ - SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ - SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ - SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ - SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ - SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } - SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } - SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } - SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ - SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } - SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } - SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ - SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ - SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ - SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ - SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ - SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ - SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ - SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ - SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ - SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ - SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ - SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } - SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ - SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ - SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ - SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ - SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } - SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } - SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ - SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ - SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } - SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } - SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } - SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ - SYS_CAP_ENTER = 516 // { int cap_enter(void); } - SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } - SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } - SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } - SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } - SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ - SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ - SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } - SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ - SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ - SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ - SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ - SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ - SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ - SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ - SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ - SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ - SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ - SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ - SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ - SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ - SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ - SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ - SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ - SYS_ACCEPT4 = 541 // { int accept4(int s, \ - SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } - SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ - SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ - SYS_FUTIMENS = 546 // { int futimens(int fd, \ - SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ + SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_FORK = 2 // { int fork(void); } + SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } + SYS_CLOSE = 6 // { int close(int fd); } + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_LINK = 9 // { int link(char *path, char *link); } + SYS_UNLINK = 10 // { int unlink(char *path); } + SYS_CHDIR = 12 // { int chdir(char *path); } + SYS_FCHDIR = 13 // { int fchdir(int fd); } + SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } + SYS_CHMOD = 15 // { int chmod(char *path, int mode); } + SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } + SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_GETPID = 20 // { pid_t getpid(void); } + SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } + SYS_SETUID = 23 // { int setuid(uid_t uid); } + SYS_GETUID = 24 // { uid_t getuid(void); } + SYS_GETEUID = 25 // { uid_t geteuid(void); } + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ + SYS_ACCEPT = 30 // { int accept(int s, \ + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_ACCESS = 33 // { int access(char *path, int amode); } + SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } + SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } + SYS_SYNC = 36 // { int sync(void); } + SYS_KILL = 37 // { int kill(int pid, int signum); } + SYS_GETPPID = 39 // { pid_t getppid(void); } + SYS_DUP = 41 // { int dup(u_int fd); } + SYS_PIPE = 42 // { int pipe(void); } + SYS_GETEGID = 43 // { gid_t getegid(void); } + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_GETGID = 47 // { gid_t getgid(void); } + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } + SYS_ACCT = 51 // { int acct(char *path); } + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_REBOOT = 55 // { int reboot(int opt); } + SYS_REVOKE = 56 // { int revoke(char *path); } + SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_CHROOT = 61 // { int chroot(char *path); } + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_VFORK = 66 // { int vfork(void); } + SYS_SBRK = 69 // { int sbrk(int incr); } + SYS_SSTK = 70 // { int sstk(int incr); } + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_GETPGRP = 81 // { int getpgrp(void); } + SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SWAPON = 85 // { int swapon(char *name); } + SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } + SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } + SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_FSYNC = 95 // { int fsync(int fd); } + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ + SYS_SOCKET = 97 // { int socket(int domain, int type, \ + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } + SYS_BIND = 104 // { int bind(int s, caddr_t name, \ + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_LISTEN = 106 // { int listen(int s, int backlog); } + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ + SYS_GETRUSAGE = 117 // { int getrusage(int who, \ + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } + SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } + SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } + SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } + SYS_RENAME = 128 // { int rename(char *from, char *to); } + SYS_FLOCK = 131 // { int flock(int fd, int how); } + SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } + SYS_RMDIR = 137 // { int rmdir(char *path); } + SYS_UTIMES = 138 // { int utimes(char *path, \ + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_SETSID = 147 // { int setsid(void); } + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } + SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } + SYS_LGETFH = 160 // { int lgetfh(char *fname, \ + SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ + SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ + SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ + SYS_SETFIB = 175 // { int setfib(int fibnum); } + SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } + SYS_SETGID = 181 // { int setgid(gid_t gid); } + SYS_SETEGID = 182 // { int setegid(gid_t egid); } + SYS_SETEUID = 183 // { int seteuid(uid_t euid); } + SYS_STAT = 188 // { int stat(char *path, struct stat *ub); } + SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); } + SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } + SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } + SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ + SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ + SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ + SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ + SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } + SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } + SYS_UNDELETE = 205 // { int undelete(char *path); } + SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } + SYS_GETPGID = 207 // { int getpgid(pid_t pid); } + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ + SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_RFORK = 251 // { int rfork(int flags); } + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_ISSETUGID = 253 // { int issetugid(void); } + SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } + SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } + SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } + SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } + SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } + SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_MODNEXT = 300 // { int modnext(int modid); } + SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODFNEXT = 302 // { int modfnext(int modid); } + SYS_MODFIND = 303 // { int modfind(const char *name); } + SYS_KLDLOAD = 304 // { int kldload(const char *file); } + SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } + SYS_KLDFIND = 306 // { int kldfind(const char *file); } + SYS_KLDNEXT = 307 // { int kldnext(int fileid); } + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } + SYS_GETSID = 310 // { int getsid(pid_t pid); } + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } + SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } + SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } + SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } + SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, \ + SYS_YIELD = 321 // { int yield(void); } + SYS_MLOCKALL = 324 // { int mlockall(int how); } + SYS_MUNLOCKALL = 325 // { int munlockall(void); } + SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } + SYS_SCHED_YIELD = 331 // { int sched_yield (void); } + SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } + SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_JAIL = 338 // { int jail(struct jail *jail); } + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } + SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ + SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( \ + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_KQUEUE = 362 // { int kqueue(void); } + SYS_KEVENT = 363 // { int kevent(int fd, \ + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS___SETUGID = 374 // { int __setugid(int flag); } + SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } + SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ + SYS_KENV = 390 // { int kenv(int what, const char *name, \ + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ + SYS_STATFS = 396 // { int statfs(char *path, \ + SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } + SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } + SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } + SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } + SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } + SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ + SYS_SIGACTION = 416 // { int sigaction(int sig, \ + SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } + SYS_SETCONTEXT = 422 // { int setcontext( \ + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SWAPOFF = 424 // { int swapoff(const char *name); } + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS_THR_EXIT = 431 // { void thr_exit(long *state); } + SYS_THR_SELF = 432 // { int thr_self(long *id); } + SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } + SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } + SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } + SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ + SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_THR_WAKE = 443 // { int thr_wake(long id); } + SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } + SYS_AUDIT = 445 // { int audit(const void *record, \ + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_GETAUID = 447 // { int getauid(uid_t *auid); } + SYS_SETAUID = 448 // { int setauid(uid_t *auid); } + SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } + SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_AUDITCTL = 453 // { int auditctl(char *path); } + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } + SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } + SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } + SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } + SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } + SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } + SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } + SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } + SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } + SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } + SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS_CAP_ENTER = 516 // { int cap_enter(void); } + SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } + SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } + SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } + SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ + SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } + SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ + SYS_FUTIMENS = 546 // { int futimens(int fd, \ + SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go index 448831418165b..d61941ba7e002 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go @@ -7,347 +7,397 @@ package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int - SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ - SYS_FORK = 2 // { int fork(void); } - SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ - SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ - SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } - SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ - SYS_LINK = 9 // { int link(char *path, char *link); } - SYS_UNLINK = 10 // { int unlink(char *path); } - SYS_CHDIR = 12 // { int chdir(char *path); } - SYS_FCHDIR = 13 // { int fchdir(int fd); } - SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } - SYS_CHMOD = 15 // { int chmod(char *path, int mode); } - SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } - SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ - SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, \ - SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } - SYS_SETUID = 23 // { int setuid(uid_t uid); } - SYS_GETUID = 24 // { uid_t getuid(void); } - SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ - SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ - SYS_ACCEPT = 30 // { int accept(int s, \ - SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ - SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ - SYS_ACCESS = 33 // { int access(char *path, int amode); } - SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } - SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } - SYS_SYNC = 36 // { int sync(void); } - SYS_KILL = 37 // { int kill(int pid, int signum); } - SYS_GETPPID = 39 // { pid_t getppid(void); } - SYS_DUP = 41 // { int dup(u_int fd); } - SYS_PIPE = 42 // { int pipe(void); } - SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ - SYS_GETGID = 47 // { gid_t getgid(void); } - SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ - SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } - SYS_ACCT = 51 // { int acct(char *path); } - SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ - SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ - SYS_REBOOT = 55 // { int reboot(int opt); } - SYS_REVOKE = 56 // { int revoke(char *path); } - SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } - SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ - SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ - SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ - SYS_CHROOT = 61 // { int chroot(char *path); } - SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ - SYS_VFORK = 66 // { int vfork(void); } - SYS_SBRK = 69 // { int sbrk(int incr); } - SYS_SSTK = 70 // { int sstk(int incr); } - SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ - SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ - SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ - SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ - SYS_GETPGRP = 81 // { int getpgrp(void); } - SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ - SYS_SWAPON = 85 // { int swapon(char *name); } - SYS_GETITIMER = 86 // { int getitimer(u_int which, \ - SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } - SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } - SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ - SYS_FSYNC = 95 // { int fsync(int fd); } - SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ - SYS_SOCKET = 97 // { int socket(int domain, int type, \ - SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ - SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } - SYS_BIND = 104 // { int bind(int s, caddr_t name, \ - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ - SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ - SYS_GETRUSAGE = 117 // { int getrusage(int who, \ - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ - SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ - SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } - SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } - SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } - SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } - SYS_RENAME = 128 // { int rename(char *from, char *to); } - SYS_FLOCK = 131 // { int flock(int fd, int how); } - SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ - SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ - SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } - SYS_RMDIR = 137 // { int rmdir(char *path); } - SYS_UTIMES = 138 // { int utimes(char *path, \ - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ - SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ - SYS_LGETFH = 160 // { int lgetfh(char *fname, \ - SYS_GETFH = 161 // { int getfh(char *fname, \ - SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ - SYS_SETFIB = 175 // { int setfib(int fibnum); } - SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } - SYS_SETGID = 181 // { int setgid(gid_t gid); } - SYS_SETEGID = 182 // { int setegid(gid_t egid); } - SYS_SETEUID = 183 // { int seteuid(uid_t euid); } - SYS_STAT = 188 // { int stat(char *path, struct stat *ub); } - SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); } - SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } - SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } - SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ - SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } - SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } - SYS_UNDELETE = 205 // { int undelete(char *path); } - SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } - SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ - SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } - SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ - SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ - SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ - SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } - SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ - SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ - SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ - SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } - SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ - SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ - SYS_ISSETUGID = 253 // { int issetugid(void); } - SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } - SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ - SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } - SYS_LUTIMES = 276 // { int lutimes(char *path, \ - SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } - SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } - SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } - SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ - SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ - SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ - SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ - SYS_MODNEXT = 300 // { int modnext(int modid); } - SYS_MODSTAT = 301 // { int modstat(int modid, \ - SYS_MODFNEXT = 302 // { int modfnext(int modid); } - SYS_MODFIND = 303 // { int modfind(const char *name); } - SYS_KLDLOAD = 304 // { int kldload(const char *file); } - SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } - SYS_KLDFIND = 306 // { int kldfind(const char *file); } - SYS_KLDNEXT = 307 // { int kldnext(int fileid); } - SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ - SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } - SYS_GETSID = 310 // { int getsid(pid_t pid); } - SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ - SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ - SYS_YIELD = 321 // { int yield(void); } - SYS_MLOCKALL = 324 // { int mlockall(int how); } - SYS_MUNLOCKALL = 325 // { int munlockall(void); } - SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } - SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ - SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ - SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ - SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } - SYS_SCHED_YIELD = 331 // { int sched_yield (void); } - SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } - SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } - SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ - SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } - SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ - SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ - SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } - SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ - SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ - SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ - SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ - SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ - SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ - SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ - SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ - SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ - SYS___SETUGID = 374 // { int __setugid(int flag); } - SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } - SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ - SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } - SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } - SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ - SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ - SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ - SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ - SYS_KENV = 390 // { int kenv(int what, const char *name, \ - SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ - SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ - SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ - SYS_STATFS = 396 // { int statfs(char *path, \ - SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ - SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ - SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ - SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ - SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ - SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ - SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ - SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ - SYS_SIGACTION = 416 // { int sigaction(int sig, \ - SYS_SIGRETURN = 417 // { int sigreturn( \ - SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } - SYS_SETCONTEXT = 422 // { int setcontext( \ - SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ - SYS_SWAPOFF = 424 // { int swapoff(const char *name); } - SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ - SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ - SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ - SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ - SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ - SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ - SYS_THR_EXIT = 431 // { void thr_exit(long *state); } - SYS_THR_SELF = 432 // { int thr_self(long *id); } - SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } - SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } - SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } - SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } - SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ - SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ - SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ - SYS_THR_SUSPEND = 442 // { int thr_suspend( \ - SYS_THR_WAKE = 443 // { int thr_wake(long id); } - SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } - SYS_AUDIT = 445 // { int audit(const void *record, \ - SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ - SYS_GETAUID = 447 // { int getauid(uid_t *auid); } - SYS_SETAUID = 448 // { int setauid(uid_t *auid); } - SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } - SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } - SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ - SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ - SYS_AUDITCTL = 453 // { int auditctl(char *path); } - SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ - SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ - SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } - SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } - SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } - SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ - SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ - SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ - SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ - SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ - SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } - SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } - SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } - SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ - SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } - SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } - SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ - SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ - SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ - SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ - SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ - SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ - SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ - SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ - SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ - SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ - SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ - SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } - SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ - SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ - SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ - SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ - SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } - SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } - SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ - SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ - SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } - SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } - SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } - SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ - SYS_CAP_ENTER = 516 // { int cap_enter(void); } - SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } - SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } - SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } - SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } - SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ - SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ - SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } - SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ - SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ - SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ - SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ - SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ - SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ - SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ - SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ - SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ - SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ - SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ - SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ - SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ - SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ - SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ - SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ - SYS_ACCEPT4 = 541 // { int accept4(int s, \ - SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } - SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ - SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ - SYS_FUTIMENS = 546 // { int futimens(int fd, \ - SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ + SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_FORK = 2 // { int fork(void); } + SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } + SYS_CLOSE = 6 // { int close(int fd); } + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_LINK = 9 // { int link(char *path, char *link); } + SYS_UNLINK = 10 // { int unlink(char *path); } + SYS_CHDIR = 12 // { int chdir(char *path); } + SYS_FCHDIR = 13 // { int fchdir(int fd); } + SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } + SYS_CHMOD = 15 // { int chmod(char *path, int mode); } + SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } + SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_GETPID = 20 // { pid_t getpid(void); } + SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } + SYS_SETUID = 23 // { int setuid(uid_t uid); } + SYS_GETUID = 24 // { uid_t getuid(void); } + SYS_GETEUID = 25 // { uid_t geteuid(void); } + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ + SYS_ACCEPT = 30 // { int accept(int s, \ + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_ACCESS = 33 // { int access(char *path, int amode); } + SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } + SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } + SYS_SYNC = 36 // { int sync(void); } + SYS_KILL = 37 // { int kill(int pid, int signum); } + SYS_GETPPID = 39 // { pid_t getppid(void); } + SYS_DUP = 41 // { int dup(u_int fd); } + SYS_PIPE = 42 // { int pipe(void); } + SYS_GETEGID = 43 // { gid_t getegid(void); } + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_GETGID = 47 // { gid_t getgid(void); } + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } + SYS_ACCT = 51 // { int acct(char *path); } + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_REBOOT = 55 // { int reboot(int opt); } + SYS_REVOKE = 56 // { int revoke(char *path); } + SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_CHROOT = 61 // { int chroot(char *path); } + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_VFORK = 66 // { int vfork(void); } + SYS_SBRK = 69 // { int sbrk(int incr); } + SYS_SSTK = 70 // { int sstk(int incr); } + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_GETPGRP = 81 // { int getpgrp(void); } + SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SWAPON = 85 // { int swapon(char *name); } + SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } + SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } + SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_FSYNC = 95 // { int fsync(int fd); } + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ + SYS_SOCKET = 97 // { int socket(int domain, int type, \ + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } + SYS_BIND = 104 // { int bind(int s, caddr_t name, \ + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_LISTEN = 106 // { int listen(int s, int backlog); } + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ + SYS_GETRUSAGE = 117 // { int getrusage(int who, \ + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } + SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } + SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } + SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } + SYS_RENAME = 128 // { int rename(char *from, char *to); } + SYS_FLOCK = 131 // { int flock(int fd, int how); } + SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } + SYS_RMDIR = 137 // { int rmdir(char *path); } + SYS_UTIMES = 138 // { int utimes(char *path, \ + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_SETSID = 147 // { int setsid(void); } + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } + SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } + SYS_LGETFH = 160 // { int lgetfh(char *fname, \ + SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ + SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ + SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ + SYS_SETFIB = 175 // { int setfib(int fibnum); } + SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } + SYS_SETGID = 181 // { int setgid(gid_t gid); } + SYS_SETEGID = 182 // { int setegid(gid_t egid); } + SYS_SETEUID = 183 // { int seteuid(uid_t euid); } + SYS_STAT = 188 // { int stat(char *path, struct stat *ub); } + SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); } + SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } + SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } + SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ + SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ + SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ + SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ + SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } + SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } + SYS_UNDELETE = 205 // { int undelete(char *path); } + SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } + SYS_GETPGID = 207 // { int getpgid(pid_t pid); } + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ + SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_RFORK = 251 // { int rfork(int flags); } + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_ISSETUGID = 253 // { int issetugid(void); } + SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } + SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } + SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } + SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } + SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } + SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_MODNEXT = 300 // { int modnext(int modid); } + SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODFNEXT = 302 // { int modfnext(int modid); } + SYS_MODFIND = 303 // { int modfind(const char *name); } + SYS_KLDLOAD = 304 // { int kldload(const char *file); } + SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } + SYS_KLDFIND = 306 // { int kldfind(const char *file); } + SYS_KLDNEXT = 307 // { int kldnext(int fileid); } + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } + SYS_GETSID = 310 // { int getsid(pid_t pid); } + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } + SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } + SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } + SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } + SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, \ + SYS_YIELD = 321 // { int yield(void); } + SYS_MLOCKALL = 324 // { int mlockall(int how); } + SYS_MUNLOCKALL = 325 // { int munlockall(void); } + SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } + SYS_SCHED_YIELD = 331 // { int sched_yield (void); } + SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } + SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_JAIL = 338 // { int jail(struct jail *jail); } + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } + SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ + SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( \ + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_KQUEUE = 362 // { int kqueue(void); } + SYS_KEVENT = 363 // { int kevent(int fd, \ + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS___SETUGID = 374 // { int __setugid(int flag); } + SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } + SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ + SYS_KENV = 390 // { int kenv(int what, const char *name, \ + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ + SYS_STATFS = 396 // { int statfs(char *path, \ + SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } + SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } + SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } + SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } + SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } + SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ + SYS_SIGACTION = 416 // { int sigaction(int sig, \ + SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } + SYS_SETCONTEXT = 422 // { int setcontext( \ + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SWAPOFF = 424 // { int swapoff(const char *name); } + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS_THR_EXIT = 431 // { void thr_exit(long *state); } + SYS_THR_SELF = 432 // { int thr_self(long *id); } + SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } + SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } + SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } + SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ + SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_THR_WAKE = 443 // { int thr_wake(long id); } + SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } + SYS_AUDIT = 445 // { int audit(const void *record, \ + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_GETAUID = 447 // { int getauid(uid_t *auid); } + SYS_SETAUID = 448 // { int setauid(uid_t *auid); } + SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } + SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_AUDITCTL = 453 // { int auditctl(char *path); } + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } + SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } + SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } + SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } + SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } + SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } + SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } + SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } + SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } + SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } + SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS_CAP_ENTER = 516 // { int cap_enter(void); } + SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } + SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } + SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } + SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ + SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } + SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ + SYS_FUTIMENS = 546 // { int futimens(int fd, \ + SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 95ab12903ec5d..8d17873de0fe0 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -m32 /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m32 /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,linux @@ -387,4 +387,6 @@ const ( SYS_PKEY_FREE = 382 SYS_STATX = 383 SYS_ARCH_PRCTL = 384 + SYS_IO_PGETEVENTS = 385 + SYS_RSEQ = 386 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index c5dabf2e45185..b3d8ad79d425b 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -m64 /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -m64 /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,linux @@ -339,4 +339,6 @@ const ( SYS_PKEY_ALLOC = 330 SYS_PKEY_FREE = 331 SYS_STATX = 332 + SYS_IO_PGETEVENTS = 333 + SYS_RSEQ = 334 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index ab7fa5fd3939d..e092822fbadd1 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,linux @@ -359,4 +359,6 @@ const ( SYS_PKEY_ALLOC = 395 SYS_PKEY_FREE = 396 SYS_STATX = 397 + SYS_RSEQ = 398 + SYS_IO_PGETEVENTS = 399 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index b1c6b4bd3b39d..3206967896afd 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm64,linux @@ -283,4 +283,6 @@ const ( SYS_PKEY_ALLOC = 289 SYS_PKEY_FREE = 290 SYS_STATX = 291 + SYS_IO_PGETEVENTS = 292 + SYS_RSEQ = 293 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 2e9aa7a3e7ece..6893a5bd055b1 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build mips,linux @@ -372,4 +372,6 @@ const ( SYS_PKEY_ALLOC = 4364 SYS_PKEY_FREE = 4365 SYS_STATX = 4366 + SYS_RSEQ = 4367 + SYS_IO_PGETEVENTS = 4368 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 92827635aae49..40164cacdf5c3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build mips64,linux @@ -332,4 +332,6 @@ const ( SYS_PKEY_ALLOC = 5324 SYS_PKEY_FREE = 5325 SYS_STATX = 5326 + SYS_RSEQ = 5327 + SYS_IO_PGETEVENTS = 5328 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 45bd3fd6c84be..8a909738bc0ef 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build mips64le,linux @@ -332,4 +332,6 @@ const ( SYS_PKEY_ALLOC = 5324 SYS_PKEY_FREE = 5325 SYS_STATX = 5326 + SYS_RSEQ = 5327 + SYS_IO_PGETEVENTS = 5328 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 62ccac4b74212..8d78184224586 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build mipsle,linux @@ -372,4 +372,6 @@ const ( SYS_PKEY_ALLOC = 4364 SYS_PKEY_FREE = 4365 SYS_STATX = 4366 + SYS_RSEQ = 4367 + SYS_IO_PGETEVENTS = 4368 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index 384d49bfa5a5c..ec5bde3d56345 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build ppc64,linux @@ -370,4 +370,6 @@ const ( SYS_PKEY_ALLOC = 384 SYS_PKEY_FREE = 385 SYS_PKEY_MPROTECT = 386 + SYS_RSEQ = 387 + SYS_IO_PGETEVENTS = 388 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 9623248a5ef14..bdbabdbcdb179 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build ppc64le,linux @@ -370,4 +370,6 @@ const ( SYS_PKEY_ALLOC = 384 SYS_PKEY_FREE = 385 SYS_PKEY_MPROTECT = 386 + SYS_RSEQ = 387 + SYS_IO_PGETEVENTS = 388 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go new file mode 100644 index 0000000000000..473c74613f64f --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -0,0 +1,287 @@ +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build riscv64,linux + +package unix + +const ( + SYS_IO_SETUP = 0 + SYS_IO_DESTROY = 1 + SYS_IO_SUBMIT = 2 + SYS_IO_CANCEL = 3 + SYS_IO_GETEVENTS = 4 + SYS_SETXATTR = 5 + SYS_LSETXATTR = 6 + SYS_FSETXATTR = 7 + SYS_GETXATTR = 8 + SYS_LGETXATTR = 9 + SYS_FGETXATTR = 10 + SYS_LISTXATTR = 11 + SYS_LLISTXATTR = 12 + SYS_FLISTXATTR = 13 + SYS_REMOVEXATTR = 14 + SYS_LREMOVEXATTR = 15 + SYS_FREMOVEXATTR = 16 + SYS_GETCWD = 17 + SYS_LOOKUP_DCOOKIE = 18 + SYS_EVENTFD2 = 19 + SYS_EPOLL_CREATE1 = 20 + SYS_EPOLL_CTL = 21 + SYS_EPOLL_PWAIT = 22 + SYS_DUP = 23 + SYS_DUP3 = 24 + SYS_FCNTL = 25 + SYS_INOTIFY_INIT1 = 26 + SYS_INOTIFY_ADD_WATCH = 27 + SYS_INOTIFY_RM_WATCH = 28 + SYS_IOCTL = 29 + SYS_IOPRIO_SET = 30 + SYS_IOPRIO_GET = 31 + SYS_FLOCK = 32 + SYS_MKNODAT = 33 + SYS_MKDIRAT = 34 + SYS_UNLINKAT = 35 + SYS_SYMLINKAT = 36 + SYS_LINKAT = 37 + SYS_UMOUNT2 = 39 + SYS_MOUNT = 40 + SYS_PIVOT_ROOT = 41 + SYS_NFSSERVCTL = 42 + SYS_STATFS = 43 + SYS_FSTATFS = 44 + SYS_TRUNCATE = 45 + SYS_FTRUNCATE = 46 + SYS_FALLOCATE = 47 + SYS_FACCESSAT = 48 + SYS_CHDIR = 49 + SYS_FCHDIR = 50 + SYS_CHROOT = 51 + SYS_FCHMOD = 52 + SYS_FCHMODAT = 53 + SYS_FCHOWNAT = 54 + SYS_FCHOWN = 55 + SYS_OPENAT = 56 + SYS_CLOSE = 57 + SYS_VHANGUP = 58 + SYS_PIPE2 = 59 + SYS_QUOTACTL = 60 + SYS_GETDENTS64 = 61 + SYS_LSEEK = 62 + SYS_READ = 63 + SYS_WRITE = 64 + SYS_READV = 65 + SYS_WRITEV = 66 + SYS_PREAD64 = 67 + SYS_PWRITE64 = 68 + SYS_PREADV = 69 + SYS_PWRITEV = 70 + SYS_SENDFILE = 71 + SYS_PSELECT6 = 72 + SYS_PPOLL = 73 + SYS_SIGNALFD4 = 74 + SYS_VMSPLICE = 75 + SYS_SPLICE = 76 + SYS_TEE = 77 + SYS_READLINKAT = 78 + SYS_FSTATAT = 79 + SYS_FSTAT = 80 + SYS_SYNC = 81 + SYS_FSYNC = 82 + SYS_FDATASYNC = 83 + SYS_SYNC_FILE_RANGE = 84 + SYS_TIMERFD_CREATE = 85 + SYS_TIMERFD_SETTIME = 86 + SYS_TIMERFD_GETTIME = 87 + SYS_UTIMENSAT = 88 + SYS_ACCT = 89 + SYS_CAPGET = 90 + SYS_CAPSET = 91 + SYS_PERSONALITY = 92 + SYS_EXIT = 93 + SYS_EXIT_GROUP = 94 + SYS_WAITID = 95 + SYS_SET_TID_ADDRESS = 96 + SYS_UNSHARE = 97 + SYS_FUTEX = 98 + SYS_SET_ROBUST_LIST = 99 + SYS_GET_ROBUST_LIST = 100 + SYS_NANOSLEEP = 101 + SYS_GETITIMER = 102 + SYS_SETITIMER = 103 + SYS_KEXEC_LOAD = 104 + SYS_INIT_MODULE = 105 + SYS_DELETE_MODULE = 106 + SYS_TIMER_CREATE = 107 + SYS_TIMER_GETTIME = 108 + SYS_TIMER_GETOVERRUN = 109 + SYS_TIMER_SETTIME = 110 + SYS_TIMER_DELETE = 111 + SYS_CLOCK_SETTIME = 112 + SYS_CLOCK_GETTIME = 113 + SYS_CLOCK_GETRES = 114 + SYS_CLOCK_NANOSLEEP = 115 + SYS_SYSLOG = 116 + SYS_PTRACE = 117 + SYS_SCHED_SETPARAM = 118 + SYS_SCHED_SETSCHEDULER = 119 + SYS_SCHED_GETSCHEDULER = 120 + SYS_SCHED_GETPARAM = 121 + SYS_SCHED_SETAFFINITY = 122 + SYS_SCHED_GETAFFINITY = 123 + SYS_SCHED_YIELD = 124 + SYS_SCHED_GET_PRIORITY_MAX = 125 + SYS_SCHED_GET_PRIORITY_MIN = 126 + SYS_SCHED_RR_GET_INTERVAL = 127 + SYS_RESTART_SYSCALL = 128 + SYS_KILL = 129 + SYS_TKILL = 130 + SYS_TGKILL = 131 + SYS_SIGALTSTACK = 132 + SYS_RT_SIGSUSPEND = 133 + SYS_RT_SIGACTION = 134 + SYS_RT_SIGPROCMASK = 135 + SYS_RT_SIGPENDING = 136 + SYS_RT_SIGTIMEDWAIT = 137 + SYS_RT_SIGQUEUEINFO = 138 + SYS_RT_SIGRETURN = 139 + SYS_SETPRIORITY = 140 + SYS_GETPRIORITY = 141 + SYS_REBOOT = 142 + SYS_SETREGID = 143 + SYS_SETGID = 144 + SYS_SETREUID = 145 + SYS_SETUID = 146 + SYS_SETRESUID = 147 + SYS_GETRESUID = 148 + SYS_SETRESGID = 149 + SYS_GETRESGID = 150 + SYS_SETFSUID = 151 + SYS_SETFSGID = 152 + SYS_TIMES = 153 + SYS_SETPGID = 154 + SYS_GETPGID = 155 + SYS_GETSID = 156 + SYS_SETSID = 157 + SYS_GETGROUPS = 158 + SYS_SETGROUPS = 159 + SYS_UNAME = 160 + SYS_SETHOSTNAME = 161 + SYS_SETDOMAINNAME = 162 + SYS_GETRLIMIT = 163 + SYS_SETRLIMIT = 164 + SYS_GETRUSAGE = 165 + SYS_UMASK = 166 + SYS_PRCTL = 167 + SYS_GETCPU = 168 + SYS_GETTIMEOFDAY = 169 + SYS_SETTIMEOFDAY = 170 + SYS_ADJTIMEX = 171 + SYS_GETPID = 172 + SYS_GETPPID = 173 + SYS_GETUID = 174 + SYS_GETEUID = 175 + SYS_GETGID = 176 + SYS_GETEGID = 177 + SYS_GETTID = 178 + SYS_SYSINFO = 179 + SYS_MQ_OPEN = 180 + SYS_MQ_UNLINK = 181 + SYS_MQ_TIMEDSEND = 182 + SYS_MQ_TIMEDRECEIVE = 183 + SYS_MQ_NOTIFY = 184 + SYS_MQ_GETSETATTR = 185 + SYS_MSGGET = 186 + SYS_MSGCTL = 187 + SYS_MSGRCV = 188 + SYS_MSGSND = 189 + SYS_SEMGET = 190 + SYS_SEMCTL = 191 + SYS_SEMTIMEDOP = 192 + SYS_SEMOP = 193 + SYS_SHMGET = 194 + SYS_SHMCTL = 195 + SYS_SHMAT = 196 + SYS_SHMDT = 197 + SYS_SOCKET = 198 + SYS_SOCKETPAIR = 199 + SYS_BIND = 200 + SYS_LISTEN = 201 + SYS_ACCEPT = 202 + SYS_CONNECT = 203 + SYS_GETSOCKNAME = 204 + SYS_GETPEERNAME = 205 + SYS_SENDTO = 206 + SYS_RECVFROM = 207 + SYS_SETSOCKOPT = 208 + SYS_GETSOCKOPT = 209 + SYS_SHUTDOWN = 210 + SYS_SENDMSG = 211 + SYS_RECVMSG = 212 + SYS_READAHEAD = 213 + SYS_BRK = 214 + SYS_MUNMAP = 215 + SYS_MREMAP = 216 + SYS_ADD_KEY = 217 + SYS_REQUEST_KEY = 218 + SYS_KEYCTL = 219 + SYS_CLONE = 220 + SYS_EXECVE = 221 + SYS_MMAP = 222 + SYS_FADVISE64 = 223 + SYS_SWAPON = 224 + SYS_SWAPOFF = 225 + SYS_MPROTECT = 226 + SYS_MSYNC = 227 + SYS_MLOCK = 228 + SYS_MUNLOCK = 229 + SYS_MLOCKALL = 230 + SYS_MUNLOCKALL = 231 + SYS_MINCORE = 232 + SYS_MADVISE = 233 + SYS_REMAP_FILE_PAGES = 234 + SYS_MBIND = 235 + SYS_GET_MEMPOLICY = 236 + SYS_SET_MEMPOLICY = 237 + SYS_MIGRATE_PAGES = 238 + SYS_MOVE_PAGES = 239 + SYS_RT_TGSIGQUEUEINFO = 240 + SYS_PERF_EVENT_OPEN = 241 + SYS_ACCEPT4 = 242 + SYS_RECVMMSG = 243 + SYS_ARCH_SPECIFIC_SYSCALL = 244 + SYS_WAIT4 = 260 + SYS_PRLIMIT64 = 261 + SYS_FANOTIFY_INIT = 262 + SYS_FANOTIFY_MARK = 263 + SYS_NAME_TO_HANDLE_AT = 264 + SYS_OPEN_BY_HANDLE_AT = 265 + SYS_CLOCK_ADJTIME = 266 + SYS_SYNCFS = 267 + SYS_SETNS = 268 + SYS_SENDMMSG = 269 + SYS_PROCESS_VM_READV = 270 + SYS_PROCESS_VM_WRITEV = 271 + SYS_KCMP = 272 + SYS_FINIT_MODULE = 273 + SYS_SCHED_SETATTR = 274 + SYS_SCHED_GETATTR = 275 + SYS_RENAMEAT2 = 276 + SYS_SECCOMP = 277 + SYS_GETRANDOM = 278 + SYS_MEMFD_CREATE = 279 + SYS_BPF = 280 + SYS_EXECVEAT = 281 + SYS_USERFAULTFD = 282 + SYS_MEMBARRIER = 283 + SYS_MLOCK2 = 284 + SYS_COPY_FILE_RANGE = 285 + SYS_PREADV2 = 286 + SYS_PWRITEV2 = 287 + SYS_PKEY_MPROTECT = 288 + SYS_PKEY_ALLOC = 289 + SYS_PKEY_FREE = 290 + SYS_STATX = 291 + SYS_IO_PGETEVENTS = 292 + SYS_RSEQ = 293 +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index c061d6f1d3bb3..6eb7c257f8caf 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -1,4 +1,4 @@ -// linux/mksysnum.pl -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include -fsigned-char /tmp/include/asm/unistd.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build s390x,linux @@ -332,4 +332,6 @@ const ( SYS_STATX = 379 SYS_S390_STHYI = 380 SYS_KEXEC_FILE_LOAD = 381 + SYS_IO_PGETEVENTS = 382 + SYS_RSEQ = 383 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go index 07787301f0102..f93f391d26be6 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go @@ -1,5 +1,5 @@ // mksysnum_openbsd.pl -// Code generated by the command above; DO NOT EDIT. +// Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,openbsd @@ -12,6 +12,7 @@ const ( SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, \ SYS_OPEN = 5 // { int sys_open(const char *path, \ SYS_CLOSE = 6 // { int sys_close(int fd); } + SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, \ SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } @@ -37,11 +38,10 @@ const ( SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, \ SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, \ SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, \ - SYS_ACCESS = 33 // { int sys_access(const char *path, int flags); } + SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } SYS_SYNC = 36 // { void sys_sync(void); } - SYS_KILL = 37 // { int sys_kill(int pid, int signum); } SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); } SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } @@ -53,7 +53,6 @@ const ( SYS_SIGACTION = 46 // { int sys_sigaction(int signum, \ SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } - SYS_GETLOGIN = 49 // { int sys_getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } @@ -62,7 +61,7 @@ const ( SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } SYS_SYMLINK = 57 // { int sys_symlink(const char *path, \ - SYS_READLINK = 58 // { int sys_readlink(const char *path, char *buf, \ + SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, \ SYS_EXECVE = 59 // { int sys_execve(const char *path, \ SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } @@ -86,15 +85,18 @@ const ( SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, \ SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, \ SYS_GETPGRP = 81 // { int sys_getpgrp(void); } - SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, int pgid); } + SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } + SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, \ SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, \ SYS_FUTIMENS = 85 // { int sys_futimens(int fd, \ + SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, \ SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, \ SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, \ SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, \ SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, \ SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } + SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, \ SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, \ SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } @@ -102,16 +104,24 @@ const ( SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, \ SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } + SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } + SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, \ SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, \ SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } + SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, \ + SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, \ SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, \ SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \ SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } + SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, \ + SYS_UNVEIL = 114 // { int sys_unveil(const char *path, \ SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \ + SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, \ SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \ + SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); } @@ -125,6 +135,7 @@ const ( SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, \ + SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, \ SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } @@ -144,7 +155,7 @@ const ( SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \ SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, \ SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } - SYS___SYSCTL = 202 // { int sys___sysctl(const int *name, u_int namelen, \ + SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, \ SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go index 10edff07d5754..bc7fa57956a95 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go @@ -116,6 +116,7 @@ const ( SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \ SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, \ + SYS_UNVEIL = 114 // { int sys_unveil(const char *path, \ SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \ SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, \ diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go index 7a1693acbc197..be1198d91633c 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go @@ -1,5 +1,5 @@ // mksysnum_openbsd.pl -// Code generated by the command above; DO NOT EDIT. +// Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,openbsd @@ -53,7 +53,6 @@ const ( SYS_SIGACTION = 46 // { int sys_sigaction(int signum, \ SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } - SYS_GETLOGIN = 49 // { int sys_getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } @@ -87,9 +86,10 @@ const ( SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, \ SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } - SYS_SENDSYSLOG = 83 // { int sys_sendsyslog(const void *buf, size_t nbyte); } + SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, \ SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, \ SYS_FUTIMENS = 85 // { int sys_futimens(int fd, \ + SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, \ SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, \ SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, \ SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, \ @@ -111,10 +111,14 @@ const ( SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, \ SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, \ + SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, \ SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, \ SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \ SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } + SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, \ + SYS_UNVEIL = 114 // { int sys_unveil(const char *path, \ SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \ + SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } SYS_READV = 120 // { ssize_t sys_readv(int fd, \ SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \ SYS_KILL = 122 // { int sys_kill(int pid, int signum); } @@ -131,6 +135,7 @@ const ( SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, \ + SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, \ SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } @@ -150,7 +155,7 @@ const ( SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \ SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, \ SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } - SYS___SYSCTL = 202 // { int sys___sysctl(const int *name, u_int namelen, \ + SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, \ SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go new file mode 100644 index 0000000000000..cedc9b0f26d73 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go @@ -0,0 +1,345 @@ +// cgo -godefs types_aix.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build ppc,aix + +package unix + +const ( + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 + PathMax = 0x3ff +) + +type ( + _C_short int16 + _C_int int32 + _C_long int32 + _C_long_long int64 +) + +type off64 int64 +type off int32 +type Mode_t uint32 + +type Timespec struct { + Sec int32 + Nsec int32 +} + +type StTimespec struct { + Sec int32 + Nsec int32 +} + +type Timeval struct { + Sec int32 + Usec int32 +} + +type Timeval32 struct { + Sec int32 + Usec int32 +} + +type Timex struct{} + +type Time_t int32 + +type Tms struct{} + +type Utimbuf struct { + Actime int32 + Modtime int32 +} + +type Timezone struct { + Minuteswest int32 + Dsttime int32 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int32 + Ixrss int32 + Idrss int32 + Isrss int32 + Minflt int32 + Majflt int32 + Nswap int32 + Inblock int32 + Oublock int32 + Msgsnd int32 + Msgrcv int32 + Nsignals int32 + Nvcsw int32 + Nivcsw int32 +} + +type Rlimit struct { + Cur uint64 + Max uint64 +} + +type Pid_t int32 + +type _Gid_t uint32 + +type dev_t uint32 + +type Stat_t struct { + Dev uint32 + Ino uint32 + Mode uint32 + Nlink int16 + Flag uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Size int32 + Atim StTimespec + Mtim StTimespec + Ctim StTimespec + Blksize int32 + Blocks int32 + Vfstype int32 + Vfs uint32 + Type uint32 + Gen uint32 + Reserved [9]uint32 +} + +type StatxTimestamp struct{} + +type Statx_t struct{} + +type Dirent struct { + Offset uint32 + Ino uint32 + Reclen uint16 + Namlen uint16 + Name [256]uint8 +} + +type RawSockaddrInet4 struct { + Len uint8 + Family uint8 + Port uint16 + Addr [4]byte /* in_addr */ + Zero [8]uint8 +} + +type RawSockaddrInet6 struct { + Len uint8 + Family uint8 + Port uint16 + Flowinfo uint32 + Addr [16]byte /* in6_addr */ + Scope_id uint32 +} + +type RawSockaddrUnix struct { + Len uint8 + Family uint8 + Path [1023]uint8 +} + +type RawSockaddr struct { + Len uint8 + Family uint8 + Data [14]uint8 +} + +type RawSockaddrAny struct { + Addr RawSockaddr + Pad [1012]uint8 +} + +type _Socklen uint32 + +type Cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +type ICMPv6Filter struct { + Filt [8]uint32 +} + +type Iovec struct { + Base *byte + Len uint32 +} + +type IPMreq struct { + Multiaddr [4]byte /* in_addr */ + Interface [4]byte /* in_addr */ +} + +type IPv6Mreq struct { + Multiaddr [16]byte /* in6_addr */ + Interface uint32 +} + +type IPv6MTUInfo struct { + Addr RawSockaddrInet6 + Mtu uint32 +} + +type Linger struct { + Onoff int32 + Linger int32 +} + +type Msghdr struct { + Name *byte + Namelen uint32 + Iov *Iovec + Iovlen int32 + Control *byte + Controllen uint32 + Flags int32 +} + +const ( + SizeofSockaddrInet4 = 0x10 + SizeofSockaddrInet6 = 0x1c + SizeofSockaddrAny = 0x404 + SizeofSockaddrUnix = 0x401 + SizeofLinger = 0x8 + SizeofIPMreq = 0x8 + SizeofIPv6Mreq = 0x14 + SizeofIPv6MTUInfo = 0x20 + SizeofMsghdr = 0x1c + SizeofCmsghdr = 0xc + SizeofICMPv6Filter = 0x20 +) + +const ( + SizeofIfMsghdr = 0x10 +) + +type IfMsgHdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + Addrlen uint8 + _ [1]byte +} + +type FdSet struct { + Bits [2048]int32 +} + +type Utsname struct { + Sysname [32]byte + Nodename [32]byte + Release [32]byte + Version [32]byte + Machine [32]byte +} + +type Ustat_t struct{} + +type Sigset_t struct { + Losigs uint32 + Hisigs uint32 +} + +const ( + AT_FDCWD = -0x2 + AT_REMOVEDIR = 0x1 + AT_SYMLINK_NOFOLLOW = 0x1 +) + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Cc [16]uint8 +} + +type Termio struct { + Iflag uint16 + Oflag uint16 + Cflag uint16 + Lflag uint16 + Line uint8 + Cc [8]uint8 + _ [1]byte +} + +type Winsize struct { + Row uint16 + Col uint16 + Xpixel uint16 + Ypixel uint16 +} + +type PollFd struct { + Fd int32 + Events uint16 + Revents uint16 +} + +const ( + POLLERR = 0x4000 + POLLHUP = 0x2000 + POLLIN = 0x1 + POLLNVAL = 0x8000 + POLLOUT = 0x2 + POLLPRI = 0x4 + POLLRDBAND = 0x20 + POLLRDNORM = 0x10 + POLLWRBAND = 0x40 + POLLWRNORM = 0x2 +) + +type Flock_t struct { + Type int16 + Whence int16 + Sysid uint32 + Pid int32 + Vfs int32 + Start int64 + Len int64 +} + +type Fsid_t struct { + Val [2]uint32 +} +type Fsid64_t struct { + Val [2]uint64 +} + +type Statfs_t struct { + Version int32 + Type int32 + Bsize uint32 + Blocks uint32 + Bfree uint32 + Bavail uint32 + Files uint32 + Ffree uint32 + Fsid Fsid_t + Vfstype int32 + Fsize uint32 + Vfsnumber int32 + Vfsoff int32 + Vfslen int32 + Vfsvers int32 + Fname [32]uint8 + Fpack [32]uint8 + Name_max int32 +} + +const RNDGETENTCNT = 0x80045200 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go new file mode 100644 index 0000000000000..f46482d272e62 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go @@ -0,0 +1,354 @@ +// cgo -godefs types_aix.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build ppc64,aix + +package unix + +const ( + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 + PathMax = 0x3ff +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type off64 int64 +type off int64 +type Mode_t uint32 + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type StTimespec struct { + Sec int64 + Nsec int32 + _ [4]byte +} + +type Timeval struct { + Sec int64 + Usec int32 + _ [4]byte +} + +type Timeval32 struct { + Sec int32 + Usec int32 +} + +type Timex struct{} + +type Time_t int64 + +type Tms struct{} + +type Utimbuf struct { + Actime int64 + Modtime int64 +} + +type Timezone struct { + Minuteswest int32 + Dsttime int32 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Rlimit struct { + Cur uint64 + Max uint64 +} + +type Pid_t int32 + +type _Gid_t uint32 + +type dev_t uint64 + +type Stat_t struct { + Dev uint64 + Ino uint64 + Mode uint32 + Nlink int16 + Flag uint16 + Uid uint32 + Gid uint32 + Rdev uint64 + Ssize int32 + _ [4]byte + Atim StTimespec + Mtim StTimespec + Ctim StTimespec + Blksize int64 + Blocks int64 + Vfstype int32 + Vfs uint32 + Type uint32 + Gen uint32 + Reserved [9]uint32 + Padto_ll uint32 + Size int64 +} + +type StatxTimestamp struct{} + +type Statx_t struct{} + +type Dirent struct { + Offset uint64 + Ino uint64 + Reclen uint16 + Namlen uint16 + Name [256]uint8 + _ [4]byte +} + +type RawSockaddrInet4 struct { + Len uint8 + Family uint8 + Port uint16 + Addr [4]byte /* in_addr */ + Zero [8]uint8 +} + +type RawSockaddrInet6 struct { + Len uint8 + Family uint8 + Port uint16 + Flowinfo uint32 + Addr [16]byte /* in6_addr */ + Scope_id uint32 +} + +type RawSockaddrUnix struct { + Len uint8 + Family uint8 + Path [1023]uint8 +} + +type RawSockaddr struct { + Len uint8 + Family uint8 + Data [14]uint8 +} + +type RawSockaddrAny struct { + Addr RawSockaddr + Pad [1012]uint8 +} + +type _Socklen uint32 + +type Cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +type ICMPv6Filter struct { + Filt [8]uint32 +} + +type Iovec struct { + Base *byte + Len uint64 +} + +type IPMreq struct { + Multiaddr [4]byte /* in_addr */ + Interface [4]byte /* in_addr */ +} + +type IPv6Mreq struct { + Multiaddr [16]byte /* in6_addr */ + Interface uint32 +} + +type IPv6MTUInfo struct { + Addr RawSockaddrInet6 + Mtu uint32 +} + +type Linger struct { + Onoff int32 + Linger int32 +} + +type Msghdr struct { + Name *byte + Namelen uint32 + _ [4]byte + Iov *Iovec + Iovlen int32 + _ [4]byte + Control *byte + Controllen uint32 + Flags int32 +} + +const ( + SizeofSockaddrInet4 = 0x10 + SizeofSockaddrInet6 = 0x1c + SizeofSockaddrAny = 0x404 + SizeofSockaddrUnix = 0x401 + SizeofLinger = 0x8 + SizeofIPMreq = 0x8 + SizeofIPv6Mreq = 0x14 + SizeofIPv6MTUInfo = 0x20 + SizeofMsghdr = 0x30 + SizeofCmsghdr = 0xc + SizeofICMPv6Filter = 0x20 +) + +const ( + SizeofIfMsghdr = 0x10 +) + +type IfMsgHdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + Addrlen uint8 + _ [1]byte +} + +type FdSet struct { + Bits [1024]int64 +} + +type Utsname struct { + Sysname [32]byte + Nodename [32]byte + Release [32]byte + Version [32]byte + Machine [32]byte +} + +type Ustat_t struct{} + +type Sigset_t struct { + Set [4]uint64 +} + +const ( + AT_FDCWD = -0x2 + AT_REMOVEDIR = 0x1 + AT_SYMLINK_NOFOLLOW = 0x1 +) + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Cc [16]uint8 +} + +type Termio struct { + Iflag uint16 + Oflag uint16 + Cflag uint16 + Lflag uint16 + Line uint8 + Cc [8]uint8 + _ [1]byte +} + +type Winsize struct { + Row uint16 + Col uint16 + Xpixel uint16 + Ypixel uint16 +} + +type PollFd struct { + Fd int32 + Events uint16 + Revents uint16 +} + +const ( + POLLERR = 0x4000 + POLLHUP = 0x2000 + POLLIN = 0x1 + POLLNVAL = 0x8000 + POLLOUT = 0x2 + POLLPRI = 0x4 + POLLRDBAND = 0x20 + POLLRDNORM = 0x10 + POLLWRBAND = 0x40 + POLLWRNORM = 0x2 +) + +type Flock_t struct { + Type int16 + Whence int16 + Sysid uint32 + Pid int32 + Vfs int32 + Start int64 + Len int64 +} + +type Fsid_t struct { + Val [2]uint32 +} +type Fsid64_t struct { + Val [2]uint64 +} + +type Statfs_t struct { + Version int32 + Type int32 + Bsize uint64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint64 + Ffree uint64 + Fsid Fsid64_t + Vfstype int32 + _ [4]byte + Fsize uint64 + Vfsnumber int32 + Vfsoff int32 + Vfslen int32 + Vfsvers int32 + Fname [32]uint8 + Fpack [32]uint8 + Name_max int32 + _ [4]byte +} + +const RNDGETENTCNT = 0x80045200 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go index 327af5fba16c0..2aeb52a886dec 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go index 116e6e0757854..0d0d9f2ccb7ab 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 ) type ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go index 2750ad76070d1..04e344b78d883 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go @@ -7,11 +7,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go index 8cead0996c849..9fec185c180f0 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 ) type ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go index 315a553bd5bb0..7b34e2e2c6868 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 ) type ( @@ -56,23 +56,6 @@ type Rlimit struct { type _Gid_t uint32 -const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 -) - type Stat_t struct { Ino uint64 Nlink uint32 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go index 878a21ad6d74a..c146c1ad35441 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( @@ -57,44 +57,83 @@ type Rlimit struct { type _Gid_t uint32 const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 + _statfsVersion = 0x20140518 + _dirblksiz = 0x400 ) type Stat_t struct { - Dev uint32 - Ino uint32 - Mode uint16 - Nlink uint16 - Uid uint32 - Gid uint32 - Rdev uint32 - Atimespec Timespec - Mtimespec Timespec - Ctimespec Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint32 - Lspare int32 - Birthtimespec Timespec - Pad_cgo_0 [8]byte + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint16 + _0 int16 + Uid uint32 + Gid uint32 + _1 int32 + Rdev uint64 + Atim_ext int32 + Atim Timespec + Mtim_ext int32 + Mtim Timespec + Ctim_ext int32 + Ctim Timespec + Btim_ext int32 + Birthtim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint64 + Spare [10]uint64 +} + +type stat_freebsd11_t struct { + Dev uint32 + Ino uint32 + Mode uint16 + Nlink uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Atim Timespec + Mtim Timespec + Ctim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + Lspare int32 + Birthtim Timespec + _ [8]byte } type Statfs_t struct { + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]int8 + Fstypename [16]int8 + Mntfromname [1024]int8 + Mntonname [1024]int8 +} + +type statfs_freebsd11_t struct { Version uint32 Type uint32 Flags uint64 @@ -129,6 +168,17 @@ type Flock_t struct { } type Dirent struct { + Fileno uint64 + Off int64 + Reclen uint16 + Type uint8 + Pad0 uint8 + Namlen uint16 + Pad1 uint16 + Name [256]int8 +} + +type dirent_freebsd11 struct { Fileno uint32 Reclen uint16 Type uint8 @@ -289,7 +339,7 @@ type Kevent_t struct { } type FdSet struct { - X__fds_bits [32]uint32 + Bits [32]uint32 } const ( @@ -305,53 +355,53 @@ const ( ) type ifMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Data ifData + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data ifData } type IfMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Data IfData + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data IfData } type ifData struct { - Type uint8 - Physical uint8 - Addrlen uint8 - Hdrlen uint8 - Link_state uint8 - Vhid uint8 - Datalen uint16 - Mtu uint32 - Metric uint32 - Baudrate uint64 - Ipackets uint64 - Ierrors uint64 - Opackets uint64 - Oerrors uint64 - Collisions uint64 - Ibytes uint64 - Obytes uint64 - Imcasts uint64 - Omcasts uint64 - Iqdrops uint64 - Oqdrops uint64 - Noproto uint64 - Hwassist uint64 - X__ifi_epoch [8]byte - X__ifi_lastchange [16]byte + Type uint8 + Physical uint8 + Addrlen uint8 + Hdrlen uint8 + Link_state uint8 + Vhid uint8 + Datalen uint16 + Mtu uint32 + Metric uint32 + Baudrate uint64 + Ipackets uint64 + Ierrors uint64 + Opackets uint64 + Oerrors uint64 + Collisions uint64 + Ibytes uint64 + Obytes uint64 + Imcasts uint64 + Omcasts uint64 + Iqdrops uint64 + Oqdrops uint64 + Noproto uint64 + Hwassist uint64 + _ [8]byte + _ [16]byte } type IfData struct { @@ -383,24 +433,24 @@ type IfData struct { } type IfaMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Metric int32 + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Metric int32 } type IfmaMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte } type IfAnnounceMsghdr struct { @@ -413,19 +463,19 @@ type IfAnnounceMsghdr struct { } type RtMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Index uint16 - Pad_cgo_0 [2]byte - Flags int32 - Addrs int32 - Pid int32 - Seq int32 - Errno int32 - Fmask int32 - Inits uint32 - Rmx RtMetrics + Msglen uint16 + Version uint8 + Type uint8 + Index uint16 + _ [2]byte + Flags int32 + Addrs int32 + Pid int32 + Seq int32 + Errno int32 + Fmask int32 + Inits uint32 + Rmx RtMetrics } type RtMetrics struct { @@ -482,18 +532,18 @@ type BpfInsn struct { } type BpfHdr struct { - Tstamp Timeval - Caplen uint32 - Datalen uint32 - Hdrlen uint16 - Pad_cgo_0 [2]byte + Tstamp Timeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + _ [2]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 - X_bzh_pad [5]uint32 + _ [5]uint32 } type Termios struct { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go index 8408af1250cbb..ac33a8dd4a6c2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 ) type ( @@ -57,43 +57,78 @@ type Rlimit struct { type _Gid_t uint32 const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 + _statfsVersion = 0x20140518 + _dirblksiz = 0x400 ) type Stat_t struct { - Dev uint32 - Ino uint32 - Mode uint16 - Nlink uint16 - Uid uint32 - Gid uint32 - Rdev uint32 - Atimespec Timespec - Mtimespec Timespec - Ctimespec Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint32 - Lspare int32 - Birthtimespec Timespec + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint16 + _0 int16 + Uid uint32 + Gid uint32 + _1 int32 + Rdev uint64 + Atim Timespec + Mtim Timespec + Ctim Timespec + Birthtim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint64 + Spare [10]uint64 +} + +type stat_freebsd11_t struct { + Dev uint32 + Ino uint32 + Mode uint16 + Nlink uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Atim Timespec + Mtim Timespec + Ctim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + Lspare int32 + Birthtim Timespec } type Statfs_t struct { + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]int8 + Fstypename [16]int8 + Mntfromname [1024]int8 + Mntonname [1024]int8 +} + +type statfs_freebsd11_t struct { Version uint32 Type uint32 Flags uint64 @@ -119,16 +154,27 @@ type Statfs_t struct { } type Flock_t struct { - Start int64 - Len int64 - Pid int32 - Type int16 - Whence int16 - Sysid int32 - Pad_cgo_0 [4]byte + Start int64 + Len int64 + Pid int32 + Type int16 + Whence int16 + Sysid int32 + _ [4]byte } type Dirent struct { + Fileno uint64 + Off int64 + Reclen uint16 + Type uint8 + Pad0 uint8 + Namlen uint16 + Pad1 uint16 + Name [256]int8 +} + +type dirent_freebsd11 struct { Fileno uint32 Reclen uint16 Type uint8 @@ -229,10 +275,10 @@ type IPv6Mreq struct { type Msghdr struct { Name *byte Namelen uint32 - Pad_cgo_0 [4]byte + _ [4]byte Iov *Iovec Iovlen int32 - Pad_cgo_1 [4]byte + _ [4]byte Control *byte Controllen uint32 Flags int32 @@ -291,7 +337,7 @@ type Kevent_t struct { } type FdSet struct { - X__fds_bits [16]uint64 + Bits [16]uint64 } const ( @@ -307,53 +353,53 @@ const ( ) type ifMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Data ifData + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data ifData } type IfMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Data IfData + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data IfData } type ifData struct { - Type uint8 - Physical uint8 - Addrlen uint8 - Hdrlen uint8 - Link_state uint8 - Vhid uint8 - Datalen uint16 - Mtu uint32 - Metric uint32 - Baudrate uint64 - Ipackets uint64 - Ierrors uint64 - Opackets uint64 - Oerrors uint64 - Collisions uint64 - Ibytes uint64 - Obytes uint64 - Imcasts uint64 - Omcasts uint64 - Iqdrops uint64 - Oqdrops uint64 - Noproto uint64 - Hwassist uint64 - X__ifi_epoch [8]byte - X__ifi_lastchange [16]byte + Type uint8 + Physical uint8 + Addrlen uint8 + Hdrlen uint8 + Link_state uint8 + Vhid uint8 + Datalen uint16 + Mtu uint32 + Metric uint32 + Baudrate uint64 + Ipackets uint64 + Ierrors uint64 + Opackets uint64 + Oerrors uint64 + Collisions uint64 + Ibytes uint64 + Obytes uint64 + Imcasts uint64 + Omcasts uint64 + Iqdrops uint64 + Oqdrops uint64 + Noproto uint64 + Hwassist uint64 + _ [8]byte + _ [16]byte } type IfData struct { @@ -385,24 +431,24 @@ type IfData struct { } type IfaMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Metric int32 + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Metric int32 } type IfmaMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte } type IfAnnounceMsghdr struct { @@ -415,19 +461,19 @@ type IfAnnounceMsghdr struct { } type RtMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Index uint16 - Pad_cgo_0 [2]byte - Flags int32 - Addrs int32 - Pid int32 - Seq int32 - Errno int32 - Fmask int32 - Inits uint64 - Rmx RtMetrics + Msglen uint16 + Version uint8 + Type uint8 + Index uint16 + _ [2]byte + Flags int32 + Addrs int32 + Pid int32 + Seq int32 + Errno int32 + Fmask int32 + Inits uint64 + Rmx RtMetrics } type RtMetrics struct { @@ -472,9 +518,9 @@ type BpfZbuf struct { } type BpfProgram struct { - Len uint32 - Pad_cgo_0 [4]byte - Insns *BpfInsn + Len uint32 + _ [4]byte + Insns *BpfInsn } type BpfInsn struct { @@ -485,18 +531,18 @@ type BpfInsn struct { } type BpfHdr struct { - Tstamp Timeval - Caplen uint32 - Datalen uint32 - Hdrlen uint16 - Pad_cgo_0 [6]byte + Tstamp Timeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + _ [6]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 - X_bzh_pad [5]uint32 + _ [5]uint32 } type Termios struct { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go index 4b2d9a4839974..e27511a642f11 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( @@ -21,15 +21,15 @@ type ( ) type Timespec struct { - Sec int64 - Nsec int32 - Pad_cgo_0 [4]byte + Sec int64 + Nsec int32 + _ [4]byte } type Timeval struct { - Sec int64 - Usec int32 - Pad_cgo_0 [4]byte + Sec int64 + Usec int32 + _ [4]byte } type Rusage struct { @@ -59,43 +59,78 @@ type Rlimit struct { type _Gid_t uint32 const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 + _statfsVersion = 0x20140518 + _dirblksiz = 0x400 ) type Stat_t struct { - Dev uint32 - Ino uint32 - Mode uint16 - Nlink uint16 - Uid uint32 - Gid uint32 - Rdev uint32 - Atimespec Timespec - Mtimespec Timespec - Ctimespec Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint32 - Lspare int32 - Birthtimespec Timespec + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint16 + _0 int16 + Uid uint32 + Gid uint32 + _1 int32 + Rdev uint64 + Atim Timespec + Mtim Timespec + Ctim Timespec + Birthtim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint64 + Spare [10]uint64 +} + +type stat_freebsd11_t struct { + Dev uint32 + Ino uint32 + Mode uint16 + Nlink uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Atim Timespec + Mtim Timespec + Ctim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + Lspare int32 + Birthtim Timespec } type Statfs_t struct { + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]int8 + Fstypename [16]int8 + Mntfromname [1024]int8 + Mntonname [1024]int8 +} + +type statfs_freebsd11_t struct { Version uint32 Type uint32 Flags uint64 @@ -121,16 +156,27 @@ type Statfs_t struct { } type Flock_t struct { - Start int64 - Len int64 - Pid int32 - Type int16 - Whence int16 - Sysid int32 - Pad_cgo_0 [4]byte + Start int64 + Len int64 + Pid int32 + Type int16 + Whence int16 + Sysid int32 + _ [4]byte } type Dirent struct { + Fileno uint64 + Off int64 + Reclen uint16 + Type uint8 + Pad0 uint8 + Namlen uint16 + Pad1 uint16 + Name [256]int8 +} + +type dirent_freebsd11 struct { Fileno uint32 Reclen uint16 Type uint8 @@ -291,7 +337,7 @@ type Kevent_t struct { } type FdSet struct { - X__fds_bits [32]uint32 + Bits [32]uint32 } const ( @@ -307,53 +353,53 @@ const ( ) type ifMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Data ifData + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data ifData } type IfMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Data IfData + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data IfData } type ifData struct { - Type uint8 - Physical uint8 - Addrlen uint8 - Hdrlen uint8 - Link_state uint8 - Vhid uint8 - Datalen uint16 - Mtu uint32 - Metric uint32 - Baudrate uint64 - Ipackets uint64 - Ierrors uint64 - Opackets uint64 - Oerrors uint64 - Collisions uint64 - Ibytes uint64 - Obytes uint64 - Imcasts uint64 - Omcasts uint64 - Iqdrops uint64 - Oqdrops uint64 - Noproto uint64 - Hwassist uint64 - X__ifi_epoch [8]byte - X__ifi_lastchange [16]byte + Type uint8 + Physical uint8 + Addrlen uint8 + Hdrlen uint8 + Link_state uint8 + Vhid uint8 + Datalen uint16 + Mtu uint32 + Metric uint32 + Baudrate uint64 + Ipackets uint64 + Ierrors uint64 + Opackets uint64 + Oerrors uint64 + Collisions uint64 + Ibytes uint64 + Obytes uint64 + Imcasts uint64 + Omcasts uint64 + Iqdrops uint64 + Oqdrops uint64 + Noproto uint64 + Hwassist uint64 + _ [8]byte + _ [16]byte } type IfData struct { @@ -380,30 +426,30 @@ type IfData struct { Iqdrops uint32 Noproto uint32 Hwassist uint32 - Pad_cgo_0 [4]byte + _ [4]byte Epoch int64 Lastchange Timeval } type IfaMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte - Metric int32 + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Metric int32 } type IfmaMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Addrs int32 - Flags int32 - Index uint16 - Pad_cgo_0 [2]byte + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte } type IfAnnounceMsghdr struct { @@ -416,19 +462,19 @@ type IfAnnounceMsghdr struct { } type RtMsghdr struct { - Msglen uint16 - Version uint8 - Type uint8 - Index uint16 - Pad_cgo_0 [2]byte - Flags int32 - Addrs int32 - Pid int32 - Seq int32 - Errno int32 - Fmask int32 - Inits uint32 - Rmx RtMetrics + Msglen uint16 + Version uint8 + Type uint8 + Index uint16 + _ [2]byte + Flags int32 + Addrs int32 + Pid int32 + Seq int32 + Errno int32 + Fmask int32 + Inits uint32 + Rmx RtMetrics } type RtMetrics struct { @@ -485,18 +531,18 @@ type BpfInsn struct { } type BpfHdr struct { - Tstamp Timeval - Caplen uint32 - Datalen uint32 - Hdrlen uint16 - Pad_cgo_0 [6]byte + Tstamp Timeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + _ [6]byte } type BpfZbufHeader struct { Kernel_gen uint32 Kernel_len uint32 User_gen uint32 - X_bzh_pad [5]uint32 + _ [5]uint32 } type Termios struct { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index e89bc6b3664ce..f56e164b70420 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -248,6 +248,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -271,6 +278,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -401,9 +418,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 @@ -433,6 +453,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -476,7 +497,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -501,6 +522,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1844,3 +1879,113 @@ type RTCPLLInfo struct { Negmult int32 Clock int32 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 +} + +const ( + BLKPG = 0x1269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index d95372baecf91..ac5f636a68773 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -250,6 +250,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -273,6 +280,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -405,9 +422,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 @@ -437,6 +457,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -480,7 +501,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -505,6 +526,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1864,3 +1899,115 @@ type RTCPLLInfo struct { Negmult int32 Clock int64 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x1269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 77875ba01b67b..eb7562da792e5 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -251,6 +251,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -274,6 +281,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -404,9 +421,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 @@ -436,6 +456,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -479,7 +500,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -504,6 +525,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1833,3 +1868,114 @@ type RTCPLLInfo struct { Negmult int32 Clock int32 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x1269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 5a9df694a6f76..3c4fb88d76041 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -251,6 +251,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -274,6 +281,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -406,9 +423,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 @@ -438,6 +458,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -481,7 +502,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -506,6 +527,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1843,3 +1878,115 @@ type RTCPLLInfo struct { Negmult int32 Clock int64 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x1269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index dcb239de813da..647e40a7746ca 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -249,6 +249,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -272,6 +279,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -402,9 +419,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 @@ -434,6 +454,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -477,7 +498,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -502,6 +523,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1838,3 +1873,114 @@ type RTCPLLInfo struct { Negmult int32 Clock int32 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 9cf85f7218a3d..e0159b01d4065 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -251,6 +251,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -274,6 +281,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -406,9 +423,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 @@ -438,6 +458,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -481,7 +502,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -506,6 +527,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1845,3 +1880,115 @@ type RTCPLLInfo struct { Negmult int32 Clock int64 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 6fd66e7510db5..c1a024dfd7936 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -251,6 +251,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -274,6 +281,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -406,9 +423,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 @@ -438,6 +458,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -481,7 +502,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -506,6 +527,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1845,3 +1880,115 @@ type RTCPLLInfo struct { Negmult int32 Clock int64 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index faa5b3ef18077..7e525eb7f99ea 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -249,6 +249,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -272,6 +279,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -402,9 +419,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x8 SizeofIPMreq = 0x8 @@ -434,6 +454,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -477,7 +498,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -502,6 +523,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1838,3 +1873,114 @@ type RTCPLLInfo struct { Negmult int32 Clock int32 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index ad4c452460c0c..85ae2954dcd6a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -252,6 +252,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -275,6 +282,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -407,9 +424,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 @@ -439,6 +459,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -482,7 +503,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -507,6 +528,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1853,3 +1888,115 @@ type RTCPLLInfo struct { Negmult int32 Clock int64 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 1fdb2f21626df..d0c930a13fa32 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -252,6 +252,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -275,6 +282,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -407,9 +424,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 @@ -439,6 +459,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -482,7 +503,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -507,6 +528,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1853,3 +1888,115 @@ type RTCPLLInfo struct { Negmult int32 Clock int64 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go new file mode 100644 index 0000000000000..c1a20bcd3f491 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -0,0 +1,2019 @@ +// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build riscv64,linux + +package unix + +const ( + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 + PathMax = 0x1000 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type Timeval struct { + Sec int64 + Usec int64 +} + +type Timex struct { + Modes uint32 + _ [4]byte + Offset int64 + Freq int64 + Maxerror int64 + Esterror int64 + Status int32 + _ [4]byte + Constant int64 + Precision int64 + Tolerance int64 + Time Timeval + Tick int64 + Ppsfreq int64 + Jitter int64 + Shift int32 + _ [4]byte + Stabil int64 + Jitcnt int64 + Calcnt int64 + Errcnt int64 + Stbcnt int64 + Tai int32 + _ [44]byte +} + +type Time_t int64 + +type Tms struct { + Utime int64 + Stime int64 + Cutime int64 + Cstime int64 +} + +type Utimbuf struct { + Actime int64 + Modtime int64 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Rlimit struct { + Cur uint64 + Max uint64 +} + +type _Gid_t uint32 + +type Stat_t struct { + Dev uint64 + Ino uint64 + Mode uint32 + Nlink uint32 + Uid uint32 + Gid uint32 + Rdev uint64 + _ uint64 + Size int64 + Blksize int32 + _ int32 + Blocks int64 + Atim Timespec + Mtim Timespec + Ctim Timespec + _ [2]int32 +} + +type StatxTimestamp struct { + Sec int64 + Nsec uint32 + _ int32 +} + +type Statx_t struct { + Mask uint32 + Blksize uint32 + Attributes uint64 + Nlink uint32 + Uid uint32 + Gid uint32 + Mode uint16 + _ [1]uint16 + Ino uint64 + Size uint64 + Blocks uint64 + Attributes_mask uint64 + Atime StatxTimestamp + Btime StatxTimestamp + Ctime StatxTimestamp + Mtime StatxTimestamp + Rdev_major uint32 + Rdev_minor uint32 + Dev_major uint32 + Dev_minor uint32 + _ [14]uint64 +} + +type Dirent struct { + Ino uint64 + Off int64 + Reclen uint16 + Type uint8 + Name [256]uint8 + _ [5]byte +} + +type Fsid struct { + Val [2]int32 +} + +type Flock_t struct { + Type int16 + Whence int16 + _ [4]byte + Start int64 + Len int64 + Pid int32 + _ [4]byte +} + +type FscryptPolicy struct { + Version uint8 + Contents_encryption_mode uint8 + Filenames_encryption_mode uint8 + Flags uint8 + Master_key_descriptor [8]uint8 +} + +type FscryptKey struct { + Mode uint32 + Raw [64]uint8 + Size uint32 +} + +type KeyctlDHParams struct { + Private int32 + Prime int32 + Base int32 +} + +const ( + FADV_NORMAL = 0x0 + FADV_RANDOM = 0x1 + FADV_SEQUENTIAL = 0x2 + FADV_WILLNEED = 0x3 + FADV_DONTNEED = 0x4 + FADV_NOREUSE = 0x5 +) + +type RawSockaddrInet4 struct { + Family uint16 + Port uint16 + Addr [4]byte /* in_addr */ + Zero [8]uint8 +} + +type RawSockaddrInet6 struct { + Family uint16 + Port uint16 + Flowinfo uint32 + Addr [16]byte /* in6_addr */ + Scope_id uint32 +} + +type RawSockaddrUnix struct { + Family uint16 + Path [108]uint8 +} + +type RawSockaddrLinklayer struct { + Family uint16 + Protocol uint16 + Ifindex int32 + Hatype uint16 + Pkttype uint8 + Halen uint8 + Addr [8]uint8 +} + +type RawSockaddrNetlink struct { + Family uint16 + Pad uint16 + Pid uint32 + Groups uint32 +} + +type RawSockaddrHCI struct { + Family uint16 + Dev uint16 + Channel uint16 +} + +type RawSockaddrL2 struct { + Family uint16 + Psm uint16 + Bdaddr [6]uint8 + Cid uint16 + Bdaddr_type uint8 + _ [1]byte +} + +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + +type RawSockaddrCAN struct { + Family uint16 + _ [2]byte + Ifindex int32 + Addr [8]byte +} + +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + +type RawSockaddrVM struct { + Family uint16 + Reserved1 uint16 + Port uint32 + Cid uint32 + Zero [4]uint8 +} + +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + +type RawSockaddr struct { + Family uint16 + Data [14]uint8 +} + +type RawSockaddrAny struct { + Addr RawSockaddr + Pad [96]uint8 +} + +type _Socklen uint32 + +type Linger struct { + Onoff int32 + Linger int32 +} + +type Iovec struct { + Base *byte + Len uint64 +} + +type IPMreq struct { + Multiaddr [4]byte /* in_addr */ + Interface [4]byte /* in_addr */ +} + +type IPMreqn struct { + Multiaddr [4]byte /* in_addr */ + Address [4]byte /* in_addr */ + Ifindex int32 +} + +type IPv6Mreq struct { + Multiaddr [16]byte /* in6_addr */ + Interface uint32 +} + +type PacketMreq struct { + Ifindex int32 + Type uint16 + Alen uint16 + Address [8]uint8 +} + +type Msghdr struct { + Name *byte + Namelen uint32 + _ [4]byte + Iov *Iovec + Iovlen uint64 + Control *byte + Controllen uint64 + Flags int32 + _ [4]byte +} + +type Cmsghdr struct { + Len uint64 + Level int32 + Type int32 +} + +type Inet4Pktinfo struct { + Ifindex int32 + Spec_dst [4]byte /* in_addr */ + Addr [4]byte /* in_addr */ +} + +type Inet6Pktinfo struct { + Addr [16]byte /* in6_addr */ + Ifindex uint32 +} + +type IPv6MTUInfo struct { + Addr RawSockaddrInet6 + Mtu uint32 +} + +type ICMPv6Filter struct { + Data [8]uint32 +} + +type Ucred struct { + Pid int32 + Uid uint32 + Gid uint32 +} + +type TCPInfo struct { + State uint8 + Ca_state uint8 + Retransmits uint8 + Probes uint8 + Backoff uint8 + Options uint8 + _ [2]byte + Rto uint32 + Ato uint32 + Snd_mss uint32 + Rcv_mss uint32 + Unacked uint32 + Sacked uint32 + Lost uint32 + Retrans uint32 + Fackets uint32 + Last_data_sent uint32 + Last_ack_sent uint32 + Last_data_recv uint32 + Last_ack_recv uint32 + Pmtu uint32 + Rcv_ssthresh uint32 + Rtt uint32 + Rttvar uint32 + Snd_ssthresh uint32 + Snd_cwnd uint32 + Advmss uint32 + Reordering uint32 + Rcv_rtt uint32 + Rcv_space uint32 + Total_retrans uint32 +} + +const ( + SizeofSockaddrInet4 = 0x10 + SizeofSockaddrInet6 = 0x1c + SizeofSockaddrAny = 0x70 + SizeofSockaddrUnix = 0x6e + SizeofSockaddrLinklayer = 0x14 + SizeofSockaddrNetlink = 0xc + SizeofSockaddrHCI = 0x6 + SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa + SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 + SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e + SizeofLinger = 0x8 + SizeofIovec = 0x10 + SizeofIPMreq = 0x8 + SizeofIPMreqn = 0xc + SizeofIPv6Mreq = 0x14 + SizeofPacketMreq = 0x10 + SizeofMsghdr = 0x38 + SizeofCmsghdr = 0x10 + SizeofInet4Pktinfo = 0xc + SizeofInet6Pktinfo = 0x14 + SizeofIPv6MTUInfo = 0x20 + SizeofICMPv6Filter = 0x20 + SizeofUcred = 0xc + SizeofTCPInfo = 0x68 +) + +const ( + IFA_UNSPEC = 0x0 + IFA_ADDRESS = 0x1 + IFA_LOCAL = 0x2 + IFA_LABEL = 0x3 + IFA_BROADCAST = 0x4 + IFA_ANYCAST = 0x5 + IFA_CACHEINFO = 0x6 + IFA_MULTICAST = 0x7 + IFLA_UNSPEC = 0x0 + IFLA_ADDRESS = 0x1 + IFLA_BROADCAST = 0x2 + IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 + IFLA_MTU = 0x4 + IFLA_LINK = 0x5 + IFLA_QDISC = 0x6 + IFLA_STATS = 0x7 + IFLA_COST = 0x8 + IFLA_PRIORITY = 0x9 + IFLA_MASTER = 0xa + IFLA_WIRELESS = 0xb + IFLA_PROTINFO = 0xc + IFLA_TXQLEN = 0xd + IFLA_MAP = 0xe + IFLA_WEIGHT = 0xf + IFLA_OPERSTATE = 0x10 + IFLA_LINKMODE = 0x11 + IFLA_LINKINFO = 0x12 + IFLA_NET_NS_PID = 0x13 + IFLA_IFALIAS = 0x14 + IFLA_NUM_VF = 0x15 + IFLA_VFINFO_LIST = 0x16 + IFLA_STATS64 = 0x17 + IFLA_VF_PORTS = 0x18 + IFLA_PORT_SELF = 0x19 + IFLA_AF_SPEC = 0x1a + IFLA_GROUP = 0x1b + IFLA_NET_NS_FD = 0x1c + IFLA_EXT_MASK = 0x1d + IFLA_PROMISCUITY = 0x1e + IFLA_NUM_TX_QUEUES = 0x1f + IFLA_NUM_RX_QUEUES = 0x20 + IFLA_CARRIER = 0x21 + IFLA_PHYS_PORT_ID = 0x22 + IFLA_CARRIER_CHANGES = 0x23 + IFLA_PHYS_SWITCH_ID = 0x24 + IFLA_LINK_NETNSID = 0x25 + IFLA_PHYS_PORT_NAME = 0x26 + IFLA_PROTO_DOWN = 0x27 + IFLA_GSO_MAX_SEGS = 0x28 + IFLA_GSO_MAX_SIZE = 0x29 + IFLA_PAD = 0x2a + IFLA_XDP = 0x2b + IFLA_EVENT = 0x2c + IFLA_NEW_NETNSID = 0x2d + IFLA_IF_NETNSID = 0x2e + IFLA_MAX = 0x33 + RT_SCOPE_UNIVERSE = 0x0 + RT_SCOPE_SITE = 0xc8 + RT_SCOPE_LINK = 0xfd + RT_SCOPE_HOST = 0xfe + RT_SCOPE_NOWHERE = 0xff + RT_TABLE_UNSPEC = 0x0 + RT_TABLE_COMPAT = 0xfc + RT_TABLE_DEFAULT = 0xfd + RT_TABLE_MAIN = 0xfe + RT_TABLE_LOCAL = 0xff + RT_TABLE_MAX = 0xffffffff + RTA_UNSPEC = 0x0 + RTA_DST = 0x1 + RTA_SRC = 0x2 + RTA_IIF = 0x3 + RTA_OIF = 0x4 + RTA_GATEWAY = 0x5 + RTA_PRIORITY = 0x6 + RTA_PREFSRC = 0x7 + RTA_METRICS = 0x8 + RTA_MULTIPATH = 0x9 + RTA_FLOW = 0xb + RTA_CACHEINFO = 0xc + RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d + RTN_UNSPEC = 0x0 + RTN_UNICAST = 0x1 + RTN_LOCAL = 0x2 + RTN_BROADCAST = 0x3 + RTN_ANYCAST = 0x4 + RTN_MULTICAST = 0x5 + RTN_BLACKHOLE = 0x6 + RTN_UNREACHABLE = 0x7 + RTN_PROHIBIT = 0x8 + RTN_THROW = 0x9 + RTN_NAT = 0xa + RTN_XRESOLVE = 0xb + RTNLGRP_NONE = 0x0 + RTNLGRP_LINK = 0x1 + RTNLGRP_NOTIFY = 0x2 + RTNLGRP_NEIGH = 0x3 + RTNLGRP_TC = 0x4 + RTNLGRP_IPV4_IFADDR = 0x5 + RTNLGRP_IPV4_MROUTE = 0x6 + RTNLGRP_IPV4_ROUTE = 0x7 + RTNLGRP_IPV4_RULE = 0x8 + RTNLGRP_IPV6_IFADDR = 0x9 + RTNLGRP_IPV6_MROUTE = 0xa + RTNLGRP_IPV6_ROUTE = 0xb + RTNLGRP_IPV6_IFINFO = 0xc + RTNLGRP_IPV6_PREFIX = 0x12 + RTNLGRP_IPV6_RULE = 0x13 + RTNLGRP_ND_USEROPT = 0x14 + SizeofNlMsghdr = 0x10 + SizeofNlMsgerr = 0x14 + SizeofRtGenmsg = 0x1 + SizeofNlAttr = 0x4 + SizeofRtAttr = 0x4 + SizeofIfInfomsg = 0x10 + SizeofIfAddrmsg = 0x8 + SizeofRtMsg = 0xc + SizeofRtNexthop = 0x8 +) + +type NlMsghdr struct { + Len uint32 + Type uint16 + Flags uint16 + Seq uint32 + Pid uint32 +} + +type NlMsgerr struct { + Error int32 + Msg NlMsghdr +} + +type RtGenmsg struct { + Family uint8 +} + +type NlAttr struct { + Len uint16 + Type uint16 +} + +type RtAttr struct { + Len uint16 + Type uint16 +} + +type IfInfomsg struct { + Family uint8 + _ uint8 + Type uint16 + Index int32 + Flags uint32 + Change uint32 +} + +type IfAddrmsg struct { + Family uint8 + Prefixlen uint8 + Flags uint8 + Scope uint8 + Index uint32 +} + +type RtMsg struct { + Family uint8 + Dst_len uint8 + Src_len uint8 + Tos uint8 + Table uint8 + Protocol uint8 + Scope uint8 + Type uint8 + Flags uint32 +} + +type RtNexthop struct { + Len uint16 + Flags uint8 + Hops uint8 + Ifindex int32 +} + +const ( + SizeofSockFilter = 0x8 + SizeofSockFprog = 0x10 +) + +type SockFilter struct { + Code uint16 + Jt uint8 + Jf uint8 + K uint32 +} + +type SockFprog struct { + Len uint16 + _ [6]byte + Filter *SockFilter +} + +type InotifyEvent struct { + Wd int32 + Mask uint32 + Cookie uint32 + Len uint32 +} + +const SizeofInotifyEvent = 0x10 + +type PtraceRegs struct { + Pc uint64 + Ra uint64 + Sp uint64 + Gp uint64 + Tp uint64 + T0 uint64 + T1 uint64 + T2 uint64 + S0 uint64 + S1 uint64 + A0 uint64 + A1 uint64 + A2 uint64 + A3 uint64 + A4 uint64 + A5 uint64 + A6 uint64 + A7 uint64 + S2 uint64 + S3 uint64 + S4 uint64 + S5 uint64 + S6 uint64 + S7 uint64 + S8 uint64 + S9 uint64 + S10 uint64 + S11 uint64 + T3 uint64 + T4 uint64 + T5 uint64 + T6 uint64 +} + +type FdSet struct { + Bits [16]int64 +} + +type Sysinfo_t struct { + Uptime int64 + Loads [3]uint64 + Totalram uint64 + Freeram uint64 + Sharedram uint64 + Bufferram uint64 + Totalswap uint64 + Freeswap uint64 + Procs uint16 + Pad uint16 + _ [4]byte + Totalhigh uint64 + Freehigh uint64 + Unit uint32 + _ [0]uint8 + _ [4]byte +} + +type Utsname struct { + Sysname [65]byte + Nodename [65]byte + Release [65]byte + Version [65]byte + Machine [65]byte + Domainname [65]byte +} + +type Ustat_t struct { + Tfree int32 + _ [4]byte + Tinode uint64 + Fname [6]uint8 + Fpack [6]uint8 + _ [4]byte +} + +type EpollEvent struct { + Events uint32 + Fd int32 + Pad int32 +} + +const ( + AT_EMPTY_PATH = 0x1000 + AT_FDCWD = -0x64 + AT_NO_AUTOMOUNT = 0x800 + AT_REMOVEDIR = 0x200 + + AT_STATX_SYNC_AS_STAT = 0x0 + AT_STATX_FORCE_SYNC = 0x2000 + AT_STATX_DONT_SYNC = 0x4000 + + AT_SYMLINK_FOLLOW = 0x400 + AT_SYMLINK_NOFOLLOW = 0x100 + + AT_EACCESS = 0x200 +) + +type PollFd struct { + Fd int32 + Events int16 + Revents int16 +} + +const ( + POLLIN = 0x1 + POLLPRI = 0x2 + POLLOUT = 0x4 + POLLRDHUP = 0x2000 + POLLERR = 0x8 + POLLHUP = 0x10 + POLLNVAL = 0x20 +) + +type Sigset_t struct { + Val [16]uint64 +} + +const RNDGETENTCNT = 0x80045200 + +const PERF_IOC_FLAG_GROUP = 0x1 + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Line uint8 + Cc [19]uint8 + Ispeed uint32 + Ospeed uint32 +} + +type Winsize struct { + Row uint16 + Col uint16 + Xpixel uint16 + Ypixel uint16 +} + +type Taskstats struct { + Version uint16 + _ [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + _ [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]uint8 + Ac_sched uint8 + Ac_pad [3]uint8 + _ [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + _ [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type CGroupStats struct { + Sleeping uint64 + Running uint64 + Stopped uint64 + Uninterruptible uint64 + Io_wait uint64 +} + +const ( + CGROUPSTATS_CMD_UNSPEC = 0x3 + CGROUPSTATS_CMD_GET = 0x4 + CGROUPSTATS_CMD_NEW = 0x5 + CGROUPSTATS_TYPE_UNSPEC = 0x0 + CGROUPSTATS_TYPE_CGROUP_STATS = 0x1 + CGROUPSTATS_CMD_ATTR_UNSPEC = 0x0 + CGROUPSTATS_CMD_ATTR_FD = 0x1 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) + +type cpuMask uint64 + +const ( + _CPU_SETSIZE = 0x400 + _NCPUBITS = 0x40 +) + +const ( + BDADDR_BREDR = 0x0 + BDADDR_LE_PUBLIC = 0x1 + BDADDR_LE_RANDOM = 0x2 +) + +type PerfEventAttr struct { + Type uint32 + Size uint32 + Config uint64 + Sample uint64 + Sample_type uint64 + Read_format uint64 + Bits uint64 + Wakeup uint32 + Bp_type uint32 + Ext1 uint64 + Ext2 uint64 + Branch_sample_type uint64 + Sample_regs_user uint64 + Sample_stack_user uint32 + Clockid int32 + Sample_regs_intr uint64 + Aux_watermark uint32 + _ uint32 +} + +type PerfEventMmapPage struct { + Version uint32 + Compat_version uint32 + Lock uint32 + Index uint32 + Offset int64 + Time_enabled uint64 + Time_running uint64 + Capabilities uint64 + Pmc_width uint16 + Time_shift uint16 + Time_mult uint32 + Time_offset uint64 + Time_zero uint64 + Size uint32 + _ [948]uint8 + Data_head uint64 + Data_tail uint64 + Data_offset uint64 + Data_size uint64 + Aux_head uint64 + Aux_tail uint64 + Aux_offset uint64 + Aux_size uint64 +} + +const ( + PerfBitDisabled uint64 = CBitFieldMaskBit0 + PerfBitInherit = CBitFieldMaskBit1 + PerfBitPinned = CBitFieldMaskBit2 + PerfBitExclusive = CBitFieldMaskBit3 + PerfBitExcludeUser = CBitFieldMaskBit4 + PerfBitExcludeKernel = CBitFieldMaskBit5 + PerfBitExcludeHv = CBitFieldMaskBit6 + PerfBitExcludeIdle = CBitFieldMaskBit7 + PerfBitMmap = CBitFieldMaskBit8 + PerfBitComm = CBitFieldMaskBit9 + PerfBitFreq = CBitFieldMaskBit10 + PerfBitInheritStat = CBitFieldMaskBit11 + PerfBitEnableOnExec = CBitFieldMaskBit12 + PerfBitTask = CBitFieldMaskBit13 + PerfBitWatermark = CBitFieldMaskBit14 + PerfBitPreciseIPBit1 = CBitFieldMaskBit15 + PerfBitPreciseIPBit2 = CBitFieldMaskBit16 + PerfBitMmapData = CBitFieldMaskBit17 + PerfBitSampleIDAll = CBitFieldMaskBit18 + PerfBitExcludeHost = CBitFieldMaskBit19 + PerfBitExcludeGuest = CBitFieldMaskBit20 + PerfBitExcludeCallchainKernel = CBitFieldMaskBit21 + PerfBitExcludeCallchainUser = CBitFieldMaskBit22 + PerfBitMmap2 = CBitFieldMaskBit23 + PerfBitCommExec = CBitFieldMaskBit24 + PerfBitUseClockID = CBitFieldMaskBit25 + PerfBitContextSwitch = CBitFieldMaskBit26 +) + +const ( + PERF_TYPE_HARDWARE = 0x0 + PERF_TYPE_SOFTWARE = 0x1 + PERF_TYPE_TRACEPOINT = 0x2 + PERF_TYPE_HW_CACHE = 0x3 + PERF_TYPE_RAW = 0x4 + PERF_TYPE_BREAKPOINT = 0x5 + + PERF_COUNT_HW_CPU_CYCLES = 0x0 + PERF_COUNT_HW_INSTRUCTIONS = 0x1 + PERF_COUNT_HW_CACHE_REFERENCES = 0x2 + PERF_COUNT_HW_CACHE_MISSES = 0x3 + PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4 + PERF_COUNT_HW_BRANCH_MISSES = 0x5 + PERF_COUNT_HW_BUS_CYCLES = 0x6 + PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7 + PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8 + PERF_COUNT_HW_REF_CPU_CYCLES = 0x9 + + PERF_COUNT_HW_CACHE_L1D = 0x0 + PERF_COUNT_HW_CACHE_L1I = 0x1 + PERF_COUNT_HW_CACHE_LL = 0x2 + PERF_COUNT_HW_CACHE_DTLB = 0x3 + PERF_COUNT_HW_CACHE_ITLB = 0x4 + PERF_COUNT_HW_CACHE_BPU = 0x5 + PERF_COUNT_HW_CACHE_NODE = 0x6 + + PERF_COUNT_HW_CACHE_OP_READ = 0x0 + PERF_COUNT_HW_CACHE_OP_WRITE = 0x1 + PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2 + + PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0 + PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1 + + PERF_COUNT_SW_CPU_CLOCK = 0x0 + PERF_COUNT_SW_TASK_CLOCK = 0x1 + PERF_COUNT_SW_PAGE_FAULTS = 0x2 + PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3 + PERF_COUNT_SW_CPU_MIGRATIONS = 0x4 + PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5 + PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6 + PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7 + PERF_COUNT_SW_EMULATION_FAULTS = 0x8 + PERF_COUNT_SW_DUMMY = 0x9 + + PERF_SAMPLE_IP = 0x1 + PERF_SAMPLE_TID = 0x2 + PERF_SAMPLE_TIME = 0x4 + PERF_SAMPLE_ADDR = 0x8 + PERF_SAMPLE_READ = 0x10 + PERF_SAMPLE_CALLCHAIN = 0x20 + PERF_SAMPLE_ID = 0x40 + PERF_SAMPLE_CPU = 0x80 + PERF_SAMPLE_PERIOD = 0x100 + PERF_SAMPLE_STREAM_ID = 0x200 + PERF_SAMPLE_RAW = 0x400 + PERF_SAMPLE_BRANCH_STACK = 0x800 + + PERF_SAMPLE_BRANCH_USER = 0x1 + PERF_SAMPLE_BRANCH_KERNEL = 0x2 + PERF_SAMPLE_BRANCH_HV = 0x4 + PERF_SAMPLE_BRANCH_ANY = 0x8 + PERF_SAMPLE_BRANCH_ANY_CALL = 0x10 + PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20 + PERF_SAMPLE_BRANCH_IND_CALL = 0x40 + + PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1 + PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2 + PERF_FORMAT_ID = 0x4 + PERF_FORMAT_GROUP = 0x8 + + PERF_RECORD_MMAP = 0x1 + PERF_RECORD_LOST = 0x2 + PERF_RECORD_COMM = 0x3 + PERF_RECORD_EXIT = 0x4 + PERF_RECORD_THROTTLE = 0x5 + PERF_RECORD_UNTHROTTLE = 0x6 + PERF_RECORD_FORK = 0x7 + PERF_RECORD_READ = 0x8 + PERF_RECORD_SAMPLE = 0x9 + + PERF_CONTEXT_HV = -0x20 + PERF_CONTEXT_KERNEL = -0x80 + PERF_CONTEXT_USER = -0x200 + + PERF_CONTEXT_GUEST = -0x800 + PERF_CONTEXT_GUEST_KERNEL = -0x880 + PERF_CONTEXT_GUEST_USER = -0xa00 + + PERF_FLAG_FD_NO_GROUP = 0x1 + PERF_FLAG_FD_OUTPUT = 0x2 + PERF_FLAG_PID_CGROUP = 0x4 +) + +const ( + CBitFieldMaskBit0 = 0x1 + CBitFieldMaskBit1 = 0x2 + CBitFieldMaskBit2 = 0x4 + CBitFieldMaskBit3 = 0x8 + CBitFieldMaskBit4 = 0x10 + CBitFieldMaskBit5 = 0x20 + CBitFieldMaskBit6 = 0x40 + CBitFieldMaskBit7 = 0x80 + CBitFieldMaskBit8 = 0x100 + CBitFieldMaskBit9 = 0x200 + CBitFieldMaskBit10 = 0x400 + CBitFieldMaskBit11 = 0x800 + CBitFieldMaskBit12 = 0x1000 + CBitFieldMaskBit13 = 0x2000 + CBitFieldMaskBit14 = 0x4000 + CBitFieldMaskBit15 = 0x8000 + CBitFieldMaskBit16 = 0x10000 + CBitFieldMaskBit17 = 0x20000 + CBitFieldMaskBit18 = 0x40000 + CBitFieldMaskBit19 = 0x80000 + CBitFieldMaskBit20 = 0x100000 + CBitFieldMaskBit21 = 0x200000 + CBitFieldMaskBit22 = 0x400000 + CBitFieldMaskBit23 = 0x800000 + CBitFieldMaskBit24 = 0x1000000 + CBitFieldMaskBit25 = 0x2000000 + CBitFieldMaskBit26 = 0x4000000 + CBitFieldMaskBit27 = 0x8000000 + CBitFieldMaskBit28 = 0x10000000 + CBitFieldMaskBit29 = 0x20000000 + CBitFieldMaskBit30 = 0x40000000 + CBitFieldMaskBit31 = 0x80000000 + CBitFieldMaskBit32 = 0x100000000 + CBitFieldMaskBit33 = 0x200000000 + CBitFieldMaskBit34 = 0x400000000 + CBitFieldMaskBit35 = 0x800000000 + CBitFieldMaskBit36 = 0x1000000000 + CBitFieldMaskBit37 = 0x2000000000 + CBitFieldMaskBit38 = 0x4000000000 + CBitFieldMaskBit39 = 0x8000000000 + CBitFieldMaskBit40 = 0x10000000000 + CBitFieldMaskBit41 = 0x20000000000 + CBitFieldMaskBit42 = 0x40000000000 + CBitFieldMaskBit43 = 0x80000000000 + CBitFieldMaskBit44 = 0x100000000000 + CBitFieldMaskBit45 = 0x200000000000 + CBitFieldMaskBit46 = 0x400000000000 + CBitFieldMaskBit47 = 0x800000000000 + CBitFieldMaskBit48 = 0x1000000000000 + CBitFieldMaskBit49 = 0x2000000000000 + CBitFieldMaskBit50 = 0x4000000000000 + CBitFieldMaskBit51 = 0x8000000000000 + CBitFieldMaskBit52 = 0x10000000000000 + CBitFieldMaskBit53 = 0x20000000000000 + CBitFieldMaskBit54 = 0x40000000000000 + CBitFieldMaskBit55 = 0x80000000000000 + CBitFieldMaskBit56 = 0x100000000000000 + CBitFieldMaskBit57 = 0x200000000000000 + CBitFieldMaskBit58 = 0x400000000000000 + CBitFieldMaskBit59 = 0x800000000000000 + CBitFieldMaskBit60 = 0x1000000000000000 + CBitFieldMaskBit61 = 0x2000000000000000 + CBitFieldMaskBit62 = 0x4000000000000000 + CBitFieldMaskBit63 = 0x8000000000000000 +) + +type SockaddrStorage struct { + Family uint16 + _ [118]uint8 + _ uint64 +} + +type TCPMD5Sig struct { + Addr SockaddrStorage + Flags uint8 + Prefixlen uint8 + Keylen uint16 + _ uint32 + Key [80]uint8 +} + +type HDDriveCmdHdr struct { + Command uint8 + Number uint8 + Feature uint8 + Count uint8 +} + +type HDGeometry struct { + Heads uint8 + Sectors uint8 + Cylinders uint16 + _ [4]byte + Start uint64 +} + +type HDDriveID struct { + Config uint16 + Cyls uint16 + Reserved2 uint16 + Heads uint16 + Track_bytes uint16 + Sector_bytes uint16 + Sectors uint16 + Vendor0 uint16 + Vendor1 uint16 + Vendor2 uint16 + Serial_no [20]uint8 + Buf_type uint16 + Buf_size uint16 + Ecc_bytes uint16 + Fw_rev [8]uint8 + Model [40]uint8 + Max_multsect uint8 + Vendor3 uint8 + Dword_io uint16 + Vendor4 uint8 + Capability uint8 + Reserved50 uint16 + Vendor5 uint8 + TPIO uint8 + Vendor6 uint8 + TDMA uint8 + Field_valid uint16 + Cur_cyls uint16 + Cur_heads uint16 + Cur_sectors uint16 + Cur_capacity0 uint16 + Cur_capacity1 uint16 + Multsect uint8 + Multsect_valid uint8 + Lba_capacity uint32 + Dma_1word uint16 + Dma_mword uint16 + Eide_pio_modes uint16 + Eide_dma_min uint16 + Eide_dma_time uint16 + Eide_pio uint16 + Eide_pio_iordy uint16 + Words69_70 [2]uint16 + Words71_74 [4]uint16 + Queue_depth uint16 + Words76_79 [4]uint16 + Major_rev_num uint16 + Minor_rev_num uint16 + Command_set_1 uint16 + Command_set_2 uint16 + Cfsse uint16 + Cfs_enable_1 uint16 + Cfs_enable_2 uint16 + Csf_default uint16 + Dma_ultra uint16 + Trseuc uint16 + TrsEuc uint16 + CurAPMvalues uint16 + Mprc uint16 + Hw_config uint16 + Acoustic uint16 + Msrqs uint16 + Sxfert uint16 + Sal uint16 + Spg uint32 + Lba_capacity_2 uint64 + Words104_125 [22]uint16 + Last_lun uint16 + Word127 uint16 + Dlf uint16 + Csfo uint16 + Words130_155 [26]uint16 + Word156 uint16 + Words157_159 [3]uint16 + Cfa_power uint16 + Words161_175 [15]uint16 + Words176_205 [30]uint16 + Words206_254 [49]uint16 + Integrity_word uint16 +} + +type Statfs_t struct { + Type int64 + Bsize int64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint64 + Ffree uint64 + Fsid Fsid + Namelen int64 + Frsize int64 + Flags int64 + Spare [4]int64 +} + +const ( + ST_MANDLOCK = 0x40 + ST_NOATIME = 0x400 + ST_NODEV = 0x4 + ST_NODIRATIME = 0x800 + ST_NOEXEC = 0x8 + ST_NOSUID = 0x2 + ST_RDONLY = 0x1 + ST_RELATIME = 0x1000 + ST_SYNCHRONOUS = 0x10 +) + +type TpacketHdr struct { + Status uint64 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Sec uint32 + Usec uint32 + _ [4]byte +} + +type Tpacket2Hdr struct { + Status uint32 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Sec uint32 + Nsec uint32 + Vlan_tci uint16 + Vlan_tpid uint16 + _ [4]uint8 +} + +type Tpacket3Hdr struct { + Next_offset uint32 + Sec uint32 + Nsec uint32 + Snaplen uint32 + Len uint32 + Status uint32 + Mac uint16 + Net uint16 + Hv1 TpacketHdrVariant1 + _ [8]uint8 +} + +type TpacketHdrVariant1 struct { + Rxhash uint32 + Vlan_tci uint32 + Vlan_tpid uint16 + _ uint16 +} + +type TpacketBlockDesc struct { + Version uint32 + To_priv uint32 + Hdr [40]byte +} + +type TpacketReq struct { + Block_size uint32 + Block_nr uint32 + Frame_size uint32 + Frame_nr uint32 +} + +type TpacketReq3 struct { + Block_size uint32 + Block_nr uint32 + Frame_size uint32 + Frame_nr uint32 + Retire_blk_tov uint32 + Sizeof_priv uint32 + Feature_req_word uint32 +} + +type TpacketStats struct { + Packets uint32 + Drops uint32 +} + +type TpacketStatsV3 struct { + Packets uint32 + Drops uint32 + Freeze_q_cnt uint32 +} + +type TpacketAuxdata struct { + Status uint32 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Vlan_tci uint16 + Vlan_tpid uint16 +} + +const ( + TPACKET_V1 = 0x0 + TPACKET_V2 = 0x1 + TPACKET_V3 = 0x2 +) + +const ( + SizeofTpacketHdr = 0x20 + SizeofTpacket2Hdr = 0x20 + SizeofTpacket3Hdr = 0x30 +) + +const ( + NF_INET_PRE_ROUTING = 0x0 + NF_INET_LOCAL_IN = 0x1 + NF_INET_FORWARD = 0x2 + NF_INET_LOCAL_OUT = 0x3 + NF_INET_POST_ROUTING = 0x4 + NF_INET_NUMHOOKS = 0x5 +) + +const ( + NF_NETDEV_INGRESS = 0x0 + NF_NETDEV_NUMHOOKS = 0x1 +) + +const ( + NFPROTO_UNSPEC = 0x0 + NFPROTO_INET = 0x1 + NFPROTO_IPV4 = 0x2 + NFPROTO_ARP = 0x3 + NFPROTO_NETDEV = 0x5 + NFPROTO_BRIDGE = 0x7 + NFPROTO_IPV6 = 0xa + NFPROTO_DECNET = 0xc + NFPROTO_NUMPROTO = 0xd +) + +type Nfgenmsg struct { + Nfgen_family uint8 + Version uint8 + Res_id uint16 +} + +const ( + NFNL_BATCH_UNSPEC = 0x0 + NFNL_BATCH_GENID = 0x1 +) + +const ( + NFT_REG_VERDICT = 0x0 + NFT_REG_1 = 0x1 + NFT_REG_2 = 0x2 + NFT_REG_3 = 0x3 + NFT_REG_4 = 0x4 + NFT_REG32_00 = 0x8 + NFT_REG32_01 = 0x9 + NFT_REG32_02 = 0xa + NFT_REG32_03 = 0xb + NFT_REG32_04 = 0xc + NFT_REG32_05 = 0xd + NFT_REG32_06 = 0xe + NFT_REG32_07 = 0xf + NFT_REG32_08 = 0x10 + NFT_REG32_09 = 0x11 + NFT_REG32_10 = 0x12 + NFT_REG32_11 = 0x13 + NFT_REG32_12 = 0x14 + NFT_REG32_13 = 0x15 + NFT_REG32_14 = 0x16 + NFT_REG32_15 = 0x17 + NFT_CONTINUE = -0x1 + NFT_BREAK = -0x2 + NFT_JUMP = -0x3 + NFT_GOTO = -0x4 + NFT_RETURN = -0x5 + NFT_MSG_NEWTABLE = 0x0 + NFT_MSG_GETTABLE = 0x1 + NFT_MSG_DELTABLE = 0x2 + NFT_MSG_NEWCHAIN = 0x3 + NFT_MSG_GETCHAIN = 0x4 + NFT_MSG_DELCHAIN = 0x5 + NFT_MSG_NEWRULE = 0x6 + NFT_MSG_GETRULE = 0x7 + NFT_MSG_DELRULE = 0x8 + NFT_MSG_NEWSET = 0x9 + NFT_MSG_GETSET = 0xa + NFT_MSG_DELSET = 0xb + NFT_MSG_NEWSETELEM = 0xc + NFT_MSG_GETSETELEM = 0xd + NFT_MSG_DELSETELEM = 0xe + NFT_MSG_NEWGEN = 0xf + NFT_MSG_GETGEN = 0x10 + NFT_MSG_TRACE = 0x11 + NFT_MSG_NEWOBJ = 0x12 + NFT_MSG_GETOBJ = 0x13 + NFT_MSG_DELOBJ = 0x14 + NFT_MSG_GETOBJ_RESET = 0x15 + NFT_MSG_MAX = 0x19 + NFTA_LIST_UNPEC = 0x0 + NFTA_LIST_ELEM = 0x1 + NFTA_HOOK_UNSPEC = 0x0 + NFTA_HOOK_HOOKNUM = 0x1 + NFTA_HOOK_PRIORITY = 0x2 + NFTA_HOOK_DEV = 0x3 + NFT_TABLE_F_DORMANT = 0x1 + NFTA_TABLE_UNSPEC = 0x0 + NFTA_TABLE_NAME = 0x1 + NFTA_TABLE_FLAGS = 0x2 + NFTA_TABLE_USE = 0x3 + NFTA_CHAIN_UNSPEC = 0x0 + NFTA_CHAIN_TABLE = 0x1 + NFTA_CHAIN_HANDLE = 0x2 + NFTA_CHAIN_NAME = 0x3 + NFTA_CHAIN_HOOK = 0x4 + NFTA_CHAIN_POLICY = 0x5 + NFTA_CHAIN_USE = 0x6 + NFTA_CHAIN_TYPE = 0x7 + NFTA_CHAIN_COUNTERS = 0x8 + NFTA_CHAIN_PAD = 0x9 + NFTA_RULE_UNSPEC = 0x0 + NFTA_RULE_TABLE = 0x1 + NFTA_RULE_CHAIN = 0x2 + NFTA_RULE_HANDLE = 0x3 + NFTA_RULE_EXPRESSIONS = 0x4 + NFTA_RULE_COMPAT = 0x5 + NFTA_RULE_POSITION = 0x6 + NFTA_RULE_USERDATA = 0x7 + NFTA_RULE_PAD = 0x8 + NFTA_RULE_ID = 0x9 + NFT_RULE_COMPAT_F_INV = 0x2 + NFT_RULE_COMPAT_F_MASK = 0x2 + NFTA_RULE_COMPAT_UNSPEC = 0x0 + NFTA_RULE_COMPAT_PROTO = 0x1 + NFTA_RULE_COMPAT_FLAGS = 0x2 + NFT_SET_ANONYMOUS = 0x1 + NFT_SET_CONSTANT = 0x2 + NFT_SET_INTERVAL = 0x4 + NFT_SET_MAP = 0x8 + NFT_SET_TIMEOUT = 0x10 + NFT_SET_EVAL = 0x20 + NFT_SET_OBJECT = 0x40 + NFT_SET_POL_PERFORMANCE = 0x0 + NFT_SET_POL_MEMORY = 0x1 + NFTA_SET_DESC_UNSPEC = 0x0 + NFTA_SET_DESC_SIZE = 0x1 + NFTA_SET_UNSPEC = 0x0 + NFTA_SET_TABLE = 0x1 + NFTA_SET_NAME = 0x2 + NFTA_SET_FLAGS = 0x3 + NFTA_SET_KEY_TYPE = 0x4 + NFTA_SET_KEY_LEN = 0x5 + NFTA_SET_DATA_TYPE = 0x6 + NFTA_SET_DATA_LEN = 0x7 + NFTA_SET_POLICY = 0x8 + NFTA_SET_DESC = 0x9 + NFTA_SET_ID = 0xa + NFTA_SET_TIMEOUT = 0xb + NFTA_SET_GC_INTERVAL = 0xc + NFTA_SET_USERDATA = 0xd + NFTA_SET_PAD = 0xe + NFTA_SET_OBJ_TYPE = 0xf + NFT_SET_ELEM_INTERVAL_END = 0x1 + NFTA_SET_ELEM_UNSPEC = 0x0 + NFTA_SET_ELEM_KEY = 0x1 + NFTA_SET_ELEM_DATA = 0x2 + NFTA_SET_ELEM_FLAGS = 0x3 + NFTA_SET_ELEM_TIMEOUT = 0x4 + NFTA_SET_ELEM_EXPIRATION = 0x5 + NFTA_SET_ELEM_USERDATA = 0x6 + NFTA_SET_ELEM_EXPR = 0x7 + NFTA_SET_ELEM_PAD = 0x8 + NFTA_SET_ELEM_OBJREF = 0x9 + NFTA_SET_ELEM_LIST_UNSPEC = 0x0 + NFTA_SET_ELEM_LIST_TABLE = 0x1 + NFTA_SET_ELEM_LIST_SET = 0x2 + NFTA_SET_ELEM_LIST_ELEMENTS = 0x3 + NFTA_SET_ELEM_LIST_SET_ID = 0x4 + NFT_DATA_VALUE = 0x0 + NFT_DATA_VERDICT = 0xffffff00 + NFTA_DATA_UNSPEC = 0x0 + NFTA_DATA_VALUE = 0x1 + NFTA_DATA_VERDICT = 0x2 + NFTA_VERDICT_UNSPEC = 0x0 + NFTA_VERDICT_CODE = 0x1 + NFTA_VERDICT_CHAIN = 0x2 + NFTA_EXPR_UNSPEC = 0x0 + NFTA_EXPR_NAME = 0x1 + NFTA_EXPR_DATA = 0x2 + NFTA_IMMEDIATE_UNSPEC = 0x0 + NFTA_IMMEDIATE_DREG = 0x1 + NFTA_IMMEDIATE_DATA = 0x2 + NFTA_BITWISE_UNSPEC = 0x0 + NFTA_BITWISE_SREG = 0x1 + NFTA_BITWISE_DREG = 0x2 + NFTA_BITWISE_LEN = 0x3 + NFTA_BITWISE_MASK = 0x4 + NFTA_BITWISE_XOR = 0x5 + NFT_BYTEORDER_NTOH = 0x0 + NFT_BYTEORDER_HTON = 0x1 + NFTA_BYTEORDER_UNSPEC = 0x0 + NFTA_BYTEORDER_SREG = 0x1 + NFTA_BYTEORDER_DREG = 0x2 + NFTA_BYTEORDER_OP = 0x3 + NFTA_BYTEORDER_LEN = 0x4 + NFTA_BYTEORDER_SIZE = 0x5 + NFT_CMP_EQ = 0x0 + NFT_CMP_NEQ = 0x1 + NFT_CMP_LT = 0x2 + NFT_CMP_LTE = 0x3 + NFT_CMP_GT = 0x4 + NFT_CMP_GTE = 0x5 + NFTA_CMP_UNSPEC = 0x0 + NFTA_CMP_SREG = 0x1 + NFTA_CMP_OP = 0x2 + NFTA_CMP_DATA = 0x3 + NFT_RANGE_EQ = 0x0 + NFT_RANGE_NEQ = 0x1 + NFTA_RANGE_UNSPEC = 0x0 + NFTA_RANGE_SREG = 0x1 + NFTA_RANGE_OP = 0x2 + NFTA_RANGE_FROM_DATA = 0x3 + NFTA_RANGE_TO_DATA = 0x4 + NFT_LOOKUP_F_INV = 0x1 + NFTA_LOOKUP_UNSPEC = 0x0 + NFTA_LOOKUP_SET = 0x1 + NFTA_LOOKUP_SREG = 0x2 + NFTA_LOOKUP_DREG = 0x3 + NFTA_LOOKUP_SET_ID = 0x4 + NFTA_LOOKUP_FLAGS = 0x5 + NFT_DYNSET_OP_ADD = 0x0 + NFT_DYNSET_OP_UPDATE = 0x1 + NFT_DYNSET_F_INV = 0x1 + NFTA_DYNSET_UNSPEC = 0x0 + NFTA_DYNSET_SET_NAME = 0x1 + NFTA_DYNSET_SET_ID = 0x2 + NFTA_DYNSET_OP = 0x3 + NFTA_DYNSET_SREG_KEY = 0x4 + NFTA_DYNSET_SREG_DATA = 0x5 + NFTA_DYNSET_TIMEOUT = 0x6 + NFTA_DYNSET_EXPR = 0x7 + NFTA_DYNSET_PAD = 0x8 + NFTA_DYNSET_FLAGS = 0x9 + NFT_PAYLOAD_LL_HEADER = 0x0 + NFT_PAYLOAD_NETWORK_HEADER = 0x1 + NFT_PAYLOAD_TRANSPORT_HEADER = 0x2 + NFT_PAYLOAD_CSUM_NONE = 0x0 + NFT_PAYLOAD_CSUM_INET = 0x1 + NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1 + NFTA_PAYLOAD_UNSPEC = 0x0 + NFTA_PAYLOAD_DREG = 0x1 + NFTA_PAYLOAD_BASE = 0x2 + NFTA_PAYLOAD_OFFSET = 0x3 + NFTA_PAYLOAD_LEN = 0x4 + NFTA_PAYLOAD_SREG = 0x5 + NFTA_PAYLOAD_CSUM_TYPE = 0x6 + NFTA_PAYLOAD_CSUM_OFFSET = 0x7 + NFTA_PAYLOAD_CSUM_FLAGS = 0x8 + NFT_EXTHDR_F_PRESENT = 0x1 + NFT_EXTHDR_OP_IPV6 = 0x0 + NFT_EXTHDR_OP_TCPOPT = 0x1 + NFTA_EXTHDR_UNSPEC = 0x0 + NFTA_EXTHDR_DREG = 0x1 + NFTA_EXTHDR_TYPE = 0x2 + NFTA_EXTHDR_OFFSET = 0x3 + NFTA_EXTHDR_LEN = 0x4 + NFTA_EXTHDR_FLAGS = 0x5 + NFTA_EXTHDR_OP = 0x6 + NFTA_EXTHDR_SREG = 0x7 + NFT_META_LEN = 0x0 + NFT_META_PROTOCOL = 0x1 + NFT_META_PRIORITY = 0x2 + NFT_META_MARK = 0x3 + NFT_META_IIF = 0x4 + NFT_META_OIF = 0x5 + NFT_META_IIFNAME = 0x6 + NFT_META_OIFNAME = 0x7 + NFT_META_IIFTYPE = 0x8 + NFT_META_OIFTYPE = 0x9 + NFT_META_SKUID = 0xa + NFT_META_SKGID = 0xb + NFT_META_NFTRACE = 0xc + NFT_META_RTCLASSID = 0xd + NFT_META_SECMARK = 0xe + NFT_META_NFPROTO = 0xf + NFT_META_L4PROTO = 0x10 + NFT_META_BRI_IIFNAME = 0x11 + NFT_META_BRI_OIFNAME = 0x12 + NFT_META_PKTTYPE = 0x13 + NFT_META_CPU = 0x14 + NFT_META_IIFGROUP = 0x15 + NFT_META_OIFGROUP = 0x16 + NFT_META_CGROUP = 0x17 + NFT_META_PRANDOM = 0x18 + NFT_RT_CLASSID = 0x0 + NFT_RT_NEXTHOP4 = 0x1 + NFT_RT_NEXTHOP6 = 0x2 + NFT_RT_TCPMSS = 0x3 + NFT_HASH_JENKINS = 0x0 + NFT_HASH_SYM = 0x1 + NFTA_HASH_UNSPEC = 0x0 + NFTA_HASH_SREG = 0x1 + NFTA_HASH_DREG = 0x2 + NFTA_HASH_LEN = 0x3 + NFTA_HASH_MODULUS = 0x4 + NFTA_HASH_SEED = 0x5 + NFTA_HASH_OFFSET = 0x6 + NFTA_HASH_TYPE = 0x7 + NFTA_META_UNSPEC = 0x0 + NFTA_META_DREG = 0x1 + NFTA_META_KEY = 0x2 + NFTA_META_SREG = 0x3 + NFTA_RT_UNSPEC = 0x0 + NFTA_RT_DREG = 0x1 + NFTA_RT_KEY = 0x2 + NFT_CT_STATE = 0x0 + NFT_CT_DIRECTION = 0x1 + NFT_CT_STATUS = 0x2 + NFT_CT_MARK = 0x3 + NFT_CT_SECMARK = 0x4 + NFT_CT_EXPIRATION = 0x5 + NFT_CT_HELPER = 0x6 + NFT_CT_L3PROTOCOL = 0x7 + NFT_CT_SRC = 0x8 + NFT_CT_DST = 0x9 + NFT_CT_PROTOCOL = 0xa + NFT_CT_PROTO_SRC = 0xb + NFT_CT_PROTO_DST = 0xc + NFT_CT_LABELS = 0xd + NFT_CT_PKTS = 0xe + NFT_CT_BYTES = 0xf + NFT_CT_AVGPKT = 0x10 + NFT_CT_ZONE = 0x11 + NFT_CT_EVENTMASK = 0x12 + NFTA_CT_UNSPEC = 0x0 + NFTA_CT_DREG = 0x1 + NFTA_CT_KEY = 0x2 + NFTA_CT_DIRECTION = 0x3 + NFTA_CT_SREG = 0x4 + NFT_LIMIT_PKTS = 0x0 + NFT_LIMIT_PKT_BYTES = 0x1 + NFT_LIMIT_F_INV = 0x1 + NFTA_LIMIT_UNSPEC = 0x0 + NFTA_LIMIT_RATE = 0x1 + NFTA_LIMIT_UNIT = 0x2 + NFTA_LIMIT_BURST = 0x3 + NFTA_LIMIT_TYPE = 0x4 + NFTA_LIMIT_FLAGS = 0x5 + NFTA_LIMIT_PAD = 0x6 + NFTA_COUNTER_UNSPEC = 0x0 + NFTA_COUNTER_BYTES = 0x1 + NFTA_COUNTER_PACKETS = 0x2 + NFTA_COUNTER_PAD = 0x3 + NFTA_LOG_UNSPEC = 0x0 + NFTA_LOG_GROUP = 0x1 + NFTA_LOG_PREFIX = 0x2 + NFTA_LOG_SNAPLEN = 0x3 + NFTA_LOG_QTHRESHOLD = 0x4 + NFTA_LOG_LEVEL = 0x5 + NFTA_LOG_FLAGS = 0x6 + NFTA_QUEUE_UNSPEC = 0x0 + NFTA_QUEUE_NUM = 0x1 + NFTA_QUEUE_TOTAL = 0x2 + NFTA_QUEUE_FLAGS = 0x3 + NFTA_QUEUE_SREG_QNUM = 0x4 + NFT_QUOTA_F_INV = 0x1 + NFT_QUOTA_F_DEPLETED = 0x2 + NFTA_QUOTA_UNSPEC = 0x0 + NFTA_QUOTA_BYTES = 0x1 + NFTA_QUOTA_FLAGS = 0x2 + NFTA_QUOTA_PAD = 0x3 + NFTA_QUOTA_CONSUMED = 0x4 + NFT_REJECT_ICMP_UNREACH = 0x0 + NFT_REJECT_TCP_RST = 0x1 + NFT_REJECT_ICMPX_UNREACH = 0x2 + NFT_REJECT_ICMPX_NO_ROUTE = 0x0 + NFT_REJECT_ICMPX_PORT_UNREACH = 0x1 + NFT_REJECT_ICMPX_HOST_UNREACH = 0x2 + NFT_REJECT_ICMPX_ADMIN_PROHIBITED = 0x3 + NFTA_REJECT_UNSPEC = 0x0 + NFTA_REJECT_TYPE = 0x1 + NFTA_REJECT_ICMP_CODE = 0x2 + NFT_NAT_SNAT = 0x0 + NFT_NAT_DNAT = 0x1 + NFTA_NAT_UNSPEC = 0x0 + NFTA_NAT_TYPE = 0x1 + NFTA_NAT_FAMILY = 0x2 + NFTA_NAT_REG_ADDR_MIN = 0x3 + NFTA_NAT_REG_ADDR_MAX = 0x4 + NFTA_NAT_REG_PROTO_MIN = 0x5 + NFTA_NAT_REG_PROTO_MAX = 0x6 + NFTA_NAT_FLAGS = 0x7 + NFTA_MASQ_UNSPEC = 0x0 + NFTA_MASQ_FLAGS = 0x1 + NFTA_MASQ_REG_PROTO_MIN = 0x2 + NFTA_MASQ_REG_PROTO_MAX = 0x3 + NFTA_REDIR_UNSPEC = 0x0 + NFTA_REDIR_REG_PROTO_MIN = 0x1 + NFTA_REDIR_REG_PROTO_MAX = 0x2 + NFTA_REDIR_FLAGS = 0x3 + NFTA_DUP_UNSPEC = 0x0 + NFTA_DUP_SREG_ADDR = 0x1 + NFTA_DUP_SREG_DEV = 0x2 + NFTA_FWD_UNSPEC = 0x0 + NFTA_FWD_SREG_DEV = 0x1 + NFTA_OBJREF_UNSPEC = 0x0 + NFTA_OBJREF_IMM_TYPE = 0x1 + NFTA_OBJREF_IMM_NAME = 0x2 + NFTA_OBJREF_SET_SREG = 0x3 + NFTA_OBJREF_SET_NAME = 0x4 + NFTA_OBJREF_SET_ID = 0x5 + NFTA_GEN_UNSPEC = 0x0 + NFTA_GEN_ID = 0x1 + NFTA_GEN_PROC_PID = 0x2 + NFTA_GEN_PROC_NAME = 0x3 + NFTA_FIB_UNSPEC = 0x0 + NFTA_FIB_DREG = 0x1 + NFTA_FIB_RESULT = 0x2 + NFTA_FIB_FLAGS = 0x3 + NFT_FIB_RESULT_UNSPEC = 0x0 + NFT_FIB_RESULT_OIF = 0x1 + NFT_FIB_RESULT_OIFNAME = 0x2 + NFT_FIB_RESULT_ADDRTYPE = 0x3 + NFTA_FIB_F_SADDR = 0x1 + NFTA_FIB_F_DADDR = 0x2 + NFTA_FIB_F_MARK = 0x4 + NFTA_FIB_F_IIF = 0x8 + NFTA_FIB_F_OIF = 0x10 + NFTA_FIB_F_PRESENT = 0x20 + NFTA_CT_HELPER_UNSPEC = 0x0 + NFTA_CT_HELPER_NAME = 0x1 + NFTA_CT_HELPER_L3PROTO = 0x2 + NFTA_CT_HELPER_L4PROTO = 0x3 + NFTA_OBJ_UNSPEC = 0x0 + NFTA_OBJ_TABLE = 0x1 + NFTA_OBJ_NAME = 0x2 + NFTA_OBJ_TYPE = 0x3 + NFTA_OBJ_DATA = 0x4 + NFTA_OBJ_USE = 0x5 + NFTA_TRACE_UNSPEC = 0x0 + NFTA_TRACE_TABLE = 0x1 + NFTA_TRACE_CHAIN = 0x2 + NFTA_TRACE_RULE_HANDLE = 0x3 + NFTA_TRACE_TYPE = 0x4 + NFTA_TRACE_VERDICT = 0x5 + NFTA_TRACE_ID = 0x6 + NFTA_TRACE_LL_HEADER = 0x7 + NFTA_TRACE_NETWORK_HEADER = 0x8 + NFTA_TRACE_TRANSPORT_HEADER = 0x9 + NFTA_TRACE_IIF = 0xa + NFTA_TRACE_IIFTYPE = 0xb + NFTA_TRACE_OIF = 0xc + NFTA_TRACE_OIFTYPE = 0xd + NFTA_TRACE_MARK = 0xe + NFTA_TRACE_NFPROTO = 0xf + NFTA_TRACE_POLICY = 0x10 + NFTA_TRACE_PAD = 0x11 + NFT_TRACETYPE_UNSPEC = 0x0 + NFT_TRACETYPE_POLICY = 0x1 + NFT_TRACETYPE_RETURN = 0x2 + NFT_TRACETYPE_RULE = 0x3 + NFTA_NG_UNSPEC = 0x0 + NFTA_NG_DREG = 0x1 + NFTA_NG_MODULUS = 0x2 + NFTA_NG_TYPE = 0x3 + NFTA_NG_OFFSET = 0x4 + NFT_NG_INCREMENTAL = 0x0 + NFT_NG_RANDOM = 0x1 +) + +type RTCTime struct { + Sec int32 + Min int32 + Hour int32 + Mday int32 + Mon int32 + Year int32 + Wday int32 + Yday int32 + Isdst int32 +} + +type RTCWkAlrm struct { + Enabled uint8 + Pending uint8 + _ [2]byte + Time RTCTime +} + +type RTCPLLInfo struct { + Ctrl int32 + Value int32 + Max int32 + Min int32 + Posmult int32 + Negmult int32 + Clock int64 +} + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x1269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index d32079d1aaa09..3c26ea82ba797 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) @@ -250,6 +250,13 @@ type RawSockaddrL2 struct { _ [1]byte } +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { Family uint16 _ [2]byte @@ -273,6 +280,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -405,9 +422,12 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 SizeofIovec = 0x10 SizeofIPMreq = 0x8 @@ -437,6 +457,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -480,7 +501,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x31 + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -505,6 +526,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -1870,3 +1905,115 @@ type RTCPLLInfo struct { Negmult int32 Clock int64 } + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + _ [4]byte + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x1269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 8e7384b89ca77..1fc7f7dea9c3f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -5,11 +5,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x1000 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go index 4b86fb2b33282..2dae0c17a3c20 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( @@ -402,6 +402,13 @@ type Winsize struct { Ypixel uint16 } +type Ptmget struct { + Cfd int32 + Sfd int32 + Cn [1024]byte + Sn [1024]byte +} + const ( AT_FDCWD = -0x64 AT_SYMLINK_NOFOLLOW = 0x200 @@ -446,3 +453,13 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Tickadj int32 + Stathz int32 + Profhz int32 +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go index 9048a509d0883..1f0e76c0ccc6e 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 ) type ( @@ -409,6 +409,13 @@ type Winsize struct { Ypixel uint16 } +type Ptmget struct { + Cfd int32 + Sfd int32 + Cn [1024]byte + Sn [1024]byte +} + const ( AT_FDCWD = -0x64 AT_SYMLINK_NOFOLLOW = 0x200 @@ -453,3 +460,13 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Tickadj int32 + Stathz int32 + Profhz int32 +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index 00525e7b02961..53f2159c7d2b0 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( @@ -407,6 +407,13 @@ type Winsize struct { Ypixel uint16 } +type Ptmget struct { + Cfd int32 + Sfd int32 + Cn [1024]byte + Sn [1024]byte +} + const ( AT_FDCWD = -0x64 AT_SYMLINK_NOFOLLOW = 0x200 @@ -451,3 +458,13 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofClockinfo = 0x14 + +type Clockinfo struct { + Hz int32 + Tick int32 + Tickadj int32 + Stathz int32 + Profhz int32 +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go index d5a2d75da3834..8b37d83992b6f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( @@ -56,23 +56,6 @@ type Rlimit struct { type _Gid_t uint32 -const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 -) - type Stat_t struct { Mode uint32 Dev int32 @@ -475,6 +458,8 @@ const ( POLLWRNORM = 0x4 ) +type Sigset_t uint32 + type Utsname struct { Sysname [256]byte Nodename [256]byte @@ -482,3 +467,94 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofUvmexp = 0x158 + +type Uvmexp struct { + Pagesize int32 + Pagemask int32 + Pageshift int32 + Npages int32 + Free int32 + Active int32 + Inactive int32 + Paging int32 + Wired int32 + Zeropages int32 + Reserve_pagedaemon int32 + Reserve_kernel int32 + Anonpages int32 + Vnodepages int32 + Vtextpages int32 + Freemin int32 + Freetarg int32 + Inactarg int32 + Wiredmax int32 + Anonmin int32 + Vtextmin int32 + Vnodemin int32 + Anonminpct int32 + Vtextminpct int32 + Vnodeminpct int32 + Nswapdev int32 + Swpages int32 + Swpginuse int32 + Swpgonly int32 + Nswget int32 + Nanon int32 + Nanonneeded int32 + Nfreeanon int32 + Faults int32 + Traps int32 + Intrs int32 + Swtch int32 + Softs int32 + Syscalls int32 + Pageins int32 + Obsolete_swapins int32 + Obsolete_swapouts int32 + Pgswapin int32 + Pgswapout int32 + Forks int32 + Forks_ppwait int32 + Forks_sharevm int32 + Pga_zerohit int32 + Pga_zeromiss int32 + Zeroaborts int32 + Fltnoram int32 + Fltnoanon int32 + Fltnoamap int32 + Fltpgwait int32 + Fltpgrele int32 + Fltrelck int32 + Fltrelckok int32 + Fltanget int32 + Fltanretry int32 + Fltamcopy int32 + Fltnamap int32 + Fltnomap int32 + Fltlget int32 + Fltget int32 + Flt_anon int32 + Flt_acow int32 + Flt_obj int32 + Flt_prcopy int32 + Flt_przero int32 + Pdwoke int32 + Pdrevs int32 + Pdswout int32 + Pdfreed int32 + Pdscans int32 + Pdanscan int32 + Pdobscan int32 + Pdreact int32 + Pdbusy int32 + Pdpageouts int32 + Pdpending int32 + Pddeact int32 + Pdreanon int32 + Pdrevnode int32 + Pdrevtext int32 + Fpswtch int32 + Kmapent int32 +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go index 5a9c8184859b5..6efea463559f8 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 ) type ( @@ -56,23 +56,6 @@ type Rlimit struct { type _Gid_t uint32 -const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 -) - type Stat_t struct { Mode uint32 Dev int32 @@ -475,6 +458,8 @@ const ( POLLWRNORM = 0x4 ) +type Sigset_t uint32 + type Utsname struct { Sysname [256]byte Nodename [256]byte @@ -482,3 +467,94 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofUvmexp = 0x158 + +type Uvmexp struct { + Pagesize int32 + Pagemask int32 + Pageshift int32 + Npages int32 + Free int32 + Active int32 + Inactive int32 + Paging int32 + Wired int32 + Zeropages int32 + Reserve_pagedaemon int32 + Reserve_kernel int32 + Anonpages int32 + Vnodepages int32 + Vtextpages int32 + Freemin int32 + Freetarg int32 + Inactarg int32 + Wiredmax int32 + Anonmin int32 + Vtextmin int32 + Vnodemin int32 + Anonminpct int32 + Vtextminpct int32 + Vnodeminpct int32 + Nswapdev int32 + Swpages int32 + Swpginuse int32 + Swpgonly int32 + Nswget int32 + Nanon int32 + Nanonneeded int32 + Nfreeanon int32 + Faults int32 + Traps int32 + Intrs int32 + Swtch int32 + Softs int32 + Syscalls int32 + Pageins int32 + Obsolete_swapins int32 + Obsolete_swapouts int32 + Pgswapin int32 + Pgswapout int32 + Forks int32 + Forks_ppwait int32 + Forks_sharevm int32 + Pga_zerohit int32 + Pga_zeromiss int32 + Zeroaborts int32 + Fltnoram int32 + Fltnoanon int32 + Fltnoamap int32 + Fltpgwait int32 + Fltpgrele int32 + Fltrelck int32 + Fltrelckok int32 + Fltanget int32 + Fltanretry int32 + Fltamcopy int32 + Fltnamap int32 + Fltnomap int32 + Fltlget int32 + Fltget int32 + Flt_anon int32 + Flt_acow int32 + Flt_obj int32 + Flt_prcopy int32 + Flt_przero int32 + Pdwoke int32 + Pdrevs int32 + Pdswout int32 + Pdfreed int32 + Pdscans int32 + Pdanscan int32 + Pdobscan int32 + Pdreact int32 + Pdbusy int32 + Pdpageouts int32 + Pdpending int32 + Pddeact int32 + Pdreanon int32 + Pdrevnode int32 + Pdrevtext int32 + Fpswtch int32 + Kmapent int32 +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go index e35b13b6fcf73..510efc3eaac69 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go @@ -1,4 +1,4 @@ -// cgo -godefs types_openbsd.go | go run mkpost.go +// cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,openbsd @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x4 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x4 - sizeofLongLong = 0x8 + SizeofPtr = 0x4 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x4 + SizeofLongLong = 0x8 ) type ( @@ -23,11 +23,13 @@ type ( type Timespec struct { Sec int64 Nsec int32 + _ [4]byte } type Timeval struct { Sec int64 Usec int32 + _ [4]byte } type Rusage struct { @@ -56,46 +58,31 @@ type Rlimit struct { type _Gid_t uint32 -const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 -) - type Stat_t struct { - Mode uint32 - Dev int32 - Ino uint64 - Nlink uint32 - Uid uint32 - Gid uint32 - Rdev int32 - Atim Timespec - Mtim Timespec - Ctim Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint32 - X__st_birthtim Timespec + Mode uint32 + Dev int32 + Ino uint64 + Nlink uint32 + Uid uint32 + Gid uint32 + Rdev int32 + Atim Timespec + Mtim Timespec + Ctim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + _ [4]byte + _ Timespec } type Statfs_t struct { F_flags uint32 F_bsize uint32 F_iosize uint32 + _ [4]byte F_blocks uint64 F_bfree uint64 F_bavail int64 @@ -110,11 +97,11 @@ type Statfs_t struct { F_namemax uint32 F_owner uint32 F_ctime uint64 - F_fstypename [16]uint8 - F_mntonname [90]uint8 - F_mntfromname [90]uint8 - F_mntfromspec [90]uint8 - Pad_cgo_0 [2]byte + F_fstypename [16]int8 + F_mntonname [90]int8 + F_mntfromname [90]int8 + F_mntfromspec [90]int8 + _ [2]byte Mount_info [160]byte } @@ -127,13 +114,13 @@ type Flock_t struct { } type Dirent struct { - Fileno uint64 - Off int64 - Reclen uint16 - Type uint8 - Namlen uint8 - X__d_padding [4]uint8 - Name [256]uint8 + Fileno uint64 + Off int64 + Reclen uint16 + Type uint8 + Namlen uint8 + _ [4]uint8 + Name [256]int8 } type Fsid struct { @@ -268,8 +255,10 @@ type Kevent_t struct { Filter int16 Flags uint16 Fflags uint32 + _ [4]byte Data int64 Udata *byte + _ [4]byte } type FdSet struct { @@ -277,8 +266,8 @@ type FdSet struct { } const ( - SizeofIfMsghdr = 0x98 - SizeofIfData = 0x80 + SizeofIfMsghdr = 0xa8 + SizeofIfData = 0x90 SizeofIfaMsghdr = 0x18 SizeofIfAnnounceMsghdr = 0x1a SizeofRtMsghdr = 0x60 @@ -307,7 +296,7 @@ type IfData struct { Link_state uint8 Mtu uint32 Metric uint32 - Pad uint32 + Rdomain uint32 Baudrate uint64 Ipackets uint64 Ierrors uint64 @@ -319,8 +308,10 @@ type IfData struct { Imcasts uint64 Omcasts uint64 Iqdrops uint64 + Oqdrops uint64 Noproto uint64 Capabilities uint32 + _ [4]byte Lastchange Timeval } @@ -345,7 +336,7 @@ type IfAnnounceMsghdr struct { Hdrlen uint16 Index uint16 What uint16 - Name [16]uint8 + Name [16]int8 } type RtMsghdr struct { @@ -415,11 +406,11 @@ type BpfInsn struct { } type BpfHdr struct { - Tstamp BpfTimeval - Caplen uint32 - Datalen uint32 - Hdrlen uint16 - Pad_cgo_0 [2]byte + Tstamp BpfTimeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + _ [2]byte } type BpfTimeval struct { @@ -468,6 +459,8 @@ const ( POLLWRNORM = 0x4 ) +type Sigset_t uint32 + type Utsname struct { Sysname [256]byte Nodename [256]byte @@ -475,3 +468,94 @@ type Utsname struct { Version [256]byte Machine [256]byte } + +const SizeofUvmexp = 0x158 + +type Uvmexp struct { + Pagesize int32 + Pagemask int32 + Pageshift int32 + Npages int32 + Free int32 + Active int32 + Inactive int32 + Paging int32 + Wired int32 + Zeropages int32 + Reserve_pagedaemon int32 + Reserve_kernel int32 + Unused01 int32 + Vnodepages int32 + Vtextpages int32 + Freemin int32 + Freetarg int32 + Inactarg int32 + Wiredmax int32 + Anonmin int32 + Vtextmin int32 + Vnodemin int32 + Anonminpct int32 + Vtextminpct int32 + Vnodeminpct int32 + Nswapdev int32 + Swpages int32 + Swpginuse int32 + Swpgonly int32 + Nswget int32 + Nanon int32 + Unused05 int32 + Unused06 int32 + Faults int32 + Traps int32 + Intrs int32 + Swtch int32 + Softs int32 + Syscalls int32 + Pageins int32 + Unused07 int32 + Unused08 int32 + Pgswapin int32 + Pgswapout int32 + Forks int32 + Forks_ppwait int32 + Forks_sharevm int32 + Pga_zerohit int32 + Pga_zeromiss int32 + Unused09 int32 + Fltnoram int32 + Fltnoanon int32 + Fltnoamap int32 + Fltpgwait int32 + Fltpgrele int32 + Fltrelck int32 + Fltrelckok int32 + Fltanget int32 + Fltanretry int32 + Fltamcopy int32 + Fltnamap int32 + Fltnomap int32 + Fltlget int32 + Fltget int32 + Flt_anon int32 + Flt_acow int32 + Flt_obj int32 + Flt_prcopy int32 + Flt_przero int32 + Pdwoke int32 + Pdrevs int32 + Pdswout int32 + Pdfreed int32 + Pdscans int32 + Pdanscan int32 + Pdobscan int32 + Pdreact int32 + Pdbusy int32 + Pdpageouts int32 + Pdpending int32 + Pddeact int32 + Unused11 int32 + Unused12 int32 + Unused13 int32 + Fpswtch int32 + Kmapent int32 +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go index 2248598d03f99..8531a190f2646 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go @@ -6,11 +6,11 @@ package unix const ( - sizeofPtr = 0x8 - sizeofShort = 0x2 - sizeofInt = 0x4 - sizeofLong = 0x8 - sizeofLongLong = 0x8 + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 PathMax = 0x400 MaxHostNameLen = 0x100 ) @@ -75,23 +75,6 @@ type Rlimit struct { type _Gid_t uint32 -const ( - S_IFMT = 0xf000 - S_IFIFO = 0x1000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFBLK = 0x6000 - S_IFREG = 0x8000 - S_IFLNK = 0xa000 - S_IFSOCK = 0xc000 - S_ISUID = 0x800 - S_ISGID = 0x400 - S_ISVTX = 0x200 - S_IRUSR = 0x100 - S_IWUSR = 0x80 - S_IXUSR = 0x40 -) - type Stat_t struct { Dev uint64 Ino uint64 diff --git a/src/cmd/vendor/vendor.json b/src/cmd/vendor/vendor.json index 89764c8c6fee3..7cfda75a5edbc 100644 --- a/src/cmd/vendor/vendor.json +++ b/src/cmd/vendor/vendor.json @@ -131,10 +131,10 @@ "revisionTime": "2018-05-24T11:38:20Z" }, { - "checksumSHA1": "VQyr/RTSmHpXD2wh988ZnWCVO6w=", + "checksumSHA1": "6AYGJTfvoIblJAxlh0AEIQrRKgo=", "path": "golang.org/x/sys/unix", - "revision": "7138fd3d9dc8335c567ca206f4333fb75eb05d56", - "revisionTime": "2018-06-27T13:57:12Z" + "revision": "b05ddf57801d2239d6ab0ee35f9d981e0420f4ac", + "revisionTime": "2018-12-11T16:24:22Z" }, { "checksumSHA1": "s+lofQ+SCdhmy0cQp9FpdQncuuI=", @@ -377,5 +377,5 @@ "revisionTime": "2018-11-05T19:48:08Z" } ], - "rootPath": "cmd" + "rootPath": "/cmd" } From a728b0ba7cf6316e0c2e79f8d725654a40d62081 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Wed, 12 Dec 2018 17:38:17 -0800 Subject: [PATCH 320/594] cmd/link: skip TestRuntimeTypeAttrInternal on windows/arm Updates #26148 Change-Id: Ide1fe821cc061a08488df9d40878131f37f894c9 Reviewed-on: https://go-review.googlesource.com/c/153844 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/dwarf_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cmd/link/internal/ld/dwarf_test.go b/src/cmd/link/internal/ld/dwarf_test.go index 4768a11c259c7..7bbe2b710cca2 100644 --- a/src/cmd/link/internal/ld/dwarf_test.go +++ b/src/cmd/link/internal/ld/dwarf_test.go @@ -870,6 +870,10 @@ func TestRuntimeTypeAttrInternal(t *testing.T) { t.Skip("skipping on plan9; no DWARF symbol table in executables") } + if runtime.GOOS == "windows" && runtime.GOARCH == "arm" { + t.Skip("skipping on windows/arm; test is incompatible with relocatable binaries") + } + testRuntimeTypeAttr(t, "-ldflags=-linkmode=internal") } From 98521a5a8f464d90898f7324171d9a78951e7342 Mon Sep 17 00:00:00 2001 From: Brian Kessler Date: Thu, 6 Sep 2018 12:06:45 -0600 Subject: [PATCH 321/594] math: implement trignometric range reduction for huge arguments This change implements Payne-Hanek range reduction by Pi/4 to properly calculate trigonometric functions of huge arguments. The implementation is based on: "ARGUMENT REDUCTION FOR HUGE ARGUMENTS: Good to the Last Bit" K. C. Ng et al, March 24, 1992 The major difference with the reference is that the simulated multi-precision calculation of x*B is implemented using 64-bit integer arithmetic rather than floating point to ease extraction of the relevant bits of 4/Pi. The assembly implementations for 386 were removed since the trigonometric instructions only use a 66-bit representation of Pi internally for reduction. It is not possible to use these instructions and maintain accuracy without a prior accurate reduction in software as recommended by Intel. Fixes #6794 Change-Id: I31bf1369e0578891d738c5473447fe9b10560196 Reviewed-on: https://go-review.googlesource.com/c/153059 Reviewed-by: Robert Griesemer Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot --- src/cmd/go/go_test.go | 4 +- src/go/build/deps_test.go | 2 +- src/math/all_test.go | 120 ++++++++++++++++++++++++++++++++++++++ src/math/export_test.go | 2 + src/math/sin.go | 64 +++++++++++--------- src/math/sin_386.s | 38 +----------- src/math/sincos.go | 29 ++++----- src/math/sincos_386.go | 13 ----- src/math/sincos_386.s | 28 --------- src/math/tan.go | 28 +++++---- src/math/tan_386.s | 21 +------ src/math/trig_reduce.go | 94 +++++++++++++++++++++++++++++ 12 files changed, 291 insertions(+), 152 deletions(-) delete mode 100644 src/math/sincos_386.go delete mode 100644 src/math/sincos_386.s create mode 100644 src/math/trig_reduce.go diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index d16ab3d76d52e..e2ddc58a5d6a7 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -1771,11 +1771,11 @@ func TestGoListDeps(t *testing.T) { if runtime.Compiler != "gccgo" { // Check the list is in dependency order. tg.run("list", "-deps", "math") - want := "internal/cpu\nunsafe\nmath\n" + want := "internal/cpu\nunsafe\nmath/bits\nmath\n" out := tg.stdout.String() if !strings.Contains(out, "internal/cpu") { // Some systems don't use internal/cpu. - want = "unsafe\nmath\n" + want = "unsafe\nmath/bits\nmath\n" } if tg.stdout.String() != want { t.Fatalf("list -deps math: wrong order\nhave %q\nwant %q", tg.stdout.String(), want) diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index 3a70991639e39..2c29a3e6018f7 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -61,7 +61,7 @@ var pkgDeps = map[string][]string{ // L1 adds simple functions and strings processing, // but not Unicode tables. - "math": {"internal/cpu", "unsafe"}, + "math": {"internal/cpu", "unsafe", "math/bits"}, "math/bits": {"unsafe"}, "math/cmplx": {"math"}, "math/rand": {"L0", "math"}, diff --git a/src/math/all_test.go b/src/math/all_test.go index 6a6d8bf6d0a08..5716048454fee 100644 --- a/src/math/all_test.go +++ b/src/math/all_test.go @@ -175,6 +175,48 @@ var cosLarge = []float64{ -2.51772931436786954751e-01, -7.3924135157173099849e-01, } + +// Inputs to test trig_reduce +var trigHuge = []float64{ + 1 << 120, + 1 << 240, + 1 << 480, + 1234567891234567 << 180, + 1234567891234567 << 300, + MaxFloat64, +} + +// Results for trigHuge[i] calculated with https://github.com/robpike/ivy +// using 4096 bits of working precision. Values requiring less than +// 102 decimal digits (1 << 120, 1 << 240, 1 << 480, 1234567891234567 << 180) +// were confirmed via https://keisan.casio.com/ +var cosHuge = []float64{ + -0.92587902285483787, + 0.93601042593353793, + -0.28282777640193788, + -0.14616431394103619, + -0.79456058210671406, + -0.99998768942655994, +} + +var sinHuge = []float64{ + 0.37782010936075202, + -0.35197227524865778, + 0.95917070894368716, + 0.98926032637023618, + -0.60718488235646949, + 0.00496195478918406, +} + +var tanHuge = []float64{ + -0.40806638884180424, + -0.37603456702698076, + -3.39135965054779932, + -6.76813854009065030, + 0.76417695016604922, + -0.00496201587444489, +} + var cosh = []float64{ 7.2668796942212842775517446e+01, 1.1479413465659254502011135e+03, @@ -3026,6 +3068,84 @@ func TestLargeTan(t *testing.T) { } } +// Check that trigReduce matches the standard reduction results for input values +// below reduceThreshold. +func TestTrigReduce(t *testing.T) { + inputs := make([]float64, len(vf)) + // all of the standard inputs + copy(inputs, vf) + // all of the large inputs + large := float64(100000 * Pi) + for _, v := range vf { + inputs = append(inputs, v+large) + } + // Also test some special inputs, Pi and right below the reduceThreshold + inputs = append(inputs, Pi, Nextafter(ReduceThreshold, 0)) + for _, x := range inputs { + // reduce the value to compare + j, z := TrigReduce(x) + xred := float64(j)*(Pi/4) + z + + if f, fred := Sin(x), Sin(xred); !close(f, fred) { + t.Errorf("Sin(trigReduce(%g)) != Sin(%g), got %g, want %g", x, x, fred, f) + } + if f, fred := Cos(x), Cos(xred); !close(f, fred) { + t.Errorf("Cos(trigReduce(%g)) != Cos(%g), got %g, want %g", x, x, fred, f) + } + if f, fred := Tan(x), Tan(xred); !close(f, fred) { + t.Errorf(" Tan(trigReduce(%g)) != Tan(%g), got %g, want %g", x, x, fred, f) + } + f, g := Sincos(x) + fred, gred := Sincos(xred) + if !close(f, fred) || !close(g, gred) { + t.Errorf(" Sincos(trigReduce(%g)) != Sincos(%g), got %g, %g, want %g, %g", x, x, fred, gred, f, g) + } + } +} + +// Check that trig values of huge angles return accurate results. +// This confirms that argument reduction works for very large values +// up to MaxFloat64. +func TestHugeCos(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1 := cosHuge[i] + f2 := Cos(trigHuge[i]) + if !close(f1, f2) { + t.Errorf("Cos(%g) = %g, want %g", trigHuge[i], f2, f1) + } + } +} + +func TestHugeSin(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1 := sinHuge[i] + f2 := Sin(trigHuge[i]) + if !close(f1, f2) { + t.Errorf("Sin(%g) = %g, want %g", trigHuge[i], f2, f1) + } + } +} + +func TestHugeSinCos(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1, g1 := sinHuge[i], cosHuge[i] + f2, g2 := Sincos(trigHuge[i]) + if !close(f1, f2) || !close(g1, g2) { + t.Errorf("Sincos(%g) = %g, %g, want %g, %g", trigHuge[i], f2, g2, f1, g1) + } + } +} + +func TestHugeTan(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1 := tanHuge[i] + f2 := Tan(trigHuge[i]) + if !close(f1, f2) { + t.Errorf("Tan(%g) = %g, want %g", trigHuge[i], f2, f1) + } + } +} + // Check that math constants are accepted by compiler // and have right value (assumes strconv.ParseFloat works). // https://golang.org/issue/201 diff --git a/src/math/export_test.go b/src/math/export_test.go index 368308e1e5d3f..5f15bdb025d2d 100644 --- a/src/math/export_test.go +++ b/src/math/export_test.go @@ -9,3 +9,5 @@ var ExpGo = exp var Exp2Go = exp2 var HypotGo = hypot var SqrtGo = sqrt +var ReduceThreshold = reduceThreshold +var TrigReduce = trigReduce diff --git a/src/math/sin.go b/src/math/sin.go index 929cac34ecaa6..cc8b1366ad37b 100644 --- a/src/math/sin.go +++ b/src/math/sin.go @@ -118,10 +118,9 @@ func Cos(x float64) float64 func cos(x float64) float64 { const ( - PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts - PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, - PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, - M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi + PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts + PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, + PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, ) // special cases switch { @@ -133,15 +132,23 @@ func cos(x float64) float64 { sign := false x = Abs(x) - j := int64(x * M4PI) // integer part of x/(Pi/4), as integer for tests on the phase angle - y := float64(j) // integer part of x/(Pi/4), as float - - // map zeros to origin - if j&1 == 1 { - j++ - y++ + var j uint64 + var y, z float64 + if x >= reduceThreshold { + j, z = trigReduce(x) + } else { + j = uint64(x * (4 / Pi)) // integer part of x/(Pi/4), as integer for tests on the phase angle + y = float64(j) // integer part of x/(Pi/4), as float + + // map zeros to origin + if j&1 == 1 { + j++ + y++ + } + j &= 7 // octant modulo 2Pi radians (360 degrees) + z = ((x - y*PI4A) - y*PI4B) - y*PI4C // Extended precision modular arithmetic } - j &= 7 // octant modulo 2Pi radians (360 degrees) + if j > 3 { j -= 4 sign = !sign @@ -150,7 +157,6 @@ func cos(x float64) float64 { sign = !sign } - z := ((x - y*PI4A) - y*PI4B) - y*PI4C // Extended precision modular arithmetic zz := z * z if j == 1 || j == 2 { y = z + z*zz*((((((_sin[0]*zz)+_sin[1])*zz+_sin[2])*zz+_sin[3])*zz+_sin[4])*zz+_sin[5]) @@ -173,10 +179,9 @@ func Sin(x float64) float64 func sin(x float64) float64 { const ( - PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts - PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, - PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, - M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi + PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts + PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, + PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, ) // special cases switch { @@ -193,22 +198,27 @@ func sin(x float64) float64 { sign = true } - j := int64(x * M4PI) // integer part of x/(Pi/4), as integer for tests on the phase angle - y := float64(j) // integer part of x/(Pi/4), as float - - // map zeros to origin - if j&1 == 1 { - j++ - y++ + var j uint64 + var y, z float64 + if x >= reduceThreshold { + j, z = trigReduce(x) + } else { + j = uint64(x * (4 / Pi)) // integer part of x/(Pi/4), as integer for tests on the phase angle + y = float64(j) // integer part of x/(Pi/4), as float + + // map zeros to origin + if j&1 == 1 { + j++ + y++ + } + j &= 7 // octant modulo 2Pi radians (360 degrees) + z = ((x - y*PI4A) - y*PI4B) - y*PI4C // Extended precision modular arithmetic } - j &= 7 // octant modulo 2Pi radians (360 degrees) // reflect in x axis if j > 3 { sign = !sign j -= 4 } - - z := ((x - y*PI4A) - y*PI4B) - y*PI4C // Extended precision modular arithmetic zz := z * z if j == 1 || j == 2 { y = 1.0 - 0.5*zz + zz*zz*((((((_cos[0]*zz)+_cos[1])*zz+_cos[2])*zz+_cos[3])*zz+_cos[4])*zz+_cos[5]) diff --git a/src/math/sin_386.s b/src/math/sin_386.s index 45d12e00c824c..cf7679d1889cb 100644 --- a/src/math/sin_386.s +++ b/src/math/sin_386.s @@ -6,42 +6,8 @@ // func Cos(x float64) float64 TEXT ·Cos(SB),NOSPLIT,$0 - FMOVD x+0(FP), F0 // F0=x - FCOS // F0=cos(x) if -2**63 < x < 2**63 - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE 3(PC) // jump if x outside range - FMOVDP F0, ret+8(FP) - RET - FLDPI // F0=Pi, F1=x - FADDD F0, F0 // F0=2*Pi, F1=x - FXCHD F0, F1 // F0=x, F1=2*Pi - FPREM1 // F0=reduced_x, F1=2*Pi - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE -3(PC) // jump if reduction incomplete - FMOVDP F0, F1 // F0=reduced_x - FCOS // F0=cos(reduced_x) - FMOVDP F0, ret+8(FP) - RET + JMP ·cos(SB) // func Sin(x float64) float64 TEXT ·Sin(SB),NOSPLIT,$0 - FMOVD x+0(FP), F0 // F0=x - FSIN // F0=sin(x) if -2**63 < x < 2**63 - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE 3(PC) // jump if x outside range - FMOVDP F0, ret+8(FP) - RET - FLDPI // F0=Pi, F1=x - FADDD F0, F0 // F0=2*Pi, F1=x - FXCHD F0, F1 // F0=x, F1=2*Pi - FPREM1 // F0=reduced_x, F1=2*Pi - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE -3(PC) // jump if reduction incomplete - FMOVDP F0, F1 // F0=reduced_x - FSIN // F0=sin(reduced_x) - FMOVDP F0, ret+8(FP) - RET + JMP ·sin(SB) diff --git a/src/math/sincos.go b/src/math/sincos.go index 3ae193a3b253c..c002db6b3cd16 100644 --- a/src/math/sincos.go +++ b/src/math/sincos.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !386 - package math // Coefficients _sin[] and _cos[] are found in pkg/math/sin.go. @@ -16,10 +14,9 @@ package math // Sincos(NaN) = NaN, NaN func Sincos(x float64) (sin, cos float64) { const ( - PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts - PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, - PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, - M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi + PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts + PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, + PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, ) // special cases switch { @@ -36,14 +33,21 @@ func Sincos(x float64) (sin, cos float64) { sinSign = true } - j := int64(x * M4PI) // integer part of x/(Pi/4), as integer for tests on the phase angle - y := float64(j) // integer part of x/(Pi/4), as float + var j uint64 + var y, z float64 + if x >= reduceThreshold { + j, z = trigReduce(x) + } else { + j = uint64(x * (4 / Pi)) // integer part of x/(Pi/4), as integer for tests on the phase angle + y = float64(j) // integer part of x/(Pi/4), as float - if j&1 == 1 { // map zeros to origin - j++ - y++ + if j&1 == 1 { // map zeros to origin + j++ + y++ + } + j &= 7 // octant modulo 2Pi radians (360 degrees) + z = ((x - y*PI4A) - y*PI4B) - y*PI4C // Extended precision modular arithmetic } - j &= 7 // octant modulo 2Pi radians (360 degrees) if j > 3 { // reflect in x axis j -= 4 sinSign, cosSign = !sinSign, !cosSign @@ -52,7 +56,6 @@ func Sincos(x float64) (sin, cos float64) { cosSign = !cosSign } - z := ((x - y*PI4A) - y*PI4B) - y*PI4C // Extended precision modular arithmetic zz := z * z cos = 1.0 - 0.5*zz + zz*zz*((((((_cos[0]*zz)+_cos[1])*zz+_cos[2])*zz+_cos[3])*zz+_cos[4])*zz+_cos[5]) sin = z + z*zz*((((((_sin[0]*zz)+_sin[1])*zz+_sin[2])*zz+_sin[3])*zz+_sin[4])*zz+_sin[5]) diff --git a/src/math/sincos_386.go b/src/math/sincos_386.go deleted file mode 100644 index 38bb050572036..0000000000000 --- a/src/math/sincos_386.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package math - -// Sincos returns Sin(x), Cos(x). -// -// Special cases are: -// Sincos(±0) = ±0, 1 -// Sincos(±Inf) = NaN, NaN -// Sincos(NaN) = NaN, NaN -func Sincos(x float64) (sin, cos float64) diff --git a/src/math/sincos_386.s b/src/math/sincos_386.s deleted file mode 100644 index f700a4f9bfb5c..0000000000000 --- a/src/math/sincos_386.s +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2010 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. - -#include "textflag.h" - -// func Sincos(x float64) (sin, cos float64) -TEXT ·Sincos(SB),NOSPLIT,$0 - FMOVD x+0(FP), F0 // F0=x - FSINCOS // F0=cos(x), F1=sin(x) if -2**63 < x < 2**63 - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE 4(PC) // jump if x outside range - FMOVDP F0, cos+16(FP) // F0=sin(x) - FMOVDP F0, sin+8(FP) - RET - FLDPI // F0=Pi, F1=x - FADDD F0, F0 // F0=2*Pi, F1=x - FXCHD F0, F1 // F0=x, F1=2*Pi - FPREM1 // F0=reduced_x, F1=2*Pi - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE -3(PC) // jump if reduction incomplete - FMOVDP F0, F1 // F0=reduced_x - FSINCOS // F0=cos(reduced_x), F1=sin(reduced_x) - FMOVDP F0, cos+16(FP) // F0=sin(reduced_x) - FMOVDP F0, sin+8(FP) - RET diff --git a/src/math/tan.go b/src/math/tan.go index aa2fb37e81b95..0d5394cf264d3 100644 --- a/src/math/tan.go +++ b/src/math/tan.go @@ -83,10 +83,9 @@ func Tan(x float64) float64 func tan(x float64) float64 { const ( - PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts - PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, - PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, - M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi + PI4A = 7.85398125648498535156E-1 // 0x3fe921fb40000000, Pi/4 split into three parts + PI4B = 3.77489470793079817668E-8 // 0x3e64442d00000000, + PI4C = 2.69515142907905952645E-15 // 0x3ce8469898cc5170, ) // special cases switch { @@ -102,17 +101,22 @@ func tan(x float64) float64 { x = -x sign = true } + var j uint64 + var y, z float64 + if x >= reduceThreshold { + j, z = trigReduce(x) + } else { + j = uint64(x * (4 / Pi)) // integer part of x/(Pi/4), as integer for tests on the phase angle + y = float64(j) // integer part of x/(Pi/4), as float - j := int64(x * M4PI) // integer part of x/(Pi/4), as integer for tests on the phase angle - y := float64(j) // integer part of x/(Pi/4), as float + /* map zeros and singularities to origin */ + if j&1 == 1 { + j++ + y++ + } - /* map zeros and singularities to origin */ - if j&1 == 1 { - j++ - y++ + z = ((x - y*PI4A) - y*PI4B) - y*PI4C } - - z := ((x - y*PI4A) - y*PI4B) - y*PI4C zz := z * z if zz > 1e-14 { diff --git a/src/math/tan_386.s b/src/math/tan_386.s index cb65a3f703d4b..4e44c2692d2d8 100644 --- a/src/math/tan_386.s +++ b/src/math/tan_386.s @@ -6,23 +6,4 @@ // func Tan(x float64) float64 TEXT ·Tan(SB),NOSPLIT,$0 - FMOVD x+0(FP), F0 // F0=x - FPTAN // F0=1, F1=tan(x) if -2**63 < x < 2**63 - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE 4(PC) // jump if x outside range - FMOVDP F0, F0 // F0=tan(x) - FMOVDP F0, ret+8(FP) - RET - FLDPI // F0=Pi, F1=x - FADDD F0, F0 // F0=2*Pi, F1=x - FXCHD F0, F1 // F0=x, F1=2*Pi - FPREM1 // F0=reduced_x, F1=2*Pi - FSTSW AX // AX=status word - ANDW $0x0400, AX - JNE -3(PC) // jump if reduction incomplete - FMOVDP F0, F1 // F0=reduced_x - FPTAN // F0=1, F1=tan(reduced_x) - FMOVDP F0, F0 // F0=tan(reduced_x) - FMOVDP F0, ret+8(FP) - RET + JMP ·tan(SB) diff --git a/src/math/trig_reduce.go b/src/math/trig_reduce.go new file mode 100644 index 0000000000000..7bc72e986d305 --- /dev/null +++ b/src/math/trig_reduce.go @@ -0,0 +1,94 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package math + +import ( + "math/bits" +) + +// reduceThreshold is the maximum value where the reduction using Pi/4 +// in 3 float64 parts still gives accurate results. Above this +// threshold Payne-Hanek range reduction must be used. +const reduceThreshold = (1 << 52) / (4 / Pi) + +// trigReduce implements Payne-Hanek range reduction by Pi/4 +// for x > 0. It returns the integer part mod 8 (j) and +// the fractional part (z) of x / (Pi/4). +// The implementation is based on: +// "ARGUMENT REDUCTION FOR HUGE ARGUMENTS: Good to the Last Bit" +// K. C. Ng et al, March 24, 1992 +// The simulated multi-precision calculation of x*B uses 64-bit integer arithmetic. +func trigReduce(x float64) (j uint64, z float64) { + const PI4 = Pi / 4 + if x < PI4 { + return 0, x + } + // Extract out the integer and exponent such that, + // x = ix * 2 ** exp. + ix := Float64bits(x) + exp := int(ix>>shift&mask) - bias - shift + ix &^= mask << shift + ix |= 1 << shift + // Use the exponent to extract the 3 appropriate uint64 digits from mPi4, + // B ~ (z0, z1, z2), such that the product leading digit has the exponent -61. + // Note, exp >= -53 since x >= PI4 and exp < 971 for maximum float64. + digit, bitshift := uint(exp+61)/64, uint(exp+61)%64 + z0 := (mPi4[digit] << bitshift) | (mPi4[digit+1] >> (64 - bitshift)) + z1 := (mPi4[digit+1] << bitshift) | (mPi4[digit+2] >> (64 - bitshift)) + z2 := (mPi4[digit+2] << bitshift) | (mPi4[digit+3] >> (64 - bitshift)) + // Multiply mantissa by the digits and extract the upper two digits (hi, lo). + z2hi, _ := bits.Mul64(z2, ix) + z1hi, z1lo := bits.Mul64(z1, ix) + z0lo := z0 * ix + lo, c := bits.Add64(z1lo, z2hi, 0) + hi, _ := bits.Add64(z0lo, z1hi, c) + // The top 3 bits are j. + j = hi >> 61 + // Extract the fraction and find its magnitude. + hi = hi<<3 | lo>>61 + lz := uint(bits.LeadingZeros64(hi)) + e := uint64(bias - (lz + 1)) + // Clear implicit mantissa bit and shift into place. + hi = (hi << (lz + 1)) | (lo >> (64 - (lz + 1))) + hi >>= 64 - shift + // Include the exponent and convert to a float. + hi |= e << shift + z = Float64frombits(hi) + // Map zeros to origin. + if j&1 == 1 { + j++ + j &= 7 + z-- + } + // Multiply the fractional part by pi/4. + return j, z * PI4 +} + +// mPi4 is the binary digits of 4/pi as a uint64 array, +// that is, 4/pi = Sum mPi4[i]*2^(-64*i) +// 19 64-bit digits gives 1153 bits of precision to handle +// the largest possible float64 exponent. +var mPi4 = [...]uint64{ + 0x0000000000000001, + 0x45f306dc9c882a53, + 0xf84eafa3ea69bb81, + 0xb6c52b3278872083, + 0xfca2c757bd778ac3, + 0x6e48dc74849ba5c0, + 0x0c925dd413a32439, + 0xfc3bd63962534e7d, + 0xd1046bea5d768909, + 0xd338e04d68befc82, + 0x7323ac7306a673e9, + 0x3908bf177bf25076, + 0x3ff12fffbc0b301f, + 0xde5e2316b414da3e, + 0xda6cfd9e4f96136e, + 0x9e8c7ecd3cbfd45a, + 0xea4f758fd7cbe2f6, + 0x7a0e73ef14a525d4, + 0xd7f6bf623f1aba10, + 0xac06608df8f6d757, +} From 944a9c7a4f2553998609351ee17111995cf80bb7 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 12 Dec 2018 22:08:50 -0800 Subject: [PATCH 322/594] math: use constant rather than variable for exported test threshold This is a minor follow-up on https://golang.org/cl/153059. TBR=iant Updates #6794. Change-Id: I03657dafc572959d46a03f86bbeb280825bc969d Reviewed-on: https://go-review.googlesource.com/c/153845 Reviewed-by: Robert Griesemer --- src/math/export_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/math/export_test.go b/src/math/export_test.go index 5f15bdb025d2d..53d9205b9d169 100644 --- a/src/math/export_test.go +++ b/src/math/export_test.go @@ -9,5 +9,6 @@ var ExpGo = exp var Exp2Go = exp2 var HypotGo = hypot var SqrtGo = sqrt -var ReduceThreshold = reduceThreshold var TrigReduce = trigReduce + +const ReduceThreshold = reduceThreshold From 5dc144c607cb355e9f4a01bfa0b8f054899156a2 Mon Sep 17 00:00:00 2001 From: Lynn Boger Date: Wed, 12 Dec 2018 16:18:19 -0500 Subject: [PATCH 323/594] os/signal: increase wait time for signal delivery time in testcase This increases the time to wait from 1 to 2 seconds in the TestAtomicStop testcase. When running with gccgo on ppc64 & ppc64le on a loaded systems these testcases can intermittently fail with the current value. Updates #29046 Change-Id: If420274dd65926d933a3024903b5c757c300bd60 Reviewed-on: https://go-review.googlesource.com/c/153826 Run-TryBot: Lynn Boger TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/os/signal/signal_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/os/signal/signal_test.go b/src/os/signal/signal_test.go index ecb05fd16c3e7..6ea59f4697f62 100644 --- a/src/os/signal/signal_test.go +++ b/src/os/signal/signal_test.go @@ -432,12 +432,12 @@ func atomicStopTestProgram() { // At this point we should either die from SIGINT or // get a notification on cs. If neither happens, we - // dropped the signal. Give it a second to deliver, - // which is far far longer than it should require. + // dropped the signal. It is given 2 seconds to + // deliver, as needed for gccgo on some loaded test systems. select { case <-cs: - case <-time.After(1 * time.Second): + case <-time.After(2 * time.Second): if !printed { fmt.Print("lost signal on tries:") printed = true From 571d93e977862f91bb153f0b98937ca655505fcd Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Sun, 9 Dec 2018 03:30:08 +1100 Subject: [PATCH 324/594] cmd/go/internal/work: ensure correct group for TestRespectSetgidDir mkdir(2) inherits the parent directory group on *BSD (including Darwin), and it may inherit on other platforms if the parent directory is SetGID. This can cause TestRespectSetgidDir SetGID to fail when the process does not have have permission for the inherited group on the new temporary directory. Fixes #29160 Change-Id: Iac05511e501dfe307a753f801223b1049cc0947d Reviewed-on: https://go-review.googlesource.com/c/153357 Reviewed-by: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/go/internal/work/build_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cmd/go/internal/work/build_test.go b/src/cmd/go/internal/work/build_test.go index 010e17ee48057..a875ec1aa62fd 100644 --- a/src/cmd/go/internal/work/build_test.go +++ b/src/cmd/go/internal/work/build_test.go @@ -227,6 +227,8 @@ func TestRespectSetgidDir(t *testing.T) { if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { t.Skip("can't set SetGID bit with chmod on iOS") } + case "windows", "plan9": + t.Skip("chown/chmod setgid are not supported on Windows and Plan 9") } var b Builder @@ -245,11 +247,13 @@ func TestRespectSetgidDir(t *testing.T) { } defer os.RemoveAll(setgiddir) - if runtime.GOOS == "freebsd" { - err = os.Chown(setgiddir, os.Getuid(), os.Getgid()) - if err != nil { - t.Fatal(err) - } + // BSD mkdir(2) inherits the parent directory group, and other platforms + // can inherit the parent directory group via setgid. The test setup (chmod + // setgid) will fail if the process does not have the group permission to + // the new temporary directory. + err = os.Chown(setgiddir, os.Getuid(), os.Getgid()) + if err != nil { + t.Fatal(err) } // Change setgiddir's permissions to include the SetGID bit. From 9eb383e8f0be692df68ac6cbc3c9f1ccf991d342 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 8 Dec 2018 16:45:29 +0100 Subject: [PATCH 325/594] runtime,os,syscall,internal/poll: replace getdirentries on iOS The getdirentries syscall is considered private API on iOS and is rejected by the App Store submission checks. Replace it with the fdopendir/readdir_r/closedir syscalls. Fixes #28984 Change-Id: I73341b124310e9cb34834a95f946769f337ec5b7 Reviewed-on: https://go-review.googlesource.com/c/153338 Reviewed-by: Keith Randall --- src/internal/poll/fd_opendir_ios.go | 35 +++++++++++ src/os/dir_ios.go | 87 ++++++++++++++++++++++++++++ src/os/dir_unix.go | 36 +++--------- src/os/file_unix.go | 38 +++++++++--- src/runtime/sys_darwin_32.go | 11 ++++ src/runtime/sys_darwin_386.s | 5 ++ src/runtime/sys_darwin_64.go | 11 ++++ src/runtime/sys_darwin_amd64.s | 5 ++ src/runtime/sys_darwin_arm.s | 23 ++++++++ src/runtime/sys_darwin_arm64.s | 28 +++++++++ src/syscall/dirent_bsd_test.go | 2 +- src/syscall/syscall_darwin.go | 1 - src/syscall/syscall_darwin_386.go | 1 + src/syscall/syscall_darwin_amd64.go | 1 + src/syscall/syscall_darwin_arm.go | 21 +++++++ src/syscall/syscall_darwin_arm64.go | 21 +++++++ src/syscall/zsyscall_darwin_386.go | 42 +++++++------- src/syscall/zsyscall_darwin_386.s | 4 +- src/syscall/zsyscall_darwin_amd64.go | 42 +++++++------- src/syscall/zsyscall_darwin_amd64.s | 4 +- src/syscall/zsyscall_darwin_arm.go | 47 ++++++++------- src/syscall/zsyscall_darwin_arm.s | 8 ++- src/syscall/zsyscall_darwin_arm64.go | 47 ++++++++------- src/syscall/zsyscall_darwin_arm64.s | 8 ++- 24 files changed, 400 insertions(+), 128 deletions(-) create mode 100644 src/internal/poll/fd_opendir_ios.go create mode 100644 src/os/dir_ios.go diff --git a/src/internal/poll/fd_opendir_ios.go b/src/internal/poll/fd_opendir_ios.go new file mode 100644 index 0000000000000..e646bd9a9656a --- /dev/null +++ b/src/internal/poll/fd_opendir_ios.go @@ -0,0 +1,35 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin +// +build arm arm64 + +package poll + +import ( + "syscall" + _ "unsafe" // for go:linkname +) + +// OpenDir returns a pointer to a DIR structure suitable for +// ReadDir. In case of an error, the name of the failed +// syscall is returned along with a syscall.Errno. +func (fd *FD) OpenDir() (uintptr, string, error) { + // fdopendir(3) takes control of the file descriptor, + // so use a dup. + fd2, call, err := fd.Dup() + if err != nil { + return 0, call, err + } + dir, err := fdopendir(fd2) + if err != nil { + syscall.Close(fd2) + return 0, "fdopendir", err + } + return dir, "", nil +} + +// Implemented in syscall/syscall_darwin.go. +//go:linkname fdopendir syscall.fdopendir +func fdopendir(fd int) (dir uintptr, err error) diff --git a/src/os/dir_ios.go b/src/os/dir_ios.go new file mode 100644 index 0000000000000..8c14d89508a5f --- /dev/null +++ b/src/os/dir_ios.go @@ -0,0 +1,87 @@ +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin +// +build arm arm64 + +package os + +import ( + "io" + "runtime" + "syscall" + "unsafe" +) + +// Auxiliary information if the File describes a directory +type dirInfo struct { + dir uintptr // Pointer to DIR structure from dirent.h +} + +func (d *dirInfo) close() { + if d.dir == 0 { + return + } + closedir(d.dir) + d.dir = 0 +} + +func (f *File) readdirnames(n int) (names []string, err error) { + if f.dirinfo == nil { + dir, call, errno := f.pfd.OpenDir() + if errno != nil { + return nil, wrapSyscallError(call, errno) + } + f.dirinfo = &dirInfo{ + dir: dir, + } + } + d := f.dirinfo + + size := n + if size <= 0 { + size = 100 + n = -1 + } + + names = make([]string, 0, size) + var dirent syscall.Dirent + var entptr uintptr + for len(names) < size { + if res := readdir_r(d.dir, uintptr(unsafe.Pointer(&dirent)), uintptr(unsafe.Pointer(&entptr))); res != 0 { + return names, wrapSyscallError("readdir", syscall.Errno(res)) + } + if entptr == 0 { // EOF + break + } + if dirent.Ino == 0 { + continue + } + name := (*[len(syscall.Dirent{}.Name)]byte)(unsafe.Pointer(&dirent.Name))[:] + for i, c := range name { + if c == 0 { + name = name[:i] + break + } + } + // Check for useless names before allocating a string. + if string(name) == "." || string(name) == ".." { + continue + } + names = append(names, string(name)) + runtime.KeepAlive(f) + } + if n >= 0 && len(names) == 0 { + return names, io.EOF + } + return names, nil +} + +// Implemented in syscall/syscall_darwin.go. + +//go:linkname closedir syscall.closedir +func closedir(dir uintptr) (err error) + +//go:linkname readdir_r syscall.readdir_r +func readdir_r(dir, entry, result uintptr) (res int) diff --git a/src/os/dir_unix.go b/src/os/dir_unix.go index 7a3ef47ce21fa..bd99ef4813841 100644 --- a/src/os/dir_unix.go +++ b/src/os/dir_unix.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd js,wasm linux nacl netbsd openbsd solaris +// +build aix darwin,!arm,!arm64 dragonfly freebsd js,wasm linux nacl netbsd openbsd solaris package os @@ -12,37 +12,19 @@ import ( "syscall" ) +// Auxiliary information if the File describes a directory +type dirInfo struct { + buf []byte // buffer for directory I/O + nbuf int // length of buf; return value from Getdirentries + bufp int // location of next record in buf. +} + const ( // More than 5760 to work around https://golang.org/issue/24015. blockSize = 8192 ) -func (f *File) readdir(n int) (fi []FileInfo, err error) { - dirname := f.name - if dirname == "" { - dirname = "." - } - names, err := f.Readdirnames(n) - fi = make([]FileInfo, 0, len(names)) - for _, filename := range names { - fip, lerr := lstat(dirname + "/" + filename) - if IsNotExist(lerr) { - // File disappeared between readdir + stat. - // Just treat it as if it didn't exist. - continue - } - if lerr != nil { - return fi, lerr - } - fi = append(fi, fip) - } - if len(fi) == 0 && err == nil && n > 0 { - // Per File.Readdir, the slice must be non-empty or err - // must be non-nil if n > 0. - err = io.EOF - } - return fi, err -} +func (d *dirInfo) close() {} func (f *File) readdirnames(n int) (names []string, err error) { // If this file has no dirinfo, create one. diff --git a/src/os/file_unix.go b/src/os/file_unix.go index 0ca34b070da8d..688b68e1c3547 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -9,6 +9,7 @@ package os import ( "internal/poll" "internal/syscall/unix" + "io" "runtime" "syscall" ) @@ -155,13 +156,6 @@ func newFile(fd uintptr, name string, kind newFileKind) *File { return f } -// Auxiliary information if the File describes a directory -type dirInfo struct { - buf []byte // buffer for directory I/O - nbuf int // length of buf; return value from Getdirentries - bufp int // location of next record in buf. -} - // epipecheck raises SIGPIPE if we get an EPIPE error on standard // output or standard error. See the SIGPIPE docs in os/signal, and // issue 11845. @@ -230,6 +224,9 @@ func (file *file) close() error { if file == nil { return syscall.EINVAL } + if file.dirinfo != nil { + file.dirinfo.close() + } var err error if e := file.pfd.Close(); e != nil { if e == poll.ErrFileClosing { @@ -358,3 +355,30 @@ func Symlink(oldname, newname string) error { } return nil } + +func (f *File) readdir(n int) (fi []FileInfo, err error) { + dirname := f.name + if dirname == "" { + dirname = "." + } + names, err := f.Readdirnames(n) + fi = make([]FileInfo, 0, len(names)) + for _, filename := range names { + fip, lerr := lstat(dirname + "/" + filename) + if IsNotExist(lerr) { + // File disappeared between readdir + stat. + // Just treat it as if it didn't exist. + continue + } + if lerr != nil { + return fi, lerr + } + fi = append(fi, fip) + } + if len(fi) == 0 && err == nil && n > 0 { + // Per File.Readdir, the slice must be non-empty or err + // must be non-nil if n > 0. + err = io.EOF + } + return fi, err +} diff --git a/src/runtime/sys_darwin_32.go b/src/runtime/sys_darwin_32.go index f126be83e52d7..2f17091327dae 100644 --- a/src/runtime/sys_darwin_32.go +++ b/src/runtime/sys_darwin_32.go @@ -19,3 +19,14 @@ func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, e return } func syscall9() + +//go:linkname syscall_syscallPtr syscall.syscallPtr +//go:nosplit +//go:cgo_unsafe_args +func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) { + entersyscallblock() + libcCall(unsafe.Pointer(funcPC(syscallPtr)), unsafe.Pointer(&fn)) + exitsyscall() + return +} +func syscallPtr() diff --git a/src/runtime/sys_darwin_386.s b/src/runtime/sys_darwin_386.s index a14b3db494eb3..1bc1a63c285fb 100644 --- a/src/runtime/sys_darwin_386.s +++ b/src/runtime/sys_darwin_386.s @@ -675,6 +675,11 @@ ok: POPL BP RET +// Not used on 386. +TEXT runtime·syscallPtr(SB),NOSPLIT,$0 + MOVL $0xf1, 0xf1 // crash + RET + // syscall6 calls a function in libc on behalf of the syscall package. // syscall6 takes a pointer to a struct like: // struct { diff --git a/src/runtime/sys_darwin_64.go b/src/runtime/sys_darwin_64.go index 07b0bb54af9d5..8c128811b9f5d 100644 --- a/src/runtime/sys_darwin_64.go +++ b/src/runtime/sys_darwin_64.go @@ -19,3 +19,14 @@ func syscall_syscallX(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) { return } func syscallX() + +//go:linkname syscall_syscallXPtr syscall.syscallXPtr +//go:nosplit +//go:cgo_unsafe_args +func syscall_syscallXPtr(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) { + entersyscallblock() + libcCall(unsafe.Pointer(funcPC(syscallXPtr)), unsafe.Pointer(&fn)) + exitsyscall() + return +} +func syscallXPtr() diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s index 9d100057a89f6..f99cb00ab8cf0 100644 --- a/src/runtime/sys_darwin_amd64.s +++ b/src/runtime/sys_darwin_amd64.s @@ -637,6 +637,11 @@ ok: POPQ BP RET +// Not used on amd64. +TEXT runtime·syscallXPtr(SB),NOSPLIT,$0 + MOVL $0xf1, 0xf1 // crash + RET + // syscall6 calls a function in libc on behalf of the syscall package. // syscall6 takes a pointer to a struct like: // struct { diff --git a/src/runtime/sys_darwin_arm.s b/src/runtime/sys_darwin_arm.s index f045067066898..54c7afbf34395 100644 --- a/src/runtime/sys_darwin_arm.s +++ b/src/runtime/sys_darwin_arm.s @@ -417,6 +417,29 @@ TEXT runtime·syscall(SB),NOSPLIT,$0 ok: RET +// syscallPtr is like syscall except the libc function reports an +// error by returning NULL. +TEXT runtime·syscallPtr(SB),NOSPLIT,$0 + MOVW.W R0, -4(R13) // push structure pointer + MOVW 0(R0), R12 // fn + MOVW 8(R0), R1 // a2 + MOVW 12(R0), R2 // a3 + MOVW 4(R0), R0 // a1 + BL (R12) + MOVW.P 4(R13), R2 // pop structure pointer + MOVW R0, 16(R2) // save r1 + MOVW R1, 20(R2) // save r2 + MOVW $0, R3 + CMP R0, R3 + BNE ok + MOVW.W R2, -4(R13) // push structure pointer + BL libc_error(SB) + MOVW (R0), R0 + MOVW.P 4(R13), R2 // pop structure pointer + MOVW R0, 24(R2) // save err +ok: + RET + // syscall6 calls a function in libc on behalf of the syscall package. // syscall6 takes a pointer to a struct like: // struct { diff --git a/src/runtime/sys_darwin_arm64.s b/src/runtime/sys_darwin_arm64.s index 10d8534359015..29951d8ad7247 100644 --- a/src/runtime/sys_darwin_arm64.s +++ b/src/runtime/sys_darwin_arm64.s @@ -465,6 +465,34 @@ TEXT runtime·syscallX(SB),NOSPLIT,$0 ok: RET +// syscallXPtr is like syscallX except that the libc function reports an +// error by returning NULL. +TEXT runtime·syscallXPtr(SB),NOSPLIT,$0 + SUB $16, RSP // push structure pointer + MOVD R0, (RSP) + + MOVD 0(R0), R12 // fn + MOVD 16(R0), R1 // a2 + MOVD 24(R0), R2 // a3 + MOVD 8(R0), R0 // a1 + BL (R12) + + MOVD (RSP), R2 // pop structure pointer + ADD $16, RSP + MOVD R0, 32(R2) // save r1 + MOVD R1, 40(R2) // save r2 + CMP $0, R0 + BNE ok + SUB $16, RSP // push structure pointer + MOVD R2, (RSP) + BL libc_error(SB) + MOVW (R0), R0 + MOVD (RSP), R2 // pop structure pointer + ADD $16, RSP + MOVD R0, 48(R2) // save err +ok: + RET + // syscall6 calls a function in libc on behalf of the syscall package. // syscall6 takes a pointer to a struct like: // struct { diff --git a/src/syscall/dirent_bsd_test.go b/src/syscall/dirent_bsd_test.go index e5b8357af70a1..e5f5eb3f8aa1d 100644 --- a/src/syscall/dirent_bsd_test.go +++ b/src/syscall/dirent_bsd_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd netbsd openbsd +// +build darwin,!arm,!arm64 dragonfly freebsd netbsd openbsd package syscall_test diff --git a/src/syscall/syscall_darwin.go b/src/syscall/syscall_darwin.go index ee79fb3fb3f6f..80e42b0aec8cb 100644 --- a/src/syscall/syscall_darwin.go +++ b/src/syscall/syscall_darwin.go @@ -270,7 +270,6 @@ func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1) //sys Fsync(fd int) (err error) // Fsync is not called for os.File.Sync(). Please see internal/poll/fd_fsync_darwin.go //sys Ftruncate(fd int, length int64) (err error) -//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64 //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) diff --git a/src/syscall/syscall_darwin_386.go b/src/syscall/syscall_darwin_386.go index a8926c022a57d..045ebc726b813 100644 --- a/src/syscall/syscall_darwin_386.go +++ b/src/syscall/syscall_darwin_386.go @@ -16,6 +16,7 @@ func setTimeval(sec, usec int64) Timeval { //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64 //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64 +//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64 //sysnb Gettimeofday(tp *Timeval) (err error) //sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64 //sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64 diff --git a/src/syscall/syscall_darwin_amd64.go b/src/syscall/syscall_darwin_amd64.go index bc3acf8d7589f..7b6493bf9fe58 100644 --- a/src/syscall/syscall_darwin_amd64.go +++ b/src/syscall/syscall_darwin_amd64.go @@ -16,6 +16,7 @@ func setTimeval(sec, usec int64) Timeval { //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_fstat64 //sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_fstatfs64 +//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS___getdirentries64 //sysnb Gettimeofday(tp *Timeval) (err error) //sys Lstat(path string, stat *Stat_t) (err error) = SYS_lstat64 //sys Stat(path string, stat *Stat_t) (err error) = SYS_stat64 diff --git a/src/syscall/syscall_darwin_arm.go b/src/syscall/syscall_darwin_arm.go index 19c9827c093ac..cb7489ed7beed 100644 --- a/src/syscall/syscall_darwin_arm.go +++ b/src/syscall/syscall_darwin_arm.go @@ -14,14 +14,20 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int32(sec), Usec: int32(usec)} } +//sys closedir(dir uintptr) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sysnb Gettimeofday(tp *Timeval) (err error) //sys Lstat(path string, stat *Stat_t) (err error) +//sys readdir_r(dir uintptr, entry uintptr, result uintptr) (res int) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) //sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + return 0, ENOSYS +} + func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint32(fd) k.Filter = int16(mode) @@ -58,7 +64,22 @@ func libc_sendfile_trampoline() //go:linkname libc_sendfile libc_sendfile //go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" +func fdopendir(fd int) (dir uintptr, err error) { + r0, _, e1 := syscallPtr(funcPC(libc_fdopendir_trampoline), uintptr(fd), 0, 0) + dir = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fdopendir_trampoline() + +//go:linkname libc_fdopendir libc_fdopendir +//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib" + // Implemented in the runtime package (runtime/sys_darwin_32.go) +func syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic diff --git a/src/syscall/syscall_darwin_arm64.go b/src/syscall/syscall_darwin_arm64.go index 95eb9465b9bd6..57902d45c6358 100644 --- a/src/syscall/syscall_darwin_arm64.go +++ b/src/syscall/syscall_darwin_arm64.go @@ -14,14 +14,20 @@ func setTimeval(sec, usec int64) Timeval { return Timeval{Sec: int64(sec), Usec: int32(usec)} } +//sys closedir(dir uintptr) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatfs(fd int, stat *Statfs_t) (err error) //sysnb Gettimeofday(tp *Timeval) (err error) //sys Lstat(path string, stat *Stat_t) (err error) +//sys readdir_r(dirp uintptr, entry uintptr, result uintptr) (res int) //sys Stat(path string, stat *Stat_t) (err error) //sys Statfs(path string, stat *Statfs_t) (err error) //sys fstatat(fd int, path string, stat *Stat_t, flags int) (err error) +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + return 0, ENOSYS +} + func SetKevent(k *Kevent_t, fd, mode, flags int) { k.Ident = uint64(fd) k.Filter = int16(mode) @@ -58,7 +64,22 @@ func libc_sendfile_trampoline() //go:linkname libc_sendfile libc_sendfile //go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" +func fdopendir(fd int) (dir uintptr, err error) { + r0, _, e1 := syscallXPtr(funcPC(libc_fdopendir_trampoline), uintptr(fd), 0, 0) + dir = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fdopendir_trampoline() + +//go:linkname libc_fdopendir libc_fdopendir +//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib" + // Implemented in the runtime package (runtime/sys_darwin_64.go) func syscallX(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) +func syscallXPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // sic diff --git a/src/syscall/zsyscall_darwin_386.go b/src/syscall/zsyscall_darwin_386.go index ed80764398d56..758ff7b129dd2 100644 --- a/src/syscall/zsyscall_darwin_386.go +++ b/src/syscall/zsyscall_darwin_386.go @@ -679,27 +679,6 @@ func libc_ftruncate_trampoline() //go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc___getdirentries64_trampoline() - -//go:linkname libc___getdirentries64 libc___getdirentries64 -//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Getdtablesize() (size int) { r0, _, _ := syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) @@ -1868,6 +1847,27 @@ func libc_fstatfs64_trampoline() //go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc___getdirentries64_trampoline() + +//go:linkname libc___getdirentries64 libc___getdirentries64 +//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Gettimeofday(tp *Timeval) (err error) { _, _, e1 := rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { diff --git a/src/syscall/zsyscall_darwin_386.s b/src/syscall/zsyscall_darwin_386.s index 2d09f0a883200..a688192501b32 100644 --- a/src/syscall/zsyscall_darwin_386.s +++ b/src/syscall/zsyscall_darwin_386.s @@ -95,8 +95,6 @@ TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) -TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 - JMP libc___getdirentries64(SB) TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 JMP libc_getdtablesize(SB) TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 @@ -237,6 +235,8 @@ TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 JMP libc_fstat64(SB) TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 JMP libc_fstatfs64(SB) +TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 + JMP libc___getdirentries64(SB) TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 diff --git a/src/syscall/zsyscall_darwin_amd64.go b/src/syscall/zsyscall_darwin_amd64.go index d6676391a2269..afc3d72d8d7cd 100644 --- a/src/syscall/zsyscall_darwin_amd64.go +++ b/src/syscall/zsyscall_darwin_amd64.go @@ -679,27 +679,6 @@ func libc_ftruncate_trampoline() //go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc___getdirentries64_trampoline() - -//go:linkname libc___getdirentries64 libc___getdirentries64 -//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Getdtablesize() (size int) { r0, _, _ := syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) @@ -1868,6 +1847,27 @@ func libc_fstatfs64_trampoline() //go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc___getdirentries64_trampoline() + +//go:linkname libc___getdirentries64 libc___getdirentries64 +//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Gettimeofday(tp *Timeval) (err error) { _, _, e1 := rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { diff --git a/src/syscall/zsyscall_darwin_amd64.s b/src/syscall/zsyscall_darwin_amd64.s index 3648a50b3bc5c..21ab38e3eedde 100644 --- a/src/syscall/zsyscall_darwin_amd64.s +++ b/src/syscall/zsyscall_darwin_amd64.s @@ -95,8 +95,6 @@ TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) -TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 - JMP libc___getdirentries64(SB) TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 JMP libc_getdtablesize(SB) TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 @@ -237,6 +235,8 @@ TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 JMP libc_fstat64(SB) TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 JMP libc_fstatfs64(SB) +TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 + JMP libc___getdirentries64(SB) TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 diff --git a/src/syscall/zsyscall_darwin_arm.go b/src/syscall/zsyscall_darwin_arm.go index 82e0f043d3a4d..80ef9e514fbb1 100644 --- a/src/syscall/zsyscall_darwin_arm.go +++ b/src/syscall/zsyscall_darwin_arm.go @@ -679,27 +679,6 @@ func libc_ftruncate_trampoline() //go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc___getdirentries64_trampoline() - -//go:linkname libc___getdirentries64 libc___getdirentries64 -//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Getdtablesize() (size int) { r0, _, _ := syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) @@ -1840,6 +1819,20 @@ func libc_openat_trampoline() //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func closedir(dir uintptr) (err error) { + _, _, e1 := syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_closedir_trampoline() + +//go:linkname libc_closedir libc_closedir +//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { @@ -1901,6 +1894,18 @@ func libc_lstat_trampoline() //go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readdir_r(dir uintptr, entry uintptr, result uintptr) (res int) { + r0, _, _ := syscall(funcPC(libc_readdir_r_trampoline), uintptr(dir), uintptr(entry), uintptr(result)) + res = int(r0) + return +} + +func libc_readdir_r_trampoline() + +//go:linkname libc_readdir_r libc_readdir_r +//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/syscall/zsyscall_darwin_arm.s b/src/syscall/zsyscall_darwin_arm.s index 9a3bdbeeba492..f9978d755d49e 100644 --- a/src/syscall/zsyscall_darwin_arm.s +++ b/src/syscall/zsyscall_darwin_arm.s @@ -9,6 +9,8 @@ TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) +TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fdopendir(SB) TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0 @@ -95,8 +97,6 @@ TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) -TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 - JMP libc___getdirentries64(SB) TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 JMP libc_getdtablesize(SB) TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 @@ -233,6 +233,8 @@ TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 JMP libc_openat(SB) +TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_closedir(SB) TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0 @@ -241,6 +243,8 @@ TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) +TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readdir_r(SB) TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0 JMP libc_stat(SB) TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0 diff --git a/src/syscall/zsyscall_darwin_arm64.go b/src/syscall/zsyscall_darwin_arm64.go index 50f5fc9f3182e..a917176a31e18 100644 --- a/src/syscall/zsyscall_darwin_arm64.go +++ b/src/syscall/zsyscall_darwin_arm64.go @@ -679,27 +679,6 @@ func libc_ftruncate_trampoline() //go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc___getdirentries64_trampoline() - -//go:linkname libc___getdirentries64 libc___getdirentries64 -//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Getdtablesize() (size int) { r0, _, _ := syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) @@ -1840,6 +1819,20 @@ func libc_openat_trampoline() //go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func closedir(dir uintptr) (err error) { + _, _, e1 := syscall(funcPC(libc_closedir_trampoline), uintptr(dir), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_closedir_trampoline() + +//go:linkname libc_closedir libc_closedir +//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { @@ -1901,6 +1894,18 @@ func libc_lstat_trampoline() //go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readdir_r(dirp uintptr, entry uintptr, result uintptr) (res int) { + r0, _, _ := syscall(funcPC(libc_readdir_r_trampoline), uintptr(dirp), uintptr(entry), uintptr(result)) + res = int(r0) + return +} + +func libc_readdir_r_trampoline() + +//go:linkname libc_readdir_r libc_readdir_r +//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/syscall/zsyscall_darwin_arm64.s b/src/syscall/zsyscall_darwin_arm64.s index 35316d27f69ec..7ef24e534d066 100644 --- a/src/syscall/zsyscall_darwin_arm64.s +++ b/src/syscall/zsyscall_darwin_arm64.s @@ -9,6 +9,8 @@ TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) +TEXT ·libc_fdopendir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fdopendir(SB) TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0 JMP libc_getgroups(SB) TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0 @@ -95,8 +97,6 @@ TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 JMP libc_fsync(SB) TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 JMP libc_ftruncate(SB) -TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 - JMP libc___getdirentries64(SB) TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 JMP libc_getdtablesize(SB) TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 @@ -233,6 +233,8 @@ TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 JMP libc_unlinkat(SB) TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 JMP libc_openat(SB) +TEXT ·libc_closedir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_closedir(SB) TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0 @@ -241,6 +243,8 @@ TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 JMP libc_gettimeofday(SB) TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0 JMP libc_lstat(SB) +TEXT ·libc_readdir_r_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readdir_r(SB) TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0 JMP libc_stat(SB) TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0 From b6e6870cdb04a838dfb08f2792fbd8d41b849d2a Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Wed, 12 Dec 2018 17:03:34 -0500 Subject: [PATCH 326/594] doc/go1.12: add release notes for bufio and syscall packages Change-Id: I5112be3b0f80ef1d9dad234b1f233e598465a409 Reviewed-on: https://go-review.googlesource.com/c/153824 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index f204c977fd8a0..caba169688067 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -54,6 +54,11 @@

    Darwin

    Go 1.13 will require macOS 10.11 El Capitan or later.

    +

    + libSystem is now used when making syscalls on Darwin, ensuring forward-compatibility + with future versions of macOS. +

    +

    Windows

    @@ -231,7 +236,9 @@

    Minor changes to the library

    bufio

    - TODO: https://golang.org/cl/149297: make Reader.Peek invalidate Unreads + Reader's UnreadRune and + UnreadByte methods will now return an error + if they are called after Peek.

    @@ -584,20 +591,19 @@

    Minor changes to the library

    syscall
    -

    - TODO: https://golang.org/cl/125456: implement Unix Socket for Windows -

    -

    - TODO: https://golang.org/cl/138595: FreeBSD 12 ino64 support + 64-bit inodes are now supported on FreeBSD 12. Some types have been adjusted accordingly.

    -

    - TODO: https://golang.org/cl/141639: implement syscalls on Darwin using libSystem +

    + The Unix socket + (AF_UNIX) + address family is now supported for compatible versions of Windows.

    - TODO: https://golang.org/cl/147117: add Syscall18 on Windows + The new function Syscall18 + has been introduced for Windows, allowing for calls with up to 18 arguments.

    From f95578cd5fa6035e2b253bcb1af3a18ad7352251 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Fri, 14 Dec 2018 05:03:37 +1100 Subject: [PATCH 327/594] runtime: correct signal structs/offsets for openbsd/arm Update sigcontext and siginfo structs to match those currently in use by OpenBSD armv7. Also correct the offset of the fault address field in the siginfo struct, which moved due to the switch to EABI. Change-Id: Icdd95222346239fcc04b95ae0fcefae09b7aa044 Reviewed-on: https://go-review.googlesource.com/c/154077 Reviewed-by: Brad Fitzpatrick --- src/runtime/defs_openbsd_arm.go | 12 ++++++++---- src/runtime/signal_openbsd_arm.go | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/runtime/defs_openbsd_arm.go b/src/runtime/defs_openbsd_arm.go index bfccf5772e327..59f9410e1d63f 100644 --- a/src/runtime/defs_openbsd_arm.go +++ b/src/runtime/defs_openbsd_arm.go @@ -114,13 +114,17 @@ type sigcontext struct { sc_usr_lr uint32 sc_svc_lr uint32 sc_pc uint32 + sc_fpused uint32 + sc_fpscr uint32 + sc_fpreg [32]uint64 } type siginfo struct { - si_signo int32 - si_code int32 - si_errno int32 - _data [116]byte + si_signo int32 + si_code int32 + si_errno int32 + pad_cgo_0 [4]byte + _data [120]byte } type stackt struct { diff --git a/src/runtime/signal_openbsd_arm.go b/src/runtime/signal_openbsd_arm.go index 97bb13b4f3e1f..f796550e60c0d 100644 --- a/src/runtime/signal_openbsd_arm.go +++ b/src/runtime/signal_openbsd_arm.go @@ -45,7 +45,7 @@ func (c *sigctxt) oldmask() uint32 { return 0 } func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) } func (c *sigctxt) sigaddr() uint32 { - return *(*uint32)(add(unsafe.Pointer(c.info), 12)) + return *(*uint32)(add(unsafe.Pointer(c.info), 16)) } func (c *sigctxt) set_pc(x uint32) { c.regs().sc_pc = x } @@ -55,5 +55,5 @@ func (c *sigctxt) set_r10(x uint32) { c.regs().sc_r10 = x } func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) } func (c *sigctxt) set_sigaddr(x uint32) { - *(*uint32)(add(unsafe.Pointer(c.info), 12)) = x + *(*uint32)(add(unsafe.Pointer(c.info), 16)) = x } From 7d9649bf0d3acb8b83d966afa945db7f2188b753 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Tue, 11 Dec 2018 14:23:17 +0100 Subject: [PATCH 328/594] syscall/js: rename js.Callback to js.Func The name "Callback" does not fit to all use cases of js.Callback. This commit changes its name to Func. Accordingly NewCallback gets renamed to FuncOf, which matches ValueOf and TypedArrayOf. The package syscall/js is currently exempt from Go's compatibility promise and js.Callback is already affected by a breaking change in this release cycle. See #28711 for details. Fixes #28711 Change-Id: I2c380970c3822bed6a3893909672c15d0cbe9da3 Reviewed-on: https://go-review.googlesource.com/c/153559 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/wasm/wasm_exec.js | 34 +++++------ src/cmd/vet/all/whitelist/wasm.txt | 2 +- src/net/http/roundtrip_js.go | 12 ++-- src/runtime/lock_js.go | 51 ++++++++--------- src/runtime/rt0_js_wasm.s | 6 +- src/runtime/sys_wasm.s | 4 +- src/syscall/fs_js.go | 2 +- src/syscall/js/callback.go | 92 ------------------------------ src/syscall/js/func.go | 92 ++++++++++++++++++++++++++++++ src/syscall/js/js.go | 2 +- src/syscall/js/js_test.go | 20 +++---- 11 files changed, 158 insertions(+), 159 deletions(-) delete mode 100644 src/syscall/js/callback.go create mode 100644 src/syscall/js/func.go diff --git a/misc/wasm/wasm_exec.js b/misc/wasm/wasm_exec.js index 743eaf70b2ced..165d567750506 100644 --- a/misc/wasm/wasm_exec.js +++ b/misc/wasm/wasm_exec.js @@ -87,8 +87,8 @@ this._exitPromise = new Promise((resolve) => { this._resolveExitPromise = resolve; }); - this._pendingCallback = null; - this._callbackTimeouts = new Map(); + this._pendingEvent = null; + this._scheduledTimeouts = new Map(); this._nextCallbackTimeoutID = 1; const mem = () => { @@ -204,7 +204,7 @@ this.importObject = { go: { // Go's SP does not change as long as no Go code is running. Some operations (e.g. calls, getters and setters) - // may trigger a synchronous callback to Go. This makes Go code get executed in the middle of the imported + // may synchronously trigger a Go event handler. This makes Go code get executed in the middle of the imported // function. A goroutine can switch to a new stack if the current stack is too small (see morestack function). // This changes the SP, thus we have to update the SP used by the imported function. @@ -238,22 +238,22 @@ mem().setInt32(sp + 16, (msec % 1000) * 1000000, true); }, - // func scheduleCallback(delay int64) int32 - "runtime.scheduleCallback": (sp) => { + // func scheduleTimeoutEvent(delay int64) int32 + "runtime.scheduleTimeoutEvent": (sp) => { const id = this._nextCallbackTimeoutID; this._nextCallbackTimeoutID++; - this._callbackTimeouts.set(id, setTimeout( + this._scheduledTimeouts.set(id, setTimeout( () => { this._resume(); }, getInt64(sp + 8) + 1, // setTimeout has been seen to fire up to 1 millisecond early )); mem().setInt32(sp + 16, id, true); }, - // func clearScheduledCallback(id int32) - "runtime.clearScheduledCallback": (sp) => { + // func clearTimeoutEvent(id int32) + "runtime.clearTimeoutEvent": (sp) => { const id = mem().getInt32(sp + 8, true); - clearTimeout(this._callbackTimeouts.get(id)); - this._callbackTimeouts.delete(id); + clearTimeout(this._scheduledTimeouts.get(id)); + this._scheduledTimeouts.delete(id); }, // func getRandomData(r []byte) @@ -420,7 +420,7 @@ _resume() { if (this.exited) { - throw new Error("bad callback: Go program has already exited"); + throw new Error("Go program has already exited"); } this._inst.exports.resume(); if (this.exited) { @@ -428,13 +428,13 @@ } } - _makeCallbackHelper(id) { + _makeFuncWrapper(id) { const go = this; return function () { - const cb = { id: id, this: this, args: arguments }; - go._pendingCallback = cb; + const event = { id: id, this: this, args: arguments }; + go._pendingEvent = event; go._resume(); - return cb.result; + return event.result; }; } } @@ -450,10 +450,10 @@ go.env = Object.assign({ TMPDIR: require("os").tmpdir() }, process.env); go.exit = process.exit; WebAssembly.instantiate(fs.readFileSync(process.argv[2]), go.importObject).then((result) => { - process.on("exit", (code) => { // Node.js exits if no callback is pending + process.on("exit", (code) => { // Node.js exits if no event handler is pending if (code === 0 && !go.exited) { // deadlock, make Go print error and stack traces - go._pendingCallback = { id: 0 }; + go._pendingEvent = { id: 0 }; go._resume(); } }); diff --git a/src/cmd/vet/all/whitelist/wasm.txt b/src/cmd/vet/all/whitelist/wasm.txt index a3f8c291bf9e2..45496ed3f6e0b 100644 --- a/src/cmd/vet/all/whitelist/wasm.txt +++ b/src/cmd/vet/all/whitelist/wasm.txt @@ -12,7 +12,7 @@ runtime/asm_wasm.s: [wasm] rt0_go: use of 8(SP) points beyond argument frame // Calling WebAssembly import. No write from Go assembly. runtime/sys_wasm.s: [wasm] nanotime: RET without writing to 8-byte ret+0(FP) -runtime/sys_wasm.s: [wasm] scheduleCallback: RET without writing to 4-byte ret+8(FP) +runtime/sys_wasm.s: [wasm] scheduleTimeoutEvent: RET without writing to 4-byte ret+8(FP) syscall/js/js_js.s: [wasm] stringVal: RET without writing to 8-byte ret+16(FP) syscall/js/js_js.s: [wasm] valueGet: RET without writing to 8-byte ret+24(FP) syscall/js/js_js.s: [wasm] valueIndex: RET without writing to 8-byte ret+16(FP) diff --git a/src/net/http/roundtrip_js.go b/src/net/http/roundtrip_js.go index 79598164452e8..1e38b908d387e 100644 --- a/src/net/http/roundtrip_js.go +++ b/src/net/http/roundtrip_js.go @@ -93,7 +93,7 @@ func (t *Transport) RoundTrip(req *Request) (*Response, error) { respCh = make(chan *Response, 1) errCh = make(chan error, 1) ) - success := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + success := js.FuncOf(func(this js.Value, args []js.Value) interface{} { result := args[0] header := Header{} // https://developer.mozilla.org/en-US/docs/Web/API/Headers/entries @@ -141,7 +141,7 @@ func (t *Transport) RoundTrip(req *Request) (*Response, error) { return nil }) defer success.Release() - failure := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + failure := js.FuncOf(func(this js.Value, args []js.Value) interface{} { err := fmt.Errorf("net/http: fetch() failed: %s", args[0].String()) select { case errCh <- err: @@ -190,7 +190,7 @@ func (r *streamReader) Read(p []byte) (n int, err error) { bCh = make(chan []byte, 1) errCh = make(chan error, 1) ) - success := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + success := js.FuncOf(func(this js.Value, args []js.Value) interface{} { result := args[0] if result.Get("done").Bool() { errCh <- io.EOF @@ -204,7 +204,7 @@ func (r *streamReader) Read(p []byte) (n int, err error) { return nil }) defer success.Release() - failure := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + failure := js.FuncOf(func(this js.Value, args []js.Value) interface{} { // Assumes it's a TypeError. See // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError // for more information on this type. See @@ -258,7 +258,7 @@ func (r *arrayReader) Read(p []byte) (n int, err error) { bCh = make(chan []byte, 1) errCh = make(chan error, 1) ) - success := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + success := js.FuncOf(func(this js.Value, args []js.Value) interface{} { // Wrap the input ArrayBuffer with a Uint8Array uint8arrayWrapper := js.Global().Get("Uint8Array").New(args[0]) value := make([]byte, uint8arrayWrapper.Get("byteLength").Int()) @@ -269,7 +269,7 @@ func (r *arrayReader) Read(p []byte) (n int, err error) { return nil }) defer success.Release() - failure := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + failure := js.FuncOf(func(this js.Value, args []js.Value) interface{} { // Assumes it's a TypeError. See // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError // for more information on this type. diff --git a/src/runtime/lock_js.go b/src/runtime/lock_js.go index 98aed8796b5ee..b04ccdb107e4e 100644 --- a/src/runtime/lock_js.go +++ b/src/runtime/lock_js.go @@ -92,7 +92,7 @@ func notetsleepg(n *note, ns int64) bool { delay = 1<<31 - 1 // cap to max int32 } - id := scheduleCallback(delay) + id := scheduleTimeoutEvent(delay) mp := acquirem() notes[n] = gp notesWithTimeout[n] = noteWithTimeout{gp: gp, deadline: deadline} @@ -100,7 +100,7 @@ func notetsleepg(n *note, ns int64) bool { gopark(nil, nil, waitReasonSleep, traceEvNone, 1) - clearScheduledCallback(id) // note might have woken early, clear timeout + clearTimeoutEvent(id) // note might have woken early, clear timeout mp = acquirem() delete(notes, n) delete(notesWithTimeout, n) @@ -134,17 +134,17 @@ func checkTimeouts() { } } -var returnedCallback *g +var returnedEventHandler *g func init() { - // At the toplevel we need an extra goroutine that handles asynchronous callbacks. + // At the toplevel we need an extra goroutine that handles asynchronous events. initg := getg() go func() { - returnedCallback = getg() + returnedEventHandler = getg() goready(initg, 1) gopark(nil, nil, waitReasonZero, traceEvNone, 1) - returnedCallback = nil + returnedEventHandler = nil pause(getcallersp() - 16) }() @@ -152,44 +152,43 @@ func init() { } // beforeIdle gets called by the scheduler if no goroutine is awake. -// If a callback has returned, then we resume the callback handler which -// will pause the execution. +// We resume the event handler (if available) which will pause the execution. func beforeIdle() bool { - if returnedCallback != nil { - goready(returnedCallback, 1) + if returnedEventHandler != nil { + goready(returnedEventHandler, 1) return true } return false } -// pause sets SP to newsp and pauses the execution of Go's WebAssembly code until a callback is triggered. +// pause sets SP to newsp and pauses the execution of Go's WebAssembly code until an event is triggered. func pause(newsp uintptr) -// scheduleCallback tells the WebAssembly environment to trigger a callback after ms milliseconds. -// It returns a timer id that can be used with clearScheduledCallback. -func scheduleCallback(ms int64) int32 +// scheduleTimeoutEvent tells the WebAssembly environment to trigger an event after ms milliseconds. +// It returns a timer id that can be used with clearTimeoutEvent. +func scheduleTimeoutEvent(ms int64) int32 -// clearScheduledCallback clears a callback scheduled by scheduleCallback. -func clearScheduledCallback(id int32) +// clearTimeoutEvent clears a timeout event scheduled by scheduleTimeoutEvent. +func clearTimeoutEvent(id int32) -func handleCallback() { - prevReturnedCallback := returnedCallback - returnedCallback = nil +func handleEvent() { + prevReturnedEventHandler := returnedEventHandler + returnedEventHandler = nil checkTimeouts() - callbackHandler() + eventHandler() - returnedCallback = getg() + returnedEventHandler = getg() gopark(nil, nil, waitReasonZero, traceEvNone, 1) - returnedCallback = prevReturnedCallback + returnedEventHandler = prevReturnedEventHandler pause(getcallersp() - 16) } -var callbackHandler func() +var eventHandler func() -//go:linkname setCallbackHandler syscall/js.setCallbackHandler -func setCallbackHandler(fn func()) { - callbackHandler = fn +//go:linkname setEventHandler syscall/js.setEventHandler +func setEventHandler(fn func()) { + eventHandler = fn } diff --git a/src/runtime/rt0_js_wasm.s b/src/runtime/rt0_js_wasm.s index 8b92fcbdb72c7..50adbe22256da 100644 --- a/src/runtime/rt0_js_wasm.s +++ b/src/runtime/rt0_js_wasm.s @@ -15,7 +15,7 @@ TEXT _rt0_wasm_js(SB),NOSPLIT,$0 Drop // wasm_export_run gets called from JavaScript. It initializes the Go runtime and executes Go code until it needs -// to wait for a callback. It does NOT follow the Go ABI. It has two WebAssembly parameters: +// to wait for an event. It does NOT follow the Go ABI. It has two WebAssembly parameters: // R0: argc (i32) // R1: argv (i32) TEXT wasm_export_run(SB),NOSPLIT,$0 @@ -44,9 +44,9 @@ TEXT wasm_export_run(SB),NOSPLIT,$0 Return // wasm_export_resume gets called from JavaScript. It resumes the execution of Go code until it needs to wait for -// a callback. +// an event. TEXT wasm_export_resume(SB),NOSPLIT,$0 - I32Const $runtime·handleCallback(SB) + I32Const $runtime·handleEvent(SB) I32Const $16 I32ShrU Set PC_F diff --git a/src/runtime/sys_wasm.s b/src/runtime/sys_wasm.s index 3ca844a4c73c5..6e28656340d79 100644 --- a/src/runtime/sys_wasm.s +++ b/src/runtime/sys_wasm.s @@ -187,11 +187,11 @@ TEXT ·walltime(SB), NOSPLIT, $0 CallImport RET -TEXT ·scheduleCallback(SB), NOSPLIT, $0 +TEXT ·scheduleTimeoutEvent(SB), NOSPLIT, $0 CallImport RET -TEXT ·clearScheduledCallback(SB), NOSPLIT, $0 +TEXT ·clearTimeoutEvent(SB), NOSPLIT, $0 CallImport RET diff --git a/src/syscall/fs_js.go b/src/syscall/fs_js.go index 58d8216f21128..fcc5f038b823c 100644 --- a/src/syscall/fs_js.go +++ b/src/syscall/fs_js.go @@ -474,7 +474,7 @@ func fsCall(name string, args ...interface{}) (js.Value, error) { } c := make(chan callResult, 1) - jsFS.Call(name, append(args, js.NewCallback(func(this js.Value, args []js.Value) interface{} { + jsFS.Call(name, append(args, js.FuncOf(func(this js.Value, args []js.Value) interface{} { var res callResult if len(args) >= 1 { // on Node.js 8, fs.utimes calls the callback without any arguments diff --git a/src/syscall/js/callback.go b/src/syscall/js/callback.go deleted file mode 100644 index 7f6540908df17..0000000000000 --- a/src/syscall/js/callback.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2018 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build js,wasm - -package js - -import "sync" - -var ( - callbacksMu sync.Mutex - callbacks = make(map[uint32]func(Value, []Value) interface{}) - nextCallbackID uint32 = 1 -) - -var _ Wrapper = Callback{} // Callback must implement Wrapper - -// Callback is a Go function that got wrapped for use as a JavaScript callback. -type Callback struct { - Value // the JavaScript function that invokes the Go function - id uint32 -} - -// NewCallback returns a wrapped callback function. -// -// Invoking the callback in JavaScript will synchronously call the Go function fn with the value of JavaScript's -// "this" keyword and the arguments of the invocation. -// The return value of the invocation is the result of the Go function mapped back to JavaScript according to ValueOf. -// -// A callback triggered during a call from Go to JavaScript gets executed on the same goroutine. -// A callback triggered by JavaScript's event loop gets executed on an extra goroutine. -// Blocking operations in the callback will block the event loop. -// As a consequence, if one callback blocks, other callbacks will not be processed. -// A blocking callback should therefore explicitly start a new goroutine. -// -// Callback.Release must be called to free up resources when the callback will not be used any more. -func NewCallback(fn func(this Value, args []Value) interface{}) Callback { - callbacksMu.Lock() - id := nextCallbackID - nextCallbackID++ - callbacks[id] = fn - callbacksMu.Unlock() - return Callback{ - id: id, - Value: jsGo.Call("_makeCallbackHelper", id), - } -} - -// Release frees up resources allocated for the callback. -// The callback must not be invoked after calling Release. -func (c Callback) Release() { - callbacksMu.Lock() - delete(callbacks, c.id) - callbacksMu.Unlock() -} - -// setCallbackHandler is defined in the runtime package. -func setCallbackHandler(fn func()) - -func init() { - setCallbackHandler(handleCallback) -} - -func handleCallback() { - cb := jsGo.Get("_pendingCallback") - if cb == Null() { - return - } - jsGo.Set("_pendingCallback", Null()) - - id := uint32(cb.Get("id").Int()) - if id == 0 { // zero indicates deadlock - select {} - } - callbacksMu.Lock() - f, ok := callbacks[id] - callbacksMu.Unlock() - if !ok { - Global().Get("console").Call("error", "call to closed callback") - return - } - - this := cb.Get("this") - argsObj := cb.Get("args") - args := make([]Value, argsObj.Length()) - for i := range args { - args[i] = argsObj.Index(i) - } - result := f(this, args) - cb.Set("result", result) -} diff --git a/src/syscall/js/func.go b/src/syscall/js/func.go new file mode 100644 index 0000000000000..6b7f39b8784a1 --- /dev/null +++ b/src/syscall/js/func.go @@ -0,0 +1,92 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build js,wasm + +package js + +import "sync" + +var ( + funcsMu sync.Mutex + funcs = make(map[uint32]func(Value, []Value) interface{}) + nextFuncID uint32 = 1 +) + +var _ Wrapper = Func{} // Func must implement Wrapper + +// Func is a wrapped Go function to be called by JavaScript. +type Func struct { + Value // the JavaScript function that invokes the Go function + id uint32 +} + +// FuncOf returns a wrapped function. +// +// Invoking the JavaScript function will synchronously call the Go function fn with the value of JavaScript's +// "this" keyword and the arguments of the invocation. +// The return value of the invocation is the result of the Go function mapped back to JavaScript according to ValueOf. +// +// A wrapped function triggered during a call from Go to JavaScript gets executed on the same goroutine. +// A wrapped function triggered by JavaScript's event loop gets executed on an extra goroutine. +// Blocking operations in the wrapped function will block the event loop. +// As a consequence, if one wrapped function blocks, other wrapped funcs will not be processed. +// A blocking function should therefore explicitly start a new goroutine. +// +// Func.Release must be called to free up resources when the function will not be used any more. +func FuncOf(fn func(this Value, args []Value) interface{}) Func { + funcsMu.Lock() + id := nextFuncID + nextFuncID++ + funcs[id] = fn + funcsMu.Unlock() + return Func{ + id: id, + Value: jsGo.Call("_makeFuncWrapper", id), + } +} + +// Release frees up resources allocated for the function. +// The function must not be invoked after calling Release. +func (c Func) Release() { + funcsMu.Lock() + delete(funcs, c.id) + funcsMu.Unlock() +} + +// setEventHandler is defined in the runtime package. +func setEventHandler(fn func()) + +func init() { + setEventHandler(handleEvent) +} + +func handleEvent() { + cb := jsGo.Get("_pendingEvent") + if cb == Null() { + return + } + jsGo.Set("_pendingEvent", Null()) + + id := uint32(cb.Get("id").Int()) + if id == 0 { // zero indicates deadlock + select {} + } + funcsMu.Lock() + f, ok := funcs[id] + funcsMu.Unlock() + if !ok { + Global().Get("console").Call("error", "call to released function") + return + } + + this := cb.Get("this") + argsObj := cb.Get("args") + args := make([]Value, argsObj.Length()) + for i := range args { + args[i] = argsObj.Index(i) + } + result := f(this, args) + cb.Set("result", result) +} diff --git a/src/syscall/js/js.go b/src/syscall/js/js.go index 885723f87d690..0893db022d356 100644 --- a/src/syscall/js/js.go +++ b/src/syscall/js/js.go @@ -107,7 +107,7 @@ func Global() Value { // | ---------------------- | ---------------------- | // | js.Value | [its value] | // | js.TypedArray | typed array | -// | js.Callback | function | +// | js.Func | function | // | nil | null | // | bool | boolean | // | integers and floats | number | diff --git a/src/syscall/js/js_test.go b/src/syscall/js/js_test.go index b4d2e66faf76e..c14d2cc24c90b 100644 --- a/src/syscall/js/js_test.go +++ b/src/syscall/js/js_test.go @@ -300,9 +300,9 @@ func TestZeroValue(t *testing.T) { } } -func TestCallback(t *testing.T) { +func TestFuncOf(t *testing.T) { c := make(chan struct{}) - cb := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + cb := js.FuncOf(func(this js.Value, args []js.Value) interface{} { if got := args[0].Int(); got != 42 { t.Errorf("got %#v, want %#v", got, 42) } @@ -314,10 +314,10 @@ func TestCallback(t *testing.T) { <-c } -func TestInvokeCallback(t *testing.T) { +func TestInvokeFunction(t *testing.T) { called := false - cb := js.NewCallback(func(this js.Value, args []js.Value) interface{} { - cb2 := js.NewCallback(func(this js.Value, args []js.Value) interface{} { + cb := js.FuncOf(func(this js.Value, args []js.Value) interface{} { + cb2 := js.FuncOf(func(this js.Value, args []js.Value) interface{} { called = true return 42 }) @@ -329,15 +329,15 @@ func TestInvokeCallback(t *testing.T) { t.Errorf("got %#v, want %#v", got, 42) } if !called { - t.Error("callback not called") + t.Error("function not called") } } -func ExampleNewCallback() { - var cb js.Callback - cb = js.NewCallback(func(this js.Value, args []js.Value) interface{} { +func ExampleFuncOf() { + var cb js.Func + cb = js.FuncOf(func(this js.Value, args []js.Value) interface{} { fmt.Println("button clicked") - cb.Release() // release the callback if the button will not be clicked again + cb.Release() // release the function if the button will not be clicked again return nil }) js.Global().Get("document").Call("getElementById", "myButton").Call("addEventListener", "click", cb) From 9c623f72c441f93af27b8e4af56ad0ed37adcfeb Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 12 Dec 2018 16:53:09 -0500 Subject: [PATCH 329/594] cmd/go: test 'go get' and 'go install' with an (invalid) module ending in /v1 We expect major version v1 to not have a /v1 suffix. (Such a suffix on the package path is fine, but not on the module path.) Fixes #26375 Change-Id: I4206ded82ede36440cedfaf39875c38b9c95dc27 Reviewed-on: https://go-review.googlesource.com/c/153823 Run-TryBot: Bryan C. Mills Reviewed-by: Russ Cox Reviewed-by: Jay Conrod --- .../mod/example.com_invalidpath_v1_v1.0.0.txt | 13 +++++++++++++ src/cmd/go/testdata/script/mod_import_v1suffix.txt | 11 +++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/cmd/go/testdata/mod/example.com_invalidpath_v1_v1.0.0.txt create mode 100644 src/cmd/go/testdata/script/mod_import_v1suffix.txt diff --git a/src/cmd/go/testdata/mod/example.com_invalidpath_v1_v1.0.0.txt b/src/cmd/go/testdata/mod/example.com_invalidpath_v1_v1.0.0.txt new file mode 100644 index 0000000000000..7d9d1303a9043 --- /dev/null +++ b/src/cmd/go/testdata/mod/example.com_invalidpath_v1_v1.0.0.txt @@ -0,0 +1,13 @@ +example.com/invalidpath/v1 v1.0.0 +written by hand + +-- .mod -- +module example.com/invalidpath/v1 +-- .info -- +{"Version":"v1.0.0"} +-- go.mod -- +module example.com/invalidpath/v1 +-- version.go -- +package version + +const V = "v1.0.0" diff --git a/src/cmd/go/testdata/script/mod_import_v1suffix.txt b/src/cmd/go/testdata/script/mod_import_v1suffix.txt new file mode 100644 index 0000000000000..82bb5e2a2fb6f --- /dev/null +++ b/src/cmd/go/testdata/script/mod_import_v1suffix.txt @@ -0,0 +1,11 @@ +env GO111MODULE=on + +! go get -m example.com/invalidpath/v1 +! go install . + +-- go.mod -- +module example.com +-- main.go -- +package main +import _ "example.com/invalidpath/v1" +func main() {} From 01eb1d045963a554a39b40c964e9411183dcc42e Mon Sep 17 00:00:00 2001 From: Katie Hockman Date: Wed, 5 Dec 2018 14:54:33 -0500 Subject: [PATCH 330/594] doc: 1.12 release notes for regexp, runtime, and runtime/debug packages Change-Id: I30686cbeda34f42d5b1848b884588a76a9fb28b9 Reviewed-on: https://go-review.googlesource.com/c/152741 Reviewed-by: Andrew Bonventre --- doc/go1.12.html | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index caba169688067..d2fa217e59e51 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -531,12 +531,12 @@

    Minor changes to the library

    regexp
    -

    - TODO: https://golang.org/cl/139783: add DeepEqual test -

    -

    - TODO: https://golang.org/cl/139784: add partial Deprecation comment to Copy + Copy is no longer necessary + to avoid lock contention, so it has been given a partial deprecation comment. + Copy + may still be appropriate if the reason for its use is to make two copies with + different Longest settings.

    @@ -544,7 +544,9 @@

    Minor changes to the library

    runtime

    - TODO: https://golang.org/cl/135395: use MADV_FREE on Linux if available + On Linux, the Go runtime now releases memory only when the OS is under memory + pressure. This is more efficient, but means a process's RSS (resident set size) + won't decrease unless the OS is running out of memory.

    @@ -552,7 +554,12 @@

    Minor changes to the library

    runtime/debug

    - TODO: https://golang.org/cl/144220: add API to read module info in binary + A new BuildInfo type + exposes the build information read from the running binary, available only in + binaries built with module support. This includes the main package path, main + module information, and the module dependencies. This type is given though the + ReadBuildInfo function + on BuildInfo.

    From 57de1af78c30d7f06e788b33c96341f286f36f4d Mon Sep 17 00:00:00 2001 From: dupoxy Date: Thu, 13 Dec 2018 18:52:17 +0000 Subject: [PATCH 331/594] bytes: add ReplaceAll example Change-Id: I36cc0b68a5a47ac78982b05118c58723c9c6648c GitHub-Last-Rev: 0704d9569407d8b84d1ddcf845b759f7daa91ec1 GitHub-Pull-Request: golang/go#29203 Reviewed-on: https://go-review.googlesource.com/c/153842 Run-TryBot: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor --- src/bytes/example_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bytes/example_test.go b/src/bytes/example_test.go index 4d5cdfa28095e..6d328378fabdc 100644 --- a/src/bytes/example_test.go +++ b/src/bytes/example_test.go @@ -298,6 +298,12 @@ func ExampleReplace() { // moo moo moo } +func ExampleReplaceAll() { + fmt.Printf("%s\n", bytes.ReplaceAll([]byte("oink oink oink"), []byte("oink"), []byte("moo"))) + // Output: + // moo moo moo +} + func ExampleRunes() { rs := bytes.Runes([]byte("go gopher")) for _, r := range rs { From 8fd53db4cf536ff8f425afc7902cd44b5ca98663 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 13 Dec 2018 18:22:53 +0000 Subject: [PATCH 332/594] doc/go1.12: add note about CL 153559's syscall/js.Callback rename Updates #28711 Change-Id: I03139a394fdf0540db07d6d1e38b3fa223b06d58 Reviewed-on: https://go-review.googlesource.com/c/154059 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index d2fa217e59e51..817c1366ac80d 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -617,6 +617,18 @@

    Minor changes to the library

    syscall/js
    +

    +

    + The Callback type and NewCallback function have been renamed; + they are now called + Func and + FuncOf, respectively. + This is a breaking change, but WebAssembly support is still experimental + and not yet subject to the + Go 1 compatibility promise. Any code using the + old name will need to be updated. +

    +

    TODO: https://golang.org/cl/141644: add Wrapper interface to support external Value wrapper types

    From d177e10d2268d92e1babbbdf98fa992cb55bcff4 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 13 Dec 2018 19:50:40 +0000 Subject: [PATCH 333/594] cmd/vendor: update vendored golang.org/x/sys/unix To x/sys git rev 4d1cda033e0619309c606fc686de3adcf599539e Fixes #29224 Change-Id: I696c815b4c2d26e8340c77cb77d1a37245c40ed2 Reviewed-on: https://go-review.googlesource.com/c/154117 Run-TryBot: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor Reviewed-by: Tobias Klauser TryBot-Result: Gobot Gobot --- .../x/sys/unix/example_exec_test.go | 19 + ...{example_test.go => example_flock_test.go} | 7 +- .../vendor/golang.org/x/sys/unix/mksyscall.pl | 341 ------------------ .../golang.org/x/sys/unix/sockcmsg_unix.go | 14 +- .../golang.org/x/sys/unix/syscall_aix.go | 9 +- .../x/sys/unix/syscall_linux_arm.go | 8 + .../x/sys/unix/zsyscall_linux_arm.go | 10 + src/cmd/vendor/vendor.json | 6 +- 8 files changed, 48 insertions(+), 366 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/example_exec_test.go rename src/cmd/vendor/golang.org/x/sys/unix/{example_test.go => example_flock_test.go} (75%) delete mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksyscall.pl diff --git a/src/cmd/vendor/golang.org/x/sys/unix/example_exec_test.go b/src/cmd/vendor/golang.org/x/sys/unix/example_exec_test.go new file mode 100644 index 0000000000000..bb4d3bf5da9ad --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/example_exec_test.go @@ -0,0 +1,19 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris + +package unix_test + +import ( + "log" + "os" + + "golang.org/x/sys/unix" +) + +func ExampleExec() { + err := unix.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ()) + log.Fatal(err) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/example_test.go b/src/cmd/vendor/golang.org/x/sys/unix/example_flock_test.go similarity index 75% rename from src/cmd/vendor/golang.org/x/sys/unix/example_test.go rename to src/cmd/vendor/golang.org/x/sys/unix/example_flock_test.go index ae008f5ba6cc7..6c9174859e80b 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/example_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/example_flock_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris +// +build darwin dragonfly freebsd linux netbsd openbsd solaris package unix_test @@ -13,11 +13,6 @@ import ( "golang.org/x/sys/unix" ) -func ExampleExec() { - err := unix.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ()) - log.Fatal(err) -} - func ExampleFlock() { f, _ := os.Create("example.lock") if err := unix.Flock(int(f.Fd()), unix.LOCK_EX); err != nil { diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksyscall.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksyscall.pl deleted file mode 100755 index 1f6b926f8c64c..0000000000000 --- a/src/cmd/vendor/golang.org/x/sys/unix/mksyscall.pl +++ /dev/null @@ -1,341 +0,0 @@ -#!/usr/bin/env perl -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# This program reads a file containing function prototypes -# (like syscall_darwin.go) and generates system call bodies. -# The prototypes are marked by lines beginning with "//sys" -# and read like func declarations if //sys is replaced by func, but: -# * The parameter lists must give a name for each argument. -# This includes return parameters. -# * The parameter lists must give a type for each argument: -# the (x, y, z int) shorthand is not allowed. -# * If the return parameter is an error number, it must be named errno. - -# A line beginning with //sysnb is like //sys, except that the -# goroutine will not be suspended during the execution of the system -# call. This must only be used for system calls which can never -# block, as otherwise the system call could cause all goroutines to -# hang. - -use strict; - -my $cmdline = "mksyscall.pl " . join(' ', @ARGV); -my $errors = 0; -my $_32bit = ""; -my $plan9 = 0; -my $openbsd = 0; -my $netbsd = 0; -my $dragonfly = 0; -my $arm = 0; # 64-bit value should use (even, odd)-pair -my $tags = ""; # build tags - -if($ARGV[0] eq "-b32") { - $_32bit = "big-endian"; - shift; -} elsif($ARGV[0] eq "-l32") { - $_32bit = "little-endian"; - shift; -} -if($ARGV[0] eq "-plan9") { - $plan9 = 1; - shift; -} -if($ARGV[0] eq "-openbsd") { - $openbsd = 1; - shift; -} -if($ARGV[0] eq "-netbsd") { - $netbsd = 1; - shift; -} -if($ARGV[0] eq "-dragonfly") { - $dragonfly = 1; - shift; -} -if($ARGV[0] eq "-arm") { - $arm = 1; - shift; -} -if($ARGV[0] eq "-tags") { - shift; - $tags = $ARGV[0]; - shift; -} - -if($ARGV[0] =~ /^-/) { - print STDERR "usage: mksyscall.pl [-b32 | -l32] [-tags x,y] [file ...]\n"; - exit 1; -} - -# Check that we are using the new build system if we should -if($ENV{'GOOS'} eq "linux" && $ENV{'GOARCH'} ne "sparc64") { - if($ENV{'GOLANG_SYS_BUILD'} ne "docker") { - print STDERR "In the new build system, mksyscall should not be called directly.\n"; - print STDERR "See README.md\n"; - exit 1; - } -} - - -sub parseparamlist($) { - my ($list) = @_; - $list =~ s/^\s*//; - $list =~ s/\s*$//; - if($list eq "") { - return (); - } - return split(/\s*,\s*/, $list); -} - -sub parseparam($) { - my ($p) = @_; - if($p !~ /^(\S*) (\S*)$/) { - print STDERR "$ARGV:$.: malformed parameter: $p\n"; - $errors = 1; - return ("xx", "int"); - } - return ($1, $2); -} - -my $text = ""; -while(<>) { - chomp; - s/\s+/ /g; - s/^\s+//; - s/\s+$//; - my $nonblock = /^\/\/sysnb /; - next if !/^\/\/sys / && !$nonblock; - - # Line must be of the form - # func Open(path string, mode int, perm int) (fd int, errno error) - # Split into name, in params, out params. - if(!/^\/\/sys(nb)? (\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$/) { - print STDERR "$ARGV:$.: malformed //sys declaration\n"; - $errors = 1; - next; - } - my ($func, $in, $out, $sysname) = ($2, $3, $4, $5); - - # Split argument lists on comma. - my @in = parseparamlist($in); - my @out = parseparamlist($out); - - # Try in vain to keep people from editing this file. - # The theory is that they jump into the middle of the file - # without reading the header. - $text .= "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"; - - # Go function header. - my $out_decl = @out ? sprintf(" (%s)", join(', ', @out)) : ""; - $text .= sprintf "func %s(%s)%s {\n", $func, join(', ', @in), $out_decl; - - # Check if err return available - my $errvar = ""; - foreach my $p (@out) { - my ($name, $type) = parseparam($p); - if($type eq "error") { - $errvar = $name; - last; - } - } - - # Prepare arguments to Syscall. - my @args = (); - my $n = 0; - foreach my $p (@in) { - my ($name, $type) = parseparam($p); - if($type =~ /^\*/) { - push @args, "uintptr(unsafe.Pointer($name))"; - } elsif($type eq "string" && $errvar ne "") { - $text .= "\tvar _p$n *byte\n"; - $text .= "\t_p$n, $errvar = BytePtrFromString($name)\n"; - $text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; - push @args, "uintptr(unsafe.Pointer(_p$n))"; - $n++; - } elsif($type eq "string") { - print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; - $text .= "\tvar _p$n *byte\n"; - $text .= "\t_p$n, _ = BytePtrFromString($name)\n"; - push @args, "uintptr(unsafe.Pointer(_p$n))"; - $n++; - } elsif($type =~ /^\[\](.*)/) { - # Convert slice into pointer, length. - # Have to be careful not to take address of &a[0] if len == 0: - # pass dummy pointer in that case. - # Used to pass nil, but some OSes or simulators reject write(fd, nil, 0). - $text .= "\tvar _p$n unsafe.Pointer\n"; - $text .= "\tif len($name) > 0 {\n\t\t_p$n = unsafe.Pointer(\&${name}[0])\n\t}"; - $text .= " else {\n\t\t_p$n = unsafe.Pointer(&_zero)\n\t}"; - $text .= "\n"; - push @args, "uintptr(_p$n)", "uintptr(len($name))"; - $n++; - } elsif($type eq "int64" && ($openbsd || $netbsd)) { - push @args, "0"; - if($_32bit eq "big-endian") { - push @args, "uintptr($name>>32)", "uintptr($name)"; - } elsif($_32bit eq "little-endian") { - push @args, "uintptr($name)", "uintptr($name>>32)"; - } else { - push @args, "uintptr($name)"; - } - } elsif($type eq "int64" && $dragonfly) { - if ($func !~ /^extp(read|write)/i) { - push @args, "0"; - } - if($_32bit eq "big-endian") { - push @args, "uintptr($name>>32)", "uintptr($name)"; - } elsif($_32bit eq "little-endian") { - push @args, "uintptr($name)", "uintptr($name>>32)"; - } else { - push @args, "uintptr($name)"; - } - } elsif($type eq "int64" && $_32bit ne "") { - if(@args % 2 && $arm) { - # arm abi specifies 64-bit argument uses - # (even, odd) pair - push @args, "0" - } - if($_32bit eq "big-endian") { - push @args, "uintptr($name>>32)", "uintptr($name)"; - } else { - push @args, "uintptr($name)", "uintptr($name>>32)"; - } - } else { - push @args, "uintptr($name)"; - } - } - - # Determine which form to use; pad args with zeros. - my $asm = "Syscall"; - if ($nonblock) { - if ($errvar eq "" && $ENV{'GOOS'} eq "linux") { - $asm = "RawSyscallNoError"; - } else { - $asm = "RawSyscall"; - } - } else { - if ($errvar eq "" && $ENV{'GOOS'} eq "linux") { - $asm = "SyscallNoError"; - } - } - if(@args <= 3) { - while(@args < 3) { - push @args, "0"; - } - } elsif(@args <= 6) { - $asm .= "6"; - while(@args < 6) { - push @args, "0"; - } - } elsif(@args <= 9) { - $asm .= "9"; - while(@args < 9) { - push @args, "0"; - } - } else { - print STDERR "$ARGV:$.: too many arguments to system call\n"; - } - - # System call number. - if($sysname eq "") { - $sysname = "SYS_$func"; - $sysname =~ s/([a-z])([A-Z])/${1}_$2/g; # turn FooBar into Foo_Bar - $sysname =~ y/a-z/A-Z/; - } - - # Actual call. - my $args = join(', ', @args); - my $call = "$asm($sysname, $args)"; - - # Assign return values. - my $body = ""; - my @ret = ("_", "_", "_"); - my $do_errno = 0; - for(my $i=0; $i<@out; $i++) { - my $p = $out[$i]; - my ($name, $type) = parseparam($p); - my $reg = ""; - if($name eq "err" && !$plan9) { - $reg = "e1"; - $ret[2] = $reg; - $do_errno = 1; - } elsif($name eq "err" && $plan9) { - $ret[0] = "r0"; - $ret[2] = "e1"; - next; - } else { - $reg = sprintf("r%d", $i); - $ret[$i] = $reg; - } - if($type eq "bool") { - $reg = "$reg != 0"; - } - if($type eq "int64" && $_32bit ne "") { - # 64-bit number in r1:r0 or r0:r1. - if($i+2 > @out) { - print STDERR "$ARGV:$.: not enough registers for int64 return\n"; - } - if($_32bit eq "big-endian") { - $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i, $i+1); - } else { - $reg = sprintf("int64(r%d)<<32 | int64(r%d)", $i+1, $i); - } - $ret[$i] = sprintf("r%d", $i); - $ret[$i+1] = sprintf("r%d", $i+1); - } - if($reg ne "e1" || $plan9) { - $body .= "\t$name = $type($reg)\n"; - } - } - if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") { - $text .= "\t$call\n"; - } else { - if ($errvar eq "" && $ENV{'GOOS'} eq "linux") { - # raw syscall without error on Linux, see golang.org/issue/22924 - $text .= "\t$ret[0], $ret[1] := $call\n"; - } else { - $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n"; - } - } - $text .= $body; - - if ($plan9 && $ret[2] eq "e1") { - $text .= "\tif int32(r0) == -1 {\n"; - $text .= "\t\terr = e1\n"; - $text .= "\t}\n"; - } elsif ($do_errno) { - $text .= "\tif e1 != 0 {\n"; - $text .= "\t\terr = errnoErr(e1)\n"; - $text .= "\t}\n"; - } - $text .= "\treturn\n"; - $text .= "}\n\n"; -} - -chomp $text; -chomp $text; - -if($errors) { - exit 1; -} - -print <>32), uintptr(n), uintptr(n>>32)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/vendor.json b/src/cmd/vendor/vendor.json index 7cfda75a5edbc..1dcf16d5a9579 100644 --- a/src/cmd/vendor/vendor.json +++ b/src/cmd/vendor/vendor.json @@ -131,10 +131,10 @@ "revisionTime": "2018-05-24T11:38:20Z" }, { - "checksumSHA1": "6AYGJTfvoIblJAxlh0AEIQrRKgo=", + "checksumSHA1": "rx5/IrpHIVwz6KnAeqbTGHZe040=", "path": "golang.org/x/sys/unix", - "revision": "b05ddf57801d2239d6ab0ee35f9d981e0420f4ac", - "revisionTime": "2018-12-11T16:24:22Z" + "revision": "4d1cda033e0619309c606fc686de3adcf599539e", + "revisionTime": "2018-12-13T07:38:38Z" }, { "checksumSHA1": "s+lofQ+SCdhmy0cQp9FpdQncuuI=", From 02ad841dd82bd644b12efa168ad9fc4c623d6b37 Mon Sep 17 00:00:00 2001 From: Brian Kessler Date: Thu, 13 Dec 2018 09:19:11 -0700 Subject: [PATCH 334/594] math: correct mPi4 comment The previous comment mis-stated the number of bits in mPi4. The correct value is 19*64 + 1 == 1217 bits. Change-Id: Ife971ff6936ce2d5b81ce663ce48044749d592a0 Reviewed-on: https://go-review.googlesource.com/c/154017 Reviewed-by: Brad Fitzpatrick --- src/math/trig_reduce.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/trig_reduce.go b/src/math/trig_reduce.go index 7bc72e986d305..6f8eaba9b9184 100644 --- a/src/math/trig_reduce.go +++ b/src/math/trig_reduce.go @@ -68,8 +68,8 @@ func trigReduce(x float64) (j uint64, z float64) { // mPi4 is the binary digits of 4/pi as a uint64 array, // that is, 4/pi = Sum mPi4[i]*2^(-64*i) -// 19 64-bit digits gives 1153 bits of precision to handle -// the largest possible float64 exponent. +// 19 64-bit digits and the leading one bit give 1217 bits +// of precision to handle the largest possible float64 exponent. var mPi4 = [...]uint64{ 0x0000000000000001, 0x45f306dc9c882a53, From 3331608c1c1f357c26f46f028a2c5c6e23036d63 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Thu, 13 Dec 2018 08:17:09 -0500 Subject: [PATCH 335/594] go/internal/gccgoimporter: test fix for older gccgo versions Avoid running the test for issue 29198 if the available copy of gccgo is too old (needs to support context package). Fixes a failure on the solaris builder. Updates #29198. Change-Id: I2b1b3438f4ac105432f30078fbef78e24f2077cd Reviewed-on: https://go-review.googlesource.com/c/153831 Run-TryBot: Than McIntosh TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/go/internal/gccgoimporter/importer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/go/internal/gccgoimporter/importer_test.go b/src/go/internal/gccgoimporter/importer_test.go index f678ddc3b59a0..7a21c5f2f4846 100644 --- a/src/go/internal/gccgoimporter/importer_test.go +++ b/src/go/internal/gccgoimporter/importer_test.go @@ -159,7 +159,7 @@ func TestObjImporter(t *testing.T) { for _, test := range importerTests { // Support for type aliases was added in GCC 7. - if test.pkgpath == "aliases" || test.pkgpath == "issue27856" { + if test.pkgpath == "aliases" || test.pkgpath == "issue27856" || test.pkgpath == "issue29198" { if major < 7 { t.Logf("skipping %q: not supported before gccgo version 7", test.pkgpath) continue From 35edc960c42e570fd196292148c985ffc3a17692 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 13 Dec 2018 14:30:57 -0500 Subject: [PATCH 336/594] cmd/go/internal/work: skip TestRespectSetgidDir on js. chown is not implemented on js: see https://build.golang.org/log/43d7b12602660b786a6e080e685165193df0de00. Change-Id: I3f461338825bb670d682c3f47b17ee1638343fc8 Reviewed-on: https://go-review.googlesource.com/c/154097 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/go/internal/work/build_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/internal/work/build_test.go b/src/cmd/go/internal/work/build_test.go index a875ec1aa62fd..ef95a408ca31b 100644 --- a/src/cmd/go/internal/work/build_test.go +++ b/src/cmd/go/internal/work/build_test.go @@ -227,8 +227,8 @@ func TestRespectSetgidDir(t *testing.T) { if runtime.GOARCH == "arm" || runtime.GOARCH == "arm64" { t.Skip("can't set SetGID bit with chmod on iOS") } - case "windows", "plan9": - t.Skip("chown/chmod setgid are not supported on Windows and Plan 9") + case "windows", "plan9", "js": + t.Skip("chown/chmod setgid are not supported on Windows, Plan 9, or JS") } var b Builder From 9ce38f570f1c62662c1ce04a3fbe62817708ac45 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 13 Dec 2018 13:55:15 -0800 Subject: [PATCH 337/594] math: don't run huge argument tests on s390x The s390x implementations for Sin/Cos/SinCos/Tan use assembly routines which don't reduce arguments accurately enough for huge inputs. Fixes #29221. Change-Id: I340f576899d67bb52a553c3ab22e6464172c936d Reviewed-on: https://go-review.googlesource.com/c/154119 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/math/all_test.go | 84 ------------------------------------ src/math/huge_test.go | 99 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 84 deletions(-) create mode 100644 src/math/huge_test.go diff --git a/src/math/all_test.go b/src/math/all_test.go index 5716048454fee..c2d2efcd97fd3 100644 --- a/src/math/all_test.go +++ b/src/math/all_test.go @@ -176,47 +176,6 @@ var cosLarge = []float64{ -7.3924135157173099849e-01, } -// Inputs to test trig_reduce -var trigHuge = []float64{ - 1 << 120, - 1 << 240, - 1 << 480, - 1234567891234567 << 180, - 1234567891234567 << 300, - MaxFloat64, -} - -// Results for trigHuge[i] calculated with https://github.com/robpike/ivy -// using 4096 bits of working precision. Values requiring less than -// 102 decimal digits (1 << 120, 1 << 240, 1 << 480, 1234567891234567 << 180) -// were confirmed via https://keisan.casio.com/ -var cosHuge = []float64{ - -0.92587902285483787, - 0.93601042593353793, - -0.28282777640193788, - -0.14616431394103619, - -0.79456058210671406, - -0.99998768942655994, -} - -var sinHuge = []float64{ - 0.37782010936075202, - -0.35197227524865778, - 0.95917070894368716, - 0.98926032637023618, - -0.60718488235646949, - 0.00496195478918406, -} - -var tanHuge = []float64{ - -0.40806638884180424, - -0.37603456702698076, - -3.39135965054779932, - -6.76813854009065030, - 0.76417695016604922, - -0.00496201587444489, -} - var cosh = []float64{ 7.2668796942212842775517446e+01, 1.1479413465659254502011135e+03, @@ -3103,49 +3062,6 @@ func TestTrigReduce(t *testing.T) { } } -// Check that trig values of huge angles return accurate results. -// This confirms that argument reduction works for very large values -// up to MaxFloat64. -func TestHugeCos(t *testing.T) { - for i := 0; i < len(trigHuge); i++ { - f1 := cosHuge[i] - f2 := Cos(trigHuge[i]) - if !close(f1, f2) { - t.Errorf("Cos(%g) = %g, want %g", trigHuge[i], f2, f1) - } - } -} - -func TestHugeSin(t *testing.T) { - for i := 0; i < len(trigHuge); i++ { - f1 := sinHuge[i] - f2 := Sin(trigHuge[i]) - if !close(f1, f2) { - t.Errorf("Sin(%g) = %g, want %g", trigHuge[i], f2, f1) - } - } -} - -func TestHugeSinCos(t *testing.T) { - for i := 0; i < len(trigHuge); i++ { - f1, g1 := sinHuge[i], cosHuge[i] - f2, g2 := Sincos(trigHuge[i]) - if !close(f1, f2) || !close(g1, g2) { - t.Errorf("Sincos(%g) = %g, %g, want %g, %g", trigHuge[i], f2, g2, f1, g1) - } - } -} - -func TestHugeTan(t *testing.T) { - for i := 0; i < len(trigHuge); i++ { - f1 := tanHuge[i] - f2 := Tan(trigHuge[i]) - if !close(f1, f2) { - t.Errorf("Tan(%g) = %g, want %g", trigHuge[i], f2, f1) - } - } -} - // Check that math constants are accepted by compiler // and have right value (assumes strconv.ParseFloat works). // https://golang.org/issue/201 diff --git a/src/math/huge_test.go b/src/math/huge_test.go new file mode 100644 index 0000000000000..0b45dbf5b12ec --- /dev/null +++ b/src/math/huge_test.go @@ -0,0 +1,99 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Disabled for s390x because it uses assembly routines that are not +// accurate for huge arguments. + +// +build !s390x + +package math_test + +import ( + . "math" + "testing" +) + +// Inputs to test trig_reduce +var trigHuge = []float64{ + 1 << 120, + 1 << 240, + 1 << 480, + 1234567891234567 << 180, + 1234567891234567 << 300, + MaxFloat64, +} + +// Results for trigHuge[i] calculated with https://github.com/robpike/ivy +// using 4096 bits of working precision. Values requiring less than +// 102 decimal digits (1 << 120, 1 << 240, 1 << 480, 1234567891234567 << 180) +// were confirmed via https://keisan.casio.com/ +var cosHuge = []float64{ + -0.92587902285483787, + 0.93601042593353793, + -0.28282777640193788, + -0.14616431394103619, + -0.79456058210671406, + -0.99998768942655994, +} + +var sinHuge = []float64{ + 0.37782010936075202, + -0.35197227524865778, + 0.95917070894368716, + 0.98926032637023618, + -0.60718488235646949, + 0.00496195478918406, +} + +var tanHuge = []float64{ + -0.40806638884180424, + -0.37603456702698076, + -3.39135965054779932, + -6.76813854009065030, + 0.76417695016604922, + -0.00496201587444489, +} + +// Check that trig values of huge angles return accurate results. +// This confirms that argument reduction works for very large values +// up to MaxFloat64. +func TestHugeCos(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1 := cosHuge[i] + f2 := Cos(trigHuge[i]) + if !close(f1, f2) { + t.Errorf("Cos(%g) = %g, want %g", trigHuge[i], f2, f1) + } + } +} + +func TestHugeSin(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1 := sinHuge[i] + f2 := Sin(trigHuge[i]) + if !close(f1, f2) { + t.Errorf("Sin(%g) = %g, want %g", trigHuge[i], f2, f1) + } + } +} + +func TestHugeSinCos(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1, g1 := sinHuge[i], cosHuge[i] + f2, g2 := Sincos(trigHuge[i]) + if !close(f1, f2) || !close(g1, g2) { + t.Errorf("Sincos(%g) = %g, %g, want %g, %g", trigHuge[i], f2, g2, f1, g1) + } + } +} + +func TestHugeTan(t *testing.T) { + for i := 0; i < len(trigHuge); i++ { + f1 := tanHuge[i] + f2 := Tan(trigHuge[i]) + if !close(f1, f2) { + t.Errorf("Tan(%g) = %g, want %g", trigHuge[i], f2, f1) + } + } +} From c3b9a723bb407d02e4421ffc4a0208d65ca30f5a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 12 Dec 2018 15:46:20 -0800 Subject: [PATCH 338/594] fmt: include failing method name in panic message Fixes #25707 Change-Id: Idfa379db8cc0e105ea68455ec0b4a0dbc1b3f485 Reviewed-on: https://go-review.googlesource.com/c/153827 Run-TryBot: Ian Lance Taylor Reviewed-by: Rob Pike TryBot-Result: Gobot Gobot --- src/fmt/fmt_test.go | 14 +++++++------- src/fmt/print.go | 12 +++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/fmt/fmt_test.go b/src/fmt/fmt_test.go index 1907268c748bb..068c2620a8a20 100644 --- a/src/fmt/fmt_test.go +++ b/src/fmt/fmt_test.go @@ -1683,18 +1683,18 @@ var panictests = []struct { }{ // String {"%s", (*PanicS)(nil), ""}, // nil pointer special case - {"%s", PanicS{io.ErrUnexpectedEOF}, "%!s(PANIC=unexpected EOF)"}, - {"%s", PanicS{3}, "%!s(PANIC=3)"}, + {"%s", PanicS{io.ErrUnexpectedEOF}, "%!s(PANIC=String method: unexpected EOF)"}, + {"%s", PanicS{3}, "%!s(PANIC=String method: 3)"}, // GoString {"%#v", (*PanicGo)(nil), ""}, // nil pointer special case - {"%#v", PanicGo{io.ErrUnexpectedEOF}, "%!v(PANIC=unexpected EOF)"}, - {"%#v", PanicGo{3}, "%!v(PANIC=3)"}, + {"%#v", PanicGo{io.ErrUnexpectedEOF}, "%!v(PANIC=GoString method: unexpected EOF)"}, + {"%#v", PanicGo{3}, "%!v(PANIC=GoString method: 3)"}, // Issue 18282. catchPanic should not clear fmtFlags permanently. - {"%#v", []interface{}{PanicGo{3}, PanicGo{3}}, "[]interface {}{%!v(PANIC=3), %!v(PANIC=3)}"}, + {"%#v", []interface{}{PanicGo{3}, PanicGo{3}}, "[]interface {}{%!v(PANIC=GoString method: 3), %!v(PANIC=GoString method: 3)}"}, // Format {"%s", (*PanicF)(nil), ""}, // nil pointer special case - {"%s", PanicF{io.ErrUnexpectedEOF}, "%!s(PANIC=unexpected EOF)"}, - {"%s", PanicF{3}, "%!s(PANIC=3)"}, + {"%s", PanicF{io.ErrUnexpectedEOF}, "%!s(PANIC=Format method: unexpected EOF)"}, + {"%s", PanicF{3}, "%!s(PANIC=Format method: 3)"}, } func TestPanics(t *testing.T) { diff --git a/src/fmt/print.go b/src/fmt/print.go index 5df34a25e5320..42fcd8b979b01 100644 --- a/src/fmt/print.go +++ b/src/fmt/print.go @@ -538,7 +538,7 @@ func (p *pp) fmtPointer(value reflect.Value, verb rune) { } } -func (p *pp) catchPanic(arg interface{}, verb rune) { +func (p *pp) catchPanic(arg interface{}, verb rune, method string) { if err := recover(); err != nil { // If it's a nil pointer, just say "". The likeliest causes are a // Stringer that fails to guard against nil or a nil pointer for a @@ -561,6 +561,8 @@ func (p *pp) catchPanic(arg interface{}, verb rune) { p.buf.WriteString(percentBangString) p.buf.WriteRune(verb) p.buf.WriteString(panicString) + p.buf.WriteString(method) + p.buf.WriteString(" method: ") p.panicking = true p.printArg(err, 'v') p.panicking = false @@ -577,7 +579,7 @@ func (p *pp) handleMethods(verb rune) (handled bool) { // Is it a Formatter? if formatter, ok := p.arg.(Formatter); ok { handled = true - defer p.catchPanic(p.arg, verb) + defer p.catchPanic(p.arg, verb, "Format") formatter.Format(p, verb) return } @@ -586,7 +588,7 @@ func (p *pp) handleMethods(verb rune) (handled bool) { if p.fmt.sharpV { if stringer, ok := p.arg.(GoStringer); ok { handled = true - defer p.catchPanic(p.arg, verb) + defer p.catchPanic(p.arg, verb, "GoString") // Print the result of GoString unadorned. p.fmt.fmtS(stringer.GoString()) return @@ -604,13 +606,13 @@ func (p *pp) handleMethods(verb rune) (handled bool) { switch v := p.arg.(type) { case error: handled = true - defer p.catchPanic(p.arg, verb) + defer p.catchPanic(p.arg, verb, "Error") p.fmtString(v.Error(), verb) return case Stringer: handled = true - defer p.catchPanic(p.arg, verb) + defer p.catchPanic(p.arg, verb, "String") p.fmtString(v.String(), verb) return } From 784d810976e6fce946d8202b19f3e3c33beb89a2 Mon Sep 17 00:00:00 2001 From: Evan Klitzke Date: Mon, 25 Jun 2018 20:27:58 +0000 Subject: [PATCH 339/594] text/html: escape MIME type "application/ld+json" as JavaScript Fixes #26053 Change-Id: Ic2052b1d0d4e0826a217a520c83d7bb0995ea72a GitHub-Last-Rev: 5a3eea3dd22b0a194591ce2294b88cb340df1e8d GitHub-Pull-Request: golang/go#26054 Reviewed-on: https://go-review.googlesource.com/c/120835 Reviewed-by: Emmanuel Odeke --- src/html/template/js.go | 1 + src/html/template/js_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/src/html/template/js.go b/src/html/template/js.go index 98e821b73c8f2..872f6786b3555 100644 --- a/src/html/template/js.go +++ b/src/html/template/js.go @@ -391,6 +391,7 @@ func isJSType(mimeType string) bool { "application/ecmascript", "application/javascript", "application/json", + "application/ld+json", "application/x-ecmascript", "application/x-javascript", "text/ecmascript", diff --git a/src/html/template/js_test.go b/src/html/template/js_test.go index 12a850d6e3bfe..05fa105be02c7 100644 --- a/src/html/template/js_test.go +++ b/src/html/template/js_test.go @@ -343,6 +343,7 @@ func TestIsJsMimeType(t *testing.T) { {"application/javascript/version=1.8", false}, {"text/javascript", true}, {"application/json", true}, + {"application/ld+json", true}, } for _, test := range tests { From a6293995c55659f51e0662e7656f395633c99b5b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 13 Dec 2018 15:23:35 -0800 Subject: [PATCH 340/594] mime/multipart: quote boundary in Content-Type if necessary Fixes #26532 Change-Id: Ic086c90503c7b24982f947c828c7ccf016ddbf69 Reviewed-on: https://go-review.googlesource.com/c/154120 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick --- src/mime/multipart/writer.go | 8 +++++++- src/mime/multipart/writer_test.go | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/mime/multipart/writer.go b/src/mime/multipart/writer.go index 3dd0c8fb1368a..d1ff151a7d1d6 100644 --- a/src/mime/multipart/writer.go +++ b/src/mime/multipart/writer.go @@ -72,7 +72,13 @@ func (w *Writer) SetBoundary(boundary string) error { // FormDataContentType returns the Content-Type for an HTTP // multipart/form-data with this Writer's Boundary. func (w *Writer) FormDataContentType() string { - return "multipart/form-data; boundary=" + w.boundary + b := w.boundary + // We must quote the boundary if it contains any of the + // tspecials characters defined by RFC 2045, or space. + if strings.ContainsAny(b, `()<>@,;:\"/[]?= `) { + b = `"` + b + `"` + } + return "multipart/form-data; boundary=" + b } func randomBoundary() string { diff --git a/src/mime/multipart/writer_test.go b/src/mime/multipart/writer_test.go index 8b1bcd68d870a..b89b093fff6ff 100644 --- a/src/mime/multipart/writer_test.go +++ b/src/mime/multipart/writer_test.go @@ -7,6 +7,7 @@ package multipart import ( "bytes" "io/ioutil" + "mime" "net/textproto" "strings" "testing" @@ -94,6 +95,7 @@ func TestWriterSetBoundary(t *testing.T) { {"my-separator", true}, {"with space", true}, {"badspace ", false}, + {"(boundary)", true}, } for i, tt := range tests { var b bytes.Buffer @@ -107,6 +109,17 @@ func TestWriterSetBoundary(t *testing.T) { if got != tt.b { t.Errorf("boundary = %q; want %q", got, tt.b) } + + ct := w.FormDataContentType() + mt, params, err := mime.ParseMediaType(ct) + if err != nil { + t.Errorf("could not parse Content-Type %q: %v", ct, err) + } else if mt != "multipart/form-data" { + t.Errorf("unexpected media type %q; want %q", mt, "multipart/form-data") + } else if b := params["boundary"]; b != tt.b { + t.Errorf("unexpected boundary parameter %q; want %q", b, tt.b) + } + w.Close() wantSub := "\r\n--" + tt.b + "--\r\n" if got := b.String(); !strings.Contains(got, wantSub) { From 190a5f8fd2f360c22c11b290796ae7fc0fa5607c Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Fri, 16 Feb 2018 14:52:10 -0800 Subject: [PATCH 341/594] go/doc: simplify and robustify link detection logic To fix #5043, we added logic to allow balanced pairs of parenthesis so that we could match URLs like: http://example.com/some_resource(foo) Howewer, such logic breaks when parsing something like the following: art by [https://example.com/person][Person Name]]. such that the following is considered the link: https://example.com/person][Person Since the logic added in #5043 was just a heuristic, we adjust the heuristic that in addition to requiring balanced pairs, the first parenthesis must be an opening one. For further robustness, we apply this heuristic to parenthesis, braces, and brackets. Fixes #22285 Change-Id: I23b728a644e35ce3995b05a79129cad2c1e3b1ce Reviewed-on: https://go-review.googlesource.com/c/94876 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/go/doc/comment.go | 51 ++++++++++++++++---------------------- src/go/doc/comment_test.go | 38 ++++++---------------------- 2 files changed, 28 insertions(+), 61 deletions(-) diff --git a/src/go/doc/comment.go b/src/go/doc/comment.go index d2c026ea70290..0ec42643fdf82 100644 --- a/src/go/doc/comment.go +++ b/src/go/doc/comment.go @@ -54,7 +54,7 @@ const ( identRx = `[\pL_][\pL_0-9]*` // Regexp for URLs - // Match parens, and check in pairedParensPrefixLen for balance - see #5043 + // Match parens, and check later for balance - see #5043, #22285 // Match .,:;?! within path, but not at end - see #18139, #16565 // This excludes some rare yet valid urls ending in common punctuation // in order to allow sentences ending in URLs. @@ -86,29 +86,6 @@ var ( html_endh = []byte("\n") ) -// pairedParensPrefixLen returns the length of the longest prefix of s containing paired parentheses. -func pairedParensPrefixLen(s string) int { - parens := 0 - l := len(s) - for i, ch := range s { - switch ch { - case '(': - if parens == 0 { - l = i - } - parens++ - case ')': - parens-- - if parens == 0 { - l = len(s) - } else if parens < 0 { - return i - } - } - } - return l -} - // Emphasize and escape a line of text for HTML. URLs are converted into links; // if the URL also appears in the words map, the link is taken from the map (if // the corresponding map value is the empty string, the URL is not converted @@ -128,13 +105,27 @@ func emphasize(w io.Writer, line string, words map[string]string, nice bool) { // write text before match commentEscape(w, line[0:m[0]], nice) - // adjust match if necessary + // adjust match for URLs match := line[m[0]:m[1]] - if n := pairedParensPrefixLen(match); n < len(match) { - // match contains unpaired parentheses (rare); - // redo matching with shortened line for correct indices - m = matchRx.FindStringSubmatchIndex(line[:m[0]+n]) - match = match[:n] + if strings.Contains(match, "://") { + m0, m1 := m[0], m[1] + for _, s := range []string{"()", "{}", "[]"} { + open, close := s[:1], s[1:] // E.g., "(" and ")" + // require opening parentheses before closing parentheses (#22285) + if i := strings.Index(match, close); i >= 0 && i < strings.Index(match, open) { + m1 = m0 + i + match = line[m0:m1] + } + // require balanced pairs of parentheses (#5043) + for i := 0; strings.Count(match, open) != strings.Count(match, close) && i < 10; i++ { + m1 = strings.LastIndexAny(line[:m1], s) + match = line[m0:m1] + } + } + if m1 != m[1] { + // redo matching with shortened line for correct indices + m = matchRx.FindStringSubmatchIndex(line[:m[0]+len(match)]) + } } // analyze match diff --git a/src/go/doc/comment_test.go b/src/go/doc/comment_test.go index 1e6cf84cdfb96..e0adeb2f5cf10 100644 --- a/src/go/doc/comment_test.go +++ b/src/go/doc/comment_test.go @@ -151,6 +151,7 @@ func TestToText(t *testing.T) { var emphasizeTests = []struct { in, out string }{ + {"", ""}, {"http://[::1]:8080/foo.txt", `http://[::1]:8080/foo.txt`}, {"before (https://www.google.com) after", `before (https://www.google.com) after`}, {"before https://www.google.com:30/x/y/z:b::c. After", `before https://www.google.com:30/x/y/z:b::c. After`}, @@ -169,7 +170,13 @@ var emphasizeTests = []struct { {"Hello http://example.com/%2f/ /world.", `Hello http://example.com/%2f/ /world.`}, {"Lorem http: ipsum //host/path", "Lorem http: ipsum //host/path"}, {"javascript://is/not/linked", "javascript://is/not/linked"}, + {"http://foo", `http://foo`}, + {"art by [[https://www.example.com/person/][Person Name]]", `art by [[https://www.example.com/person/][Person Name]]`}, + {"please visit (http://golang.org/)", `please visit (http://golang.org/)`}, + {"please visit http://golang.org/hello())", `please visit http://golang.org/hello())`}, {"http://git.qemu.org/?p=qemu.git;a=blob;f=qapi-schema.json;hb=HEAD", `http://git.qemu.org/?p=qemu.git;a=blob;f=qapi-schema.json;hb=HEAD`}, + {"https://foo.bar/bal/x(])", `https://foo.bar/bal/x(])`}, // inner ] causes (]) to be cut off from URL + {"foo [ http://bar(])", `foo [ http://bar(])`}, // outer [ causes ]) to be cut off from URL } func TestEmphasize(t *testing.T) { @@ -183,37 +190,6 @@ func TestEmphasize(t *testing.T) { } } -var pairedParensPrefixLenTests = []struct { - in, out string -}{ - {"", ""}, - {"foo", "foo"}, - {"()", "()"}, - {"foo()", "foo()"}, - {"foo()()()", "foo()()()"}, - {"foo()((()()))", "foo()((()()))"}, - {"foo()((()()))bar", "foo()((()()))bar"}, - {"foo)", "foo"}, - {"foo))", "foo"}, - {"foo)))))", "foo"}, - {"(foo", ""}, - {"((foo", ""}, - {"(((((foo", ""}, - {"(foo)", "(foo)"}, - {"((((foo))))", "((((foo))))"}, - {"foo()())", "foo()()"}, - {"foo((()())", "foo"}, - {"foo((()())) (() foo ", "foo((()())) "}, -} - -func TestPairedParensPrefixLen(t *testing.T) { - for i, tt := range pairedParensPrefixLenTests { - if out := tt.in[:pairedParensPrefixLen(tt.in)]; out != tt.out { - t.Errorf("#%d: mismatch\nhave: %q\nwant: %q", i, out, tt.out) - } - } -} - func TestCommentEscape(t *testing.T) { commentTests := []struct { in, out string From bc82d7c7db83487e05d7a88e06549d4ae2a688c3 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 30 Nov 2018 15:06:40 -0500 Subject: [PATCH 342/594] cmd/go: reject 'get' of paths containing leading dots or unsupported characters On some platforms, directories beginning with dot are treated as hidden files, and filenames containing unusual characters can be confusing for users to manipulate (and delete). Fixes #29230 Fixes #29231 Change-Id: Ic6f97f577d8fafa83ef62438095a5c7ae022881a Reviewed-on: https://team-review.git.corp.google.com/c/368507 Reviewed-by: Russ Cox Reviewed-on: https://go-review.googlesource.com/c/154101 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/get/get.go | 4 + src/cmd/go/internal/get/path.go | 172 ++++++++++++++++++++ src/cmd/go/testdata/script/get_brace.txt | 45 +++++ src/cmd/go/testdata/script/get_dotfiles.txt | 57 +++++++ 4 files changed, 278 insertions(+) create mode 100644 src/cmd/go/internal/get/path.go create mode 100644 src/cmd/go/testdata/script/get_brace.txt create mode 100644 src/cmd/go/testdata/script/get_dotfiles.txt diff --git a/src/cmd/go/internal/get/get.go b/src/cmd/go/internal/get/get.go index e4148bceb0484..f4b969fcb22c6 100644 --- a/src/cmd/go/internal/get/get.go +++ b/src/cmd/go/internal/get/get.go @@ -402,6 +402,10 @@ func downloadPackage(p *load.Package) error { security = web.Insecure } + if err := CheckImportPath(p.ImportPath); err != nil { + return fmt.Errorf("%s: invalid import path: %v", p.ImportPath, err) + } + if p.Internal.Build.SrcRoot != "" { // Directory exists. Look for checkout along path to src. vcs, rootPath, err = vcsFromDir(p.Dir, p.Internal.Build.SrcRoot) diff --git a/src/cmd/go/internal/get/path.go b/src/cmd/go/internal/get/path.go new file mode 100644 index 0000000000000..2920fc2085106 --- /dev/null +++ b/src/cmd/go/internal/get/path.go @@ -0,0 +1,172 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package get + +import ( + "fmt" + "strings" + "unicode" + "unicode/utf8" +) + +// The following functions are copied verbatim from cmd/go/internal/module/module.go. +// +// TODO(bcmills): After the call site for this function is backported, +// consolidate this back down to a single copy. + +// CheckImportPath checks that an import path is valid. +func CheckImportPath(path string) error { + if err := checkPath(path, false); err != nil { + return fmt.Errorf("malformed import path %q: %v", path, err) + } + return nil +} + +// checkPath checks that a general path is valid. +// It returns an error describing why but not mentioning path. +// Because these checks apply to both module paths and import paths, +// the caller is expected to add the "malformed ___ path %q: " prefix. +// fileName indicates whether the final element of the path is a file name +// (as opposed to a directory name). +func checkPath(path string, fileName bool) error { + if !utf8.ValidString(path) { + return fmt.Errorf("invalid UTF-8") + } + if path == "" { + return fmt.Errorf("empty string") + } + if strings.Contains(path, "..") { + return fmt.Errorf("double dot") + } + if strings.Contains(path, "//") { + return fmt.Errorf("double slash") + } + if path[len(path)-1] == '/' { + return fmt.Errorf("trailing slash") + } + elemStart := 0 + for i, r := range path { + if r == '/' { + if err := checkElem(path[elemStart:i], fileName); err != nil { + return err + } + elemStart = i + 1 + } + } + if err := checkElem(path[elemStart:], fileName); err != nil { + return err + } + return nil +} + +// checkElem checks whether an individual path element is valid. +// fileName indicates whether the element is a file name (not a directory name). +func checkElem(elem string, fileName bool) error { + if elem == "" { + return fmt.Errorf("empty path element") + } + if strings.Count(elem, ".") == len(elem) { + return fmt.Errorf("invalid path element %q", elem) + } + if elem[0] == '.' && !fileName { + return fmt.Errorf("leading dot in path element") + } + if elem[len(elem)-1] == '.' { + return fmt.Errorf("trailing dot in path element") + } + charOK := pathOK + if fileName { + charOK = fileNameOK + } + for _, r := range elem { + if !charOK(r) { + return fmt.Errorf("invalid char %q", r) + } + } + + // Windows disallows a bunch of path elements, sadly. + // See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file + short := elem + if i := strings.Index(short, "."); i >= 0 { + short = short[:i] + } + for _, bad := range badWindowsNames { + if strings.EqualFold(bad, short) { + return fmt.Errorf("disallowed path element %q", elem) + } + } + return nil +} + +// pathOK reports whether r can appear in an import path element. +// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~. +// This matches what "go get" has historically recognized in import paths. +// TODO(rsc): We would like to allow Unicode letters, but that requires additional +// care in the safe encoding (see note below). +func pathOK(r rune) bool { + if r < utf8.RuneSelf { + return r == '+' || r == '-' || r == '.' || r == '_' || r == '~' || + '0' <= r && r <= '9' || + 'A' <= r && r <= 'Z' || + 'a' <= r && r <= 'z' + } + return false +} + +// fileNameOK reports whether r can appear in a file name. +// For now we allow all Unicode letters but otherwise limit to pathOK plus a few more punctuation characters. +// If we expand the set of allowed characters here, we have to +// work harder at detecting potential case-folding and normalization collisions. +// See note about "safe encoding" below. +func fileNameOK(r rune) bool { + if r < utf8.RuneSelf { + // Entire set of ASCII punctuation, from which we remove characters: + // ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ + // We disallow some shell special characters: " ' * < > ? ` | + // (Note that some of those are disallowed by the Windows file system as well.) + // We also disallow path separators / : and \ (fileNameOK is only called on path element characters). + // We allow spaces (U+0020) in file names. + const allowed = "!#$%&()+,-.=@[]^_{}~ " + if '0' <= r && r <= '9' || 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' { + return true + } + for i := 0; i < len(allowed); i++ { + if rune(allowed[i]) == r { + return true + } + } + return false + } + // It may be OK to add more ASCII punctuation here, but only carefully. + // For example Windows disallows < > \, and macOS disallows :, so we must not allow those. + return unicode.IsLetter(r) +} + +// badWindowsNames are the reserved file path elements on Windows. +// See https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file +var badWindowsNames = []string{ + "CON", + "PRN", + "AUX", + "NUL", + "COM1", + "COM2", + "COM3", + "COM4", + "COM5", + "COM6", + "COM7", + "COM8", + "COM9", + "LPT1", + "LPT2", + "LPT3", + "LPT4", + "LPT5", + "LPT6", + "LPT7", + "LPT8", + "LPT9", +} diff --git a/src/cmd/go/testdata/script/get_brace.txt b/src/cmd/go/testdata/script/get_brace.txt new file mode 100644 index 0000000000000..36414d7b556c0 --- /dev/null +++ b/src/cmd/go/testdata/script/get_brace.txt @@ -0,0 +1,45 @@ +[!exec:git] skip + +# Set up some empty repositories. +cd $WORK/_origin/foo +exec git init +exec git commit --allow-empty -m 'create master branch' + +cd $WORK +cd '_origin/{confusing}' +exec git init +exec git commit --allow-empty -m 'create master branch' + +# Clone the empty repositories into GOPATH. +# This tells the Go command where to find them: it takes the place of a user's meta-tag redirector. +mkdir $GOPATH/src/example.com +cd $GOPATH/src/example.com +exec git clone $WORK/_origin/foo +exec git clone $WORK/_origin/{confusing} + +# Commit contents to the repositories. +cd $WORK/_origin/foo +exec git add main.go +exec git commit -m 'add main' + +cd $WORK +cd '_origin/{confusing}' +exec git add confusing.go +exec git commit -m 'just try to delete this!' + +# 'go get' should refuse to download or update the confusingly-named repo. +cd $GOPATH/src/example.com/foo +! go get -u 'example.com/{confusing}' +stderr 'invalid char' +! go get -u example.com/foo +stderr 'invalid import path' +! exists example.com/{confusing} + +-- $WORK/_origin/foo/main.go -- +package main +import _ "example.com/{confusing}" + +func main() {} + +-- $WORK/_origin/{confusing}/confusing.go -- +package confusing diff --git a/src/cmd/go/testdata/script/get_dotfiles.txt b/src/cmd/go/testdata/script/get_dotfiles.txt new file mode 100644 index 0000000000000..c09da8beeb1dd --- /dev/null +++ b/src/cmd/go/testdata/script/get_dotfiles.txt @@ -0,0 +1,57 @@ +[!exec:git] skip + +# Set up a benign repository and a repository with a dotfile name. +cd $WORK/_origin/foo +exec git init +exec git commit --allow-empty -m 'create master branch' + +cd $WORK/_origin/.hidden +exec git init +exec git commit --allow-empty -m 'create master branch' + +# Clone the empty repositories into GOPATH. +# This tells the Go command where to find them: it takes the place of a user's meta-tag redirector. +mkdir $GOPATH/src/example.com +cd $GOPATH/src/example.com +exec git clone $WORK/_origin/foo +exec git clone $WORK/_origin/.hidden + +# Add a benign commit. +cd $WORK/_origin/foo +cp _ok/main.go main.go +exec git add main.go +exec git commit -m 'add ok' + +# 'go get' should install the benign commit. +cd $GOPATH +go get -u example.com/foo + +# Now sneak in an import of a dotfile path. +cd $WORK/_origin/.hidden +exec git add hidden.go +exec git commit -m 'nothing to see here, move along' + +cd $WORK/_origin/foo +cp _sneaky/main.go main.go +exec git add main.go +exec git commit -m 'fix typo (heh heh heh)' + +# 'go get -u' should refuse to download or update the dotfile-named repo. +cd $GOPATH/src/example.com/foo +! go get -u example.com/foo +stderr 'leading dot' +! exists example.com/.hidden/hidden.go + +-- $WORK/_origin/foo/_ok/main.go -- +package main + +func main() {} + +-- $WORK/_origin/foo/_sneaky/main.go -- +package main +import _ "example.com/.hidden" + +func main() {} + +-- $WORK/_origin/.hidden/hidden.go -- +package hidden From 4ab6fb194572846d53b80a92a0d87eaf31446542 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 4 Dec 2018 14:37:39 -0500 Subject: [PATCH 343/594] cmd/go/internal/get: reject Windows shortnames as path components Updates #29230 Change-Id: Ia32d8ec1fc0c4e242f50d8871c0ef3ce315f3c65 Reviewed-on: https://team-review.git.corp.google.com/c/370571 Reviewed-by: Russ Cox Reviewed-on: https://go-review.googlesource.com/c/154102 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/get/path.go | 21 ++++++++++++++++++++- src/cmd/go/testdata/script/get_tilde.txt | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/cmd/go/testdata/script/get_tilde.txt diff --git a/src/cmd/go/internal/get/path.go b/src/cmd/go/internal/get/path.go index 2920fc2085106..c8072b25fd4c4 100644 --- a/src/cmd/go/internal/get/path.go +++ b/src/cmd/go/internal/get/path.go @@ -11,7 +11,8 @@ import ( "unicode/utf8" ) -// The following functions are copied verbatim from cmd/go/internal/module/module.go. +// The following functions are copied verbatim from cmd/go/internal/module/module.go, +// with one change to additionally reject Windows short-names. // // TODO(bcmills): After the call site for this function is backported, // consolidate this back down to a single copy. @@ -76,6 +77,7 @@ func checkElem(elem string, fileName bool) error { if elem[len(elem)-1] == '.' { return fmt.Errorf("trailing dot in path element") } + charOK := pathOK if fileName { charOK = fileNameOK @@ -97,6 +99,23 @@ func checkElem(elem string, fileName bool) error { return fmt.Errorf("disallowed path element %q", elem) } } + + // Reject path components that look like Windows short-names. + // Those usually end in a tilde followed by one or more ASCII digits. + if tilde := strings.LastIndexByte(short, '~'); tilde >= 0 && tilde < len(short)-1 { + suffix := short[tilde+1:] + suffixIsDigits := true + for _, r := range suffix { + if r < '0' || r > '9' { + suffixIsDigits = false + break + } + } + if suffixIsDigits { + return fmt.Errorf("trailing tilde and digits in path element") + } + } + return nil } diff --git a/src/cmd/go/testdata/script/get_tilde.txt b/src/cmd/go/testdata/script/get_tilde.txt new file mode 100644 index 0000000000000..08289ca4054c0 --- /dev/null +++ b/src/cmd/go/testdata/script/get_tilde.txt @@ -0,0 +1,21 @@ +# Paths containing windows short names should be rejected before attempting to fetch. +! go get example.com/longna~1.dir/thing +stderr 'trailing tilde and digits' +! go get example.com/longna~1/thing +stderr 'trailing tilde and digits' +! go get example.com/~9999999/thing +stderr 'trailing tilde and digits' + +# A path containing an element that is just a tilde, or a tilde followed by non-digits, +# should attempt to resolve. +! go get example.com/~glenda/notfound +! stderr 'trailing tilde and digits' +stderr 'unrecognized import path' + +! go get example.com/~glenda2/notfound +! stderr 'trailing tilde and digits' +stderr 'unrecognized import path' + +! go get example.com/~/notfound +! stderr 'trailing tilde and digits' +stderr 'unrecognized import path' From 73e862eced80553479b7f19d572e9ca4e07bf585 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 4 Dec 2018 15:42:32 -0500 Subject: [PATCH 344/594] cmd/go/internal/get: use a strings.Replacer in expand This should be a no-op, but produces deterministic (and more correct) behavior if we have accidentally failed to sanitize one of the inputs. Updates #29231 Change-Id: I1271d0ffd01a691ec8c84906c4e02d9e2be19c72 Reviewed-on: https://team-review.git.corp.google.com/c/370575 Reviewed-by: Russ Cox Reviewed-by: Dmitri Shuralyov Reviewed-on: https://go-review.googlesource.com/c/154103 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/get/vcs.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/internal/get/vcs.go b/src/cmd/go/internal/get/vcs.go index 173934b84ec96..052c82b7b564d 100644 --- a/src/cmd/go/internal/get/vcs.go +++ b/src/cmd/go/internal/get/vcs.go @@ -963,10 +963,14 @@ func matchGoImport(imports []metaImport, importPath string) (metaImport, error) // expand rewrites s to replace {k} with match[k] for each key k in match. func expand(match map[string]string, s string) string { + // We want to replace each match exactly once, and the result of expansion + // must not depend on the iteration order through the map. + // A strings.Replacer has exactly the properties we're looking for. + oldNew := make([]string, 0, 2*len(match)) for k, v := range match { - s = strings.ReplaceAll(s, "{"+k+"}", v) + oldNew = append(oldNew, "{"+k+"}", v) } - return s + return strings.NewReplacer(oldNew...).Replace(s) } // vcsPaths defines the meaning of import paths referring to From 9c075b7c71703f6c4d815c5f7d5177476412c2ca Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 4 Dec 2018 17:00:19 -0500 Subject: [PATCH 345/594] cmd/go/internal/get: relax pathOK check to allow any letter This fixes a regression of #18660 with the new path checks. Updates #29230 Change-Id: I2dd9adab999e7f810e0e746ad8b75ea9622f56e7 Reviewed-on: https://team-review.git.corp.google.com/c/370578 Reviewed-by: Russ Cox Reviewed-on: https://go-review.googlesource.com/c/154104 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/get/path.go | 13 +++++----- src/cmd/go/testdata/script/get_unicode.txt | 28 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 src/cmd/go/testdata/script/get_unicode.txt diff --git a/src/cmd/go/internal/get/path.go b/src/cmd/go/internal/get/path.go index c8072b25fd4c4..d443bd28a9656 100644 --- a/src/cmd/go/internal/get/path.go +++ b/src/cmd/go/internal/get/path.go @@ -12,10 +12,13 @@ import ( ) // The following functions are copied verbatim from cmd/go/internal/module/module.go, -// with one change to additionally reject Windows short-names. +// with a change to additionally reject Windows short-names, +// and one to accept arbitrary letters (golang.org/issue/29101). // // TODO(bcmills): After the call site for this function is backported, // consolidate this back down to a single copy. +// +// NOTE: DO NOT MERGE THESE UNTIL WE DECIDE ABOUT ARBITRARY LETTERS IN MODULE MODE. // CheckImportPath checks that an import path is valid. func CheckImportPath(path string) error { @@ -120,10 +123,8 @@ func checkElem(elem string, fileName bool) error { } // pathOK reports whether r can appear in an import path element. -// Paths can be ASCII letters, ASCII digits, and limited ASCII punctuation: + - . _ and ~. -// This matches what "go get" has historically recognized in import paths. -// TODO(rsc): We would like to allow Unicode letters, but that requires additional -// care in the safe encoding (see note below). +// +// NOTE: This function DIVERGES from module mode pathOK by accepting Unicode letters. func pathOK(r rune) bool { if r < utf8.RuneSelf { return r == '+' || r == '-' || r == '.' || r == '_' || r == '~' || @@ -131,7 +132,7 @@ func pathOK(r rune) bool { 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' } - return false + return unicode.IsLetter(r) } // fileNameOK reports whether r can appear in a file name. diff --git a/src/cmd/go/testdata/script/get_unicode.txt b/src/cmd/go/testdata/script/get_unicode.txt new file mode 100644 index 0000000000000..a30802b999cd2 --- /dev/null +++ b/src/cmd/go/testdata/script/get_unicode.txt @@ -0,0 +1,28 @@ +[!exec:git] skip + +cd $WORK/_origin/example.com/unicode +exec git init +exec git add unicode.go +exec git commit -m 'add unicode.go' + +mkdir $GOPATH/src/example.com/unicode +cd $GOPATH/src/example.com/unicode +exec git clone $WORK/_origin/example.com/unicode . + +cd $WORK/_origin/example.com/испытание +exec git init +exec git add испытание.go +exec git commit -m 'add испытание.go' + +mkdir $GOPATH/src/example.com/испытание +cd $GOPATH/src/example.com/испытание +exec git clone $WORK/_origin/example.com/испытание . + +cd $GOPATH +go get -u example.com/unicode + +-- $WORK/_origin/example.com/unicode/unicode.go -- +package unicode +import _ "example.com/испытание" +-- $WORK/_origin/example.com/испытание/испытание.go -- +package испытание From 770130659b6fb2acf271476579a3644e093dda7f Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 4 Dec 2018 22:23:22 -0500 Subject: [PATCH 346/594] crypto/x509: limit number of signature checks for each verification That number grows quadratically with the number of intermediate certificates in certain pathological cases (for example if they all have the same Subject) leading to a CPU DoS. Set a fixed budget that should fit all real world chains, given we only look at intermediates provided by the peer. The algorithm can be improved, but that's left for follow-up CLs: * the cache logic should be reviewed for correctness, as it seems to override the entire chain with the cached one * the equality check should compare Subject and public key, not the whole certificate * certificates with the right SKID but the wrong Subject should not be considered, and in particular should not take priority over certificates with the right Subject Fixes #29233 Change-Id: Ib257c12cd5563df7723f9c81231d82b882854213 Reviewed-on: https://team-review.git.corp.google.com/c/370475 Reviewed-by: Andrew Bonventre Reviewed-on: https://go-review.googlesource.com/c/154105 Reviewed-by: Filippo Valsorda Run-TryBot: Filippo Valsorda --- src/crypto/x509/cert_pool.go | 28 ++------ src/crypto/x509/verify.go | 86 ++++++++++++++---------- src/crypto/x509/verify_test.go | 119 +++++++++++++++++++++++++++++++++ 3 files changed, 176 insertions(+), 57 deletions(-) diff --git a/src/crypto/x509/cert_pool.go b/src/crypto/x509/cert_pool.go index 7cc1dd4eb6f01..7c55c3b4a3286 100644 --- a/src/crypto/x509/cert_pool.go +++ b/src/crypto/x509/cert_pool.go @@ -65,32 +65,16 @@ func SystemCertPool() (*CertPool, error) { return loadSystemRoots() } -// findVerifiedParents attempts to find certificates in s which have signed the -// given certificate. If any candidates were rejected then errCert will be set -// to one of them, arbitrarily, and err will contain the reason that it was -// rejected. -func (s *CertPool) findVerifiedParents(cert *Certificate) (parents []int, errCert *Certificate, err error) { +// findPotentialParents returns the indexes of certificates in s which might +// have signed cert. The caller must not modify the returned slice. +func (s *CertPool) findPotentialParents(cert *Certificate) []int { if s == nil { - return + return nil } - var candidates []int - if len(cert.AuthorityKeyId) > 0 { - candidates = s.bySubjectKeyId[string(cert.AuthorityKeyId)] - } - if len(candidates) == 0 { - candidates = s.byName[string(cert.RawIssuer)] + return s.bySubjectKeyId[string(cert.AuthorityKeyId)] } - - for _, c := range candidates { - if err = cert.CheckSignatureFrom(s.certs[c]); err == nil { - parents = append(parents, c) - } else { - errCert = s.certs[c] - } - } - - return + return s.byName[string(cert.RawIssuer)] } func (s *CertPool) contains(cert *Certificate) bool { diff --git a/src/crypto/x509/verify.go b/src/crypto/x509/verify.go index ea78ab123f202..56b7948c41552 100644 --- a/src/crypto/x509/verify.go +++ b/src/crypto/x509/verify.go @@ -763,7 +763,7 @@ func (c *Certificate) Verify(opts VerifyOptions) (chains [][]*Certificate, err e if opts.Roots.contains(c) { candidateChains = append(candidateChains, []*Certificate{c}) } else { - if candidateChains, err = c.buildChains(make(map[int][][]*Certificate), []*Certificate{c}, &opts); err != nil { + if candidateChains, err = c.buildChains(nil, []*Certificate{c}, nil, &opts); err != nil { return nil, err } } @@ -800,58 +800,74 @@ func appendToFreshChain(chain []*Certificate, cert *Certificate) []*Certificate return n } -func (c *Certificate) buildChains(cache map[int][][]*Certificate, currentChain []*Certificate, opts *VerifyOptions) (chains [][]*Certificate, err error) { - possibleRoots, failedRoot, rootErr := opts.Roots.findVerifiedParents(c) -nextRoot: - for _, rootNum := range possibleRoots { - root := opts.Roots.certs[rootNum] +// maxChainSignatureChecks is the maximum number of CheckSignatureFrom calls +// that an invocation of buildChains will (tranistively) make. Most chains are +// less than 15 certificates long, so this leaves space for multiple chains and +// for failed checks due to different intermediates having the same Subject. +const maxChainSignatureChecks = 100 +func (c *Certificate) buildChains(cache map[*Certificate][][]*Certificate, currentChain []*Certificate, sigChecks *int, opts *VerifyOptions) (chains [][]*Certificate, err error) { + var ( + hintErr error + hintCert *Certificate + ) + + considerCandidate := func(certType int, candidate *Certificate) { for _, cert := range currentChain { - if cert.Equal(root) { - continue nextRoot + if cert.Equal(candidate) { + return } } - err = root.isValid(rootCertificate, currentChain, opts) - if err != nil { - continue + if sigChecks == nil { + sigChecks = new(int) + } + *sigChecks++ + if *sigChecks > maxChainSignatureChecks { + err = errors.New("x509: signature check attempts limit reached while verifying certificate chain") + return } - chains = append(chains, appendToFreshChain(currentChain, root)) - } - possibleIntermediates, failedIntermediate, intermediateErr := opts.Intermediates.findVerifiedParents(c) -nextIntermediate: - for _, intermediateNum := range possibleIntermediates { - intermediate := opts.Intermediates.certs[intermediateNum] - for _, cert := range currentChain { - if cert.Equal(intermediate) { - continue nextIntermediate + if err := c.CheckSignatureFrom(candidate); err != nil { + if hintErr == nil { + hintErr = err + hintCert = candidate } + return } - err = intermediate.isValid(intermediateCertificate, currentChain, opts) + + err = candidate.isValid(certType, currentChain, opts) if err != nil { - continue + return } - var childChains [][]*Certificate - childChains, ok := cache[intermediateNum] - if !ok { - childChains, err = intermediate.buildChains(cache, appendToFreshChain(currentChain, intermediate), opts) - cache[intermediateNum] = childChains + + switch certType { + case rootCertificate: + chains = append(chains, appendToFreshChain(currentChain, candidate)) + case intermediateCertificate: + if cache == nil { + cache = make(map[*Certificate][][]*Certificate) + } + childChains, ok := cache[candidate] + if !ok { + childChains, err = candidate.buildChains(cache, appendToFreshChain(currentChain, candidate), sigChecks, opts) + cache[candidate] = childChains + } + chains = append(chains, childChains...) } - chains = append(chains, childChains...) + } + + for _, rootNum := range opts.Roots.findPotentialParents(c) { + considerCandidate(rootCertificate, opts.Roots.certs[rootNum]) + } + for _, intermediateNum := range opts.Intermediates.findPotentialParents(c) { + considerCandidate(intermediateCertificate, opts.Intermediates.certs[intermediateNum]) } if len(chains) > 0 { err = nil } - if len(chains) == 0 && err == nil { - hintErr := rootErr - hintCert := failedRoot - if hintErr == nil { - hintErr = intermediateErr - hintCert = failedIntermediate - } err = UnknownAuthorityError{c, hintErr, hintCert} } diff --git a/src/crypto/x509/verify_test.go b/src/crypto/x509/verify_test.go index 0e24d3b5da3af..85f4703d4c3fd 100644 --- a/src/crypto/x509/verify_test.go +++ b/src/crypto/x509/verify_test.go @@ -5,10 +5,15 @@ package x509 import ( + "crypto" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" "crypto/x509/pkix" "encoding/pem" "errors" "fmt" + "math/big" "runtime" "strings" "testing" @@ -1889,3 +1894,117 @@ func TestValidHostname(t *testing.T) { } } } + +func generateCert(cn string, isCA bool, issuer *Certificate, issuerKey crypto.PrivateKey) (*Certificate, crypto.PrivateKey, error) { + priv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + return nil, nil, err + } + + serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) + serialNumber, _ := rand.Int(rand.Reader, serialNumberLimit) + + template := &Certificate{ + SerialNumber: serialNumber, + Subject: pkix.Name{CommonName: cn}, + NotBefore: time.Now().Add(-1 * time.Hour), + NotAfter: time.Now().Add(24 * time.Hour), + + KeyUsage: KeyUsageKeyEncipherment | KeyUsageDigitalSignature | KeyUsageCertSign, + ExtKeyUsage: []ExtKeyUsage{ExtKeyUsageServerAuth}, + BasicConstraintsValid: true, + IsCA: isCA, + } + if issuer == nil { + issuer = template + issuerKey = priv + } + + derBytes, err := CreateCertificate(rand.Reader, template, issuer, priv.Public(), issuerKey) + if err != nil { + return nil, nil, err + } + cert, err := ParseCertificate(derBytes) + if err != nil { + return nil, nil, err + } + + return cert, priv, nil +} + +func TestPathologicalChain(t *testing.T) { + if testing.Short() { + t.Skip("skipping generation of a long chain of certificates in short mode") + } + + // Build a chain where all intermediates share the same subject, to hit the + // path building worst behavior. + roots, intermediates := NewCertPool(), NewCertPool() + + parent, parentKey, err := generateCert("Root CA", true, nil, nil) + if err != nil { + t.Fatal(err) + } + roots.AddCert(parent) + + for i := 1; i < 100; i++ { + parent, parentKey, err = generateCert("Intermediate CA", true, parent, parentKey) + if err != nil { + t.Fatal(err) + } + intermediates.AddCert(parent) + } + + leaf, _, err := generateCert("Leaf", false, parent, parentKey) + if err != nil { + t.Fatal(err) + } + + start := time.Now() + _, err = leaf.Verify(VerifyOptions{ + Roots: roots, + Intermediates: intermediates, + }) + t.Logf("verification took %v", time.Since(start)) + + if err == nil || !strings.Contains(err.Error(), "signature check attempts limit") { + t.Errorf("expected verification to fail with a signature checks limit error; got %v", err) + } +} + +func TestLongChain(t *testing.T) { + if testing.Short() { + t.Skip("skipping generation of a long chain of certificates in short mode") + } + + roots, intermediates := NewCertPool(), NewCertPool() + + parent, parentKey, err := generateCert("Root CA", true, nil, nil) + if err != nil { + t.Fatal(err) + } + roots.AddCert(parent) + + for i := 1; i < 15; i++ { + name := fmt.Sprintf("Intermediate CA #%d", i) + parent, parentKey, err = generateCert(name, true, parent, parentKey) + if err != nil { + t.Fatal(err) + } + intermediates.AddCert(parent) + } + + leaf, _, err := generateCert("Leaf", false, parent, parentKey) + if err != nil { + t.Fatal(err) + } + + start := time.Now() + if _, err := leaf.Verify(VerifyOptions{ + Roots: roots, + Intermediates: intermediates, + }); err != nil { + t.Error(err) + } + t.Logf("verification took %v", time.Since(start)) +} From c8029041277c52f6a8c97dffa0a799ffbe217336 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Wed, 12 Dec 2018 13:35:19 -0500 Subject: [PATCH 347/594] doc: document Go 1.11.3 and Go 1.10.6 Change-Id: I3fe44887a84586d73be01df78a9cbb002c1fc9c5 Reviewed-on: https://team-review.git.corp.google.com/c/376465 Reviewed-by: Filippo Valsorda Reviewed-on: https://go-review.googlesource.com/c/154106 Reviewed-by: Brad Fitzpatrick --- doc/devel/release.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/devel/release.html b/doc/devel/release.html index b02efed5010ec..4e1f7cbc50250 100644 --- a/doc/devel/release.html +++ b/doc/devel/release.html @@ -49,6 +49,13 @@

    Minor revisions

    1.11.2 milestone on our issue tracker for details.

    +

    +go1.11.3 (released 2018/12/12) includes three security fixes to "go get" and +the crypto/x509 package. +See the Go +1.11.3 milestone on our issue tracker for details. +

    +

    go1.10 (released 2018/02/16)

    @@ -98,6 +105,14 @@

    Minor revisions

    1.10.5 milestone on our issue tracker for details.

    +

    +go1.10.6 (released 2018/12/12) includes three security fixes to "go get" and +the crypto/x509 package. +It contains the same fixes as Go 1.11.3 and was released at the same time. +See the Go +1.10.6 milestone on our issue tracker for details. +

    +

    go1.9 (released 2017/08/24)

    From 84b408cd36e909cd039130c0798095cce4edab94 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 13 Dec 2018 09:23:25 -0500 Subject: [PATCH 348/594] cmd/go: set user and email in test-local git repos Some of the builders cannot infer user and email from the builder hostname. Change-Id: I27e5d011fa1471f27763b6b7fa1bf59e418b925c Reviewed-on: https://team-review.git.corp.google.com/c/376739 Reviewed-by: Dmitri Shuralyov Reviewed-on: https://go-review.googlesource.com/c/154107 Reviewed-by: Brad Fitzpatrick Run-TryBot: Dmitri Shuralyov TryBot-Result: Gobot Gobot --- src/cmd/go/testdata/script/get_brace.txt | 4 ++++ src/cmd/go/testdata/script/get_dotfiles.txt | 4 ++++ src/cmd/go/testdata/script/get_unicode.txt | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/src/cmd/go/testdata/script/get_brace.txt b/src/cmd/go/testdata/script/get_brace.txt index 36414d7b556c0..be81d8f4875cc 100644 --- a/src/cmd/go/testdata/script/get_brace.txt +++ b/src/cmd/go/testdata/script/get_brace.txt @@ -3,11 +3,15 @@ # Set up some empty repositories. cd $WORK/_origin/foo exec git init +exec git config user.name 'Nameless Gopher' +exec git config user.email 'nobody@golang.org' exec git commit --allow-empty -m 'create master branch' cd $WORK cd '_origin/{confusing}' exec git init +exec git config user.name 'Nameless Gopher' +exec git config user.email 'nobody@golang.org' exec git commit --allow-empty -m 'create master branch' # Clone the empty repositories into GOPATH. diff --git a/src/cmd/go/testdata/script/get_dotfiles.txt b/src/cmd/go/testdata/script/get_dotfiles.txt index c09da8beeb1dd..1876114362690 100644 --- a/src/cmd/go/testdata/script/get_dotfiles.txt +++ b/src/cmd/go/testdata/script/get_dotfiles.txt @@ -3,10 +3,14 @@ # Set up a benign repository and a repository with a dotfile name. cd $WORK/_origin/foo exec git init +exec git config user.name 'Nameless Gopher' +exec git config user.email 'nobody@golang.org' exec git commit --allow-empty -m 'create master branch' cd $WORK/_origin/.hidden exec git init +exec git config user.name 'Nameless Gopher' +exec git config user.email 'nobody@golang.org' exec git commit --allow-empty -m 'create master branch' # Clone the empty repositories into GOPATH. diff --git a/src/cmd/go/testdata/script/get_unicode.txt b/src/cmd/go/testdata/script/get_unicode.txt index a30802b999cd2..31edcdb9f66c9 100644 --- a/src/cmd/go/testdata/script/get_unicode.txt +++ b/src/cmd/go/testdata/script/get_unicode.txt @@ -1,23 +1,32 @@ [!exec:git] skip +# Construct a repository that imports a non-ASCII path. cd $WORK/_origin/example.com/unicode exec git init +exec git config user.name 'Nameless Gopher' +exec git config user.email 'nobody@golang.org' exec git add unicode.go exec git commit -m 'add unicode.go' +# Clone the repo into GOPATH so that 'go get -u' can find it. mkdir $GOPATH/src/example.com/unicode cd $GOPATH/src/example.com/unicode exec git clone $WORK/_origin/example.com/unicode . +# Construct the imported repository. cd $WORK/_origin/example.com/испытание exec git init +exec git config user.name 'Nameless Gopher' +exec git config user.email 'nobody@golang.org' exec git add испытание.go exec git commit -m 'add испытание.go' +# Clone that repo into GOPATH too. mkdir $GOPATH/src/example.com/испытание cd $GOPATH/src/example.com/испытание exec git clone $WORK/_origin/example.com/испытание . +# Upgrading the importer should pull from the non-ASCII repo. cd $GOPATH go get -u example.com/unicode From 38e7177c949016c3d74411fa7ea1c300ae85c0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Thu, 13 Dec 2018 17:55:52 +0100 Subject: [PATCH 349/594] cmd/compile: fix length overflow when appending elements to a slice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of testing len(slice)+numNewElements > cap(slice) use uint(len(slice)+numNewElements) > uint(cap(slice)) to test if a slice needs to be grown in an append operation. This prevents a possible overflow when len(slice) is near the maximum int value and the addition of a constant number of new elements makes it overflow and wrap around to a negative number which is smaller than the capacity of the slice. Appending a slice to a slice with append(s1, s2...) already used a uint comparison to test slice capacity and therefore was not vulnerable to the same overflow issue. Fixes: #29190 Change-Id: I41733895838b4f80a44f827bf900ce931d8be5ca Reviewed-on: https://go-review.googlesource.com/c/154037 Run-TryBot: Martin Möhrmann Reviewed-by: Keith Randall TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/ssa.go | 4 ++-- test/fixedbugs/issue29190.go | 37 ++++++++++++++++++++++++++++++ test/prove.go | 2 +- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 test/fixedbugs/issue29190.go diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index dcb9841042a9b..2eeea79ff99cc 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -2416,7 +2416,7 @@ func (s *state) append(n *Node, inplace bool) *ssa.Value { // a := &s // ptr, len, cap := s // newlen := len + 3 - // if newlen > cap { + // if uint(newlen) > uint(cap) { // newptr, len, newcap = growslice(ptr, len, cap, newlen) // vardef(a) // if necessary, advise liveness we are writing a new a // *a.cap = newcap // write before ptr to avoid a spill @@ -2454,7 +2454,7 @@ func (s *state) append(n *Node, inplace bool) *ssa.Value { c := s.newValue1(ssa.OpSliceCap, types.Types[TINT], slice) nl := s.newValue2(s.ssaOp(OADD, types.Types[TINT]), types.Types[TINT], l, s.constInt(types.Types[TINT], nargs)) - cmp := s.newValue2(s.ssaOp(OGT, types.Types[TINT]), types.Types[TBOOL], nl, c) + cmp := s.newValue2(s.ssaOp(OGT, types.Types[TUINT]), types.Types[TBOOL], nl, c) s.vars[&ptrVar] = p if !inplace { diff --git a/test/fixedbugs/issue29190.go b/test/fixedbugs/issue29190.go new file mode 100644 index 0000000000000..c0c4bb12b4df0 --- /dev/null +++ b/test/fixedbugs/issue29190.go @@ -0,0 +1,37 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "strings" +) + +type T struct{} + +const maxInt = int(^uint(0) >> 1) + +func main() { + s := make([]T, maxInt) + shouldPanic("cap out of range", func() { s = append(s, T{}) }) + var oneElem = make([]T, 1) + shouldPanic("cap out of range", func() { s = append(s, oneElem...) }) +} + +func shouldPanic(str string, f func()) { + defer func() { + err := recover() + if err == nil { + panic("did not panic") + } + s := err.(error).Error() + if !strings.Contains(s, str) { + panic("got panic " + s + ", want " + str) + } + }() + + f() +} diff --git a/test/prove.go b/test/prove.go index 0de6bd63b4047..a881b2d6e2ef8 100644 --- a/test/prove.go +++ b/test/prove.go @@ -530,7 +530,7 @@ func fence1(b []int, x, y int) { } if len(b) < cap(b) { // This eliminates the growslice path. - b = append(b, 1) // ERROR "Disproved Greater64$" + b = append(b, 1) // ERROR "Disproved Greater64U$" } } From 976bab6003bdc72ca25954d048f340a34d8e717a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Thu, 13 Dec 2018 13:37:57 +0100 Subject: [PATCH 350/594] syscall: remove linknames to runtime symbols for aix/ppc64 Replaces //go:linkname by assembly functions for syscall functions on aix/ppc64. Since the new runtime internal ABI, this was triggering an error if syscall.Syscall6 was called by others packages like x/sys/unix. This commit should remove every future occurences of this problem. Fixes #28769 Change-Id: I6a4bf77472ee1e974bdb76b27e74275e568f5a76 Reviewed-on: https://go-review.googlesource.com/c/153997 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- src/runtime/syscall_aix.go | 4 ---- src/syscall/asm_aix_ppc64.s | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 src/syscall/asm_aix_ppc64.s diff --git a/src/runtime/syscall_aix.go b/src/runtime/syscall_aix.go index 376e22d59a7f8..7f2bcbe9d95bb 100644 --- a/src/runtime/syscall_aix.go +++ b/src/runtime/syscall_aix.go @@ -57,7 +57,6 @@ var ( // Syscall is needed because some packages (like net) need it too. // The best way is to return EINVAL and let Golang handles its failure // If the syscall can't fail, this function can redirect it to a real syscall. -//go:linkname syscall_Syscall syscall.Syscall //go:nosplit func syscall_Syscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) { return 0, 0, _EINVAL @@ -65,12 +64,10 @@ func syscall_Syscall(fn, a1, a2, a3 uintptr) (r1, r2, err uintptr) { // This is syscall.RawSyscall, it exists to satisfy some build dependency, // but it doesn't work. -//go:linkname syscall_RawSyscall syscall.RawSyscall func syscall_RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) { panic("RawSyscall not available on AIX") } -//go:linkname syscall_syscall6 syscall.syscall6 //go:nosplit func syscall_syscall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) { c := getg().m.libcall @@ -84,7 +81,6 @@ func syscall_syscall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err ui return c.r1, 0, c.err } -//go:linkname syscall_rawSyscall6 syscall.rawSyscall6 //go:nosplit func syscall_rawSyscall6(fn, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) { c := getg().m.libcall diff --git a/src/syscall/asm_aix_ppc64.s b/src/syscall/asm_aix_ppc64.s new file mode 100644 index 0000000000000..7eb9ffb7e7b36 --- /dev/null +++ b/src/syscall/asm_aix_ppc64.s @@ -0,0 +1,21 @@ +// Copyright 2014 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. + +#include "textflag.h" + +// +// System calls for aix/ppc64 are implemented in ../runtime/syscall_aix.go +// + +TEXT ·syscall6(SB),NOSPLIT,$0 + JMP runtime·syscall_syscall6(SB) + +TEXT ·rawSyscall6(SB),NOSPLIT,$0 + JMP runtime·syscall_rawSyscall6(SB) + +TEXT ·RawSyscall(SB),NOSPLIT,$0 + JMP runtime·syscall_RawSyscall(SB) + +TEXT ·Syscall(SB),NOSPLIT,$0 + JMP runtime·syscall_Syscall(SB) From 47fb1fbd554a76dc961bfdedaa85efcb68646ed1 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 13 Dec 2018 21:42:33 -0500 Subject: [PATCH 351/594] cmd/go/internal/get: move wildcard-trimming to before CheckImportPath MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, RepoRootForImportPath trimmed certain "..." wildcards from package patterns (even though its name suggests that the argument must be an actual import path). It trimmed at the first path element that was literally "..." (although wildcards in general may appear within a larger path element), and relied on a subsequent check in RepoRootForImportPath to catch confusing resolutions. However, that causes 'go get' with wildcard patterns in fresh paths to fail as of CL 154101: a wildcard pattern is not a valid import path, and fails the path check. (The existing Test{Vendor,Go}Get* packages in go_test.go and vendor_test.go catch the failure, but they are all skipped when the "-short" flag is set — including in all.bash — and we had forgotten to run them separately.) We now trim the path before any element that contains a wildcard, and perform the path check (and repo resolution) on only that prefix. It is possible that the expanded path after fetching the repo will be invalid, but a repository can contain directories that are not valid import paths in general anyway. Fixes #29241 Change-Id: I70fb2f7fc6603b7d339fd6c02e8cdeacfc93fc4b Reviewed-on: https://go-review.googlesource.com/c/154108 Reviewed-by: Russ Cox --- src/cmd/go/internal/get/get.go | 21 +++++++++++++++++---- src/cmd/go/internal/get/vcs.go | 10 ++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/cmd/go/internal/get/get.go b/src/cmd/go/internal/get/get.go index f4b969fcb22c6..a314c57160b39 100644 --- a/src/cmd/go/internal/get/get.go +++ b/src/cmd/go/internal/get/get.go @@ -232,7 +232,7 @@ var downloadCache = map[string]bool{} var downloadRootCache = map[string]bool{} // download runs the download half of the get command -// for the package named by the argument. +// for the package or pattern named by the argument. func download(arg string, parent *load.Package, stk *load.ImportStack, mode int) { if mode&load.ResolveImport != 0 { // Caller is responsible for expanding vendor paths. @@ -402,7 +402,20 @@ func downloadPackage(p *load.Package) error { security = web.Insecure } - if err := CheckImportPath(p.ImportPath); err != nil { + // p can be either a real package, or a pseudo-package whose “import path” is + // actually a wildcard pattern. + // Trim the path at the element containing the first wildcard, + // and hope that it applies to the wildcarded parts too. + // This makes 'go get rsc.io/pdf/...' work in a fresh GOPATH. + importPrefix := p.ImportPath + if i := strings.Index(importPrefix, "..."); i >= 0 { + slash := strings.LastIndexByte(importPrefix[:i], '/') + if slash < 0 { + return fmt.Errorf("cannot expand ... in %q", p.ImportPath) + } + importPrefix = importPrefix[:slash] + } + if err := CheckImportPath(importPrefix); err != nil { return fmt.Errorf("%s: invalid import path: %v", p.ImportPath, err) } @@ -425,7 +438,7 @@ func downloadPackage(p *load.Package) error { } repo = remote if !*getF && err == nil { - if rr, err := RepoRootForImportPath(p.ImportPath, IgnoreMod, security); err == nil { + if rr, err := RepoRootForImportPath(importPrefix, IgnoreMod, security); err == nil { repo := rr.Repo if rr.vcs.resolveRepo != nil { resolved, err := rr.vcs.resolveRepo(rr.vcs, dir, repo) @@ -442,7 +455,7 @@ func downloadPackage(p *load.Package) error { } else { // Analyze the import path to determine the version control system, // repository, and the import path for the root of the repository. - rr, err := RepoRootForImportPath(p.ImportPath, IgnoreMod, security) + rr, err := RepoRootForImportPath(importPrefix, IgnoreMod, security) if err != nil { return err } diff --git a/src/cmd/go/internal/get/vcs.go b/src/cmd/go/internal/get/vcs.go index 052c82b7b564d..a7a2ba32cc33c 100644 --- a/src/cmd/go/internal/get/vcs.go +++ b/src/cmd/go/internal/get/vcs.go @@ -647,14 +647,7 @@ const ( func RepoRootForImportPath(importPath string, mod ModuleMode, security web.SecurityMode) (*RepoRoot, error) { rr, err := repoRootFromVCSPaths(importPath, "", security, vcsPaths) if err == errUnknownSite { - // If there are wildcards, look up the thing before the wildcard, - // hoping it applies to the wildcarded parts too. - // This makes 'go get rsc.io/pdf/...' work in a fresh GOPATH. - lookup := strings.TrimSuffix(importPath, "/...") - if i := strings.Index(lookup, "/.../"); i >= 0 { - lookup = lookup[:i] - } - rr, err = repoRootForImportDynamic(lookup, mod, security) + rr, err = repoRootForImportDynamic(importPath, mod, security) if err != nil { err = fmt.Errorf("unrecognized import path %q (%v)", importPath, err) } @@ -667,6 +660,7 @@ func RepoRootForImportPath(importPath string, mod ModuleMode, security web.Secur } } + // Should have been taken care of above, but make sure. if err == nil && strings.Contains(importPath, "...") && strings.Contains(rr.Root, "...") { // Do not allow wildcards in the repo root. rr = nil From dbd323bb880ff27fa9b4bdfebf3e5d4828b09678 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 13 Dec 2018 20:28:29 +0000 Subject: [PATCH 352/594] internal/x/net/http2/hpack: update from upstream Updates to x/net git rev 891ebc4b82d6e74f468c533b06f983c7be918a96 for: http2/hpack: track the beginning of a header block https://go-review.googlesource.com/c/153978 Updates golang/go#29187 Change-Id: Ie2568b3f8d6aaa3f097a4ac25d3acdc794f5ff5c Reviewed-on: https://go-review.googlesource.com/c/154118 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Matt Layher --- src/internal/x/net/http2/hpack/hpack.go | 10 +++++++++- src/internal/x/net/http2/hpack/hpack_test.go | 14 +++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/internal/x/net/http2/hpack/hpack.go b/src/internal/x/net/http2/hpack/hpack.go index 166788ceec5e8..85f18a2b0a861 100644 --- a/src/internal/x/net/http2/hpack/hpack.go +++ b/src/internal/x/net/http2/hpack/hpack.go @@ -92,6 +92,8 @@ type Decoder struct { // saveBuf is previous data passed to Write which we weren't able // to fully parse before. Unlike buf, we own this data. saveBuf bytes.Buffer + + firstField bool // processing the first field of the header block } // NewDecoder returns a new decoder with the provided maximum dynamic @@ -101,6 +103,7 @@ func NewDecoder(maxDynamicTableSize uint32, emitFunc func(f HeaderField)) *Decod d := &Decoder{ emit: emitFunc, emitEnabled: true, + firstField: true, } d.dynTab.table.init() d.dynTab.allowedMaxSize = maxDynamicTableSize @@ -226,11 +229,15 @@ func (d *Decoder) DecodeFull(p []byte) ([]HeaderField, error) { return hf, nil } +// Close declares that the decoding is complete and resets the Decoder +// to be reused again for a new header block. If there is any remaining +// data in the decoder's buffer, Close returns an error. func (d *Decoder) Close() error { if d.saveBuf.Len() > 0 { d.saveBuf.Reset() return DecodingError{errors.New("truncated headers")} } + d.firstField = true return nil } @@ -266,6 +273,7 @@ func (d *Decoder) Write(p []byte) (n int, err error) { d.saveBuf.Write(d.buf) return len(p), nil } + d.firstField = false if err != nil { break } @@ -391,7 +399,7 @@ func (d *Decoder) callEmit(hf HeaderField) error { func (d *Decoder) parseDynamicTableSizeUpdate() error { // RFC 7541, sec 4.2: This dynamic table size update MUST occur at the // beginning of the first header block following the change to the dynamic table size. - if d.dynTab.size > 0 { + if !d.firstField && d.dynTab.size > 0 { return DecodingError{errors.New("dynamic table size update MUST occur at the beginning of a header block")} } diff --git a/src/internal/x/net/http2/hpack/hpack_test.go b/src/internal/x/net/http2/hpack/hpack_test.go index 3f2227442a985..a361a2a7c2ece 100644 --- a/src/internal/x/net/http2/hpack/hpack_test.go +++ b/src/internal/x/net/http2/hpack/hpack_test.go @@ -748,14 +748,22 @@ func TestDynamicSizeUpdate(t *testing.T) { enc.SetMaxDynamicTableSize(255) enc.WriteField(HeaderField{Name: "foo", Value: "bar"}) - d := NewDecoder(4096, nil) - _, err := d.DecodeFull(buf.Bytes()) + d := NewDecoder(4096, func(_ HeaderField) {}) + _, err := d.Write(buf.Bytes()) + if err != nil { + t.Fatalf("unexpected error: got = %v", err) + } + + d.Close() + + // Start a new header + _, err = d.Write(buf.Bytes()) if err != nil { t.Fatalf("unexpected error: got = %v", err) } // must fail since the dynamic table update must be at the beginning - _, err = d.DecodeFull(buf.Bytes()) + _, err = d.Write(buf.Bytes()) if err == nil { t.Fatalf("dynamic table size update not at the beginning of a header block") } From b875991a49ac6d323c9c52c889429eb3b1642ef7 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 14 Dec 2018 18:33:13 +0000 Subject: [PATCH 353/594] net/http/httptest: don't register a flag unless it looks like it's in use We shouldn't pollute people's flags with this debugging flag that was never really meant to be public. It's certainly not documented. So keep it for now, but don't register it unless it looks like it's in use (by looking at os.Args). Kinda gross, but less gross than before. Fixes #28619 Change-Id: I47498948a26a71ff36f9658a6d9dac73fd0a3016 Reviewed-on: https://go-review.googlesource.com/c/154217 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Andrew Bonventre --- src/net/http/httptest/server.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/net/http/httptest/server.go b/src/net/http/httptest/server.go index ebafc9999c603..b4e2e9266e685 100644 --- a/src/net/http/httptest/server.go +++ b/src/net/http/httptest/server.go @@ -53,10 +53,10 @@ type Server struct { } func newLocalListener() net.Listener { - if *serve != "" { - l, err := net.Listen("tcp", *serve) + if serveFlag != "" { + l, err := net.Listen("tcp", serveFlag) if err != nil { - panic(fmt.Sprintf("httptest: failed to listen on %v: %v", *serve, err)) + panic(fmt.Sprintf("httptest: failed to listen on %v: %v", serveFlag, err)) } return l } @@ -73,7 +73,25 @@ func newLocalListener() net.Listener { // this flag lets you run // go test -run=BrokenTest -httptest.serve=127.0.0.1:8000 // to start the broken server so you can interact with it manually. -var serve = flag.String("httptest.serve", "", "if non-empty, httptest.NewServer serves on this address and blocks") +// We only register this flag if it looks like the caller knows about it +// and is trying to use it as we don't want to pollute flags and this +// isn't really part of our API. Don't depend on this. +var serveFlag string + +func init() { + if strSliceContainsPrefix(os.Args, "-httptest.serve=") || strSliceContainsPrefix(os.Args, "--httptest.serve=") { + flag.StringVar(&serveFlag, "httptest.serve", "", "if non-empty, httptest.NewServer serves on this address and blocks.") + } +} + +func strSliceContainsPrefix(v []string, pre string) bool { + for _, s := range v { + if strings.HasPrefix(s, pre) { + return true + } + } + return false +} // NewServer starts and returns a new Server. // The caller should call Close when finished, to shut it down. @@ -107,7 +125,7 @@ func (s *Server) Start() { s.URL = "http://" + s.Listener.Addr().String() s.wrap() s.goServe() - if *serve != "" { + if serveFlag != "" { fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL) select {} } From 84bf9ce1fbe7ae8424031550d9cf3fe6b27575e3 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 14 Dec 2018 16:14:56 -0500 Subject: [PATCH 354/594] doc: document Go 1.10.7 Change-Id: Id71aad4cf6149e0ba15f7fec0b74517827c37866 Reviewed-on: https://go-review.googlesource.com/c/154303 Reviewed-by: Dmitri Shuralyov --- doc/devel/release.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/devel/release.html b/doc/devel/release.html index 4e1f7cbc50250..8baf98677bf86 100644 --- a/doc/devel/release.html +++ b/doc/devel/release.html @@ -113,6 +113,14 @@

    Minor revisions

    1.10.6 milestone on our issue tracker for details.

    +

    +go1.10.7 (released 2018/12/14) includes a fix to a bug introduced in Go 1.10.6 +that broke go get for import path patterns containing +"...". +See the +Go 1.10.7 milestone on our issue tracker for details. +

    +

    go1.9 (released 2017/08/24)

    From 47713567d9ec3784688d4e41ae16dca8466dcb84 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 14 Dec 2018 16:04:50 -0500 Subject: [PATCH 355/594] doc: document Go 1.11.4 Change-Id: Ic098bd69fa9e3f7b2ed6c451a7a266167c0cde94 Reviewed-on: https://go-review.googlesource.com/c/154302 Reviewed-by: Dmitri Shuralyov --- doc/devel/release.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/devel/release.html b/doc/devel/release.html index 8baf98677bf86..73f7a0e304710 100644 --- a/doc/devel/release.html +++ b/doc/devel/release.html @@ -56,6 +56,16 @@

    Minor revisions

    1.11.3 milestone on our issue tracker for details.

    +

    +go1.11.4 (released 2018/12/14) includes fixes to cgo, the compiler, linker, +runtime, documentation, go command, and the net/http and +go/types packages. +It includes a fix to a bug introduced in Go 1.11.3 that broke go +get for import path patterns containing "...". +See the Go +1.11.4 milestone on our issue tracker for details. +

    +

    go1.10 (released 2018/02/16)

    From fd323a8cffc11c92366243c4d26cb3ead507dc84 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 14 Dec 2018 16:59:04 -0500 Subject: [PATCH 356/594] cmd/go/internal/cache: save more data from DefaultDir cmd/go/main.go sets GOCACHE explicitly, so if we don't save some metadata about how DefaultDir arrived at its answer we will be unable to reconstruct it later. Fixes #29243 Change-Id: Ic8bb859ab045a29c91f6a4527e65aedabf874d53 Reviewed-on: https://go-review.googlesource.com/c/154309 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod Reviewed-by: Filippo Valsorda --- src/cmd/go/internal/cache/default.go | 53 ++++++++++++-------- src/cmd/go/testdata/script/build_nocache.txt | 24 +++++++-- 2 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/cmd/go/internal/cache/default.go b/src/cmd/go/internal/cache/default.go index 52a1fc8c7a517..f545c147009f2 100644 --- a/src/cmd/go/internal/cache/default.go +++ b/src/cmd/go/internal/cache/default.go @@ -37,8 +37,11 @@ See golang.org to learn more about Go. // the first time Default is called. func initDefaultCache() { dir := DefaultDir() - if dir == "off" { - die() + if dir == "off" || dir == "" { + if defaultDirErr != nil { + base.Fatalf("build cache is required, but could not be located: %v", defaultDirErr) + } + base.Fatalf("build cache is disabled by GOCACHE=off, but required as of Go 1.12") } if err := os.MkdirAll(dir, 0777); err != nil { base.Fatalf("failed to initialize build cache at %s: %s\n", dir, err) @@ -55,29 +58,35 @@ func initDefaultCache() { defaultCache = c } +var ( + defaultDirOnce sync.Once + defaultDir string + defaultDirErr error +) + // DefaultDir returns the effective GOCACHE setting. // It returns "off" if the cache is disabled. func DefaultDir() string { - dir := os.Getenv("GOCACHE") - if dir != "" { - return dir - } + // Save the result of the first call to DefaultDir for later use in + // initDefaultCache. cmd/go/main.go explicitly sets GOCACHE so that + // subprocesses will inherit it, but that means initDefaultCache can't + // otherwise distinguish between an explicit "off" and a UserCacheDir error. - // Compute default location. - dir, err := os.UserCacheDir() - if err != nil { - return "off" - } - return filepath.Join(dir, "go-build") -} + defaultDirOnce.Do(func() { + defaultDir = os.Getenv("GOCACHE") + if defaultDir != "" { + return + } -// die calls base.Fatalf with a message explaining why DefaultDir was "off". -func die() { - if os.Getenv("GOCACHE") == "off" { - base.Fatalf("build cache is disabled by GOCACHE=off, but required as of Go 1.12") - } - if _, err := os.UserCacheDir(); err != nil { - base.Fatalf("build cache is required, but could not be located: %v", err) - } - panic(fmt.Sprintf("cache.die called unexpectedly with cache.DefaultDir() = %s", DefaultDir())) + // Compute default location. + dir, err := os.UserCacheDir() + if err != nil { + defaultDir = "off" + defaultDirErr = fmt.Errorf("GOCACHE is not defined and %v", err) + return + } + defaultDir = filepath.Join(dir, "go-build") + }) + + return defaultDir } diff --git a/src/cmd/go/testdata/script/build_nocache.txt b/src/cmd/go/testdata/script/build_nocache.txt index 61ea5c5dbdc51..5aa46e0b77378 100644 --- a/src/cmd/go/testdata/script/build_nocache.txt +++ b/src/cmd/go/testdata/script/build_nocache.txt @@ -1,5 +1,22 @@ -# Set GOCACHE to a directory that doesn't allow writes. -[windows] skip # Does not support unwritable directories. +# As of Go 1.12, the module cache is required. + +# If none of the variables we use to locate GOCACHE are set, the cache is off +# and we cannot build. +env GOCACHE= +env XDG_CACHE_HOME= +env HOME= +[plan9] env home= +[windows] env LocalAppData= +! go build -o triv triv.go +stderr 'build cache is required, but could not be located: GOCACHE is not defined and .*' + +# An explicit GOCACHE=off also disables builds. +env GOCACHE=off +! go build -o triv triv.go +stderr 'build cache is disabled by GOCACHE=off' + +# If GOCACHE is set to an unwritable directory, we should diagnose it as such. +[windows] stop # Does not support unwritable directories. [root] skip # Can write to unwritable directories. mkdir $WORK/unwritable/home @@ -8,9 +25,6 @@ chmod 0555 $WORK/unwritable/home [plan9] env home=$WORK/unwritable/home env GOCACHE=$WORK/unwritable/home - -# As of Go 1.12, the module cache is required: -# failure to write to it should cause builds to fail. ! go build -o triv triv.go stderr 'failed to initialize build cache.* permission denied' From 281ce28c5048416dce9379405cc061b2f3662c84 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Thu, 13 Dec 2018 23:55:22 -0500 Subject: [PATCH 357/594] cmd/link: fix in-package syso linking CL 146297 ignored archive members with short names that don't have the .o suffix, however, it also ignored .syso files as well. This change restores the original .syso behavior and adds a test. As the test is basically following a shell script, we make use of the existing cmd/go/testdata/script framework. To support running C compiler in the script, we added a `cc` command, which runs the C compiler along with correct platform specific arguments. Fixes #29253. Change-Id: If8520151c4d6a74ab9fe84d34bff9a4480688815 Reviewed-on: https://go-review.googlesource.com/c/154109 Run-TryBot: Minux Ma TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang Reviewed-by: Alan Donovan --- src/cmd/go/script_test.go | 13 +++++++++ src/cmd/go/testdata/script/README | 4 +++ .../testdata/script/cgo_syso_issue29253.txt | 28 +++++++++++++++++++ src/cmd/link/internal/ld/lib.go | 6 ++-- 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/cmd/go/testdata/script/cgo_syso_issue29253.txt diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index 284b3548c451c..4aa92625dde3c 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -27,6 +27,7 @@ import ( "cmd/go/internal/imports" "cmd/go/internal/par" "cmd/go/internal/txtar" + "cmd/go/internal/work" ) // TestScript runs the tests in testdata/script/*.txt. @@ -343,6 +344,7 @@ Script: // var scriptCmds = map[string]func(*testScript, bool, []string){ "addcrlf": (*testScript).cmdAddcrlf, + "cc": (*testScript).cmdCc, "cd": (*testScript).cmdCd, "chmod": (*testScript).cmdChmod, "cmp": (*testScript).cmdCmp, @@ -378,6 +380,17 @@ func (ts *testScript) cmdAddcrlf(neg bool, args []string) { } } +// cc runs the C compiler along with platform specific options. +func (ts *testScript) cmdCc(neg bool, args []string) { + if len(args) < 1 || (len(args) == 1 && args[0] == "&") { + ts.fatalf("usage: cc args... [&]") + } + + var b work.Builder + b.Init() + ts.cmdExec(neg, append(b.GccCmd(".", ""), args...)) +} + // cd changes to a different directory. func (ts *testScript) cmdCd(neg bool, args []string) { if neg { diff --git a/src/cmd/go/testdata/script/README b/src/cmd/go/testdata/script/README index 76d4b36b017ca..a7b50fff16454 100644 --- a/src/cmd/go/testdata/script/README +++ b/src/cmd/go/testdata/script/README @@ -84,6 +84,10 @@ when testing.Short() is false. The commands are: +- [!] cc args... [&] + Run the C compiler, the platform specific flags (i.e. `go env GOGCCFLAGS`) will be + added automatically before args. + - cd dir Change to the given directory for future commands. diff --git a/src/cmd/go/testdata/script/cgo_syso_issue29253.txt b/src/cmd/go/testdata/script/cgo_syso_issue29253.txt new file mode 100644 index 0000000000000..0d18fa91d6b7f --- /dev/null +++ b/src/cmd/go/testdata/script/cgo_syso_issue29253.txt @@ -0,0 +1,28 @@ +# This test tests that we can link in-package syso files that provides symbols +# for cgo. See issue 29253. +[!cgo] stop +[!gc] stop +cc -c -o pkg/o.syso ext.c +go build main.go + +-- ext.c -- +// +build ignore + +int f() { return 42; } +-- pkg/pkg.go -- +package pkg + +// extern int f(void); +import "C" + +func init() { + if v := C.f(); v != 42 { + panic(v) + } +} +-- main.go -- +package main + +import _ "pkg" + +func main() {} diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 755693b27ec74..253a9f68475c6 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -872,8 +872,10 @@ func loadobjfile(ctxt *Link, lib *sym.Library) { // Skip other special (non-object-file) sections that // build tools may have added. Such sections must have // short names so that the suffix is not truncated. - if len(arhdr.name) < 16 && !strings.HasSuffix(arhdr.name, ".o") { - continue + if len(arhdr.name) < 16 { + if ext := filepath.Ext(arhdr.name); ext != ".o" && ext != ".syso" { + continue + } } pname := fmt.Sprintf("%s(%s)", lib.File, arhdr.name) From 26985ed4a58665d25a256e3b63b353972fc3aab0 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Fri, 14 Dec 2018 16:11:03 -0800 Subject: [PATCH 358/594] cmd/nm: report windows/arm as relocatable in TestGoExec Updates #26148 Change-Id: I704efafca39e4397caf2db0146d83d309c761dd1 Reviewed-on: https://go-review.googlesource.com/c/154357 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/nm/nm_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/nm/nm_test.go b/src/cmd/nm/nm_test.go index 53c39f2f896b6..1b5bd21ad5dc0 100644 --- a/src/cmd/nm/nm_test.go +++ b/src/cmd/nm/nm_test.go @@ -151,6 +151,9 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) { return true } } + if runtime.GOOS == "windows" && runtime.GOARCH == "arm" { + return true + } return false } From d50390ce7253e2caac9931bc83b49b32cdcd9698 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 15 Dec 2018 17:03:37 +0100 Subject: [PATCH 359/594] cmd/fix,cmd/cgo,misc/cgo: map the EGLDisplay C type to uintptr in Go Similar to to macOS' CF* types and JNI's jobject and derived types, the EGLDisplay type is declared as a pointer but can contain non-pointers (see #27054). Fix it the same way: map EGLDisplay to uintptr in Go. Fixes #27054 RELNOTE=yes Change-Id: I6136f8f8162687c5493b30ed324e29efe55a8fd7 Reviewed-on: https://go-review.googlesource.com/c/154417 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- misc/cgo/test/issue27054/egl.h | 7 + misc/cgo/test/issue27054/test27054.go | 17 +++ src/cmd/cgo/gcc.go | 16 +++ src/cmd/fix/egltype.go | 32 +++++ src/cmd/fix/egltype_test.go | 185 ++++++++++++++++++++++++++ 5 files changed, 257 insertions(+) create mode 100644 misc/cgo/test/issue27054/egl.h create mode 100644 misc/cgo/test/issue27054/test27054.go create mode 100644 src/cmd/fix/egltype.go create mode 100644 src/cmd/fix/egltype_test.go diff --git a/misc/cgo/test/issue27054/egl.h b/misc/cgo/test/issue27054/egl.h new file mode 100644 index 0000000000000..33a759ea2a831 --- /dev/null +++ b/misc/cgo/test/issue27054/egl.h @@ -0,0 +1,7 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// This is the relevant part of EGL/egl.h. + +typedef void *EGLDisplay; diff --git a/misc/cgo/test/issue27054/test27054.go b/misc/cgo/test/issue27054/test27054.go new file mode 100644 index 0000000000000..186f5bd602078 --- /dev/null +++ b/misc/cgo/test/issue27054/test27054.go @@ -0,0 +1,17 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package issue27054 + +/* +#include "egl.h" +*/ +import "C" +import ( + "testing" +) + +func Test27054(t *testing.T) { + var _ C.EGLDisplay = 0 // Note: 0, not nil. That makes sure we use uintptr for this type. +} diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 1f257d7958ab7..27bd59b54e0cc 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -3004,6 +3004,9 @@ func (c *typeConv) badPointerTypedef(dt *dwarf.TypedefType) bool { if c.badJNI(dt) { return true } + if c.badEGLDisplay(dt) { + return true + } return false } @@ -3140,6 +3143,19 @@ func (c *typeConv) badJNI(dt *dwarf.TypedefType) bool { return false } +func (c *typeConv) badEGLDisplay(dt *dwarf.TypedefType) bool { + if dt.Name != "EGLDisplay" { + return false + } + // Check that the typedef is "typedef void *EGLDisplay". + if ptr, ok := dt.Type.(*dwarf.PtrType); ok { + if _, ok := ptr.Type.(*dwarf.VoidType); ok { + return true + } + } + return false +} + // jniTypes maps from JNI types that we want to be uintptrs, to the underlying type to which // they are mapped. The base "jobject" maps to the empty string. var jniTypes = map[string]string{ diff --git a/src/cmd/fix/egltype.go b/src/cmd/fix/egltype.go new file mode 100644 index 0000000000000..c8c4f03e97f2b --- /dev/null +++ b/src/cmd/fix/egltype.go @@ -0,0 +1,32 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "go/ast" +) + +func init() { + register(eglFix) +} + +var eglFix = fix{ + name: "egl", + date: "2018-12-15", + f: eglfix, + desc: `Fixes initializers of EGLDisplay`, + disabled: false, +} + +// Old state: +// type EGLDisplay unsafe.Pointer +// New state: +// type EGLDisplay uintptr +// This fix finds nils initializing these types and replaces the nils with 0s. +func eglfix(f *ast.File) bool { + return typefix(f, func(s string) bool { + return s == "C.EGLDisplay" + }) +} diff --git a/src/cmd/fix/egltype_test.go b/src/cmd/fix/egltype_test.go new file mode 100644 index 0000000000000..35ffe925958a8 --- /dev/null +++ b/src/cmd/fix/egltype_test.go @@ -0,0 +1,185 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func init() { + addTestCases(eglTests, eglfix) +} + +var eglTests = []testCase{ + { + Name: "egl.localVariable", + In: `package main + +import "C" + +func f() { + var x C.EGLDisplay = nil + x = nil + x, x = nil, nil +} +`, + Out: `package main + +import "C" + +func f() { + var x C.EGLDisplay = 0 + x = 0 + x, x = 0, 0 +} +`, + }, + { + Name: "egl.globalVariable", + In: `package main + +import "C" + +var x C.EGLDisplay = nil + +func f() { + x = nil +} +`, + Out: `package main + +import "C" + +var x C.EGLDisplay = 0 + +func f() { + x = 0 +} +`, + }, + { + Name: "egl.EqualArgument", + In: `package main + +import "C" + +var x C.EGLDisplay +var y = x == nil +var z = x != nil +`, + Out: `package main + +import "C" + +var x C.EGLDisplay +var y = x == 0 +var z = x != 0 +`, + }, + { + Name: "egl.StructField", + In: `package main + +import "C" + +type T struct { + x C.EGLDisplay +} + +var t = T{x: nil} +`, + Out: `package main + +import "C" + +type T struct { + x C.EGLDisplay +} + +var t = T{x: 0} +`, + }, + { + Name: "egl.FunctionArgument", + In: `package main + +import "C" + +func f(x C.EGLDisplay) { +} + +func g() { + f(nil) +} +`, + Out: `package main + +import "C" + +func f(x C.EGLDisplay) { +} + +func g() { + f(0) +} +`, + }, + { + Name: "egl.ArrayElement", + In: `package main + +import "C" + +var x = [3]C.EGLDisplay{nil, nil, nil} +`, + Out: `package main + +import "C" + +var x = [3]C.EGLDisplay{0, 0, 0} +`, + }, + { + Name: "egl.SliceElement", + In: `package main + +import "C" + +var x = []C.EGLDisplay{nil, nil, nil} +`, + Out: `package main + +import "C" + +var x = []C.EGLDisplay{0, 0, 0} +`, + }, + { + Name: "egl.MapKey", + In: `package main + +import "C" + +var x = map[C.EGLDisplay]int{nil: 0} +`, + Out: `package main + +import "C" + +var x = map[C.EGLDisplay]int{0: 0} +`, + }, + { + Name: "egl.MapValue", + In: `package main + +import "C" + +var x = map[int]C.EGLDisplay{0: nil} +`, + Out: `package main + +import "C" + +var x = map[int]C.EGLDisplay{0: 0} +`, + }, +} From e167587dd62a7e1d8683982e2b6eaa1c1cff9c67 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Sun, 16 Dec 2018 19:13:25 +0530 Subject: [PATCH 360/594] go/doc: handle Examples with no body Fixes #29271 Change-Id: Iff6a16c659ad6ec1b4d9559fcbcd40196086c60e Reviewed-on: https://go-review.googlesource.com/c/154380 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/go/doc/example.go | 3 +++ src/go/doc/example_test.go | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/src/go/doc/example.go b/src/go/doc/example.go index 45350f8fd3532..81956f2fdbfe0 100644 --- a/src/go/doc/example.go +++ b/src/go/doc/example.go @@ -426,6 +426,9 @@ func stripOutputComment(body *ast.BlockStmt, comments []*ast.CommentGroup) (*ast // lastComment returns the last comment inside the provided block. func lastComment(b *ast.BlockStmt, c []*ast.CommentGroup) (i int, last *ast.CommentGroup) { + if b == nil { + return + } pos, end := b.Pos(), b.End() for j, cg := range c { if cg.Pos() < pos { diff --git a/src/go/doc/example_test.go b/src/go/doc/example_test.go index 0d2bf72e319b6..74fd10626d277 100644 --- a/src/go/doc/example_test.go +++ b/src/go/doc/example_test.go @@ -413,6 +413,41 @@ func TestExampleInspectSignature(t *testing.T) { } } +const exampleEmpty = ` +package p +func Example() {} +func Example_a() +` + +const exampleEmptyOutput = `package main + +func main() {} +func main() +` + +func TestExampleEmpty(t *testing.T) { + fset := token.NewFileSet() + file, err := parser.ParseFile(fset, "test.go", strings.NewReader(exampleEmpty), parser.ParseComments) + if err != nil { + t.Fatal(err) + } + + es := doc.Examples(file) + if len(es) != 1 { + t.Fatalf("wrong number of examples; got %d want 1", len(es)) + } + e := es[0] + if e.Name != "" { + t.Errorf("got Name == %q, want %q", e.Name, "") + } + if g, w := formatFile(t, fset, e.Play), exampleEmptyOutput; g != w { + t.Errorf("got Play == %q, want %q", g, w) + } + if g, w := e.Output, ""; g != w { + t.Errorf("got Output == %q, want %q", g, w) + } +} + func formatFile(t *testing.T, fset *token.FileSet, n *ast.File) string { if n == nil { return "" From a27f3d5cfbed01dd56a23647330a42dcf4bf6ea9 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 14 Dec 2018 11:55:44 -0500 Subject: [PATCH 361/594] runtime: fix hangs in TestDebugCall* This fixes a few different issues that led to hangs and general flakiness in the TestDebugCall* tests. 1. This fixes missing wake-ups in two error paths of the SIGTRAP signal handler. If the goroutine was in an unknown state, or if there was an unknown debug call status, we currently don't wake the injection coordinator. These are terminal states, so this resulted in a hang. 2. This adds a retry if the target goroutine is in a transient state that prevents us from injecting a call. The most common failure mode here is that the target goroutine is in _Grunnable, but this was previously masked because it deadlocked the test. 3. Related to 2, this switches the "ready" signal from the target goroutine from a blocking channel send to a non-blocking channel send. This makes it much less likely that we'll catch this goroutine while it's in the runtime performing that send. 4. This increases GOMAXPROCS from 2 to 8 during these tests. With the current setting of 2, we can have at most the non-preemptible goroutine we're injecting a call in to and the goroutine that's trying to make it exit. If anything else comes along, it can deadlock. One particular case I observed was in TestDebugCallGC, where runtime.GC() returns before the forEachP that prepares sweeping on all goroutines has finished. When this happens, the forEachP blocks on the non-preemptible loop, which means we now have at least three goroutines that need to run. Fixes #25519. Updates #29124. Change-Id: I7bc41dc0b865b7d0bb379cb654f9a1218bc37428 Reviewed-on: https://go-review.googlesource.com/c/154112 Run-TryBot: Austin Clements Reviewed-by: Michael Knyszek --- src/runtime/debug_test.go | 20 ++++++++++---- src/runtime/export_debug_test.go | 46 +++++++++++++++++++++++--------- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/src/runtime/debug_test.go b/src/runtime/debug_test.go index 37dcafd145ea6..f77a373d1332f 100644 --- a/src/runtime/debug_test.go +++ b/src/runtime/debug_test.go @@ -33,11 +33,17 @@ func startDebugCallWorker(t *testing.T) (g *runtime.G, after func()) { skipUnderDebugger(t) // This can deadlock if there aren't enough threads or if a GC - // tries to interrupt an atomic loop (see issue #10958). - ogomaxprocs := runtime.GOMAXPROCS(2) + // tries to interrupt an atomic loop (see issue #10958). We + // use 8 Ps so there's room for the debug call worker, + // something that's trying to preempt the call worker, and the + // goroutine that's trying to stop the call worker. + ogomaxprocs := runtime.GOMAXPROCS(8) ogcpercent := debug.SetGCPercent(-1) - ready := make(chan *runtime.G) + // ready is a buffered channel so debugCallWorker won't block + // on sending to it. This makes it less likely we'll catch + // debugCallWorker while it's in the runtime. + ready := make(chan *runtime.G, 1) var stop uint32 done := make(chan error) go debugCallWorker(ready, &stop, done) @@ -67,6 +73,10 @@ func debugCallWorker(ready chan<- *runtime.G, stop *uint32, done chan<- error) { close(done) } +// Don't inline this function, since we want to test adjusting +// pointers in the arguments. +// +//go:noinline func debugCallWorker2(stop *uint32, x *int) { for atomic.LoadUint32(stop) == 0 { // Strongly encourage x to live in a register so we @@ -193,7 +203,7 @@ func TestDebugCallUnsafePoint(t *testing.T) { // This can deadlock if there aren't enough threads or if a GC // tries to interrupt an atomic loop (see issue #10958). - defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(8)) defer debug.SetGCPercent(debug.SetGCPercent(-1)) // Test that the runtime refuses call injection at unsafe points. @@ -215,7 +225,7 @@ func TestDebugCallPanic(t *testing.T) { skipUnderDebugger(t) // This can deadlock if there aren't enough threads. - defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(2)) + defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(8)) ready := make(chan *runtime.G) var stop uint32 diff --git a/src/runtime/export_debug_test.go b/src/runtime/export_debug_test.go index 74f8855de6554..e97dd52f209d9 100644 --- a/src/runtime/export_debug_test.go +++ b/src/runtime/export_debug_test.go @@ -50,19 +50,31 @@ func InjectDebugCall(gp *g, fn, args interface{}, tkill func(tid int) error) (in h.gp = gp h.fv, h.argp, h.argSize = fv, argp, argSize h.handleF = h.handle // Avoid allocating closure during signal - noteclear(&h.done) defer func() { testSigtrap = nil }() - testSigtrap = h.inject - if err := tkill(tid); err != nil { - return nil, err - } - // Wait for completion. - notetsleepg(&h.done, -1) - if len(h.err) != 0 { - return nil, h.err + for i := 0; ; i++ { + testSigtrap = h.inject + noteclear(&h.done) + h.err = "" + + if err := tkill(tid); err != nil { + return nil, err + } + // Wait for completion. + notetsleepg(&h.done, -1) + if h.err != "" { + switch h.err { + case "retry _Grunnable", "executing on Go runtime stack": + // These are transient states. Try to get out of them. + if i < 100 { + Gosched() + continue + } + } + return nil, h.err + } + return h.panic, nil } - return h.panic, nil } type debugCallHandler struct { @@ -99,12 +111,18 @@ func (h *debugCallHandler) inject(info *siginfo, ctxt *sigctxt, gp2 *g) bool { h.savedRegs.fpstate = nil // Set PC to debugCallV1. ctxt.set_rip(uint64(funcPC(debugCallV1))) + // Call injected. Switch to the debugCall protocol. + testSigtrap = h.handleF + case _Grunnable: + // Ask InjectDebugCall to pause for a bit and then try + // again to interrupt this goroutine. + h.err = plainError("retry _Grunnable") + notewakeup(&h.done) default: h.err = plainError("goroutine in unexpected state at call inject") - return true + notewakeup(&h.done) } - // Switch to the debugCall protocol and resume execution. - testSigtrap = h.handleF + // Resume execution. return true } @@ -149,6 +167,7 @@ func (h *debugCallHandler) handle(info *siginfo, ctxt *sigctxt, gp2 *g) bool { sp := ctxt.rsp() reason := *(*string)(unsafe.Pointer(uintptr(sp))) h.err = plainError(reason) + // Don't wake h.done. We need to transition to status 16 first. case 16: // Restore all registers except RIP and RSP. rip, rsp := ctxt.rip(), ctxt.rsp() @@ -162,6 +181,7 @@ func (h *debugCallHandler) handle(info *siginfo, ctxt *sigctxt, gp2 *g) bool { notewakeup(&h.done) default: h.err = plainError("unexpected debugCallV1 status") + notewakeup(&h.done) } // Resume execution. return true From bc175e53cc95d0f2026d06a1c8827246f9c55f8d Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Sun, 16 Dec 2018 01:07:58 +1100 Subject: [PATCH 362/594] cmd/dist: re-enable VFPv3 on openbsd/arm The OpenBSD armv7 port has working VFPv3 these days - re-enable the VFP detection code so that GOARM=7 is used by default on openbsd/arm. Change-Id: I0271d81c048d2d55becd2803c19e5f1542076357 Reviewed-on: https://go-review.googlesource.com/c/154378 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor --- src/cmd/dist/util.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go index 808a60a28e2c1..996e058b31822 100644 --- a/src/cmd/dist/util.go +++ b/src/cmd/dist/util.go @@ -397,9 +397,8 @@ func xgetgoarm() string { // Conservative default for cross-compilation. return "5" } - if goos == "freebsd" || goos == "openbsd" { + if goos == "freebsd" { // FreeBSD has broken VFP support. - // OpenBSD currently only supports softfloat. return "5" } From e4535772ca3f11084ee5fa4d4bd3a542e143b80f Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 15 Dec 2018 18:52:26 +1100 Subject: [PATCH 363/594] os: make Stat work on FAT file system It appears calling GetFileInformationByHandleEx with FILE_ATTRIBUTE_TAG_INFO fails on FAT file system. FAT does not support symlinks, so assume there are no symlnks when GetFileInformationByHandleEx returns ERROR_INVALID_PARAMETER. Fixes #29214 Change-Id: If2d9f3288bd99637681ab5fd4e4581c77b578a69 Reviewed-on: https://go-review.googlesource.com/c/154377 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/os/types_windows.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/os/types_windows.go b/src/os/types_windows.go index 8636dc7f05d9e..5e33292bec681 100644 --- a/src/os/types_windows.go +++ b/src/os/types_windows.go @@ -51,7 +51,15 @@ func newFileStatFromGetFileInformationByHandle(path string, h syscall.Handle) (f var ti windows.FILE_ATTRIBUTE_TAG_INFO err = windows.GetFileInformationByHandleEx(h, windows.FileAttributeTagInfo, (*byte)(unsafe.Pointer(&ti)), uint32(unsafe.Sizeof(ti))) if err != nil { - return nil, &PathError{"GetFileInformationByHandleEx", path, err} + if errno, ok := err.(syscall.Errno); ok && errno == windows.ERROR_INVALID_PARAMETER { + // It appears calling GetFileInformationByHandleEx with + // FILE_ATTRIBUTE_TAG_INFO fails on FAT file system with + // ERROR_INVALID_PARAMETER. Clear ti.ReparseTag in that + // instance to indicate no symlinks are possible. + ti.ReparseTag = 0 + } else { + return nil, &PathError{"GetFileInformationByHandleEx", path, err} + } } return &fileStat{ From bed88f4e81013433ff47fb2661a329530b57ede6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 23 Nov 2018 15:16:18 +0100 Subject: [PATCH 364/594] cmd/link: fix error messages for external linking on ppc64 This commit fixes error messages displayed on aix/ppc64 with external linking. Change-Id: I5311d36f30394be717827891e070db249482814a Reviewed-on: https://go-review.googlesource.com/c/151041 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/link/internal/ld/config.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/link/internal/ld/config.go b/src/cmd/link/internal/ld/config.go index 2f6dd7a7e22d8..60b6491859574 100644 --- a/src/cmd/link/internal/ld/config.go +++ b/src/cmd/link/internal/ld/config.go @@ -248,7 +248,7 @@ func determineLinkMode(ctxt *Link) { ctxt.LinkMode = LinkInternal case "1": if objabi.GOARCH == "ppc64" { - Exitf("external linking requested via GO_EXTLINK_ENABLED but not supported for linux/ppc64") + Exitf("external linking requested via GO_EXTLINK_ENABLED but not supported for %s/ppc64", objabi.GOOS) } ctxt.LinkMode = LinkExternal default: @@ -262,7 +262,7 @@ func determineLinkMode(ctxt *Link) { ctxt.LinkMode = LinkInternal } if objabi.GOARCH == "ppc64" && ctxt.LinkMode == LinkExternal { - Exitf("external linking is not supported for linux/ppc64") + Exitf("external linking is not supported for %s/ppc64", objabi.GOOS) } } case LinkInternal: @@ -271,7 +271,7 @@ func determineLinkMode(ctxt *Link) { } case LinkExternal: if objabi.GOARCH == "ppc64" { - Exitf("external linking not supported for linux/ppc64") + Exitf("external linking not supported for %s/ppc64", objabi.GOOS) } } } From fe2feb978e0c4324047f749c3fcfb9cecaafcfdc Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 17 Dec 2018 13:45:14 -0500 Subject: [PATCH 365/594] runtime: poison the write barrier buffer during flushing Currently we reset the write barrier buffer before processing the pointers in it. As a result, if there were any write barriers in the code that processes the buffer, it would corrupt the write barrier buffer and cause us to mark objects without later scanning them. As far as I can tell, this shouldn't be happening, but rather than relying on hope (and incomplete static analysis), this CL changes wbBufFlush1 to poison the write barrier buffer while processing it, and only reset it once it's done. Updates #27993. (Unlike many of the other changes for this issue, there's no need to roll back this CL. It's a good change in its own right.) Change-Id: I6d2d9f1b69b89438438b9ee624f3fff9f009e29d Reviewed-on: https://go-review.googlesource.com/c/154537 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Michael Knyszek --- src/runtime/mwbbuf.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtime/mwbbuf.go b/src/runtime/mwbbuf.go index a698493a0a2c5..6f01bf68fdb47 100644 --- a/src/runtime/mwbbuf.go +++ b/src/runtime/mwbbuf.go @@ -217,14 +217,16 @@ func wbBufFlush1(_p_ *p) { n := (_p_.wbBuf.next - start) / unsafe.Sizeof(_p_.wbBuf.buf[0]) ptrs := _p_.wbBuf.buf[:n] - // Reset the buffer. - _p_.wbBuf.reset() + // Poison the buffer to make extra sure nothing is enqueued + // while we're processing the buffer. + _p_.wbBuf.next = 0 if useCheckmark { // Slow path for checkmark mode. for _, ptr := range ptrs { shade(ptr) } + _p_.wbBuf.reset() return } @@ -275,4 +277,6 @@ func wbBufFlush1(_p_ *p) { // Enqueue the greyed objects. gcw.putBatch(ptrs[:pos]) + + _p_.wbBuf.reset() } From a1aafd8b28ada0d40e2cb25fb0762ae171eec558 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 17 Dec 2018 11:33:42 -0800 Subject: [PATCH 366/594] cmd/compile: generate interface method expression wrapper for error.Error A prior optimization (https://golang.org/cl/106175) removed the generation of unnecessary method expression wrappers, but also eliminated the generation of the wrapper for error.Error which was still required. Special-case error type in the optimization. Fixes #29304. Change-Id: I54c8afc88a2c6d1906afa2d09c68a0a3f3e2f1e3 Reviewed-on: https://go-review.googlesource.com/c/154578 Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/subr.go | 5 +++-- test/fixedbugs/issue29304.go | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 test/fixedbugs/issue29304.go diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index 629186829a5af..2a976dc4f03a9 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -1517,8 +1517,9 @@ func genwrapper(rcvr *types.Type, method *types.Field, newnam *types.Sym) { return } - // Only generate I.M wrappers for I in I's own package. - if rcvr.IsInterface() && rcvr.Sym != nil && rcvr.Sym.Pkg != localpkg { + // Only generate I.M wrappers for I in I's own package + // but keep doing it for error.Error (was issue #29304). + if rcvr.IsInterface() && rcvr.Sym != nil && rcvr.Sym.Pkg != localpkg && rcvr != types.Errortype { return } diff --git a/test/fixedbugs/issue29304.go b/test/fixedbugs/issue29304.go new file mode 100644 index 0000000000000..47bc99f9ca20e --- /dev/null +++ b/test/fixedbugs/issue29304.go @@ -0,0 +1,19 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Verify that relocation target go.builtin.error.Error +// is defined and the code links and runs correctly. + +package main + +import "errors" + +func main() { + err := errors.New("foo") + if error.Error(err) != "foo" { + panic("FAILED") + } +} From 179acf4083bedecad5f9700b86f6b58052b7526e Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 17 Dec 2018 15:26:36 -0500 Subject: [PATCH 367/594] doc/go1.12: updates for runtime and compiler Change-Id: Ifb16fd28105efd05cebbd615b52e45330b77cede Reviewed-on: https://go-review.googlesource.com/c/154600 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 58 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 817c1366ac80d..14adc7c4da41d 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -203,6 +203,23 @@

    Compiler toolchain

    Language changes made before Go 1.12 are not consistently enforced.

    +

    + The compiler toolchain now uses different conventions to call Go + functions and assembly functions. This should be invisible to users, + except for calls that simultaneously cross between Go and + assembly and cross a package boundary. If linking results + in an error like "relocation target not defined for ABIInternal (but + is defined for ABI0)", please refer to help section of the ABI + design document. + TODO(austin): Link to the design doc. +

    + +

    + There have been many improvements to the DWARF debug information + produced by the compiler, including improvements to argument + printing and variable location information. +

    +

    Godoc

    @@ -211,6 +228,36 @@

    Godoc

    for command-line help output instead.

    +

    Trace

    + +

    + The trace tool now supports plotting mutator utilization curves, + including cross-references to the execution trace. These are useful + for analyzing the impact of the garbage collector on application + latency and throughput. +

    + +

    Runtime

    + +

    + Go 1.12 significantly improves the performance of sweeping when a + large fraction of the heap remains live. This reduces allocation + latency immediately following a garbage collection. +

    + +

    + The Go runtime now releases memory back to the operating system more + aggressively, particularly in response to large allocations that + can't reuse existing heap space. +

    + +

    + On Linux, the Go runtime now releases memory back to the operating + system only when the OS is under memory pressure. This is more + efficient, but means a process's RSS (resident set size) won't + decrease unless the OS is running out of memory. +

    +

    Core library

    @@ -231,7 +278,6 @@

    Minor changes to the library

    -
    bufio
    @@ -541,16 +587,6 @@

    Minor changes to the library

    -
    runtime
    -
    -

    - On Linux, the Go runtime now releases memory only when the OS is under memory - pressure. This is more efficient, but means a process's RSS (resident set size) - won't decrease unless the OS is running out of memory. -

    - -
    -
    runtime/debug

    From 503091a77c43263a5ce86f9358de3445524627b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 28 Nov 2018 13:38:02 +0100 Subject: [PATCH 368/594] cmd: improve aix/ppc64 new symbol addressing This commit updates the new symbol addressing made for aix/ppc64 according to feedbacks given in CL 151039. Change-Id: Ic4eb9943dc520d65f7d084adf8fa9a2530f4d3f9 Reviewed-on: https://go-review.googlesource.com/c/151302 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/internal/obj/ppc64/asm9.go | 12 +++++++----- src/cmd/internal/obj/ppc64/obj9.go | 1 + src/cmd/link/internal/ppc64/asm.go | 9 ++++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/cmd/internal/obj/ppc64/asm9.go b/src/cmd/internal/obj/ppc64/asm9.go index d7f1a08622af2..a2ea492710b59 100644 --- a/src/cmd/internal/obj/ppc64/asm9.go +++ b/src/cmd/internal/obj/ppc64/asm9.go @@ -2212,7 +2212,7 @@ func (c *ctxt9) opform(insn uint32) int { // instruction op with source or destination (as appropriate) register reg. func (c *ctxt9) symbolAccess(s *obj.LSym, d int64, reg int16, op uint32) (o1, o2 uint32) { if c.ctxt.Headtype == objabi.Haix { - // Every symbol accesses must be made via a TOC anchor. + // Every symbol access must be made via a TOC anchor. c.ctxt.Diag("symbolAccess called for %s", s.Name) } var base uint32 @@ -3656,18 +3656,20 @@ func (c *ctxt9) asmout(p *obj.Prog, o *Optab, out []uint32) { cy := int(c.regoff(p.GetFrom3())) o1 = AOP_Z23I(c.oprrr(p.As), uint32(p.To.Reg), uint32(p.From.Reg), uint32(p.Reg), uint32(cy)) - case 95: /* Retrieve TOC symbol */ - v := c.vregoff(&p.To) + case 95: /* Retrieve TOC relative symbol */ + /* This code is for AIX only */ + v := c.vregoff(&p.From) if v != 0 { c.ctxt.Diag("invalid offset against TOC slot %v", p) } - if c.opform(c.opload(p.As)) != DS_FORM { + inst := c.opload(p.As) + if c.opform(inst) != DS_FORM { c.ctxt.Diag("invalid form for a TOC access in %v", p) } o1 = AOP_IRR(OP_ADDIS, uint32(p.To.Reg), REG_R2, 0) - o2 = AOP_IRR(c.opload(AMOVD), uint32(p.To.Reg), uint32(p.To.Reg), 0) + o2 = AOP_IRR(inst, uint32(p.To.Reg), uint32(p.To.Reg), 0) rel := obj.Addrel(c.cursym) rel.Off = int32(c.pc) rel.Siz = 8 diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index a9928742deaa6..2286916098820 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -114,6 +114,7 @@ func progedit(ctxt *obj.Link, p *obj.Prog, newprog obj.ProgAlloc) { } // Rewrite p, if necessary, to access a symbol using its TOC anchor. +// This code is for AIX only. func (c *ctxt9) rewriteToUseTOC(p *obj.Prog) { if p.As == obj.ATEXT || p.As == obj.AFUNCDATA || p.As == obj.ACALL || p.As == obj.ARET || p.As == obj.AJMP { return diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 4f5d8b55398bc..3b283b38551b7 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -383,7 +383,7 @@ func addelfdynrel(ctxt *ld.Link, s *sym.Symbol, r *sym.Reloc) bool { func elfreloc1(ctxt *ld.Link, r *sym.Reloc, sectoff int64) bool { // Beware that bit0~bit15 start from the third byte of a instruction in Big-Endian machines. - if r.Type == objabi.R_ADDR || r.Type == objabi.R_POWER_TLS || r.Type == objabi.R_CALLPOWER { + if r.Type == objabi.R_ADDR || r.Type == objabi.R_POWER_TLS || r.Type == objabi.R_CALLPOWER { } else { if ctxt.Arch.ByteOrder == binary.BigEndian { sectoff += 2 @@ -489,7 +489,12 @@ func symtoc(ctxt *ld.Link, s *sym.Symbol) int64 { return toc.Value } +// archreloctoc relocates a TOC relative symbol. +// This code is for AIX only. func archreloctoc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { + if ctxt.HeadType == objabi.Hlinux { + ld.Errorf(s, "archrelocaddr called for %s relocation\n", r.Sym.Name) + } var o1, o2 uint32 o1 = uint32(val >> 32) @@ -519,6 +524,8 @@ func archreloctoc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { return int64(o1)<<32 | int64(o2) } +// archrelocaddr relocates a symbol address. +// This code is for AIX only. func archrelocaddr(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { if ctxt.HeadType == objabi.Haix { ld.Errorf(s, "archrelocaddr called for %s relocation\n", r.Sym.Name) From 3c255e8bc6964ebee580b44835ddbe95c893e29f Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 17 Dec 2018 14:17:20 -0500 Subject: [PATCH 369/594] runtime: record extra information in throwOnGCWork crashes Currently we only know the slot address and the value being written in the throwOnGCWork crash tracebacks, and we have to infer the old value from what's dumped by gcWork.checkPut. Sometimes these old values don't make sense, like when we see a write of a nil pointer to a freshly-allocated object, yet we observe marking a value (where did that pointer come from?). This CL adds the old value of the slot and the first two pointers in the buffer to the traceback. For #27993. Change-Id: Ib70eead1afb9c06e8099e520172c3a2acaa45f80 Reviewed-on: https://go-review.googlesource.com/c/154597 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Michael Knyszek --- src/runtime/mwbbuf.go | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/runtime/mwbbuf.go b/src/runtime/mwbbuf.go index 6f01bf68fdb47..78ce54452db1c 100644 --- a/src/runtime/mwbbuf.go +++ b/src/runtime/mwbbuf.go @@ -197,10 +197,32 @@ func wbBufFlush(dst *uintptr, src uintptr) { // Switch to the system stack so we don't have to worry about // the untyped stack slots or safe points. systemstack(func() { - wbBufFlush1(getg().m.p.ptr()) + if debugCachedWork { + // For debugging, include the old value of the + // slot and some other data in the traceback. + wbBuf := &getg().m.p.ptr().wbBuf + var old uintptr + if dst != nil { + // dst may be nil in direct calls to wbBufFlush. + old = *dst + } + wbBufFlush1Debug(old, wbBuf.buf[0], wbBuf.buf[1], &wbBuf.buf[0], wbBuf.next) + } else { + wbBufFlush1(getg().m.p.ptr()) + } }) } +// wbBufFlush1Debug is a temporary function for debugging issue +// #27993. It exists solely to add some context to the traceback. +// +//go:nowritebarrierrec +//go:systemstack +//go:noinline +func wbBufFlush1Debug(old, buf1, buf2 uintptr, start *uintptr, next uintptr) { + wbBufFlush1(getg().m.p.ptr()) +} + // wbBufFlush1 flushes p's write barrier buffer to the GC work queue. // // This must not have write barriers because it is part of the write From db1e8a9e1f1b019dd7928ea239d5b0e4af66d9a6 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 17 Dec 2018 14:23:56 -0500 Subject: [PATCH 370/594] runtime: make traceback indicate whether _defer was just allocated Many of the crashes observed in #27993 involve committing the new _defer object at the end of newdefer. It would be helpful to know if the _defer was just allocated or was retrieved from the defer pool. In order to indicate this in the traceback, this CL duplicates the tail of newdefer so that the PC/line number will tell us whether d is new or not. For #27993. Change-Id: Icd3e23dbcf00461877bb082b6f18df701149a607 Reviewed-on: https://go-review.googlesource.com/c/154598 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Michael Knyszek --- src/runtime/panic.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 5b989d28e98af..81ff21113f98d 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -241,6 +241,15 @@ func newdefer(siz int32) *_defer { total := roundupsize(totaldefersize(uintptr(siz))) d = (*_defer)(mallocgc(total, deferType, true)) }) + if debugCachedWork { + // Duplicate the tail below so if there's a + // crash in checkPut we can tell if d was just + // allocated or came from the pool. + d.siz = siz + d.link = gp._defer + gp._defer = d + return d + } } d.siz = siz d.link = gp._defer From ccbca561ef1fc7990ca697102f0e9d3b2150d8f5 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 17 Dec 2018 14:39:05 -0500 Subject: [PATCH 371/594] runtime: capture pause stack for late gcWork put debugging This captures the stack trace where mark completion observed that each P had no work, and then dumps this if that P later discovers more work. Hopefully this will help bound where the work was created. For #27993. Change-Id: I4f29202880d22c433482dc1463fb50ab693b6de6 Reviewed-on: https://go-review.googlesource.com/c/154599 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Michael Knyszek --- src/runtime/mgc.go | 5 +++++ src/runtime/mgcwork.go | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 622750ed2ea9e..36d48d2561c4f 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1453,6 +1453,11 @@ top: // there's a paused gcWork, then // that's a bug. _p_.gcw.pauseGen = gcWorkPauseGen + // Capture the G's stack. + for i := range _p_.gcw.pauseStack { + _p_.gcw.pauseStack[i] = 0 + } + callers(1, _p_.gcw.pauseStack[:]) } }) casgstatus(gp, _Gwaiting, _Grunning) diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go index cdc94b8ffb11e..0ed07134423e2 100644 --- a/src/runtime/mgcwork.go +++ b/src/runtime/mgcwork.go @@ -97,6 +97,10 @@ type gcWork struct { // pauseGen causes put operations to spin while pauseGen == // gcWorkPauseGen if debugCachedWork is true. pauseGen uint32 + + // pauseStack is the stack at which this P was paused if + // debugCachedWork is true. + pauseStack [16]uintptr } // Most of the methods of gcWork are go:nowritebarrierrec because the @@ -128,6 +132,23 @@ func (w *gcWork) checkPut(ptr uintptr, ptrs []uintptr) { for _, ptr := range ptrs { gcDumpObject("ptrs", ptr, ^uintptr(0)) } + println("runtime: paused at") + for _, pc := range w.pauseStack { + if pc == 0 { + break + } + f := findfunc(pc) + if f.valid() { + // Obviously this doesn't + // relate to ancestor + // tracebacks, but this + // function prints what we + // want. + printAncestorTracebackFuncInfo(f, pc) + } else { + println("\tunknown PC ", hex(pc), "\n") + } + } throw("throwOnGCWork") } } From 6e33abbdbb8549184f80d60bbbe39be6004279ed Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 12 Dec 2018 19:30:32 -0500 Subject: [PATCH 372/594] doc/go1.12: release notes for "go doc -all" Change-Id: If65518c76a865c03266be76b1c21c76e1c8b4763 Reviewed-on: https://go-review.googlesource.com/c/153828 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 14adc7c4da41d..6b6d9d4401d6b 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -220,7 +220,7 @@

    Compiler toolchain

    printing and variable location information.

    -

    Godoc

    +

    godoc and go doc

    In Go 1.12, godoc no longer has a command-line interface and @@ -228,6 +228,12 @@

    Godoc

    for command-line help output instead.

    +

    + go doc now supports the -all flag, + which will cause it to print all exported APIs and their documentation, + similarly to what the godoc command line used to do. +

    +

    Trace

    @@ -276,7 +282,6 @@

    Minor changes to the library

    -
    bufio
    From 81a908aa685c5c3e68ded0fe542e7f3983d9dc85 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 12 Dec 2018 19:31:45 -0500 Subject: [PATCH 373/594] doc/go1.12: release notes for crypto Change-Id: I2a5613377a38815fb8746c5bfb07ccbbc2e6dd0b Reviewed-on: https://go-review.googlesource.com/c/153829 Reviewed-by: Adam Langley --- doc/go1.12.html | 67 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 6b6d9d4401d6b..54ebed5142280 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -266,8 +266,48 @@

    Runtime

    Core library

    +

    TLS 1.3

    + +

    + Go 1.12 adds support in the crypto/tls package for TLS 1.3 as + specified in RFC 8446. + + Programs that did not set an explicit MaxVersion in + Config will automatically negotiate + TLS 1.3 if available. All TLS 1.2 features except TLSUnique in + ConnectionState + and renegotiation are available in TLS 1.3 and provide equivalent or + better security and performance. +

    + +

    + TLS 1.3 cipher suites are not configurable. All supported cipher suites are + safe, and if PreferServerCipherSuites is set in + Config the preference order + is based on the available hardware. +

    + +

    + Early data (also called "0-RTT mode") is not currently supported as a + client or server. Additionally, a Go 1.12 server does not support skipping + unexpected early data if a client sends it. Since TLS 1.3 0-RTT mode + involves clients keeping state regarding which servers support 0-RTT, + a Go 1.12 server cannot be part of a load-balancing pool where some other + servers do support 0-RTT. If switching a domain from a server that supported + 0-RTT to a Go 1.12 server, 0-RTT would have to be disabled for at least the + lifetime of the issued session tickets before the switch to ensure + uninterrupted operation. +

    +

    - All of the changes to the standard library are minor. + In TLS 1.3 the client is the last one to speak in the handshake, so if it causes + an error to occur on the server, it will be returned on the client by the first + Read, not by + Handshake. For + example, that will be the case if the server rejects the client certificate. + Similarly, session tickets are now post-handshake messages, so are only + received by the client upon its first + Read.

    Minor changes to the library

    @@ -327,12 +367,15 @@

    Minor changes to the library

    crypto/rand
    -

    - TODO: https://golang.org/cl/120055: use the new getrandom syscall on FreeBSD +

    + A warning will now be printed to standard error the first time + Reader.Read is blocked for more than 60 seconds waiting + to read entropy from the kernel.

    -

    - TODO: https://golang.org/cl/139419: warn to stderr if blocked 60+ sec on first Reader.Read call +

    + On FreeBSD, Reader now uses the getrandom + system call if available, /dev/urandom otherwise.

    @@ -340,11 +383,23 @@

    Minor changes to the library

    crypto/rc4

    - TODO: https://golang.org/cl/130397: remove assembler implementations + This release removes the optimized assembly implementations. RC4 is insecure + and should only be used for compatibility with legacy systems.

    +
    crypto/tls
    +
    +

    + If a client sends an initial message that does not look like TLS, the server + will now not reply with an alert, and it will expose the underlying + net.Conn in the new field Conn of + RecordHeaderError. +

    + +
    +
    database/sql

    From 213845f7b932c72c5e49445224166d0ae14dfac9 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 11 Dec 2018 18:26:42 +0000 Subject: [PATCH 374/594] runtime: fix sysUsed for Windows sysUsed on Windows cares about the result from the VirtualAlloc syscall returning exactly the address that was passed to it. However, VirtualAlloc aligns the address its given to the kernel's allocation granularity, so the returned address may not be the same. Note that this wasn't an issue in the past because we only sysUsed regions owned by spans, and spans are always a multiple of 8K, which is a multiple of the allocation granularity on most Windows machines. Change-Id: I3f5ccd63c6bbbd8b7995945ecedee17573b31667 Reviewed-on: https://go-review.googlesource.com/c/153677 Run-TryBot: Michael Knyszek Reviewed-by: Rick Hudson --- src/runtime/mem_windows.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/mem_windows.go b/src/runtime/mem_windows.go index 690f55eb5c83a..fc52ec59a05e0 100644 --- a/src/runtime/mem_windows.go +++ b/src/runtime/mem_windows.go @@ -61,7 +61,7 @@ func sysUnused(v unsafe.Pointer, n uintptr) { func sysUsed(v unsafe.Pointer, n uintptr) { r := stdcall4(_VirtualAlloc, uintptr(v), n, _MEM_COMMIT, _PAGE_READWRITE) - if r == uintptr(v) { + if r != 0 { return } From d924c3336c39a256c832512ecd24fcdeed0ca266 Mon Sep 17 00:00:00 2001 From: David Chase Date: Mon, 17 Dec 2018 12:01:56 -0500 Subject: [PATCH 375/594] cmd/compile: prevent double-walk of switch for OPRINT/OPRINTN When a println arg contains a call to an inlineable function that itself contains a switch, that switch statement will be walked twice, once by the walkexprlist formerly in the OPRINT/OPRINTN case, then by walkexprlistcheap in walkprint. Remove the first walkexprlist, it is not necessary. walkexprlist = s[i] = walkexpr(s[i], init) walkexprlistcheap = { s[i] = cheapexpr(n, init) s[i] = walkexpr(s[i], init) } Seems like this might be possible in other places, i.e., calls to inlineable switch-containing functions. See also #25776. Fixes #29220. Change-Id: I3781e86aad6688711597b8bee9bc7ebd3af93601 Reviewed-on: https://go-review.googlesource.com/c/154497 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/walk.go | 1 - test/fixedbugs/issue29220.go | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/fixedbugs/issue29220.go diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index b84bc26e04a72..f23a5916479a6 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -563,7 +563,6 @@ opswitch: n = walkinrange(n, init) case OPRINT, OPRINTN: - walkexprlist(n.List.Slice(), init) n = walkprint(n, init) case OPANIC: diff --git a/test/fixedbugs/issue29220.go b/test/fixedbugs/issue29220.go new file mode 100644 index 0000000000000..bbfe930786e09 --- /dev/null +++ b/test/fixedbugs/issue29220.go @@ -0,0 +1,26 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func ascii(r rune) rune { + switch { + case 97 <= r && r <= 122: + return r - 32 + case 65 <= r && r <= 90: + return r + 32 + default: + return r + } +} + +func main() { + nomeObjeto := "ABE1FK21" + println(string(nomeObjeto[1:4])) + println(ascii(rune(nomeObjeto[4])) >= 48 && ascii(rune(nomeObjeto[4])) <= 57) + println(string(nomeObjeto[5])) + println(string(nomeObjeto[6:10])) +} From 9a3c1a1bc8ec81925925d6699577ff7812be3d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Fri, 23 Nov 2018 15:12:04 +0100 Subject: [PATCH 376/594] cmd/link: move XCOFF data addresses to an unreachable segment This commit move data addresses to 0x200000000 for XCOFF executables. .data and .bss must always be position-independent on AIX. This modification allows to detect more easily if they aren't, as segfault will be triggered. Change-Id: Ied7a5b72b9f4ff9f870a1626cf07c48110635e62 Reviewed-on: https://go-review.googlesource.com/c/151040 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/data.go | 5 +++++ src/cmd/link/internal/ld/xcoff.go | 36 +++++++++++++------------------ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/cmd/link/internal/ld/data.go b/src/cmd/link/internal/ld/data.go index 5209878b78c7d..e0fad1acfdc90 100644 --- a/src/cmd/link/internal/ld/data.go +++ b/src/cmd/link/internal/ld/data.go @@ -2036,6 +2036,11 @@ func (ctxt *Link) address() []*sym.Segment { } va = uint64(Rnd(int64(va), int64(*FlagRound))) + if ctxt.HeadType == objabi.Haix { + // Data sections are moved to an unreachable segment + // to ensure that they are position-independent. + va += uint64(XCOFFDATABASE) - uint64(XCOFFTEXTBASE) + } order = append(order, &Segdata) Segdata.Rwx = 06 Segdata.Vaddr = va diff --git a/src/cmd/link/internal/ld/xcoff.go b/src/cmd/link/internal/ld/xcoff.go index a82bbb65dfa47..1561ce8cd0d17 100644 --- a/src/cmd/link/internal/ld/xcoff.go +++ b/src/cmd/link/internal/ld/xcoff.go @@ -17,17 +17,20 @@ import ( // as PE and XCOFF are based on COFF files. // XCOFF files generated are 64 bits. -// Total amount of space to reserve at the start of the file -// for FileHeader, Auxiliary Header, and Section Headers. -// May waste some. -// Based on 24(fhdr) + 120(ahdr) + 23(max sections number) * 72(scnhdr) const ( - XCOFFHDRRESERVE = FILHSZ_64 + AOUTHSZ_EXEC64 + SCNHSZ_64*23 -) - -const ( - XCOFFSECTALIGN int64 = 32 // base on dump -o - XCOFFBASE = 0x100000000 // Address on 64 bits must start at this value. + // Total amount of space to reserve at the start of the file + // for File Header, Auxiliary Header, and Section Headers. + // May waste some. + XCOFFHDRRESERVE = FILHSZ_64 + AOUTHSZ_EXEC64 + SCNHSZ_64*23 + XCOFFSECTALIGN int64 = 32 // base on dump -o + + // XCOFF binaries should normally have all its sections position-independent. + // However, this is not yet possible for .text because of some R_ADDR relocations + // inside RODATA symbols. + // .data and .bss are position-independent so their address start inside a unreachable + // segment during execution to force segfault if something is wrong. + XCOFFTEXTBASE = 0x100000000 // Start of text address + XCOFFDATABASE = 0x200000000 // Start of data address ) // File Header @@ -367,12 +370,6 @@ type xcoffFile struct { loaderReloc []*xcoffLoaderReloc // Reloc that must be made inside loader } -// Those values will latter be computed in XcoffInit -var ( - XCOFFFILEHDR int - XCOFFSECTHDR int -) - // Var used by XCOFF Generation algorithms var ( xfile xcoffFile @@ -489,14 +486,11 @@ func (f *xcoffFile) getXCOFFscnum(sect *sym.Section) int16 { func Xcoffinit(ctxt *Link) { xfile.dynLibraries = make(map[string]int) - XCOFFFILEHDR = int(Rnd(XCOFFHDRRESERVE, XCOFFSECTALIGN)) - XCOFFSECTHDR = int(Rnd(int64(XCOFFFILEHDR), XCOFFSECTALIGN)) - - HEADR = int32(XCOFFFILEHDR) + HEADR = int32(Rnd(XCOFFHDRRESERVE, XCOFFSECTALIGN)) if *FlagTextAddr != -1 { Errorf(nil, "-T not available on AIX") } - *FlagTextAddr = XCOFFBASE + int64(XCOFFSECTHDR) + *FlagTextAddr = XCOFFTEXTBASE + int64(HEADR) *FlagDataAddr = 0 if *FlagRound != -1 { Errorf(nil, "-R not available on AIX") From 3651476075bad3d21d4dbaddc9a7d298d3d97e24 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Mon, 26 Nov 2018 23:56:35 +0000 Subject: [PATCH 377/594] runtime: add iterator abstraction for mTreap This change adds the treapIter type which provides an iterator abstraction for walking over an mTreap. In particular, the mTreap type now has iter() and rev() for iterating both forwards (smallest to largest) and backwards (largest to smallest). It also has an erase() method for erasing elements at the iterator's current position. For #28479. While the expectation is that this change will slow down Go programs, the impact on Go1 and Garbage is negligible. Go1: https://perf.golang.org/search?q=upload:20181214.6 Garbage: https://perf.golang.org/search?q=upload:20181214.11 Change-Id: I60dbebbbe73cbbe7b78d45d2093cec12cc0bc649 Reviewed-on: https://go-review.googlesource.com/c/151537 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements Reviewed-by: Rick Hudson --- src/runtime/export_test.go | 6 ++-- src/runtime/mgclarge.go | 74 ++++++++++++++++++++++++++++++++++++++ src/runtime/mheap.go | 48 ++++++------------------- 3 files changed, 88 insertions(+), 40 deletions(-) diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index ecb21935b9efe..de66b07c68ebb 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -337,9 +337,9 @@ func ReadMemStatsSlow() (base, slow MemStats) { slow.BySize[i].Frees = bySize[i].Frees } - mheap_.scav.treap.walkTreap(func(tn *treapNode) { - slow.HeapReleased += uint64(tn.spanKey.released()) - }) + for i := mheap_.scav.iter(); i.valid(); i = i.next() { + slow.HeapReleased += uint64(i.span().released()) + } getg().m.mallocing-- }) diff --git a/src/runtime/mgclarge.go b/src/runtime/mgclarge.go index 66259d4cdfd81..663a37e3edcf9 100644 --- a/src/runtime/mgclarge.go +++ b/src/runtime/mgclarge.go @@ -153,6 +153,70 @@ func checkTreapNode(t *treapNode) { } } +// treapIter is a unidirectional iterator type which may be used to iterate over a +// an mTreap in-order forwards (increasing order) or backwards (decreasing order). +// Its purpose is to hide details about the treap from users when trying to iterate +// over it. +// +// To create iterators over the treap, call iter or rev on an mTreap. +type treapIter struct { + t *treapNode + inc bool // if true, iterate in increasing order, otherwise decreasing order. +} + +// span returns the span at the current position in the treap. +// If the treap is not valid, span will panic. +func (i *treapIter) span() *mspan { + return i.t.spanKey +} + +// valid returns whether the iterator represents a valid position +// in the mTreap. +func (i *treapIter) valid() bool { + return i.t != nil +} + +// next moves the iterator forward by one. Once the iterator +// ceases to be valid, calling next will panic. +func (i treapIter) next() treapIter { + if i.inc { + i.t = i.t.succ() + } else { + i.t = i.t.pred() + } + return i +} + +// iter returns an iterator which may be used to iterate over the treap +// in increasing order of span size ("forwards"). +func (root *mTreap) iter() treapIter { + i := treapIter{inc: true} + t := root.treap + if t == nil { + return i + } + for t.left != nil { + t = t.left + } + i.t = t + return i +} + +// rev returns an iterator which may be used to iterate over the treap +// in decreasing order of span size ("reverse"). +func (root *mTreap) rev() treapIter { + i := treapIter{inc: false} + t := root.treap + if t == nil { + return i + } + for t.right != nil { + t = t.right + } + i.t = t + return i +} + // insert adds span to the large span treap. func (root *mTreap) insert(span *mspan) { npages := span.npages @@ -280,6 +344,16 @@ func (root *mTreap) removeSpan(span *mspan) { root.removeNode(t) } +// erase removes the element referred to by the current position of the +// iterator and returns i.next(). This operation consumes the given +// iterator, so it should no longer be used and iteration should continue +// from the returned iterator. +func (root *mTreap) erase(i treapIter) treapIter { + n := i.next() + root.removeNode(i.t) + return n +} + // rotateLeft rotates the tree rooted at node x. // turning (x a (y b c)) into (y (x a b) c). func (root *mTreap) rotateLeft(x *treapNode) { diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 99994593c3934..b5e0b0f306625 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -1273,21 +1273,11 @@ func (h *mheap) freeSpanLocked(s *mspan, acctinuse, acctidle bool, unusedsince i // starting from the largest span and working down. It then takes those spans // and places them in scav. h must be locked. func (h *mheap) scavengeLargest(nbytes uintptr) { - // Find the largest child. - t := h.free.treap - if t == nil { - return - } - for t.right != nil { - t = t.right - } - // Iterate over the treap from the largest child to the smallest by - // starting from the largest and finding its predecessor until we've - // recovered nbytes worth of physical memory, or it no longer has a - // predecessor (meaning the treap is now empty). + // Iterate over the treap backwards (from largest to smallest) scavenging spans + // until we've reached our quota of nbytes. released := uintptr(0) - for t != nil && released < nbytes { - s := t.spanKey + for t := h.free.rev(); released < nbytes && t.valid(); { + s := t.span() r := s.scavenge() if r == 0 { // Since we're going in order of largest-to-smallest span, this @@ -1301,9 +1291,7 @@ func (h *mheap) scavengeLargest(nbytes uintptr) { // those which have it unset are only in the `free` treap. return } - prev := t.pred() - h.free.removeNode(t) - t = prev + t = h.free.erase(t) h.scav.insert(s) released += r } @@ -1313,34 +1301,20 @@ func (h *mheap) scavengeLargest(nbytes uintptr) { // treapNode's span. It then removes the scavenged span from // unscav and adds it into scav before continuing. h must be locked. func (h *mheap) scavengeAll(now, limit uint64) uintptr { - // Compute the left-most child in unscav to start iteration from. - t := h.free.treap - if t == nil { - return 0 - } - for t.left != nil { - t = t.left - } - // Iterate over the treap be computing t's successor before - // potentially scavenging it. + // Iterate over the treap scavenging spans if unused for at least limit time. released := uintptr(0) - for t != nil { - s := t.spanKey - next := t.succ() + for t := h.free.iter(); t.valid(); { + s := t.span() if (now - uint64(s.unusedsince)) > limit { r := s.scavenge() if r != 0 { - // If we ended up scavenging s, then remove it from unscav - // and add it to scav. This is safe to do since we've already - // moved to t's successor. - h.free.removeNode(t) + t = h.free.erase(t) h.scav.insert(s) released += r + continue } } - // Move t forward to its successor to iterate over the whole - // treap. - t = next + t = t.next() } return released } From 064842450bd904d2519d723a0109b33007ad00e9 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Thu, 8 Nov 2018 20:06:58 +0000 Subject: [PATCH 378/594] runtime: allocate from free and scav fairly This change modifies the behavior of span allocations to no longer prefer the free treap over the scavenged treap. While there is an additional cost to allocating out of the scavenged treap, the current behavior of preferring the unscavenged spans can lead to unbounded growth of a program's virtual memory footprint. In small programs (low # of Ps, low resident set size, low allocation rate) this behavior isn't really apparent and is difficult to reproduce. However, in relatively large, long-running programs we see this unbounded growth in free spans, and an unbounded amount of heap growths. It still remains unclear how this policy change actually ends up increasing the number of heap growths over time, but switching the policy back to best-fit does indeed solve the problem. Change-Id: Ibb88d24f9ef6766baaa7f12b411974cc03341e7b Reviewed-on: https://go-review.googlesource.com/c/148979 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson Reviewed-by: Austin Clements --- src/runtime/mgclarge.go | 13 +++++-------- src/runtime/mheap.go | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/runtime/mgclarge.go b/src/runtime/mgclarge.go index 663a37e3edcf9..2a04d4a7933fa 100644 --- a/src/runtime/mgclarge.go +++ b/src/runtime/mgclarge.go @@ -297,14 +297,13 @@ func (root *mTreap) removeNode(t *treapNode) { mheap_.treapalloc.free(unsafe.Pointer(t)) } -// remove searches for, finds, removes from the treap, and returns the smallest -// span that can hold npages. If no span has at least npages return nil. +// find searches for, finds, and returns the treap node containing the +// smallest span that can hold npages. If no span has at least npages +// it returns nil. // This is slightly more complicated than a simple binary tree search // since if an exact match is not found the next larger node is // returned. -// If the last node inspected > npagesKey not holding -// a left node (a smaller npages) is the "best fit" node. -func (root *mTreap) remove(npages uintptr) *mspan { +func (root *mTreap) find(npages uintptr) *treapNode { t := root.treap for t != nil { if t.spanKey == nil { @@ -315,9 +314,7 @@ func (root *mTreap) remove(npages uintptr) *mspan { } else if t.left != nil && t.left.npagesKey >= npages { t = t.left } else { - result := t.spanKey - root.removeNode(t) - return result + return t } } return nil diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index b5e0b0f306625..9d7d683cd1008 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -998,19 +998,34 @@ func (h *mheap) setSpans(base, npage uintptr, s *mspan) { } } +// pickFreeSpan acquires a free span from internal free list +// structures if one is available. Otherwise returns nil. +// h must be locked. +func (h *mheap) pickFreeSpan(npage uintptr) *mspan { + tf := h.free.find(npage) + ts := h.scav.find(npage) + + // Check for whichever treap gave us the smaller, non-nil result. + // Note that we want the _smaller_ free span, i.e. the free span + // closer in size to the amount we requested (npage). + var s *mspan + if tf != nil && (ts == nil || tf.spanKey.npages <= ts.spanKey.npages) { + s = tf.spanKey + h.free.removeNode(tf) + } else if ts != nil && (tf == nil || tf.spanKey.npages > ts.spanKey.npages) { + s = ts.spanKey + h.scav.removeNode(ts) + } + return s +} + // Allocates a span of the given size. h must be locked. // The returned span has been removed from the // free structures, but its state is still mSpanFree. func (h *mheap) allocSpanLocked(npage uintptr, stat *uint64) *mspan { var s *mspan - // First, attempt to allocate from free spans, then from - // scavenged spans, looking for best fit in each. - s = h.free.remove(npage) - if s != nil { - goto HaveSpan - } - s = h.scav.remove(npage) + s = h.pickFreeSpan(npage) if s != nil { goto HaveSpan } @@ -1018,23 +1033,19 @@ func (h *mheap) allocSpanLocked(npage uintptr, stat *uint64) *mspan { if !h.grow(npage) { return nil } - s = h.free.remove(npage) + s = h.pickFreeSpan(npage) if s != nil { goto HaveSpan } - s = h.scav.remove(npage) - if s != nil { - goto HaveSpan - } - return nil + throw("grew heap, but no adequate free span found") HaveSpan: // Mark span in use. if s.state != mSpanFree { - throw("mheap.allocLocked - mspan not free") + throw("candidate mspan for allocation is not free") } if s.npages < npage { - throw("mheap.allocLocked - bad npages") + throw("candidate mspan for allocation is too small") } // First, subtract any memory that was released back to From 32b879c674b46249dc3e1db48c0076f5c11aa7a4 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 17 Dec 2018 15:09:34 -0800 Subject: [PATCH 379/594] doc: explain how to use "go vet -shadow" Fixes #29260 Change-Id: I419b74d06380113f4bd32b9aeb053c3be36208d5 Reviewed-on: https://go-review.googlesource.com/c/154584 Reviewed-by: Alan Donovan --- doc/go1.12.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 54ebed5142280..66c37d5d1db27 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -93,6 +93,16 @@

    go tool vet no longer supported

    vet should work with all supported versions of Go.

    +

    + As part of this change, the experimental -shadow option + is no longer available with go vet. Checking for + variable shadowing may now be done using +

    +    go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
    +    go vet -vettool=$(which shadow)
    +  
    +

    +

    Build cache requirement

    From 99e4ddd053fada36038f7fd4e7220d789e30e48a Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 17 Dec 2018 14:42:29 -0800 Subject: [PATCH 380/594] cmd/compile: increase nesting depth limit for type descriptors The formatting routines for types use a depth limit as primitive mechanism to detect cycles. For now, increase the limit from 100 to 250 and file #29312 so we don't drop this on the floor. Also, adjust some fatal error messages elsewhere to use better formatting. Fixes #29264. Updates #29312. Change-Id: Idd529f6682d478e0dcd2d469cb802192190602f6 Reviewed-on: https://go-review.googlesource.com/c/154583 Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/fmt.go | 6 +++++- src/cmd/compile/internal/gc/iexport.go | 2 +- src/cmd/compile/internal/gc/iimport.go | 2 +- test/fixedbugs/issue29264.go | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 test/fixedbugs/issue29264.go diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go index f128872dbba3b..baea4cc7161c4 100644 --- a/src/cmd/compile/internal/gc/fmt.go +++ b/src/cmd/compile/internal/gc/fmt.go @@ -1749,7 +1749,11 @@ func tconv(t *types.Type, flag FmtFlag, mode fmtMode, depth int) string { return t.FieldType(0).String() + "," + t.FieldType(1).String() } - if depth > 100 { + // Avoid endless recursion by setting an upper limit. This also + // limits the depths of valid composite types, but they are likely + // artificially created. + // TODO(gri) should have proper cycle detection here, eventually (issue #29312) + if depth > 250 { return "<...>" } diff --git a/src/cmd/compile/internal/gc/iexport.go b/src/cmd/compile/internal/gc/iexport.go index cc43c2e2876d2..2a34e2ea778f7 100644 --- a/src/cmd/compile/internal/gc/iexport.go +++ b/src/cmd/compile/internal/gc/iexport.go @@ -1325,7 +1325,7 @@ func (w *exportWriter) expr(n *Node) { default: Fatalf("cannot export %v (%d) node\n"+ - "==> please file an issue and assign to gri@\n", n.Op, int(n.Op)) + "\t==> please file an issue and assign to gri@", n.Op, int(n.Op)) } } diff --git a/src/cmd/compile/internal/gc/iimport.go b/src/cmd/compile/internal/gc/iimport.go index ff98b79835f27..addf829b04a96 100644 --- a/src/cmd/compile/internal/gc/iimport.go +++ b/src/cmd/compile/internal/gc/iimport.go @@ -1053,7 +1053,7 @@ func (r *importReader) node() *Node { default: Fatalf("cannot import %v (%d) node\n"+ - "==> please file an issue and assign to gri@\n", op, int(op)) + "\t==> please file an issue and assign to gri@", op, int(op)) panic("unreachable") // satisfy compiler } } diff --git a/test/fixedbugs/issue29264.go b/test/fixedbugs/issue29264.go new file mode 100644 index 0000000000000..3781559ada315 --- /dev/null +++ b/test/fixedbugs/issue29264.go @@ -0,0 +1,22 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Verify that we emit a valid type descriptor for +// a fairly deeply nested type. + +package main + +import "fmt" +import "strings" + +func main() { + a := [][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]int{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{42}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} + got := fmt.Sprint(a) + want := strings.Repeat("[", 100) + "42" + strings.Repeat("]", 100) + if got != want { + fmt.Printf("got %q\nwant %q\n", got, want) + } +} From c52beb108779b8d983136fa5200ab91005c6de49 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Mon, 17 Dec 2018 01:18:51 +1100 Subject: [PATCH 381/594] runtime,cmd/dist,cmd/link: add cgo support on openbsd/arm Add support for cgo on openbsd/arm.The gcc shipped with base OpenBSD armv7 is old/inadequate, so use clang by default. Change-Id: I945a26d369378952d357727718e69249411e1127 Reviewed-on: https://go-review.googlesource.com/c/154381 Run-TryBot: Joel Sing TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/dist/build.go | 2 +- src/cmd/dist/main.go | 7 ++++ src/cmd/link/internal/ld/lib.go | 6 +++ src/runtime/cgo/gcc_openbsd_arm.c | 67 +++++++++++++++++++++++++++++++ src/runtime/sys_openbsd_arm.s | 7 ++-- 5 files changed, 85 insertions(+), 4 deletions(-) create mode 100644 src/runtime/cgo/gcc_openbsd_arm.c diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index 8d7b14d17c650..da677c81ada5a 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -1448,7 +1448,7 @@ var cgoEnabled = map[string]bool{ "netbsd/arm": true, "openbsd/386": true, "openbsd/amd64": true, - "openbsd/arm": false, + "openbsd/arm": true, "plan9/386": false, "plan9/amd64": false, "plan9/arm": false, diff --git a/src/cmd/dist/main.go b/src/cmd/dist/main.go index bf08869afb7f2..bab8ab781ab67 100644 --- a/src/cmd/dist/main.go +++ b/src/cmd/dist/main.go @@ -65,6 +65,13 @@ func main() { case "freebsd": // Since FreeBSD 10 gcc is no longer part of the base system. defaultclang = true + case "openbsd": + // The gcc available on OpenBSD armv7 is old/inadequate (for example, lacks + // __sync_fetch_and_*/__sync_*_and_fetch) and will likely be removed in the + // not-to-distant future - use clang instead. + if runtime.GOARCH == "arm" { + defaultclang = true + } case "solaris": // Even on 64-bit platform, solaris uname -m prints i86pc. out := run("", CheckExit, "isainfo", "-n") diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 253a9f68475c6..b45397e7278a2 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -535,6 +535,12 @@ func (ctxt *Link) loadlib() { if *flagLibGCC == "" { *flagLibGCC = ctxt.findLibPathCmd("--print-libgcc-file-name", "libgcc") } + if runtime.GOOS == "openbsd" && *flagLibGCC == "libgcc.a" { + // On OpenBSD `clang --print-libgcc-file-name` returns "libgcc.a". + // In this case we fail to load libgcc.a and can encounter link + // errors - see if we can find libcompiler_rt.a instead. + *flagLibGCC = ctxt.findLibPathCmd("--print-file-name=libcompiler_rt.a", "libcompiler_rt") + } if *flagLibGCC != "none" { hostArchive(ctxt, *flagLibGCC) } diff --git a/src/runtime/cgo/gcc_openbsd_arm.c b/src/runtime/cgo/gcc_openbsd_arm.c new file mode 100644 index 0000000000000..9a5757f0ad369 --- /dev/null +++ b/src/runtime/cgo/gcc_openbsd_arm.c @@ -0,0 +1,67 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include +#include +#include +#include +#include "libcgo.h" +#include "libcgo_unix.h" + +static void* threadentry(void*); +static void (*setg_gcc)(void*); + +void +x_cgo_init(G *g, void (*setg)(void*)) +{ + pthread_attr_t attr; + size_t size; + + setg_gcc = setg; + pthread_attr_init(&attr); + pthread_attr_getstacksize(&attr, &size); + g->stacklo = (uintptr)&attr - size + 4096; + pthread_attr_destroy(&attr); +} + +void +_cgo_sys_thread_start(ThreadStart *ts) +{ + pthread_attr_t attr; + sigset_t ign, oset; + pthread_t p; + size_t size; + int err; + + sigfillset(&ign); + pthread_sigmask(SIG_SETMASK, &ign, &oset); + + pthread_attr_init(&attr); + pthread_attr_getstacksize(&attr, &size); + + // Leave stacklo=0 and set stackhi=size; mstart will do the rest. + ts->g->stackhi = size; + err = _cgo_try_pthread_create(&p, &attr, threadentry, ts); + + pthread_sigmask(SIG_SETMASK, &oset, nil); + + if (err != 0) { + fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err)); + abort(); + } +} + +extern void crosscall_arm1(void (*fn)(void), void (*setg_gcc)(void*), void *g); + +static void* +threadentry(void *v) +{ + ThreadStart ts; + + ts = *(ThreadStart*)v; + free(v); + + crosscall_arm1(ts.fn, setg_gcc, (void*)ts.g); + return nil; +} diff --git a/src/runtime/sys_openbsd_arm.s b/src/runtime/sys_openbsd_arm.s index 52d3638bc18c1..94ac5d599d2fd 100644 --- a/src/runtime/sys_openbsd_arm.s +++ b/src/runtime/sys_openbsd_arm.s @@ -371,8 +371,9 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0 TEXT ·publicationBarrier(SB),NOSPLIT|NOFRAME,$0-0 B runtime·armPublicationBarrier(SB) -// TODO(jsing): Implement. TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0 - MOVW $5, R0 - MOVW R0, (R0) + MOVM.WP [R1, R2, R3, R12], (R13) + MOVW $330, R12 // sys___get_tcb + SWI $0 + MOVM.IAW (R13), [R1, R2, R3, R12] RET From 9a258f308689d2f1cb13f286baf745aad5fa991b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Wed, 14 Nov 2018 23:13:28 +0100 Subject: [PATCH 382/594] doc: document GODEBUG options to disable use of instruction set extensions Fixes #27218 Change-Id: I4eb8e8f2486b20fe0ed6e3e2c6ec521c9e8c0032 Reviewed-on: https://go-review.googlesource.com/c/149579 Reviewed-by: Austin Clements --- doc/diagnostics.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/diagnostics.html b/doc/diagnostics.html index 0a7847744b6e5..478611c15c0f6 100644 --- a/doc/diagnostics.html +++ b/doc/diagnostics.html @@ -456,3 +456,15 @@

    GODEBUG

    and the length of the pause.
  • GODEBUG=schedtrace=X prints scheduling events every X milliseconds.
  • + +

    The GODEBUG environmental variable can be used to disable use of +instruction set extensions in the standard library and runtime.

    + +
      +
    • GODEBUG=cpu.all=off disables the use of all optional +instruction set extensions.
    • +
    • GODEBUG=cpu.extension=off disables use of instructions from the +specified instruction set extension.
      +extension is the lower case name for the instruction set extension +such as sse41 or avx.
    • +
    From 2d00007bdb996dc859ffb16b601e0f51bb72662c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 17 Dec 2018 20:57:34 -0500 Subject: [PATCH 383/594] runtime: flush on every write barrier while debugging Currently, we flush the write barrier buffer on every write barrier once throwOnGCWork is set, but not during the mark completion algorithm itself. As seen in recent failures like https://build.golang.org/log/317369853b803b4ee762b27653f367e1aa445ac1 by the time we actually catch a late gcWork put, the write barrier buffer is full-size again. As a result, we're probably not catching the actual problematic write barrier, which is probably somewhere in the buffer. Fix this by using the gcWork pause generation to also keep the write barrier buffer small between the mark completion flushes it and when mark completion is done. For #27993. Change-Id: I77618169441d42a7d562fb2a998cfaa89891edb2 Reviewed-on: https://go-review.googlesource.com/c/154638 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox Reviewed-by: Michael Knyszek --- src/runtime/mgc.go | 1 + src/runtime/mwbbuf.go | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 36d48d2561c4f..9d21dc4fa0c9f 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1434,6 +1434,7 @@ top: if debugCachedWork { b := &_p_.wbBuf b.end = uintptr(unsafe.Pointer(&b.buf[wbBufEntryPointers])) + b.debugGen = gcWorkPauseGen } // Flush the gcWork, since this may create global work // and set the flushedWork flag. diff --git a/src/runtime/mwbbuf.go b/src/runtime/mwbbuf.go index 78ce54452db1c..f444452bab502 100644 --- a/src/runtime/mwbbuf.go +++ b/src/runtime/mwbbuf.go @@ -23,6 +23,7 @@ package runtime import ( + "runtime/internal/atomic" "runtime/internal/sys" "unsafe" ) @@ -56,6 +57,12 @@ type wbBuf struct { // on. This must be a multiple of wbBufEntryPointers because // the write barrier only checks for overflow once per entry. buf [wbBufEntryPointers * wbBufEntries]uintptr + + // debugGen causes the write barrier buffer to flush after + // every write barrier if equal to gcWorkPauseGen. This is for + // debugging #27993. This is only set if debugCachedWork is + // set. + debugGen uint32 } const ( @@ -79,7 +86,7 @@ const ( func (b *wbBuf) reset() { start := uintptr(unsafe.Pointer(&b.buf[0])) b.next = start - if writeBarrier.cgo || (debugCachedWork && throwOnGCWork) { + if writeBarrier.cgo || (debugCachedWork && (throwOnGCWork || b.debugGen == atomic.Load(&gcWorkPauseGen))) { // Effectively disable the buffer by forcing a flush // on every barrier. b.end = uintptr(unsafe.Pointer(&b.buf[wbBufEntryPointers])) From 34437f04fd642c43d32ac70be68c470c60b4dc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Tue, 18 Dec 2018 09:09:12 +0100 Subject: [PATCH 384/594] doc/1.12: add notes about aix/ppc64 port Fixes #29315 Change-Id: I6ecc5109c23e7a7d9db54250bf041acc841701e3 Reviewed-on: https://go-review.googlesource.com/c/154697 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 66c37d5d1db27..028ab0ce7586c 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -68,7 +68,7 @@

    Windows

    AIX

    - TODO: status of AIX port? + Go now supports AIX 7.2 and later on POWER8 architectures (aix/ppc64). External linking, cgo, pprof and the race detector aren't yet supported.

    Hurd

    From cebf9d47cf16e9ccc550d3895f5f9074ae2477a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Mon, 26 Nov 2018 11:14:09 +0100 Subject: [PATCH 385/594] cmd/link: optimize access to data symbols for aix/ppc64 This commit changes the second instruction used to retrieve a symbol on aix/ppc64 if it is in .data or .bss section. The previous version always retrieves the symbol address via a load on its TOC symbol. However, as the TOC is also in .data, the symbol's address is close enough to be fetched directly and the load instruction can be replaced by an addi. Bench go1 benchmark old ns/op new ns/op delta BenchmarkBinaryTree17-16 5919354000 5824897000 -1.60% BenchmarkFannkuch11-16 5206937000 5162043000 -0.86% BenchmarkFmtFprintfEmpty-16 106 105 -0.94% BenchmarkFmtFprintfString-16 165 165 +0.00% BenchmarkFmtFprintfInt-16 165 167 +1.21% BenchmarkFmtFprintfIntInt-16 303 239 -21.12% BenchmarkFmtFprintfPrefixedInt-16 282 283 +0.35% BenchmarkFmtFprintfFloat-16 434 381 -12.21% BenchmarkFmtManyArgs-16 1797 903 -49.75% BenchmarkGobDecode-16 16000450 12173630 -23.92% BenchmarkGobEncode-16 12007010 10258070 -14.57% BenchmarkGzip-16 638581500 456050333 -28.58% BenchmarkGunzip-16 111976900 74943900 -33.07% BenchmarkHTTPClientServer-16 206850 153716 -25.69% BenchmarkJSONEncode-16 32057380 17517130 -45.36% BenchmarkJSONDecode-16 182606400 106807700 -41.51% BenchmarkMandelbrot200-16 6896975 5616903 -18.56% BenchmarkGoParse-16 11248260 6094115 -45.82% BenchmarkRegexpMatchEasy0_32-16 292 148 -49.32% BenchmarkRegexpMatchEasy0_1K-16 540 327 -39.44% BenchmarkRegexpMatchEasy1_32-16 243 150 -38.27% BenchmarkRegexpMatchEasy1_1K-16 1029 657 -36.15% BenchmarkRegexpMatchMedium_32-16 423 230 -45.63% BenchmarkRegexpMatchMedium_1K-16 107250 59683 -44.35% BenchmarkRegexpMatchHard_32-16 3353 3139 -6.38% BenchmarkRegexpMatchHard_1K-16 107277 93610 -12.74% BenchmarkRevcomp-16 1124311500 677442500 -39.75% BenchmarkTemplate-16 241286600 109177400 -54.75% BenchmarkTimeParse-16 1058 562 -46.88% BenchmarkTimeFormat-16 1321 581 -56.02% benchmark old MB/s new MB/s speedup BenchmarkGobDecode-16 47.97 63.05 1.31x BenchmarkGobEncode-16 63.92 74.82 1.17x BenchmarkGzip-16 30.39 42.55 1.40x BenchmarkGunzip-16 173.29 258.92 1.49x BenchmarkJSONEncode-16 60.53 110.78 1.83x BenchmarkJSONDecode-16 10.63 18.17 1.71x BenchmarkGoParse-16 5.15 9.50 1.84x BenchmarkRegexpMatchEasy0_32-16 109.42 215.86 1.97x BenchmarkRegexpMatchEasy0_1K-16 1896.22 3126.28 1.65x BenchmarkRegexpMatchEasy1_32-16 131.46 212.99 1.62x BenchmarkRegexpMatchEasy1_1K-16 994.55 1557.51 1.57x BenchmarkRegexpMatchMedium_32-16 2.36 4.34 1.84x BenchmarkRegexpMatchMedium_1K-16 9.55 17.16 1.80x BenchmarkRegexpMatchHard_32-16 9.54 10.19 1.07x BenchmarkRegexpMatchHard_1K-16 9.55 10.94 1.15x BenchmarkRevcomp-16 226.06 375.19 1.66x BenchmarkTemplate-16 8.04 17.77 2.21x Change-Id: Iaf2aa5953b99271361510c69a5ced3371f6c6c20 Reviewed-on: https://go-review.googlesource.com/c/151201 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ppc64/asm.go | 34 ++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/cmd/link/internal/ppc64/asm.go b/src/cmd/link/internal/ppc64/asm.go index 3b283b38551b7..6e31668e28e2b 100644 --- a/src/cmd/link/internal/ppc64/asm.go +++ b/src/cmd/link/internal/ppc64/asm.go @@ -39,6 +39,7 @@ import ( "encoding/binary" "fmt" "log" + "strings" ) func genplt(ctxt *ld.Link) { @@ -490,6 +491,9 @@ func symtoc(ctxt *ld.Link, s *sym.Symbol) int64 { } // archreloctoc relocates a TOC relative symbol. +// If the symbol pointed by this TOC relative symbol is in .data or .bss, the +// default load instruction can be changed to an addi instruction and the +// symbol address can be used directly. // This code is for AIX only. func archreloctoc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { if ctxt.HeadType == objabi.Hlinux { @@ -500,7 +504,25 @@ func archreloctoc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { o1 = uint32(val >> 32) o2 = uint32(val) - t := ld.Symaddr(r.Sym) + r.Add - ctxt.Syms.ROLookup("TOC", 0).Value // sym addr + var t int64 + useAddi := false + const prefix = "TOC." + var tarSym *sym.Symbol + if strings.HasPrefix(r.Sym.Name, prefix) { + tarSym = ctxt.Syms.ROLookup(strings.TrimPrefix(r.Sym.Name, prefix), 0) + } else { + ld.Errorf(s, "archreloctoc called for a symbol without TOC anchor") + } + + if tarSym != nil && tarSym.Attr.Reachable() && (tarSym.Sect.Seg == &ld.Segdata) { + t = ld.Symaddr(tarSym) + r.Add - ctxt.Syms.ROLookup("TOC", 0).Value + // change ld to addi in the second instruction + o2 = (o2 & 0x03FF0000) | 0xE<<26 + useAddi = true + } else { + t = ld.Symaddr(r.Sym) + r.Add - ctxt.Syms.ROLookup("TOC", 0).Value + } + if t != int64(int32(t)) { ld.Errorf(s, "TOC relocation for %s is too big to relocate %s: 0x%x", s.Name, r.Sym, t) } @@ -513,10 +535,14 @@ func archreloctoc(ctxt *ld.Link, r *sym.Reloc, s *sym.Symbol, val int64) int64 { switch r.Type { case objabi.R_ADDRPOWER_TOCREL_DS: - if t&3 != 0 { - ld.Errorf(s, "bad DS reloc for %s: %d", s.Name, ld.Symaddr(r.Sym)) + if useAddi { + o2 |= uint32(t) & 0xFFFF + } else { + if t&3 != 0 { + ld.Errorf(s, "bad DS reloc for %s: %d", s.Name, ld.Symaddr(r.Sym)) + } + o2 |= uint32(t) & 0xFFFC } - o2 |= uint32(t) & 0xFFFC default: return -1 } From 3855fe7254cbce964a53efdf6d8c9fdde9b4419c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Tue, 18 Dec 2018 13:00:26 +0100 Subject: [PATCH 386/594] runtime: fix backtrace during C syscalls for aix/ppc64 This commit fixes backtrace if a crash or an exit signal is received during a C syscall on aix/ppc64. This is similar to Solaris, Darwin or Windows implementation. Change-Id: I6040c0b1577a9f5b298f58bd4ee6556258a135ef Reviewed-on: https://go-review.googlesource.com/c/154718 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/os2_aix.go | 147 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 140 insertions(+), 7 deletions(-) diff --git a/src/runtime/os2_aix.go b/src/runtime/os2_aix.go index c478d4b0d89b2..d0349191c6d30 100644 --- a/src/runtime/os2_aix.go +++ b/src/runtime/os2_aix.go @@ -151,91 +151,224 @@ var asmsyscall6 libFunc //go:nowritebarrier //go:nosplit func syscall0(fn *libFunc) (r, err uintptr) { - c := &getg().m.libcall + gp := getg() + var mp *m + if gp != nil { + mp = gp.m + } + if mp != nil && mp.libcallsp == 0 { + mp.libcallg.set(gp) + mp.libcallpc = getcallerpc() + // sp must be the last, because once async cpu profiler finds + // all three values to be non-zero, it will use them + mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall + } + + c := &gp.m.libcall c.fn = uintptr(unsafe.Pointer(fn)) c.n = 0 c.args = uintptr(noescape(unsafe.Pointer(&fn))) // it's unused but must be non-nil, otherwise crashes asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(c)) + if mp != nil { + mp.libcallsp = 0 + } + return c.r1, c.err } //go:nowritebarrier //go:nosplit func syscall1(fn *libFunc, a0 uintptr) (r, err uintptr) { - c := &getg().m.libcall + gp := getg() + var mp *m + if gp != nil { + mp = gp.m + } + if mp != nil && mp.libcallsp == 0 { + mp.libcallg.set(gp) + mp.libcallpc = getcallerpc() + // sp must be the last, because once async cpu profiler finds + // all three values to be non-zero, it will use them + mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall + } + + c := &gp.m.libcall c.fn = uintptr(unsafe.Pointer(fn)) c.n = 1 c.args = uintptr(noescape(unsafe.Pointer(&a0))) asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(c)) + if mp != nil { + mp.libcallsp = 0 + } + return c.r1, c.err } //go:nowritebarrier //go:nosplit func syscall2(fn *libFunc, a0, a1 uintptr) (r, err uintptr) { - c := &getg().m.libcall + gp := getg() + var mp *m + if gp != nil { + mp = gp.m + } + if mp != nil && mp.libcallsp == 0 { + mp.libcallg.set(gp) + mp.libcallpc = getcallerpc() + // sp must be the last, because once async cpu profiler finds + // all three values to be non-zero, it will use them + mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall + } + + c := &gp.m.libcall c.fn = uintptr(unsafe.Pointer(fn)) c.n = 2 c.args = uintptr(noescape(unsafe.Pointer(&a0))) asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(c)) + if mp != nil { + mp.libcallsp = 0 + } + return c.r1, c.err } //go:nowritebarrier //go:nosplit func syscall3(fn *libFunc, a0, a1, a2 uintptr) (r, err uintptr) { - c := &getg().m.libcall + gp := getg() + var mp *m + if gp != nil { + mp = gp.m + } + if mp != nil && mp.libcallsp == 0 { + mp.libcallg.set(gp) + mp.libcallpc = getcallerpc() + // sp must be the last, because once async cpu profiler finds + // all three values to be non-zero, it will use them + mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall + } + + c := &gp.m.libcall c.fn = uintptr(unsafe.Pointer(fn)) c.n = 3 c.args = uintptr(noescape(unsafe.Pointer(&a0))) asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(c)) + if mp != nil { + mp.libcallsp = 0 + } + return c.r1, c.err } //go:nowritebarrier //go:nosplit func syscall4(fn *libFunc, a0, a1, a2, a3 uintptr) (r, err uintptr) { - c := &getg().m.libcall + gp := getg() + var mp *m + if gp != nil { + mp = gp.m + } + if mp != nil && mp.libcallsp == 0 { + mp.libcallg.set(gp) + mp.libcallpc = getcallerpc() + // sp must be the last, because once async cpu profiler finds + // all three values to be non-zero, it will use them + mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall + } + + c := &gp.m.libcall c.fn = uintptr(unsafe.Pointer(fn)) c.n = 4 c.args = uintptr(noescape(unsafe.Pointer(&a0))) asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(c)) + if mp != nil { + mp.libcallsp = 0 + } + return c.r1, c.err } //go:nowritebarrier //go:nosplit func syscall5(fn *libFunc, a0, a1, a2, a3, a4 uintptr) (r, err uintptr) { - c := &getg().m.libcall + gp := getg() + var mp *m + if gp != nil { + mp = gp.m + } + if mp != nil && mp.libcallsp == 0 { + mp.libcallg.set(gp) + mp.libcallpc = getcallerpc() + // sp must be the last, because once async cpu profiler finds + // all three values to be non-zero, it will use them + mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall + } + + c := &gp.m.libcall c.fn = uintptr(unsafe.Pointer(fn)) c.n = 5 c.args = uintptr(noescape(unsafe.Pointer(&a0))) asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(c)) + if mp != nil { + mp.libcallsp = 0 + } + return c.r1, c.err } //go:nowritebarrier //go:nosplit func syscall6(fn *libFunc, a0, a1, a2, a3, a4, a5 uintptr) (r, err uintptr) { - c := &getg().m.libcall + gp := getg() + var mp *m + if gp != nil { + mp = gp.m + } + if mp != nil && mp.libcallsp == 0 { + mp.libcallg.set(gp) + mp.libcallpc = getcallerpc() + // sp must be the last, because once async cpu profiler finds + // all three values to be non-zero, it will use them + mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall + } + + c := &gp.m.libcall c.fn = uintptr(unsafe.Pointer(fn)) c.n = 6 c.args = uintptr(noescape(unsafe.Pointer(&a0))) asmcgocall(unsafe.Pointer(&asmsyscall6), unsafe.Pointer(c)) + if mp != nil { + mp.libcallsp = 0 + } + return c.r1, c.err } From 5777e9700f023f1b464dc112b4e28be70da94253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=B6hrmann?= Date: Tue, 18 Dec 2018 12:46:06 +0100 Subject: [PATCH 387/594] doc/go1.12: add release notes for GODEBUG internal/cpu options Change-Id: Id68b62138e14d13bb352b14c7f42bcef5601eee3 Reviewed-on: https://go-review.googlesource.com/c/154717 Reviewed-by: Austin Clements Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 028ab0ce7586c..f1841cbffebc7 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -274,6 +274,14 @@

    Runtime

    decrease unless the OS is running out of memory.

    +

    + Adding cpu.extension=off to the + GODEBUG environment + variable now disables the use of optional CPU instruction + set extensions in the standard library and runtime. This is not + yet supported on Windows. +

    +

    Core library

    TLS 1.3

    @@ -493,14 +501,6 @@

    Minor changes to the library

    -
    internal/cpu
    -
    -

    - TODO: https://golang.org/cl/149578: move GODEBUGCPU options into GODEBUG -

    - -
    -
    internal/poll

    From c040786f37246f40ae29402fbdb6e97031a21713 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Mon, 17 Dec 2018 17:15:40 -0500 Subject: [PATCH 388/594] doc/go1.12: add notes for syscall/js CLs 141644, 143137, 144384 Also update a Go 1 compatibility promise link to canonical URL. Updates #27592 Updates #28264 Change-Id: I5994a0a63e0870c1795c65016590dfad829d26a7 Reviewed-on: https://go-review.googlesource.com/c/154618 Reviewed-by: Richard Musiol Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index f1841cbffebc7..76c5fe3aac310 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -27,7 +27,7 @@

    DRAFT RELEASE NOTES - Introduction to Go 1.12

    The latest Go release, version 1.12, arrives six months after Go 1.11. Most of its changes are in TODO. - As always, the release maintains the Go 1 promise of compatibility. + As always, the release maintains the Go 1 promise of compatibility. We expect almost all Go programs to continue to compile and run as before.

    @@ -732,19 +732,35 @@

    Minor changes to the library

    This is a breaking change, but WebAssembly support is still experimental and not yet subject to the Go 1 compatibility promise. Any code using the - old name will need to be updated. + old names will need to be updated.

    - TODO: https://golang.org/cl/141644: add Wrapper interface to support external Value wrapper types + If a type implements the new + Wrapper + interface, + ValueOf + will use it to return the JavaScript value for that type.

    - TODO: https://golang.org/cl/143137: make zero js.Value represent "undefined" + The meaning of the zero + Value + has changed. It now represents the JavaScript undefined value + instead of the number zero. + This is a breaking change, but WebAssembly support is still experimental + and not yet subject to the + Go 1 compatibility promise. Any code relying on + the zero Value + to mean the number zero will need to be updated.

    - TODO: https://golang.org/cl/144384: add the Value.Truthy method + The new + Value.Truthy + method reports the + JavaScript "truthiness" + of a given value.

    From 4e9b3ba84df34263f1d423c739c14a3acddd3dc0 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 17 Dec 2018 20:01:10 -0500 Subject: [PATCH 389/594] doc/go1.12: finish most Go 1.12 release notes Change-Id: I598c9a2031001a6780b75c31d9015c880741b170 Reviewed-on: https://go-review.googlesource.com/c/154637 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 110 +++++++++++++++++++++++++++--------------------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 76c5fe3aac310..1ef43d9cf01ae 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -26,11 +26,17 @@

    DRAFT RELEASE NOTES - Introduction to Go 1.12

    The latest Go release, version 1.12, arrives six months after Go 1.11. - Most of its changes are in TODO. + Most of its changes are in the implementation of the toolchain, runtime, and libraries. As always, the release maintains the Go 1 promise of compatibility. We expect almost all Go programs to continue to compile and run as before.

    +

    + There is a known issue in + the garbage collector that can cause rare crashes. It is being investigated. + Please report any issues you encounter. +

    +

    Changes to the language

    @@ -39,30 +45,30 @@

    Changes to the language

    Ports

    -

    FreeBSD

    +

    + The race detector is now supported on linux/arm64. +

    -

    +

    Go 1.12 is the last release that is supported on FreeBSD 10.x, which has already reached end-of-life. Go 1.13 will require FreeBSD 11.2+ or FreeBSD 12.0+.

    -

    Darwin

    - -

    -Go 1.12 is the last release that will run on macOS 10.10 Yosemite. -Go 1.13 will require macOS 10.11 El Capitan or later. +

    + cgo is now supported on linux/ppc64.

    -

    - libSystem is now used when making syscalls on Darwin, ensuring forward-compatibility - with future versions of macOS. +

    + hurd is now a recognized value for GOOS, reserved + for the GNU/Hurd system for use with gccgo.

    Windows

    - TODO: status of ARM32 port? + Go's new windows/arm port supports running Go on Windows 10 + IoT Core on 32-bit ARM chips such as the Raspberry Pi 3.

    AIX

    @@ -71,11 +77,16 @@

    AIX

    Go now supports AIX 7.2 and later on POWER8 architectures (aix/ppc64). External linking, cgo, pprof and the race detector aren't yet supported.

    -

    Hurd

    +

    Darwin

    -

    - hurd is now a recognized value for GOOS, reserved - for the GNU/Hurd system for use with gccgo. +

    + Go 1.12 is the last release that will run on macOS 10.10 Yosemite. + Go 1.13 will require macOS 10.11 El Capitan or later. +

    + +

    + libSystem is now used when making syscalls on Darwin, + ensuring forward-compatibility with future versions of macOS and iOS.

    Tools

    @@ -221,7 +232,7 @@

    Compiler toolchain

    in an error like "relocation target not defined for ABIInternal (but is defined for ABI0)", please refer to help section of the ABI design document. - TODO(austin): Link to the design doc. +

    @@ -230,6 +241,18 @@

    Compiler toolchain

    printing and variable location information.

    +

    + Go programs now also maintain stack frame pointers on linux/arm64 + for the benefit of profiling tools like perf. The frame pointer + maintenance has a small run-time overhead that varies but averages around 3%. + To build a toolchain that does not use frame pointers, set + GOEXPERIMENT=noframepointer when running make.bash. +

    + +

    + The obsolete "safe" compiler mode (enabled by the -u gcflag) has been removed. +

    +

    godoc and go doc

    @@ -253,6 +276,14 @@

    Trace

    latency and throughput.

    +

    Assembler

    + +

    + On arm64, the platform register was renamed from + R18 to R18_PLATFORM to prevent accidental + use, as the OS could choose to reserve this register. +

    +

    Runtime

    @@ -336,12 +367,8 @@

    Minor changes to the library

    in mind.

    - - - - - - + +
    bufio

    @@ -352,14 +379,6 @@

    Minor changes to the library

    -
    build
    -
    -

    - TODO: https://golang.org/cl/61511: support frame-pointer for arm64 -

    - -
    -
    bytes

    @@ -375,14 +394,6 @@

    Minor changes to the library

    -
    cmd,runtime
    -
    -

    - TODO: https://golang.org/cl/138675: enable race detector on arm64 -

    - -
    -
    crypto/rand

    @@ -501,14 +512,6 @@

    Minor changes to the library

    -
    internal/poll
    -
    -

    - TODO: https://golang.org/cl/130676: use F_FULLFSYNC fcntl for FD.Fsync on OS X -

    - -
    -
    io

    @@ -620,6 +623,11 @@

    Minor changes to the library

    on most Unix systems.

    +

    + File.Sync now uses F_FULLFSYNC on macOS + to properly flush content to permanent storage. Note that this might have a negative performance impact. +

    +
    path/filepath
    @@ -790,3 +798,11 @@

    Minor changes to the library

    +
    unsafe
    +
    +

    + It is invalid to convert a nil unsafe.Pointer to uintptr and back with arithmetic. + (This was already invalid, but will now cause the compiler to misbehave.) +

    + +
    From d063b7c6d342815f196c183693e2300ac3925334 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Sat, 17 Nov 2018 13:58:38 -0500 Subject: [PATCH 390/594] cmd/dist: enable race detector test on Linux/ARM64 CL 138675 added the race detector support on Linux/ARM64, but it didn't enable the race detector tests in cmd/dist (therefore in all.bash). Enable them. Updates #28848 Change-Id: I4306dad2fb4167021d568436076b9f535d7f6e07 Reviewed-on: https://go-review.googlesource.com/c/149967 Run-TryBot: Cherry Zhang Reviewed-by: Ian Lance Taylor --- src/cmd/dist/test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index ac182305529f9..82e2e17424f5d 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -1471,7 +1471,7 @@ func (t *tester) packageHasBenchmarks(pkg string) bool { func raceDetectorSupported(goos, goarch string) bool { switch goos { case "linux": - return goarch == "amd64" || goarch == "ppc64le" + return goarch == "amd64" || goarch == "ppc64le" || goarch == "arm64" case "darwin", "freebsd", "netbsd", "windows": return goarch == "amd64" default: From 77caea5bf2c5103a81283d9fb5b7ca030b884af2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 6 Dec 2018 14:08:19 -0800 Subject: [PATCH 391/594] cmd/cover: use -toolexec in tests to run newly built cover program This ensures that "go test cmd/cover" tests the current cover program, not the installed cover program. Change-Id: I58e718ded7eb1cd8da448d0194262209bb025b20 Reviewed-on: https://go-review.googlesource.com/c/153058 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/cover/cover_test.go | 58 ++++++++++++++++++++++++------ src/cmd/cover/testdata/toolexec.go | 33 +++++++++++++++++ 2 files changed, 80 insertions(+), 11 deletions(-) create mode 100644 src/cmd/cover/testdata/toolexec.go diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index aebe6f8cb511f..3e5c076d36182 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -30,9 +30,10 @@ const ( var ( // Input files. - testMain = filepath.Join(testdata, "main.go") - testTest = filepath.Join(testdata, "test.go") - coverProfile = filepath.Join(testdata, "profile.cov") + testMain = filepath.Join(testdata, "main.go") + testTest = filepath.Join(testdata, "test.go") + coverProfile = filepath.Join(testdata, "profile.cov") + toolexecSource = filepath.Join(testdata, "toolexec.go") // The HTML test files are in a separate directory // so they are a complete package. @@ -53,11 +54,17 @@ var ( // testcover is a newly built version of the cover program. testcover string - // testcoverErr records an error building testcover. + // toolexec is a program to use as the go tool's -toolexec argument. + toolexec string + + // testcoverErr records an error building testcover or toolexec. testcoverErr error // testcoverOnce is used to build testcover once. testcoverOnce sync.Once + + // toolexecArg is the argument to pass to the go tool. + toolexecArg string ) var debug = flag.Bool("debug", false, "keep rewritten files for debugging") @@ -94,14 +101,43 @@ func buildCover(t *testing.T) { t.Helper() testenv.MustHaveGoBuild(t) testcoverOnce.Do(func() { - testcover = filepath.Join(testTempDir, "testcover.exe") - t.Logf("running [go build -o %s]", testcover) - out, err := exec.Command(testenv.GoToolPath(t), "build", "-o", testcover).CombinedOutput() - t.Logf("%s", out) - testcoverErr = err + var wg sync.WaitGroup + wg.Add(2) + + var err1, err2 error + go func() { + defer wg.Done() + testcover = filepath.Join(testTempDir, "cover.exe") + t.Logf("running [go build -o %s]", testcover) + out, err := exec.Command(testenv.GoToolPath(t), "build", "-o", testcover).CombinedOutput() + if len(out) > 0 { + t.Logf("%s", out) + } + err1 = err + }() + + go func() { + defer wg.Done() + toolexec = filepath.Join(testTempDir, "toolexec.exe") + t.Logf("running [go -build -o %s %s]", toolexec, toolexecSource) + out, err := exec.Command(testenv.GoToolPath(t), "build", "-o", toolexec, toolexecSource).CombinedOutput() + if len(out) > 0 { + t.Logf("%s", out) + } + err2 = err + }() + + wg.Wait() + + testcoverErr = err1 + if err2 != nil && err1 == nil { + testcoverErr = err2 + } + + toolexecArg = "-toolexec=" + toolexec + " " + testcover }) if testcoverErr != nil { - t.Fatal("failed to build testcover program:", testcoverErr) + t.Fatal("failed to build testcover or toolexec program:", testcoverErr) } } @@ -335,7 +371,7 @@ func TestCoverHTML(t *testing.T) { buildCover(t) // go test -coverprofile testdata/html/html.cov cmd/cover/testdata/html - cmd := exec.Command(testenv.GoToolPath(t), "test", "-coverprofile", htmlProfile, "cmd/cover/testdata/html") + cmd := exec.Command(testenv.GoToolPath(t), "test", toolexecArg, "-coverprofile", htmlProfile, "cmd/cover/testdata/html") run(cmd, t) // testcover -html testdata/html/html.cov -o testdata/html/html.html cmd = exec.Command(testcover, "-html", htmlProfile, "-o", htmlHTML) diff --git a/src/cmd/cover/testdata/toolexec.go b/src/cmd/cover/testdata/toolexec.go new file mode 100644 index 0000000000000..1769efedbeb67 --- /dev/null +++ b/src/cmd/cover/testdata/toolexec.go @@ -0,0 +1,33 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// The toolexec program is a helper program for cmd/cover tests. +// It is used so that the go tool will call the newly built version +// of the cover program, rather than the installed one. +// +// The tests arrange to run the go tool with the argument +// -toolexec="/path/to/toolexec /path/to/testcover" +// The go tool will invoke this program (compiled into /path/to/toolexec) +// with the arguments shown above followed by the command to run. +// This program will check whether it is expected to run the cover +// program, and if so replace it with /path/to/testcover. +package main + +import ( + "os" + "os/exec" + "strings" +) + +func main() { + if strings.HasSuffix(strings.TrimSuffix(os.Args[2], ".exe"), "cover") { + os.Args[2] = os.Args[1] + } + cmd := exec.Command(os.Args[2], os.Args[3:]...) + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + if err := cmd.Run(); err != nil { + os.Exit(1) + } +} From d6899463029d8ab0d73c992ccf6639f095435b84 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 6 Dec 2018 20:54:35 -0800 Subject: [PATCH 392/594] cmd/cover: avoid repeating positions When using //line directives and unformatted code it is possible for positions to repeat. Increment the final column position to avoid that. Fixes #27350 Change-Id: I2faccc31360075e9814d4a024b0f98b117f8ce97 Reviewed-on: https://go-review.googlesource.com/c/153061 Run-TryBot: Rob Pike Reviewed-by: Rob Pike --- src/cmd/cover/cover.go | 20 +++++++++++ src/cmd/cover/cover_test.go | 68 ++++++++++++++++++++++++++++++++----- 2 files changed, 80 insertions(+), 8 deletions(-) diff --git a/src/cmd/cover/cover.go b/src/cmd/cover/cover.go index 425bcbdd2660a..0348849578bb1 100644 --- a/src/cmd/cover/cover.go +++ b/src/cmd/cover/cover.go @@ -646,9 +646,21 @@ func (f *File) addVariables(w io.Writer) { // - 32-bit starting line number // - 32-bit ending line number // - (16 bit ending column number << 16) | (16-bit starting column number). + var lastStart, lastEnd token.Position for i, block := range f.blocks { start := f.fset.Position(block.startByte) end := f.fset.Position(block.endByte) + + // It is possible for positions to repeat when there is a + // line directive that does not specify column information + // and the input has not been passed through gofmt. + // See issue #27350 and TestHtmlUnformatted. + if samePos(start, lastStart) && samePos(end, lastEnd) { + end.Column++ + } + lastStart = start + lastEnd = end + fmt.Fprintf(w, "\t\t%d, %d, %#x, // [%d]\n", start.Line, end.Line, (end.Column&0xFFFF)<<16|(start.Column&0xFFFF), i) } @@ -697,3 +709,11 @@ func isValidIdentifier(ident string) bool { } return true } + +// samePos returns whether two positions have the same file/line/column. +// We don't use p1 == p2 because token.Position also has an Offset field, +// and when the input uses //line directives two Positions can have different +// Offset values while having the same file/line/dolumn. +func samePos(p1, p2 token.Position) bool { + return p1.Filename == p2.Filename && p1.Line == p2.Line && p1.Column == p2.Column +} diff --git a/src/cmd/cover/cover_test.go b/src/cmd/cover/cover_test.go index 3e5c076d36182..3de9b0c12d7ea 100644 --- a/src/cmd/cover/cover_test.go +++ b/src/cmd/cover/cover_test.go @@ -40,11 +40,16 @@ var ( htmlGolden = filepath.Join(testdata, "html", "html.golden") // Temporary files. - tmpTestMain string - coverInput string - coverOutput string - htmlProfile string - htmlHTML string + tmpTestMain string + coverInput string + coverOutput string + htmlProfile string + htmlHTML string + htmlUDir string + htmlU string + htmlUTest string + htmlUProfile string + htmlUHTML string ) var ( @@ -85,6 +90,11 @@ func TestMain(m *testing.M) { coverOutput = filepath.Join(dir, "test_cover.go") htmlProfile = filepath.Join(dir, "html.cov") htmlHTML = filepath.Join(dir, "html.html") + htmlUDir = filepath.Join(dir, "htmlunformatted") + htmlU = filepath.Join(htmlUDir, "htmlunformatted.go") + htmlUTest = filepath.Join(htmlUDir, "htmlunformatted_test.go") + htmlUProfile = filepath.Join(htmlUDir, "htmlunformatted.cov") + htmlUHTML = filepath.Join(htmlUDir, "htmlunformatted.html") status := m.Run() @@ -427,12 +437,54 @@ func TestCoverHTML(t *testing.T) { } } +// Test HTML processing with a source file not run through gofmt. +// Issue #27350. +func TestHtmlUnformatted(t *testing.T) { + t.Parallel() + testenv.MustHaveGoRun(t) + buildCover(t) + + if err := os.Mkdir(htmlUDir, 0777); err != nil { + t.Fatal(err) + } + + const htmlUContents = ` +package htmlunformatted + +var g int + +func F() { +//line x.go:1 + { { F(); goto lab } } +lab: +}` + + const htmlUTestContents = `package htmlunformatted` + + if err := ioutil.WriteFile(htmlU, []byte(htmlUContents), 0444); err != nil { + t.Fatal(err) + } + if err := ioutil.WriteFile(htmlUTest, []byte(htmlUTestContents), 0444); err != nil { + t.Fatal(err) + } + + // go test -covermode=count -coverprofile TMPDIR/htmlunformatted.cov + cmd := exec.Command(testenv.GoToolPath(t), "test", toolexecArg, "-covermode=count", "-coverprofile", htmlUProfile) + cmd.Dir = htmlUDir + run(cmd, t) + + // testcover -html TMPDIR/htmlunformatted.cov -o unformatted.html + cmd = exec.Command(testcover, "-html", htmlUProfile, "-o", htmlUHTML) + run(cmd, t) +} + func run(c *exec.Cmd, t *testing.T) { t.Helper() t.Log("running", c.Args) - c.Stdout = os.Stdout - c.Stderr = os.Stderr - err := c.Run() + out, err := c.CombinedOutput() + if len(out) > 0 { + t.Logf("%s", out) + } if err != nil { t.Fatal(err) } From 7ef718f16fa05cd07bb0f7d22aa4bc57067de1f2 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 11 Dec 2018 22:03:04 +0000 Subject: [PATCH 393/594] runtime: call mmap with MAP_FIXED on BSDs in race mode This change makes it so that reserving more of the address space for the heap calls mmap with MAP_FIXED in race mode. Race mode requires certain guarantees on where the heap is located in the address space, and on Darwin 10.10 it appears that the kernel may end up ignoring the hint quite often (#26475). Using MAP_FIXED is relatively OK in race mode because nothing else should be mapped in the memory region provided by the initial hints. Fixes #26475. Change-Id: Id7ac1534ee74f6de491bc04441f27dbda09f0285 Reviewed-on: https://go-review.googlesource.com/c/153897 Reviewed-by: Austin Clements Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot --- src/runtime/mem_bsd.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/runtime/mem_bsd.go b/src/runtime/mem_bsd.go index 13065b61d48e8..bf2d99678b99e 100644 --- a/src/runtime/mem_bsd.go +++ b/src/runtime/mem_bsd.go @@ -42,7 +42,19 @@ func sysFault(v unsafe.Pointer, n uintptr) { } func sysReserve(v unsafe.Pointer, n uintptr) unsafe.Pointer { - p, err := mmap(v, n, _PROT_NONE, _MAP_ANON|_MAP_PRIVATE, -1, 0) + flags := int32(_MAP_ANON | _MAP_PRIVATE) + if raceenabled { + // Currently the race detector expects memory to live within a certain + // range, and on Darwin 10.10 mmap is prone to ignoring hints, moreso + // than later versions and other BSDs (#26475). So, even though it's + // potentially dangerous to MAP_FIXED, we do it in the race detection + // case because it'll help maintain the race detector's invariants. + // + // TODO(mknyszek): Drop this once support for Darwin 10.10 is dropped, + // and reconsider this when #24133 is addressed. + flags |= _MAP_FIXED + } + p, err := mmap(v, n, _PROT_NONE, flags, -1, 0) if err != 0 { return nil } From c343b6b2b81f9c6d4007c2c3c567dfaadd4fa4e6 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Mon, 17 Dec 2018 00:37:07 +0000 Subject: [PATCH 394/594] os: show how to print permission bits in octal Permission bits are most commonly viewed in string form (rwx-- etc) or in octal form (0755), but the latter is relatively rare in Go. Demonstrate how to print a FileMode in readable octal format. Change-Id: I41feb801bcecb5077d4eabafdea27c149fc179a1 Reviewed-on: https://go-review.googlesource.com/c/154423 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick --- src/os/example_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/example_test.go b/src/os/example_test.go index 5c96ebb417dcd..8b6566e1496ed 100644 --- a/src/os/example_test.go +++ b/src/os/example_test.go @@ -55,6 +55,7 @@ func ExampleFileMode() { log.Fatal(err) } + fmt.Printf("permissions: %#o\n", fi.Mode().Perm()) // 0400, 0777, etc. switch mode := fi.Mode(); { case mode.IsRegular(): fmt.Println("regular file") From 9d0318fc9daff2e72d540dfc1d9840cce16ea2bf Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 18 Dec 2018 15:32:58 -0500 Subject: [PATCH 395/594] api: promote next to go1.12 Change-Id: I9a30c76d1299a494cce69b1060156bc2932ac8d5 Reviewed-on: https://go-review.googlesource.com/c/154857 Reviewed-by: Dmitri Shuralyov Reviewed-by: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick Run-TryBot: Dmitri Shuralyov TryBot-Result: Gobot Gobot --- api/go1.12.txt | 251 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 251 insertions(+) create mode 100644 api/go1.12.txt diff --git a/api/go1.12.txt b/api/go1.12.txt new file mode 100644 index 0000000000000..865f04b76b43e --- /dev/null +++ b/api/go1.12.txt @@ -0,0 +1,251 @@ +pkg bytes, func ReplaceAll([]uint8, []uint8, []uint8) []uint8 +pkg crypto/tls, const TLS_AES_128_GCM_SHA256 = 4865 +pkg crypto/tls, const TLS_AES_128_GCM_SHA256 uint16 +pkg crypto/tls, const TLS_AES_256_GCM_SHA384 = 4866 +pkg crypto/tls, const TLS_AES_256_GCM_SHA384 uint16 +pkg crypto/tls, const TLS_CHACHA20_POLY1305_SHA256 = 4867 +pkg crypto/tls, const TLS_CHACHA20_POLY1305_SHA256 uint16 +pkg crypto/tls, const VersionTLS13 = 772 +pkg crypto/tls, const VersionTLS13 ideal-int +pkg crypto/tls, type RecordHeaderError struct, Conn net.Conn +pkg debug/elf, const R_RISCV_32_PCREL = 57 +pkg debug/elf, const R_RISCV_32_PCREL R_RISCV +pkg debug/pe, const IMAGE_FILE_MACHINE_ARMNT = 452 +pkg debug/pe, const IMAGE_FILE_MACHINE_ARMNT ideal-int +pkg expvar, method (*Map) Delete(string) +pkg go/doc, const PreserveAST = 4 +pkg go/doc, const PreserveAST Mode +pkg go/importer, func ForCompiler(*token.FileSet, string, Lookup) types.Importer +pkg go/token, method (*File) LineStart(int) Pos +pkg io, type StringWriter interface { WriteString } +pkg io, type StringWriter interface, WriteString(string) (int, error) +pkg log, method (*Logger) Writer() io.Writer +pkg math/bits, func Add(uint, uint, uint) (uint, uint) +pkg math/bits, func Add32(uint32, uint32, uint32) (uint32, uint32) +pkg math/bits, func Add64(uint64, uint64, uint64) (uint64, uint64) +pkg math/bits, func Div(uint, uint, uint) (uint, uint) +pkg math/bits, func Div32(uint32, uint32, uint32) (uint32, uint32) +pkg math/bits, func Div64(uint64, uint64, uint64) (uint64, uint64) +pkg math/bits, func Mul(uint, uint) (uint, uint) +pkg math/bits, func Mul32(uint32, uint32) (uint32, uint32) +pkg math/bits, func Mul64(uint64, uint64) (uint64, uint64) +pkg math/bits, func Sub(uint, uint, uint) (uint, uint) +pkg math/bits, func Sub32(uint32, uint32, uint32) (uint32, uint32) +pkg math/bits, func Sub64(uint64, uint64, uint64) (uint64, uint64) +pkg net/http, const StatusTooEarly = 425 +pkg net/http, const StatusTooEarly ideal-int +pkg net/http, method (*Client) CloseIdleConnections() +pkg os, const ModeType = 2401763328 +pkg os, func UserHomeDir() (string, error) +pkg os, method (*ProcessState) ExitCode() int +pkg os/exec, method (ExitError) ExitCode() int +pkg reflect, method (*MapIter) Key() Value +pkg reflect, method (*MapIter) Next() bool +pkg reflect, method (*MapIter) Value() Value +pkg reflect, method (Value) MapRange() *MapIter +pkg reflect, type MapIter struct +pkg runtime/debug, func ReadBuildInfo() (*BuildInfo, bool) +pkg runtime/debug, type BuildInfo struct +pkg runtime/debug, type BuildInfo struct, Deps []*Module +pkg runtime/debug, type BuildInfo struct, Main Module +pkg runtime/debug, type BuildInfo struct, Path string +pkg runtime/debug, type Module struct +pkg runtime/debug, type Module struct, Path string +pkg runtime/debug, type Module struct, Replace *Module +pkg runtime/debug, type Module struct, Sum string +pkg runtime/debug, type Module struct, Version string +pkg strings, func ReplaceAll(string, string, string) string +pkg strings, method (*Builder) Cap() int +pkg syscall (freebsd-386), const S_IRWXG = 56 +pkg syscall (freebsd-386), const S_IRWXG ideal-int +pkg syscall (freebsd-386), const S_IRWXO = 7 +pkg syscall (freebsd-386), const S_IRWXO ideal-int +pkg syscall (freebsd-386), func Fstatat(int, string, *Stat_t, int) error +pkg syscall (freebsd-386), func Mknod(string, uint32, uint64) error +pkg syscall (freebsd-386), type Dirent struct, Fileno uint64 +pkg syscall (freebsd-386), type Dirent struct, Namlen uint16 +pkg syscall (freebsd-386), type Dirent struct, Off int64 +pkg syscall (freebsd-386), type Dirent struct, Pad0 uint8 +pkg syscall (freebsd-386), type Dirent struct, Pad1 uint16 +pkg syscall (freebsd-386), type Stat_t struct, Atim Timespec +pkg syscall (freebsd-386), type Stat_t struct, Atim_ext int32 +pkg syscall (freebsd-386), type Stat_t struct, Birthtim Timespec +pkg syscall (freebsd-386), type Stat_t struct, Blksize int32 +pkg syscall (freebsd-386), type Stat_t struct, Btim_ext int32 +pkg syscall (freebsd-386), type Stat_t struct, Ctim Timespec +pkg syscall (freebsd-386), type Stat_t struct, Ctim_ext int32 +pkg syscall (freebsd-386), type Stat_t struct, Dev uint64 +pkg syscall (freebsd-386), type Stat_t struct, Gen uint64 +pkg syscall (freebsd-386), type Stat_t struct, Ino uint64 +pkg syscall (freebsd-386), type Stat_t struct, Mtim Timespec +pkg syscall (freebsd-386), type Stat_t struct, Mtim_ext int32 +pkg syscall (freebsd-386), type Stat_t struct, Nlink uint64 +pkg syscall (freebsd-386), type Stat_t struct, Padding0 int16 +pkg syscall (freebsd-386), type Stat_t struct, Padding1 int32 +pkg syscall (freebsd-386), type Stat_t struct, Rdev uint64 +pkg syscall (freebsd-386), type Stat_t struct, Spare [10]uint64 +pkg syscall (freebsd-386), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (freebsd-386), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (freebsd-386-cgo), const S_IRWXG = 56 +pkg syscall (freebsd-386-cgo), const S_IRWXG ideal-int +pkg syscall (freebsd-386-cgo), const S_IRWXO = 7 +pkg syscall (freebsd-386-cgo), const S_IRWXO ideal-int +pkg syscall (freebsd-386-cgo), func Fstatat(int, string, *Stat_t, int) error +pkg syscall (freebsd-386-cgo), func Mknod(string, uint32, uint64) error +pkg syscall (freebsd-386-cgo), type Dirent struct, Fileno uint64 +pkg syscall (freebsd-386-cgo), type Dirent struct, Namlen uint16 +pkg syscall (freebsd-386-cgo), type Dirent struct, Off int64 +pkg syscall (freebsd-386-cgo), type Dirent struct, Pad0 uint8 +pkg syscall (freebsd-386-cgo), type Dirent struct, Pad1 uint16 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Atim Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Atim_ext int32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Birthtim Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Blksize int32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Btim_ext int32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Ctim_ext int32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Dev uint64 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Gen uint64 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Ino uint64 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (freebsd-386-cgo), type Stat_t struct, Mtim_ext int32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Nlink uint64 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Padding0 int16 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Padding1 int32 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (freebsd-386-cgo), type Stat_t struct, Spare [10]uint64 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (freebsd-amd64), const S_IRWXG = 56 +pkg syscall (freebsd-amd64), const S_IRWXG ideal-int +pkg syscall (freebsd-amd64), const S_IRWXO = 7 +pkg syscall (freebsd-amd64), const S_IRWXO ideal-int +pkg syscall (freebsd-amd64), func Fstatat(int, string, *Stat_t, int) error +pkg syscall (freebsd-amd64), func Mknod(string, uint32, uint64) error +pkg syscall (freebsd-amd64), type Dirent struct, Fileno uint64 +pkg syscall (freebsd-amd64), type Dirent struct, Namlen uint16 +pkg syscall (freebsd-amd64), type Dirent struct, Off int64 +pkg syscall (freebsd-amd64), type Dirent struct, Pad0 uint8 +pkg syscall (freebsd-amd64), type Dirent struct, Pad1 uint16 +pkg syscall (freebsd-amd64), type Stat_t struct, Atim Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Birthtim Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Blksize int32 +pkg syscall (freebsd-amd64), type Stat_t struct, Ctim Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Dev uint64 +pkg syscall (freebsd-amd64), type Stat_t struct, Gen uint64 +pkg syscall (freebsd-amd64), type Stat_t struct, Ino uint64 +pkg syscall (freebsd-amd64), type Stat_t struct, Mtim Timespec +pkg syscall (freebsd-amd64), type Stat_t struct, Nlink uint64 +pkg syscall (freebsd-amd64), type Stat_t struct, Padding0 int16 +pkg syscall (freebsd-amd64), type Stat_t struct, Padding1 int32 +pkg syscall (freebsd-amd64), type Stat_t struct, Rdev uint64 +pkg syscall (freebsd-amd64), type Stat_t struct, Spare [10]uint64 +pkg syscall (freebsd-amd64), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (freebsd-amd64), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (freebsd-amd64-cgo), const S_IRWXG = 56 +pkg syscall (freebsd-amd64-cgo), const S_IRWXG ideal-int +pkg syscall (freebsd-amd64-cgo), const S_IRWXO = 7 +pkg syscall (freebsd-amd64-cgo), const S_IRWXO ideal-int +pkg syscall (freebsd-amd64-cgo), func Fstatat(int, string, *Stat_t, int) error +pkg syscall (freebsd-amd64-cgo), func Mknod(string, uint32, uint64) error +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Fileno uint64 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Namlen uint16 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Off int64 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Pad0 uint8 +pkg syscall (freebsd-amd64-cgo), type Dirent struct, Pad1 uint16 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Atim Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Birthtim Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Blksize int32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Dev uint64 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Gen uint64 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ino uint64 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Nlink uint64 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Padding0 int16 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Padding1 int32 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Spare [10]uint64 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (freebsd-arm), const S_IRWXG = 56 +pkg syscall (freebsd-arm), const S_IRWXG ideal-int +pkg syscall (freebsd-arm), const S_IRWXO = 7 +pkg syscall (freebsd-arm), const S_IRWXO ideal-int +pkg syscall (freebsd-arm), func Fstatat(int, string, *Stat_t, int) error +pkg syscall (freebsd-arm), func Mknod(string, uint32, uint64) error +pkg syscall (freebsd-arm), type Dirent struct, Fileno uint64 +pkg syscall (freebsd-arm), type Dirent struct, Namlen uint16 +pkg syscall (freebsd-arm), type Dirent struct, Off int64 +pkg syscall (freebsd-arm), type Dirent struct, Pad0 uint8 +pkg syscall (freebsd-arm), type Dirent struct, Pad1 uint16 +pkg syscall (freebsd-arm), type Stat_t struct, Atim Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Birthtim Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Blksize int32 +pkg syscall (freebsd-arm), type Stat_t struct, Ctim Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Dev uint64 +pkg syscall (freebsd-arm), type Stat_t struct, Gen uint64 +pkg syscall (freebsd-arm), type Stat_t struct, Ino uint64 +pkg syscall (freebsd-arm), type Stat_t struct, Mtim Timespec +pkg syscall (freebsd-arm), type Stat_t struct, Nlink uint64 +pkg syscall (freebsd-arm), type Stat_t struct, Padding0 int16 +pkg syscall (freebsd-arm), type Stat_t struct, Padding1 int32 +pkg syscall (freebsd-arm), type Stat_t struct, Rdev uint64 +pkg syscall (freebsd-arm), type Stat_t struct, Spare [10]uint64 +pkg syscall (freebsd-arm), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (freebsd-arm), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (freebsd-arm-cgo), const S_IRWXG = 56 +pkg syscall (freebsd-arm-cgo), const S_IRWXG ideal-int +pkg syscall (freebsd-arm-cgo), const S_IRWXO = 7 +pkg syscall (freebsd-arm-cgo), const S_IRWXO ideal-int +pkg syscall (freebsd-arm-cgo), func Fstatat(int, string, *Stat_t, int) error +pkg syscall (freebsd-arm-cgo), func Mknod(string, uint32, uint64) error +pkg syscall (freebsd-arm-cgo), type Dirent struct, Fileno uint64 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Namlen uint16 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Off int64 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Pad0 uint8 +pkg syscall (freebsd-arm-cgo), type Dirent struct, Pad1 uint16 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Atim Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Birthtim Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Blksize int32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ctim Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Dev uint64 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Gen uint64 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ino uint64 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Mtim Timespec +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Nlink uint64 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Padding0 int16 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Padding1 int32 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Rdev uint64 +pkg syscall (freebsd-arm-cgo), type Stat_t struct, Spare [10]uint64 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntfromname [1024]int8 +pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntonname [1024]int8 +pkg syscall (openbsd-386), const S_IRWXG = 56 +pkg syscall (openbsd-386), const S_IRWXG ideal-int +pkg syscall (openbsd-386), const S_IRWXO = 7 +pkg syscall (openbsd-386), const S_IRWXO ideal-int +pkg syscall (openbsd-386-cgo), const S_IRWXG = 56 +pkg syscall (openbsd-386-cgo), const S_IRWXG ideal-int +pkg syscall (openbsd-386-cgo), const S_IRWXO = 7 +pkg syscall (openbsd-386-cgo), const S_IRWXO ideal-int +pkg syscall (openbsd-amd64), const S_IRWXG = 56 +pkg syscall (openbsd-amd64), const S_IRWXG ideal-int +pkg syscall (openbsd-amd64), const S_IRWXO = 7 +pkg syscall (openbsd-amd64), const S_IRWXO ideal-int +pkg syscall (openbsd-amd64-cgo), const S_IRWXG = 56 +pkg syscall (openbsd-amd64-cgo), const S_IRWXG ideal-int +pkg syscall (openbsd-amd64-cgo), const S_IRWXO = 7 +pkg syscall (openbsd-amd64-cgo), const S_IRWXO ideal-int +pkg syscall (windows-386), const UNIX_PATH_MAX = 108 +pkg syscall (windows-386), const UNIX_PATH_MAX ideal-int +pkg syscall (windows-386), func Syscall18(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-386), type RawSockaddrAny struct, Pad [100]int8 +pkg syscall (windows-386), type RawSockaddrUnix struct, Family uint16 +pkg syscall (windows-386), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall (windows-amd64), const UNIX_PATH_MAX = 108 +pkg syscall (windows-amd64), const UNIX_PATH_MAX ideal-int +pkg syscall (windows-amd64), func Syscall18(uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) (uintptr, uintptr, Errno) +pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [100]int8 +pkg syscall (windows-amd64), type RawSockaddrUnix struct, Family uint16 +pkg syscall (windows-amd64), type RawSockaddrUnix struct, Path [108]int8 +pkg syscall, type RawSockaddrUnix struct From 9ded8b0e97588895e00e93299e4a4a748cfa3a4b Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Tue, 18 Dec 2018 21:32:48 +0100 Subject: [PATCH 396/594] doc/go1.12: note that syscall.Getdirentries is no longer supported on iOS Change-Id: I4277f4130b460b42c5b51fd5a5e07f6c0e62163b Reviewed-on: https://go-review.googlesource.com/c/154720 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 1ef43d9cf01ae..f0957eeb7e575 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -87,6 +87,11 @@

    Darwin

    libSystem is now used when making syscalls on Darwin, ensuring forward-compatibility with future versions of macOS and iOS. + + The switch to libSystem triggered additional App Store + checks for private API usage. Since it is considered private, + syscall.Getdirentries now always fails with + ENOSYS on iOS.

    Tools

    From e3b4b7baad555f74b6fbc0ddc00d46ed0ac03a0a Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Tue, 18 Dec 2018 12:54:23 -0800 Subject: [PATCH 397/594] runtime: use QPC for nanotime and time.now on windows/arm The previous implementation of nanotime and time.now used a time source that was updated on the system clock tick, which has a maximum resolution of about 1ms. On 386 and amd64, this time source maps to the system performance counter, so has much higher resolution. On ARM, use QueryPerformanceCounter() to get a high resolution timestamp. Updates #26148 Change-Id: I1abc99baf927a95b472ac05020a7788626c71d08 Reviewed-on: https://go-review.googlesource.com/c/154758 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/runtime/os_windows.go | 13 ++-- src/runtime/sys_windows_arm.s | 109 +--------------------------------- 2 files changed, 12 insertions(+), 110 deletions(-) diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 9b34589874c54..20fe01c40375d 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -198,9 +198,12 @@ func loadOptionalSyscalls() { } _NtWaitForSingleObject = windowsFindfunc(n32, []byte("NtWaitForSingleObject\000")) - if windowsFindfunc(n32, []byte("wine_get_version\000")) != nil { - // running on Wine - initWine(k32) + underWine := windowsFindfunc(n32, []byte("wine_get_version\000")) != nil + if underWine || GOARCH == "arm" { + initQPC(k32) + } + if underWine { + initWine() } } @@ -357,7 +360,7 @@ func nowQPC() (sec int64, nsec int32, mono int64) { return } -func initWine(k32 uintptr) { +func initQPC(k32 uintptr) { _GetSystemTimeAsFileTime = windowsFindfunc(k32, []byte("GetSystemTimeAsFileTime\000")) if _GetSystemTimeAsFileTime == nil { throw("could not find GetSystemTimeAsFileTime() syscall") @@ -394,7 +397,9 @@ func initWine(k32 uintptr) { // We have to do it this way (or similar), since multiplying QPC counter by 100 millions overflows // int64 and resulted time will always be invalid. qpcMultiplier = int64(timediv(1000000000, qpcFrequency, nil)) +} +func initWine() { useQPCTime = 1 } diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s index 60be74b95cf02..514dc5223e9c9 100644 --- a/src/runtime/sys_windows_arm.s +++ b/src/runtime/sys_windows_arm.s @@ -487,115 +487,12 @@ TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0 MOVW R0, (R0) RET -// See http://www.dcl.hpi.uni-potsdam.de/research/WRK/2007/08/getting-os-information-the-kuser_shared_data-structure/ -// Must read hi1, then lo, then hi2. The snapshot is valid if hi1 == hi2. -#define _INTERRUPT_TIME 0x7ffe0008 -#define _SYSTEM_TIME 0x7ffe0014 -#define time_lo 0 -#define time_hi1 4 -#define time_hi2 8 - -TEXT runtime·nanotime(SB),NOSPLIT,$0-8 - MOVW $0, R0 - MOVB runtime·useQPCTime(SB), R0 - CMP $0, R0 - BNE useQPC - MOVW $_INTERRUPT_TIME, R3 -loop: - MOVW time_hi1(R3), R1 - MOVW time_lo(R3), R0 - MOVW time_hi2(R3), R2 - CMP R1, R2 - BNE loop - - // wintime = R1:R0, multiply by 100 - MOVW $100, R2 - MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2 - MULA R1, R2, R4, R4 - - // wintime*100 = R4:R3 - MOVW R3, ret_lo+0(FP) - MOVW R4, ret_hi+4(FP) - RET -useQPC: +TEXT runtime·nanotime(SB),NOSPLIT|NOFRAME,$0-8 B runtime·nanotimeQPC(SB) // tail call RET -TEXT time·now(SB),NOSPLIT,$0-20 - MOVW $0, R0 - MOVB runtime·useQPCTime(SB), R0 - CMP $0, R0 - BNE useQPC - MOVW $_INTERRUPT_TIME, R3 -loop: - MOVW time_hi1(R3), R1 - MOVW time_lo(R3), R0 - MOVW time_hi2(R3), R2 - CMP R1, R2 - BNE loop - - // wintime = R1:R0, multiply by 100 - MOVW $100, R2 - MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2 - MULA R1, R2, R4, R4 - - // wintime*100 = R4:R3 - MOVW R3, mono+12(FP) - MOVW R4, mono+16(FP) - - MOVW $_SYSTEM_TIME, R3 -wall: - MOVW time_hi1(R3), R1 - MOVW time_lo(R3), R0 - MOVW time_hi2(R3), R2 - CMP R1, R2 - BNE wall - - // w = R1:R0 in 100ns untis - // convert to Unix epoch (but still 100ns units) - #define delta 116444736000000000 - SUB.S $(delta & 0xFFFFFFFF), R0 - SBC $(delta >> 32), R1 - - // Convert to nSec - MOVW $100, R2 - MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2 - MULA R1, R2, R4, R4 - // w = R2:R1 in nSec - MOVW R3, R1 // R4:R3 -> R2:R1 - MOVW R4, R2 - - // multiply nanoseconds by reciprocal of 10**9 (scaled by 2**61) - // to get seconds (96 bit scaled result) - MOVW $0x89705f41, R3 // 2**61 * 10**-9 - MULLU R1,R3,(R6,R5) // R7:R6:R5 = R2:R1 * R3 - MOVW $0,R7 - MULALU R2,R3,(R7,R6) - - // unscale by discarding low 32 bits, shifting the rest by 29 - MOVW R6>>29,R6 // R7:R6 = (R7:R6:R5 >> 61) - ORR R7<<3,R6 - MOVW R7>>29,R7 - - // subtract (10**9 * sec) from nsec to get nanosecond remainder - MOVW $1000000000, R5 // 10**9 - MULLU R6,R5,(R9,R8) // R9:R8 = R7:R6 * R5 - MULA R7,R5,R9,R9 - SUB.S R8,R1 // R2:R1 -= R9:R8 - SBC R9,R2 - - // because reciprocal was a truncated repeating fraction, quotient - // may be slightly too small -- adjust to make remainder < 10**9 - CMP R5,R1 // if remainder > 10**9 - SUB.HS R5,R1 // remainder -= 10**9 - ADD.HS $1,R6 // sec += 1 - - MOVW R6,sec_lo+0(FP) - MOVW R7,sec_hi+4(FP) - MOVW R1,nsec+8(FP) - RET -useQPC: - B runtime·nanotimeQPC(SB) // tail call +TEXT time·now(SB),NOSPLIT|NOFRAME,$0-20 + B runtime·nowQPC(SB) // tail call RET // save_g saves the g register (R10) into thread local memory From 9ed9df6ca27850704133de1ceb94407c635beb82 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 18 Dec 2018 20:04:53 +0000 Subject: [PATCH 398/594] runtime: avoid write barrier in startpanic_m startpanic_m could be called correctly in a context where there's a valid G, a valid M, but no P, for example in a signal handler which panics. Currently, startpanic_m has write barriers enabled because write barriers are permitted if a G's M is dying. However, all the current write barrier implementations assume the current G has a P. Therefore, in this change we disable write barriers in startpanic_m, remove the only pointer write which clears g.writebuf, and fix up gwrite to ignore the writebuf if the current G's M is dying, rather than relying on it being nil in the dying case. Fixes #26575. Change-Id: I9b29e6b9edf00d8e99ffc71770c287142ebae086 Reviewed-on: https://go-review.googlesource.com/c/154837 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/panic.go | 11 +++++++---- src/runtime/print.go | 7 ++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/runtime/panic.go b/src/runtime/panic.go index 81ff21113f98d..bb83be4715d3a 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -729,10 +729,13 @@ func fatalpanic(msgs *_panic) { // It returns true if panic messages should be printed, or false if // the runtime is in bad shape and should just print stacks. // -// It can have write barriers because the write barrier explicitly -// ignores writes once dying > 0. +// It must not have write barriers even though the write barrier +// explicitly ignores writes once dying > 0. Write barriers still +// assume that g.m.p != nil, and this function may not have P +// in some contexts (e.g. a panic in a signal handler for a signal +// sent to an M with no P). // -//go:yeswritebarrierrec +//go:nowritebarrierrec func startpanic_m() bool { _g_ := getg() if mheap_.cachealloc.size == 0 { // very early @@ -752,8 +755,8 @@ func startpanic_m() bool { switch _g_.m.dying { case 0: + // Setting dying >0 has the side-effect of disabling this G's writebuf. _g_.m.dying = 1 - _g_.writebuf = nil atomic.Xadd(&panicking, 1) lock(&paniclk) if debug.schedtrace > 0 || debug.scheddetail > 0 { diff --git a/src/runtime/print.go b/src/runtime/print.go index 7b2e4f40ffe06..e605eb34cb90a 100644 --- a/src/runtime/print.go +++ b/src/runtime/print.go @@ -89,7 +89,12 @@ func gwrite(b []byte) { } recordForPanic(b) gp := getg() - if gp == nil || gp.writebuf == nil { + // Don't use the writebuf if gp.m is dying. We want anything + // written through gwrite to appear in the terminal rather + // than be written to in some buffer, if we're in a panicking state. + // Note that we can't just clear writebuf in the gp.m.dying case + // because a panic isn't allowed to have any write barriers. + if gp == nil || gp.writebuf == nil || gp.m.dying > 0 { writeErr(b) return } From d902f23ec416fc881d567c1a81a3d2c48cc16855 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 19 Dec 2018 13:50:13 +0100 Subject: [PATCH 399/594] cmd/cgo,doc/go1.12.html: document breaking EGLDisplay change Change-Id: I3c8ba5fdb05b6b1324648622656cc10071c70a34 Reviewed-on: https://go-review.googlesource.com/c/154997 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 10 ++++++++++ src/cmd/cgo/doc.go | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index f0957eeb7e575..2b64adffefcae 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -135,6 +135,16 @@

    Binary-only packages

    Go 1.12 is the last release that will support binary-only packages.

    +

    Cgo

    + +

    + Go 1.12 will translate the C type EGLDisplay to the Go type uintptr. + This change is similar to how Go 1.10 and newer treats Darwin's CoreFoundation + and Java's JNI types. See the + cgo documentation + for more information. +

    +

    Modules

    diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index 08d64130df436..cceb33edbdb73 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -413,6 +413,8 @@ type in Go are instead represented by a uintptr. Those include: jobjectArray jweak +3. The EGLDisplay type from the EGL API. + These types are uintptr on the Go side because they would otherwise confuse the Go garbage collector; they are sometimes not really pointers but data structures encoded in a pointer type. All operations @@ -427,6 +429,11 @@ from Go 1.9 and earlier, use the cftype or jni rewrites in the Go fix tool: It will replace nil with 0 in the appropriate places. +The EGLDisplay case were introduced in Go 1.12. Use the egl rewrite +to auto-update code from Go 1.11 and earlier: + + go tool fix -r egl + Using cgo directly Usage: From d9e2ba4fcce0a405e2d103e43c19f01fa1a5401d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Dec 2018 07:03:04 -0800 Subject: [PATCH 400/594] cmd/cgo: ensure the command passed to run retains a trailing dash This was accidentally broken by CL 127755. Fixes #29333 Change-Id: I5e92048c64a55c1699d6c38eb4dbbd51c817b820 Reviewed-on: https://go-review.googlesource.com/c/155037 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/cgo/test/issue4339.go | 3 ++- src/cmd/cgo/gcc.go | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/cgo/test/issue4339.go b/misc/cgo/test/issue4339.go index 4fa4b2bbd7e3c..3715fde57573a 100644 --- a/misc/cgo/test/issue4339.go +++ b/misc/cgo/test/issue4339.go @@ -5,7 +5,8 @@ package cgotest /* -#include "issue4339.h" +// We've historically permitted #include <>, so test it here. Issue 29333. +#include */ import "C" diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 27bd59b54e0cc..11c3ff3a9ceae 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -1992,8 +1992,10 @@ func (p *Package) gccErrors(stdin []byte) string { } } - // Force -O0 optimization + // Force -O0 optimization but keep the trailing "-" at the end. nargs = append(nargs, "-O0") + nl := len(nargs) + nargs[nl-2], nargs[nl-1] = nargs[nl-1], nargs[nl-2] if *debugGcc { fmt.Fprintf(os.Stderr, "$ %s < Date: Wed, 19 Dec 2018 09:36:11 +0100 Subject: [PATCH 401/594] doc/go1.12: fix typos and code formatting Fix two typos and don't indent the go vet example. Change-Id: Iccec56ca5decfbae45547a00115500ed13b703e1 Reviewed-on: https://go-review.googlesource.com/c/154721 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 2b64adffefcae..4fed4b7fc4a2f 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -113,10 +113,10 @@

    go tool vet no longer supported

    As part of this change, the experimental -shadow option is no longer available with go vet. Checking for variable shadowing may now be done using -
    -    go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
    -    go vet -vettool=$(which shadow)
    -  
    +
    +go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
    +go vet -vettool=$(which shadow)
    +

    Build cache requirement

    @@ -505,7 +505,7 @@

    Minor changes to the library

    The File type has a new LineStart field, which returns the position of the start of a given line. This is especially useful - in programs that occassionally handle non-Go files, such as assembly, but wish to use + in programs that occasionally handle non-Go files, such as assembly, but wish to use the token.Pos mechanism to identify file positions.

    @@ -662,7 +662,7 @@

    Minor changes to the library

    an iterator for ranging over a map. This type is exposed through the Value type's new MapRange method. - This follows the same iteration semantics as a range statment, with Next + This follows the same iteration semantics as a range statement, with Next to advance the iterator, and Key/Value to access each entry.

    From e2897e4ac0e0c124f3bb06885b4e2ed22e18eabf Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Wed, 19 Dec 2018 10:33:42 +0530 Subject: [PATCH 402/594] doc/go1.12: fix minor grammatical error Change-Id: I767bf77aeab62f2d42239fac9d601a8e04fe860f Reviewed-on: https://go-review.googlesource.com/c/154957 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 4fed4b7fc4a2f..0aee382aebb1a 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -279,7 +279,7 @@

    godoc and go doc

    go doc now supports the -all flag, which will cause it to print all exported APIs and their documentation, - similarly to what the godoc command line used to do. + as the godoc command line used to do.

    Trace

    From f880efcc1666e2b99fbda644eeff258e4a15dd38 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Tue, 18 Dec 2018 16:32:09 -0800 Subject: [PATCH 403/594] Revert "runtime: use QPC for nanotime and time.now on windows/arm" This reverts change https://golang.org/cl/154758. Restore the previous implementations of nanotime and time.now, which are sufficiently high resolution and more efficient than QueryPerformanceCounter. The intent of the change was to improve resolution of tracing timestamps, but the change was overly broad as it was only necessary to fix cputicks(). cputicks() is fixed in a subsequent change. Updates #26148 Change-Id: Ib9883d02fe1af2cc4940e866d8f6dc7622d47781 Reviewed-on: https://go-review.googlesource.com/c/154761 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/runtime/os_windows.go | 13 ++-- src/runtime/sys_windows_arm.s | 109 +++++++++++++++++++++++++++++++++- 2 files changed, 110 insertions(+), 12 deletions(-) diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 20fe01c40375d..9b34589874c54 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -198,12 +198,9 @@ func loadOptionalSyscalls() { } _NtWaitForSingleObject = windowsFindfunc(n32, []byte("NtWaitForSingleObject\000")) - underWine := windowsFindfunc(n32, []byte("wine_get_version\000")) != nil - if underWine || GOARCH == "arm" { - initQPC(k32) - } - if underWine { - initWine() + if windowsFindfunc(n32, []byte("wine_get_version\000")) != nil { + // running on Wine + initWine(k32) } } @@ -360,7 +357,7 @@ func nowQPC() (sec int64, nsec int32, mono int64) { return } -func initQPC(k32 uintptr) { +func initWine(k32 uintptr) { _GetSystemTimeAsFileTime = windowsFindfunc(k32, []byte("GetSystemTimeAsFileTime\000")) if _GetSystemTimeAsFileTime == nil { throw("could not find GetSystemTimeAsFileTime() syscall") @@ -397,9 +394,7 @@ func initQPC(k32 uintptr) { // We have to do it this way (or similar), since multiplying QPC counter by 100 millions overflows // int64 and resulted time will always be invalid. qpcMultiplier = int64(timediv(1000000000, qpcFrequency, nil)) -} -func initWine() { useQPCTime = 1 } diff --git a/src/runtime/sys_windows_arm.s b/src/runtime/sys_windows_arm.s index 514dc5223e9c9..60be74b95cf02 100644 --- a/src/runtime/sys_windows_arm.s +++ b/src/runtime/sys_windows_arm.s @@ -487,12 +487,115 @@ TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0 MOVW R0, (R0) RET -TEXT runtime·nanotime(SB),NOSPLIT|NOFRAME,$0-8 +// See http://www.dcl.hpi.uni-potsdam.de/research/WRK/2007/08/getting-os-information-the-kuser_shared_data-structure/ +// Must read hi1, then lo, then hi2. The snapshot is valid if hi1 == hi2. +#define _INTERRUPT_TIME 0x7ffe0008 +#define _SYSTEM_TIME 0x7ffe0014 +#define time_lo 0 +#define time_hi1 4 +#define time_hi2 8 + +TEXT runtime·nanotime(SB),NOSPLIT,$0-8 + MOVW $0, R0 + MOVB runtime·useQPCTime(SB), R0 + CMP $0, R0 + BNE useQPC + MOVW $_INTERRUPT_TIME, R3 +loop: + MOVW time_hi1(R3), R1 + MOVW time_lo(R3), R0 + MOVW time_hi2(R3), R2 + CMP R1, R2 + BNE loop + + // wintime = R1:R0, multiply by 100 + MOVW $100, R2 + MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2 + MULA R1, R2, R4, R4 + + // wintime*100 = R4:R3 + MOVW R3, ret_lo+0(FP) + MOVW R4, ret_hi+4(FP) + RET +useQPC: B runtime·nanotimeQPC(SB) // tail call RET -TEXT time·now(SB),NOSPLIT|NOFRAME,$0-20 - B runtime·nowQPC(SB) // tail call +TEXT time·now(SB),NOSPLIT,$0-20 + MOVW $0, R0 + MOVB runtime·useQPCTime(SB), R0 + CMP $0, R0 + BNE useQPC + MOVW $_INTERRUPT_TIME, R3 +loop: + MOVW time_hi1(R3), R1 + MOVW time_lo(R3), R0 + MOVW time_hi2(R3), R2 + CMP R1, R2 + BNE loop + + // wintime = R1:R0, multiply by 100 + MOVW $100, R2 + MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2 + MULA R1, R2, R4, R4 + + // wintime*100 = R4:R3 + MOVW R3, mono+12(FP) + MOVW R4, mono+16(FP) + + MOVW $_SYSTEM_TIME, R3 +wall: + MOVW time_hi1(R3), R1 + MOVW time_lo(R3), R0 + MOVW time_hi2(R3), R2 + CMP R1, R2 + BNE wall + + // w = R1:R0 in 100ns untis + // convert to Unix epoch (but still 100ns units) + #define delta 116444736000000000 + SUB.S $(delta & 0xFFFFFFFF), R0 + SBC $(delta >> 32), R1 + + // Convert to nSec + MOVW $100, R2 + MULLU R0, R2, (R4, R3) // R4:R3 = R1:R0 * R2 + MULA R1, R2, R4, R4 + // w = R2:R1 in nSec + MOVW R3, R1 // R4:R3 -> R2:R1 + MOVW R4, R2 + + // multiply nanoseconds by reciprocal of 10**9 (scaled by 2**61) + // to get seconds (96 bit scaled result) + MOVW $0x89705f41, R3 // 2**61 * 10**-9 + MULLU R1,R3,(R6,R5) // R7:R6:R5 = R2:R1 * R3 + MOVW $0,R7 + MULALU R2,R3,(R7,R6) + + // unscale by discarding low 32 bits, shifting the rest by 29 + MOVW R6>>29,R6 // R7:R6 = (R7:R6:R5 >> 61) + ORR R7<<3,R6 + MOVW R7>>29,R7 + + // subtract (10**9 * sec) from nsec to get nanosecond remainder + MOVW $1000000000, R5 // 10**9 + MULLU R6,R5,(R9,R8) // R9:R8 = R7:R6 * R5 + MULA R7,R5,R9,R9 + SUB.S R8,R1 // R2:R1 -= R9:R8 + SBC R9,R2 + + // because reciprocal was a truncated repeating fraction, quotient + // may be slightly too small -- adjust to make remainder < 10**9 + CMP R5,R1 // if remainder > 10**9 + SUB.HS R5,R1 // remainder -= 10**9 + ADD.HS $1,R6 // sec += 1 + + MOVW R6,sec_lo+0(FP) + MOVW R7,sec_hi+4(FP) + MOVW R1,nsec+8(FP) + RET +useQPC: + B runtime·nanotimeQPC(SB) // tail call RET // save_g saves the g register (R10) into thread local memory From 6fcab648af59faab639f3453354a7a14c888e75c Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Wed, 19 Dec 2018 17:32:22 +0000 Subject: [PATCH 404/594] runtime: disable TestArenaCollision on Darwin in race mode This change disables the test TestArenaCollision on Darwin in race mode to deal with the fact that Darwin 10.10 must use MAP_FIXED in race mode to ensure we retain our heap in a particular portion of the address space which the race detector needs. The test specifically checks to make sure a manually mapped region's space isn't re-used, which is definitely possible with MAP_FIXED because it replaces whatever mapping already exists at a given address. This change then also makes it so that MAP_FIXED is only used in race mode and on Darwin, not all BSDs, because using MAP_FIXED breaks this test for FreeBSD in addition to Darwin. Updates #26475. Fixes #29340. Change-Id: I1c59349408ccd7eeb30c4bf2593f48316b23ab2f Reviewed-on: https://go-review.googlesource.com/c/155097 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/runtime/malloc_test.go | 8 ++++++++ src/runtime/mem_bsd.go | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/runtime/malloc_test.go b/src/runtime/malloc_test.go index f25bfa48aff02..a2d5864d3d472 100644 --- a/src/runtime/malloc_test.go +++ b/src/runtime/malloc_test.go @@ -183,6 +183,14 @@ type acLink struct { var arenaCollisionSink []*acLink func TestArenaCollision(t *testing.T) { + if GOOS == "darwin" && race.Enabled { + // Skip this test on Darwin in race mode because Darwin 10.10 has + // issues following arena hints and runs out of them in race mode, so + // MAP_FIXED is used to ensure we keep the heap in the memory region the + // race detector expects. + // TODO(mknyszek): Delete this when Darwin 10.10 is no longer supported. + t.Skip("disabled on Darwin with race mode since MAP_FIXED is used") + } testenv.MustHaveExec(t) // Test that mheap.sysAlloc handles collisions with other diff --git a/src/runtime/mem_bsd.go b/src/runtime/mem_bsd.go index bf2d99678b99e..84238d7279fb5 100644 --- a/src/runtime/mem_bsd.go +++ b/src/runtime/mem_bsd.go @@ -43,7 +43,7 @@ func sysFault(v unsafe.Pointer, n uintptr) { func sysReserve(v unsafe.Pointer, n uintptr) unsafe.Pointer { flags := int32(_MAP_ANON | _MAP_PRIVATE) - if raceenabled { + if raceenabled && GOOS == "darwin" { // Currently the race detector expects memory to live within a certain // range, and on Darwin 10.10 mmap is prone to ignoring hints, moreso // than later versions and other BSDs (#26475). So, even though it's From d0f8a7517ab0b33c8e3dd49294800dd6144e4cee Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Fri, 7 Dec 2018 00:07:43 +0000 Subject: [PATCH 405/594] runtime: don't clear lockedExt on locked M when G exits When a locked M has its G exit without calling UnlockOSThread, then lockedExt on it was getting cleared. Unfortunately, this meant that during P handoff, if a new M was started, it might get forked (on most OSs besides Windows) from the locked M, which could have kernel state attached to it. To solve this, just don't clear lockedExt. At the point where the locked M has its G exit, it will also exit in accordance with the LockOSThread API. So, we can safely assume that it's lockedExt state will no longer be used. For the case of the main thread where it just gets wedged instead of exiting, it's probably better for it to keep the locked marker since it more accurately represents its state. Fixed #28979. Change-Id: I7d3d71dd65bcb873e9758086d2cbcb9a06429b0f Reviewed-on: https://go-review.googlesource.com/c/153078 Run-TryBot: Michael Knyszek Reviewed-by: Austin Clements --- src/runtime/proc.go | 5 +- src/runtime/proc_test.go | 6 ++ src/runtime/testdata/testprog/gettid.go | 29 ------ src/runtime/testdata/testprog/lockosthread.go | 99 +++++++++++++++++++ src/runtime/testdata/testprog/syscalls.go | 54 ++++++++++ .../{gettid_none.go => syscalls_none.go} | 12 +++ 6 files changed, 175 insertions(+), 30 deletions(-) delete mode 100644 src/runtime/testdata/testprog/gettid.go create mode 100644 src/runtime/testdata/testprog/syscalls.go rename src/runtime/testdata/testprog/{gettid_none.go => syscalls_none.go} (68%) diff --git a/src/runtime/proc.go b/src/runtime/proc.go index fc77a964b6e3f..bdf73e041204b 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -2703,7 +2703,6 @@ func goexit0(gp *g) { print("invalid m->lockedInt = ", _g_.m.lockedInt, "\n") throw("internal lockOSThread error") } - _g_.m.lockedExt = 0 gfput(_g_.m.p.ptr(), gp) if locked { // The goroutine may have locked this thread because @@ -2714,6 +2713,10 @@ func goexit0(gp *g) { // the thread. if GOOS != "plan9" { // See golang.org/issue/22227. gogo(&_g_.m.g0.sched) + } else { + // Clear lockedExt on plan9 since we may end up re-using + // this thread. + _g_.m.lockedExt = 0 } } schedule() diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index ad325987ac4d1..e6947d584945e 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -885,6 +885,12 @@ func TestLockOSThreadNesting(t *testing.T) { func TestLockOSThreadExit(t *testing.T) { testLockOSThreadExit(t, "testprog") + + want := "OK\n" + output := runTestProg(t, "testprog", "LockOSThreadAvoidsStatePropagation", "GOMAXPROCS=1") + if output != want { + t.Errorf("want %s, got %s\n", want, output) + } } func testLockOSThreadExit(t *testing.T, prog string) { diff --git a/src/runtime/testdata/testprog/gettid.go b/src/runtime/testdata/testprog/gettid.go deleted file mode 100644 index 1b3e29ab08e5f..0000000000000 --- a/src/runtime/testdata/testprog/gettid.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux - -package main - -import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "syscall" -) - -func gettid() int { - return syscall.Gettid() -} - -func tidExists(tid int) (exists, supported bool) { - stat, err := ioutil.ReadFile(fmt.Sprintf("/proc/self/task/%d/stat", tid)) - if os.IsNotExist(err) { - return false, true - } - // Check if it's a zombie thread. - state := bytes.Fields(stat)[2] - return !(len(state) == 1 && state[0] == 'Z'), true -} diff --git a/src/runtime/testdata/testprog/lockosthread.go b/src/runtime/testdata/testprog/lockosthread.go index 88c0d12e4c11b..5119cf8131a03 100644 --- a/src/runtime/testdata/testprog/lockosthread.go +++ b/src/runtime/testdata/testprog/lockosthread.go @@ -24,6 +24,12 @@ func init() { runtime.LockOSThread() }) register("LockOSThreadAlt", LockOSThreadAlt) + + registerInit("LockOSThreadAvoidsStatePropagation", func() { + // Lock the OS thread now so main runs on the main thread. + runtime.LockOSThread() + }) + register("LockOSThreadAvoidsStatePropagation", LockOSThreadAvoidsStatePropagation) } func LockOSThreadMain() { @@ -92,3 +98,96 @@ func LockOSThreadAlt() { ok: println("OK") } + +func LockOSThreadAvoidsStatePropagation() { + // This test is similar to LockOSThreadAlt in that it will detect if a thread + // which should have died is still running. However, rather than do this with + // thread IDs, it does this by unsharing state on that thread. This way, it + // also detects whether new threads were cloned from the dead thread, and not + // from a clean thread. Cloning from a locked thread is undesirable since + // cloned threads will inherit potentially unwanted OS state. + // + // unshareFs, getcwd, and chdir("/tmp") are only guaranteed to work on + // Linux, so on other platforms this just checks that the runtime doesn't + // do anything terrible. + // + // This is running locked to the main OS thread. + + // GOMAXPROCS=1 makes this fail much more reliably if a tainted thread is + // cloned from. + if runtime.GOMAXPROCS(-1) != 1 { + println("requires GOMAXPROCS=1") + os.Exit(1) + } + + if err := chdir("/"); err != nil { + println("failed to chdir:", err.Error()) + os.Exit(1) + } + // On systems other than Linux, cwd == "". + cwd, err := getcwd() + if err != nil { + println("failed to get cwd:", err.Error()) + os.Exit(1) + } + if cwd != "" && cwd != "/" { + println("unexpected cwd", cwd, " wanted /") + os.Exit(1) + } + + ready := make(chan bool, 1) + go func() { + // This goroutine must be running on a new thread. + runtime.LockOSThread() + + // Unshare details about the FS, like the CWD, with + // the rest of the process on this thread. + // On systems other than Linux, this is a no-op. + if err := unshareFs(); err != nil { + println("failed to unshare fs:", err.Error()) + os.Exit(1) + } + // Chdir to somewhere else on this thread. + // On systems other than Linux, this is a no-op. + if err := chdir("/tmp"); err != nil { + println("failed to chdir:", err.Error()) + os.Exit(1) + } + + // The state on this thread is now considered "tainted", but it + // should no longer be observable in any other context. + + ready <- true + // Exit with the thread locked. + }() + <-ready + + // Spawn yet another goroutine and lock it. Since GOMAXPROCS=1, if + // for some reason state from the (hopefully dead) locked thread above + // propagated into a newly created thread (via clone), or that thread + // is actually being re-used, then we should get scheduled on such a + // thread with high likelihood. + done := make(chan bool) + go func() { + runtime.LockOSThread() + + // Get the CWD and check if this is the same as the main thread's + // CWD. Every thread should share the same CWD. + // On systems other than Linux, wd == "". + wd, err := getcwd() + if err != nil { + println("failed to get cwd:", err.Error()) + os.Exit(1) + } + if wd != cwd { + println("bad state from old thread propagated after it should have died") + os.Exit(1) + } + <-done + + runtime.UnlockOSThread() + }() + done <- true + runtime.UnlockOSThread() + println("OK") +} diff --git a/src/runtime/testdata/testprog/syscalls.go b/src/runtime/testdata/testprog/syscalls.go new file mode 100644 index 0000000000000..08284fc561548 --- /dev/null +++ b/src/runtime/testdata/testprog/syscalls.go @@ -0,0 +1,54 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux + +package main + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "syscall" +) + +func gettid() int { + return syscall.Gettid() +} + +func tidExists(tid int) (exists, supported bool) { + stat, err := ioutil.ReadFile(fmt.Sprintf("/proc/self/task/%d/stat", tid)) + if os.IsNotExist(err) { + return false, true + } + // Check if it's a zombie thread. + state := bytes.Fields(stat)[2] + return !(len(state) == 1 && state[0] == 'Z'), true +} + +func getcwd() (string, error) { + if !syscall.ImplementsGetwd { + return "", nil + } + // Use the syscall to get the current working directory. + // This is imperative for checking for OS thread state + // after an unshare since os.Getwd might just check the + // environment, or use some other mechanism. + var buf [4096]byte + n, err := syscall.Getcwd(buf[:]) + if err != nil { + return "", err + } + // Subtract one for null terminator. + return string(buf[:n-1]), nil +} + +func unshareFs() error { + return syscall.Unshare(syscall.CLONE_FS) +} + +func chdir(path string) error { + return syscall.Chdir(path) +} diff --git a/src/runtime/testdata/testprog/gettid_none.go b/src/runtime/testdata/testprog/syscalls_none.go similarity index 68% rename from src/runtime/testdata/testprog/gettid_none.go rename to src/runtime/testdata/testprog/syscalls_none.go index 036db87e10ea6..7f8ded3994f18 100644 --- a/src/runtime/testdata/testprog/gettid_none.go +++ b/src/runtime/testdata/testprog/syscalls_none.go @@ -13,3 +13,15 @@ func gettid() int { func tidExists(tid int) (exists, supported bool) { return false, false } + +func getcwd() (string, error) { + return "", nil +} + +func unshareFs() error { + return nil +} + +func chdir(path string) error { + return nil +} From 84066f1b0b68761a75ce9064f4c412f751ee2168 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Tue, 18 Dec 2018 16:41:57 -0800 Subject: [PATCH 406/594] runtime: use QPC to implement cputicks() on windows/arm Tracing uses cputicks() to generate trace event timestamps. cputicks() is expected to be a high resolution clock source. On Windows/ARM, call QueryPerformanceCounter() which is the highest resolution clock source available. Updates #26148 Change-Id: I987fa556060b3d60c02f07b87b9e6320b9b026e2 Reviewed-on: https://go-review.googlesource.com/c/154762 Reviewed-by: Brad Fitzpatrick Reviewed-by: Austin Clements Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/runtime/os_windows.go | 7 +++++++ src/runtime/os_windows_arm.go | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/runtime/os_windows.go b/src/runtime/os_windows.go index 9b34589874c54..2e1ec58a0d9be 100644 --- a/src/runtime/os_windows.go +++ b/src/runtime/os_windows.go @@ -198,6 +198,13 @@ func loadOptionalSyscalls() { } _NtWaitForSingleObject = windowsFindfunc(n32, []byte("NtWaitForSingleObject\000")) + if GOARCH == "arm" { + _QueryPerformanceCounter = windowsFindfunc(k32, []byte("QueryPerformanceCounter\000")) + if _QueryPerformanceCounter == nil { + throw("could not find QPC syscalls") + } + } + if windowsFindfunc(n32, []byte("wine_get_version\000")) != nil { // running on Wine initWine(k32) diff --git a/src/runtime/os_windows_arm.go b/src/runtime/os_windows_arm.go index 3115f7241dbeb..10aff75e31191 100644 --- a/src/runtime/os_windows_arm.go +++ b/src/runtime/os_windows_arm.go @@ -4,9 +4,13 @@ package runtime +import "unsafe" + //go:nosplit func cputicks() int64 { - return nanotime() + var counter int64 + stdcall1(_QueryPerformanceCounter, uintptr(unsafe.Pointer(&counter))) + return counter } func checkgoarm() { From 7e1ec1e9ccaaf52888799a10e1dfed2805ff4650 Mon Sep 17 00:00:00 2001 From: catatsuy Date: Thu, 20 Dec 2018 12:36:27 +0900 Subject: [PATCH 407/594] net/http: fix the old url about deflate Change-Id: Iaa1468296fbc98389165a152cf8b591216c22489 Reviewed-on: https://go-review.googlesource.com/c/155217 Reviewed-by: Brad Fitzpatrick --- src/net/http/transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/http/transport.go b/src/net/http/transport.go index f30ad2151c494..44d27d05c2f1d 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -2116,7 +2116,7 @@ func (pc *persistConn) roundTrip(req *transportRequest) (resp *Response, err err req.Method != "HEAD" { // Request gzip only, not deflate. Deflate is ambiguous and // not as universally supported anyway. - // See: http://www.gzip.org/zlib/zlib_faq.html#faq38 + // See: https://zlib.net/zlib_faq.html#faq39 // // Note that we don't request this for HEAD requests, // due to a bug in nginx: From 49abcf1a974fb452e345cb696216bf47a97dc3e2 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Mon, 17 Dec 2018 20:39:48 +1100 Subject: [PATCH 408/594] os: adjust TempDir for Z:\ If TMP environment variable is set to Z:\, TempDir returns Z:. But Z: refers to current directory on Z:, while Z:\ refers to root directory on Z:. Adjust TempDir to return Z:\. Fixes #29291 Change-Id: If04d0c7977a8ac2d9d558307502e81beb68776ef Reviewed-on: https://go-review.googlesource.com/c/154384 Run-TryBot: Alex Brainman Reviewed-by: Brad Fitzpatrick --- src/os/file_windows.go | 5 ++++- src/os/os_windows_test.go | 44 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/os/file_windows.go b/src/os/file_windows.go index 7ed4fe2f389d9..85f248774c77e 100644 --- a/src/os/file_windows.go +++ b/src/os/file_windows.go @@ -325,7 +325,10 @@ func tempDir() string { if n > uint32(len(b)) { continue } - if n > 0 && b[n-1] == '\\' { + if n == 3 && b[1] == ':' && b[2] == '\\' { + // Do nothing for path, like C:\. + } else if n > 0 && b[n-1] == '\\' { + // Otherwise remove terminating \. n-- } return string(utf16.Decode(b[:n])) diff --git a/src/os/os_windows_test.go b/src/os/os_windows_test.go index c5553694880ee..1023b25e22584 100644 --- a/src/os/os_windows_test.go +++ b/src/os/os_windows_test.go @@ -5,6 +5,7 @@ package os_test import ( + "errors" "fmt" "internal/poll" "internal/syscall/windows" @@ -1003,3 +1004,46 @@ func TestStatOfInvalidName(t *testing.T) { t.Fatal(`os.Stat("*.go") unexpectedly succeeded`) } } + +// findUnusedDriveLetter searches mounted drive list on the system +// (starting from Z: and ending at D:) for unused drive letter. +// It returns path to the found drive root directory (like Z:\) or error. +func findUnusedDriveLetter() (string, error) { + // Do not use A: and B:, because they are reserved for floppy drive. + // Do not use C:, becasue it is normally used for main drive. + for l := 'Z'; l >= 'D'; l-- { + p := string(l) + `:\` + _, err := os.Stat(p) + if os.IsNotExist(err) { + return p, nil + } + } + return "", errors.New("Could not find unused drive letter.") +} + +func TestRootDirAsTemp(t *testing.T) { + testenv.MustHaveExec(t) + + if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" { + fmt.Print(os.TempDir()) + os.Exit(0) + } + + newtmp, err := findUnusedDriveLetter() + if err != nil { + t.Fatal(err) + } + + cmd := osexec.Command(os.Args[0], "-test.run=TestRootDirAsTemp") + cmd.Env = os.Environ() + cmd.Env = append(cmd.Env, "GO_WANT_HELPER_PROCESS=1") + cmd.Env = append(cmd.Env, "TMP="+newtmp) + cmd.Env = append(cmd.Env, "TEMP="+newtmp) + output, err := cmd.CombinedOutput() + if err != nil { + t.Fatalf("Failed to spawn child process: %v %q", err, string(output)) + } + if want, have := newtmp, string(output); have != want { + t.Fatalf("unexpected child process output %q, want %q", have, want) + } +} From 0dd88cd54d3f247934a75610fbbb7ade67243e15 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 18 Dec 2018 15:10:38 -0800 Subject: [PATCH 409/594] net: don't accept timeouts in TestUDPZeroBytePayload Before this CL we accepted timeouts in TestUDPZeroBytePayload to avoid flakiness and because, according to CL 9194, the test didn't work on some platforms. On Windows, before CL 132781, the read would always timeout, and so since the test accepted timeouts it would pass incorrectly. CL 132781 fixed Windows, and changed the test to not accept timeouts in the ReadFrom case. However, the timeout was short, and so on a loaded system the Read might timeout not due to an error in the code, but just because the read was not delivered. So ignoring timeouts made the test flaky, as reported in issue #29225. This CL tries to get to a better state by increasing the timeout to a large value and not permitting timeouts at all. If there are systems where the test fails, we will need to explicitly skip the test on those systems. Fixes #29225 Change-Id: I26863369898a69cac866b34fcb5b6ffbffab31f6 Reviewed-on: https://go-review.googlesource.com/c/154759 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Alex Brainman Reviewed-by: Brad Fitzpatrick --- src/net/udpsock_test.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/net/udpsock_test.go b/src/net/udpsock_test.go index 1f06397ffa38a..c5a2439d6cd49 100644 --- a/src/net/udpsock_test.go +++ b/src/net/udpsock_test.go @@ -353,21 +353,18 @@ func TestUDPZeroBytePayload(t *testing.T) { if n != 0 { t.Errorf("got %d; want 0", n) } - c.SetReadDeadline(time.Now().Add(100 * time.Millisecond)) + c.SetReadDeadline(time.Now().Add(30 * time.Second)) var b [1]byte + var name string if genericRead { _, err = c.(Conn).Read(b[:]) - // Read may timeout, it depends on the platform. - if err != nil { - if nerr, ok := err.(Error); !ok || !nerr.Timeout() { - t.Fatal(err) - } - } + name = "Read" } else { _, _, err = c.ReadFrom(b[:]) - if err != nil { - t.Fatal(err) - } + name = "ReadFrom" + } + if err != nil { + t.Errorf("%s of zero byte packet failed: %v", name, err) } } } From b17d5449769622edf1cb27f7ea803c90f3cd477f Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 20 Dec 2018 10:56:47 +0100 Subject: [PATCH 410/594] cmd/vendor: update vendored golang.org/x/sys/windows Update to x/sys git revision 074acd46bca67915925527c07849494d115e7c43 This fixes TestFormatMessage and TestExample on windows/arm by pulling in CL 154560 and CL 154817. Change-Id: Ic6495fe3072b5bcc7ea68efb3f0be5fc1fe4c238 Reviewed-on: https://go-review.googlesource.com/c/155297 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Alex Brainman Reviewed-by: Ian Lance Taylor --- .../golang.org/x/sys/windows/svc/svc_test.go | 8 ++--- .../x/sys/windows/syscall_windows_test.go | 29 +++---------------- src/cmd/vendor/vendor.json | 12 ++++---- 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/src/cmd/vendor/golang.org/x/sys/windows/svc/svc_test.go b/src/cmd/vendor/golang.org/x/sys/windows/svc/svc_test.go index 60eb4478e4093..feed8fabde676 100644 --- a/src/cmd/vendor/golang.org/x/sys/windows/svc/svc_test.go +++ b/src/cmd/vendor/golang.org/x/sys/windows/svc/svc_test.go @@ -121,13 +121,9 @@ func TestExample(t *testing.T) { t.Fatalf("Delete failed: %s", err) } - cmd := `Get-Eventlog -LogName Application -Newest 100` + - ` | Where Source -eq "myservice"` + - ` | Select -first 10` + - ` | Format-table -HideTableHeaders -property ReplacementStrings` - out, err := exec.Command("powershell", "-Command", cmd).CombinedOutput() + out, err := exec.Command("wevtutil.exe", "qe", "Application", "/q:*[System[Provider[@Name='myservice']]]", "/rd:true", "/c:10").CombinedOutput() if err != nil { - t.Fatalf("powershell failed: %v\n%v", err, string(out)) + t.Fatalf("wevtutil failed: %v\n%v", err, string(out)) } if want := strings.Join(append([]string{name}, args...), "-"); !strings.Contains(string(out), want) { t.Errorf("%q string does not contain %q", string(out), want) diff --git a/src/cmd/vendor/golang.org/x/sys/windows/syscall_windows_test.go b/src/cmd/vendor/golang.org/x/sys/windows/syscall_windows_test.go index 0e27464e8c4c1..539dda2413ec2 100644 --- a/src/cmd/vendor/golang.org/x/sys/windows/syscall_windows_test.go +++ b/src/cmd/vendor/golang.org/x/sys/windows/syscall_windows_test.go @@ -10,7 +10,6 @@ import ( "path/filepath" "syscall" "testing" - "unsafe" "golang.org/x/sys/windows" ) @@ -54,34 +53,14 @@ func TestWin32finddata(t *testing.T) { } func TestFormatMessage(t *testing.T) { - dll := windows.MustLoadDLL("pdh.dll") - - pdhOpenQuery := func(datasrc *uint16, userdata uint32, query *windows.Handle) (errno uintptr) { - r0, _, _ := syscall.Syscall(dll.MustFindProc("PdhOpenQueryW").Addr(), 3, uintptr(unsafe.Pointer(datasrc)), uintptr(userdata), uintptr(unsafe.Pointer(query))) - return r0 - } - - pdhCloseQuery := func(query windows.Handle) (errno uintptr) { - r0, _, _ := syscall.Syscall(dll.MustFindProc("PdhCloseQuery").Addr(), 1, uintptr(query), 0, 0) - return r0 - } - - var q windows.Handle - name, err := windows.UTF16PtrFromString("no_such_source") - if err != nil { - t.Fatal(err) - } - errno := pdhOpenQuery(name, 0, &q) - if errno == 0 { - pdhCloseQuery(q) - t.Fatal("PdhOpenQuery succeeded, but expected to fail.") - } + dll := windows.MustLoadDLL("netevent.dll") + const TITLE_SC_MESSAGE_BOX uint32 = 0xC0001B75 const flags uint32 = syscall.FORMAT_MESSAGE_FROM_HMODULE | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS buf := make([]uint16, 300) - _, err = windows.FormatMessage(flags, uintptr(dll.Handle), uint32(errno), 0, buf, nil) + _, err := windows.FormatMessage(flags, uintptr(dll.Handle), TITLE_SC_MESSAGE_BOX, 0, buf, nil) if err != nil { - t.Fatalf("FormatMessage for handle=%x and errno=%x failed: %v", dll.Handle, errno, err) + t.Fatalf("FormatMessage for handle=%x and errno=%x failed: %v", dll.Handle, TITLE_SC_MESSAGE_BOX, err) } } diff --git a/src/cmd/vendor/vendor.json b/src/cmd/vendor/vendor.json index 1dcf16d5a9579..b44f022457098 100644 --- a/src/cmd/vendor/vendor.json +++ b/src/cmd/vendor/vendor.json @@ -137,10 +137,10 @@ "revisionTime": "2018-12-13T07:38:38Z" }, { - "checksumSHA1": "s+lofQ+SCdhmy0cQp9FpdQncuuI=", + "checksumSHA1": "WoSat9PbqZFXREek5bkUBr256/Q=", "path": "golang.org/x/sys/windows", - "revision": "90868a75fefd03942536221d7c0e2f84ec62a668", - "revisionTime": "2018-08-01T20:46:00Z" + "revision": "074acd46bca67915925527c07849494d115e7c43", + "revisionTime": "2018-12-18T18:24:21Z" }, { "checksumSHA1": "yEg3f1MGwuyDh5NrNEGkWKlTyqY=", @@ -149,10 +149,10 @@ "revisionTime": "2018-08-01T20:46:00Z" }, { - "checksumSHA1": "ZDwqsuoZqQq/XMQ0R0dJ4oK41lU=", + "checksumSHA1": "sL1Y17u+ri3uepsUZOZ4uopiPEg=", "path": "golang.org/x/sys/windows/svc", - "revision": "90868a75fefd03942536221d7c0e2f84ec62a668", - "revisionTime": "2018-08-01T20:46:00Z" + "revision": "074acd46bca67915925527c07849494d115e7c43", + "revisionTime": "2018-12-18T18:24:21Z" }, { "checksumSHA1": "e9KJPWrdqg5PMkbE2w60Io8rY4M=", From 4422319fbf8db7700752ae2a755244bbd24672de Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 20 Dec 2018 09:38:37 +0100 Subject: [PATCH 411/594] doc/go1.12: fix GOARCH value in Syscall18 link Currently the link works also with the non-existing GOARCH armd64, but let's correct in anyhow. Change-Id: Ida647b8f9dd2f8460b019f5a23759f10a6da8e60 Reviewed-on: https://go-review.googlesource.com/c/155277 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 0aee382aebb1a..356f678cbdab8 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -738,7 +738,7 @@

    Minor changes to the library

    - The new function Syscall18 + The new function Syscall18 has been introduced for Windows, allowing for calls with up to 18 arguments.

    From 443990742ec6dd128fab41d4afaa8668e665eadd Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Thu, 13 Dec 2018 09:31:21 -0800 Subject: [PATCH 412/594] cmd/compile: ignore out-of-bounds reads from readonly constants Out-of-bounds reads of globals can happen in dead code. For code like this: s := "a" if len(s) == 3 { load s[0], s[1], and s[2] } The out-of-bounds loads are dead code, but aren't removed yet when lowering. We need to not panic when compile-time evaluating those loads. This can only happen for dead code, so the result doesn't matter. Fixes #29215 Change-Id: I7fb765766328b9524c6f2a1e6ab8d8edd9875097 Reviewed-on: https://go-review.googlesource.com/c/154057 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Alberto Donizetti --- src/cmd/compile/internal/ssa/rewrite.go | 16 ++++++++++++++++ test/fixedbugs/issue29215.go | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/fixedbugs/issue29215.go diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index 1fd335b3e7f0c..69365c4e6066b 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -1137,12 +1137,22 @@ func symIsRO(sym interface{}) bool { // read8 reads one byte from the read-only global sym at offset off. func read8(sym interface{}, off int64) uint8 { lsym := sym.(*obj.LSym) + if off >= int64(len(lsym.P)) { + // Invalid index into the global sym. + // This can happen in dead code, so we don't want to panic. + // Just return any value, it will eventually get ignored. + // See issue 29215. + return 0 + } return lsym.P[off] } // read16 reads two bytes from the read-only global sym at offset off. func read16(sym interface{}, off int64, bigEndian bool) uint16 { lsym := sym.(*obj.LSym) + if off >= int64(len(lsym.P))-1 { + return 0 + } if bigEndian { return binary.BigEndian.Uint16(lsym.P[off:]) } else { @@ -1153,6 +1163,9 @@ func read16(sym interface{}, off int64, bigEndian bool) uint16 { // read32 reads four bytes from the read-only global sym at offset off. func read32(sym interface{}, off int64, bigEndian bool) uint32 { lsym := sym.(*obj.LSym) + if off >= int64(len(lsym.P))-3 { + return 0 + } if bigEndian { return binary.BigEndian.Uint32(lsym.P[off:]) } else { @@ -1163,6 +1176,9 @@ func read32(sym interface{}, off int64, bigEndian bool) uint32 { // read64 reads eight bytes from the read-only global sym at offset off. func read64(sym interface{}, off int64, bigEndian bool) uint64 { lsym := sym.(*obj.LSym) + if off >= int64(len(lsym.P))-7 { + return 0 + } if bigEndian { return binary.BigEndian.Uint64(lsym.P[off:]) } else { diff --git a/test/fixedbugs/issue29215.go b/test/fixedbugs/issue29215.go new file mode 100644 index 0000000000000..df703aa25d7e8 --- /dev/null +++ b/test/fixedbugs/issue29215.go @@ -0,0 +1,18 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func f() { + var s string + var p, q bool + s = "a" + for p { + p = false == (true != q) + s = "" + } + _ = s == "bbb" +} From 745273f739fc63a5a4089d81c85f33edca58f0e9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Dec 2018 17:49:11 -0800 Subject: [PATCH 413/594] os: clarify O_TRUNC comment Fixes #28699 Change-Id: Ic340c3171bb7d91d8cb9553967c2b51e7d9daba8 Reviewed-on: https://go-review.googlesource.com/c/155177 Reviewed-by: Bryan C. Mills --- src/os/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/file.go b/src/os/file.go index 9b7863e9b6b84..228777c67772f 100644 --- a/src/os/file.go +++ b/src/os/file.go @@ -73,7 +73,7 @@ const ( O_CREATE int = syscall.O_CREAT // create a new file if none exists. O_EXCL int = syscall.O_EXCL // used with O_CREATE, file must not exist. O_SYNC int = syscall.O_SYNC // open for synchronous I/O. - O_TRUNC int = syscall.O_TRUNC // if possible, truncate file when opened. + O_TRUNC int = syscall.O_TRUNC // truncate regular writable file when opened. ) // Seek whence values. From 1e708337b21c43c14d3ac46dd29181a4af0548da Mon Sep 17 00:00:00 2001 From: Osamu TONOMORI Date: Thu, 20 Dec 2018 22:39:01 +0900 Subject: [PATCH 414/594] compress/flate: fix the old url for the flate algorithm Change-Id: I84b74bc96516033bbf4a01f9aa81fe60d5a41355 Reviewed-on: https://go-review.googlesource.com/c/155317 Reviewed-by: Matthew Dempsky Reviewed-by: Brad Fitzpatrick --- src/compress/flate/inflate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compress/flate/inflate.go b/src/compress/flate/inflate.go index 685be70a3e38f..49921398e2ba9 100644 --- a/src/compress/flate/inflate.go +++ b/src/compress/flate/inflate.go @@ -89,7 +89,7 @@ type Resetter interface { // number of bits. // // See the following: -// http://www.gzip.org/algorithm.txt +// https://github.com/madler/zlib/raw/master/doc/algorithm.txt // chunk & 15 is number of bits // chunk >> 4 is value, including table link From 6a5c5f848606f8a63ed65e0203a8fade0a75c12d Mon Sep 17 00:00:00 2001 From: Brian Kessler Date: Thu, 20 Dec 2018 11:16:23 -0700 Subject: [PATCH 415/594] doc/go1.12: correct types for math/bits Extended precision math/bits functions are unsigned. Change-Id: Ic1633e9c367fc3d5a80bc503008f035db4e78945 Reviewed-on: https://go-review.googlesource.com/c/155379 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 356f678cbdab8..7f5847c58b503 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -547,7 +547,7 @@

    Minor changes to the library

    math/bits

    - New extended precision operations Add, Sub, Mul, and Div are available in int, int32, and int64 versions. + New extended precision operations Add, Sub, Mul, and Div are available in uint, uint32, and uint64 versions.

    From 8ff04a9966083f982ecaa57f7bcc786aa7316ec8 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Tue, 25 Sep 2018 09:22:09 -0700 Subject: [PATCH 416/594] os: clearer doc for Interrupt I was confused by the juxtaposition of os.Interrupt docs, which are "guaranteed to exist on all platforms" in one sentence and then "not implemented" in the next sentence. Reading the code reveals "not implemented" refers specifically to the implementation of os.Process.Signal on Windows, not to the os.Interrupt variable itself. Reword the doc to make this distinction clearer. Fixes #27854. Change-Id: I5fe7cddea61fa1954cef2006dc51b8fa8ece4d6e Reviewed-on: https://go-review.googlesource.com/c/137336 Reviewed-by: Alex Brainman --- src/os/exec_posix.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/os/exec_posix.go b/src/os/exec_posix.go index 1e60365dba4de..4c8261295c009 100644 --- a/src/os/exec_posix.go +++ b/src/os/exec_posix.go @@ -10,10 +10,11 @@ import ( "syscall" ) -// The only signal values guaranteed to be present in the os package -// on all systems are Interrupt (send the process an interrupt) and -// Kill (force the process to exit). Interrupt is not implemented on -// Windows; using it with os.Process.Signal will return an error. +// The only signal values guaranteed to be present in the os package on all +// systems are os.Interrupt (send the process an interrupt) and os.Kill (force +// the process to exit). On Windows, sending os.Interrupt to a process with +// os.Process.Signal is not implemented; it will return an error instead of +// sending a signal. var ( Interrupt Signal = syscall.SIGINT Kill Signal = syscall.SIGKILL From 706b54bb85df2eb9a21da9e049fd1dff77342d25 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 20 Dec 2018 11:10:06 -0800 Subject: [PATCH 417/594] cmd/compile: fix ICE due to bad rune width It was possible that var X interface{} = 'x' could cause a compilation failure due to having not calculated rune's width yet. typecheck.go normally calculates the width of things, but it doesn't for implicit conversions to default type. We already compute the width of all of the standard numeric types in universe.go, but we failed to calculate it for the rune alias type. So we could later crash if the code never otherwise explicitly mentioned 'rune'. While here, explicitly compute widths for 'byte' and 'error' for consistency. Fixes #29350. Change-Id: Ifedd4899527c983ee5258dcf75aaf635b6f812f8 Reviewed-on: https://go-review.googlesource.com/c/155380 Reviewed-by: Josh Bleecher Snyder Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/universe.go | 3 +++ test/fixedbugs/issue29350.go | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/fixedbugs/issue29350.go diff --git a/src/cmd/compile/internal/gc/universe.go b/src/cmd/compile/internal/gc/universe.go index 745ce66bba240..104c6bab23d32 100644 --- a/src/cmd/compile/internal/gc/universe.go +++ b/src/cmd/compile/internal/gc/universe.go @@ -386,6 +386,7 @@ func lexinit1() { types.Errortype.Sym = s types.Errortype.Orig = makeErrorInterface() s.Def = asTypesNode(typenod(types.Errortype)) + dowidth(types.Errortype) // We create separate byte and rune types for better error messages // rather than just creating type alias *types.Sym's for the uint8 and @@ -401,6 +402,7 @@ func lexinit1() { types.Bytetype.Sym = s s.Def = asTypesNode(typenod(types.Bytetype)) asNode(s.Def).Name = new(Name) + dowidth(types.Bytetype) // rune alias s = builtinpkg.Lookup("rune") @@ -408,6 +410,7 @@ func lexinit1() { types.Runetype.Sym = s s.Def = asTypesNode(typenod(types.Runetype)) asNode(s.Def).Name = new(Name) + dowidth(types.Runetype) // backend-dependent builtin types (e.g. int). for _, s := range typedefs { diff --git a/test/fixedbugs/issue29350.go b/test/fixedbugs/issue29350.go new file mode 100644 index 0000000000000..9d59f6f6c0f10 --- /dev/null +++ b/test/fixedbugs/issue29350.go @@ -0,0 +1,9 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package p + +var X interface{} = 'x' From 90dca98d33055b8365d9e7e40ebb4ca478daf77e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Dec 2018 07:08:38 -0800 Subject: [PATCH 418/594] doc: clarify change to File.Sync on macOS Updates #26650 Change-Id: I0ec070127dcacc7fc68dd5baf125eb762e1ea846 Reviewed-on: https://go-review.googlesource.com/c/155038 Reviewed-by: Bryan C. Mills --- doc/go1.12.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 7f5847c58b503..1a0127d88f5fd 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -640,7 +640,8 @@

    Minor changes to the library

    File.Sync now uses F_FULLFSYNC on macOS - to properly flush content to permanent storage. Note that this might have a negative performance impact. + to correctly flush the file contents to permanent storage. + This may cause the method to run more slowly than in previous releases.

    From 429bae715876c69853bb63db1733f580e293c916 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Thu, 20 Dec 2018 20:21:45 +0000 Subject: [PATCH 419/594] runtime: skip TestLockOSThreadAvoidsStatePropagation if one can't unshare This change splits a testprog out of TestLockOSThreadExit and makes it its own test. Then, this change makes the testprog exit prematurely with a special message if unshare fails with EPERM because not all of the builders allow the user to call the unshare syscall. Also, do some minor cleanup on the TestLockOSThread* tests. Fixes #29366. Change-Id: Id8a9f6c4b16e26af92ed2916b90b0249ba226dbe Reviewed-on: https://go-review.googlesource.com/c/155437 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/runtime/proc_test.go | 21 ++++--- src/runtime/testdata/testprog/lockosthread.go | 4 ++ src/runtime/testdata/testprog/syscalls.go | 47 +-------------- .../testdata/testprog/syscalls_linux.go | 59 +++++++++++++++++++ 4 files changed, 78 insertions(+), 53 deletions(-) create mode 100644 src/runtime/testdata/testprog/syscalls_linux.go diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index e6947d584945e..1715324aa09d2 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -885,23 +885,28 @@ func TestLockOSThreadNesting(t *testing.T) { func TestLockOSThreadExit(t *testing.T) { testLockOSThreadExit(t, "testprog") - - want := "OK\n" - output := runTestProg(t, "testprog", "LockOSThreadAvoidsStatePropagation", "GOMAXPROCS=1") - if output != want { - t.Errorf("want %s, got %s\n", want, output) - } } func testLockOSThreadExit(t *testing.T, prog string) { output := runTestProg(t, prog, "LockOSThreadMain", "GOMAXPROCS=1") want := "OK\n" if output != want { - t.Errorf("want %s, got %s\n", want, output) + t.Errorf("want %q, got %q", want, output) } output = runTestProg(t, prog, "LockOSThreadAlt") if output != want { - t.Errorf("want %s, got %s\n", want, output) + t.Errorf("want %q, got %q", want, output) + } +} + +func TestLockOSThreadAvoidsStatePropagation(t *testing.T) { + want := "OK\n" + skip := "unshare not permitted\n" + output := runTestProg(t, "testprog", "LockOSThreadAvoidsStatePropagation", "GOMAXPROCS=1") + if output == skip { + t.Skip("unshare syscall not permitted on this system") + } else if output != want { + t.Errorf("want %q, got %q", want, output) } } diff --git a/src/runtime/testdata/testprog/lockosthread.go b/src/runtime/testdata/testprog/lockosthread.go index 5119cf8131a03..fd3123e64743f 100644 --- a/src/runtime/testdata/testprog/lockosthread.go +++ b/src/runtime/testdata/testprog/lockosthread.go @@ -144,6 +144,10 @@ func LockOSThreadAvoidsStatePropagation() { // the rest of the process on this thread. // On systems other than Linux, this is a no-op. if err := unshareFs(); err != nil { + if err == errNotPermitted { + println("unshare not permitted") + os.Exit(0) + } println("failed to unshare fs:", err.Error()) os.Exit(1) } diff --git a/src/runtime/testdata/testprog/syscalls.go b/src/runtime/testdata/testprog/syscalls.go index 08284fc561548..098d5cadf8a48 100644 --- a/src/runtime/testdata/testprog/syscalls.go +++ b/src/runtime/testdata/testprog/syscalls.go @@ -2,53 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build linux - package main import ( - "bytes" - "fmt" - "io/ioutil" - "os" - "syscall" + "errors" ) -func gettid() int { - return syscall.Gettid() -} - -func tidExists(tid int) (exists, supported bool) { - stat, err := ioutil.ReadFile(fmt.Sprintf("/proc/self/task/%d/stat", tid)) - if os.IsNotExist(err) { - return false, true - } - // Check if it's a zombie thread. - state := bytes.Fields(stat)[2] - return !(len(state) == 1 && state[0] == 'Z'), true -} - -func getcwd() (string, error) { - if !syscall.ImplementsGetwd { - return "", nil - } - // Use the syscall to get the current working directory. - // This is imperative for checking for OS thread state - // after an unshare since os.Getwd might just check the - // environment, or use some other mechanism. - var buf [4096]byte - n, err := syscall.Getcwd(buf[:]) - if err != nil { - return "", err - } - // Subtract one for null terminator. - return string(buf[:n-1]), nil -} - -func unshareFs() error { - return syscall.Unshare(syscall.CLONE_FS) -} - -func chdir(path string) error { - return syscall.Chdir(path) -} +var errNotPermitted = errors.New("operation not permitted") diff --git a/src/runtime/testdata/testprog/syscalls_linux.go b/src/runtime/testdata/testprog/syscalls_linux.go new file mode 100644 index 0000000000000..b8ac0876269d3 --- /dev/null +++ b/src/runtime/testdata/testprog/syscalls_linux.go @@ -0,0 +1,59 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "syscall" +) + +func gettid() int { + return syscall.Gettid() +} + +func tidExists(tid int) (exists, supported bool) { + stat, err := ioutil.ReadFile(fmt.Sprintf("/proc/self/task/%d/stat", tid)) + if os.IsNotExist(err) { + return false, true + } + // Check if it's a zombie thread. + state := bytes.Fields(stat)[2] + return !(len(state) == 1 && state[0] == 'Z'), true +} + +func getcwd() (string, error) { + if !syscall.ImplementsGetwd { + return "", nil + } + // Use the syscall to get the current working directory. + // This is imperative for checking for OS thread state + // after an unshare since os.Getwd might just check the + // environment, or use some other mechanism. + var buf [4096]byte + n, err := syscall.Getcwd(buf[:]) + if err != nil { + return "", err + } + // Subtract one for null terminator. + return string(buf[:n-1]), nil +} + +func unshareFs() error { + err := syscall.Unshare(syscall.CLONE_FS) + if err != nil { + errno, ok := err.(syscall.Errno) + if ok && errno == syscall.EPERM { + return errNotPermitted + } + } + return err +} + +func chdir(path string) error { + return syscall.Chdir(path) +} From 00055152d320f60476ca5db1e7da4fc89f94834e Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Fri, 21 Dec 2018 12:23:18 -0500 Subject: [PATCH 420/594] cmd/go: fix -n output in runtime/internal/atomic When building runtime/internal/atomic, the toolchain writes a symabis2 file. This file is read back in, filtered, and appended to the symabis file. This breaks with -n, since the symabis2 file is never written. With this change, when -n is used, an equivalent "grep" command is printed instead. The output for -x is unchanged. Fixes #29346 Change-Id: Id25e06e06364fc6689e71660d000f09c649c4f0c Reviewed-on: https://go-review.googlesource.com/c/155480 Reviewed-by: Bryan C. Mills Run-TryBot: Bryan C. Mills --- src/cmd/go/internal/work/gc.go | 6 ++++++ src/cmd/go/testdata/script/build_runtime_gcflags.txt | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 src/cmd/go/testdata/script/build_runtime_gcflags.txt diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index 0df6629f410fb..3d09f69fcc3e4 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -316,6 +316,12 @@ func (gcToolchain) symabis(b *Builder, a *Action, sfiles []string) (string, erro // Filter out just the symbol refs and append them to // the symabis file. + if cfg.BuildN { + // -x will print the lines from symabis2 that are actually appended + // to symabis. With -n, we don't know what those lines will be. + b.Showcmd("", `grep '^ref' <%s | grep -v '^ref\s*""\.' >>%s`, symabis2, a.Objdir+"symabis") + continue + } abis2, err := ioutil.ReadFile(symabis2) if err != nil { return "", err diff --git a/src/cmd/go/testdata/script/build_runtime_gcflags.txt b/src/cmd/go/testdata/script/build_runtime_gcflags.txt new file mode 100644 index 0000000000000..dc0767c569f17 --- /dev/null +++ b/src/cmd/go/testdata/script/build_runtime_gcflags.txt @@ -0,0 +1,4 @@ +# This test verifies the standard library (specifically runtime/internal/atomic) +# can be built with -gcflags when -n is given. See golang.org/issue/26092. +go build -n -gcflags=all='-l' std +stderr 'compile.* -l .* runtime/internal/atomic' From b7451e299ba2b1f69ecf8744adaf028ae437f262 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Fri, 21 Dec 2018 13:47:20 -0500 Subject: [PATCH 421/594] cmd/go: use cached source files in "go list -find -compiled" When "go list" is invoked with -find, it clears the list of imports for each package matched on the command line. This affects action IDs, since they incorporate dependencies' action IDs. Consequently, the build triggered by -compiled won't find sources cached by "go build". We can still safely cache compiled sources from multiple runs of "go list -find -compiled" though, since cgo generated sources are not affected by imported dependencies. This change adds a second look into the cache in this situation. Fixes #29371 Change-Id: Ia0ae5a403ab5d621feaa16f521e6a65ac0ae6d9a Reviewed-on: https://go-review.googlesource.com/c/155481 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/work/exec.go | 7 +++++++ src/cmd/go/testdata/script/list_find.txt | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index ca588911fed84..baa587268744f 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -386,6 +386,13 @@ func (b *Builder) build(a *Action) (err error) { cached = true a.output = []byte{} // start saving output in case we miss any cache results } + + // Source files might be cached, even if the full action is not + // (e.g., go list -compiled -find). + if !cached && need&needCompiledGoFiles != 0 && b.loadCachedSrcFiles(a) { + need &^= needCompiledGoFiles + } + if need == 0 { return nil } diff --git a/src/cmd/go/testdata/script/list_find.txt b/src/cmd/go/testdata/script/list_find.txt index dbe8fb0ac98ce..63c6896e507db 100644 --- a/src/cmd/go/testdata/script/list_find.txt +++ b/src/cmd/go/testdata/script/list_find.txt @@ -5,6 +5,15 @@ stdout true go list -find -f '{{.Incomplete}} {{.Imports}}' x/y/z... stdout '^false \[\]' +# go list -find -compiled should use cached sources the second time it's run. +# It might not find the same cached sources as "go build", but the sources +# should be identical. "go build" derives action IDs (which are used as cache +# keys) from dependencies' action IDs. "go list -find" won't know what the +# dependencies are, so it's can't construct the same action IDs. +go list -find -compiled net +go list -find -compiled -x net +! stderr 'cgo' + -- x/y/z/z.go -- package z import "does/not/exist" From e7c20b7917989e678a2800378b807fe0fdaf8031 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Dec 2018 11:16:43 -0800 Subject: [PATCH 422/594] doc: go_mem: clarify Once docs Fixes #27808 Change-Id: Ia643d51004c47953642a2ba41dfed281f1112be6 Reviewed-on: https://go-review.googlesource.com/c/155637 Reviewed-by: Bryan C. Mills --- doc/go_mem.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/go_mem.html b/doc/go_mem.html index 143f3b2ff22e9..d355bebaed881 100644 --- a/doc/go_mem.html +++ b/doc/go_mem.html @@ -418,8 +418,12 @@

    Once

    -calling twoprint causes "hello, world" to be printed twice. -The first call to doprint runs setup once. +calling twoprint will call setup exactly +once. +The setup function will complete before either call +of print. +The result will be that "hello, world" will be printed +twice.

    Incorrect synchronization

    From 08477a38ab21c5d4c196af6d16f817aae8c125da Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Dec 2018 13:14:09 -0800 Subject: [PATCH 423/594] cmd/cgo: don't let inserted /*line*/ become a // comment Fixes #29383 Change-Id: I0fb2929863e153b96d32d851e25e536231e4ae65 Reviewed-on: https://go-review.googlesource.com/c/155638 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- misc/cgo/test/issue29383.go | 19 +++++++++++++++++++ src/cmd/cgo/gcc.go | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 misc/cgo/test/issue29383.go diff --git a/misc/cgo/test/issue29383.go b/misc/cgo/test/issue29383.go new file mode 100644 index 0000000000000..462c9a37df293 --- /dev/null +++ b/misc/cgo/test/issue29383.go @@ -0,0 +1,19 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// cgo's /*line*/ comments failed when inserted after '/', +// because the result looked like a "//" comment. +// No runtime test; just make sure it compiles. + +package cgotest + +// #include +import "C" + +func Issue29383(n, size uint) int { + if ^C.size_t(0)/C.size_t(n) < C.size_t(size) { + return 0 + } + return 0 +} diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 11c3ff3a9ceae..65f9f6e4a1943 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -1389,7 +1389,9 @@ func (p *Package) rewriteRef(f *File) { // Record source-level edit for cgo output. if !r.Done { - repl := gofmtPos(expr, old.Pos()) + // Prepend a space in case the earlier code ends + // with '/', which would give us a "//" comment. + repl := " " + gofmtPos(expr, old.Pos()) end := fset.Position(old.End()) // Subtract 1 from the column if we are going to // append a close parenthesis. That will set the @@ -1399,7 +1401,7 @@ func (p *Package) rewriteRef(f *File) { sub = 1 } if end.Column > sub { - repl = fmt.Sprintf("%s/*line :%d:%d*/", repl, end.Line, end.Column-sub) + repl = fmt.Sprintf("%s /*line :%d:%d*/", repl, end.Line, end.Column-sub) } if r.Name.Kind != "type" { repl = "(" + repl + ")" From debca779719a72929932c589fe7ed3fea5341e53 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 21 Dec 2018 15:41:28 -0800 Subject: [PATCH 424/594] cmd/compile: fix line number for implicitly declared method expressions Method expressions where the method is implicitly declared have no line number. The Error method of the built-in error type is one such method. We leave the line number at the use of the method expression in this case. Fixes #29389 Change-Id: I29c64bb47b1a704576abf086599eb5af7b78df53 Reviewed-on: https://go-review.googlesource.com/c/155639 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/compile/internal/gc/closure.go | 7 ++++++- test/fixedbugs/issue29389.go | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/fixedbugs/issue29389.go diff --git a/src/cmd/compile/internal/gc/closure.go b/src/cmd/compile/internal/gc/closure.go index f6b492a16f029..284ecdf457ce3 100644 --- a/src/cmd/compile/internal/gc/closure.go +++ b/src/cmd/compile/internal/gc/closure.go @@ -439,9 +439,14 @@ func makepartialcall(fn *Node, t0 *types.Type, meth *types.Sym) *Node { // Set line number equal to the line number where the method is declared. var m *types.Field - if lookdot0(meth, rcvrtype, &m, false) == 1 { + if lookdot0(meth, rcvrtype, &m, false) == 1 && m.Pos.IsKnown() { lineno = m.Pos } + // Note: !m.Pos.IsKnown() happens for method expressions where + // the method is implicitly declared. The Error method of the + // built-in error type is one such method. We leave the line + // number at the use of the method expression in this + // case. See issue 29389. tfn := nod(OTFUNC, nil, nil) tfn.List.Set(structargs(t0.Params(), true)) diff --git a/test/fixedbugs/issue29389.go b/test/fixedbugs/issue29389.go new file mode 100644 index 0000000000000..43859fd38f085 --- /dev/null +++ b/test/fixedbugs/issue29389.go @@ -0,0 +1,17 @@ +// compile + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure we can correctly compile method expressions +// where the method is implicitly declared. + +package main + +import "io" + +func main() { + err := io.EOF + _ = err.Error +} From c5414457c62fc11f299946a46f6c868c4f0bf2ab Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 21 Dec 2018 16:36:45 -0800 Subject: [PATCH 425/594] cmd/compile: pad zero-sized stack variables If someone takes a pointer to a zero-sized stack variable, it can be incorrectly interpreted as a pointer to the next object in the stack frame. To avoid this, add some padding after zero-sized variables. We only need to pad if the next variable in memory (which is the previous variable in the order in which we allocate variables to the stack frame) has pointers. If the next variable has no pointers, it won't hurt to have a pointer to it. Because we allocate all pointer-containing variables before all non-pointer-containing variables, we should only have to pad once per frame. Fixes #24993 Change-Id: Ife561cdfdf964fdbf69af03ae6ba97d004e6193c Reviewed-on: https://go-review.googlesource.com/c/155698 Run-TryBot: Keith Randall Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/pgen.go | 11 +++++++++++ test/codegen/zerosize.go | 25 +++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 test/codegen/zerosize.go diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index bdc66f3e275a0..63e586095052f 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -153,6 +153,7 @@ func (s *ssafn) AllocFrame(f *ssa.Func) { sort.Sort(byStackVar(fn.Dcl)) // Reassign stack offsets of the locals that are used. + lastHasPtr := false for i, n := range fn.Dcl { if n.Op != ONAME || n.Class() != PAUTO { continue @@ -167,10 +168,20 @@ func (s *ssafn) AllocFrame(f *ssa.Func) { if w >= thearch.MAXWIDTH || w < 0 { Fatalf("bad width") } + if w == 0 && lastHasPtr { + // Pad between a pointer-containing object and a zero-sized object. + // This prevents a pointer to the zero-sized object from being interpreted + // as a pointer to the pointer-containing object (and causing it + // to be scanned when it shouldn't be). See issue 24993. + w = 1 + } s.stksize += w s.stksize = Rnd(s.stksize, int64(n.Type.Align)) if types.Haspointers(n.Type) { s.stkptrsize = s.stksize + lastHasPtr = true + } else { + lastHasPtr = false } if thearch.LinkArch.InFamily(sys.MIPS, sys.MIPS64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) { s.stksize = Rnd(s.stksize, int64(Widthptr)) diff --git a/test/codegen/zerosize.go b/test/codegen/zerosize.go new file mode 100644 index 0000000000000..cd0c83b6efed7 --- /dev/null +++ b/test/codegen/zerosize.go @@ -0,0 +1,25 @@ +// asmcheck + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure a pointer variable and a zero-sized variable +// aren't allocated to the same stack slot. +// See issue 24993. + +package codegen + +func zeroSize() { + c := make(chan struct{}) + // amd64:`MOVQ\t\$0, ""\.s\+32\(SP\)` + var s *int + g(&s) // force s to be a stack object + + // amd64:`LEAQ\t""\..*\+31\(SP\)` + c <- struct{}{} +} + +//go:noinline +func g(p **int) { +} From 3a3b98fdf96a93191d6c14f3b3cd2b757b961ec0 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sat, 15 Dec 2018 21:39:00 -0800 Subject: [PATCH 426/594] cmd/compile/internal/ssa/gen: set wasm genfile This appears to have been an oversight and/or left over from development. Setting the genfile means that extra sanity checks are executed when regenerating SSA files. They already pass. Change-Id: Icc01ecf85020d3d51355e8bccfbc521b52371747 Reviewed-on: https://go-review.googlesource.com/c/154459 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/gen/WasmOps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/gen/WasmOps.go b/src/cmd/compile/internal/ssa/gen/WasmOps.go index 9b4f66d3f172a..e0f2f92a3f70b 100644 --- a/src/cmd/compile/internal/ssa/gen/WasmOps.go +++ b/src/cmd/compile/internal/ssa/gen/WasmOps.go @@ -196,7 +196,7 @@ func init() { archs = append(archs, arch{ name: "Wasm", pkg: "cmd/internal/obj/wasm", - genfile: "", + genfile: "../../wasm/ssa.go", ops: WasmOps, blocks: nil, regnames: regNamesWasm, From 97d5cb24b10b7b740de2f1cc04d88341c4437ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 21 Dec 2018 00:04:18 +0100 Subject: [PATCH 427/594] cmd/go: add regression test for cryptic vcs errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Go 1.11.x, if one ran 'go build' on a main package within a module, while a needed vcs program like git was missing, a confusing error would show up: build testmod: cannot find module for path rsc.io/quote The error should instead point at the source of the problem, which is the missing vcs program. Thankfully, Go 1.12 doesn't have this bug, even though it doesn't seem like the bug was fixed directly and intentionally. To ensure that this particular edge case isn't broken again, add a regression test. Piggyback on mod_vcs_missing, since it already requires a missing vcs program and network access. I double-checked that Go 1.11 fails this test via /usr/bin/go, which is 1.11.3 on my system: $ PATH=~/tip/bin go test -v -run Script/mod_vcs_missing [...] > exec /usr/bin/go build [stderr] build m: cannot find module for path launchpad.net/gocheck Fixes #28948. Change-Id: Iff1bcf77d9f7c11d15935cb87d6f58d7981d33d2 Reviewed-on: https://go-review.googlesource.com/c/155537 Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- .../go/testdata/script/mod_vcs_missing.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/cmd/go/testdata/script/mod_vcs_missing.txt b/src/cmd/go/testdata/script/mod_vcs_missing.txt index fb146b44155eb..009bb91c3c79b 100644 --- a/src/cmd/go/testdata/script/mod_vcs_missing.txt +++ b/src/cmd/go/testdata/script/mod_vcs_missing.txt @@ -4,8 +4,25 @@ env GO111MODULE=on env GOPROXY= +cd empty ! go list launchpad.net/gocheck stderr '"bzr": executable file not found' +cd .. --- go.mod -- +# 1.11 used to give the cryptic error "cannot find module for path" here, but +# only for a main package. +cd main +! go build +stderr '"bzr": executable file not found' +cd .. + +-- empty/go.mod -- +module m +-- main/go.mod -- module m +-- main/main.go -- +package main + +import _ "launchpad.net/gocheck" + +func main() {} From 3b66c00857ff77f8acfc3e6e9491dda3677858a4 Mon Sep 17 00:00:00 2001 From: Andrew Bonventre Date: Sun, 23 Dec 2018 16:48:38 -0500 Subject: [PATCH 428/594] reflect: fix panic when Value.IsNil is called for UnsafePointer UnsafePointer is a valid type kind to call IsNil on. Fixes #29381 Change-Id: Iaf65d582c67f4be52cd1885badf40f174920500b Reviewed-on: https://go-review.googlesource.com/c/155797 Run-TryBot: Andrew Bonventre TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/reflect/all_test.go | 1 + src/reflect/value.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index 4b215f120c963..10b52456f34ee 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -1009,6 +1009,7 @@ func TestIsNil(t *testing.T) { struct{ x func() bool }{}, struct{ x chan int }{}, struct{ x []string }{}, + struct{ x unsafe.Pointer }{}, } for _, ts := range doNil { ty := TypeOf(ts).Field(0).Type diff --git a/src/reflect/value.go b/src/reflect/value.go index 8906febb9bf1a..7ae2dd8d10455 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -1031,7 +1031,7 @@ func (v Value) InterfaceData() [2]uintptr { func (v Value) IsNil() bool { k := v.kind() switch k { - case Chan, Func, Map, Ptr: + case Chan, Func, Map, Ptr, UnsafePointer: if v.flag&flagMethod != 0 { return false } From b32ee0a3c004d4ef79d92bd63200008456da50f3 Mon Sep 17 00:00:00 2001 From: LE Manh Cuong Date: Fri, 21 Dec 2018 11:21:02 +0700 Subject: [PATCH 429/594] path/filepath: walkSymlinks: return correct error for file with trailing slash Rather than return os.ErrNotExist for /path/to/existing_file/, walkSymLinks now returns syscall.ENOTDIR. This is consistent with behavior of os.Lstat. Fixes #29372 Change-Id: Id5c471d901db04b2f35d60f60a81b2a0be93cae9 Reviewed-on: https://go-review.googlesource.com/c/155597 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/path/filepath/path_test.go | 37 ++++++++++++++++++++++++++++ src/path/filepath/symlink.go | 9 ++++--- src/path/filepath/symlink_windows.go | 18 +++++++++++++- 3 files changed, 60 insertions(+), 4 deletions(-) diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go index 3434ea2e6e77c..1b9f286c4d87a 100644 --- a/src/path/filepath/path_test.go +++ b/src/path/filepath/path_test.go @@ -15,6 +15,7 @@ import ( "runtime" "sort" "strings" + "syscall" "testing" ) @@ -1371,3 +1372,39 @@ func TestWalkSymlink(t *testing.T) { testenv.MustHaveSymlink(t) testWalkSymlink(t, os.Symlink) } + +func TestIssue29372(t *testing.T) { + f, err := ioutil.TempFile("", "issue29372") + if err != nil { + t.Fatal(err) + } + f.Close() + path := f.Name() + defer os.Remove(path) + + isWin := runtime.GOOS == "windows" + pathSeparator := string(filepath.Separator) + tests := []struct { + path string + skip bool + }{ + {path + strings.Repeat(pathSeparator, 1), false}, + {path + strings.Repeat(pathSeparator, 2), false}, + {path + strings.Repeat(pathSeparator, 1) + ".", false}, + {path + strings.Repeat(pathSeparator, 2) + ".", false}, + // windows.GetFinalPathNameByHandle return the directory part with trailing dot dot + // C:\path\to\existing_dir\existing_file\.. returns C:\path\to\existing_dir + {path + strings.Repeat(pathSeparator, 1) + "..", isWin}, + {path + strings.Repeat(pathSeparator, 2) + "..", isWin}, + } + + for i, test := range tests { + if test.skip { + continue + } + _, err = filepath.EvalSymlinks(test.path) + if err != syscall.ENOTDIR { + t.Fatalf("test#%d: want %q, got %q", i, syscall.ENOTDIR, err) + } + } +} diff --git a/src/path/filepath/symlink.go b/src/path/filepath/symlink.go index 98a92357bedb2..a08b85a29cdb3 100644 --- a/src/path/filepath/symlink.go +++ b/src/path/filepath/symlink.go @@ -8,10 +8,13 @@ import ( "errors" "os" "runtime" + "syscall" ) func walkSymlinks(path string) (string, error) { volLen := volumeNameLen(path) + pathSeparator := string(os.PathSeparator) + if volLen < len(path) && os.IsPathSeparator(path[volLen]) { volLen++ } @@ -50,7 +53,7 @@ func walkSymlinks(path string) (string, error) { } if r < volLen { if len(dest) > volLen { - dest += string(os.PathSeparator) + dest += pathSeparator } dest += ".." } else { @@ -62,7 +65,7 @@ func walkSymlinks(path string) (string, error) { // Ordinary path component. Add it to result. if len(dest) > volumeNameLen(dest) && !os.IsPathSeparator(dest[len(dest)-1]) { - dest += string(os.PathSeparator) + dest += pathSeparator } dest += path[start:end] @@ -76,7 +79,7 @@ func walkSymlinks(path string) (string, error) { if fi.Mode()&os.ModeSymlink == 0 { if !fi.Mode().IsDir() && end < len(path) { - return "", os.ErrNotExist + return "", syscall.ENOTDIR } continue } diff --git a/src/path/filepath/symlink_windows.go b/src/path/filepath/symlink_windows.go index 7095a6b4bd575..1108b3ddff0bd 100644 --- a/src/path/filepath/symlink_windows.go +++ b/src/path/filepath/symlink_windows.go @@ -159,6 +159,18 @@ func evalSymlinksUsingGetFinalPathNameByHandle(path string) (string, error) { return "", errors.New("GetFinalPathNameByHandle returned unexpected path=" + s) } +func symlinkOrDir(path string) (string, error) { + fi, err := os.Lstat(path) + if err != nil { + return "", err + } + + if fi.Mode()&os.ModeSymlink == 0 && !fi.Mode().IsDir() { + return "", syscall.ENOTDIR + } + return path, nil +} + func samefile(path1, path2 string) bool { fi1, err := os.Lstat(path1) if err != nil { @@ -176,7 +188,11 @@ func evalSymlinks(path string) (string, error) { if err != nil { newpath2, err2 := evalSymlinksUsingGetFinalPathNameByHandle(path) if err2 == nil { - return toNorm(newpath2, normBase) + normPath, toNormErr := toNorm(newpath2, normBase) + if toNormErr != nil { + return "", toNormErr + } + return symlinkOrDir(normPath) } return "", err } From 652d59861ee34b7cbef49cdd9da71fa822124e6e Mon Sep 17 00:00:00 2001 From: Max Ushakov Date: Fri, 21 Dec 2018 17:53:33 +0300 Subject: [PATCH 430/594] time: return ENOENT if a zoneinfo zip file is not found Updates #20969 Change-Id: Ibcf0bf932d5b1de67c22c63dd8514ed7a5d198fb Reviewed-on: https://go-review.googlesource.com/c/155538 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- src/time/zoneinfo_read.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/time/zoneinfo_read.go b/src/time/zoneinfo_read.go index b495217c0686f..d8d4070d5b51a 100644 --- a/src/time/zoneinfo_read.go +++ b/src/time/zoneinfo_read.go @@ -271,7 +271,7 @@ func get2(b []byte) int { func loadTzinfoFromZip(zipfile, name string) ([]byte, error) { fd, err := open(zipfile) if err != nil { - return nil, errors.New("open " + zipfile + ": " + err.Error()) + return nil, err } defer closefd(fd) From 55e3aced9e7581549286a9ee5710e9c193baf0a7 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 21 Dec 2018 18:23:31 -0800 Subject: [PATCH 431/594] cmd: vendor x/sys/unix into the stdlib Last of the Macos libSystem changes, hopefully. Fixes #17490 Change-Id: I88b303bafd92494cc4ddde712213d2ef976ce4e2 Reviewed-on: https://go-review.googlesource.com/c/155737 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Ian Lance Taylor --- .../vendor/golang.org/x/sys/unix/README.md | 4 +- .../golang.org/x/sys/unix/darwin_test.go | 210 + src/cmd/vendor/golang.org/x/sys/unix/mkall.sh | 23 +- .../vendor/golang.org/x/sys/unix/mkerrors.sh | 18 +- .../golang.org/x/sys/unix/sendfile_test.go | 98 + .../golang.org/x/sys/unix/syscall_aix.go | 7 + .../golang.org/x/sys/unix/syscall_darwin.go | 62 +- .../x/sys/unix/syscall_darwin_386.go | 23 +- .../x/sys/unix/syscall_darwin_amd64.go | 23 +- .../x/sys/unix/syscall_darwin_arm.go | 26 +- .../x/sys/unix/syscall_darwin_arm64.go | 26 +- .../x/sys/unix/syscall_darwin_libSystem.go | 31 + .../x/sys/unix/syscall_dragonfly.go | 7 + .../golang.org/x/sys/unix/syscall_freebsd.go | 7 + .../golang.org/x/sys/unix/syscall_linux.go | 7 + .../golang.org/x/sys/unix/syscall_netbsd.go | 7 + .../golang.org/x/sys/unix/syscall_openbsd.go | 7 + .../golang.org/x/sys/unix/syscall_solaris.go | 7 + .../golang.org/x/sys/unix/syscall_unix.go | 7 - .../x/sys/unix/syscall_unix_test.go | 6 + .../x/sys/unix/zerrors_linux_sparc64.go | 4196 ++++++++++------- .../x/sys/unix/zsyscall_darwin_386.1_11.go | 1810 +++++++ .../x/sys/unix/zsyscall_darwin_386.go | 1174 ++++- .../x/sys/unix/zsyscall_darwin_386.s | 284 ++ .../x/sys/unix/zsyscall_darwin_amd64.1_11.go | 1810 +++++++ .../x/sys/unix/zsyscall_darwin_amd64.go | 1174 ++++- .../x/sys/unix/zsyscall_darwin_amd64.s | 284 ++ .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 1793 +++++++ .../x/sys/unix/zsyscall_darwin_arm.go | 1152 ++++- .../x/sys/unix/zsyscall_darwin_arm.s | 282 ++ .../x/sys/unix/zsyscall_darwin_arm64.1_11.go | 1793 +++++++ .../x/sys/unix/zsyscall_darwin_arm64.go | 1152 ++++- .../x/sys/unix/zsyscall_darwin_arm64.s | 282 ++ .../x/sys/unix/zsysnum_linux_sparc64.go | 6 +- .../golang.org/x/sys/unix/ztypes_linux_386.go | 9 +- .../x/sys/unix/ztypes_linux_amd64.go | 16 - .../golang.org/x/sys/unix/ztypes_linux_arm.go | 10 +- .../x/sys/unix/ztypes_linux_arm64.go | 16 - .../x/sys/unix/ztypes_linux_mips.go | 7 +- .../x/sys/unix/ztypes_linux_mips64.go | 16 - .../x/sys/unix/ztypes_linux_mips64le.go | 16 - .../x/sys/unix/ztypes_linux_mipsle.go | 7 +- .../x/sys/unix/ztypes_linux_ppc64.go | 16 - .../x/sys/unix/ztypes_linux_ppc64le.go | 16 - .../x/sys/unix/ztypes_linux_riscv64.go | 16 - .../x/sys/unix/ztypes_linux_s390x.go | 21 +- .../x/sys/unix/ztypes_linux_sparc64.go | 1487 +++++- src/cmd/vendor/vendor.json | 6 +- 48 files changed, 16425 insertions(+), 3032 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/darwin_test.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/sendfile_test.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s diff --git a/src/cmd/vendor/golang.org/x/sys/unix/README.md b/src/cmd/vendor/golang.org/x/sys/unix/README.md index bc6f6031f1b79..2bf415fb1cff3 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/README.md +++ b/src/cmd/vendor/golang.org/x/sys/unix/README.md @@ -14,7 +14,7 @@ migrating the build system to use containers so the builds are reproducible. This is being done on an OS-by-OS basis. Please update this documentation as components of the build system change. -### Old Build System (currently for `GOOS != "Linux" || GOARCH == "sparc64"`) +### Old Build System (currently for `GOOS != "linux"`) The old build system generates the Go files based on the C header files present on your system. This means that files @@ -34,7 +34,7 @@ your specific system. Running `mkall.sh -n` shows the commands that will be run. Requirements: bash, perl, go -### New Build System (currently for `GOOS == "Linux" && GOARCH != "sparc64"`) +### New Build System (currently for `GOOS == "linux"`) The new build system uses a Docker container to generate the go files directly from source checkouts of the kernel and various system libraries. This means diff --git a/src/cmd/vendor/golang.org/x/sys/unix/darwin_test.go b/src/cmd/vendor/golang.org/x/sys/unix/darwin_test.go new file mode 100644 index 0000000000000..29af36f102ee2 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/darwin_test.go @@ -0,0 +1,210 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin,go1.12,amd64 darwin,go1.12,386 + +package unix + +import ( + "os" + "os/exec" + "strings" + "testing" +) + +type darwinTest struct { + name string + f func() +} + +// TODO(khr): decide whether to keep this test enabled permanently or +// only temporarily. +func TestDarwinLoader(t *testing.T) { + // Make sure the Darwin dynamic loader can actually resolve + // all the system calls into libSystem.dylib. Unfortunately + // there is no easy way to test this at compile time. So we + // implement a crazy hack here, calling into the syscall + // function with all its arguments set to junk, and see what + // error we get. We are happy with any error (or none) except + // an error from the dynamic loader. + // + // We have to run each test in a separate subprocess for fault isolation. + // + // Hopefully the junk args won't accidentally ask the system to do "rm -fr /". + // + // In an ideal world each syscall would have its own test, so this test + // would be unnecessary. Unfortunately, we do not live in that world. + for _, test := range darwinTests { + // Call the test binary recursively, giving it a magic argument + // (see init below) and the name of the test to run. + cmd := exec.Command(os.Args[0], "testDarwinLoader", test.name) + + // Run subprocess, collect results. Note that we expect the subprocess + // to fail somehow, so the error is irrelevant. + out, _ := cmd.CombinedOutput() + + if strings.Contains(string(out), "dyld: Symbol not found:") { + t.Errorf("can't resolve %s in libSystem.dylib", test.name) + } + if !strings.Contains(string(out), "success") { + // Not really an error. Might be a syscall that never returns, + // like exit, or one that segfaults, like gettimeofday. + t.Logf("test never finished: %s: %s", test.name, string(out)) + } + } +} + +func init() { + // The test binary execs itself with the "testDarwinLoader" argument. + // Run the test specified by os.Args[2], then panic. + if len(os.Args) >= 3 && os.Args[1] == "testDarwinLoader" { + for _, test := range darwinTests { + if test.name == os.Args[2] { + test.f() + } + } + // Panic with a "success" label, so the parent process can check it. + panic("success") + } +} + +// All the _trampoline functions in zsyscall_darwin_$ARCH.s +var darwinTests = [...]darwinTest{ + {"getgroups", libc_getgroups_trampoline}, + {"setgroups", libc_setgroups_trampoline}, + {"wait4", libc_wait4_trampoline}, + {"accept", libc_accept_trampoline}, + {"bind", libc_bind_trampoline}, + {"connect", libc_connect_trampoline}, + {"socket", libc_socket_trampoline}, + {"getsockopt", libc_getsockopt_trampoline}, + {"setsockopt", libc_setsockopt_trampoline}, + {"getpeername", libc_getpeername_trampoline}, + {"getsockname", libc_getsockname_trampoline}, + {"shutdown", libc_shutdown_trampoline}, + {"socketpair", libc_socketpair_trampoline}, + {"recvfrom", libc_recvfrom_trampoline}, + {"sendto", libc_sendto_trampoline}, + {"recvmsg", libc_recvmsg_trampoline}, + {"sendmsg", libc_sendmsg_trampoline}, + {"kevent", libc_kevent_trampoline}, + {"__sysctl", libc___sysctl_trampoline}, + {"utimes", libc_utimes_trampoline}, + {"futimes", libc_futimes_trampoline}, + {"fcntl", libc_fcntl_trampoline}, + {"poll", libc_poll_trampoline}, + {"madvise", libc_madvise_trampoline}, + {"mlock", libc_mlock_trampoline}, + {"mlockall", libc_mlockall_trampoline}, + {"mprotect", libc_mprotect_trampoline}, + {"msync", libc_msync_trampoline}, + {"munlock", libc_munlock_trampoline}, + {"munlockall", libc_munlockall_trampoline}, + {"ptrace", libc_ptrace_trampoline}, + {"pipe", libc_pipe_trampoline}, + {"getxattr", libc_getxattr_trampoline}, + {"fgetxattr", libc_fgetxattr_trampoline}, + {"setxattr", libc_setxattr_trampoline}, + {"fsetxattr", libc_fsetxattr_trampoline}, + {"removexattr", libc_removexattr_trampoline}, + {"fremovexattr", libc_fremovexattr_trampoline}, + {"listxattr", libc_listxattr_trampoline}, + {"flistxattr", libc_flistxattr_trampoline}, + {"kill", libc_kill_trampoline}, + {"ioctl", libc_ioctl_trampoline}, + {"access", libc_access_trampoline}, + {"adjtime", libc_adjtime_trampoline}, + {"chdir", libc_chdir_trampoline}, + {"chflags", libc_chflags_trampoline}, + {"chmod", libc_chmod_trampoline}, + {"chown", libc_chown_trampoline}, + {"chroot", libc_chroot_trampoline}, + {"close", libc_close_trampoline}, + {"dup", libc_dup_trampoline}, + {"dup2", libc_dup2_trampoline}, + {"exchangedata", libc_exchangedata_trampoline}, + {"exit", libc_exit_trampoline}, + {"faccessat", libc_faccessat_trampoline}, + {"fchdir", libc_fchdir_trampoline}, + {"fchflags", libc_fchflags_trampoline}, + {"fchmod", libc_fchmod_trampoline}, + {"fchmodat", libc_fchmodat_trampoline}, + {"fchown", libc_fchown_trampoline}, + {"fchownat", libc_fchownat_trampoline}, + {"flock", libc_flock_trampoline}, + {"fpathconf", libc_fpathconf_trampoline}, + {"fstat64", libc_fstat64_trampoline}, + {"fstatat64", libc_fstatat64_trampoline}, + {"fstatfs64", libc_fstatfs64_trampoline}, + {"fsync", libc_fsync_trampoline}, + {"ftruncate", libc_ftruncate_trampoline}, + {"__getdirentries64", libc___getdirentries64_trampoline}, + {"getdtablesize", libc_getdtablesize_trampoline}, + {"getegid", libc_getegid_trampoline}, + {"geteuid", libc_geteuid_trampoline}, + {"getgid", libc_getgid_trampoline}, + {"getpgid", libc_getpgid_trampoline}, + {"getpgrp", libc_getpgrp_trampoline}, + {"getpid", libc_getpid_trampoline}, + {"getppid", libc_getppid_trampoline}, + {"getpriority", libc_getpriority_trampoline}, + {"getrlimit", libc_getrlimit_trampoline}, + {"getrusage", libc_getrusage_trampoline}, + {"getsid", libc_getsid_trampoline}, + {"getuid", libc_getuid_trampoline}, + {"issetugid", libc_issetugid_trampoline}, + {"kqueue", libc_kqueue_trampoline}, + {"lchown", libc_lchown_trampoline}, + {"link", libc_link_trampoline}, + {"linkat", libc_linkat_trampoline}, + {"listen", libc_listen_trampoline}, + {"lstat64", libc_lstat64_trampoline}, + {"mkdir", libc_mkdir_trampoline}, + {"mkdirat", libc_mkdirat_trampoline}, + {"mkfifo", libc_mkfifo_trampoline}, + {"mknod", libc_mknod_trampoline}, + {"open", libc_open_trampoline}, + {"openat", libc_openat_trampoline}, + {"pathconf", libc_pathconf_trampoline}, + {"pread", libc_pread_trampoline}, + {"pwrite", libc_pwrite_trampoline}, + {"read", libc_read_trampoline}, + {"readlink", libc_readlink_trampoline}, + {"readlinkat", libc_readlinkat_trampoline}, + {"rename", libc_rename_trampoline}, + {"renameat", libc_renameat_trampoline}, + {"revoke", libc_revoke_trampoline}, + {"rmdir", libc_rmdir_trampoline}, + {"lseek", libc_lseek_trampoline}, + {"select", libc_select_trampoline}, + {"setegid", libc_setegid_trampoline}, + {"seteuid", libc_seteuid_trampoline}, + {"setgid", libc_setgid_trampoline}, + {"setlogin", libc_setlogin_trampoline}, + {"setpgid", libc_setpgid_trampoline}, + {"setpriority", libc_setpriority_trampoline}, + {"setprivexec", libc_setprivexec_trampoline}, + {"setregid", libc_setregid_trampoline}, + {"setreuid", libc_setreuid_trampoline}, + {"setrlimit", libc_setrlimit_trampoline}, + {"setsid", libc_setsid_trampoline}, + {"settimeofday", libc_settimeofday_trampoline}, + {"setuid", libc_setuid_trampoline}, + {"stat64", libc_stat64_trampoline}, + {"statfs64", libc_statfs64_trampoline}, + {"symlink", libc_symlink_trampoline}, + {"symlinkat", libc_symlinkat_trampoline}, + {"sync", libc_sync_trampoline}, + {"truncate", libc_truncate_trampoline}, + {"umask", libc_umask_trampoline}, + {"undelete", libc_undelete_trampoline}, + {"unlink", libc_unlink_trampoline}, + {"unlinkat", libc_unlinkat_trampoline}, + {"unmount", libc_unmount_trampoline}, + {"write", libc_write_trampoline}, + {"mmap", libc_mmap_trampoline}, + {"munmap", libc_munmap_trampoline}, + {"gettimeofday", libc_gettimeofday_trampoline}, + {"getfsstat64", libc_getfsstat64_trampoline}, +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh b/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh index 4f92537caa306..b21f0118e1dea 100755 --- a/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh +++ b/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh @@ -17,6 +17,7 @@ mksysctl="" zsysctl="zsysctl_$GOOSARCH.go" mksysnum= mktypes= +mkasm= run="sh" cmd="" @@ -45,8 +46,8 @@ case "$#" in exit 2 esac -if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then - # Use then new build system +if [[ "$GOOS" = "linux" ]]; then + # Use the Docker-based build system # Files generated through docker (use $cmd so you can Ctl-C the build or run) $cmd docker build --tag generate:$GOOS $GOOS $cmd docker run --interactive --tty --volume $(dirname "$(readlink -f "$0")"):/build generate:$GOOS @@ -74,21 +75,26 @@ darwin_386) mksyscall="go run mksyscall.go -l32" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" + mkasm="go run mkasm_darwin.go" ;; darwin_amd64) mkerrors="$mkerrors -m64" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" + mkasm="go run mkasm_darwin.go" ;; darwin_arm) mkerrors="$mkerrors" + mksyscall="go run mksyscall.go -l32" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" + mkasm="go run mkasm_darwin.go" ;; darwin_arm64) mkerrors="$mkerrors -m64" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" + mkasm="go run mkasm_darwin.go" ;; dragonfly_amd64) mkerrors="$mkerrors -m64" @@ -115,13 +121,6 @@ freebsd_arm) # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; -linux_sparc64) - GOOSARCH_in=syscall_linux_sparc64.go - unistd_h=/usr/include/sparc64-linux-gnu/asm/unistd.h - mkerrors="$mkerrors -m64" - mksysnum="./mksysnum_linux.pl $unistd_h" - mktypes="GOARCH=$GOARCH go tool cgo -godefs" - ;; netbsd_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32 -netbsd" @@ -191,6 +190,11 @@ esac if [ "$GOOSARCH" == "aix_ppc64" ]; then # aix/ppc64 script generates files instead of writing to stdin. echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ; + elif [ "$GOOS" == "darwin" ]; then + # pre-1.12, direct syscalls + echo "$mksyscall -tags $GOOS,$GOARCH,!go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.1_11.go"; + # 1.12 and later, syscalls via libSystem + echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; else echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; fi @@ -200,5 +204,6 @@ esac if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go"; + if [ -n "$mkasm" ]; then echo "$mkasm $GOARCH"; fi fi ) | $run diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh b/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh index 955dd50f9af17..178077f47b46f 100755 --- a/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -17,12 +17,10 @@ if test -z "$GOARCH" -o -z "$GOOS"; then fi # Check that we are using the new build system if we should -if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then - if [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then - echo 1>&2 "In the new build system, mkerrors should not be called directly." - echo 1>&2 "See README.md" - exit 1 - fi +if [[ "$GOOS" = "linux" ]] && [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then + echo 1>&2 "In the Docker based build system, mkerrors should not be called directly." + echo 1>&2 "See README.md" + exit 1 fi if [[ "$GOOS" = "aix" ]]; then @@ -223,7 +221,15 @@ struct ltchars { #include #include #include + +#if defined(__sparc__) +// On sparc{,64}, the kernel defines struct termios2 itself which clashes with the +// definition in glibc. As only the error constants are needed here, include the +// generic termibits.h (which is included by termbits.h on sparc). +#include +#else #include +#endif #ifndef MSG_FASTOPEN #define MSG_FASTOPEN 0x20000000 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/sendfile_test.go b/src/cmd/vendor/golang.org/x/sys/unix/sendfile_test.go new file mode 100644 index 0000000000000..d41fb93c8f44a --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/sendfile_test.go @@ -0,0 +1,98 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin,amd64 darwin,386 dragonfly freebsd linux solaris + +package unix_test + +import ( + "io/ioutil" + "net" + "os" + "path/filepath" + "testing" + + "golang.org/x/sys/unix" +) + +func TestSendfile(t *testing.T) { + // Set up source data file. + tempDir, err := ioutil.TempDir("", "TestSendfile") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tempDir) + name := filepath.Join(tempDir, "source") + const contents = "contents" + err = ioutil.WriteFile(name, []byte(contents), 0666) + if err != nil { + t.Fatal(err) + } + + done := make(chan bool) + + // Start server listening on a socket. + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Skipf("listen failed: %s\n", err) + } + defer ln.Close() + go func() { + conn, err := ln.Accept() + if err != nil { + t.Fatal(err) + } + defer conn.Close() + b, err := ioutil.ReadAll(conn) + if string(b) != contents { + t.Errorf("contents not transmitted: got %s (len=%d), want %s", string(b), len(b), contents) + } + done <- true + }() + + // Open source file. + src, err := os.Open(name) + if err != nil { + t.Fatal(err) + } + + // Send source file to server. + conn, err := net.Dial("tcp", ln.Addr().String()) + if err != nil { + t.Fatal(err) + } + file, err := conn.(*net.TCPConn).File() + if err != nil { + t.Fatal(err) + } + var off int64 + n, err := unix.Sendfile(int(file.Fd()), int(src.Fd()), &off, len(contents)) + if err != nil { + t.Errorf("Sendfile failed %s\n", err) + } + if n != len(contents) { + t.Errorf("written count wrong: want %d, got %d", len(contents), n) + } + // Note: off is updated on some systems and not others. Oh well. + // Linux: increments off by the amount sent. + // Darwin: leaves off unchanged. + // It would be nice to fix Darwin if we can. + if off != 0 && off != int64(len(contents)) { + t.Errorf("offset wrong: god %d, want %d or %d", off, 0, len(contents)) + } + // The cursor position should be unchanged. + pos, err := src.Seek(0, 1) + if err != nil { + t.Errorf("can't get cursor position %s\n", err) + } + if pos != 0 { + t.Errorf("cursor position wrong: got %d, want 0", pos) + } + + file.Close() // Note: required to have the close below really send EOF to the server. + conn.Close() + + // Wait for server to close. + <-done +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go index 992a8ea0f785b..1351a228b8418 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -268,6 +268,13 @@ func Gettimeofday(tv *Timeval) (err error) { return } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + return sendfile(outfd, infd, offset, count) +} + // TODO func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { return -1, ENOSYS diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go index 1aabc560d7a5a..04042e44b4a3b 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -108,17 +108,8 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( return nil, err } - _, _, e1 := Syscall6( - SYS_GETATTRLIST, - uintptr(unsafe.Pointer(_p0)), - uintptr(unsafe.Pointer(&attrList)), - uintptr(unsafe.Pointer(&attrBuf[0])), - uintptr(len(attrBuf)), - uintptr(options), - 0, - ) - if e1 != 0 { - return nil, e1 + if err := getattrlist(_p0, unsafe.Pointer(&attrList), unsafe.Pointer(&attrBuf[0]), uintptr(len(attrBuf)), int(options)); err != nil { + return nil, err } size := *(*uint32)(unsafe.Pointer(&attrBuf[0])) @@ -151,6 +142,8 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( return } +//sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) + //sysnb pipe() (r int, w int, err error) func Pipe(p []int) (err error) { @@ -168,12 +161,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { _p0 = unsafe.Pointer(&buf[0]) bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } - r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags)) - n = int(r0) - if e1 != 0 { - err = e1 - } - return + return getfsstat(_p0, bufsize, flags) } func xattrPointer(dest []byte) *byte { @@ -298,21 +286,16 @@ func setattrlistTimes(path string, times []Timespec, flags int) error { if flags&AT_SYMLINK_NOFOLLOW != 0 { options |= FSOPT_NOFOLLOW } - _, _, e1 := Syscall6( - SYS_SETATTRLIST, - uintptr(unsafe.Pointer(_p0)), - uintptr(unsafe.Pointer(&attrList)), - uintptr(unsafe.Pointer(&attributes)), - uintptr(unsafe.Sizeof(attributes)), - uintptr(options), - 0, - ) - if e1 != 0 { - return e1 - } - return nil + return setattrlist( + _p0, + unsafe.Pointer(&attrList), + unsafe.Pointer(&attributes), + unsafe.Sizeof(attributes), + options) } +//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { // Darwin doesn't support SYS_UTIMENSAT return ENOSYS @@ -411,6 +394,18 @@ func Uname(uname *Utsname) error { return nil } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + var length = int64(count) + err = sendfile(infd, outfd, *offset, &length, nil, 0) + written = int(length) + return +} + +//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) + /* * Exposed directly */ @@ -435,12 +430,8 @@ func Uname(uname *Utsname) error { //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) //sys Flock(fd int, how int) (err error) //sys Fpathconf(fd int, name int) (val int, err error) -//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 -//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 -//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) -//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 //sys Getdtablesize() (size int) //sysnb Getegid() (egid int) //sysnb Geteuid() (uid int) @@ -460,7 +451,6 @@ func Uname(uname *Utsname) error { //sys Link(path string, link string) (err error) //sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) //sys Listen(s int, backlog int) (err error) -//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 //sys Mkdir(path string, mode uint32) (err error) //sys Mkdirat(dirfd int, path string, mode uint32) (err error) //sys Mkfifo(path string, mode uint32) (err error) @@ -492,8 +482,6 @@ func Uname(uname *Utsname) error { //sysnb Setsid() (pid int, err error) //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) -//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 -//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go index b3ac109a2f42d..489726fa9bdbc 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go @@ -8,7 +8,6 @@ package unix import ( "syscall" - "unsafe" ) func setTimespec(sec, nsec int64) Timespec { @@ -48,21 +47,17 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } -func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - var length = uint64(count) - - _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) - - written = int(length) - - if e1 != 0 { - err = e1 - } - return -} - func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of darwin/386 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL + +//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 +//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 +//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 +//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 +//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 +//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 +//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 +//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go index 75219444a8d26..914b89bde5aae 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go @@ -8,7 +8,6 @@ package unix import ( "syscall" - "unsafe" ) func setTimespec(sec, nsec int64) Timespec { @@ -48,21 +47,17 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } -func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - var length = uint64(count) - - _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) - - written = int(length) - - if e1 != 0 { - err = e1 - } - return -} - func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of darwin/amd64 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL + +//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 +//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 +//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64 +//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64 +//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64 +//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64 +//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64 +//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64 diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go index faae207a47803..4a284cf5025f2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go @@ -6,7 +6,6 @@ package unix import ( "syscall" - "unsafe" ) func setTimespec(sec, nsec int64) Timespec { @@ -46,21 +45,20 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } -func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - var length = uint64(count) - - _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) - - written = int(length) - - if e1 != 0 { - err = e1 - } - return -} - func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of darwin/arm the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL + +//sys Fstat(fd int, stat *Stat_t) (err error) +//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) +//sys Fstatfs(fd int, stat *Statfs_t) (err error) +//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT +//sys Lstat(path string, stat *Stat_t) (err error) +//sys Stat(path string, stat *Stat_t) (err error) +//sys Statfs(path string, stat *Statfs_t) (err error) + +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + return 0, ENOSYS +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go index d6d962801426b..52dcd88f6bf98 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go @@ -8,7 +8,6 @@ package unix import ( "syscall" - "unsafe" ) func setTimespec(sec, nsec int64) Timespec { @@ -48,21 +47,20 @@ func (cmsg *Cmsghdr) SetLen(length int) { cmsg.Len = uint32(length) } -func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - var length = uint64(count) - - _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) - - written = int(length) - - if e1 != 0 { - err = e1 - } - return -} - func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions // of darwin/arm64 the syscall is called sysctl instead of __sysctl. const SYS___SYSCTL = SYS_SYSCTL + +//sys Fstat(fd int, stat *Stat_t) (err error) +//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) +//sys Fstatfs(fd int, stat *Statfs_t) (err error) +//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT +//sys Lstat(path string, stat *Stat_t) (err error) +//sys Stat(path string, stat *Stat_t) (err error) +//sys Statfs(path string, stat *Statfs_t) (err error) + +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + return 0, ENOSYS +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go new file mode 100644 index 0000000000000..4b4ae460f2ff9 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go @@ -0,0 +1,31 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build darwin,go1.12 + +package unix + +import "unsafe" + +// Implemented in the runtime package (runtime/sys_darwin.go) +func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) +func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) +func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) +func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only +func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) +func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) + +//go:linkname syscall_syscall syscall.syscall +//go:linkname syscall_syscall6 syscall.syscall6 +//go:linkname syscall_syscall6X syscall.syscall6X +//go:linkname syscall_syscall9 syscall.syscall9 +//go:linkname syscall_rawSyscall syscall.rawSyscall +//go:linkname syscall_rawSyscall6 syscall.rawSyscall6 + +// Find the entry point for f. See comments in runtime/proc.go for the +// function of the same name. +//go:nosplit +func funcPC(f func()) uintptr { + return **(**uintptr)(unsafe.Pointer(&f)) +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go index 7565105752ce6..891c94d7e26b6 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go @@ -234,6 +234,13 @@ func Uname(uname *Utsname) error { return nil } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + return sendfile(outfd, infd, offset, count) +} + /* * Exposed directly */ diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go index 085a808cc63d7..a7ca1ebea315e 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -500,6 +500,13 @@ func convertFromDirents11(buf []byte, old []byte) int { return dstPos } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + return sendfile(outfd, infd, offset, count) +} + /* * Exposed directly */ diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go index c2c7a000e78e9..77604023335b6 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1360,6 +1360,13 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri return mount(source, target, fstype, flags, datap) } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + return sendfile(outfd, infd, offset, count) +} + // Sendto // Recvfrom // Socketpair diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 059327a363b21..5240e16e4b34f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -244,6 +244,13 @@ func Uname(uname *Utsname) error { return nil } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + return sendfile(outfd, infd, offset, count) +} + /* * Exposed directly */ diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 5a398f8170f96..687999549c800 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -94,6 +94,13 @@ func Getwd() (string, error) { return string(buf[:n]), nil } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + return sendfile(outfd, infd, offset, count) +} + // TODO func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { return -1, ENOSYS diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go index 53b8078282eab..e4780127537d8 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -585,6 +585,13 @@ func Poll(fds []PollFd, timeout int) (n int, err error) { return poll(&fds[0], len(fds), timeout) } +func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + return sendfile(outfd, infd, offset, count) +} + /* * Exposed directly */ diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go index a21486f658c6d..33583a22b67c4 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -351,13 +351,6 @@ func Socketpair(domain, typ, proto int) (fd [2]int, err error) { return } -func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - return sendfile(outfd, infd, offset, count) -} - var ioSync int64 func CloseOnExec(fd int) { fcntl(fd, F_SETFD, FD_CLOEXEC) } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go index 0a28f6e5d48c2..c1b1ea59a0adc 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go @@ -337,6 +337,12 @@ func TestRlimit(t *testing.T) { } set := rlimit set.Cur = set.Max - 1 + if runtime.GOOS == "darwin" && set.Cur > 10240 { + // The max file limit is 10240, even though + // the max returned by Getrlimit is 1<<63-1. + // This is OPEN_MAX in sys/syslimits.h. + set.Cur = 10240 + } err = unix.Setrlimit(unix.RLIMIT_NOFILE, &set) if err != nil { t.Fatalf("Setrlimit: set failed: %#v %v", set, err) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index ba93f3e53c193..38cdd81a3e98f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -11,1782 +11,2426 @@ package unix import "syscall" const ( - AF_ALG = 0x26 - AF_APPLETALK = 0x5 - AF_ASH = 0x12 - AF_ATMPVC = 0x8 - AF_ATMSVC = 0x14 - AF_AX25 = 0x3 - AF_BLUETOOTH = 0x1f - AF_BRIDGE = 0x7 - AF_CAIF = 0x25 - AF_CAN = 0x1d - AF_DECnet = 0xc - AF_ECONET = 0x13 - AF_FILE = 0x1 - AF_IB = 0x1b - AF_IEEE802154 = 0x24 - AF_INET = 0x2 - AF_INET6 = 0xa - AF_IPX = 0x4 - AF_IRDA = 0x17 - AF_ISDN = 0x22 - AF_IUCV = 0x20 - AF_KCM = 0x29 - AF_KEY = 0xf - AF_LLC = 0x1a - AF_LOCAL = 0x1 - AF_MAX = 0x2a - AF_MPLS = 0x1c - AF_NETBEUI = 0xd - AF_NETLINK = 0x10 - AF_NETROM = 0x6 - AF_NFC = 0x27 - AF_PACKET = 0x11 - AF_PHONET = 0x23 - AF_PPPOX = 0x18 - AF_RDS = 0x15 - AF_ROSE = 0xb - AF_ROUTE = 0x10 - AF_RXRPC = 0x21 - AF_SECURITY = 0xe - AF_SNA = 0x16 - AF_TIPC = 0x1e - AF_UNIX = 0x1 - AF_UNSPEC = 0x0 - AF_VSOCK = 0x28 - AF_WANPIPE = 0x19 - AF_X25 = 0x9 - ALG_OP_DECRYPT = 0x0 - ALG_OP_ENCRYPT = 0x1 - ALG_SET_AEAD_ASSOCLEN = 0x4 - ALG_SET_AEAD_AUTHSIZE = 0x5 - ALG_SET_IV = 0x2 - ALG_SET_KEY = 0x1 - ALG_SET_OP = 0x3 - ARPHRD_6LOWPAN = 0x339 - ARPHRD_ADAPT = 0x108 - ARPHRD_APPLETLK = 0x8 - ARPHRD_ARCNET = 0x7 - ARPHRD_ASH = 0x30d - ARPHRD_ATM = 0x13 - ARPHRD_AX25 = 0x3 - ARPHRD_BIF = 0x307 - ARPHRD_CAIF = 0x336 - ARPHRD_CAN = 0x118 - ARPHRD_CHAOS = 0x5 - ARPHRD_CISCO = 0x201 - ARPHRD_CSLIP = 0x101 - ARPHRD_CSLIP6 = 0x103 - ARPHRD_DDCMP = 0x205 - ARPHRD_DLCI = 0xf - ARPHRD_ECONET = 0x30e - ARPHRD_EETHER = 0x2 - ARPHRD_ETHER = 0x1 - ARPHRD_EUI64 = 0x1b - ARPHRD_FCAL = 0x311 - ARPHRD_FCFABRIC = 0x313 - ARPHRD_FCPL = 0x312 - ARPHRD_FCPP = 0x310 - ARPHRD_FDDI = 0x306 - ARPHRD_FRAD = 0x302 - ARPHRD_HDLC = 0x201 - ARPHRD_HIPPI = 0x30c - ARPHRD_HWX25 = 0x110 - ARPHRD_IEEE1394 = 0x18 - ARPHRD_IEEE802 = 0x6 - ARPHRD_IEEE80211 = 0x321 - ARPHRD_IEEE80211_PRISM = 0x322 - ARPHRD_IEEE80211_RADIOTAP = 0x323 - ARPHRD_IEEE802154 = 0x324 - ARPHRD_IEEE802154_MONITOR = 0x325 - ARPHRD_IEEE802_TR = 0x320 - ARPHRD_INFINIBAND = 0x20 - ARPHRD_IP6GRE = 0x337 - ARPHRD_IPDDP = 0x309 - ARPHRD_IPGRE = 0x30a - ARPHRD_IRDA = 0x30f - ARPHRD_LAPB = 0x204 - ARPHRD_LOCALTLK = 0x305 - ARPHRD_LOOPBACK = 0x304 - ARPHRD_METRICOM = 0x17 - ARPHRD_NETLINK = 0x338 - ARPHRD_NETROM = 0x0 - ARPHRD_NONE = 0xfffe - ARPHRD_PHONET = 0x334 - ARPHRD_PHONET_PIPE = 0x335 - ARPHRD_PIMREG = 0x30b - ARPHRD_PPP = 0x200 - ARPHRD_PRONET = 0x4 - ARPHRD_RAWHDLC = 0x206 - ARPHRD_ROSE = 0x10e - ARPHRD_RSRVD = 0x104 - ARPHRD_SIT = 0x308 - ARPHRD_SKIP = 0x303 - ARPHRD_SLIP = 0x100 - ARPHRD_SLIP6 = 0x102 - ARPHRD_TUNNEL = 0x300 - ARPHRD_TUNNEL6 = 0x301 - ARPHRD_VOID = 0xffff - ARPHRD_X25 = 0x10f - ASI_LEON_DFLUSH = 0x11 - ASI_LEON_IFLUSH = 0x10 - ASI_LEON_MMUFLUSH = 0x18 - B0 = 0x0 - B1000000 = 0x100c - B110 = 0x3 - B115200 = 0x1002 - B1152000 = 0x100d - B1200 = 0x9 - B134 = 0x4 - B150 = 0x5 - B1500000 = 0x100e - B153600 = 0x1006 - B1800 = 0xa - B19200 = 0xe - B200 = 0x6 - B2000000 = 0x100f - B230400 = 0x1003 - B2400 = 0xb - B300 = 0x7 - B307200 = 0x1007 - B38400 = 0xf - B460800 = 0x1004 - B4800 = 0xc - B50 = 0x1 - B500000 = 0x100a - B57600 = 0x1001 - B576000 = 0x100b - B600 = 0x8 - B614400 = 0x1008 - B75 = 0x2 - B76800 = 0x1005 - B921600 = 0x1009 - B9600 = 0xd - BLKBSZGET = 0x80081270 - BLKBSZSET = 0x40081271 - BLKFLSBUF = 0x1261 - BLKFRAGET = 0x1265 - BLKFRASET = 0x1264 - BLKGETSIZE = 0x1260 - BLKGETSIZE64 = 0x80081272 - BLKRAGET = 0x1263 - BLKRASET = 0x1262 - BLKROGET = 0x125e - BLKROSET = 0x125d - BLKRRPART = 0x125f - BLKSECTGET = 0x1267 - BLKSECTSET = 0x1266 - BLKSSZGET = 0x1268 - BOTHER = 0x1000 - BPF_A = 0x10 - BPF_ABS = 0x20 - BPF_ADD = 0x0 - BPF_ALU = 0x4 - BPF_AND = 0x50 - BPF_B = 0x10 - BPF_DIV = 0x30 - BPF_H = 0x8 - BPF_IMM = 0x0 - BPF_IND = 0x40 - BPF_JA = 0x0 - BPF_JEQ = 0x10 - BPF_JGE = 0x30 - BPF_JGT = 0x20 - BPF_JMP = 0x5 - BPF_JSET = 0x40 - BPF_K = 0x0 - BPF_LD = 0x0 - BPF_LDX = 0x1 - BPF_LEN = 0x80 - BPF_LL_OFF = -0x200000 - BPF_LSH = 0x60 - BPF_MAJOR_VERSION = 0x1 - BPF_MAXINSNS = 0x1000 - BPF_MEM = 0x60 - BPF_MEMWORDS = 0x10 - BPF_MINOR_VERSION = 0x1 - BPF_MISC = 0x7 - BPF_MOD = 0x90 - BPF_MSH = 0xa0 - BPF_MUL = 0x20 - BPF_NEG = 0x80 - BPF_NET_OFF = -0x100000 - BPF_OR = 0x40 - BPF_RET = 0x6 - BPF_RSH = 0x70 - BPF_ST = 0x2 - BPF_STX = 0x3 - BPF_SUB = 0x10 - BPF_TAX = 0x0 - BPF_TXA = 0x80 - BPF_W = 0x0 - BPF_X = 0x8 - BPF_XOR = 0xa0 - BRKINT = 0x2 - BS0 = 0x0 - BS1 = 0x2000 - BSDLY = 0x2000 - CAN_BCM = 0x2 - CAN_EFF_FLAG = 0x80000000 - CAN_EFF_ID_BITS = 0x1d - CAN_EFF_MASK = 0x1fffffff - CAN_ERR_FLAG = 0x20000000 - CAN_ERR_MASK = 0x1fffffff - CAN_INV_FILTER = 0x20000000 - CAN_ISOTP = 0x6 - CAN_MAX_DLC = 0x8 - CAN_MAX_DLEN = 0x8 - CAN_MCNET = 0x5 - CAN_MTU = 0x10 - CAN_NPROTO = 0x7 - CAN_RAW = 0x1 - CAN_RTR_FLAG = 0x40000000 - CAN_SFF_ID_BITS = 0xb - CAN_SFF_MASK = 0x7ff - CAN_TP16 = 0x3 - CAN_TP20 = 0x4 - CBAUD = 0x100f - CBAUDEX = 0x1000 - CFLUSH = 0xf - CIBAUD = 0x100f0000 - CLOCAL = 0x800 - CLOCK_BOOTTIME = 0x7 - CLOCK_BOOTTIME_ALARM = 0x9 - CLOCK_DEFAULT = 0x0 - CLOCK_EXT = 0x1 - CLOCK_INT = 0x2 - CLOCK_MONOTONIC = 0x1 - CLOCK_MONOTONIC_COARSE = 0x6 - CLOCK_MONOTONIC_RAW = 0x4 - CLOCK_PROCESS_CPUTIME_ID = 0x2 - CLOCK_REALTIME = 0x0 - CLOCK_REALTIME_ALARM = 0x8 - CLOCK_REALTIME_COARSE = 0x5 - CLOCK_TAI = 0xb - CLOCK_THREAD_CPUTIME_ID = 0x3 - CLOCK_TXFROMRX = 0x4 - CLOCK_TXINT = 0x3 - CLONE_CHILD_CLEARTID = 0x200000 - CLONE_CHILD_SETTID = 0x1000000 - CLONE_DETACHED = 0x400000 - CLONE_FILES = 0x400 - CLONE_FS = 0x200 - CLONE_IO = 0x80000000 - CLONE_NEWCGROUP = 0x2000000 - CLONE_NEWIPC = 0x8000000 - CLONE_NEWNET = 0x40000000 - CLONE_NEWNS = 0x20000 - CLONE_NEWPID = 0x20000000 - CLONE_NEWUSER = 0x10000000 - CLONE_NEWUTS = 0x4000000 - CLONE_PARENT = 0x8000 - CLONE_PARENT_SETTID = 0x100000 - CLONE_PTRACE = 0x2000 - CLONE_SETTLS = 0x80000 - CLONE_SIGHAND = 0x800 - CLONE_SYSVSEM = 0x40000 - CLONE_THREAD = 0x10000 - CLONE_UNTRACED = 0x800000 - CLONE_VFORK = 0x4000 - CLONE_VM = 0x100 - CMSPAR = 0x40000000 - CR0 = 0x0 - CR1 = 0x200 - CR2 = 0x400 - CR3 = 0x600 - CRDLY = 0x600 - CREAD = 0x80 - CRTSCTS = 0x80000000 - CS5 = 0x0 - CS6 = 0x10 - CS7 = 0x20 - CS8 = 0x30 - CSIGNAL = 0xff - CSIZE = 0x30 - CSTART = 0x11 - CSTATUS = 0x0 - CSTOP = 0x13 - CSTOPB = 0x40 - CSUSP = 0x1a - DT_BLK = 0x6 - DT_CHR = 0x2 - DT_DIR = 0x4 - DT_FIFO = 0x1 - DT_LNK = 0xa - DT_REG = 0x8 - DT_SOCK = 0xc - DT_UNKNOWN = 0x0 - DT_WHT = 0xe - ECHO = 0x8 - ECHOCTL = 0x200 - ECHOE = 0x10 - ECHOK = 0x20 - ECHOKE = 0x800 - ECHONL = 0x40 - ECHOPRT = 0x400 - EMT_TAGOVF = 0x1 - ENCODING_DEFAULT = 0x0 - ENCODING_FM_MARK = 0x3 - ENCODING_FM_SPACE = 0x4 - ENCODING_MANCHESTER = 0x5 - ENCODING_NRZ = 0x1 - ENCODING_NRZI = 0x2 - EPOLLERR = 0x8 - EPOLLET = 0x80000000 - EPOLLEXCLUSIVE = 0x10000000 - EPOLLHUP = 0x10 - EPOLLIN = 0x1 - EPOLLMSG = 0x400 - EPOLLONESHOT = 0x40000000 - EPOLLOUT = 0x4 - EPOLLPRI = 0x2 - EPOLLRDBAND = 0x80 - EPOLLRDHUP = 0x2000 - EPOLLRDNORM = 0x40 - EPOLLWAKEUP = 0x20000000 - EPOLLWRBAND = 0x200 - EPOLLWRNORM = 0x100 - EPOLL_CLOEXEC = 0x400000 - EPOLL_CTL_ADD = 0x1 - EPOLL_CTL_DEL = 0x2 - EPOLL_CTL_MOD = 0x3 - ETH_P_1588 = 0x88f7 - ETH_P_8021AD = 0x88a8 - ETH_P_8021AH = 0x88e7 - ETH_P_8021Q = 0x8100 - ETH_P_80221 = 0x8917 - ETH_P_802_2 = 0x4 - ETH_P_802_3 = 0x1 - ETH_P_802_3_MIN = 0x600 - ETH_P_802_EX1 = 0x88b5 - ETH_P_AARP = 0x80f3 - ETH_P_AF_IUCV = 0xfbfb - ETH_P_ALL = 0x3 - ETH_P_AOE = 0x88a2 - ETH_P_ARCNET = 0x1a - ETH_P_ARP = 0x806 - ETH_P_ATALK = 0x809b - ETH_P_ATMFATE = 0x8884 - ETH_P_ATMMPOA = 0x884c - ETH_P_AX25 = 0x2 - ETH_P_BATMAN = 0x4305 - ETH_P_BPQ = 0x8ff - ETH_P_CAIF = 0xf7 - ETH_P_CAN = 0xc - ETH_P_CANFD = 0xd - ETH_P_CONTROL = 0x16 - ETH_P_CUST = 0x6006 - ETH_P_DDCMP = 0x6 - ETH_P_DEC = 0x6000 - ETH_P_DIAG = 0x6005 - ETH_P_DNA_DL = 0x6001 - ETH_P_DNA_RC = 0x6002 - ETH_P_DNA_RT = 0x6003 - ETH_P_DSA = 0x1b - ETH_P_ECONET = 0x18 - ETH_P_EDSA = 0xdada - ETH_P_FCOE = 0x8906 - ETH_P_FIP = 0x8914 - ETH_P_HDLC = 0x19 - ETH_P_HSR = 0x892f - ETH_P_IEEE802154 = 0xf6 - ETH_P_IEEEPUP = 0xa00 - ETH_P_IEEEPUPAT = 0xa01 - ETH_P_IP = 0x800 - ETH_P_IPV6 = 0x86dd - ETH_P_IPX = 0x8137 - ETH_P_IRDA = 0x17 - ETH_P_LAT = 0x6004 - ETH_P_LINK_CTL = 0x886c - ETH_P_LOCALTALK = 0x9 - ETH_P_LOOP = 0x60 - ETH_P_LOOPBACK = 0x9000 - ETH_P_MACSEC = 0x88e5 - ETH_P_MOBITEX = 0x15 - ETH_P_MPLS_MC = 0x8848 - ETH_P_MPLS_UC = 0x8847 - ETH_P_MVRP = 0x88f5 - ETH_P_PAE = 0x888e - ETH_P_PAUSE = 0x8808 - ETH_P_PHONET = 0xf5 - ETH_P_PPPTALK = 0x10 - ETH_P_PPP_DISC = 0x8863 - ETH_P_PPP_MP = 0x8 - ETH_P_PPP_SES = 0x8864 - ETH_P_PRP = 0x88fb - ETH_P_PUP = 0x200 - ETH_P_PUPAT = 0x201 - ETH_P_QINQ1 = 0x9100 - ETH_P_QINQ2 = 0x9200 - ETH_P_QINQ3 = 0x9300 - ETH_P_RARP = 0x8035 - ETH_P_SCA = 0x6007 - ETH_P_SLOW = 0x8809 - ETH_P_SNAP = 0x5 - ETH_P_TDLS = 0x890d - ETH_P_TEB = 0x6558 - ETH_P_TIPC = 0x88ca - ETH_P_TRAILER = 0x1c - ETH_P_TR_802_2 = 0x11 - ETH_P_TSN = 0x22f0 - ETH_P_WAN_PPP = 0x7 - ETH_P_WCCP = 0x883e - ETH_P_X25 = 0x805 - ETH_P_XDSA = 0xf8 - EXTA = 0xe - EXTB = 0xf - EXTPROC = 0x10000 - FALLOC_FL_COLLAPSE_RANGE = 0x8 - FALLOC_FL_INSERT_RANGE = 0x20 - FALLOC_FL_KEEP_SIZE = 0x1 - FALLOC_FL_NO_HIDE_STALE = 0x4 - FALLOC_FL_PUNCH_HOLE = 0x2 - FALLOC_FL_ZERO_RANGE = 0x10 - FD_CLOEXEC = 0x1 - FD_SETSIZE = 0x400 - FF0 = 0x0 - FF1 = 0x8000 - FFDLY = 0x8000 - FLUSHO = 0x2000 - F_DUPFD = 0x0 - F_DUPFD_CLOEXEC = 0x406 - F_EXLCK = 0x4 - F_GETFD = 0x1 - F_GETFL = 0x3 - F_GETLEASE = 0x401 - F_GETLK = 0x7 - F_GETLK64 = 0x7 - F_GETOWN = 0x5 - F_GETOWN_EX = 0x10 - F_GETPIPE_SZ = 0x408 - F_GETSIG = 0xb - F_LOCK = 0x1 - F_NOTIFY = 0x402 - F_OFD_GETLK = 0x24 - F_OFD_SETLK = 0x25 - F_OFD_SETLKW = 0x26 - F_OK = 0x0 - F_RDLCK = 0x1 - F_SETFD = 0x2 - F_SETFL = 0x4 - F_SETLEASE = 0x400 - F_SETLK = 0x8 - F_SETLK64 = 0x8 - F_SETLKW = 0x9 - F_SETLKW64 = 0x9 - F_SETOWN = 0x6 - F_SETOWN_EX = 0xf - F_SETPIPE_SZ = 0x407 - F_SETSIG = 0xa - F_SHLCK = 0x8 - F_TEST = 0x3 - F_TLOCK = 0x2 - F_ULOCK = 0x0 - F_UNLCK = 0x3 - F_WRLCK = 0x2 - GRND_NONBLOCK = 0x1 - GRND_RANDOM = 0x2 - HUPCL = 0x400 - IBSHIFT = 0x10 - ICANON = 0x2 - ICMPV6_FILTER = 0x1 - ICRNL = 0x100 - IEXTEN = 0x8000 - IFA_F_DADFAILED = 0x8 - IFA_F_DEPRECATED = 0x20 - IFA_F_HOMEADDRESS = 0x10 - IFA_F_MANAGETEMPADDR = 0x100 - IFA_F_MCAUTOJOIN = 0x400 - IFA_F_NODAD = 0x2 - IFA_F_NOPREFIXROUTE = 0x200 - IFA_F_OPTIMISTIC = 0x4 - IFA_F_PERMANENT = 0x80 - IFA_F_SECONDARY = 0x1 - IFA_F_STABLE_PRIVACY = 0x800 - IFA_F_TEMPORARY = 0x1 - IFA_F_TENTATIVE = 0x40 - IFA_MAX = 0x8 - IFF_ALLMULTI = 0x200 - IFF_ATTACH_QUEUE = 0x200 - IFF_AUTOMEDIA = 0x4000 - IFF_BROADCAST = 0x2 - IFF_DEBUG = 0x4 - IFF_DETACH_QUEUE = 0x400 - IFF_DORMANT = 0x20000 - IFF_DYNAMIC = 0x8000 - IFF_ECHO = 0x40000 - IFF_LOOPBACK = 0x8 - IFF_LOWER_UP = 0x10000 - IFF_MASTER = 0x400 - IFF_MULTICAST = 0x1000 - IFF_MULTI_QUEUE = 0x100 - IFF_NOARP = 0x80 - IFF_NOFILTER = 0x1000 - IFF_NOTRAILERS = 0x20 - IFF_NO_PI = 0x1000 - IFF_ONE_QUEUE = 0x2000 - IFF_PERSIST = 0x800 - IFF_POINTOPOINT = 0x10 - IFF_PORTSEL = 0x2000 - IFF_PROMISC = 0x100 - IFF_RUNNING = 0x40 - IFF_SLAVE = 0x800 - IFF_TAP = 0x2 - IFF_TUN = 0x1 - IFF_TUN_EXCL = 0x8000 - IFF_UP = 0x1 - IFF_VNET_HDR = 0x4000 - IFF_VOLATILE = 0x70c5a - IFNAMSIZ = 0x10 - IGNBRK = 0x1 - IGNCR = 0x80 - IGNPAR = 0x4 - IMAXBEL = 0x2000 - INLCR = 0x40 - INPCK = 0x10 - IN_ACCESS = 0x1 - IN_ALL_EVENTS = 0xfff - IN_ATTRIB = 0x4 - IN_CLASSA_HOST = 0xffffff - IN_CLASSA_MAX = 0x80 - IN_CLASSA_NET = 0xff000000 - IN_CLASSA_NSHIFT = 0x18 - IN_CLASSB_HOST = 0xffff - IN_CLASSB_MAX = 0x10000 - IN_CLASSB_NET = 0xffff0000 - IN_CLASSB_NSHIFT = 0x10 - IN_CLASSC_HOST = 0xff - IN_CLASSC_NET = 0xffffff00 - IN_CLASSC_NSHIFT = 0x8 - IN_CLOEXEC = 0x400000 - IN_CLOSE = 0x18 - IN_CLOSE_NOWRITE = 0x10 - IN_CLOSE_WRITE = 0x8 - IN_CREATE = 0x100 - IN_DELETE = 0x200 - IN_DELETE_SELF = 0x400 - IN_DONT_FOLLOW = 0x2000000 - IN_EXCL_UNLINK = 0x4000000 - IN_IGNORED = 0x8000 - IN_ISDIR = 0x40000000 - IN_LOOPBACKNET = 0x7f - IN_MASK_ADD = 0x20000000 - IN_MODIFY = 0x2 - IN_MOVE = 0xc0 - IN_MOVED_FROM = 0x40 - IN_MOVED_TO = 0x80 - IN_MOVE_SELF = 0x800 - IN_NONBLOCK = 0x4000 - IN_ONESHOT = 0x80000000 - IN_ONLYDIR = 0x1000000 - IN_OPEN = 0x20 - IN_Q_OVERFLOW = 0x4000 - IN_UNMOUNT = 0x2000 - IPPROTO_AH = 0x33 - IPPROTO_BEETPH = 0x5e - IPPROTO_COMP = 0x6c - IPPROTO_DCCP = 0x21 - IPPROTO_DSTOPTS = 0x3c - IPPROTO_EGP = 0x8 - IPPROTO_ENCAP = 0x62 - IPPROTO_ESP = 0x32 - IPPROTO_FRAGMENT = 0x2c - IPPROTO_GRE = 0x2f - IPPROTO_HOPOPTS = 0x0 - IPPROTO_ICMP = 0x1 - IPPROTO_ICMPV6 = 0x3a - IPPROTO_IDP = 0x16 - IPPROTO_IGMP = 0x2 - IPPROTO_IP = 0x0 - IPPROTO_IPIP = 0x4 - IPPROTO_IPV6 = 0x29 - IPPROTO_MH = 0x87 - IPPROTO_MPLS = 0x89 - IPPROTO_MTP = 0x5c - IPPROTO_NONE = 0x3b - IPPROTO_PIM = 0x67 - IPPROTO_PUP = 0xc - IPPROTO_RAW = 0xff - IPPROTO_ROUTING = 0x2b - IPPROTO_RSVP = 0x2e - IPPROTO_SCTP = 0x84 - IPPROTO_TCP = 0x6 - IPPROTO_TP = 0x1d - IPPROTO_UDP = 0x11 - IPPROTO_UDPLITE = 0x88 - IPV6_2292DSTOPTS = 0x4 - IPV6_2292HOPLIMIT = 0x8 - IPV6_2292HOPOPTS = 0x3 - IPV6_2292PKTINFO = 0x2 - IPV6_2292PKTOPTIONS = 0x6 - IPV6_2292RTHDR = 0x5 - IPV6_ADDRFORM = 0x1 - IPV6_ADD_MEMBERSHIP = 0x14 - IPV6_AUTHHDR = 0xa - IPV6_CHECKSUM = 0x7 - IPV6_DONTFRAG = 0x3e - IPV6_DROP_MEMBERSHIP = 0x15 - IPV6_DSTOPTS = 0x3b - IPV6_HDRINCL = 0x24 - IPV6_HOPLIMIT = 0x34 - IPV6_HOPOPTS = 0x36 - IPV6_IPSEC_POLICY = 0x22 - IPV6_JOIN_ANYCAST = 0x1b - IPV6_JOIN_GROUP = 0x14 - IPV6_LEAVE_ANYCAST = 0x1c - IPV6_LEAVE_GROUP = 0x15 - IPV6_MTU = 0x18 - IPV6_MTU_DISCOVER = 0x17 - IPV6_MULTICAST_HOPS = 0x12 - IPV6_MULTICAST_IF = 0x11 - IPV6_MULTICAST_LOOP = 0x13 - IPV6_NEXTHOP = 0x9 - IPV6_PATHMTU = 0x3d - IPV6_PKTINFO = 0x32 - IPV6_PMTUDISC_DO = 0x2 - IPV6_PMTUDISC_DONT = 0x0 - IPV6_PMTUDISC_INTERFACE = 0x4 - IPV6_PMTUDISC_OMIT = 0x5 - IPV6_PMTUDISC_PROBE = 0x3 - IPV6_PMTUDISC_WANT = 0x1 - IPV6_RECVDSTOPTS = 0x3a - IPV6_RECVERR = 0x19 - IPV6_RECVHOPLIMIT = 0x33 - IPV6_RECVHOPOPTS = 0x35 - IPV6_RECVPATHMTU = 0x3c - IPV6_RECVPKTINFO = 0x31 - IPV6_RECVRTHDR = 0x38 - IPV6_RECVTCLASS = 0x42 - IPV6_ROUTER_ALERT = 0x16 - IPV6_RTHDR = 0x39 - IPV6_RTHDRDSTOPTS = 0x37 - IPV6_RTHDR_LOOSE = 0x0 - IPV6_RTHDR_STRICT = 0x1 - IPV6_RTHDR_TYPE_0 = 0x0 - IPV6_RXDSTOPTS = 0x3b - IPV6_RXHOPOPTS = 0x36 - IPV6_TCLASS = 0x43 - IPV6_UNICAST_HOPS = 0x10 - IPV6_V6ONLY = 0x1a - IPV6_XFRM_POLICY = 0x23 - IP_ADD_MEMBERSHIP = 0x23 - IP_ADD_SOURCE_MEMBERSHIP = 0x27 - IP_BIND_ADDRESS_NO_PORT = 0x18 - IP_BLOCK_SOURCE = 0x26 - IP_CHECKSUM = 0x17 - IP_DEFAULT_MULTICAST_LOOP = 0x1 - IP_DEFAULT_MULTICAST_TTL = 0x1 - IP_DF = 0x4000 - IP_DROP_MEMBERSHIP = 0x24 - IP_DROP_SOURCE_MEMBERSHIP = 0x28 - IP_FREEBIND = 0xf - IP_HDRINCL = 0x3 - IP_IPSEC_POLICY = 0x10 - IP_MAXPACKET = 0xffff - IP_MAX_MEMBERSHIPS = 0x14 - IP_MF = 0x2000 - IP_MINTTL = 0x15 - IP_MSFILTER = 0x29 - IP_MSS = 0x240 - IP_MTU = 0xe - IP_MTU_DISCOVER = 0xa - IP_MULTICAST_ALL = 0x31 - IP_MULTICAST_IF = 0x20 - IP_MULTICAST_LOOP = 0x22 - IP_MULTICAST_TTL = 0x21 - IP_NODEFRAG = 0x16 - IP_OFFMASK = 0x1fff - IP_OPTIONS = 0x4 - IP_ORIGDSTADDR = 0x14 - IP_PASSSEC = 0x12 - IP_PKTINFO = 0x8 - IP_PKTOPTIONS = 0x9 - IP_PMTUDISC = 0xa - IP_PMTUDISC_DO = 0x2 - IP_PMTUDISC_DONT = 0x0 - IP_PMTUDISC_INTERFACE = 0x4 - IP_PMTUDISC_OMIT = 0x5 - IP_PMTUDISC_PROBE = 0x3 - IP_PMTUDISC_WANT = 0x1 - IP_RECVERR = 0xb - IP_RECVOPTS = 0x6 - IP_RECVORIGDSTADDR = 0x14 - IP_RECVRETOPTS = 0x7 - IP_RECVTOS = 0xd - IP_RECVTTL = 0xc - IP_RETOPTS = 0x7 - IP_RF = 0x8000 - IP_ROUTER_ALERT = 0x5 - IP_TOS = 0x1 - IP_TRANSPARENT = 0x13 - IP_TTL = 0x2 - IP_UNBLOCK_SOURCE = 0x25 - IP_UNICAST_IF = 0x32 - IP_XFRM_POLICY = 0x11 - ISIG = 0x1 - ISTRIP = 0x20 - IUCLC = 0x200 - IUTF8 = 0x4000 - IXANY = 0x800 - IXOFF = 0x1000 - IXON = 0x400 - LINUX_REBOOT_CMD_CAD_OFF = 0x0 - LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef - LINUX_REBOOT_CMD_HALT = 0xcdef0123 - LINUX_REBOOT_CMD_KEXEC = 0x45584543 - LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc - LINUX_REBOOT_CMD_RESTART = 0x1234567 - LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4 - LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 - LINUX_REBOOT_MAGIC1 = 0xfee1dead - LINUX_REBOOT_MAGIC2 = 0x28121969 - LOCK_EX = 0x2 - LOCK_NB = 0x4 - LOCK_SH = 0x1 - LOCK_UN = 0x8 - MADV_DODUMP = 0x11 - MADV_DOFORK = 0xb - MADV_DONTDUMP = 0x10 - MADV_DONTFORK = 0xa - MADV_DONTNEED = 0x4 - MADV_FREE = 0x8 - MADV_HUGEPAGE = 0xe - MADV_HWPOISON = 0x64 - MADV_MERGEABLE = 0xc - MADV_NOHUGEPAGE = 0xf - MADV_NORMAL = 0x0 - MADV_RANDOM = 0x1 - MADV_REMOVE = 0x9 - MADV_SEQUENTIAL = 0x2 - MADV_UNMERGEABLE = 0xd - MADV_WILLNEED = 0x3 - MAP_ANON = 0x20 - MAP_ANONYMOUS = 0x20 - MAP_DENYWRITE = 0x800 - MAP_EXECUTABLE = 0x1000 - MAP_FILE = 0x0 - MAP_FIXED = 0x10 - MAP_GROWSDOWN = 0x200 - MAP_HUGETLB = 0x40000 - MAP_HUGE_MASK = 0x3f - MAP_HUGE_SHIFT = 0x1a - MAP_LOCKED = 0x100 - MAP_NONBLOCK = 0x10000 - MAP_NORESERVE = 0x40 - MAP_POPULATE = 0x8000 - MAP_PRIVATE = 0x2 - MAP_RENAME = 0x20 - MAP_SHARED = 0x1 - MAP_STACK = 0x20000 - MAP_TYPE = 0xf - MCL_CURRENT = 0x2000 - MCL_FUTURE = 0x4000 - MCL_ONFAULT = 0x8000 - MNT_DETACH = 0x2 - MNT_EXPIRE = 0x4 - MNT_FORCE = 0x1 - MSG_BATCH = 0x40000 - MSG_CMSG_CLOEXEC = 0x40000000 - MSG_CONFIRM = 0x800 - MSG_CTRUNC = 0x8 - MSG_DONTROUTE = 0x4 - MSG_DONTWAIT = 0x40 - MSG_EOR = 0x80 - MSG_ERRQUEUE = 0x2000 - MSG_FASTOPEN = 0x20000000 - MSG_FIN = 0x200 - MSG_MORE = 0x8000 - MSG_NOSIGNAL = 0x4000 - MSG_OOB = 0x1 - MSG_PEEK = 0x2 - MSG_PROXY = 0x10 - MSG_RST = 0x1000 - MSG_SYN = 0x400 - MSG_TRUNC = 0x20 - MSG_TRYHARD = 0x4 - MSG_WAITALL = 0x100 - MSG_WAITFORONE = 0x10000 - MS_ACTIVE = 0x40000000 - MS_ASYNC = 0x1 - MS_BIND = 0x1000 - MS_DIRSYNC = 0x80 - MS_INVALIDATE = 0x2 - MS_I_VERSION = 0x800000 - MS_KERNMOUNT = 0x400000 - MS_LAZYTIME = 0x2000000 - MS_MANDLOCK = 0x40 - MS_MGC_MSK = 0xffff0000 - MS_MGC_VAL = 0xc0ed0000 - MS_MOVE = 0x2000 - MS_NOATIME = 0x400 - MS_NODEV = 0x4 - MS_NODIRATIME = 0x800 - MS_NOEXEC = 0x8 - MS_NOSUID = 0x2 - MS_NOUSER = -0x80000000 - MS_POSIXACL = 0x10000 - MS_PRIVATE = 0x40000 - MS_RDONLY = 0x1 - MS_REC = 0x4000 - MS_RELATIME = 0x200000 - MS_REMOUNT = 0x20 - MS_RMT_MASK = 0x2800051 - MS_SHARED = 0x100000 - MS_SILENT = 0x8000 - MS_SLAVE = 0x80000 - MS_STRICTATIME = 0x1000000 - MS_SYNC = 0x4 - MS_SYNCHRONOUS = 0x10 - MS_UNBINDABLE = 0x20000 - NAME_MAX = 0xff - NETLINK_ADD_MEMBERSHIP = 0x1 - NETLINK_AUDIT = 0x9 - NETLINK_BROADCAST_ERROR = 0x4 - NETLINK_CAP_ACK = 0xa - NETLINK_CONNECTOR = 0xb - NETLINK_CRYPTO = 0x15 - NETLINK_DNRTMSG = 0xe - NETLINK_DROP_MEMBERSHIP = 0x2 - NETLINK_ECRYPTFS = 0x13 - NETLINK_FIB_LOOKUP = 0xa - NETLINK_FIREWALL = 0x3 - NETLINK_GENERIC = 0x10 - NETLINK_INET_DIAG = 0x4 - NETLINK_IP6_FW = 0xd - NETLINK_ISCSI = 0x8 - NETLINK_KOBJECT_UEVENT = 0xf - NETLINK_LISTEN_ALL_NSID = 0x8 - NETLINK_LIST_MEMBERSHIPS = 0x9 - NETLINK_NETFILTER = 0xc - NETLINK_NFLOG = 0x5 - NETLINK_NO_ENOBUFS = 0x5 - NETLINK_PKTINFO = 0x3 - NETLINK_RDMA = 0x14 - NETLINK_ROUTE = 0x0 - NETLINK_RX_RING = 0x6 - NETLINK_SCSITRANSPORT = 0x12 - NETLINK_SELINUX = 0x7 - NETLINK_SOCK_DIAG = 0x4 - NETLINK_TX_RING = 0x7 - NETLINK_UNUSED = 0x1 - NETLINK_USERSOCK = 0x2 - NETLINK_XFRM = 0x6 - NL0 = 0x0 - NL1 = 0x100 - NLA_ALIGNTO = 0x4 - NLA_F_NESTED = 0x8000 - NLA_F_NET_BYTEORDER = 0x4000 - NLA_HDRLEN = 0x4 - NLDLY = 0x100 - NLMSG_ALIGNTO = 0x4 - NLMSG_DONE = 0x3 - NLMSG_ERROR = 0x2 - NLMSG_HDRLEN = 0x10 - NLMSG_MIN_TYPE = 0x10 - NLMSG_NOOP = 0x1 - NLMSG_OVERRUN = 0x4 - NLM_F_ACK = 0x4 - NLM_F_APPEND = 0x800 - NLM_F_ATOMIC = 0x400 - NLM_F_CREATE = 0x400 - NLM_F_DUMP = 0x300 - NLM_F_DUMP_FILTERED = 0x20 - NLM_F_DUMP_INTR = 0x10 - NLM_F_ECHO = 0x8 - NLM_F_EXCL = 0x200 - NLM_F_MATCH = 0x200 - NLM_F_MULTI = 0x2 - NLM_F_REPLACE = 0x100 - NLM_F_REQUEST = 0x1 - NLM_F_ROOT = 0x100 - NOFLSH = 0x80 - OCRNL = 0x8 - OFDEL = 0x80 - OFILL = 0x40 - OLCUC = 0x2 - ONLCR = 0x4 - ONLRET = 0x20 - ONOCR = 0x10 - OPOST = 0x1 - O_ACCMODE = 0x3 - O_APPEND = 0x8 - O_ASYNC = 0x40 - O_CLOEXEC = 0x400000 - O_CREAT = 0x200 - O_DIRECT = 0x100000 - O_DIRECTORY = 0x10000 - O_DSYNC = 0x2000 - O_EXCL = 0x800 - O_FSYNC = 0x802000 - O_LARGEFILE = 0x0 - O_NDELAY = 0x4004 - O_NOATIME = 0x200000 - O_NOCTTY = 0x8000 - O_NOFOLLOW = 0x20000 - O_NONBLOCK = 0x4000 - O_PATH = 0x1000000 - O_RDONLY = 0x0 - O_RDWR = 0x2 - O_RSYNC = 0x802000 - O_SYNC = 0x802000 - O_TMPFILE = 0x2010000 - O_TRUNC = 0x400 - O_WRONLY = 0x1 - PACKET_ADD_MEMBERSHIP = 0x1 - PACKET_AUXDATA = 0x8 - PACKET_BROADCAST = 0x1 - PACKET_COPY_THRESH = 0x7 - PACKET_DROP_MEMBERSHIP = 0x2 - PACKET_FANOUT = 0x12 - PACKET_FANOUT_CBPF = 0x6 - PACKET_FANOUT_CPU = 0x2 - PACKET_FANOUT_DATA = 0x16 - PACKET_FANOUT_EBPF = 0x7 - PACKET_FANOUT_FLAG_DEFRAG = 0x8000 - PACKET_FANOUT_FLAG_ROLLOVER = 0x1000 - PACKET_FANOUT_HASH = 0x0 - PACKET_FANOUT_LB = 0x1 - PACKET_FANOUT_QM = 0x5 - PACKET_FANOUT_RND = 0x4 - PACKET_FANOUT_ROLLOVER = 0x3 - PACKET_FASTROUTE = 0x6 - PACKET_HDRLEN = 0xb - PACKET_HOST = 0x0 - PACKET_KERNEL = 0x7 - PACKET_LOOPBACK = 0x5 - PACKET_LOSS = 0xe - PACKET_MR_ALLMULTI = 0x2 - PACKET_MR_MULTICAST = 0x0 - PACKET_MR_PROMISC = 0x1 - PACKET_MR_UNICAST = 0x3 - PACKET_MULTICAST = 0x2 - PACKET_ORIGDEV = 0x9 - PACKET_OTHERHOST = 0x3 - PACKET_OUTGOING = 0x4 - PACKET_QDISC_BYPASS = 0x14 - PACKET_RECV_OUTPUT = 0x3 - PACKET_RESERVE = 0xc - PACKET_ROLLOVER_STATS = 0x15 - PACKET_RX_RING = 0x5 - PACKET_STATISTICS = 0x6 - PACKET_TIMESTAMP = 0x11 - PACKET_TX_HAS_OFF = 0x13 - PACKET_TX_RING = 0xd - PACKET_TX_TIMESTAMP = 0x10 - PACKET_USER = 0x6 - PACKET_VERSION = 0xa - PACKET_VNET_HDR = 0xf - PARENB = 0x100 - PARITY_CRC16_PR0 = 0x2 - PARITY_CRC16_PR0_CCITT = 0x4 - PARITY_CRC16_PR1 = 0x3 - PARITY_CRC16_PR1_CCITT = 0x5 - PARITY_CRC32_PR0_CCITT = 0x6 - PARITY_CRC32_PR1_CCITT = 0x7 - PARITY_DEFAULT = 0x0 - PARITY_NONE = 0x1 - PARMRK = 0x8 - PARODD = 0x200 - PENDIN = 0x4000 - PRIO_PGRP = 0x1 - PRIO_PROCESS = 0x0 - PRIO_USER = 0x2 - PROT_EXEC = 0x4 - PROT_GROWSDOWN = 0x1000000 - PROT_GROWSUP = 0x2000000 - PROT_NONE = 0x0 - PROT_READ = 0x1 - PROT_WRITE = 0x2 - PR_CAPBSET_DROP = 0x18 - PR_CAPBSET_READ = 0x17 - PR_CAP_AMBIENT = 0x2f - PR_CAP_AMBIENT_CLEAR_ALL = 0x4 - PR_CAP_AMBIENT_IS_SET = 0x1 - PR_CAP_AMBIENT_LOWER = 0x3 - PR_CAP_AMBIENT_RAISE = 0x2 - PR_ENDIAN_BIG = 0x0 - PR_ENDIAN_LITTLE = 0x1 - PR_ENDIAN_PPC_LITTLE = 0x2 - PR_FPEMU_NOPRINT = 0x1 - PR_FPEMU_SIGFPE = 0x2 - PR_FP_EXC_ASYNC = 0x2 - PR_FP_EXC_DISABLED = 0x0 - PR_FP_EXC_DIV = 0x10000 - PR_FP_EXC_INV = 0x100000 - PR_FP_EXC_NONRECOV = 0x1 - PR_FP_EXC_OVF = 0x20000 - PR_FP_EXC_PRECISE = 0x3 - PR_FP_EXC_RES = 0x80000 - PR_FP_EXC_SW_ENABLE = 0x80 - PR_FP_EXC_UND = 0x40000 - PR_FP_MODE_FR = 0x1 - PR_FP_MODE_FRE = 0x2 - PR_GET_CHILD_SUBREAPER = 0x25 - PR_GET_DUMPABLE = 0x3 - PR_GET_ENDIAN = 0x13 - PR_GET_FPEMU = 0x9 - PR_GET_FPEXC = 0xb - PR_GET_FP_MODE = 0x2e - PR_GET_KEEPCAPS = 0x7 - PR_GET_NAME = 0x10 - PR_GET_NO_NEW_PRIVS = 0x27 - PR_GET_PDEATHSIG = 0x2 - PR_GET_SECCOMP = 0x15 - PR_GET_SECUREBITS = 0x1b - PR_GET_THP_DISABLE = 0x2a - PR_GET_TID_ADDRESS = 0x28 - PR_GET_TIMERSLACK = 0x1e - PR_GET_TIMING = 0xd - PR_GET_TSC = 0x19 - PR_GET_UNALIGN = 0x5 - PR_MCE_KILL = 0x21 - PR_MCE_KILL_CLEAR = 0x0 - PR_MCE_KILL_DEFAULT = 0x2 - PR_MCE_KILL_EARLY = 0x1 - PR_MCE_KILL_GET = 0x22 - PR_MCE_KILL_LATE = 0x0 - PR_MCE_KILL_SET = 0x1 - PR_MPX_DISABLE_MANAGEMENT = 0x2c - PR_MPX_ENABLE_MANAGEMENT = 0x2b - PR_SET_CHILD_SUBREAPER = 0x24 - PR_SET_DUMPABLE = 0x4 - PR_SET_ENDIAN = 0x14 - PR_SET_FPEMU = 0xa - PR_SET_FPEXC = 0xc - PR_SET_FP_MODE = 0x2d - PR_SET_KEEPCAPS = 0x8 - PR_SET_MM = 0x23 - PR_SET_MM_ARG_END = 0x9 - PR_SET_MM_ARG_START = 0x8 - PR_SET_MM_AUXV = 0xc - PR_SET_MM_BRK = 0x7 - PR_SET_MM_END_CODE = 0x2 - PR_SET_MM_END_DATA = 0x4 - PR_SET_MM_ENV_END = 0xb - PR_SET_MM_ENV_START = 0xa - PR_SET_MM_EXE_FILE = 0xd - PR_SET_MM_MAP = 0xe - PR_SET_MM_MAP_SIZE = 0xf - PR_SET_MM_START_BRK = 0x6 - PR_SET_MM_START_CODE = 0x1 - PR_SET_MM_START_DATA = 0x3 - PR_SET_MM_START_STACK = 0x5 - PR_SET_NAME = 0xf - PR_SET_NO_NEW_PRIVS = 0x26 - PR_SET_PDEATHSIG = 0x1 - PR_SET_PTRACER = 0x59616d61 - PR_SET_PTRACER_ANY = -0x1 - PR_SET_SECCOMP = 0x16 - PR_SET_SECUREBITS = 0x1c - PR_SET_THP_DISABLE = 0x29 - PR_SET_TIMERSLACK = 0x1d - PR_SET_TIMING = 0xe - PR_SET_TSC = 0x1a - PR_SET_UNALIGN = 0x6 - PR_TASK_PERF_EVENTS_DISABLE = 0x1f - PR_TASK_PERF_EVENTS_ENABLE = 0x20 - PR_TIMING_STATISTICAL = 0x0 - PR_TIMING_TIMESTAMP = 0x1 - PR_TSC_ENABLE = 0x1 - PR_TSC_SIGSEGV = 0x2 - PR_UNALIGN_NOPRINT = 0x1 - PR_UNALIGN_SIGBUS = 0x2 - PTRACE_ATTACH = 0x10 - PTRACE_CONT = 0x7 - PTRACE_DETACH = 0x11 - PTRACE_EVENT_CLONE = 0x3 - PTRACE_EVENT_EXEC = 0x4 - PTRACE_EVENT_EXIT = 0x6 - PTRACE_EVENT_FORK = 0x1 - PTRACE_EVENT_SECCOMP = 0x7 - PTRACE_EVENT_STOP = 0x80 - PTRACE_EVENT_VFORK = 0x2 - PTRACE_EVENT_VFORK_DONE = 0x5 - PTRACE_GETEVENTMSG = 0x4201 - PTRACE_GETFPAREGS = 0x14 - PTRACE_GETFPREGS = 0xe - PTRACE_GETFPREGS64 = 0x19 - PTRACE_GETREGS = 0xc - PTRACE_GETREGS64 = 0x16 - PTRACE_GETREGSET = 0x4204 - PTRACE_GETSIGINFO = 0x4202 - PTRACE_GETSIGMASK = 0x420a - PTRACE_INTERRUPT = 0x4207 - PTRACE_KILL = 0x8 - PTRACE_LISTEN = 0x4208 - PTRACE_O_EXITKILL = 0x100000 - PTRACE_O_MASK = 0x3000ff - PTRACE_O_SUSPEND_SECCOMP = 0x200000 - PTRACE_O_TRACECLONE = 0x8 - PTRACE_O_TRACEEXEC = 0x10 - PTRACE_O_TRACEEXIT = 0x40 - PTRACE_O_TRACEFORK = 0x2 - PTRACE_O_TRACESECCOMP = 0x80 - PTRACE_O_TRACESYSGOOD = 0x1 - PTRACE_O_TRACEVFORK = 0x4 - PTRACE_O_TRACEVFORKDONE = 0x20 - PTRACE_PEEKDATA = 0x2 - PTRACE_PEEKSIGINFO = 0x4209 - PTRACE_PEEKSIGINFO_SHARED = 0x1 - PTRACE_PEEKTEXT = 0x1 - PTRACE_PEEKUSR = 0x3 - PTRACE_POKEDATA = 0x5 - PTRACE_POKETEXT = 0x4 - PTRACE_POKEUSR = 0x6 - PTRACE_READDATA = 0x10 - PTRACE_READTEXT = 0x12 - PTRACE_SECCOMP_GET_FILTER = 0x420c - PTRACE_SEIZE = 0x4206 - PTRACE_SETFPAREGS = 0x15 - PTRACE_SETFPREGS = 0xf - PTRACE_SETFPREGS64 = 0x1a - PTRACE_SETOPTIONS = 0x4200 - PTRACE_SETREGS = 0xd - PTRACE_SETREGS64 = 0x17 - PTRACE_SETREGSET = 0x4205 - PTRACE_SETSIGINFO = 0x4203 - PTRACE_SETSIGMASK = 0x420b - PTRACE_SINGLESTEP = 0x9 - PTRACE_SPARC_DETACH = 0xb - PTRACE_SYSCALL = 0x18 - PTRACE_TRACEME = 0x0 - PTRACE_WRITEDATA = 0x11 - PTRACE_WRITETEXT = 0x13 - PT_FP = 0x48 - PT_G0 = 0x10 - PT_G1 = 0x14 - PT_G2 = 0x18 - PT_G3 = 0x1c - PT_G4 = 0x20 - PT_G5 = 0x24 - PT_G6 = 0x28 - PT_G7 = 0x2c - PT_I0 = 0x30 - PT_I1 = 0x34 - PT_I2 = 0x38 - PT_I3 = 0x3c - PT_I4 = 0x40 - PT_I5 = 0x44 - PT_I6 = 0x48 - PT_I7 = 0x4c - PT_NPC = 0x8 - PT_PC = 0x4 - PT_PSR = 0x0 - PT_REGS_MAGIC = 0x57ac6c00 - PT_TNPC = 0x90 - PT_TPC = 0x88 - PT_TSTATE = 0x80 - PT_V9_FP = 0x70 - PT_V9_G0 = 0x0 - PT_V9_G1 = 0x8 - PT_V9_G2 = 0x10 - PT_V9_G3 = 0x18 - PT_V9_G4 = 0x20 - PT_V9_G5 = 0x28 - PT_V9_G6 = 0x30 - PT_V9_G7 = 0x38 - PT_V9_I0 = 0x40 - PT_V9_I1 = 0x48 - PT_V9_I2 = 0x50 - PT_V9_I3 = 0x58 - PT_V9_I4 = 0x60 - PT_V9_I5 = 0x68 - PT_V9_I6 = 0x70 - PT_V9_I7 = 0x78 - PT_V9_MAGIC = 0x9c - PT_V9_TNPC = 0x90 - PT_V9_TPC = 0x88 - PT_V9_TSTATE = 0x80 - PT_V9_Y = 0x98 - PT_WIM = 0x10 - PT_Y = 0xc - RLIMIT_AS = 0x9 - RLIMIT_CORE = 0x4 - RLIMIT_CPU = 0x0 - RLIMIT_DATA = 0x2 - RLIMIT_FSIZE = 0x1 - RLIMIT_NOFILE = 0x6 - RLIMIT_STACK = 0x3 - RLIM_INFINITY = -0x1 - RTAX_ADVMSS = 0x8 - RTAX_CC_ALGO = 0x10 - RTAX_CWND = 0x7 - RTAX_FEATURES = 0xc - RTAX_FEATURE_ALLFRAG = 0x8 - RTAX_FEATURE_ECN = 0x1 - RTAX_FEATURE_MASK = 0xf - RTAX_FEATURE_SACK = 0x2 - RTAX_FEATURE_TIMESTAMP = 0x4 - RTAX_HOPLIMIT = 0xa - RTAX_INITCWND = 0xb - RTAX_INITRWND = 0xe - RTAX_LOCK = 0x1 - RTAX_MAX = 0x10 - RTAX_MTU = 0x2 - RTAX_QUICKACK = 0xf - RTAX_REORDERING = 0x9 - RTAX_RTO_MIN = 0xd - RTAX_RTT = 0x4 - RTAX_RTTVAR = 0x5 - RTAX_SSTHRESH = 0x6 - RTAX_UNSPEC = 0x0 - RTAX_WINDOW = 0x3 - RTA_ALIGNTO = 0x4 - RTA_MAX = 0x18 - RTCF_DIRECTSRC = 0x4000000 - RTCF_DOREDIRECT = 0x1000000 - RTCF_LOG = 0x2000000 - RTCF_MASQ = 0x400000 - RTCF_NAT = 0x800000 - RTCF_VALVE = 0x200000 - RTF_ADDRCLASSMASK = 0xf8000000 - RTF_ADDRCONF = 0x40000 - RTF_ALLONLINK = 0x20000 - RTF_BROADCAST = 0x10000000 - RTF_CACHE = 0x1000000 - RTF_DEFAULT = 0x10000 - RTF_DYNAMIC = 0x10 - RTF_FLOW = 0x2000000 - RTF_GATEWAY = 0x2 - RTF_HOST = 0x4 - RTF_INTERFACE = 0x40000000 - RTF_IRTT = 0x100 - RTF_LINKRT = 0x100000 - RTF_LOCAL = 0x80000000 - RTF_MODIFIED = 0x20 - RTF_MSS = 0x40 - RTF_MTU = 0x40 - RTF_MULTICAST = 0x20000000 - RTF_NAT = 0x8000000 - RTF_NOFORWARD = 0x1000 - RTF_NONEXTHOP = 0x200000 - RTF_NOPMTUDISC = 0x4000 - RTF_POLICY = 0x4000000 - RTF_REINSTATE = 0x8 - RTF_REJECT = 0x200 - RTF_STATIC = 0x400 - RTF_THROW = 0x2000 - RTF_UP = 0x1 - RTF_WINDOW = 0x80 - RTF_XRESOLVE = 0x800 - RTM_BASE = 0x10 - RTM_DELACTION = 0x31 - RTM_DELADDR = 0x15 - RTM_DELADDRLABEL = 0x49 - RTM_DELLINK = 0x11 - RTM_DELMDB = 0x55 - RTM_DELNEIGH = 0x1d - RTM_DELNSID = 0x59 - RTM_DELQDISC = 0x25 - RTM_DELROUTE = 0x19 - RTM_DELRULE = 0x21 - RTM_DELTCLASS = 0x29 - RTM_DELTFILTER = 0x2d - RTM_F_CLONED = 0x200 - RTM_F_EQUALIZE = 0x400 - RTM_F_LOOKUP_TABLE = 0x1000 - RTM_F_NOTIFY = 0x100 - RTM_F_PREFIX = 0x800 - RTM_GETACTION = 0x32 - RTM_GETADDR = 0x16 - RTM_GETADDRLABEL = 0x4a - RTM_GETANYCAST = 0x3e - RTM_GETDCB = 0x4e - RTM_GETLINK = 0x12 - RTM_GETMDB = 0x56 - RTM_GETMULTICAST = 0x3a - RTM_GETNEIGH = 0x1e - RTM_GETNEIGHTBL = 0x42 - RTM_GETNETCONF = 0x52 - RTM_GETNSID = 0x5a - RTM_GETQDISC = 0x26 - RTM_GETROUTE = 0x1a - RTM_GETRULE = 0x22 - RTM_GETSTATS = 0x5e - RTM_GETTCLASS = 0x2a - RTM_GETTFILTER = 0x2e - RTM_MAX = 0x5f - RTM_NEWACTION = 0x30 - RTM_NEWADDR = 0x14 - RTM_NEWADDRLABEL = 0x48 - RTM_NEWLINK = 0x10 - RTM_NEWMDB = 0x54 - RTM_NEWNDUSEROPT = 0x44 - RTM_NEWNEIGH = 0x1c - RTM_NEWNEIGHTBL = 0x40 - RTM_NEWNETCONF = 0x50 - RTM_NEWNSID = 0x58 - RTM_NEWPREFIX = 0x34 - RTM_NEWQDISC = 0x24 - RTM_NEWROUTE = 0x18 - RTM_NEWRULE = 0x20 - RTM_NEWSTATS = 0x5c - RTM_NEWTCLASS = 0x28 - RTM_NEWTFILTER = 0x2c - RTM_NR_FAMILIES = 0x14 - RTM_NR_MSGTYPES = 0x50 - RTM_SETDCB = 0x4f - RTM_SETLINK = 0x13 - RTM_SETNEIGHTBL = 0x43 - RTNH_ALIGNTO = 0x4 - RTNH_COMPARE_MASK = 0x11 - RTNH_F_DEAD = 0x1 - RTNH_F_LINKDOWN = 0x10 - RTNH_F_OFFLOAD = 0x8 - RTNH_F_ONLINK = 0x4 - RTNH_F_PERVASIVE = 0x2 - RTN_MAX = 0xb - RTPROT_BABEL = 0x2a - RTPROT_BIRD = 0xc - RTPROT_BOOT = 0x3 - RTPROT_DHCP = 0x10 - RTPROT_DNROUTED = 0xd - RTPROT_GATED = 0x8 - RTPROT_KERNEL = 0x2 - RTPROT_MROUTED = 0x11 - RTPROT_MRT = 0xa - RTPROT_NTK = 0xf - RTPROT_RA = 0x9 - RTPROT_REDIRECT = 0x1 - RTPROT_STATIC = 0x4 - RTPROT_UNSPEC = 0x0 - RTPROT_XORP = 0xe - RTPROT_ZEBRA = 0xb - RT_CLASS_DEFAULT = 0xfd - RT_CLASS_LOCAL = 0xff - RT_CLASS_MAIN = 0xfe - RT_CLASS_MAX = 0xff - RT_CLASS_UNSPEC = 0x0 - RUSAGE_CHILDREN = -0x1 - RUSAGE_SELF = 0x0 - RUSAGE_THREAD = 0x1 - SCM_CREDENTIALS = 0x2 - SCM_RIGHTS = 0x1 - SCM_TIMESTAMP = 0x1d - SCM_TIMESTAMPING = 0x23 - SCM_TIMESTAMPNS = 0x21 - SCM_WIFI_STATUS = 0x25 - SHUT_RD = 0x0 - SHUT_RDWR = 0x2 - SHUT_WR = 0x1 - SIOCADDDLCI = 0x8980 - SIOCADDMULTI = 0x8931 - SIOCADDRT = 0x890b - SIOCATMARK = 0x8905 - SIOCBONDCHANGEACTIVE = 0x8995 - SIOCBONDENSLAVE = 0x8990 - SIOCBONDINFOQUERY = 0x8994 - SIOCBONDRELEASE = 0x8991 - SIOCBONDSETHWADDR = 0x8992 - SIOCBONDSLAVEINFOQUERY = 0x8993 - SIOCBRADDBR = 0x89a0 - SIOCBRADDIF = 0x89a2 - SIOCBRDELBR = 0x89a1 - SIOCBRDELIF = 0x89a3 - SIOCDARP = 0x8953 - SIOCDELDLCI = 0x8981 - SIOCDELMULTI = 0x8932 - SIOCDELRT = 0x890c - SIOCDEVPRIVATE = 0x89f0 - SIOCDIFADDR = 0x8936 - SIOCDRARP = 0x8960 - SIOCETHTOOL = 0x8946 - SIOCGARP = 0x8954 - SIOCGHWTSTAMP = 0x89b1 - SIOCGIFADDR = 0x8915 - SIOCGIFBR = 0x8940 - SIOCGIFBRDADDR = 0x8919 - SIOCGIFCONF = 0x8912 - SIOCGIFCOUNT = 0x8938 - SIOCGIFDSTADDR = 0x8917 - SIOCGIFENCAP = 0x8925 - SIOCGIFFLAGS = 0x8913 - SIOCGIFHWADDR = 0x8927 - SIOCGIFINDEX = 0x8933 - SIOCGIFMAP = 0x8970 - SIOCGIFMEM = 0x891f - SIOCGIFMETRIC = 0x891d - SIOCGIFMTU = 0x8921 - SIOCGIFNAME = 0x8910 - SIOCGIFNETMASK = 0x891b - SIOCGIFPFLAGS = 0x8935 - SIOCGIFSLAVE = 0x8929 - SIOCGIFTXQLEN = 0x8942 - SIOCGIFVLAN = 0x8982 - SIOCGMIIPHY = 0x8947 - SIOCGMIIREG = 0x8948 - SIOCGPGRP = 0x8904 - SIOCGRARP = 0x8961 - SIOCGSTAMP = 0x8906 - SIOCGSTAMPNS = 0x8907 - SIOCINQ = 0x4004667f - SIOCOUTQ = 0x40047473 - SIOCOUTQNSD = 0x894b - SIOCPROTOPRIVATE = 0x89e0 - SIOCRTMSG = 0x890d - SIOCSARP = 0x8955 - SIOCSHWTSTAMP = 0x89b0 - SIOCSIFADDR = 0x8916 - SIOCSIFBR = 0x8941 - SIOCSIFBRDADDR = 0x891a - SIOCSIFDSTADDR = 0x8918 - SIOCSIFENCAP = 0x8926 - SIOCSIFFLAGS = 0x8914 - SIOCSIFHWADDR = 0x8924 - SIOCSIFHWBROADCAST = 0x8937 - SIOCSIFLINK = 0x8911 - SIOCSIFMAP = 0x8971 - SIOCSIFMEM = 0x8920 - SIOCSIFMETRIC = 0x891e - SIOCSIFMTU = 0x8922 - SIOCSIFNAME = 0x8923 - SIOCSIFNETMASK = 0x891c - SIOCSIFPFLAGS = 0x8934 - SIOCSIFSLAVE = 0x8930 - SIOCSIFTXQLEN = 0x8943 - SIOCSIFVLAN = 0x8983 - SIOCSMIIREG = 0x8949 - SIOCSPGRP = 0x8902 - SIOCSRARP = 0x8962 - SIOCWANDEV = 0x894a - SOCK_CLOEXEC = 0x400000 - SOCK_DCCP = 0x6 - SOCK_DGRAM = 0x2 - SOCK_NONBLOCK = 0x4000 - SOCK_PACKET = 0xa - SOCK_RAW = 0x3 - SOCK_RDM = 0x4 - SOCK_SEQPACKET = 0x5 - SOCK_STREAM = 0x1 - SOL_AAL = 0x109 - SOL_ALG = 0x117 - SOL_ATM = 0x108 - SOL_CAIF = 0x116 - SOL_DCCP = 0x10d - SOL_DECNET = 0x105 - SOL_ICMPV6 = 0x3a - SOL_IP = 0x0 - SOL_IPV6 = 0x29 - SOL_IRDA = 0x10a - SOL_IUCV = 0x115 - SOL_KCM = 0x119 - SOL_LLC = 0x10c - SOL_NETBEUI = 0x10b - SOL_NETLINK = 0x10e - SOL_NFC = 0x118 - SOL_PACKET = 0x107 - SOL_PNPIPE = 0x113 - SOL_PPPOL2TP = 0x111 - SOL_RAW = 0xff - SOL_RDS = 0x114 - SOL_RXRPC = 0x110 - SOL_SOCKET = 0xffff - SOL_TCP = 0x6 - SOL_TIPC = 0x10f - SOL_X25 = 0x106 - SOMAXCONN = 0x80 - SO_ACCEPTCONN = 0x8000 - SO_ATTACH_BPF = 0x34 - SO_ATTACH_FILTER = 0x1a - SO_ATTACH_REUSEPORT_CBPF = 0x35 - SO_ATTACH_REUSEPORT_EBPF = 0x36 - SO_BINDTODEVICE = 0xd - SO_BPF_EXTENSIONS = 0x32 - SO_BROADCAST = 0x20 - SO_BSDCOMPAT = 0x400 - SO_BUSY_POLL = 0x30 - SO_CNX_ADVICE = 0x37 - SO_DEBUG = 0x1 - SO_DETACH_BPF = 0x1b - SO_DETACH_FILTER = 0x1b - SO_DOMAIN = 0x1029 - SO_DONTROUTE = 0x10 - SO_ERROR = 0x1007 - SO_GET_FILTER = 0x1a - SO_INCOMING_CPU = 0x33 - SO_KEEPALIVE = 0x8 - SO_LINGER = 0x80 - SO_LOCK_FILTER = 0x28 - SO_MARK = 0x22 - SO_MAX_PACING_RATE = 0x31 - SO_NOFCS = 0x27 - SO_NO_CHECK = 0xb - SO_OOBINLINE = 0x100 - SO_PASSCRED = 0x2 - SO_PASSSEC = 0x1f - SO_PEEK_OFF = 0x26 - SO_PEERCRED = 0x40 - SO_PEERNAME = 0x1c - SO_PEERSEC = 0x1e - SO_PRIORITY = 0xc - SO_PROTOCOL = 0x1028 - SO_RCVBUF = 0x1002 - SO_RCVBUFFORCE = 0x100b - SO_RCVLOWAT = 0x800 - SO_RCVTIMEO = 0x2000 - SO_REUSEADDR = 0x4 - SO_REUSEPORT = 0x200 - SO_RXQ_OVFL = 0x24 - SO_SECURITY_AUTHENTICATION = 0x5001 - SO_SECURITY_ENCRYPTION_NETWORK = 0x5004 - SO_SECURITY_ENCRYPTION_TRANSPORT = 0x5002 - SO_SELECT_ERR_QUEUE = 0x29 - SO_SNDBUF = 0x1001 - SO_SNDBUFFORCE = 0x100a - SO_SNDLOWAT = 0x1000 - SO_SNDTIMEO = 0x4000 - SO_TIMESTAMP = 0x1d - SO_TIMESTAMPING = 0x23 - SO_TIMESTAMPNS = 0x21 - SO_TYPE = 0x1008 - SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 - SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 - SO_VM_SOCKETS_BUFFER_SIZE = 0x0 - SO_VM_SOCKETS_CONNECT_TIMEOUT = 0x6 - SO_VM_SOCKETS_NONBLOCK_TXRX = 0x7 - SO_VM_SOCKETS_PEER_HOST_VM_ID = 0x3 - SO_VM_SOCKETS_TRUSTED = 0x5 - SO_WIFI_STATUS = 0x25 - SPLICE_F_GIFT = 0x8 - SPLICE_F_MORE = 0x4 - SPLICE_F_MOVE = 0x1 - SPLICE_F_NONBLOCK = 0x2 - S_BLKSIZE = 0x200 - S_IEXEC = 0x40 - S_IFBLK = 0x6000 - S_IFCHR = 0x2000 - S_IFDIR = 0x4000 - S_IFIFO = 0x1000 - S_IFLNK = 0xa000 - S_IFMT = 0xf000 - S_IFREG = 0x8000 - S_IFSOCK = 0xc000 - S_IREAD = 0x100 - S_IRGRP = 0x20 - S_IROTH = 0x4 - S_IRUSR = 0x100 - S_IRWXG = 0x38 - S_IRWXO = 0x7 - S_IRWXU = 0x1c0 - S_ISGID = 0x400 - S_ISUID = 0x800 - S_ISVTX = 0x200 - S_IWGRP = 0x10 - S_IWOTH = 0x2 - S_IWRITE = 0x80 - S_IWUSR = 0x80 - S_IXGRP = 0x8 - S_IXOTH = 0x1 - S_IXUSR = 0x40 - TAB0 = 0x0 - TAB1 = 0x800 - TAB2 = 0x1000 - TAB3 = 0x1800 - TABDLY = 0x1800 - TCFLSH = 0x20005407 - TCGETA = 0x40125401 - TCGETS = 0x40245408 - TCGETS2 = 0x402c540c - TCIFLUSH = 0x0 - TCIOFF = 0x2 - TCIOFLUSH = 0x2 - TCION = 0x3 - TCOFLUSH = 0x1 - TCOOFF = 0x0 - TCOON = 0x1 - TCP_CC_INFO = 0x1a - TCP_CONGESTION = 0xd - TCP_COOKIE_IN_ALWAYS = 0x1 - TCP_COOKIE_MAX = 0x10 - TCP_COOKIE_MIN = 0x8 - TCP_COOKIE_OUT_NEVER = 0x2 - TCP_COOKIE_PAIR_SIZE = 0x20 - TCP_COOKIE_TRANSACTIONS = 0xf - TCP_CORK = 0x3 - TCP_DEFER_ACCEPT = 0x9 - TCP_FASTOPEN = 0x17 - TCP_INFO = 0xb - TCP_KEEPCNT = 0x6 - TCP_KEEPIDLE = 0x4 - TCP_KEEPINTVL = 0x5 - TCP_LINGER2 = 0x8 - TCP_MAXSEG = 0x2 - TCP_MAXWIN = 0xffff - TCP_MAX_WINSHIFT = 0xe - TCP_MD5SIG = 0xe - TCP_MD5SIG_MAXKEYLEN = 0x50 - TCP_MSS = 0x200 - TCP_MSS_DEFAULT = 0x218 - TCP_MSS_DESIRED = 0x4c4 - TCP_NODELAY = 0x1 - TCP_NOTSENT_LOWAT = 0x19 - TCP_QUEUE_SEQ = 0x15 - TCP_QUICKACK = 0xc - TCP_REPAIR = 0x13 - TCP_REPAIR_OPTIONS = 0x16 - TCP_REPAIR_QUEUE = 0x14 - TCP_SAVED_SYN = 0x1c - TCP_SAVE_SYN = 0x1b - TCP_SYNCNT = 0x7 - TCP_S_DATA_IN = 0x4 - TCP_S_DATA_OUT = 0x8 - TCP_THIN_DUPACK = 0x11 - TCP_THIN_LINEAR_TIMEOUTS = 0x10 - TCP_TIMESTAMP = 0x18 - TCP_USER_TIMEOUT = 0x12 - TCP_WINDOW_CLAMP = 0xa - TCSAFLUSH = 0x2 - TCSBRK = 0x20005405 - TCSBRKP = 0x5425 - TCSETA = 0x80125402 - TCSETAF = 0x80125404 - TCSETAW = 0x80125403 - TCSETS = 0x80245409 - TCSETS2 = 0x802c540d - TCSETSF = 0x8024540b - TCSETSF2 = 0x802c540f - TCSETSW = 0x8024540a - TCSETSW2 = 0x802c540e - TCXONC = 0x20005406 - TIOCCBRK = 0x2000747a - TIOCCONS = 0x20007424 - TIOCEXCL = 0x2000740d - TIOCGDEV = 0x40045432 - TIOCGETD = 0x40047400 - TIOCGEXCL = 0x40045440 - TIOCGICOUNT = 0x545d - TIOCGLCKTRMIOS = 0x5456 - TIOCGPGRP = 0x40047483 - TIOCGPKT = 0x40045438 - TIOCGPTLCK = 0x40045439 - TIOCGPTN = 0x40047486 - TIOCGRS485 = 0x40205441 - TIOCGSERIAL = 0x541e - TIOCGSID = 0x40047485 - TIOCGSOFTCAR = 0x40047464 - TIOCGWINSZ = 0x40087468 - TIOCINQ = 0x4004667f - TIOCLINUX = 0x541c - TIOCMBIC = 0x8004746b - TIOCMBIS = 0x8004746c - TIOCMGET = 0x4004746a - TIOCMIWAIT = 0x545c - TIOCMSET = 0x8004746d - TIOCM_CAR = 0x40 - TIOCM_CD = 0x40 - TIOCM_CTS = 0x20 - TIOCM_DSR = 0x100 - TIOCM_DTR = 0x2 - TIOCM_LE = 0x1 - TIOCM_LOOP = 0x8000 - TIOCM_OUT1 = 0x2000 - TIOCM_OUT2 = 0x4000 - TIOCM_RI = 0x80 - TIOCM_RNG = 0x80 - TIOCM_RTS = 0x4 - TIOCM_SR = 0x10 - TIOCM_ST = 0x8 - TIOCNOTTY = 0x20007471 - TIOCNXCL = 0x2000740e - TIOCOUTQ = 0x40047473 - TIOCPKT = 0x80047470 - TIOCPKT_DATA = 0x0 - TIOCPKT_DOSTOP = 0x20 - TIOCPKT_FLUSHREAD = 0x1 - TIOCPKT_FLUSHWRITE = 0x2 - TIOCPKT_IOCTL = 0x40 - TIOCPKT_NOSTOP = 0x10 - TIOCPKT_START = 0x8 - TIOCPKT_STOP = 0x4 - TIOCSBRK = 0x2000747b - TIOCSCTTY = 0x20007484 - TIOCSERCONFIG = 0x5453 - TIOCSERGETLSR = 0x5459 - TIOCSERGETMULTI = 0x545a - TIOCSERGSTRUCT = 0x5458 - TIOCSERGWILD = 0x5454 - TIOCSERSETMULTI = 0x545b - TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 - TIOCSETD = 0x80047401 - TIOCSIG = 0x80047488 - TIOCSLCKTRMIOS = 0x5457 - TIOCSPGRP = 0x80047482 - TIOCSPTLCK = 0x80047487 - TIOCSRS485 = 0xc0205442 - TIOCSSERIAL = 0x541f - TIOCSSOFTCAR = 0x80047465 - TIOCSTART = 0x2000746e - TIOCSTI = 0x80017472 - TIOCSTOP = 0x2000746f - TIOCSWINSZ = 0x80087467 - TIOCVHANGUP = 0x20005437 - TOSTOP = 0x100 - TUNATTACHFILTER = 0x801054d5 - TUNDETACHFILTER = 0x801054d6 - TUNGETFEATURES = 0x400454cf - TUNGETFILTER = 0x401054db - TUNGETIFF = 0x400454d2 - TUNGETSNDBUF = 0x400454d3 - TUNGETVNETBE = 0x400454df - TUNGETVNETHDRSZ = 0x400454d7 - TUNGETVNETLE = 0x400454dd - TUNSETDEBUG = 0x800454c9 - TUNSETGROUP = 0x800454ce - TUNSETIFF = 0x800454ca - TUNSETIFINDEX = 0x800454da - TUNSETLINK = 0x800454cd - TUNSETNOCSUM = 0x800454c8 - TUNSETOFFLOAD = 0x800454d0 - TUNSETOWNER = 0x800454cc - TUNSETPERSIST = 0x800454cb - TUNSETQUEUE = 0x800454d9 - TUNSETSNDBUF = 0x800454d4 - TUNSETTXFILTER = 0x800454d1 - TUNSETVNETBE = 0x800454de - TUNSETVNETHDRSZ = 0x800454d8 - TUNSETVNETLE = 0x800454dc - VDISCARD = 0xd - VDSUSP = 0xb - VEOF = 0x4 - VEOL = 0x5 - VEOL2 = 0x6 - VERASE = 0x2 - VINTR = 0x0 - VKILL = 0x3 - VLNEXT = 0xf - VMADDR_CID_ANY = 0xffffffff - VMADDR_CID_HOST = 0x2 - VMADDR_CID_HYPERVISOR = 0x0 - VMADDR_CID_RESERVED = 0x1 - VMADDR_PORT_ANY = 0xffffffff - VMIN = 0x4 - VQUIT = 0x1 - VREPRINT = 0xc - VSTART = 0x8 - VSTOP = 0x9 - VSUSP = 0xa - VSWTC = 0x7 - VT0 = 0x0 - VT1 = 0x4000 - VTDLY = 0x4000 - VTIME = 0x5 - VWERASE = 0xe - WALL = 0x40000000 - WCLONE = 0x80000000 - WCONTINUED = 0x8 - WEXITED = 0x4 - WNOHANG = 0x1 - WNOTHREAD = 0x20000000 - WNOWAIT = 0x1000000 - WORDSIZE = 0x40 - WRAP = 0x20000 - WSTOPPED = 0x2 - WUNTRACED = 0x2 - XCASE = 0x4 - XTABS = 0x1800 - __TIOCFLUSH = 0x80047410 + AAFS_MAGIC = 0x5a3c69f0 + ADFS_SUPER_MAGIC = 0xadf5 + AFFS_SUPER_MAGIC = 0xadff + AFS_FS_MAGIC = 0x6b414653 + AFS_SUPER_MAGIC = 0x5346414f + AF_ALG = 0x26 + AF_APPLETALK = 0x5 + AF_ASH = 0x12 + AF_ATMPVC = 0x8 + AF_ATMSVC = 0x14 + AF_AX25 = 0x3 + AF_BLUETOOTH = 0x1f + AF_BRIDGE = 0x7 + AF_CAIF = 0x25 + AF_CAN = 0x1d + AF_DECnet = 0xc + AF_ECONET = 0x13 + AF_FILE = 0x1 + AF_IB = 0x1b + AF_IEEE802154 = 0x24 + AF_INET = 0x2 + AF_INET6 = 0xa + AF_IPX = 0x4 + AF_IRDA = 0x17 + AF_ISDN = 0x22 + AF_IUCV = 0x20 + AF_KCM = 0x29 + AF_KEY = 0xf + AF_LLC = 0x1a + AF_LOCAL = 0x1 + AF_MAX = 0x2c + AF_MPLS = 0x1c + AF_NETBEUI = 0xd + AF_NETLINK = 0x10 + AF_NETROM = 0x6 + AF_NFC = 0x27 + AF_PACKET = 0x11 + AF_PHONET = 0x23 + AF_PPPOX = 0x18 + AF_QIPCRTR = 0x2a + AF_RDS = 0x15 + AF_ROSE = 0xb + AF_ROUTE = 0x10 + AF_RXRPC = 0x21 + AF_SECURITY = 0xe + AF_SMC = 0x2b + AF_SNA = 0x16 + AF_TIPC = 0x1e + AF_UNIX = 0x1 + AF_UNSPEC = 0x0 + AF_VSOCK = 0x28 + AF_WANPIPE = 0x19 + AF_X25 = 0x9 + AF_XDP = 0x2c + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 + ANON_INODE_FS_MAGIC = 0x9041934 + ARPHRD_6LOWPAN = 0x339 + ARPHRD_ADAPT = 0x108 + ARPHRD_APPLETLK = 0x8 + ARPHRD_ARCNET = 0x7 + ARPHRD_ASH = 0x30d + ARPHRD_ATM = 0x13 + ARPHRD_AX25 = 0x3 + ARPHRD_BIF = 0x307 + ARPHRD_CAIF = 0x336 + ARPHRD_CAN = 0x118 + ARPHRD_CHAOS = 0x5 + ARPHRD_CISCO = 0x201 + ARPHRD_CSLIP = 0x101 + ARPHRD_CSLIP6 = 0x103 + ARPHRD_DDCMP = 0x205 + ARPHRD_DLCI = 0xf + ARPHRD_ECONET = 0x30e + ARPHRD_EETHER = 0x2 + ARPHRD_ETHER = 0x1 + ARPHRD_EUI64 = 0x1b + ARPHRD_FCAL = 0x311 + ARPHRD_FCFABRIC = 0x313 + ARPHRD_FCPL = 0x312 + ARPHRD_FCPP = 0x310 + ARPHRD_FDDI = 0x306 + ARPHRD_FRAD = 0x302 + ARPHRD_HDLC = 0x201 + ARPHRD_HIPPI = 0x30c + ARPHRD_HWX25 = 0x110 + ARPHRD_IEEE1394 = 0x18 + ARPHRD_IEEE802 = 0x6 + ARPHRD_IEEE80211 = 0x321 + ARPHRD_IEEE80211_PRISM = 0x322 + ARPHRD_IEEE80211_RADIOTAP = 0x323 + ARPHRD_IEEE802154 = 0x324 + ARPHRD_IEEE802154_MONITOR = 0x325 + ARPHRD_IEEE802_TR = 0x320 + ARPHRD_INFINIBAND = 0x20 + ARPHRD_IP6GRE = 0x337 + ARPHRD_IPDDP = 0x309 + ARPHRD_IPGRE = 0x30a + ARPHRD_IRDA = 0x30f + ARPHRD_LAPB = 0x204 + ARPHRD_LOCALTLK = 0x305 + ARPHRD_LOOPBACK = 0x304 + ARPHRD_METRICOM = 0x17 + ARPHRD_NETLINK = 0x338 + ARPHRD_NETROM = 0x0 + ARPHRD_NONE = 0xfffe + ARPHRD_PHONET = 0x334 + ARPHRD_PHONET_PIPE = 0x335 + ARPHRD_PIMREG = 0x30b + ARPHRD_PPP = 0x200 + ARPHRD_PRONET = 0x4 + ARPHRD_RAWHDLC = 0x206 + ARPHRD_RAWIP = 0x207 + ARPHRD_ROSE = 0x10e + ARPHRD_RSRVD = 0x104 + ARPHRD_SIT = 0x308 + ARPHRD_SKIP = 0x303 + ARPHRD_SLIP = 0x100 + ARPHRD_SLIP6 = 0x102 + ARPHRD_TUNNEL = 0x300 + ARPHRD_TUNNEL6 = 0x301 + ARPHRD_VOID = 0xffff + ARPHRD_VSOCKMON = 0x33a + ARPHRD_X25 = 0x10f + ASI_LEON_DFLUSH = 0x11 + ASI_LEON_IFLUSH = 0x10 + ASI_LEON_MMUFLUSH = 0x18 + AUTOFS_SUPER_MAGIC = 0x187 + B0 = 0x0 + B1000000 = 0x1008 + B110 = 0x3 + B115200 = 0x1002 + B1152000 = 0x1009 + B1200 = 0x9 + B134 = 0x4 + B150 = 0x5 + B1500000 = 0x100a + B1800 = 0xa + B19200 = 0xe + B200 = 0x6 + B2000000 = 0x100b + B230400 = 0x1003 + B2400 = 0xb + B2500000 = 0x100c + B300 = 0x7 + B3000000 = 0x100d + B3500000 = 0x100e + B38400 = 0xf + B4000000 = 0x100f + B460800 = 0x1004 + B4800 = 0xc + B50 = 0x1 + B500000 = 0x1005 + B57600 = 0x1001 + B576000 = 0x1006 + B600 = 0x8 + B75 = 0x2 + B921600 = 0x1007 + B9600 = 0xd + BALLOON_KVM_MAGIC = 0x13661366 + BDEVFS_MAGIC = 0x62646576 + BINFMTFS_MAGIC = 0x42494e4d + BLKBSZGET = 0x40081270 + BLKBSZSET = 0x80081271 + BLKFLSBUF = 0x20001261 + BLKFRAGET = 0x20001265 + BLKFRASET = 0x20001264 + BLKGETSIZE = 0x20001260 + BLKGETSIZE64 = 0x40081272 + BLKPBSZGET = 0x2000127b + BLKRAGET = 0x20001263 + BLKRASET = 0x20001262 + BLKROGET = 0x2000125e + BLKROSET = 0x2000125d + BLKRRPART = 0x2000125f + BLKSECTGET = 0x20001267 + BLKSECTSET = 0x20001266 + BLKSSZGET = 0x20001268 + BOTHER = 0x1000 + BPF_A = 0x10 + BPF_ABS = 0x20 + BPF_ADD = 0x0 + BPF_ALU = 0x4 + BPF_AND = 0x50 + BPF_B = 0x10 + BPF_DIV = 0x30 + BPF_FS_MAGIC = 0xcafe4a11 + BPF_H = 0x8 + BPF_IMM = 0x0 + BPF_IND = 0x40 + BPF_JA = 0x0 + BPF_JEQ = 0x10 + BPF_JGE = 0x30 + BPF_JGT = 0x20 + BPF_JMP = 0x5 + BPF_JSET = 0x40 + BPF_K = 0x0 + BPF_LD = 0x0 + BPF_LDX = 0x1 + BPF_LEN = 0x80 + BPF_LL_OFF = -0x200000 + BPF_LSH = 0x60 + BPF_MAJOR_VERSION = 0x1 + BPF_MAXINSNS = 0x1000 + BPF_MEM = 0x60 + BPF_MEMWORDS = 0x10 + BPF_MINOR_VERSION = 0x1 + BPF_MISC = 0x7 + BPF_MOD = 0x90 + BPF_MSH = 0xa0 + BPF_MUL = 0x20 + BPF_NEG = 0x80 + BPF_NET_OFF = -0x100000 + BPF_OR = 0x40 + BPF_RET = 0x6 + BPF_RSH = 0x70 + BPF_ST = 0x2 + BPF_STX = 0x3 + BPF_SUB = 0x10 + BPF_TAX = 0x0 + BPF_TXA = 0x80 + BPF_W = 0x0 + BPF_X = 0x8 + BPF_XOR = 0xa0 + BRKINT = 0x2 + BS0 = 0x0 + BS1 = 0x2000 + BSDLY = 0x2000 + BTRFS_SUPER_MAGIC = 0x9123683e + BTRFS_TEST_MAGIC = 0x73727279 + CAN_BCM = 0x2 + CAN_EFF_FLAG = 0x80000000 + CAN_EFF_ID_BITS = 0x1d + CAN_EFF_MASK = 0x1fffffff + CAN_ERR_FLAG = 0x20000000 + CAN_ERR_MASK = 0x1fffffff + CAN_INV_FILTER = 0x20000000 + CAN_ISOTP = 0x6 + CAN_MAX_DLC = 0x8 + CAN_MAX_DLEN = 0x8 + CAN_MCNET = 0x5 + CAN_MTU = 0x10 + CAN_NPROTO = 0x7 + CAN_RAW = 0x1 + CAN_RAW_FILTER_MAX = 0x200 + CAN_RTR_FLAG = 0x40000000 + CAN_SFF_ID_BITS = 0xb + CAN_SFF_MASK = 0x7ff + CAN_TP16 = 0x3 + CAN_TP20 = 0x4 + CBAUD = 0x100f + CBAUDEX = 0x1000 + CFLUSH = 0xf + CGROUP2_SUPER_MAGIC = 0x63677270 + CGROUP_SUPER_MAGIC = 0x27e0eb + CIBAUD = 0x100f0000 + CLOCAL = 0x800 + CLOCK_BOOTTIME = 0x7 + CLOCK_BOOTTIME_ALARM = 0x9 + CLOCK_DEFAULT = 0x0 + CLOCK_EXT = 0x1 + CLOCK_INT = 0x2 + CLOCK_MONOTONIC = 0x1 + CLOCK_MONOTONIC_COARSE = 0x6 + CLOCK_MONOTONIC_RAW = 0x4 + CLOCK_PROCESS_CPUTIME_ID = 0x2 + CLOCK_REALTIME = 0x0 + CLOCK_REALTIME_ALARM = 0x8 + CLOCK_REALTIME_COARSE = 0x5 + CLOCK_TAI = 0xb + CLOCK_THREAD_CPUTIME_ID = 0x3 + CLOCK_TXFROMRX = 0x4 + CLOCK_TXINT = 0x3 + CLONE_CHILD_CLEARTID = 0x200000 + CLONE_CHILD_SETTID = 0x1000000 + CLONE_DETACHED = 0x400000 + CLONE_FILES = 0x400 + CLONE_FS = 0x200 + CLONE_IO = 0x80000000 + CLONE_NEWCGROUP = 0x2000000 + CLONE_NEWIPC = 0x8000000 + CLONE_NEWNET = 0x40000000 + CLONE_NEWNS = 0x20000 + CLONE_NEWPID = 0x20000000 + CLONE_NEWUSER = 0x10000000 + CLONE_NEWUTS = 0x4000000 + CLONE_PARENT = 0x8000 + CLONE_PARENT_SETTID = 0x100000 + CLONE_PTRACE = 0x2000 + CLONE_SETTLS = 0x80000 + CLONE_SIGHAND = 0x800 + CLONE_SYSVSEM = 0x40000 + CLONE_THREAD = 0x10000 + CLONE_UNTRACED = 0x800000 + CLONE_VFORK = 0x4000 + CLONE_VM = 0x100 + CMSPAR = 0x40000000 + CODA_SUPER_MAGIC = 0x73757245 + CR0 = 0x0 + CR1 = 0x200 + CR2 = 0x400 + CR3 = 0x600 + CRAMFS_MAGIC = 0x28cd3d45 + CRDLY = 0x600 + CREAD = 0x80 + CRTSCTS = 0x80000000 + CS5 = 0x0 + CS6 = 0x10 + CS7 = 0x20 + CS8 = 0x30 + CSIGNAL = 0xff + CSIZE = 0x30 + CSTART = 0x11 + CSTATUS = 0x0 + CSTOP = 0x13 + CSTOPB = 0x40 + CSUSP = 0x1a + DAXFS_MAGIC = 0x64646178 + DEBUGFS_MAGIC = 0x64626720 + DEVPTS_SUPER_MAGIC = 0x1cd1 + DT_BLK = 0x6 + DT_CHR = 0x2 + DT_DIR = 0x4 + DT_FIFO = 0x1 + DT_LNK = 0xa + DT_REG = 0x8 + DT_SOCK = 0xc + DT_UNKNOWN = 0x0 + DT_WHT = 0xe + ECHO = 0x8 + ECHOCTL = 0x200 + ECHOE = 0x10 + ECHOK = 0x20 + ECHOKE = 0x800 + ECHONL = 0x40 + ECHOPRT = 0x400 + ECRYPTFS_SUPER_MAGIC = 0xf15f + EFD_CLOEXEC = 0x400000 + EFD_NONBLOCK = 0x4000 + EFD_SEMAPHORE = 0x1 + EFIVARFS_MAGIC = 0xde5e81e4 + EFS_SUPER_MAGIC = 0x414a53 + EMT_TAGOVF = 0x1 + ENCODING_DEFAULT = 0x0 + ENCODING_FM_MARK = 0x3 + ENCODING_FM_SPACE = 0x4 + ENCODING_MANCHESTER = 0x5 + ENCODING_NRZ = 0x1 + ENCODING_NRZI = 0x2 + EPOLLERR = 0x8 + EPOLLET = 0x80000000 + EPOLLEXCLUSIVE = 0x10000000 + EPOLLHUP = 0x10 + EPOLLIN = 0x1 + EPOLLMSG = 0x400 + EPOLLONESHOT = 0x40000000 + EPOLLOUT = 0x4 + EPOLLPRI = 0x2 + EPOLLRDBAND = 0x80 + EPOLLRDHUP = 0x2000 + EPOLLRDNORM = 0x40 + EPOLLWAKEUP = 0x20000000 + EPOLLWRBAND = 0x200 + EPOLLWRNORM = 0x100 + EPOLL_CLOEXEC = 0x400000 + EPOLL_CTL_ADD = 0x1 + EPOLL_CTL_DEL = 0x2 + EPOLL_CTL_MOD = 0x3 + ETH_P_1588 = 0x88f7 + ETH_P_8021AD = 0x88a8 + ETH_P_8021AH = 0x88e7 + ETH_P_8021Q = 0x8100 + ETH_P_80221 = 0x8917 + ETH_P_802_2 = 0x4 + ETH_P_802_3 = 0x1 + ETH_P_802_3_MIN = 0x600 + ETH_P_802_EX1 = 0x88b5 + ETH_P_AARP = 0x80f3 + ETH_P_AF_IUCV = 0xfbfb + ETH_P_ALL = 0x3 + ETH_P_AOE = 0x88a2 + ETH_P_ARCNET = 0x1a + ETH_P_ARP = 0x806 + ETH_P_ATALK = 0x809b + ETH_P_ATMFATE = 0x8884 + ETH_P_ATMMPOA = 0x884c + ETH_P_AX25 = 0x2 + ETH_P_BATMAN = 0x4305 + ETH_P_BPQ = 0x8ff + ETH_P_CAIF = 0xf7 + ETH_P_CAN = 0xc + ETH_P_CANFD = 0xd + ETH_P_CONTROL = 0x16 + ETH_P_CUST = 0x6006 + ETH_P_DDCMP = 0x6 + ETH_P_DEC = 0x6000 + ETH_P_DIAG = 0x6005 + ETH_P_DNA_DL = 0x6001 + ETH_P_DNA_RC = 0x6002 + ETH_P_DNA_RT = 0x6003 + ETH_P_DSA = 0x1b + ETH_P_ECONET = 0x18 + ETH_P_EDSA = 0xdada + ETH_P_ERSPAN = 0x88be + ETH_P_ERSPAN2 = 0x22eb + ETH_P_FCOE = 0x8906 + ETH_P_FIP = 0x8914 + ETH_P_HDLC = 0x19 + ETH_P_HSR = 0x892f + ETH_P_IBOE = 0x8915 + ETH_P_IEEE802154 = 0xf6 + ETH_P_IEEEPUP = 0xa00 + ETH_P_IEEEPUPAT = 0xa01 + ETH_P_IFE = 0xed3e + ETH_P_IP = 0x800 + ETH_P_IPV6 = 0x86dd + ETH_P_IPX = 0x8137 + ETH_P_IRDA = 0x17 + ETH_P_LAT = 0x6004 + ETH_P_LINK_CTL = 0x886c + ETH_P_LOCALTALK = 0x9 + ETH_P_LOOP = 0x60 + ETH_P_LOOPBACK = 0x9000 + ETH_P_MACSEC = 0x88e5 + ETH_P_MAP = 0xf9 + ETH_P_MOBITEX = 0x15 + ETH_P_MPLS_MC = 0x8848 + ETH_P_MPLS_UC = 0x8847 + ETH_P_MVRP = 0x88f5 + ETH_P_NCSI = 0x88f8 + ETH_P_NSH = 0x894f + ETH_P_PAE = 0x888e + ETH_P_PAUSE = 0x8808 + ETH_P_PHONET = 0xf5 + ETH_P_PPPTALK = 0x10 + ETH_P_PPP_DISC = 0x8863 + ETH_P_PPP_MP = 0x8 + ETH_P_PPP_SES = 0x8864 + ETH_P_PREAUTH = 0x88c7 + ETH_P_PRP = 0x88fb + ETH_P_PUP = 0x200 + ETH_P_PUPAT = 0x201 + ETH_P_QINQ1 = 0x9100 + ETH_P_QINQ2 = 0x9200 + ETH_P_QINQ3 = 0x9300 + ETH_P_RARP = 0x8035 + ETH_P_SCA = 0x6007 + ETH_P_SLOW = 0x8809 + ETH_P_SNAP = 0x5 + ETH_P_TDLS = 0x890d + ETH_P_TEB = 0x6558 + ETH_P_TIPC = 0x88ca + ETH_P_TRAILER = 0x1c + ETH_P_TR_802_2 = 0x11 + ETH_P_TSN = 0x22f0 + ETH_P_WAN_PPP = 0x7 + ETH_P_WCCP = 0x883e + ETH_P_X25 = 0x805 + ETH_P_XDSA = 0xf8 + EXABYTE_ENABLE_NEST = 0xf0 + EXT2_SUPER_MAGIC = 0xef53 + EXT3_SUPER_MAGIC = 0xef53 + EXT4_SUPER_MAGIC = 0xef53 + EXTA = 0xe + EXTB = 0xf + EXTPROC = 0x10000 + F2FS_SUPER_MAGIC = 0xf2f52010 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_UNSHARE_RANGE = 0x40 + FALLOC_FL_ZERO_RANGE = 0x10 + FD_CLOEXEC = 0x1 + FD_SETSIZE = 0x400 + FF0 = 0x0 + FF1 = 0x8000 + FFDLY = 0x8000 + FLUSHO = 0x1000 + FS_ENCRYPTION_MODE_AES_128_CBC = 0x5 + FS_ENCRYPTION_MODE_AES_128_CTS = 0x6 + FS_ENCRYPTION_MODE_AES_256_CBC = 0x3 + FS_ENCRYPTION_MODE_AES_256_CTS = 0x4 + FS_ENCRYPTION_MODE_AES_256_GCM = 0x2 + FS_ENCRYPTION_MODE_AES_256_XTS = 0x1 + FS_ENCRYPTION_MODE_INVALID = 0x0 + FS_ENCRYPTION_MODE_SPECK128_256_CTS = 0x8 + FS_ENCRYPTION_MODE_SPECK128_256_XTS = 0x7 + FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 + FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 + FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 + FS_KEY_DESCRIPTOR_SIZE = 0x8 + FS_KEY_DESC_PREFIX = "fscrypt:" + FS_KEY_DESC_PREFIX_SIZE = 0x8 + FS_MAX_KEY_SIZE = 0x40 + FS_POLICY_FLAGS_PAD_16 = 0x2 + FS_POLICY_FLAGS_PAD_32 = 0x3 + FS_POLICY_FLAGS_PAD_4 = 0x0 + FS_POLICY_FLAGS_PAD_8 = 0x1 + FS_POLICY_FLAGS_PAD_MASK = 0x3 + FS_POLICY_FLAGS_VALID = 0x3 + FUTEXFS_SUPER_MAGIC = 0xbad1dea + F_ADD_SEALS = 0x409 + F_DUPFD = 0x0 + F_DUPFD_CLOEXEC = 0x406 + F_EXLCK = 0x4 + F_GETFD = 0x1 + F_GETFL = 0x3 + F_GETLEASE = 0x401 + F_GETLK = 0x7 + F_GETLK64 = 0x7 + F_GETOWN = 0x5 + F_GETOWN_EX = 0x10 + F_GETPIPE_SZ = 0x408 + F_GETSIG = 0xb + F_GET_FILE_RW_HINT = 0x40d + F_GET_RW_HINT = 0x40b + F_GET_SEALS = 0x40a + F_LOCK = 0x1 + F_NOTIFY = 0x402 + F_OFD_GETLK = 0x24 + F_OFD_SETLK = 0x25 + F_OFD_SETLKW = 0x26 + F_OK = 0x0 + F_RDLCK = 0x1 + F_SEAL_GROW = 0x4 + F_SEAL_SEAL = 0x1 + F_SEAL_SHRINK = 0x2 + F_SEAL_WRITE = 0x8 + F_SETFD = 0x2 + F_SETFL = 0x4 + F_SETLEASE = 0x400 + F_SETLK = 0x8 + F_SETLK64 = 0x8 + F_SETLKW = 0x9 + F_SETLKW64 = 0x9 + F_SETOWN = 0x6 + F_SETOWN_EX = 0xf + F_SETPIPE_SZ = 0x407 + F_SETSIG = 0xa + F_SET_FILE_RW_HINT = 0x40e + F_SET_RW_HINT = 0x40c + F_SHLCK = 0x8 + F_TEST = 0x3 + F_TLOCK = 0x2 + F_ULOCK = 0x0 + F_UNLCK = 0x3 + F_WRLCK = 0x2 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 + GRND_NONBLOCK = 0x1 + GRND_RANDOM = 0x2 + HDIO_DRIVE_CMD = 0x31f + HDIO_DRIVE_CMD_AEB = 0x31e + HDIO_DRIVE_CMD_HDR_SIZE = 0x4 + HDIO_DRIVE_HOB_HDR_SIZE = 0x8 + HDIO_DRIVE_RESET = 0x31c + HDIO_DRIVE_TASK = 0x31e + HDIO_DRIVE_TASKFILE = 0x31d + HDIO_DRIVE_TASK_HDR_SIZE = 0x8 + HDIO_GETGEO = 0x301 + HDIO_GET_32BIT = 0x309 + HDIO_GET_ACOUSTIC = 0x30f + HDIO_GET_ADDRESS = 0x310 + HDIO_GET_BUSSTATE = 0x31a + HDIO_GET_DMA = 0x30b + HDIO_GET_IDENTITY = 0x30d + HDIO_GET_KEEPSETTINGS = 0x308 + HDIO_GET_MULTCOUNT = 0x304 + HDIO_GET_NICE = 0x30c + HDIO_GET_NOWERR = 0x30a + HDIO_GET_QDMA = 0x305 + HDIO_GET_UNMASKINTR = 0x302 + HDIO_GET_WCACHE = 0x30e + HDIO_OBSOLETE_IDENTITY = 0x307 + HDIO_SCAN_HWIF = 0x328 + HDIO_SET_32BIT = 0x324 + HDIO_SET_ACOUSTIC = 0x32c + HDIO_SET_ADDRESS = 0x32f + HDIO_SET_BUSSTATE = 0x32d + HDIO_SET_DMA = 0x326 + HDIO_SET_KEEPSETTINGS = 0x323 + HDIO_SET_MULTCOUNT = 0x321 + HDIO_SET_NICE = 0x329 + HDIO_SET_NOWERR = 0x325 + HDIO_SET_PIO_MODE = 0x327 + HDIO_SET_QDMA = 0x32e + HDIO_SET_UNMASKINTR = 0x322 + HDIO_SET_WCACHE = 0x32b + HDIO_SET_XFER = 0x306 + HDIO_TRISTATE_HWIF = 0x31b + HDIO_UNREGISTER_HWIF = 0x32a + HOSTFS_SUPER_MAGIC = 0xc0ffee + HPFS_SUPER_MAGIC = 0xf995e849 + HUGETLBFS_MAGIC = 0x958458f6 + HUPCL = 0x400 + IBSHIFT = 0x10 + ICANON = 0x2 + ICMPV6_FILTER = 0x1 + ICRNL = 0x100 + IEXTEN = 0x8000 + IFA_F_DADFAILED = 0x8 + IFA_F_DEPRECATED = 0x20 + IFA_F_HOMEADDRESS = 0x10 + IFA_F_MANAGETEMPADDR = 0x100 + IFA_F_MCAUTOJOIN = 0x400 + IFA_F_NODAD = 0x2 + IFA_F_NOPREFIXROUTE = 0x200 + IFA_F_OPTIMISTIC = 0x4 + IFA_F_PERMANENT = 0x80 + IFA_F_SECONDARY = 0x1 + IFA_F_STABLE_PRIVACY = 0x800 + IFA_F_TEMPORARY = 0x1 + IFA_F_TENTATIVE = 0x40 + IFA_MAX = 0x9 + IFF_ALLMULTI = 0x200 + IFF_ATTACH_QUEUE = 0x200 + IFF_AUTOMEDIA = 0x4000 + IFF_BROADCAST = 0x2 + IFF_DEBUG = 0x4 + IFF_DETACH_QUEUE = 0x400 + IFF_DORMANT = 0x20000 + IFF_DYNAMIC = 0x8000 + IFF_ECHO = 0x40000 + IFF_LOOPBACK = 0x8 + IFF_LOWER_UP = 0x10000 + IFF_MASTER = 0x400 + IFF_MULTICAST = 0x1000 + IFF_MULTI_QUEUE = 0x100 + IFF_NAPI = 0x10 + IFF_NAPI_FRAGS = 0x20 + IFF_NOARP = 0x80 + IFF_NOFILTER = 0x1000 + IFF_NOTRAILERS = 0x20 + IFF_NO_PI = 0x1000 + IFF_ONE_QUEUE = 0x2000 + IFF_PERSIST = 0x800 + IFF_POINTOPOINT = 0x10 + IFF_PORTSEL = 0x2000 + IFF_PROMISC = 0x100 + IFF_RUNNING = 0x40 + IFF_SLAVE = 0x800 + IFF_TAP = 0x2 + IFF_TUN = 0x1 + IFF_TUN_EXCL = 0x8000 + IFF_UP = 0x1 + IFF_VNET_HDR = 0x4000 + IFF_VOLATILE = 0x70c5a + IFNAMSIZ = 0x10 + IGNBRK = 0x1 + IGNCR = 0x80 + IGNPAR = 0x4 + IMAXBEL = 0x2000 + INLCR = 0x40 + INPCK = 0x10 + IN_ACCESS = 0x1 + IN_ALL_EVENTS = 0xfff + IN_ATTRIB = 0x4 + IN_CLASSA_HOST = 0xffffff + IN_CLASSA_MAX = 0x80 + IN_CLASSA_NET = 0xff000000 + IN_CLASSA_NSHIFT = 0x18 + IN_CLASSB_HOST = 0xffff + IN_CLASSB_MAX = 0x10000 + IN_CLASSB_NET = 0xffff0000 + IN_CLASSB_NSHIFT = 0x10 + IN_CLASSC_HOST = 0xff + IN_CLASSC_NET = 0xffffff00 + IN_CLASSC_NSHIFT = 0x8 + IN_CLOEXEC = 0x400000 + IN_CLOSE = 0x18 + IN_CLOSE_NOWRITE = 0x10 + IN_CLOSE_WRITE = 0x8 + IN_CREATE = 0x100 + IN_DELETE = 0x200 + IN_DELETE_SELF = 0x400 + IN_DONT_FOLLOW = 0x2000000 + IN_EXCL_UNLINK = 0x4000000 + IN_IGNORED = 0x8000 + IN_ISDIR = 0x40000000 + IN_LOOPBACKNET = 0x7f + IN_MASK_ADD = 0x20000000 + IN_MODIFY = 0x2 + IN_MOVE = 0xc0 + IN_MOVED_FROM = 0x40 + IN_MOVED_TO = 0x80 + IN_MOVE_SELF = 0x800 + IN_NONBLOCK = 0x4000 + IN_ONESHOT = 0x80000000 + IN_ONLYDIR = 0x1000000 + IN_OPEN = 0x20 + IN_Q_OVERFLOW = 0x4000 + IN_UNMOUNT = 0x2000 + IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 + IPPROTO_AH = 0x33 + IPPROTO_BEETPH = 0x5e + IPPROTO_COMP = 0x6c + IPPROTO_DCCP = 0x21 + IPPROTO_DSTOPTS = 0x3c + IPPROTO_EGP = 0x8 + IPPROTO_ENCAP = 0x62 + IPPROTO_ESP = 0x32 + IPPROTO_FRAGMENT = 0x2c + IPPROTO_GRE = 0x2f + IPPROTO_HOPOPTS = 0x0 + IPPROTO_ICMP = 0x1 + IPPROTO_ICMPV6 = 0x3a + IPPROTO_IDP = 0x16 + IPPROTO_IGMP = 0x2 + IPPROTO_IP = 0x0 + IPPROTO_IPIP = 0x4 + IPPROTO_IPV6 = 0x29 + IPPROTO_MH = 0x87 + IPPROTO_MPLS = 0x89 + IPPROTO_MTP = 0x5c + IPPROTO_NONE = 0x3b + IPPROTO_PIM = 0x67 + IPPROTO_PUP = 0xc + IPPROTO_RAW = 0xff + IPPROTO_ROUTING = 0x2b + IPPROTO_RSVP = 0x2e + IPPROTO_SCTP = 0x84 + IPPROTO_TCP = 0x6 + IPPROTO_TP = 0x1d + IPPROTO_UDP = 0x11 + IPPROTO_UDPLITE = 0x88 + IPV6_2292DSTOPTS = 0x4 + IPV6_2292HOPLIMIT = 0x8 + IPV6_2292HOPOPTS = 0x3 + IPV6_2292PKTINFO = 0x2 + IPV6_2292PKTOPTIONS = 0x6 + IPV6_2292RTHDR = 0x5 + IPV6_ADDRFORM = 0x1 + IPV6_ADDR_PREFERENCES = 0x48 + IPV6_ADD_MEMBERSHIP = 0x14 + IPV6_AUTHHDR = 0xa + IPV6_AUTOFLOWLABEL = 0x46 + IPV6_CHECKSUM = 0x7 + IPV6_DONTFRAG = 0x3e + IPV6_DROP_MEMBERSHIP = 0x15 + IPV6_DSTOPTS = 0x3b + IPV6_FREEBIND = 0x4e + IPV6_HDRINCL = 0x24 + IPV6_HOPLIMIT = 0x34 + IPV6_HOPOPTS = 0x36 + IPV6_IPSEC_POLICY = 0x22 + IPV6_JOIN_ANYCAST = 0x1b + IPV6_JOIN_GROUP = 0x14 + IPV6_LEAVE_ANYCAST = 0x1c + IPV6_LEAVE_GROUP = 0x15 + IPV6_MINHOPCOUNT = 0x49 + IPV6_MTU = 0x18 + IPV6_MTU_DISCOVER = 0x17 + IPV6_MULTICAST_HOPS = 0x12 + IPV6_MULTICAST_IF = 0x11 + IPV6_MULTICAST_LOOP = 0x13 + IPV6_NEXTHOP = 0x9 + IPV6_ORIGDSTADDR = 0x4a + IPV6_PATHMTU = 0x3d + IPV6_PKTINFO = 0x32 + IPV6_PMTUDISC_DO = 0x2 + IPV6_PMTUDISC_DONT = 0x0 + IPV6_PMTUDISC_INTERFACE = 0x4 + IPV6_PMTUDISC_OMIT = 0x5 + IPV6_PMTUDISC_PROBE = 0x3 + IPV6_PMTUDISC_WANT = 0x1 + IPV6_RECVDSTOPTS = 0x3a + IPV6_RECVERR = 0x19 + IPV6_RECVFRAGSIZE = 0x4d + IPV6_RECVHOPLIMIT = 0x33 + IPV6_RECVHOPOPTS = 0x35 + IPV6_RECVORIGDSTADDR = 0x4a + IPV6_RECVPATHMTU = 0x3c + IPV6_RECVPKTINFO = 0x31 + IPV6_RECVRTHDR = 0x38 + IPV6_RECVTCLASS = 0x42 + IPV6_ROUTER_ALERT = 0x16 + IPV6_RTHDR = 0x39 + IPV6_RTHDRDSTOPTS = 0x37 + IPV6_RTHDR_LOOSE = 0x0 + IPV6_RTHDR_STRICT = 0x1 + IPV6_RTHDR_TYPE_0 = 0x0 + IPV6_RXDSTOPTS = 0x3b + IPV6_RXHOPOPTS = 0x36 + IPV6_TCLASS = 0x43 + IPV6_TRANSPARENT = 0x4b + IPV6_UNICAST_HOPS = 0x10 + IPV6_UNICAST_IF = 0x4c + IPV6_V6ONLY = 0x1a + IPV6_XFRM_POLICY = 0x23 + IP_ADD_MEMBERSHIP = 0x23 + IP_ADD_SOURCE_MEMBERSHIP = 0x27 + IP_BIND_ADDRESS_NO_PORT = 0x18 + IP_BLOCK_SOURCE = 0x26 + IP_CHECKSUM = 0x17 + IP_DEFAULT_MULTICAST_LOOP = 0x1 + IP_DEFAULT_MULTICAST_TTL = 0x1 + IP_DF = 0x4000 + IP_DROP_MEMBERSHIP = 0x24 + IP_DROP_SOURCE_MEMBERSHIP = 0x28 + IP_FREEBIND = 0xf + IP_HDRINCL = 0x3 + IP_IPSEC_POLICY = 0x10 + IP_MAXPACKET = 0xffff + IP_MAX_MEMBERSHIPS = 0x14 + IP_MF = 0x2000 + IP_MINTTL = 0x15 + IP_MSFILTER = 0x29 + IP_MSS = 0x240 + IP_MTU = 0xe + IP_MTU_DISCOVER = 0xa + IP_MULTICAST_ALL = 0x31 + IP_MULTICAST_IF = 0x20 + IP_MULTICAST_LOOP = 0x22 + IP_MULTICAST_TTL = 0x21 + IP_NODEFRAG = 0x16 + IP_OFFMASK = 0x1fff + IP_OPTIONS = 0x4 + IP_ORIGDSTADDR = 0x14 + IP_PASSSEC = 0x12 + IP_PKTINFO = 0x8 + IP_PKTOPTIONS = 0x9 + IP_PMTUDISC = 0xa + IP_PMTUDISC_DO = 0x2 + IP_PMTUDISC_DONT = 0x0 + IP_PMTUDISC_INTERFACE = 0x4 + IP_PMTUDISC_OMIT = 0x5 + IP_PMTUDISC_PROBE = 0x3 + IP_PMTUDISC_WANT = 0x1 + IP_RECVERR = 0xb + IP_RECVFRAGSIZE = 0x19 + IP_RECVOPTS = 0x6 + IP_RECVORIGDSTADDR = 0x14 + IP_RECVRETOPTS = 0x7 + IP_RECVTOS = 0xd + IP_RECVTTL = 0xc + IP_RETOPTS = 0x7 + IP_RF = 0x8000 + IP_ROUTER_ALERT = 0x5 + IP_TOS = 0x1 + IP_TRANSPARENT = 0x13 + IP_TTL = 0x2 + IP_UNBLOCK_SOURCE = 0x25 + IP_UNICAST_IF = 0x32 + IP_XFRM_POLICY = 0x11 + ISIG = 0x1 + ISOFS_SUPER_MAGIC = 0x9660 + ISTRIP = 0x20 + IUCLC = 0x200 + IUTF8 = 0x4000 + IXANY = 0x800 + IXOFF = 0x1000 + IXON = 0x400 + JFFS2_SUPER_MAGIC = 0x72b6 + KEXEC_ARCH_386 = 0x30000 + KEXEC_ARCH_68K = 0x40000 + KEXEC_ARCH_AARCH64 = 0xb70000 + KEXEC_ARCH_ARM = 0x280000 + KEXEC_ARCH_DEFAULT = 0x0 + KEXEC_ARCH_IA_64 = 0x320000 + KEXEC_ARCH_MASK = 0xffff0000 + KEXEC_ARCH_MIPS = 0x80000 + KEXEC_ARCH_MIPS_LE = 0xa0000 + KEXEC_ARCH_PPC = 0x140000 + KEXEC_ARCH_PPC64 = 0x150000 + KEXEC_ARCH_S390 = 0x160000 + KEXEC_ARCH_SH = 0x2a0000 + KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_FILE_NO_INITRAMFS = 0x4 + KEXEC_FILE_ON_CRASH = 0x2 + KEXEC_FILE_UNLOAD = 0x1 + KEXEC_ON_CRASH = 0x1 + KEXEC_PRESERVE_CONTEXT = 0x2 + KEXEC_SEGMENT_MAX = 0x10 + KEYCTL_ASSUME_AUTHORITY = 0x10 + KEYCTL_CHOWN = 0x4 + KEYCTL_CLEAR = 0x7 + KEYCTL_DESCRIBE = 0x6 + KEYCTL_DH_COMPUTE = 0x17 + KEYCTL_GET_KEYRING_ID = 0x0 + KEYCTL_GET_PERSISTENT = 0x16 + KEYCTL_GET_SECURITY = 0x11 + KEYCTL_INSTANTIATE = 0xc + KEYCTL_INSTANTIATE_IOV = 0x14 + KEYCTL_INVALIDATE = 0x15 + KEYCTL_JOIN_SESSION_KEYRING = 0x1 + KEYCTL_LINK = 0x8 + KEYCTL_NEGATE = 0xd + KEYCTL_READ = 0xb + KEYCTL_REJECT = 0x13 + KEYCTL_RESTRICT_KEYRING = 0x1d + KEYCTL_REVOKE = 0x3 + KEYCTL_SEARCH = 0xa + KEYCTL_SESSION_TO_PARENT = 0x12 + KEYCTL_SETPERM = 0x5 + KEYCTL_SET_REQKEY_KEYRING = 0xe + KEYCTL_SET_TIMEOUT = 0xf + KEYCTL_UNLINK = 0x9 + KEYCTL_UPDATE = 0x2 + KEY_REQKEY_DEFL_DEFAULT = 0x0 + KEY_REQKEY_DEFL_GROUP_KEYRING = 0x6 + KEY_REQKEY_DEFL_NO_CHANGE = -0x1 + KEY_REQKEY_DEFL_PROCESS_KEYRING = 0x2 + KEY_REQKEY_DEFL_REQUESTOR_KEYRING = 0x7 + KEY_REQKEY_DEFL_SESSION_KEYRING = 0x3 + KEY_REQKEY_DEFL_THREAD_KEYRING = 0x1 + KEY_REQKEY_DEFL_USER_KEYRING = 0x4 + KEY_REQKEY_DEFL_USER_SESSION_KEYRING = 0x5 + KEY_SPEC_GROUP_KEYRING = -0x6 + KEY_SPEC_PROCESS_KEYRING = -0x2 + KEY_SPEC_REQKEY_AUTH_KEY = -0x7 + KEY_SPEC_REQUESTOR_KEYRING = -0x8 + KEY_SPEC_SESSION_KEYRING = -0x3 + KEY_SPEC_THREAD_KEYRING = -0x1 + KEY_SPEC_USER_KEYRING = -0x4 + KEY_SPEC_USER_SESSION_KEYRING = -0x5 + LINUX_REBOOT_CMD_CAD_OFF = 0x0 + LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef + LINUX_REBOOT_CMD_HALT = 0xcdef0123 + LINUX_REBOOT_CMD_KEXEC = 0x45584543 + LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc + LINUX_REBOOT_CMD_RESTART = 0x1234567 + LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4 + LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2 + LINUX_REBOOT_MAGIC1 = 0xfee1dead + LINUX_REBOOT_MAGIC2 = 0x28121969 + LOCK_EX = 0x2 + LOCK_NB = 0x4 + LOCK_SH = 0x1 + LOCK_UN = 0x8 + MADV_DODUMP = 0x11 + MADV_DOFORK = 0xb + MADV_DONTDUMP = 0x10 + MADV_DONTFORK = 0xa + MADV_DONTNEED = 0x4 + MADV_FREE = 0x8 + MADV_HUGEPAGE = 0xe + MADV_HWPOISON = 0x64 + MADV_KEEPONFORK = 0x13 + MADV_MERGEABLE = 0xc + MADV_NOHUGEPAGE = 0xf + MADV_NORMAL = 0x0 + MADV_RANDOM = 0x1 + MADV_REMOVE = 0x9 + MADV_SEQUENTIAL = 0x2 + MADV_UNMERGEABLE = 0xd + MADV_WILLNEED = 0x3 + MADV_WIPEONFORK = 0x12 + MAP_ANON = 0x20 + MAP_ANONYMOUS = 0x20 + MAP_DENYWRITE = 0x800 + MAP_EXECUTABLE = 0x1000 + MAP_FILE = 0x0 + MAP_FIXED = 0x10 + MAP_FIXED_NOREPLACE = 0x100000 + MAP_GROWSDOWN = 0x200 + MAP_HUGETLB = 0x40000 + MAP_HUGE_MASK = 0x3f + MAP_HUGE_SHIFT = 0x1a + MAP_LOCKED = 0x100 + MAP_NONBLOCK = 0x10000 + MAP_NORESERVE = 0x40 + MAP_POPULATE = 0x8000 + MAP_PRIVATE = 0x2 + MAP_RENAME = 0x20 + MAP_SHARED = 0x1 + MAP_SHARED_VALIDATE = 0x3 + MAP_STACK = 0x20000 + MAP_TYPE = 0xf + MCL_CURRENT = 0x2000 + MCL_FUTURE = 0x4000 + MCL_ONFAULT = 0x8000 + MFD_ALLOW_SEALING = 0x2 + MFD_CLOEXEC = 0x1 + MFD_HUGETLB = 0x4 + MFD_HUGE_16GB = -0x78000000 + MFD_HUGE_16MB = 0x60000000 + MFD_HUGE_1GB = 0x78000000 + MFD_HUGE_1MB = 0x50000000 + MFD_HUGE_256MB = 0x70000000 + MFD_HUGE_2GB = 0x7c000000 + MFD_HUGE_2MB = 0x54000000 + MFD_HUGE_32MB = 0x64000000 + MFD_HUGE_512KB = 0x4c000000 + MFD_HUGE_512MB = 0x74000000 + MFD_HUGE_64KB = 0x40000000 + MFD_HUGE_8MB = 0x5c000000 + MFD_HUGE_MASK = 0x3f + MFD_HUGE_SHIFT = 0x1a + MINIX2_SUPER_MAGIC = 0x2468 + MINIX2_SUPER_MAGIC2 = 0x2478 + MINIX3_SUPER_MAGIC = 0x4d5a + MINIX_SUPER_MAGIC = 0x137f + MINIX_SUPER_MAGIC2 = 0x138f + MNT_DETACH = 0x2 + MNT_EXPIRE = 0x4 + MNT_FORCE = 0x1 + MODULE_INIT_IGNORE_MODVERSIONS = 0x1 + MODULE_INIT_IGNORE_VERMAGIC = 0x2 + MSDOS_SUPER_MAGIC = 0x4d44 + MSG_BATCH = 0x40000 + MSG_CMSG_CLOEXEC = 0x40000000 + MSG_CONFIRM = 0x800 + MSG_CTRUNC = 0x8 + MSG_DONTROUTE = 0x4 + MSG_DONTWAIT = 0x40 + MSG_EOR = 0x80 + MSG_ERRQUEUE = 0x2000 + MSG_FASTOPEN = 0x20000000 + MSG_FIN = 0x200 + MSG_MORE = 0x8000 + MSG_NOSIGNAL = 0x4000 + MSG_OOB = 0x1 + MSG_PEEK = 0x2 + MSG_PROXY = 0x10 + MSG_RST = 0x1000 + MSG_SYN = 0x400 + MSG_TRUNC = 0x20 + MSG_TRYHARD = 0x4 + MSG_WAITALL = 0x100 + MSG_WAITFORONE = 0x10000 + MSG_ZEROCOPY = 0x4000000 + MS_ACTIVE = 0x40000000 + MS_ASYNC = 0x1 + MS_BIND = 0x1000 + MS_BORN = 0x20000000 + MS_DIRSYNC = 0x80 + MS_INVALIDATE = 0x2 + MS_I_VERSION = 0x800000 + MS_KERNMOUNT = 0x400000 + MS_LAZYTIME = 0x2000000 + MS_MANDLOCK = 0x40 + MS_MGC_MSK = 0xffff0000 + MS_MGC_VAL = 0xc0ed0000 + MS_MOVE = 0x2000 + MS_NOATIME = 0x400 + MS_NODEV = 0x4 + MS_NODIRATIME = 0x800 + MS_NOEXEC = 0x8 + MS_NOREMOTELOCK = 0x8000000 + MS_NOSEC = 0x10000000 + MS_NOSUID = 0x2 + MS_NOUSER = -0x80000000 + MS_POSIXACL = 0x10000 + MS_PRIVATE = 0x40000 + MS_RDONLY = 0x1 + MS_REC = 0x4000 + MS_RELATIME = 0x200000 + MS_REMOUNT = 0x20 + MS_RMT_MASK = 0x2800051 + MS_SHARED = 0x100000 + MS_SILENT = 0x8000 + MS_SLAVE = 0x80000 + MS_STRICTATIME = 0x1000000 + MS_SUBMOUNT = 0x4000000 + MS_SYNC = 0x4 + MS_SYNCHRONOUS = 0x10 + MS_UNBINDABLE = 0x20000 + MS_VERBOSE = 0x8000 + MTD_INODE_FS_MAGIC = 0x11307854 + NAME_MAX = 0xff + NCP_SUPER_MAGIC = 0x564c + NETLINK_ADD_MEMBERSHIP = 0x1 + NETLINK_AUDIT = 0x9 + NETLINK_BROADCAST_ERROR = 0x4 + NETLINK_CAP_ACK = 0xa + NETLINK_CONNECTOR = 0xb + NETLINK_CRYPTO = 0x15 + NETLINK_DNRTMSG = 0xe + NETLINK_DROP_MEMBERSHIP = 0x2 + NETLINK_ECRYPTFS = 0x13 + NETLINK_EXT_ACK = 0xb + NETLINK_FIB_LOOKUP = 0xa + NETLINK_FIREWALL = 0x3 + NETLINK_GENERIC = 0x10 + NETLINK_INET_DIAG = 0x4 + NETLINK_IP6_FW = 0xd + NETLINK_ISCSI = 0x8 + NETLINK_KOBJECT_UEVENT = 0xf + NETLINK_LISTEN_ALL_NSID = 0x8 + NETLINK_LIST_MEMBERSHIPS = 0x9 + NETLINK_NETFILTER = 0xc + NETLINK_NFLOG = 0x5 + NETLINK_NO_ENOBUFS = 0x5 + NETLINK_PKTINFO = 0x3 + NETLINK_RDMA = 0x14 + NETLINK_ROUTE = 0x0 + NETLINK_RX_RING = 0x6 + NETLINK_SCSITRANSPORT = 0x12 + NETLINK_SELINUX = 0x7 + NETLINK_SMC = 0x16 + NETLINK_SOCK_DIAG = 0x4 + NETLINK_TX_RING = 0x7 + NETLINK_UNUSED = 0x1 + NETLINK_USERSOCK = 0x2 + NETLINK_XFRM = 0x6 + NETNSA_MAX = 0x3 + NETNSA_NSID_NOT_ASSIGNED = -0x1 + NFNETLINK_V0 = 0x0 + NFNLGRP_ACCT_QUOTA = 0x8 + NFNLGRP_CONNTRACK_DESTROY = 0x3 + NFNLGRP_CONNTRACK_EXP_DESTROY = 0x6 + NFNLGRP_CONNTRACK_EXP_NEW = 0x4 + NFNLGRP_CONNTRACK_EXP_UPDATE = 0x5 + NFNLGRP_CONNTRACK_NEW = 0x1 + NFNLGRP_CONNTRACK_UPDATE = 0x2 + NFNLGRP_MAX = 0x9 + NFNLGRP_NFTABLES = 0x7 + NFNLGRP_NFTRACE = 0x9 + NFNLGRP_NONE = 0x0 + NFNL_BATCH_MAX = 0x1 + NFNL_MSG_BATCH_BEGIN = 0x10 + NFNL_MSG_BATCH_END = 0x11 + NFNL_NFA_NEST = 0x8000 + NFNL_SUBSYS_ACCT = 0x7 + NFNL_SUBSYS_COUNT = 0xc + NFNL_SUBSYS_CTHELPER = 0x9 + NFNL_SUBSYS_CTNETLINK = 0x1 + NFNL_SUBSYS_CTNETLINK_EXP = 0x2 + NFNL_SUBSYS_CTNETLINK_TIMEOUT = 0x8 + NFNL_SUBSYS_IPSET = 0x6 + NFNL_SUBSYS_NFTABLES = 0xa + NFNL_SUBSYS_NFT_COMPAT = 0xb + NFNL_SUBSYS_NONE = 0x0 + NFNL_SUBSYS_OSF = 0x5 + NFNL_SUBSYS_QUEUE = 0x3 + NFNL_SUBSYS_ULOG = 0x4 + NFS_SUPER_MAGIC = 0x6969 + NILFS_SUPER_MAGIC = 0x3434 + NL0 = 0x0 + NL1 = 0x100 + NLA_ALIGNTO = 0x4 + NLA_F_NESTED = 0x8000 + NLA_F_NET_BYTEORDER = 0x4000 + NLA_HDRLEN = 0x4 + NLDLY = 0x100 + NLMSG_ALIGNTO = 0x4 + NLMSG_DONE = 0x3 + NLMSG_ERROR = 0x2 + NLMSG_HDRLEN = 0x10 + NLMSG_MIN_TYPE = 0x10 + NLMSG_NOOP = 0x1 + NLMSG_OVERRUN = 0x4 + NLM_F_ACK = 0x4 + NLM_F_ACK_TLVS = 0x200 + NLM_F_APPEND = 0x800 + NLM_F_ATOMIC = 0x400 + NLM_F_CAPPED = 0x100 + NLM_F_CREATE = 0x400 + NLM_F_DUMP = 0x300 + NLM_F_DUMP_FILTERED = 0x20 + NLM_F_DUMP_INTR = 0x10 + NLM_F_ECHO = 0x8 + NLM_F_EXCL = 0x200 + NLM_F_MATCH = 0x200 + NLM_F_MULTI = 0x2 + NLM_F_NONREC = 0x100 + NLM_F_REPLACE = 0x100 + NLM_F_REQUEST = 0x1 + NLM_F_ROOT = 0x100 + NOFLSH = 0x80 + NSFS_MAGIC = 0x6e736673 + OCFS2_SUPER_MAGIC = 0x7461636f + OCRNL = 0x8 + OFDEL = 0x80 + OFILL = 0x40 + OLCUC = 0x2 + ONLCR = 0x4 + ONLRET = 0x20 + ONOCR = 0x10 + OPENPROM_SUPER_MAGIC = 0x9fa1 + OPOST = 0x1 + OVERLAYFS_SUPER_MAGIC = 0x794c7630 + O_ACCMODE = 0x3 + O_APPEND = 0x8 + O_ASYNC = 0x40 + O_CLOEXEC = 0x400000 + O_CREAT = 0x200 + O_DIRECT = 0x100000 + O_DIRECTORY = 0x10000 + O_DSYNC = 0x2000 + O_EXCL = 0x800 + O_FSYNC = 0x802000 + O_LARGEFILE = 0x0 + O_NDELAY = 0x4004 + O_NOATIME = 0x200000 + O_NOCTTY = 0x8000 + O_NOFOLLOW = 0x20000 + O_NONBLOCK = 0x4000 + O_PATH = 0x1000000 + O_RDONLY = 0x0 + O_RDWR = 0x2 + O_RSYNC = 0x802000 + O_SYNC = 0x802000 + O_TMPFILE = 0x2010000 + O_TRUNC = 0x400 + O_WRONLY = 0x1 + PACKET_ADD_MEMBERSHIP = 0x1 + PACKET_AUXDATA = 0x8 + PACKET_BROADCAST = 0x1 + PACKET_COPY_THRESH = 0x7 + PACKET_DROP_MEMBERSHIP = 0x2 + PACKET_FANOUT = 0x12 + PACKET_FANOUT_CBPF = 0x6 + PACKET_FANOUT_CPU = 0x2 + PACKET_FANOUT_DATA = 0x16 + PACKET_FANOUT_EBPF = 0x7 + PACKET_FANOUT_FLAG_DEFRAG = 0x8000 + PACKET_FANOUT_FLAG_ROLLOVER = 0x1000 + PACKET_FANOUT_FLAG_UNIQUEID = 0x2000 + PACKET_FANOUT_HASH = 0x0 + PACKET_FANOUT_LB = 0x1 + PACKET_FANOUT_QM = 0x5 + PACKET_FANOUT_RND = 0x4 + PACKET_FANOUT_ROLLOVER = 0x3 + PACKET_FASTROUTE = 0x6 + PACKET_HDRLEN = 0xb + PACKET_HOST = 0x0 + PACKET_KERNEL = 0x7 + PACKET_LOOPBACK = 0x5 + PACKET_LOSS = 0xe + PACKET_MR_ALLMULTI = 0x2 + PACKET_MR_MULTICAST = 0x0 + PACKET_MR_PROMISC = 0x1 + PACKET_MR_UNICAST = 0x3 + PACKET_MULTICAST = 0x2 + PACKET_ORIGDEV = 0x9 + PACKET_OTHERHOST = 0x3 + PACKET_OUTGOING = 0x4 + PACKET_QDISC_BYPASS = 0x14 + PACKET_RECV_OUTPUT = 0x3 + PACKET_RESERVE = 0xc + PACKET_ROLLOVER_STATS = 0x15 + PACKET_RX_RING = 0x5 + PACKET_STATISTICS = 0x6 + PACKET_TIMESTAMP = 0x11 + PACKET_TX_HAS_OFF = 0x13 + PACKET_TX_RING = 0xd + PACKET_TX_TIMESTAMP = 0x10 + PACKET_USER = 0x6 + PACKET_VERSION = 0xa + PACKET_VNET_HDR = 0xf + PARENB = 0x100 + PARITY_CRC16_PR0 = 0x2 + PARITY_CRC16_PR0_CCITT = 0x4 + PARITY_CRC16_PR1 = 0x3 + PARITY_CRC16_PR1_CCITT = 0x5 + PARITY_CRC32_PR0_CCITT = 0x6 + PARITY_CRC32_PR1_CCITT = 0x7 + PARITY_DEFAULT = 0x0 + PARITY_NONE = 0x1 + PARMRK = 0x8 + PARODD = 0x200 + PENDIN = 0x4000 + PERF_EVENT_IOC_DISABLE = 0x20002401 + PERF_EVENT_IOC_ENABLE = 0x20002400 + PERF_EVENT_IOC_ID = 0x40082407 + PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b + PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 + PERF_EVENT_IOC_PERIOD = 0x80082404 + PERF_EVENT_IOC_QUERY_BPF = 0xc008240a + PERF_EVENT_IOC_REFRESH = 0x20002402 + PERF_EVENT_IOC_RESET = 0x20002403 + PERF_EVENT_IOC_SET_BPF = 0x80042408 + PERF_EVENT_IOC_SET_FILTER = 0x80082406 + PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 + PIPEFS_MAGIC = 0x50495045 + PPPIOCATTACH = 0x8004743d + PPPIOCATTCHAN = 0x80047438 + PPPIOCCONNECT = 0x8004743a + PPPIOCDETACH = 0x8004743c + PPPIOCDISCONN = 0x20007439 + PPPIOCGASYNCMAP = 0x40047458 + PPPIOCGCHAN = 0x40047437 + PPPIOCGDEBUG = 0x40047441 + PPPIOCGFLAGS = 0x4004745a + PPPIOCGIDLE = 0x4010743f + PPPIOCGL2TPSTATS = 0x40487436 + PPPIOCGMRU = 0x40047453 + PPPIOCGNPMODE = 0xc008744c + PPPIOCGRASYNCMAP = 0x40047455 + PPPIOCGUNIT = 0x40047456 + PPPIOCGXASYNCMAP = 0x40207450 + PPPIOCNEWUNIT = 0xc004743e + PPPIOCSACTIVE = 0x80107446 + PPPIOCSASYNCMAP = 0x80047457 + PPPIOCSCOMPRESS = 0x8010744d + PPPIOCSDEBUG = 0x80047440 + PPPIOCSFLAGS = 0x80047459 + PPPIOCSMAXCID = 0x80047451 + PPPIOCSMRRU = 0x8004743b + PPPIOCSMRU = 0x80047452 + PPPIOCSNPMODE = 0x8008744b + PPPIOCSPASS = 0x80107447 + PPPIOCSRASYNCMAP = 0x80047454 + PPPIOCSXASYNCMAP = 0x8020744f + PPPIOCXFERUNIT = 0x2000744e + PRIO_PGRP = 0x1 + PRIO_PROCESS = 0x0 + PRIO_USER = 0x2 + PROC_SUPER_MAGIC = 0x9fa0 + PROT_EXEC = 0x4 + PROT_GROWSDOWN = 0x1000000 + PROT_GROWSUP = 0x2000000 + PROT_NONE = 0x0 + PROT_READ = 0x1 + PROT_WRITE = 0x2 + PR_CAPBSET_DROP = 0x18 + PR_CAPBSET_READ = 0x17 + PR_CAP_AMBIENT = 0x2f + PR_CAP_AMBIENT_CLEAR_ALL = 0x4 + PR_CAP_AMBIENT_IS_SET = 0x1 + PR_CAP_AMBIENT_LOWER = 0x3 + PR_CAP_AMBIENT_RAISE = 0x2 + PR_ENDIAN_BIG = 0x0 + PR_ENDIAN_LITTLE = 0x1 + PR_ENDIAN_PPC_LITTLE = 0x2 + PR_FPEMU_NOPRINT = 0x1 + PR_FPEMU_SIGFPE = 0x2 + PR_FP_EXC_ASYNC = 0x2 + PR_FP_EXC_DISABLED = 0x0 + PR_FP_EXC_DIV = 0x10000 + PR_FP_EXC_INV = 0x100000 + PR_FP_EXC_NONRECOV = 0x1 + PR_FP_EXC_OVF = 0x20000 + PR_FP_EXC_PRECISE = 0x3 + PR_FP_EXC_RES = 0x80000 + PR_FP_EXC_SW_ENABLE = 0x80 + PR_FP_EXC_UND = 0x40000 + PR_FP_MODE_FR = 0x1 + PR_FP_MODE_FRE = 0x2 + PR_GET_CHILD_SUBREAPER = 0x25 + PR_GET_DUMPABLE = 0x3 + PR_GET_ENDIAN = 0x13 + PR_GET_FPEMU = 0x9 + PR_GET_FPEXC = 0xb + PR_GET_FP_MODE = 0x2e + PR_GET_KEEPCAPS = 0x7 + PR_GET_NAME = 0x10 + PR_GET_NO_NEW_PRIVS = 0x27 + PR_GET_PDEATHSIG = 0x2 + PR_GET_SECCOMP = 0x15 + PR_GET_SECUREBITS = 0x1b + PR_GET_SPECULATION_CTRL = 0x34 + PR_GET_THP_DISABLE = 0x2a + PR_GET_TID_ADDRESS = 0x28 + PR_GET_TIMERSLACK = 0x1e + PR_GET_TIMING = 0xd + PR_GET_TSC = 0x19 + PR_GET_UNALIGN = 0x5 + PR_MCE_KILL = 0x21 + PR_MCE_KILL_CLEAR = 0x0 + PR_MCE_KILL_DEFAULT = 0x2 + PR_MCE_KILL_EARLY = 0x1 + PR_MCE_KILL_GET = 0x22 + PR_MCE_KILL_LATE = 0x0 + PR_MCE_KILL_SET = 0x1 + PR_MPX_DISABLE_MANAGEMENT = 0x2c + PR_MPX_ENABLE_MANAGEMENT = 0x2b + PR_SET_CHILD_SUBREAPER = 0x24 + PR_SET_DUMPABLE = 0x4 + PR_SET_ENDIAN = 0x14 + PR_SET_FPEMU = 0xa + PR_SET_FPEXC = 0xc + PR_SET_FP_MODE = 0x2d + PR_SET_KEEPCAPS = 0x8 + PR_SET_MM = 0x23 + PR_SET_MM_ARG_END = 0x9 + PR_SET_MM_ARG_START = 0x8 + PR_SET_MM_AUXV = 0xc + PR_SET_MM_BRK = 0x7 + PR_SET_MM_END_CODE = 0x2 + PR_SET_MM_END_DATA = 0x4 + PR_SET_MM_ENV_END = 0xb + PR_SET_MM_ENV_START = 0xa + PR_SET_MM_EXE_FILE = 0xd + PR_SET_MM_MAP = 0xe + PR_SET_MM_MAP_SIZE = 0xf + PR_SET_MM_START_BRK = 0x6 + PR_SET_MM_START_CODE = 0x1 + PR_SET_MM_START_DATA = 0x3 + PR_SET_MM_START_STACK = 0x5 + PR_SET_NAME = 0xf + PR_SET_NO_NEW_PRIVS = 0x26 + PR_SET_PDEATHSIG = 0x1 + PR_SET_PTRACER = 0x59616d61 + PR_SET_PTRACER_ANY = 0xffffffffffffffff + PR_SET_SECCOMP = 0x16 + PR_SET_SECUREBITS = 0x1c + PR_SET_SPECULATION_CTRL = 0x35 + PR_SET_THP_DISABLE = 0x29 + PR_SET_TIMERSLACK = 0x1d + PR_SET_TIMING = 0xe + PR_SET_TSC = 0x1a + PR_SET_UNALIGN = 0x6 + PR_SPEC_DISABLE = 0x4 + PR_SPEC_ENABLE = 0x2 + PR_SPEC_FORCE_DISABLE = 0x8 + PR_SPEC_NOT_AFFECTED = 0x0 + PR_SPEC_PRCTL = 0x1 + PR_SPEC_STORE_BYPASS = 0x0 + PR_SVE_GET_VL = 0x33 + PR_SVE_SET_VL = 0x32 + PR_SVE_SET_VL_ONEXEC = 0x40000 + PR_SVE_VL_INHERIT = 0x20000 + PR_SVE_VL_LEN_MASK = 0xffff + PR_TASK_PERF_EVENTS_DISABLE = 0x1f + PR_TASK_PERF_EVENTS_ENABLE = 0x20 + PR_TIMING_STATISTICAL = 0x0 + PR_TIMING_TIMESTAMP = 0x1 + PR_TSC_ENABLE = 0x1 + PR_TSC_SIGSEGV = 0x2 + PR_UNALIGN_NOPRINT = 0x1 + PR_UNALIGN_SIGBUS = 0x2 + PSTOREFS_MAGIC = 0x6165676c + PTRACE_ATTACH = 0x10 + PTRACE_CONT = 0x7 + PTRACE_DETACH = 0x11 + PTRACE_EVENT_CLONE = 0x3 + PTRACE_EVENT_EXEC = 0x4 + PTRACE_EVENT_EXIT = 0x6 + PTRACE_EVENT_FORK = 0x1 + PTRACE_EVENT_SECCOMP = 0x7 + PTRACE_EVENT_STOP = 0x80 + PTRACE_EVENT_VFORK = 0x2 + PTRACE_EVENT_VFORK_DONE = 0x5 + PTRACE_GETEVENTMSG = 0x4201 + PTRACE_GETFPAREGS = 0x14 + PTRACE_GETFPREGS = 0xe + PTRACE_GETFPREGS64 = 0x19 + PTRACE_GETREGS = 0xc + PTRACE_GETREGS64 = 0x16 + PTRACE_GETREGSET = 0x4204 + PTRACE_GETSIGINFO = 0x4202 + PTRACE_GETSIGMASK = 0x420a + PTRACE_INTERRUPT = 0x4207 + PTRACE_KILL = 0x8 + PTRACE_LISTEN = 0x4208 + PTRACE_O_EXITKILL = 0x100000 + PTRACE_O_MASK = 0x3000ff + PTRACE_O_SUSPEND_SECCOMP = 0x200000 + PTRACE_O_TRACECLONE = 0x8 + PTRACE_O_TRACEEXEC = 0x10 + PTRACE_O_TRACEEXIT = 0x40 + PTRACE_O_TRACEFORK = 0x2 + PTRACE_O_TRACESECCOMP = 0x80 + PTRACE_O_TRACESYSGOOD = 0x1 + PTRACE_O_TRACEVFORK = 0x4 + PTRACE_O_TRACEVFORKDONE = 0x20 + PTRACE_PEEKDATA = 0x2 + PTRACE_PEEKSIGINFO = 0x4209 + PTRACE_PEEKSIGINFO_SHARED = 0x1 + PTRACE_PEEKTEXT = 0x1 + PTRACE_PEEKUSR = 0x3 + PTRACE_POKEDATA = 0x5 + PTRACE_POKETEXT = 0x4 + PTRACE_POKEUSR = 0x6 + PTRACE_READDATA = 0x10 + PTRACE_READTEXT = 0x12 + PTRACE_SECCOMP_GET_FILTER = 0x420c + PTRACE_SECCOMP_GET_METADATA = 0x420d + PTRACE_SEIZE = 0x4206 + PTRACE_SETFPAREGS = 0x15 + PTRACE_SETFPREGS = 0xf + PTRACE_SETFPREGS64 = 0x1a + PTRACE_SETOPTIONS = 0x4200 + PTRACE_SETREGS = 0xd + PTRACE_SETREGS64 = 0x17 + PTRACE_SETREGSET = 0x4205 + PTRACE_SETSIGINFO = 0x4203 + PTRACE_SETSIGMASK = 0x420b + PTRACE_SINGLESTEP = 0x9 + PTRACE_SPARC_DETACH = 0xb + PTRACE_SYSCALL = 0x18 + PTRACE_TRACEME = 0x0 + PTRACE_WRITEDATA = 0x11 + PTRACE_WRITETEXT = 0x13 + PT_FP = 0x48 + PT_G0 = 0x10 + PT_G1 = 0x14 + PT_G2 = 0x18 + PT_G3 = 0x1c + PT_G4 = 0x20 + PT_G5 = 0x24 + PT_G6 = 0x28 + PT_G7 = 0x2c + PT_I0 = 0x30 + PT_I1 = 0x34 + PT_I2 = 0x38 + PT_I3 = 0x3c + PT_I4 = 0x40 + PT_I5 = 0x44 + PT_I6 = 0x48 + PT_I7 = 0x4c + PT_NPC = 0x8 + PT_PC = 0x4 + PT_PSR = 0x0 + PT_REGS_MAGIC = 0x57ac6c00 + PT_TNPC = 0x90 + PT_TPC = 0x88 + PT_TSTATE = 0x80 + PT_V9_FP = 0x70 + PT_V9_G0 = 0x0 + PT_V9_G1 = 0x8 + PT_V9_G2 = 0x10 + PT_V9_G3 = 0x18 + PT_V9_G4 = 0x20 + PT_V9_G5 = 0x28 + PT_V9_G6 = 0x30 + PT_V9_G7 = 0x38 + PT_V9_I0 = 0x40 + PT_V9_I1 = 0x48 + PT_V9_I2 = 0x50 + PT_V9_I3 = 0x58 + PT_V9_I4 = 0x60 + PT_V9_I5 = 0x68 + PT_V9_I6 = 0x70 + PT_V9_I7 = 0x78 + PT_V9_MAGIC = 0x9c + PT_V9_TNPC = 0x90 + PT_V9_TPC = 0x88 + PT_V9_TSTATE = 0x80 + PT_V9_Y = 0x98 + PT_WIM = 0x10 + PT_Y = 0xc + QNX4_SUPER_MAGIC = 0x2f + QNX6_SUPER_MAGIC = 0x68191122 + RAMFS_MAGIC = 0x858458f6 + RDTGROUP_SUPER_MAGIC = 0x7655821 + REISERFS_SUPER_MAGIC = 0x52654973 + RENAME_EXCHANGE = 0x2 + RENAME_NOREPLACE = 0x1 + RENAME_WHITEOUT = 0x4 + RLIMIT_AS = 0x9 + RLIMIT_CORE = 0x4 + RLIMIT_CPU = 0x0 + RLIMIT_DATA = 0x2 + RLIMIT_FSIZE = 0x1 + RLIMIT_LOCKS = 0xa + RLIMIT_MEMLOCK = 0x8 + RLIMIT_MSGQUEUE = 0xc + RLIMIT_NICE = 0xd + RLIMIT_NOFILE = 0x6 + RLIMIT_NPROC = 0x7 + RLIMIT_RSS = 0x5 + RLIMIT_RTPRIO = 0xe + RLIMIT_RTTIME = 0xf + RLIMIT_SIGPENDING = 0xb + RLIMIT_STACK = 0x3 + RLIM_INFINITY = 0xffffffffffffffff + RTAX_ADVMSS = 0x8 + RTAX_CC_ALGO = 0x10 + RTAX_CWND = 0x7 + RTAX_FASTOPEN_NO_COOKIE = 0x11 + RTAX_FEATURES = 0xc + RTAX_FEATURE_ALLFRAG = 0x8 + RTAX_FEATURE_ECN = 0x1 + RTAX_FEATURE_MASK = 0xf + RTAX_FEATURE_SACK = 0x2 + RTAX_FEATURE_TIMESTAMP = 0x4 + RTAX_HOPLIMIT = 0xa + RTAX_INITCWND = 0xb + RTAX_INITRWND = 0xe + RTAX_LOCK = 0x1 + RTAX_MAX = 0x11 + RTAX_MTU = 0x2 + RTAX_QUICKACK = 0xf + RTAX_REORDERING = 0x9 + RTAX_RTO_MIN = 0xd + RTAX_RTT = 0x4 + RTAX_RTTVAR = 0x5 + RTAX_SSTHRESH = 0x6 + RTAX_UNSPEC = 0x0 + RTAX_WINDOW = 0x3 + RTA_ALIGNTO = 0x4 + RTA_MAX = 0x1d + RTCF_DIRECTSRC = 0x4000000 + RTCF_DOREDIRECT = 0x1000000 + RTCF_LOG = 0x2000000 + RTCF_MASQ = 0x400000 + RTCF_NAT = 0x800000 + RTCF_VALVE = 0x200000 + RTC_AF = 0x20 + RTC_AIE_OFF = 0x20007002 + RTC_AIE_ON = 0x20007001 + RTC_ALM_READ = 0x40247008 + RTC_ALM_SET = 0x80247007 + RTC_EPOCH_READ = 0x4008700d + RTC_EPOCH_SET = 0x8008700e + RTC_IRQF = 0x80 + RTC_IRQP_READ = 0x4008700b + RTC_IRQP_SET = 0x8008700c + RTC_MAX_FREQ = 0x2000 + RTC_PF = 0x40 + RTC_PIE_OFF = 0x20007006 + RTC_PIE_ON = 0x20007005 + RTC_PLL_GET = 0x40207011 + RTC_PLL_SET = 0x80207012 + RTC_RD_TIME = 0x40247009 + RTC_SET_TIME = 0x8024700a + RTC_UF = 0x10 + RTC_UIE_OFF = 0x20007004 + RTC_UIE_ON = 0x20007003 + RTC_VL_CLR = 0x20007014 + RTC_VL_READ = 0x40047013 + RTC_WIE_OFF = 0x20007010 + RTC_WIE_ON = 0x2000700f + RTC_WKALM_RD = 0x40287010 + RTC_WKALM_SET = 0x8028700f + RTF_ADDRCLASSMASK = 0xf8000000 + RTF_ADDRCONF = 0x40000 + RTF_ALLONLINK = 0x20000 + RTF_BROADCAST = 0x10000000 + RTF_CACHE = 0x1000000 + RTF_DEFAULT = 0x10000 + RTF_DYNAMIC = 0x10 + RTF_FLOW = 0x2000000 + RTF_GATEWAY = 0x2 + RTF_HOST = 0x4 + RTF_INTERFACE = 0x40000000 + RTF_IRTT = 0x100 + RTF_LINKRT = 0x100000 + RTF_LOCAL = 0x80000000 + RTF_MODIFIED = 0x20 + RTF_MSS = 0x40 + RTF_MTU = 0x40 + RTF_MULTICAST = 0x20000000 + RTF_NAT = 0x8000000 + RTF_NOFORWARD = 0x1000 + RTF_NONEXTHOP = 0x200000 + RTF_NOPMTUDISC = 0x4000 + RTF_POLICY = 0x4000000 + RTF_REINSTATE = 0x8 + RTF_REJECT = 0x200 + RTF_STATIC = 0x400 + RTF_THROW = 0x2000 + RTF_UP = 0x1 + RTF_WINDOW = 0x80 + RTF_XRESOLVE = 0x800 + RTM_BASE = 0x10 + RTM_DELACTION = 0x31 + RTM_DELADDR = 0x15 + RTM_DELADDRLABEL = 0x49 + RTM_DELCHAIN = 0x65 + RTM_DELLINK = 0x11 + RTM_DELMDB = 0x55 + RTM_DELNEIGH = 0x1d + RTM_DELNETCONF = 0x51 + RTM_DELNSID = 0x59 + RTM_DELQDISC = 0x25 + RTM_DELROUTE = 0x19 + RTM_DELRULE = 0x21 + RTM_DELTCLASS = 0x29 + RTM_DELTFILTER = 0x2d + RTM_F_CLONED = 0x200 + RTM_F_EQUALIZE = 0x400 + RTM_F_FIB_MATCH = 0x2000 + RTM_F_LOOKUP_TABLE = 0x1000 + RTM_F_NOTIFY = 0x100 + RTM_F_PREFIX = 0x800 + RTM_GETACTION = 0x32 + RTM_GETADDR = 0x16 + RTM_GETADDRLABEL = 0x4a + RTM_GETANYCAST = 0x3e + RTM_GETCHAIN = 0x66 + RTM_GETDCB = 0x4e + RTM_GETLINK = 0x12 + RTM_GETMDB = 0x56 + RTM_GETMULTICAST = 0x3a + RTM_GETNEIGH = 0x1e + RTM_GETNEIGHTBL = 0x42 + RTM_GETNETCONF = 0x52 + RTM_GETNSID = 0x5a + RTM_GETQDISC = 0x26 + RTM_GETROUTE = 0x1a + RTM_GETRULE = 0x22 + RTM_GETSTATS = 0x5e + RTM_GETTCLASS = 0x2a + RTM_GETTFILTER = 0x2e + RTM_MAX = 0x67 + RTM_NEWACTION = 0x30 + RTM_NEWADDR = 0x14 + RTM_NEWADDRLABEL = 0x48 + RTM_NEWCACHEREPORT = 0x60 + RTM_NEWCHAIN = 0x64 + RTM_NEWLINK = 0x10 + RTM_NEWMDB = 0x54 + RTM_NEWNDUSEROPT = 0x44 + RTM_NEWNEIGH = 0x1c + RTM_NEWNEIGHTBL = 0x40 + RTM_NEWNETCONF = 0x50 + RTM_NEWNSID = 0x58 + RTM_NEWPREFIX = 0x34 + RTM_NEWQDISC = 0x24 + RTM_NEWROUTE = 0x18 + RTM_NEWRULE = 0x20 + RTM_NEWSTATS = 0x5c + RTM_NEWTCLASS = 0x28 + RTM_NEWTFILTER = 0x2c + RTM_NR_FAMILIES = 0x16 + RTM_NR_MSGTYPES = 0x58 + RTM_SETDCB = 0x4f + RTM_SETLINK = 0x13 + RTM_SETNEIGHTBL = 0x43 + RTNH_ALIGNTO = 0x4 + RTNH_COMPARE_MASK = 0x19 + RTNH_F_DEAD = 0x1 + RTNH_F_LINKDOWN = 0x10 + RTNH_F_OFFLOAD = 0x8 + RTNH_F_ONLINK = 0x4 + RTNH_F_PERVASIVE = 0x2 + RTNH_F_UNRESOLVED = 0x20 + RTN_MAX = 0xb + RTPROT_BABEL = 0x2a + RTPROT_BGP = 0xba + RTPROT_BIRD = 0xc + RTPROT_BOOT = 0x3 + RTPROT_DHCP = 0x10 + RTPROT_DNROUTED = 0xd + RTPROT_EIGRP = 0xc0 + RTPROT_GATED = 0x8 + RTPROT_ISIS = 0xbb + RTPROT_KERNEL = 0x2 + RTPROT_MROUTED = 0x11 + RTPROT_MRT = 0xa + RTPROT_NTK = 0xf + RTPROT_OSPF = 0xbc + RTPROT_RA = 0x9 + RTPROT_REDIRECT = 0x1 + RTPROT_RIP = 0xbd + RTPROT_STATIC = 0x4 + RTPROT_UNSPEC = 0x0 + RTPROT_XORP = 0xe + RTPROT_ZEBRA = 0xb + RT_CLASS_DEFAULT = 0xfd + RT_CLASS_LOCAL = 0xff + RT_CLASS_MAIN = 0xfe + RT_CLASS_MAX = 0xff + RT_CLASS_UNSPEC = 0x0 + RUSAGE_CHILDREN = -0x1 + RUSAGE_SELF = 0x0 + RUSAGE_THREAD = 0x1 + SCM_CREDENTIALS = 0x2 + SCM_RIGHTS = 0x1 + SCM_TIMESTAMP = 0x1d + SCM_TIMESTAMPING = 0x23 + SCM_TIMESTAMPING_OPT_STATS = 0x38 + SCM_TIMESTAMPING_PKTINFO = 0x3c + SCM_TIMESTAMPNS = 0x21 + SCM_TXTIME = 0x3f + SCM_WIFI_STATUS = 0x25 + SC_LOG_FLUSH = 0x100000 + SECCOMP_MODE_DISABLED = 0x0 + SECCOMP_MODE_FILTER = 0x2 + SECCOMP_MODE_STRICT = 0x1 + SECURITYFS_MAGIC = 0x73636673 + SELINUX_MAGIC = 0xf97cff8c + SHUT_RD = 0x0 + SHUT_RDWR = 0x2 + SHUT_WR = 0x1 + SIOCADDDLCI = 0x8980 + SIOCADDMULTI = 0x8931 + SIOCADDRT = 0x890b + SIOCATMARK = 0x8905 + SIOCBONDCHANGEACTIVE = 0x8995 + SIOCBONDENSLAVE = 0x8990 + SIOCBONDINFOQUERY = 0x8994 + SIOCBONDRELEASE = 0x8991 + SIOCBONDSETHWADDR = 0x8992 + SIOCBONDSLAVEINFOQUERY = 0x8993 + SIOCBRADDBR = 0x89a0 + SIOCBRADDIF = 0x89a2 + SIOCBRDELBR = 0x89a1 + SIOCBRDELIF = 0x89a3 + SIOCDARP = 0x8953 + SIOCDELDLCI = 0x8981 + SIOCDELMULTI = 0x8932 + SIOCDELRT = 0x890c + SIOCDEVPRIVATE = 0x89f0 + SIOCDIFADDR = 0x8936 + SIOCDRARP = 0x8960 + SIOCETHTOOL = 0x8946 + SIOCGARP = 0x8954 + SIOCGHWTSTAMP = 0x89b1 + SIOCGIFADDR = 0x8915 + SIOCGIFBR = 0x8940 + SIOCGIFBRDADDR = 0x8919 + SIOCGIFCONF = 0x8912 + SIOCGIFCOUNT = 0x8938 + SIOCGIFDSTADDR = 0x8917 + SIOCGIFENCAP = 0x8925 + SIOCGIFFLAGS = 0x8913 + SIOCGIFHWADDR = 0x8927 + SIOCGIFINDEX = 0x8933 + SIOCGIFMAP = 0x8970 + SIOCGIFMEM = 0x891f + SIOCGIFMETRIC = 0x891d + SIOCGIFMTU = 0x8921 + SIOCGIFNAME = 0x8910 + SIOCGIFNETMASK = 0x891b + SIOCGIFPFLAGS = 0x8935 + SIOCGIFSLAVE = 0x8929 + SIOCGIFTXQLEN = 0x8942 + SIOCGIFVLAN = 0x8982 + SIOCGMIIPHY = 0x8947 + SIOCGMIIREG = 0x8948 + SIOCGPGRP = 0x8904 + SIOCGPPPCSTATS = 0x89f2 + SIOCGPPPSTATS = 0x89f0 + SIOCGPPPVER = 0x89f1 + SIOCGRARP = 0x8961 + SIOCGSKNS = 0x894c + SIOCGSTAMP = 0x8906 + SIOCGSTAMPNS = 0x8907 + SIOCINQ = 0x4004667f + SIOCOUTQ = 0x40047473 + SIOCOUTQNSD = 0x894b + SIOCPROTOPRIVATE = 0x89e0 + SIOCRTMSG = 0x890d + SIOCSARP = 0x8955 + SIOCSHWTSTAMP = 0x89b0 + SIOCSIFADDR = 0x8916 + SIOCSIFBR = 0x8941 + SIOCSIFBRDADDR = 0x891a + SIOCSIFDSTADDR = 0x8918 + SIOCSIFENCAP = 0x8926 + SIOCSIFFLAGS = 0x8914 + SIOCSIFHWADDR = 0x8924 + SIOCSIFHWBROADCAST = 0x8937 + SIOCSIFLINK = 0x8911 + SIOCSIFMAP = 0x8971 + SIOCSIFMEM = 0x8920 + SIOCSIFMETRIC = 0x891e + SIOCSIFMTU = 0x8922 + SIOCSIFNAME = 0x8923 + SIOCSIFNETMASK = 0x891c + SIOCSIFPFLAGS = 0x8934 + SIOCSIFSLAVE = 0x8930 + SIOCSIFTXQLEN = 0x8943 + SIOCSIFVLAN = 0x8983 + SIOCSMIIREG = 0x8949 + SIOCSPGRP = 0x8902 + SIOCSRARP = 0x8962 + SIOCWANDEV = 0x894a + SMACK_MAGIC = 0x43415d53 + SMART_AUTOSAVE = 0xd2 + SMART_AUTO_OFFLINE = 0xdb + SMART_DISABLE = 0xd9 + SMART_ENABLE = 0xd8 + SMART_HCYL_PASS = 0xc2 + SMART_IMMEDIATE_OFFLINE = 0xd4 + SMART_LCYL_PASS = 0x4f + SMART_READ_LOG_SECTOR = 0xd5 + SMART_READ_THRESHOLDS = 0xd1 + SMART_READ_VALUES = 0xd0 + SMART_SAVE = 0xd3 + SMART_STATUS = 0xda + SMART_WRITE_LOG_SECTOR = 0xd6 + SMART_WRITE_THRESHOLDS = 0xd7 + SMB_SUPER_MAGIC = 0x517b + SOCKFS_MAGIC = 0x534f434b + SOCK_CLOEXEC = 0x400000 + SOCK_DCCP = 0x6 + SOCK_DGRAM = 0x2 + SOCK_IOC_TYPE = 0x89 + SOCK_NONBLOCK = 0x4000 + SOCK_PACKET = 0xa + SOCK_RAW = 0x3 + SOCK_RDM = 0x4 + SOCK_SEQPACKET = 0x5 + SOCK_STREAM = 0x1 + SOL_AAL = 0x109 + SOL_ALG = 0x117 + SOL_ATM = 0x108 + SOL_CAIF = 0x116 + SOL_CAN_BASE = 0x64 + SOL_DCCP = 0x10d + SOL_DECNET = 0x105 + SOL_ICMPV6 = 0x3a + SOL_IP = 0x0 + SOL_IPV6 = 0x29 + SOL_IRDA = 0x10a + SOL_IUCV = 0x115 + SOL_KCM = 0x119 + SOL_LLC = 0x10c + SOL_NETBEUI = 0x10b + SOL_NETLINK = 0x10e + SOL_NFC = 0x118 + SOL_PACKET = 0x107 + SOL_PNPIPE = 0x113 + SOL_PPPOL2TP = 0x111 + SOL_RAW = 0xff + SOL_RDS = 0x114 + SOL_RXRPC = 0x110 + SOL_SOCKET = 0xffff + SOL_TCP = 0x6 + SOL_TIPC = 0x10f + SOL_TLS = 0x11a + SOL_X25 = 0x106 + SOL_XDP = 0x11b + SOMAXCONN = 0x80 + SO_ACCEPTCONN = 0x8000 + SO_ATTACH_BPF = 0x34 + SO_ATTACH_FILTER = 0x1a + SO_ATTACH_REUSEPORT_CBPF = 0x35 + SO_ATTACH_REUSEPORT_EBPF = 0x36 + SO_BINDTODEVICE = 0xd + SO_BPF_EXTENSIONS = 0x32 + SO_BROADCAST = 0x20 + SO_BSDCOMPAT = 0x400 + SO_BUSY_POLL = 0x30 + SO_CNX_ADVICE = 0x37 + SO_COOKIE = 0x3b + SO_DEBUG = 0x1 + SO_DETACH_BPF = 0x1b + SO_DETACH_FILTER = 0x1b + SO_DOMAIN = 0x1029 + SO_DONTROUTE = 0x10 + SO_ERROR = 0x1007 + SO_GET_FILTER = 0x1a + SO_INCOMING_CPU = 0x33 + SO_INCOMING_NAPI_ID = 0x3a + SO_KEEPALIVE = 0x8 + SO_LINGER = 0x80 + SO_LOCK_FILTER = 0x28 + SO_MARK = 0x22 + SO_MAX_PACING_RATE = 0x31 + SO_MEMINFO = 0x39 + SO_NOFCS = 0x27 + SO_NO_CHECK = 0xb + SO_OOBINLINE = 0x100 + SO_PASSCRED = 0x2 + SO_PASSSEC = 0x1f + SO_PEEK_OFF = 0x26 + SO_PEERCRED = 0x40 + SO_PEERGROUPS = 0x3d + SO_PEERNAME = 0x1c + SO_PEERSEC = 0x1e + SO_PRIORITY = 0xc + SO_PROTOCOL = 0x1028 + SO_RCVBUF = 0x1002 + SO_RCVBUFFORCE = 0x100b + SO_RCVLOWAT = 0x800 + SO_RCVTIMEO = 0x2000 + SO_REUSEADDR = 0x4 + SO_REUSEPORT = 0x200 + SO_RXQ_OVFL = 0x24 + SO_SECURITY_AUTHENTICATION = 0x5001 + SO_SECURITY_ENCRYPTION_NETWORK = 0x5004 + SO_SECURITY_ENCRYPTION_TRANSPORT = 0x5002 + SO_SELECT_ERR_QUEUE = 0x29 + SO_SNDBUF = 0x1001 + SO_SNDBUFFORCE = 0x100a + SO_SNDLOWAT = 0x1000 + SO_SNDTIMEO = 0x4000 + SO_TIMESTAMP = 0x1d + SO_TIMESTAMPING = 0x23 + SO_TIMESTAMPNS = 0x21 + SO_TXTIME = 0x3f + SO_TYPE = 0x1008 + SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2 + SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1 + SO_VM_SOCKETS_BUFFER_SIZE = 0x0 + SO_VM_SOCKETS_CONNECT_TIMEOUT = 0x6 + SO_VM_SOCKETS_NONBLOCK_TXRX = 0x7 + SO_VM_SOCKETS_PEER_HOST_VM_ID = 0x3 + SO_VM_SOCKETS_TRUSTED = 0x5 + SO_WIFI_STATUS = 0x25 + SO_ZEROCOPY = 0x3e + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 + SQUASHFS_MAGIC = 0x73717368 + STACK_END_MAGIC = 0x57ac6e9d + STATX_ALL = 0xfff + STATX_ATIME = 0x20 + STATX_ATTR_APPEND = 0x20 + STATX_ATTR_AUTOMOUNT = 0x1000 + STATX_ATTR_COMPRESSED = 0x4 + STATX_ATTR_ENCRYPTED = 0x800 + STATX_ATTR_IMMUTABLE = 0x10 + STATX_ATTR_NODUMP = 0x40 + STATX_BASIC_STATS = 0x7ff + STATX_BLOCKS = 0x400 + STATX_BTIME = 0x800 + STATX_CTIME = 0x80 + STATX_GID = 0x10 + STATX_INO = 0x100 + STATX_MODE = 0x2 + STATX_MTIME = 0x40 + STATX_NLINK = 0x4 + STATX_SIZE = 0x200 + STATX_TYPE = 0x1 + STATX_UID = 0x8 + STATX__RESERVED = 0x80000000 + SYNC_FILE_RANGE_WAIT_AFTER = 0x4 + SYNC_FILE_RANGE_WAIT_BEFORE = 0x1 + SYNC_FILE_RANGE_WRITE = 0x2 + SYSFS_MAGIC = 0x62656572 + S_BLKSIZE = 0x200 + S_IEXEC = 0x40 + S_IFBLK = 0x6000 + S_IFCHR = 0x2000 + S_IFDIR = 0x4000 + S_IFIFO = 0x1000 + S_IFLNK = 0xa000 + S_IFMT = 0xf000 + S_IFREG = 0x8000 + S_IFSOCK = 0xc000 + S_IREAD = 0x100 + S_IRGRP = 0x20 + S_IROTH = 0x4 + S_IRUSR = 0x100 + S_IRWXG = 0x38 + S_IRWXO = 0x7 + S_IRWXU = 0x1c0 + S_ISGID = 0x400 + S_ISUID = 0x800 + S_ISVTX = 0x200 + S_IWGRP = 0x10 + S_IWOTH = 0x2 + S_IWRITE = 0x80 + S_IWUSR = 0x80 + S_IXGRP = 0x8 + S_IXOTH = 0x1 + S_IXUSR = 0x40 + TAB0 = 0x0 + TAB1 = 0x800 + TAB2 = 0x1000 + TAB3 = 0x1800 + TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 + TCFLSH = 0x20005407 + TCGETA = 0x40125401 + TCGETS = 0x40245408 + TCGETS2 = 0x402c540c + TCIFLUSH = 0x0 + TCIOFF = 0x2 + TCIOFLUSH = 0x2 + TCION = 0x3 + TCOFLUSH = 0x1 + TCOOFF = 0x0 + TCOON = 0x1 + TCP_CC_INFO = 0x1a + TCP_CONGESTION = 0xd + TCP_COOKIE_IN_ALWAYS = 0x1 + TCP_COOKIE_MAX = 0x10 + TCP_COOKIE_MIN = 0x8 + TCP_COOKIE_OUT_NEVER = 0x2 + TCP_COOKIE_PAIR_SIZE = 0x20 + TCP_COOKIE_TRANSACTIONS = 0xf + TCP_CORK = 0x3 + TCP_DEFER_ACCEPT = 0x9 + TCP_FASTOPEN = 0x17 + TCP_FASTOPEN_CONNECT = 0x1e + TCP_FASTOPEN_KEY = 0x21 + TCP_FASTOPEN_NO_COOKIE = 0x22 + TCP_INFO = 0xb + TCP_KEEPCNT = 0x6 + TCP_KEEPIDLE = 0x4 + TCP_KEEPINTVL = 0x5 + TCP_LINGER2 = 0x8 + TCP_MAXSEG = 0x2 + TCP_MAXWIN = 0xffff + TCP_MAX_WINSHIFT = 0xe + TCP_MD5SIG = 0xe + TCP_MD5SIG_EXT = 0x20 + TCP_MD5SIG_FLAG_PREFIX = 0x1 + TCP_MD5SIG_MAXKEYLEN = 0x50 + TCP_MSS = 0x200 + TCP_MSS_DEFAULT = 0x218 + TCP_MSS_DESIRED = 0x4c4 + TCP_NODELAY = 0x1 + TCP_NOTSENT_LOWAT = 0x19 + TCP_QUEUE_SEQ = 0x15 + TCP_QUICKACK = 0xc + TCP_REPAIR = 0x13 + TCP_REPAIR_OPTIONS = 0x16 + TCP_REPAIR_QUEUE = 0x14 + TCP_REPAIR_WINDOW = 0x1d + TCP_SAVED_SYN = 0x1c + TCP_SAVE_SYN = 0x1b + TCP_SYNCNT = 0x7 + TCP_S_DATA_IN = 0x4 + TCP_S_DATA_OUT = 0x8 + TCP_THIN_DUPACK = 0x11 + TCP_THIN_LINEAR_TIMEOUTS = 0x10 + TCP_TIMESTAMP = 0x18 + TCP_ULP = 0x1f + TCP_USER_TIMEOUT = 0x12 + TCP_WINDOW_CLAMP = 0xa + TCSAFLUSH = 0x2 + TCSBRK = 0x20005405 + TCSBRKP = 0x5425 + TCSETA = 0x80125402 + TCSETAF = 0x80125404 + TCSETAW = 0x80125403 + TCSETS = 0x80245409 + TCSETS2 = 0x802c540d + TCSETSF = 0x8024540b + TCSETSF2 = 0x802c540f + TCSETSW = 0x8024540a + TCSETSW2 = 0x802c540e + TCXONC = 0x20005406 + TIOCCBRK = 0x2000747a + TIOCCONS = 0x20007424 + TIOCEXCL = 0x2000740d + TIOCGDEV = 0x40045432 + TIOCGETD = 0x40047400 + TIOCGEXCL = 0x40045440 + TIOCGICOUNT = 0x545d + TIOCGLCKTRMIOS = 0x5456 + TIOCGPGRP = 0x40047483 + TIOCGPKT = 0x40045438 + TIOCGPTLCK = 0x40045439 + TIOCGPTN = 0x40047486 + TIOCGPTPEER = 0x20007489 + TIOCGRS485 = 0x40205441 + TIOCGSERIAL = 0x541e + TIOCGSID = 0x40047485 + TIOCGSOFTCAR = 0x40047464 + TIOCGWINSZ = 0x40087468 + TIOCINQ = 0x4004667f + TIOCLINUX = 0x541c + TIOCMBIC = 0x8004746b + TIOCMBIS = 0x8004746c + TIOCMGET = 0x4004746a + TIOCMIWAIT = 0x545c + TIOCMSET = 0x8004746d + TIOCM_CAR = 0x40 + TIOCM_CD = 0x40 + TIOCM_CTS = 0x20 + TIOCM_DSR = 0x100 + TIOCM_DTR = 0x2 + TIOCM_LE = 0x1 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_RTS = 0x4 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x20007471 + TIOCNXCL = 0x2000740e + TIOCOUTQ = 0x40047473 + TIOCPKT = 0x80047470 + TIOCPKT_DATA = 0x0 + TIOCPKT_DOSTOP = 0x20 + TIOCPKT_FLUSHREAD = 0x1 + TIOCPKT_FLUSHWRITE = 0x2 + TIOCPKT_IOCTL = 0x40 + TIOCPKT_NOSTOP = 0x10 + TIOCPKT_START = 0x8 + TIOCPKT_STOP = 0x4 + TIOCSBRK = 0x2000747b + TIOCSCTTY = 0x20007484 + TIOCSERCONFIG = 0x5453 + TIOCSERGETLSR = 0x5459 + TIOCSERGETMULTI = 0x545a + TIOCSERGSTRUCT = 0x5458 + TIOCSERGWILD = 0x5454 + TIOCSERSETMULTI = 0x545b + TIOCSERSWILD = 0x5455 + TIOCSETD = 0x80047401 + TIOCSIG = 0x80047488 + TIOCSLCKTRMIOS = 0x5457 + TIOCSPGRP = 0x80047482 + TIOCSPTLCK = 0x80047487 + TIOCSRS485 = 0xc0205442 + TIOCSSERIAL = 0x541f + TIOCSSOFTCAR = 0x80047465 + TIOCSTART = 0x2000746e + TIOCSTI = 0x80017472 + TIOCSTOP = 0x2000746f + TIOCSWINSZ = 0x80087467 + TIOCVHANGUP = 0x20005437 + TMPFS_MAGIC = 0x1021994 + TOSTOP = 0x100 + TPACKET_ALIGNMENT = 0x10 + TPACKET_HDRLEN = 0x34 + TP_STATUS_AVAILABLE = 0x0 + TP_STATUS_BLK_TMO = 0x20 + TP_STATUS_COPY = 0x2 + TP_STATUS_CSUMNOTREADY = 0x8 + TP_STATUS_CSUM_VALID = 0x80 + TP_STATUS_KERNEL = 0x0 + TP_STATUS_LOSING = 0x4 + TP_STATUS_SENDING = 0x2 + TP_STATUS_SEND_REQUEST = 0x1 + TP_STATUS_TS_RAW_HARDWARE = -0x80000000 + TP_STATUS_TS_SOFTWARE = 0x20000000 + TP_STATUS_TS_SYS_HARDWARE = 0x40000000 + TP_STATUS_USER = 0x1 + TP_STATUS_VLAN_TPID_VALID = 0x40 + TP_STATUS_VLAN_VALID = 0x10 + TP_STATUS_WRONG_FORMAT = 0x4 + TRACEFS_MAGIC = 0x74726163 + TS_COMM_LEN = 0x20 + TUNATTACHFILTER = 0x801054d5 + TUNDETACHFILTER = 0x801054d6 + TUNGETFEATURES = 0x400454cf + TUNGETFILTER = 0x401054db + TUNGETIFF = 0x400454d2 + TUNGETSNDBUF = 0x400454d3 + TUNGETVNETBE = 0x400454df + TUNGETVNETHDRSZ = 0x400454d7 + TUNGETVNETLE = 0x400454dd + TUNSETDEBUG = 0x800454c9 + TUNSETFILTEREBPF = 0x400454e1 + TUNSETGROUP = 0x800454ce + TUNSETIFF = 0x800454ca + TUNSETIFINDEX = 0x800454da + TUNSETLINK = 0x800454cd + TUNSETNOCSUM = 0x800454c8 + TUNSETOFFLOAD = 0x800454d0 + TUNSETOWNER = 0x800454cc + TUNSETPERSIST = 0x800454cb + TUNSETQUEUE = 0x800454d9 + TUNSETSNDBUF = 0x800454d4 + TUNSETSTEERINGEBPF = 0x400454e0 + TUNSETTXFILTER = 0x800454d1 + TUNSETVNETBE = 0x800454de + TUNSETVNETHDRSZ = 0x800454d8 + TUNSETVNETLE = 0x800454dc + UBI_IOCATT = 0x80186f40 + UBI_IOCDET = 0x80046f41 + UBI_IOCEBCH = 0x80044f02 + UBI_IOCEBER = 0x80044f01 + UBI_IOCEBISMAP = 0x40044f05 + UBI_IOCEBMAP = 0x80084f03 + UBI_IOCEBUNMAP = 0x80044f04 + UBI_IOCMKVOL = 0x80986f00 + UBI_IOCRMVOL = 0x80046f01 + UBI_IOCRNVOL = 0x91106f03 + UBI_IOCRSVOL = 0x800c6f02 + UBI_IOCSETVOLPROP = 0x80104f06 + UBI_IOCVOLCRBLK = 0x80804f07 + UBI_IOCVOLRMBLK = 0x20004f08 + UBI_IOCVOLUP = 0x80084f00 + UDF_SUPER_MAGIC = 0x15013346 + UMOUNT_NOFOLLOW = 0x8 + USBDEVICE_SUPER_MAGIC = 0x9fa2 + UTIME_NOW = 0x3fffffff + UTIME_OMIT = 0x3ffffffe + V9FS_MAGIC = 0x1021997 + VDISCARD = 0xd + VEOF = 0x4 + VEOL = 0xb + VEOL2 = 0x10 + VERASE = 0x2 + VINTR = 0x0 + VKILL = 0x3 + VLNEXT = 0xf + VMADDR_CID_ANY = 0xffffffff + VMADDR_CID_HOST = 0x2 + VMADDR_CID_HYPERVISOR = 0x0 + VMADDR_CID_RESERVED = 0x1 + VMADDR_PORT_ANY = 0xffffffff + VMIN = 0x6 + VM_SOCKETS_INVALID_VERSION = 0xffffffff + VQUIT = 0x1 + VREPRINT = 0xc + VSTART = 0x8 + VSTOP = 0x9 + VSUSP = 0xa + VSWTC = 0x7 + VT0 = 0x0 + VT1 = 0x4000 + VTDLY = 0x4000 + VTIME = 0x5 + VWERASE = 0xe + WALL = 0x40000000 + WCLONE = 0x80000000 + WCONTINUED = 0x8 + WDIOC_GETBOOTSTATUS = 0x40045702 + WDIOC_GETPRETIMEOUT = 0x40045709 + WDIOC_GETSTATUS = 0x40045701 + WDIOC_GETSUPPORT = 0x40285700 + WDIOC_GETTEMP = 0x40045703 + WDIOC_GETTIMELEFT = 0x4004570a + WDIOC_GETTIMEOUT = 0x40045707 + WDIOC_KEEPALIVE = 0x40045705 + WDIOC_SETOPTIONS = 0x40045704 + WDIOC_SETPRETIMEOUT = 0xc0045708 + WDIOC_SETTIMEOUT = 0xc0045706 + WEXITED = 0x4 + WIN_ACKMEDIACHANGE = 0xdb + WIN_CHECKPOWERMODE1 = 0xe5 + WIN_CHECKPOWERMODE2 = 0x98 + WIN_DEVICE_RESET = 0x8 + WIN_DIAGNOSE = 0x90 + WIN_DOORLOCK = 0xde + WIN_DOORUNLOCK = 0xdf + WIN_DOWNLOAD_MICROCODE = 0x92 + WIN_FLUSH_CACHE = 0xe7 + WIN_FLUSH_CACHE_EXT = 0xea + WIN_FORMAT = 0x50 + WIN_GETMEDIASTATUS = 0xda + WIN_IDENTIFY = 0xec + WIN_IDENTIFY_DMA = 0xee + WIN_IDLEIMMEDIATE = 0xe1 + WIN_INIT = 0x60 + WIN_MEDIAEJECT = 0xed + WIN_MULTREAD = 0xc4 + WIN_MULTREAD_EXT = 0x29 + WIN_MULTWRITE = 0xc5 + WIN_MULTWRITE_EXT = 0x39 + WIN_NOP = 0x0 + WIN_PACKETCMD = 0xa0 + WIN_PIDENTIFY = 0xa1 + WIN_POSTBOOT = 0xdc + WIN_PREBOOT = 0xdd + WIN_QUEUED_SERVICE = 0xa2 + WIN_READ = 0x20 + WIN_READDMA = 0xc8 + WIN_READDMA_EXT = 0x25 + WIN_READDMA_ONCE = 0xc9 + WIN_READDMA_QUEUED = 0xc7 + WIN_READDMA_QUEUED_EXT = 0x26 + WIN_READ_BUFFER = 0xe4 + WIN_READ_EXT = 0x24 + WIN_READ_LONG = 0x22 + WIN_READ_LONG_ONCE = 0x23 + WIN_READ_NATIVE_MAX = 0xf8 + WIN_READ_NATIVE_MAX_EXT = 0x27 + WIN_READ_ONCE = 0x21 + WIN_RECAL = 0x10 + WIN_RESTORE = 0x10 + WIN_SECURITY_DISABLE = 0xf6 + WIN_SECURITY_ERASE_PREPARE = 0xf3 + WIN_SECURITY_ERASE_UNIT = 0xf4 + WIN_SECURITY_FREEZE_LOCK = 0xf5 + WIN_SECURITY_SET_PASS = 0xf1 + WIN_SECURITY_UNLOCK = 0xf2 + WIN_SEEK = 0x70 + WIN_SETFEATURES = 0xef + WIN_SETIDLE1 = 0xe3 + WIN_SETIDLE2 = 0x97 + WIN_SETMULT = 0xc6 + WIN_SET_MAX = 0xf9 + WIN_SET_MAX_EXT = 0x37 + WIN_SLEEPNOW1 = 0xe6 + WIN_SLEEPNOW2 = 0x99 + WIN_SMART = 0xb0 + WIN_SPECIFY = 0x91 + WIN_SRST = 0x8 + WIN_STANDBY = 0xe2 + WIN_STANDBY2 = 0x96 + WIN_STANDBYNOW1 = 0xe0 + WIN_STANDBYNOW2 = 0x94 + WIN_VERIFY = 0x40 + WIN_VERIFY_EXT = 0x42 + WIN_VERIFY_ONCE = 0x41 + WIN_WRITE = 0x30 + WIN_WRITEDMA = 0xca + WIN_WRITEDMA_EXT = 0x35 + WIN_WRITEDMA_ONCE = 0xcb + WIN_WRITEDMA_QUEUED = 0xcc + WIN_WRITEDMA_QUEUED_EXT = 0x36 + WIN_WRITE_BUFFER = 0xe8 + WIN_WRITE_EXT = 0x34 + WIN_WRITE_LONG = 0x32 + WIN_WRITE_LONG_ONCE = 0x33 + WIN_WRITE_ONCE = 0x31 + WIN_WRITE_SAME = 0xe9 + WIN_WRITE_VERIFY = 0x3c + WNOHANG = 0x1 + WNOTHREAD = 0x20000000 + WNOWAIT = 0x1000000 + WORDSIZE = 0x40 + WSTOPPED = 0x2 + WUNTRACED = 0x2 + XATTR_CREATE = 0x1 + XATTR_REPLACE = 0x2 + XCASE = 0x4 + XDP_COPY = 0x2 + XDP_FLAGS_DRV_MODE = 0x4 + XDP_FLAGS_HW_MODE = 0x8 + XDP_FLAGS_MASK = 0xf + XDP_FLAGS_MODES = 0xe + XDP_FLAGS_SKB_MODE = 0x2 + XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MMAP_OFFSETS = 0x1 + XDP_PGOFF_RX_RING = 0x0 + XDP_PGOFF_TX_RING = 0x80000000 + XDP_RX_RING = 0x2 + XDP_SHARED_UMEM = 0x1 + XDP_STATISTICS = 0x7 + XDP_TX_RING = 0x3 + XDP_UMEM_COMPLETION_RING = 0x6 + XDP_UMEM_FILL_RING = 0x5 + XDP_UMEM_PGOFF_COMPLETION_RING = 0x180000000 + XDP_UMEM_PGOFF_FILL_RING = 0x100000000 + XDP_UMEM_REG = 0x4 + XDP_ZEROCOPY = 0x4 + XENFS_SUPER_MAGIC = 0xabba1974 + XTABS = 0x1800 + ZSMALLOC_MAGIC = 0x58295829 + __TIOCFLUSH = 0x80047410 ) // Errors diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go new file mode 100644 index 0000000000000..c4ec7ff87cf77 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go @@ -0,0 +1,1810 @@ +// go run mksyscall.go -l32 -tags darwin,386,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build darwin,386,!go1.12 + +package unix + +import ( + "syscall" + "unsafe" +) + +var _ syscall.Errno + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(ngid int, gid *_Gid_t) (n int, err error) { + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 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 setgroups(ngid int, gid *_Gid_t) (err error) { + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { + r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + wpid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(s int, how int) (err error) { + _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { + r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, timeval *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func futimes(fd int, timeval *[2]Timeval) (err error) { + _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, behav int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_GETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe() (r int, w int, err error) { + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r = int(r0) + w = int(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func removexattr(path string, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_SETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kill(pid int, signum int, posix int) (err error) { + _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Access(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { + _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chflags(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chmod(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(fd int) (nfd int, err error) { + r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + nfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(from int, to int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exchangedata(path1 string, path2 string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path1) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(path2) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + Syscall(SYS_EXIT, uintptr(code), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchflags(fd int, flags int) (err error) { + _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + 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 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flock(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdtablesize() (size int) { + r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + size = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgrp() (pgrp int) { + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + pgrp = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Issetugid() (tainted bool) { + r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + tainted = bool(r0 != 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kqueue() (fd int, err error) { + r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Link(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, backlog int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pathconf(path string, name int) (val int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 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 Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 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 read(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Revoke(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Rmdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) + newoffset = int64(int64(r1)<<32 | int64(r0)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { + _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setegid(egid int) (err error) { + _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seteuid(euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(gid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setlogin(name string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setprivexec(flag int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlink(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() (err error) { + _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(newmask int) (oldmask int) { + r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Undelete(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unmount(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { + r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) + ret = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { + r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + sec = int32(r0) + usec = int32(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 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 getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go index 8b7f27309b12d..23346dc68ff39 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go @@ -1,7 +1,7 @@ -// go run mksyscall.go -l32 -tags darwin,386 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go +// go run mksyscall.go -l32 -tags darwin,386,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go // Code generated by the command above; see README.md. DO NOT EDIT. -// +build darwin,386 +// +build darwin,386,go1.12 package unix @@ -15,7 +15,7 @@ var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { - r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -23,20 +23,30 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { return } +func libc_getgroups_trampoline() + +//go:linkname libc_getgroups libc_getgroups +//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { - _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgroups_trampoline() + +//go:linkname libc_setgroups libc_setgroups +//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { - r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -44,10 +54,15 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err return } +func libc_wait4_trampoline() + +//go:linkname libc_wait4 libc_wait4 +//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { - r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -55,30 +70,45 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { return } +func libc_accept_trampoline() + +//go:linkname libc_accept libc_accept +//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_bind_trampoline() + +//go:linkname libc_bind libc_bind +//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_connect_trampoline() + +//go:linkname libc_connect libc_connect +//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -86,66 +116,101 @@ func socket(domain int, typ int, proto int) (fd int, err error) { return } +func libc_socket_trampoline() + +//go:linkname libc_socket libc_socket +//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { - _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockopt_trampoline() + +//go:linkname libc_getsockopt libc_getsockopt +//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { - _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setsockopt_trampoline() + +//go:linkname libc_setsockopt libc_setsockopt +//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getpeername_trampoline() + +//go:linkname libc_getpeername libc_getpeername +//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockname_trampoline() + +//go:linkname libc_getsockname libc_getsockname +//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { - _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_shutdown_trampoline() + +//go:linkname libc_shutdown libc_shutdown +//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { - _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_socketpair_trampoline() + +//go:linkname libc_socketpair libc_socketpair +//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { @@ -155,7 +220,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -163,6 +228,11 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl return } +func libc_recvfrom_trampoline() + +//go:linkname libc_recvfrom libc_recvfrom +//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { @@ -172,17 +242,22 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sendto_trampoline() + +//go:linkname libc_sendto libc_sendto +//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -190,10 +265,15 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_recvmsg_trampoline() + +//go:linkname libc_recvmsg libc_recvmsg +//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -201,10 +281,15 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_sendmsg_trampoline() + +//go:linkname libc_sendmsg libc_sendmsg +//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { - r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -212,6 +297,11 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne return } +func libc_kevent_trampoline() + +//go:linkname libc_kevent libc_kevent +//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { @@ -221,13 +311,18 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + _, _, e1 := syscall_syscall6(funcPC(libc___sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc___sysctl_trampoline() + +//go:linkname libc___sysctl libc___sysctl +//go:cgo_import_dynamic libc___sysctl __sysctl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { @@ -236,27 +331,37 @@ func utimes(path string, timeval *[2]Timeval) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_utimes_trampoline() + +//go:linkname libc_utimes libc_utimes +//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { - _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_futimes_trampoline() + +//go:linkname libc_futimes libc_futimes +//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -264,10 +369,15 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { return } +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { - r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -275,6 +385,11 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { return } +func libc_poll_trampoline() + +//go:linkname libc_poll libc_poll +//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { @@ -284,13 +399,18 @@ func Madvise(b []byte, behav int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_madvise_trampoline() + +//go:linkname libc_madvise libc_madvise +//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { @@ -300,23 +420,33 @@ func Mlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlock_trampoline() + +//go:linkname libc_mlock libc_mlock +//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { - _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlockall_trampoline() + +//go:linkname libc_mlockall libc_mlockall +//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { @@ -326,13 +456,18 @@ func Mprotect(b []byte, prot int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mprotect_trampoline() + +//go:linkname libc_mprotect libc_mprotect +//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { @@ -342,13 +477,18 @@ func Msync(b []byte, flags int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_msync_trampoline() + +//go:linkname libc_msync libc_msync +//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { @@ -358,37 +498,67 @@ func Munlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlock_trampoline() + +//go:linkname libc_munlock libc_munlock +//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { - _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlockall_trampoline() + +//go:linkname libc_munlockall libc_munlockall +//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { - _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_ptrace_trampoline() + +//go:linkname libc_ptrace libc_ptrace +//go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_getattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_getattrlist_trampoline() + +//go:linkname libc_getattrlist libc_getattrlist +//go:cgo_import_dynamic libc_getattrlist getattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) r = int(r0) w = int(r1) if e1 != 0 { @@ -397,6 +567,11 @@ func pipe() (r int, w int, err error) { return } +func libc_pipe_trampoline() + +//go:linkname libc_pipe libc_pipe +//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -410,7 +585,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o if err != nil { return } - r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -418,6 +593,11 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o return } +func libc_getxattr_trampoline() + +//go:linkname libc_getxattr libc_getxattr +//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -426,7 +606,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio if err != nil { return } - r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -434,6 +614,11 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio return } +func libc_fgetxattr_trampoline() + +//go:linkname libc_fgetxattr libc_fgetxattr +//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -447,13 +632,18 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o if err != nil { return } - _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setxattr_trampoline() + +//go:linkname libc_setxattr libc_setxattr +//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -462,13 +652,18 @@ func fsetxattr(fd int, attr string, data *byte, size int, position uint32, optio if err != nil { return } - _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsetxattr_trampoline() + +//go:linkname libc_fsetxattr libc_fsetxattr +//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func removexattr(path string, attr string, options int) (err error) { @@ -482,13 +677,18 @@ func removexattr(path string, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_removexattr_trampoline() + +//go:linkname libc_removexattr libc_removexattr +//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fremovexattr(fd int, attr string, options int) (err error) { @@ -497,13 +697,18 @@ func fremovexattr(fd int, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fremovexattr_trampoline() + +//go:linkname libc_fremovexattr libc_fremovexattr +//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { @@ -512,7 +717,7 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro if err != nil { return } - r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -520,10 +725,15 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro return } +func libc_listxattr_trampoline() + +//go:linkname libc_listxattr libc_listxattr +//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { - r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -531,26 +741,71 @@ func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { return } +func libc_flistxattr_trampoline() + +//go:linkname libc_flistxattr libc_flistxattr +//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_setattrlist_trampoline() + +//go:linkname libc_setattrlist libc_setattrlist +//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kill(pid int, signum int, posix int) (err error) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_kill_trampoline() + +//go:linkname libc_kill libc_kill +//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_ioctl_trampoline() + +//go:linkname libc_ioctl libc_ioctl +//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := syscall_syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_sendfile_trampoline() + +//go:linkname libc_sendfile libc_sendfile +//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { @@ -559,23 +814,33 @@ func Access(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_access_trampoline() + +//go:linkname libc_access libc_access +//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { - _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_adjtime_trampoline() + +//go:linkname libc_adjtime libc_adjtime +//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { @@ -584,13 +849,18 @@ func Chdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chdir_trampoline() + +//go:linkname libc_chdir libc_chdir +//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { @@ -599,13 +869,18 @@ func Chflags(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chflags_trampoline() + +//go:linkname libc_chflags libc_chflags +//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { @@ -614,13 +889,18 @@ func Chmod(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chmod_trampoline() + +//go:linkname libc_chmod libc_chmod +//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { @@ -629,13 +909,18 @@ func Chown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chown_trampoline() + +//go:linkname libc_chown libc_chown +//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { @@ -644,27 +929,37 @@ func Chroot(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chroot_trampoline() + +//go:linkname libc_chroot libc_chroot +//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { - _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_close_trampoline() + +//go:linkname libc_close libc_close +//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -672,16 +967,26 @@ func Dup(fd int) (nfd int, err error) { return } +func libc_dup_trampoline() + +//go:linkname libc_dup libc_dup +//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_dup2_trampoline() + +//go:linkname libc_dup2 libc_dup2 +//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exchangedata(path1 string, path2 string, options int) (err error) { @@ -695,20 +1000,30 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_exchangedata_trampoline() + +//go:linkname libc_exchangedata libc_exchangedata +//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { - Syscall(SYS_EXIT, uintptr(code), 0, 0) + syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0) return } +func libc_exit_trampoline() + +//go:linkname libc_exit libc_exit +//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -717,43 +1032,63 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_faccessat_trampoline() + +//go:linkname libc_faccessat libc_faccessat +//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { - _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchdir_trampoline() + +//go:linkname libc_fchdir libc_fchdir +//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { - _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchflags_trampoline() + +//go:linkname libc_fchflags libc_fchflags +//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { - _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmod_trampoline() + +//go:linkname libc_fchmod libc_fchmod +//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -762,23 +1097,33 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmodat_trampoline() + +//go:linkname libc_fchmodat libc_fchmodat +//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib" + // 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)) + _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchown_trampoline() + +//go:linkname libc_fchown libc_fchown +//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { @@ -787,142 +1132,135 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fchownat_trampoline() -func Flock(fd int, how int) (err error) { - _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fchownat libc_fchownat +//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fpathconf(fd int, name int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) - val = int(r0) +func Flock(fd int, how int) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_flock_trampoline() -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_flock libc_flock +//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0) + val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fpathconf_trampoline() -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fpathconf libc_fpathconf +//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { - _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsync_trampoline() + +//go:linkname libc_fsync libc_fsync +//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { - _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) + _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_ftruncate_trampoline() -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_ftruncate libc_ftruncate +//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { - r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) return } +func libc_getdtablesize_trampoline() + +//go:linkname libc_getdtablesize libc_getdtablesize +//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0) egid = int(r0) return } +func libc_getegid_trampoline() + +//go:linkname libc_getegid libc_getegid +//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_geteuid_trampoline() + +//go:linkname libc_geteuid libc_geteuid +//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0) gid = int(r0) return } +func libc_getgid_trampoline() + +//go:linkname libc_getgid libc_getgid +//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -930,34 +1268,54 @@ func Getpgid(pid int) (pgid int, err error) { return } +func libc_getpgid_trampoline() + +//go:linkname libc_getpgid libc_getpgid +//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0) pgrp = int(r0) return } +func libc_getpgrp_trampoline() + +//go:linkname libc_getpgrp libc_getpgrp +//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0) pid = int(r0) return } +func libc_getpid_trampoline() + +//go:linkname libc_getpid libc_getpid +//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0) ppid = int(r0) return } +func libc_getppid_trampoline() + +//go:linkname libc_getppid libc_getppid +//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { - r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -965,30 +1323,45 @@ func Getpriority(which int, who int) (prio int, err error) { return } +func libc_getpriority_trampoline() + +//go:linkname libc_getpriority libc_getpriority +//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrlimit_trampoline() + +//go:linkname libc_getrlimit libc_getrlimit +//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { - _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrusage_trampoline() + +//go:linkname libc_getrusage libc_getrusage +//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -996,26 +1369,41 @@ func Getsid(pid int) (sid int, err error) { return } +func libc_getsid_trampoline() + +//go:linkname libc_getsid libc_getsid +//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_getuid_trampoline() + +//go:linkname libc_getuid libc_getuid +//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { - r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0) tainted = bool(r0 != 0) return } +func libc_issetugid_trampoline() + +//go:linkname libc_issetugid libc_issetugid +//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { - r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1023,6 +1411,11 @@ func Kqueue() (fd int, err error) { return } +func libc_kqueue_trampoline() + +//go:linkname libc_kqueue libc_kqueue +//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { @@ -1031,13 +1424,18 @@ func Lchown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_lchown_trampoline() + +//go:linkname libc_lchown libc_lchown +//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { @@ -1051,13 +1449,18 @@ func Link(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_link_trampoline() + +//go:linkname libc_link libc_link +//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { @@ -1071,37 +1474,32 @@ func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err er if err != nil { return } - _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_linkat_trampoline() + +//go:linkname libc_linkat libc_linkat +//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { - _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_listen_trampoline() -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_listen libc_listen +//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1111,13 +1509,18 @@ func Mkdir(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdir_trampoline() + +//go:linkname libc_mkdir libc_mkdir +//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { @@ -1126,13 +1529,18 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdirat_trampoline() + +//go:linkname libc_mkdirat libc_mkdirat +//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { @@ -1141,13 +1549,18 @@ func Mkfifo(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkfifo_trampoline() + +//go:linkname libc_mkfifo libc_mkfifo +//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { @@ -1156,13 +1569,18 @@ func Mknod(path string, mode uint32, dev int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mknod_trampoline() + +//go:linkname libc_mknod libc_mknod +//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { @@ -1171,7 +1589,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1179,6 +1597,11 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } +func libc_open_trampoline() + +//go:linkname libc_open libc_open +//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { @@ -1187,7 +1610,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1195,6 +1618,11 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { return } +func libc_openat_trampoline() + +//go:linkname libc_openat libc_openat +//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { @@ -1203,7 +1631,7 @@ func Pathconf(path string, name int) (val int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1211,6 +1639,11 @@ func Pathconf(path string, name int) (val int, err error) { return } +func libc_pathconf_trampoline() + +//go:linkname libc_pathconf libc_pathconf +//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { @@ -1220,7 +1653,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1228,6 +1661,11 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pread_trampoline() + +//go:linkname libc_pread libc_pread +//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { @@ -1237,7 +1675,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1245,6 +1683,11 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pwrite_trampoline() + +//go:linkname libc_pwrite libc_pwrite +//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { @@ -1254,7 +1697,7 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1262,6 +1705,11 @@ func read(fd int, p []byte) (n int, err error) { return } +func libc_read_trampoline() + +//go:linkname libc_read libc_read +//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { @@ -1276,7 +1724,7 @@ func Readlink(path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1284,6 +1732,11 @@ func Readlink(path string, buf []byte) (n int, err error) { return } +func libc_readlink_trampoline() + +//go:linkname libc_readlink libc_readlink +//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { @@ -1298,7 +1751,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1306,6 +1759,11 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { return } +func libc_readlinkat_trampoline() + +//go:linkname libc_readlinkat libc_readlinkat +//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { @@ -1319,13 +1777,18 @@ func Rename(from string, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rename_trampoline() + +//go:linkname libc_rename libc_rename +//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { @@ -1339,13 +1802,18 @@ func Renameat(fromfd int, from string, tofd int, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_renameat_trampoline() + +//go:linkname libc_renameat libc_renameat +//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { @@ -1354,13 +1822,18 @@ func Revoke(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_revoke_trampoline() + +//go:linkname libc_revoke libc_revoke +//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { @@ -1369,17 +1842,22 @@ func Rmdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rmdir_trampoline() + +//go:linkname libc_rmdir libc_rmdir +//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) + r0, r1, e1 := syscall_syscall6(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) @@ -1387,46 +1865,71 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { return } +func libc_lseek_trampoline() + +//go:linkname libc_lseek libc_lseek +//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { - _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_select_trampoline() + +//go:linkname libc_select libc_select +//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { - _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setegid_trampoline() + +//go:linkname libc_setegid libc_setegid +//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_seteuid_trampoline() + +//go:linkname libc_seteuid libc_seteuid +//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgid_trampoline() + +//go:linkname libc_setgid libc_setgid +//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { @@ -1435,77 +1938,112 @@ func Setlogin(name string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setlogin_trampoline() + +//go:linkname libc_setlogin libc_setlogin +//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpgid_trampoline() + +//go:linkname libc_setpgid libc_setpgid +//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpriority_trampoline() + +//go:linkname libc_setpriority libc_setpriority +//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setprivexec(flag int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setprivexec_trampoline() + +//go:linkname libc_setprivexec libc_setprivexec +//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setregid_trampoline() + +//go:linkname libc_setregid libc_setregid +//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setreuid_trampoline() + +//go:linkname libc_setreuid libc_setreuid +//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setrlimit_trampoline() + +//go:linkname libc_setrlimit libc_setrlimit +//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { - r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1513,55 +2051,40 @@ func Setsid() (pid int, err error) { return } +func libc_setsid_trampoline() + +//go:linkname libc_setsid libc_setsid +//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { - _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_settimeofday_trampoline() -func Setuid(uid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_settimeofday libc_settimeofday +//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) +func Setuid(uid int) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_setuid_trampoline() -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_setuid libc_setuid +//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1576,13 +2099,18 @@ func Symlink(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlink_trampoline() + +//go:linkname libc_symlink libc_symlink +//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { @@ -1596,23 +2124,33 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlinkat_trampoline() + +//go:linkname libc_symlinkat libc_symlinkat +//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { - _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sync_trampoline() + +//go:linkname libc_sync libc_sync +//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { @@ -1621,21 +2159,31 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) + _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_truncate_trampoline() + +//go:linkname libc_truncate libc_truncate +//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0) oldmask = int(r0) return } +func libc_umask_trampoline() + +//go:linkname libc_umask libc_umask +//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { @@ -1644,13 +2192,18 @@ func Undelete(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_undelete_trampoline() + +//go:linkname libc_undelete libc_undelete +//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { @@ -1659,13 +2212,18 @@ func Unlink(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlink_trampoline() + +//go:linkname libc_unlink libc_unlink +//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { @@ -1674,13 +2232,18 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlinkat_trampoline() + +//go:linkname libc_unlinkat libc_unlinkat +//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { @@ -1689,13 +2252,18 @@ func Unmount(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unmount_trampoline() + +//go:linkname libc_unmount libc_unmount +//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { @@ -1705,7 +2273,7 @@ func write(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1713,10 +2281,15 @@ func write(fd int, p []byte) (n int, err error) { return } +func libc_write_trampoline() + +//go:linkname libc_write libc_write +//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) + r0, _, e1 := syscall_syscall9(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) @@ -1724,20 +2297,30 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( return } +func libc_mmap_trampoline() + +//go:linkname libc_mmap libc_mmap +//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { - _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munmap_trampoline() + +//go:linkname libc_munmap libc_munmap +//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1748,7 +2331,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1759,7 +2342,7 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) sec = int32(r0) usec = int32(r1) if e1 != 0 { @@ -1767,3 +2350,156 @@ func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { } return } + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstat64_trampoline() + +//go:linkname libc_fstat64 libc_fstat64 +//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat64_trampoline() + +//go:linkname libc_fstatat64 libc_fstatat64 +//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatfs64_trampoline() + +//go:linkname libc_fstatfs64 libc_fstatfs64 +//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc___getdirentries64_trampoline() + +//go:linkname libc___getdirentries64 libc___getdirentries64 +//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_getfsstat64_trampoline() + +//go:linkname libc_getfsstat64 libc_getfsstat64 +//go:cgo_import_dynamic libc_getfsstat64 getfsstat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat64_trampoline() + +//go:linkname libc_lstat64 libc_lstat64 +//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat64_trampoline() + +//go:linkname libc_stat64 libc_stat64 +//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs64_trampoline() + +//go:linkname libc_statfs64 libc_statfs64 +//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s new file mode 100644 index 0000000000000..37b85b4f6127a --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s @@ -0,0 +1,284 @@ +// go run mkasm_darwin.go 386 +// Code generated by the command above; DO NOT EDIT. + +// +build go1.12 + +#include "textflag.h" +TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgroups(SB) +TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgroups(SB) +TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0 + JMP libc_wait4(SB) +TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0 + JMP libc_accept(SB) +TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0 + JMP libc_bind(SB) +TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_connect(SB) +TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socket(SB) +TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockopt(SB) +TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsockopt(SB) +TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpeername(SB) +TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockname(SB) +TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_shutdown(SB) +TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socketpair(SB) +TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvfrom(SB) +TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendto(SB) +TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvmsg(SB) +TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendmsg(SB) +TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kevent(SB) +TEXT ·libc___sysctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc___sysctl(SB) +TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_utimes(SB) +TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 + JMP libc_poll(SB) +TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 + JMP libc_madvise(SB) +TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlock(SB) +TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlockall(SB) +TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mprotect(SB) +TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_msync(SB) +TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlock(SB) +TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlockall(SB) +TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ptrace(SB) +TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getattrlist(SB) +TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pipe(SB) +TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getxattr(SB) +TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fgetxattr(SB) +TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setxattr(SB) +TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsetxattr(SB) +TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_removexattr(SB) +TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fremovexattr(SB) +TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listxattr(SB) +TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flistxattr(SB) +TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setattrlist(SB) +TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kill(SB) +TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ioctl(SB) +TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendfile(SB) +TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0 + JMP libc_access(SB) +TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0 + JMP libc_adjtime(SB) +TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chdir(SB) +TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chflags(SB) +TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chmod(SB) +TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chown(SB) +TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chroot(SB) +TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 + JMP libc_close(SB) +TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup(SB) +TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup2(SB) +TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exchangedata(SB) +TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exit(SB) +TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_faccessat(SB) +TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchdir(SB) +TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchflags(SB) +TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmod(SB) +TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmodat(SB) +TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchown(SB) +TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchownat(SB) +TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flock(SB) +TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fpathconf(SB) +TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsync(SB) +TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ftruncate(SB) +TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getdtablesize(SB) +TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getegid(SB) +TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_geteuid(SB) +TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgid(SB) +TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgid(SB) +TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgrp(SB) +TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpid(SB) +TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getppid(SB) +TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpriority(SB) +TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrlimit(SB) +TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrusage(SB) +TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsid(SB) +TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getuid(SB) +TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_issetugid(SB) +TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kqueue(SB) +TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lchown(SB) +TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 + JMP libc_link(SB) +TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_linkat(SB) +TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listen(SB) +TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdir(SB) +TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdirat(SB) +TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkfifo(SB) +TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mknod(SB) +TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0 + JMP libc_open(SB) +TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_openat(SB) +TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pathconf(SB) +TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pread(SB) +TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pwrite(SB) +TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0 + JMP libc_read(SB) +TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlink(SB) +TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlinkat(SB) +TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rename(SB) +TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_renameat(SB) +TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0 + JMP libc_revoke(SB) +TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rmdir(SB) +TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lseek(SB) +TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0 + JMP libc_select(SB) +TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setegid(SB) +TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_seteuid(SB) +TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgid(SB) +TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setlogin(SB) +TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpgid(SB) +TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpriority(SB) +TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setprivexec(SB) +TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setregid(SB) +TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setreuid(SB) +TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setrlimit(SB) +TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsid(SB) +TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_settimeofday(SB) +TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setuid(SB) +TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlink(SB) +TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlinkat(SB) +TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sync(SB) +TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_truncate(SB) +TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0 + JMP libc_umask(SB) +TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0 + JMP libc_undelete(SB) +TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlink(SB) +TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlinkat(SB) +TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unmount(SB) +TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0 + JMP libc_write(SB) +TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mmap(SB) +TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munmap(SB) +TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_gettimeofday(SB) +TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat64(SB) +TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat64(SB) +TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs64(SB) +TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 + JMP libc___getdirentries64(SB) +TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getfsstat64(SB) +TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat64(SB) +TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat64(SB) +TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs64(SB) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go new file mode 100644 index 0000000000000..2581e8960fd5a --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go @@ -0,0 +1,1810 @@ +// go run mksyscall.go -tags darwin,amd64,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build darwin,amd64,!go1.12 + +package unix + +import ( + "syscall" + "unsafe" +) + +var _ syscall.Errno + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(ngid int, gid *_Gid_t) (n int, err error) { + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 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 setgroups(ngid int, gid *_Gid_t) (err error) { + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { + r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + wpid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(s int, how int) (err error) { + _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { + r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, timeval *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func futimes(fd int, timeval *[2]Timeval) (err error) { + _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, behav int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_GETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe() (r int, w int, err error) { + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r = int(r0) + w = int(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func removexattr(path string, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_SETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kill(pid int, signum int, posix int) (err error) { + _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Access(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { + _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chflags(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chmod(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(fd int) (nfd int, err error) { + r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + nfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(from int, to int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exchangedata(path1 string, path2 string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path1) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(path2) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + Syscall(SYS_EXIT, uintptr(code), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchflags(fd int, flags int) (err error) { + _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + 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 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flock(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdtablesize() (size int) { + r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + size = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgrp() (pgrp int) { + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + pgrp = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Issetugid() (tainted bool) { + r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + tainted = bool(r0 != 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kqueue() (fd int, err error) { + r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Link(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, backlog int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pathconf(path string, name int) (val int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 read(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Revoke(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Rmdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + newoffset = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { + _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setegid(egid int) (err error) { + _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seteuid(euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(gid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setlogin(name string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setprivexec(flag int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlink(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() (err error) { + _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(newmask int) (oldmask int) { + r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Undelete(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unmount(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + ret = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { + r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + sec = int64(r0) + usec = int32(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 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 getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 285646462c4aa..b50178d679224 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -1,7 +1,7 @@ -// go run mksyscall.go -tags darwin,amd64 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go +// go run mksyscall.go -tags darwin,amd64,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. -// +build darwin,amd64 +// +build darwin,amd64,go1.12 package unix @@ -15,7 +15,7 @@ var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { - r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -23,20 +23,30 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { return } +func libc_getgroups_trampoline() + +//go:linkname libc_getgroups libc_getgroups +//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { - _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgroups_trampoline() + +//go:linkname libc_setgroups libc_setgroups +//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { - r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -44,10 +54,15 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err return } +func libc_wait4_trampoline() + +//go:linkname libc_wait4 libc_wait4 +//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { - r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -55,30 +70,45 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { return } +func libc_accept_trampoline() + +//go:linkname libc_accept libc_accept +//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_bind_trampoline() + +//go:linkname libc_bind libc_bind +//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_connect_trampoline() + +//go:linkname libc_connect libc_connect +//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -86,66 +116,101 @@ func socket(domain int, typ int, proto int) (fd int, err error) { return } +func libc_socket_trampoline() + +//go:linkname libc_socket libc_socket +//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { - _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockopt_trampoline() + +//go:linkname libc_getsockopt libc_getsockopt +//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { - _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setsockopt_trampoline() + +//go:linkname libc_setsockopt libc_setsockopt +//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getpeername_trampoline() + +//go:linkname libc_getpeername libc_getpeername +//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockname_trampoline() + +//go:linkname libc_getsockname libc_getsockname +//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { - _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_shutdown_trampoline() + +//go:linkname libc_shutdown libc_shutdown +//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { - _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_socketpair_trampoline() + +//go:linkname libc_socketpair libc_socketpair +//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { @@ -155,7 +220,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -163,6 +228,11 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl return } +func libc_recvfrom_trampoline() + +//go:linkname libc_recvfrom libc_recvfrom +//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { @@ -172,17 +242,22 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sendto_trampoline() + +//go:linkname libc_sendto libc_sendto +//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -190,10 +265,15 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_recvmsg_trampoline() + +//go:linkname libc_recvmsg libc_recvmsg +//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -201,10 +281,15 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_sendmsg_trampoline() + +//go:linkname libc_sendmsg libc_sendmsg +//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { - r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -212,6 +297,11 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne return } +func libc_kevent_trampoline() + +//go:linkname libc_kevent libc_kevent +//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { @@ -221,13 +311,18 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + _, _, e1 := syscall_syscall6(funcPC(libc___sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc___sysctl_trampoline() + +//go:linkname libc___sysctl libc___sysctl +//go:cgo_import_dynamic libc___sysctl __sysctl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { @@ -236,27 +331,37 @@ func utimes(path string, timeval *[2]Timeval) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_utimes_trampoline() + +//go:linkname libc_utimes libc_utimes +//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { - _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_futimes_trampoline() + +//go:linkname libc_futimes libc_futimes +//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -264,10 +369,15 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { return } +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { - r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -275,6 +385,11 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { return } +func libc_poll_trampoline() + +//go:linkname libc_poll libc_poll +//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { @@ -284,13 +399,18 @@ func Madvise(b []byte, behav int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_madvise_trampoline() + +//go:linkname libc_madvise libc_madvise +//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { @@ -300,23 +420,33 @@ func Mlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlock_trampoline() + +//go:linkname libc_mlock libc_mlock +//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { - _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlockall_trampoline() + +//go:linkname libc_mlockall libc_mlockall +//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { @@ -326,13 +456,18 @@ func Mprotect(b []byte, prot int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mprotect_trampoline() + +//go:linkname libc_mprotect libc_mprotect +//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { @@ -342,13 +477,18 @@ func Msync(b []byte, flags int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_msync_trampoline() + +//go:linkname libc_msync libc_msync +//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { @@ -358,37 +498,67 @@ func Munlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlock_trampoline() + +//go:linkname libc_munlock libc_munlock +//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { - _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlockall_trampoline() + +//go:linkname libc_munlockall libc_munlockall +//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { - _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_ptrace_trampoline() + +//go:linkname libc_ptrace libc_ptrace +//go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_getattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_getattrlist_trampoline() + +//go:linkname libc_getattrlist libc_getattrlist +//go:cgo_import_dynamic libc_getattrlist getattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) r = int(r0) w = int(r1) if e1 != 0 { @@ -397,6 +567,11 @@ func pipe() (r int, w int, err error) { return } +func libc_pipe_trampoline() + +//go:linkname libc_pipe libc_pipe +//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -410,7 +585,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o if err != nil { return } - r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -418,6 +593,11 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o return } +func libc_getxattr_trampoline() + +//go:linkname libc_getxattr libc_getxattr +//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -426,7 +606,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio if err != nil { return } - r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -434,6 +614,11 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio return } +func libc_fgetxattr_trampoline() + +//go:linkname libc_fgetxattr libc_fgetxattr +//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -447,13 +632,18 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o if err != nil { return } - _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setxattr_trampoline() + +//go:linkname libc_setxattr libc_setxattr +//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -462,13 +652,18 @@ func fsetxattr(fd int, attr string, data *byte, size int, position uint32, optio if err != nil { return } - _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsetxattr_trampoline() + +//go:linkname libc_fsetxattr libc_fsetxattr +//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func removexattr(path string, attr string, options int) (err error) { @@ -482,13 +677,18 @@ func removexattr(path string, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_removexattr_trampoline() + +//go:linkname libc_removexattr libc_removexattr +//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fremovexattr(fd int, attr string, options int) (err error) { @@ -497,13 +697,18 @@ func fremovexattr(fd int, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fremovexattr_trampoline() + +//go:linkname libc_fremovexattr libc_fremovexattr +//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { @@ -512,7 +717,7 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro if err != nil { return } - r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -520,10 +725,15 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro return } +func libc_listxattr_trampoline() + +//go:linkname libc_listxattr libc_listxattr +//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { - r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -531,26 +741,71 @@ func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { return } +func libc_flistxattr_trampoline() + +//go:linkname libc_flistxattr libc_flistxattr +//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_setattrlist_trampoline() + +//go:linkname libc_setattrlist libc_setattrlist +//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kill(pid int, signum int, posix int) (err error) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_kill_trampoline() + +//go:linkname libc_kill libc_kill +//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_ioctl_trampoline() + +//go:linkname libc_ioctl libc_ioctl +//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_sendfile_trampoline() + +//go:linkname libc_sendfile libc_sendfile +//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { @@ -559,23 +814,33 @@ func Access(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_access_trampoline() + +//go:linkname libc_access libc_access +//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { - _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_adjtime_trampoline() + +//go:linkname libc_adjtime libc_adjtime +//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { @@ -584,13 +849,18 @@ func Chdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chdir_trampoline() + +//go:linkname libc_chdir libc_chdir +//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { @@ -599,13 +869,18 @@ func Chflags(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chflags_trampoline() + +//go:linkname libc_chflags libc_chflags +//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { @@ -614,13 +889,18 @@ func Chmod(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chmod_trampoline() + +//go:linkname libc_chmod libc_chmod +//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { @@ -629,13 +909,18 @@ func Chown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chown_trampoline() + +//go:linkname libc_chown libc_chown +//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { @@ -644,27 +929,37 @@ func Chroot(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chroot_trampoline() + +//go:linkname libc_chroot libc_chroot +//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { - _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_close_trampoline() + +//go:linkname libc_close libc_close +//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -672,16 +967,26 @@ func Dup(fd int) (nfd int, err error) { return } +func libc_dup_trampoline() + +//go:linkname libc_dup libc_dup +//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_dup2_trampoline() + +//go:linkname libc_dup2 libc_dup2 +//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exchangedata(path1 string, path2 string, options int) (err error) { @@ -695,20 +1000,30 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_exchangedata_trampoline() + +//go:linkname libc_exchangedata libc_exchangedata +//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { - Syscall(SYS_EXIT, uintptr(code), 0, 0) + syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0) return } +func libc_exit_trampoline() + +//go:linkname libc_exit libc_exit +//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -717,43 +1032,63 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_faccessat_trampoline() + +//go:linkname libc_faccessat libc_faccessat +//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { - _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchdir_trampoline() + +//go:linkname libc_fchdir libc_fchdir +//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { - _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchflags_trampoline() + +//go:linkname libc_fchflags libc_fchflags +//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { - _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmod_trampoline() + +//go:linkname libc_fchmod libc_fchmod +//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -762,23 +1097,33 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmodat_trampoline() + +//go:linkname libc_fchmodat libc_fchmodat +//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib" + // 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)) + _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchown_trampoline() + +//go:linkname libc_fchown libc_fchown +//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { @@ -787,142 +1132,135 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fchownat_trampoline() -func Flock(fd int, how int) (err error) { - _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fchownat libc_fchownat +//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fpathconf(fd int, name int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) - val = int(r0) +func Flock(fd int, how int) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_flock_trampoline() -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_flock libc_flock +//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0) + val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fpathconf_trampoline() -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fpathconf libc_fpathconf +//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { - _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsync_trampoline() + +//go:linkname libc_fsync libc_fsync +//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { - _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_ftruncate_trampoline() -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_ftruncate libc_ftruncate +//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { - r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) return } +func libc_getdtablesize_trampoline() + +//go:linkname libc_getdtablesize libc_getdtablesize +//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0) egid = int(r0) return } +func libc_getegid_trampoline() + +//go:linkname libc_getegid libc_getegid +//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_geteuid_trampoline() + +//go:linkname libc_geteuid libc_geteuid +//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0) gid = int(r0) return } +func libc_getgid_trampoline() + +//go:linkname libc_getgid libc_getgid +//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -930,34 +1268,54 @@ func Getpgid(pid int) (pgid int, err error) { return } +func libc_getpgid_trampoline() + +//go:linkname libc_getpgid libc_getpgid +//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0) pgrp = int(r0) return } +func libc_getpgrp_trampoline() + +//go:linkname libc_getpgrp libc_getpgrp +//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0) pid = int(r0) return } +func libc_getpid_trampoline() + +//go:linkname libc_getpid libc_getpid +//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0) ppid = int(r0) return } +func libc_getppid_trampoline() + +//go:linkname libc_getppid libc_getppid +//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { - r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -965,30 +1323,45 @@ func Getpriority(which int, who int) (prio int, err error) { return } +func libc_getpriority_trampoline() + +//go:linkname libc_getpriority libc_getpriority +//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrlimit_trampoline() + +//go:linkname libc_getrlimit libc_getrlimit +//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { - _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrusage_trampoline() + +//go:linkname libc_getrusage libc_getrusage +//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -996,26 +1369,41 @@ func Getsid(pid int) (sid int, err error) { return } +func libc_getsid_trampoline() + +//go:linkname libc_getsid libc_getsid +//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_getuid_trampoline() + +//go:linkname libc_getuid libc_getuid +//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { - r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0) tainted = bool(r0 != 0) return } +func libc_issetugid_trampoline() + +//go:linkname libc_issetugid libc_issetugid +//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { - r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1023,6 +1411,11 @@ func Kqueue() (fd int, err error) { return } +func libc_kqueue_trampoline() + +//go:linkname libc_kqueue libc_kqueue +//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { @@ -1031,13 +1424,18 @@ func Lchown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_lchown_trampoline() + +//go:linkname libc_lchown libc_lchown +//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { @@ -1051,13 +1449,18 @@ func Link(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_link_trampoline() + +//go:linkname libc_link libc_link +//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { @@ -1071,37 +1474,32 @@ func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err er if err != nil { return } - _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_linkat_trampoline() + +//go:linkname libc_linkat libc_linkat +//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { - _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_listen_trampoline() -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_listen libc_listen +//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1111,13 +1509,18 @@ func Mkdir(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdir_trampoline() + +//go:linkname libc_mkdir libc_mkdir +//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { @@ -1126,13 +1529,18 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdirat_trampoline() + +//go:linkname libc_mkdirat libc_mkdirat +//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { @@ -1141,13 +1549,18 @@ func Mkfifo(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkfifo_trampoline() + +//go:linkname libc_mkfifo libc_mkfifo +//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { @@ -1156,13 +1569,18 @@ func Mknod(path string, mode uint32, dev int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mknod_trampoline() + +//go:linkname libc_mknod libc_mknod +//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { @@ -1171,7 +1589,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1179,6 +1597,11 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } +func libc_open_trampoline() + +//go:linkname libc_open libc_open +//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { @@ -1187,7 +1610,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1195,6 +1618,11 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { return } +func libc_openat_trampoline() + +//go:linkname libc_openat libc_openat +//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { @@ -1203,7 +1631,7 @@ func Pathconf(path string, name int) (val int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1211,6 +1639,11 @@ func Pathconf(path string, name int) (val int, err error) { return } +func libc_pathconf_trampoline() + +//go:linkname libc_pathconf libc_pathconf +//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { @@ -1220,7 +1653,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1228,6 +1661,11 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pread_trampoline() + +//go:linkname libc_pread libc_pread +//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { @@ -1237,7 +1675,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1245,6 +1683,11 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pwrite_trampoline() + +//go:linkname libc_pwrite libc_pwrite +//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { @@ -1254,7 +1697,7 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1262,6 +1705,11 @@ func read(fd int, p []byte) (n int, err error) { return } +func libc_read_trampoline() + +//go:linkname libc_read libc_read +//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { @@ -1276,7 +1724,7 @@ func Readlink(path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1284,6 +1732,11 @@ func Readlink(path string, buf []byte) (n int, err error) { return } +func libc_readlink_trampoline() + +//go:linkname libc_readlink libc_readlink +//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { @@ -1298,7 +1751,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1306,6 +1759,11 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { return } +func libc_readlinkat_trampoline() + +//go:linkname libc_readlinkat libc_readlinkat +//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { @@ -1319,13 +1777,18 @@ func Rename(from string, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rename_trampoline() + +//go:linkname libc_rename libc_rename +//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { @@ -1339,13 +1802,18 @@ func Renameat(fromfd int, from string, tofd int, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_renameat_trampoline() + +//go:linkname libc_renameat libc_renameat +//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { @@ -1354,13 +1822,18 @@ func Revoke(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_revoke_trampoline() + +//go:linkname libc_revoke libc_revoke +//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { @@ -1369,17 +1842,22 @@ func Rmdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rmdir_trampoline() + +//go:linkname libc_rmdir libc_rmdir +//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + r0, _, e1 := syscall_syscall(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) @@ -1387,46 +1865,71 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { return } +func libc_lseek_trampoline() + +//go:linkname libc_lseek libc_lseek +//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { - _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_select_trampoline() + +//go:linkname libc_select libc_select +//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { - _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setegid_trampoline() + +//go:linkname libc_setegid libc_setegid +//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_seteuid_trampoline() + +//go:linkname libc_seteuid libc_seteuid +//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgid_trampoline() + +//go:linkname libc_setgid libc_setgid +//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { @@ -1435,77 +1938,112 @@ func Setlogin(name string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setlogin_trampoline() + +//go:linkname libc_setlogin libc_setlogin +//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpgid_trampoline() + +//go:linkname libc_setpgid libc_setpgid +//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpriority_trampoline() + +//go:linkname libc_setpriority libc_setpriority +//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setprivexec(flag int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setprivexec_trampoline() + +//go:linkname libc_setprivexec libc_setprivexec +//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setregid_trampoline() + +//go:linkname libc_setregid libc_setregid +//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setreuid_trampoline() + +//go:linkname libc_setreuid libc_setreuid +//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setrlimit_trampoline() + +//go:linkname libc_setrlimit libc_setrlimit +//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { - r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1513,55 +2051,40 @@ func Setsid() (pid int, err error) { return } +func libc_setsid_trampoline() + +//go:linkname libc_setsid libc_setsid +//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { - _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_settimeofday_trampoline() -func Setuid(uid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_settimeofday libc_settimeofday +//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) +func Setuid(uid int) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_setuid_trampoline() -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_setuid libc_setuid +//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1576,13 +2099,18 @@ func Symlink(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlink_trampoline() + +//go:linkname libc_symlink libc_symlink +//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { @@ -1596,23 +2124,33 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlinkat_trampoline() + +//go:linkname libc_symlinkat libc_symlinkat +//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { - _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sync_trampoline() + +//go:linkname libc_sync libc_sync +//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { @@ -1621,21 +2159,31 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_truncate_trampoline() + +//go:linkname libc_truncate libc_truncate +//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0) oldmask = int(r0) return } +func libc_umask_trampoline() + +//go:linkname libc_umask libc_umask +//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { @@ -1644,13 +2192,18 @@ func Undelete(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_undelete_trampoline() + +//go:linkname libc_undelete libc_undelete +//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { @@ -1659,13 +2212,18 @@ func Unlink(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlink_trampoline() + +//go:linkname libc_unlink libc_unlink +//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { @@ -1674,13 +2232,18 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlinkat_trampoline() + +//go:linkname libc_unlinkat libc_unlinkat +//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { @@ -1689,13 +2252,18 @@ func Unmount(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unmount_trampoline() + +//go:linkname libc_unmount libc_unmount +//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { @@ -1705,7 +2273,7 @@ func write(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1713,10 +2281,15 @@ func write(fd int, p []byte) (n int, err error) { return } +func libc_write_trampoline() + +//go:linkname libc_write libc_write +//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + r0, _, e1 := syscall_syscall6(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) @@ -1724,20 +2297,30 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( return } +func libc_mmap_trampoline() + +//go:linkname libc_mmap libc_mmap +//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { - _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munmap_trampoline() + +//go:linkname libc_munmap libc_munmap +//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1748,7 +2331,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1759,7 +2342,7 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) sec = int64(r0) usec = int32(r1) if e1 != 0 { @@ -1767,3 +2350,156 @@ func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { } return } + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstat64_trampoline() + +//go:linkname libc_fstat64 libc_fstat64 +//go:cgo_import_dynamic libc_fstat64 fstat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(funcPC(libc_fstatat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat64_trampoline() + +//go:linkname libc_fstatat64 libc_fstatat64 +//go:cgo_import_dynamic libc_fstatat64 fstatat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstatfs64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatfs64_trampoline() + +//go:linkname libc_fstatfs64 libc_fstatfs64 +//go:cgo_import_dynamic libc_fstatfs64 fstatfs64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(funcPC(libc___getdirentries64_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc___getdirentries64_trampoline() + +//go:linkname libc___getdirentries64 libc___getdirentries64 +//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat64_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_getfsstat64_trampoline() + +//go:linkname libc_getfsstat64 libc_getfsstat64 +//go:cgo_import_dynamic libc_getfsstat64 getfsstat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_lstat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat64_trampoline() + +//go:linkname libc_lstat64 libc_lstat64 +//go:cgo_import_dynamic libc_lstat64 lstat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_stat64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat64_trampoline() + +//go:linkname libc_stat64 libc_stat64 +//go:cgo_import_dynamic libc_stat64 stat64 "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_statfs64_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs64_trampoline() + +//go:linkname libc_statfs64 libc_statfs64 +//go:cgo_import_dynamic libc_statfs64 statfs64 "/usr/lib/libSystem.B.dylib" diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s new file mode 100644 index 0000000000000..da9b900a8c61c --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -0,0 +1,284 @@ +// go run mkasm_darwin.go amd64 +// Code generated by the command above; DO NOT EDIT. + +// +build go1.12 + +#include "textflag.h" +TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgroups(SB) +TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgroups(SB) +TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0 + JMP libc_wait4(SB) +TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0 + JMP libc_accept(SB) +TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0 + JMP libc_bind(SB) +TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_connect(SB) +TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socket(SB) +TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockopt(SB) +TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsockopt(SB) +TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpeername(SB) +TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockname(SB) +TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_shutdown(SB) +TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socketpair(SB) +TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvfrom(SB) +TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendto(SB) +TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvmsg(SB) +TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendmsg(SB) +TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kevent(SB) +TEXT ·libc___sysctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc___sysctl(SB) +TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_utimes(SB) +TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 + JMP libc_poll(SB) +TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 + JMP libc_madvise(SB) +TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlock(SB) +TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlockall(SB) +TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mprotect(SB) +TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_msync(SB) +TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlock(SB) +TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlockall(SB) +TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ptrace(SB) +TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getattrlist(SB) +TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pipe(SB) +TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getxattr(SB) +TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fgetxattr(SB) +TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setxattr(SB) +TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsetxattr(SB) +TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_removexattr(SB) +TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fremovexattr(SB) +TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listxattr(SB) +TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flistxattr(SB) +TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setattrlist(SB) +TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kill(SB) +TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ioctl(SB) +TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendfile(SB) +TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0 + JMP libc_access(SB) +TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0 + JMP libc_adjtime(SB) +TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chdir(SB) +TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chflags(SB) +TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chmod(SB) +TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chown(SB) +TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chroot(SB) +TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 + JMP libc_close(SB) +TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup(SB) +TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup2(SB) +TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exchangedata(SB) +TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exit(SB) +TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_faccessat(SB) +TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchdir(SB) +TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchflags(SB) +TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmod(SB) +TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmodat(SB) +TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchown(SB) +TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchownat(SB) +TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flock(SB) +TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fpathconf(SB) +TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsync(SB) +TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ftruncate(SB) +TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getdtablesize(SB) +TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getegid(SB) +TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_geteuid(SB) +TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgid(SB) +TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgid(SB) +TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgrp(SB) +TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpid(SB) +TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getppid(SB) +TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpriority(SB) +TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrlimit(SB) +TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrusage(SB) +TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsid(SB) +TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getuid(SB) +TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_issetugid(SB) +TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kqueue(SB) +TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lchown(SB) +TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 + JMP libc_link(SB) +TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_linkat(SB) +TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listen(SB) +TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdir(SB) +TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdirat(SB) +TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkfifo(SB) +TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mknod(SB) +TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0 + JMP libc_open(SB) +TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_openat(SB) +TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pathconf(SB) +TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pread(SB) +TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pwrite(SB) +TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0 + JMP libc_read(SB) +TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlink(SB) +TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlinkat(SB) +TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rename(SB) +TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_renameat(SB) +TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0 + JMP libc_revoke(SB) +TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rmdir(SB) +TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lseek(SB) +TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0 + JMP libc_select(SB) +TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setegid(SB) +TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_seteuid(SB) +TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgid(SB) +TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setlogin(SB) +TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpgid(SB) +TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpriority(SB) +TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setprivexec(SB) +TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setregid(SB) +TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setreuid(SB) +TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setrlimit(SB) +TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsid(SB) +TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_settimeofday(SB) +TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setuid(SB) +TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlink(SB) +TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlinkat(SB) +TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sync(SB) +TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_truncate(SB) +TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0 + JMP libc_umask(SB) +TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0 + JMP libc_undelete(SB) +TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlink(SB) +TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlinkat(SB) +TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unmount(SB) +TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0 + JMP libc_write(SB) +TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mmap(SB) +TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munmap(SB) +TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_gettimeofday(SB) +TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat64(SB) +TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat64(SB) +TEXT ·libc_fstatfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs64(SB) +TEXT ·libc___getdirentries64_trampoline(SB),NOSPLIT,$0-0 + JMP libc___getdirentries64(SB) +TEXT ·libc_getfsstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getfsstat64(SB) +TEXT ·libc_lstat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat64(SB) +TEXT ·libc_stat64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat64(SB) +TEXT ·libc_statfs64_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs64(SB) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go new file mode 100644 index 0000000000000..f8caecef02e29 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go @@ -0,0 +1,1793 @@ +// go run mksyscall.go -l32 -tags darwin,arm,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build darwin,arm,!go1.12 + +package unix + +import ( + "syscall" + "unsafe" +) + +var _ syscall.Errno + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(ngid int, gid *_Gid_t) (n int, err error) { + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 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 setgroups(ngid int, gid *_Gid_t) (err error) { + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { + r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + wpid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(s int, how int) (err error) { + _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { + r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, timeval *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func futimes(fd int, timeval *[2]Timeval) (err error) { + _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, behav int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_GETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe() (r int, w int, err error) { + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r = int(r0) + w = int(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func removexattr(path string, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_SETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kill(pid int, signum int, posix int) (err error) { + _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Access(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { + _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chflags(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chmod(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(fd int) (nfd int, err error) { + r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + nfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(from int, to int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exchangedata(path1 string, path2 string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path1) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(path2) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + Syscall(SYS_EXIT, uintptr(code), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchflags(fd int, flags int) (err error) { + _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + 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 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flock(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdtablesize() (size int) { + r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + size = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgrp() (pgrp int) { + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + pgrp = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Issetugid() (tainted bool) { + r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + tainted = bool(r0 != 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kqueue() (fd int, err error) { + r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Link(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, backlog int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pathconf(path string, name int) (val int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 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 Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 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 read(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Revoke(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Rmdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) + newoffset = int64(int64(r1)<<32 | int64(r0)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { + _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setegid(egid int) (err error) { + _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seteuid(euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(gid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setlogin(name string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setprivexec(flag int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlink(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() (err error) { + _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(newmask int) (oldmask int) { + r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Undelete(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unmount(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { + r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) + ret = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { + r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + sec = int32(r0) + usec = int32(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go index 37e3c692504df..01cffbf46ccf9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go @@ -1,7 +1,7 @@ -// go run mksyscall.go -l32 -tags darwin,arm syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go +// go run mksyscall.go -l32 -tags darwin,arm,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go // Code generated by the command above; see README.md. DO NOT EDIT. -// +build darwin,arm +// +build darwin,arm,go1.12 package unix @@ -15,7 +15,7 @@ var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { - r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -23,20 +23,30 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { return } +func libc_getgroups_trampoline() + +//go:linkname libc_getgroups libc_getgroups +//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { - _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgroups_trampoline() + +//go:linkname libc_setgroups libc_setgroups +//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { - r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -44,10 +54,15 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err return } +func libc_wait4_trampoline() + +//go:linkname libc_wait4 libc_wait4 +//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { - r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -55,30 +70,45 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { return } +func libc_accept_trampoline() + +//go:linkname libc_accept libc_accept +//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_bind_trampoline() + +//go:linkname libc_bind libc_bind +//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_connect_trampoline() + +//go:linkname libc_connect libc_connect +//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -86,66 +116,101 @@ func socket(domain int, typ int, proto int) (fd int, err error) { return } +func libc_socket_trampoline() + +//go:linkname libc_socket libc_socket +//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { - _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockopt_trampoline() + +//go:linkname libc_getsockopt libc_getsockopt +//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { - _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setsockopt_trampoline() + +//go:linkname libc_setsockopt libc_setsockopt +//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getpeername_trampoline() + +//go:linkname libc_getpeername libc_getpeername +//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockname_trampoline() + +//go:linkname libc_getsockname libc_getsockname +//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { - _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_shutdown_trampoline() + +//go:linkname libc_shutdown libc_shutdown +//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { - _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_socketpair_trampoline() + +//go:linkname libc_socketpair libc_socketpair +//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { @@ -155,7 +220,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -163,6 +228,11 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl return } +func libc_recvfrom_trampoline() + +//go:linkname libc_recvfrom libc_recvfrom +//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { @@ -172,17 +242,22 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sendto_trampoline() + +//go:linkname libc_sendto libc_sendto +//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -190,10 +265,15 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_recvmsg_trampoline() + +//go:linkname libc_recvmsg libc_recvmsg +//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -201,10 +281,15 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_sendmsg_trampoline() + +//go:linkname libc_sendmsg libc_sendmsg +//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { - r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -212,6 +297,11 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne return } +func libc_kevent_trampoline() + +//go:linkname libc_kevent libc_kevent +//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { @@ -221,13 +311,18 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + _, _, e1 := syscall_syscall6(funcPC(libc___sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc___sysctl_trampoline() + +//go:linkname libc___sysctl libc___sysctl +//go:cgo_import_dynamic libc___sysctl __sysctl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { @@ -236,27 +331,37 @@ func utimes(path string, timeval *[2]Timeval) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_utimes_trampoline() + +//go:linkname libc_utimes libc_utimes +//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { - _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_futimes_trampoline() + +//go:linkname libc_futimes libc_futimes +//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -264,10 +369,15 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { return } +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { - r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -275,6 +385,11 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { return } +func libc_poll_trampoline() + +//go:linkname libc_poll libc_poll +//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { @@ -284,13 +399,18 @@ func Madvise(b []byte, behav int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_madvise_trampoline() + +//go:linkname libc_madvise libc_madvise +//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { @@ -300,23 +420,33 @@ func Mlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlock_trampoline() + +//go:linkname libc_mlock libc_mlock +//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { - _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlockall_trampoline() + +//go:linkname libc_mlockall libc_mlockall +//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { @@ -326,13 +456,18 @@ func Mprotect(b []byte, prot int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mprotect_trampoline() + +//go:linkname libc_mprotect libc_mprotect +//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { @@ -342,13 +477,18 @@ func Msync(b []byte, flags int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_msync_trampoline() + +//go:linkname libc_msync libc_msync +//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { @@ -358,37 +498,67 @@ func Munlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlock_trampoline() + +//go:linkname libc_munlock libc_munlock +//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { - _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlockall_trampoline() + +//go:linkname libc_munlockall libc_munlockall +//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { - _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_ptrace_trampoline() + +//go:linkname libc_ptrace libc_ptrace +//go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_getattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getattrlist_trampoline() + +//go:linkname libc_getattrlist libc_getattrlist +//go:cgo_import_dynamic libc_getattrlist getattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) r = int(r0) w = int(r1) if e1 != 0 { @@ -397,6 +567,11 @@ func pipe() (r int, w int, err error) { return } +func libc_pipe_trampoline() + +//go:linkname libc_pipe libc_pipe +//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -410,7 +585,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o if err != nil { return } - r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -418,6 +593,11 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o return } +func libc_getxattr_trampoline() + +//go:linkname libc_getxattr libc_getxattr +//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -426,7 +606,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio if err != nil { return } - r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -434,6 +614,11 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio return } +func libc_fgetxattr_trampoline() + +//go:linkname libc_fgetxattr libc_fgetxattr +//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -447,13 +632,18 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o if err != nil { return } - _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setxattr_trampoline() + +//go:linkname libc_setxattr libc_setxattr +//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -462,13 +652,18 @@ func fsetxattr(fd int, attr string, data *byte, size int, position uint32, optio if err != nil { return } - _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsetxattr_trampoline() + +//go:linkname libc_fsetxattr libc_fsetxattr +//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func removexattr(path string, attr string, options int) (err error) { @@ -482,13 +677,18 @@ func removexattr(path string, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_removexattr_trampoline() + +//go:linkname libc_removexattr libc_removexattr +//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fremovexattr(fd int, attr string, options int) (err error) { @@ -497,13 +697,18 @@ func fremovexattr(fd int, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fremovexattr_trampoline() + +//go:linkname libc_fremovexattr libc_fremovexattr +//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { @@ -512,7 +717,7 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro if err != nil { return } - r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -520,10 +725,15 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro return } +func libc_listxattr_trampoline() + +//go:linkname libc_listxattr libc_listxattr +//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { - r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -531,26 +741,71 @@ func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { return } +func libc_flistxattr_trampoline() + +//go:linkname libc_flistxattr libc_flistxattr +//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_setattrlist_trampoline() + +//go:linkname libc_setattrlist libc_setattrlist +//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kill(pid int, signum int, posix int) (err error) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_kill_trampoline() + +//go:linkname libc_kill libc_kill +//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_ioctl_trampoline() + +//go:linkname libc_ioctl libc_ioctl +//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := syscall_syscall9(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sendfile_trampoline() + +//go:linkname libc_sendfile libc_sendfile +//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { @@ -559,23 +814,33 @@ func Access(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_access_trampoline() + +//go:linkname libc_access libc_access +//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { - _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_adjtime_trampoline() + +//go:linkname libc_adjtime libc_adjtime +//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { @@ -584,13 +849,18 @@ func Chdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chdir_trampoline() + +//go:linkname libc_chdir libc_chdir +//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { @@ -599,13 +869,18 @@ func Chflags(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chflags_trampoline() + +//go:linkname libc_chflags libc_chflags +//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { @@ -614,13 +889,18 @@ func Chmod(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chmod_trampoline() + +//go:linkname libc_chmod libc_chmod +//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { @@ -629,13 +909,18 @@ func Chown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chown_trampoline() + +//go:linkname libc_chown libc_chown +//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { @@ -644,27 +929,37 @@ func Chroot(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chroot_trampoline() + +//go:linkname libc_chroot libc_chroot +//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { - _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_close_trampoline() + +//go:linkname libc_close libc_close +//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -672,16 +967,26 @@ func Dup(fd int) (nfd int, err error) { return } +func libc_dup_trampoline() + +//go:linkname libc_dup libc_dup +//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_dup2_trampoline() + +//go:linkname libc_dup2 libc_dup2 +//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exchangedata(path1 string, path2 string, options int) (err error) { @@ -695,20 +1000,30 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_exchangedata_trampoline() + +//go:linkname libc_exchangedata libc_exchangedata +//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { - Syscall(SYS_EXIT, uintptr(code), 0, 0) + syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0) return } +func libc_exit_trampoline() + +//go:linkname libc_exit libc_exit +//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -717,43 +1032,63 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_faccessat_trampoline() + +//go:linkname libc_faccessat libc_faccessat +//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { - _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchdir_trampoline() + +//go:linkname libc_fchdir libc_fchdir +//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { - _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchflags_trampoline() + +//go:linkname libc_fchflags libc_fchflags +//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { - _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmod_trampoline() + +//go:linkname libc_fchmod libc_fchmod +//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -762,23 +1097,33 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmodat_trampoline() + +//go:linkname libc_fchmodat libc_fchmodat +//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib" + // 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)) + _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchown_trampoline() + +//go:linkname libc_fchown libc_fchown +//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { @@ -787,142 +1132,135 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fchownat_trampoline() -func Flock(fd int, how int) (err error) { - _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fchownat libc_fchownat +//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fpathconf(fd int, name int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) - val = int(r0) +func Flock(fd int, how int) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_flock_trampoline() -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_flock libc_flock +//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0) + val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fpathconf_trampoline() -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fpathconf libc_fpathconf +//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { - _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsync_trampoline() + +//go:linkname libc_fsync libc_fsync +//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { - _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) + _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_ftruncate_trampoline() -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_ftruncate libc_ftruncate +//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { - r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) return } +func libc_getdtablesize_trampoline() + +//go:linkname libc_getdtablesize libc_getdtablesize +//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0) egid = int(r0) return } +func libc_getegid_trampoline() + +//go:linkname libc_getegid libc_getegid +//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_geteuid_trampoline() + +//go:linkname libc_geteuid libc_geteuid +//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0) gid = int(r0) return } +func libc_getgid_trampoline() + +//go:linkname libc_getgid libc_getgid +//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -930,34 +1268,54 @@ func Getpgid(pid int) (pgid int, err error) { return } +func libc_getpgid_trampoline() + +//go:linkname libc_getpgid libc_getpgid +//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0) pgrp = int(r0) return } +func libc_getpgrp_trampoline() + +//go:linkname libc_getpgrp libc_getpgrp +//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0) pid = int(r0) return } +func libc_getpid_trampoline() + +//go:linkname libc_getpid libc_getpid +//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0) ppid = int(r0) return } +func libc_getppid_trampoline() + +//go:linkname libc_getppid libc_getppid +//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { - r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -965,30 +1323,45 @@ func Getpriority(which int, who int) (prio int, err error) { return } +func libc_getpriority_trampoline() + +//go:linkname libc_getpriority libc_getpriority +//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrlimit_trampoline() + +//go:linkname libc_getrlimit libc_getrlimit +//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { - _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrusage_trampoline() + +//go:linkname libc_getrusage libc_getrusage +//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -996,26 +1369,41 @@ func Getsid(pid int) (sid int, err error) { return } +func libc_getsid_trampoline() + +//go:linkname libc_getsid libc_getsid +//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_getuid_trampoline() + +//go:linkname libc_getuid libc_getuid +//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { - r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0) tainted = bool(r0 != 0) return } +func libc_issetugid_trampoline() + +//go:linkname libc_issetugid libc_issetugid +//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { - r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1023,6 +1411,11 @@ func Kqueue() (fd int, err error) { return } +func libc_kqueue_trampoline() + +//go:linkname libc_kqueue libc_kqueue +//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { @@ -1031,13 +1424,18 @@ func Lchown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_lchown_trampoline() + +//go:linkname libc_lchown libc_lchown +//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { @@ -1051,13 +1449,18 @@ func Link(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_link_trampoline() + +//go:linkname libc_link libc_link +//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { @@ -1071,37 +1474,32 @@ func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err er if err != nil { return } - _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_linkat_trampoline() + +//go:linkname libc_linkat libc_linkat +//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { - _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_listen_trampoline() -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_listen libc_listen +//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1111,13 +1509,18 @@ func Mkdir(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdir_trampoline() + +//go:linkname libc_mkdir libc_mkdir +//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { @@ -1126,13 +1529,18 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdirat_trampoline() + +//go:linkname libc_mkdirat libc_mkdirat +//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { @@ -1141,13 +1549,18 @@ func Mkfifo(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkfifo_trampoline() + +//go:linkname libc_mkfifo libc_mkfifo +//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { @@ -1156,13 +1569,18 @@ func Mknod(path string, mode uint32, dev int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mknod_trampoline() + +//go:linkname libc_mknod libc_mknod +//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { @@ -1171,7 +1589,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1179,6 +1597,11 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } +func libc_open_trampoline() + +//go:linkname libc_open libc_open +//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { @@ -1187,7 +1610,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1195,6 +1618,11 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { return } +func libc_openat_trampoline() + +//go:linkname libc_openat libc_openat +//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { @@ -1203,7 +1631,7 @@ func Pathconf(path string, name int) (val int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1211,6 +1639,11 @@ func Pathconf(path string, name int) (val int, err error) { return } +func libc_pathconf_trampoline() + +//go:linkname libc_pathconf libc_pathconf +//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { @@ -1220,7 +1653,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1228,6 +1661,11 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pread_trampoline() + +//go:linkname libc_pread libc_pread +//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { @@ -1237,7 +1675,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1245,6 +1683,11 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pwrite_trampoline() + +//go:linkname libc_pwrite libc_pwrite +//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { @@ -1254,7 +1697,7 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1262,6 +1705,11 @@ func read(fd int, p []byte) (n int, err error) { return } +func libc_read_trampoline() + +//go:linkname libc_read libc_read +//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { @@ -1276,7 +1724,7 @@ func Readlink(path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1284,6 +1732,11 @@ func Readlink(path string, buf []byte) (n int, err error) { return } +func libc_readlink_trampoline() + +//go:linkname libc_readlink libc_readlink +//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { @@ -1298,7 +1751,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1306,6 +1759,11 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { return } +func libc_readlinkat_trampoline() + +//go:linkname libc_readlinkat libc_readlinkat +//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { @@ -1319,13 +1777,18 @@ func Rename(from string, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rename_trampoline() + +//go:linkname libc_rename libc_rename +//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { @@ -1339,13 +1802,18 @@ func Renameat(fromfd int, from string, tofd int, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_renameat_trampoline() + +//go:linkname libc_renameat libc_renameat +//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { @@ -1354,13 +1822,18 @@ func Revoke(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_revoke_trampoline() + +//go:linkname libc_revoke libc_revoke +//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { @@ -1369,17 +1842,22 @@ func Rmdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rmdir_trampoline() + +//go:linkname libc_rmdir libc_rmdir +//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) + r0, r1, e1 := syscall_syscall6(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) @@ -1387,46 +1865,71 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { return } +func libc_lseek_trampoline() + +//go:linkname libc_lseek libc_lseek +//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { - _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_select_trampoline() + +//go:linkname libc_select libc_select +//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { - _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setegid_trampoline() + +//go:linkname libc_setegid libc_setegid +//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_seteuid_trampoline() + +//go:linkname libc_seteuid libc_seteuid +//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgid_trampoline() + +//go:linkname libc_setgid libc_setgid +//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { @@ -1435,77 +1938,112 @@ func Setlogin(name string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setlogin_trampoline() + +//go:linkname libc_setlogin libc_setlogin +//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpgid_trampoline() + +//go:linkname libc_setpgid libc_setpgid +//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpriority_trampoline() + +//go:linkname libc_setpriority libc_setpriority +//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setprivexec(flag int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setprivexec_trampoline() + +//go:linkname libc_setprivexec libc_setprivexec +//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setregid_trampoline() + +//go:linkname libc_setregid libc_setregid +//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setreuid_trampoline() + +//go:linkname libc_setreuid libc_setreuid +//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setrlimit_trampoline() + +//go:linkname libc_setrlimit libc_setrlimit +//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { - r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1513,55 +2051,40 @@ func Setsid() (pid int, err error) { return } +func libc_setsid_trampoline() + +//go:linkname libc_setsid libc_setsid +//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { - _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_settimeofday_trampoline() -func Setuid(uid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_settimeofday libc_settimeofday +//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) +func Setuid(uid int) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_setuid_trampoline() -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_setuid libc_setuid +//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1576,13 +2099,18 @@ func Symlink(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlink_trampoline() + +//go:linkname libc_symlink libc_symlink +//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { @@ -1596,23 +2124,33 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlinkat_trampoline() + +//go:linkname libc_symlinkat libc_symlinkat +//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { - _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sync_trampoline() + +//go:linkname libc_sync libc_sync +//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { @@ -1621,21 +2159,31 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) + _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_truncate_trampoline() + +//go:linkname libc_truncate libc_truncate +//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0) oldmask = int(r0) return } +func libc_umask_trampoline() + +//go:linkname libc_umask libc_umask +//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { @@ -1644,13 +2192,18 @@ func Undelete(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_undelete_trampoline() + +//go:linkname libc_undelete libc_undelete +//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { @@ -1659,13 +2212,18 @@ func Unlink(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlink_trampoline() + +//go:linkname libc_unlink libc_unlink +//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { @@ -1674,13 +2232,18 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlinkat_trampoline() + +//go:linkname libc_unlinkat libc_unlinkat +//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { @@ -1689,13 +2252,18 @@ func Unmount(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unmount_trampoline() + +//go:linkname libc_unmount libc_unmount +//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { @@ -1705,7 +2273,7 @@ func write(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1713,10 +2281,15 @@ func write(fd int, p []byte) (n int, err error) { return } +func libc_write_trampoline() + +//go:linkname libc_write libc_write +//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) + r0, _, e1 := syscall_syscall9(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) @@ -1724,20 +2297,30 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( return } +func libc_mmap_trampoline() + +//go:linkname libc_mmap libc_mmap +//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { - _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munmap_trampoline() + +//go:linkname libc_munmap libc_munmap +//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1748,7 +2331,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1759,7 +2342,7 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) sec = int32(r0) usec = int32(r1) if e1 != 0 { @@ -1767,3 +2350,134 @@ func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) { } return } + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstat_trampoline() + +//go:linkname libc_fstat libc_fstat +//go:cgo_import_dynamic libc_fstat fstat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(funcPC(libc_fstatat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat_trampoline() + +//go:linkname libc_fstatat libc_fstatat +//go:cgo_import_dynamic libc_fstatat fstatat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstatfs_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatfs_trampoline() + +//go:linkname libc_fstatfs libc_fstatfs +//go:cgo_import_dynamic libc_fstatfs fstatfs "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_getfsstat_trampoline() + +//go:linkname libc_getfsstat libc_getfsstat +//go:cgo_import_dynamic libc_getfsstat getfsstat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_lstat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat_trampoline() + +//go:linkname libc_lstat libc_lstat +//go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_stat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat_trampoline() + +//go:linkname libc_stat libc_stat +//go:cgo_import_dynamic libc_stat stat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_statfs_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs_trampoline() + +//go:linkname libc_statfs libc_statfs +//go:cgo_import_dynamic libc_statfs statfs "/usr/lib/libSystem.B.dylib" diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s new file mode 100644 index 0000000000000..994056f35969c --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s @@ -0,0 +1,282 @@ +// go run mkasm_darwin.go arm +// Code generated by the command above; DO NOT EDIT. + +// +build go1.12 + +#include "textflag.h" +TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgroups(SB) +TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgroups(SB) +TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0 + JMP libc_wait4(SB) +TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0 + JMP libc_accept(SB) +TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0 + JMP libc_bind(SB) +TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_connect(SB) +TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socket(SB) +TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockopt(SB) +TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsockopt(SB) +TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpeername(SB) +TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockname(SB) +TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_shutdown(SB) +TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socketpair(SB) +TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvfrom(SB) +TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendto(SB) +TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvmsg(SB) +TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendmsg(SB) +TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kevent(SB) +TEXT ·libc___sysctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc___sysctl(SB) +TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_utimes(SB) +TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 + JMP libc_poll(SB) +TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 + JMP libc_madvise(SB) +TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlock(SB) +TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlockall(SB) +TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mprotect(SB) +TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_msync(SB) +TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlock(SB) +TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlockall(SB) +TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ptrace(SB) +TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getattrlist(SB) +TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pipe(SB) +TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getxattr(SB) +TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fgetxattr(SB) +TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setxattr(SB) +TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsetxattr(SB) +TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_removexattr(SB) +TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fremovexattr(SB) +TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listxattr(SB) +TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flistxattr(SB) +TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setattrlist(SB) +TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kill(SB) +TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ioctl(SB) +TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendfile(SB) +TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0 + JMP libc_access(SB) +TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0 + JMP libc_adjtime(SB) +TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chdir(SB) +TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chflags(SB) +TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chmod(SB) +TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chown(SB) +TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chroot(SB) +TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 + JMP libc_close(SB) +TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup(SB) +TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup2(SB) +TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exchangedata(SB) +TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exit(SB) +TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_faccessat(SB) +TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchdir(SB) +TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchflags(SB) +TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmod(SB) +TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmodat(SB) +TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchown(SB) +TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchownat(SB) +TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flock(SB) +TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fpathconf(SB) +TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsync(SB) +TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ftruncate(SB) +TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getdtablesize(SB) +TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getegid(SB) +TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_geteuid(SB) +TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgid(SB) +TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgid(SB) +TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgrp(SB) +TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpid(SB) +TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getppid(SB) +TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpriority(SB) +TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrlimit(SB) +TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrusage(SB) +TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsid(SB) +TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getuid(SB) +TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_issetugid(SB) +TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kqueue(SB) +TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lchown(SB) +TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 + JMP libc_link(SB) +TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_linkat(SB) +TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listen(SB) +TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdir(SB) +TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdirat(SB) +TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkfifo(SB) +TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mknod(SB) +TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0 + JMP libc_open(SB) +TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_openat(SB) +TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pathconf(SB) +TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pread(SB) +TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pwrite(SB) +TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0 + JMP libc_read(SB) +TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlink(SB) +TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlinkat(SB) +TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rename(SB) +TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_renameat(SB) +TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0 + JMP libc_revoke(SB) +TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rmdir(SB) +TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lseek(SB) +TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0 + JMP libc_select(SB) +TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setegid(SB) +TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_seteuid(SB) +TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgid(SB) +TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setlogin(SB) +TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpgid(SB) +TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpriority(SB) +TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setprivexec(SB) +TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setregid(SB) +TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setreuid(SB) +TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setrlimit(SB) +TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsid(SB) +TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_settimeofday(SB) +TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setuid(SB) +TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlink(SB) +TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlinkat(SB) +TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sync(SB) +TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_truncate(SB) +TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0 + JMP libc_umask(SB) +TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0 + JMP libc_undelete(SB) +TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlink(SB) +TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlinkat(SB) +TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unmount(SB) +TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0 + JMP libc_write(SB) +TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mmap(SB) +TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munmap(SB) +TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_gettimeofday(SB) +TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat(SB) +TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat(SB) +TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs(SB) +TEXT ·libc_getfsstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat(SB) +TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat(SB) +TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs(SB) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go new file mode 100644 index 0000000000000..3fd0f3c854d10 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go @@ -0,0 +1,1793 @@ +// go run mksyscall.go -tags darwin,arm64,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build darwin,arm64,!go1.12 + +package unix + +import ( + "syscall" + "unsafe" +) + +var _ syscall.Errno + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getgroups(ngid int, gid *_Gid_t) (n int, err error) { + r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 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 setgroups(ngid int, gid *_Gid_t) (err error) { + _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { + r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + wpid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { + r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { + _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socket(domain int, typ int, proto int) (fd int, err error) { + r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { + _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { + _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { + _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Shutdown(s int, how int) (err error) { + _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { + _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { + r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, timeval *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func futimes(fd int, timeval *[2]Timeval) (err error) { + _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, behav int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { + _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_GETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe() (r int, w int, err error) { + r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r = int(r0) + w = int(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func removexattr(path string, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fremovexattr(fd int, attr string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attr) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { + r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + sz = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := Syscall6(SYS_SETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kill(pid int, signum int, posix int) (err error) { + _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ioctl(fd int, req uint, arg uintptr) (err error) { + _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Access(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { + _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chflags(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chmod(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(fd int) (nfd int, err error) { + r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + nfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(from int, to int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exchangedata(path1 string, path2 string, options int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path1) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(path2) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + Syscall(SYS_EXIT, uintptr(code), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchflags(fd int, flags int) (err error) { + _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + 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 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flock(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getdtablesize() (size int) { + r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + size = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgrp() (pgrp int) { + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + pgrp = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Issetugid() (tainted bool) { + r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + tainted = bool(r0 != 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kqueue() (fd int, err error) { + r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Link(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, backlog int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pathconf(path string, name int) (val int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 read(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Revoke(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Rmdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + newoffset = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { + _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setegid(egid int) (err error) { + _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seteuid(euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(gid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setlogin(name string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setprivexec(flag int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlink(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() (err error) { + _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(newmask int) (oldmask int) { + r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Undelete(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unmount(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + ret = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { + r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + sec = int64(r0) + usec = int32(r1) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 67f3b4e5e5747..8f2691deea930 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -1,7 +1,7 @@ -// go run mksyscall.go -tags darwin,arm64 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go +// go run mksyscall.go -tags darwin,arm64,go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. -// +build darwin,arm64 +// +build darwin,arm64,go1.12 package unix @@ -15,7 +15,7 @@ var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { - r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -23,20 +23,30 @@ func getgroups(ngid int, gid *_Gid_t) (n int, err error) { return } +func libc_getgroups_trampoline() + +//go:linkname libc_getgroups libc_getgroups +//go:cgo_import_dynamic libc_getgroups getgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { - _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgroups_trampoline), uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgroups_trampoline() + +//go:linkname libc_setgroups libc_setgroups +//go:cgo_import_dynamic libc_setgroups setgroups "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { - r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_wait4_trampoline), uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -44,10 +54,15 @@ func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err return } +func libc_wait4_trampoline() + +//go:linkname libc_wait4 libc_wait4 +//go:cgo_import_dynamic libc_wait4 wait4 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { - r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r0, _, e1 := syscall_syscall(funcPC(libc_accept_trampoline), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -55,30 +70,45 @@ func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { return } +func libc_accept_trampoline() + +//go:linkname libc_accept libc_accept +//go:cgo_import_dynamic libc_accept accept "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_bind_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_bind_trampoline() + +//go:linkname libc_bind libc_bind +//go:cgo_import_dynamic libc_bind bind "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { - _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) + _, _, e1 := syscall_syscall(funcPC(libc_connect_trampoline), uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_connect_trampoline() + +//go:linkname libc_connect libc_connect +//go:cgo_import_dynamic libc_connect connect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { - r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_socket_trampoline), uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -86,66 +116,101 @@ func socket(domain int, typ int, proto int) (fd int, err error) { return } +func libc_socket_trampoline() + +//go:linkname libc_socket libc_socket +//go:cgo_import_dynamic libc_socket socket "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { - _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_getsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockopt_trampoline() + +//go:linkname libc_getsockopt libc_getsockopt +//go:cgo_import_dynamic libc_getsockopt getsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { - _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_setsockopt_trampoline), uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setsockopt_trampoline() + +//go:linkname libc_setsockopt libc_setsockopt +//go:cgo_import_dynamic libc_setsockopt setsockopt "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getpeername_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getpeername_trampoline() + +//go:linkname libc_getpeername libc_getpeername +//go:cgo_import_dynamic libc_getpeername getpeername "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { - _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getsockname_trampoline), uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getsockname_trampoline() + +//go:linkname libc_getsockname libc_getsockname +//go:cgo_import_dynamic libc_getsockname getsockname "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { - _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) + _, _, e1 := syscall_syscall(funcPC(libc_shutdown_trampoline), uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_shutdown_trampoline() + +//go:linkname libc_shutdown libc_shutdown +//go:cgo_import_dynamic libc_shutdown shutdown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { - _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) + _, _, e1 := syscall_rawSyscall6(funcPC(libc_socketpair_trampoline), uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_socketpair_trampoline() + +//go:linkname libc_socketpair libc_socketpair +//go:cgo_import_dynamic libc_socketpair socketpair "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { @@ -155,7 +220,7 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + r0, _, e1 := syscall_syscall6(funcPC(libc_recvfrom_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -163,6 +228,11 @@ func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Sockl return } +func libc_recvfrom_trampoline() + +//go:linkname libc_recvfrom libc_recvfrom +//go:cgo_import_dynamic libc_recvfrom recvfrom "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { @@ -172,17 +242,22 @@ func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) ( } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + _, _, e1 := syscall_syscall6(funcPC(libc_sendto_trampoline), uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sendto_trampoline() + +//go:linkname libc_sendto libc_sendto +//go:cgo_import_dynamic libc_sendto sendto "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_recvmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -190,10 +265,15 @@ func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_recvmsg_trampoline() + +//go:linkname libc_recvmsg libc_recvmsg +//go:cgo_import_dynamic libc_recvmsg recvmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { - r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + r0, _, e1 := syscall_syscall(funcPC(libc_sendmsg_trampoline), uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -201,10 +281,15 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { return } +func libc_sendmsg_trampoline() + +//go:linkname libc_sendmsg libc_sendmsg +//go:cgo_import_dynamic libc_sendmsg sendmsg "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { - r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + r0, _, e1 := syscall_syscall6(funcPC(libc_kevent_trampoline), uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -212,6 +297,11 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne return } +func libc_kevent_trampoline() + +//go:linkname libc_kevent libc_kevent +//go:cgo_import_dynamic libc_kevent kevent "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { @@ -221,13 +311,18 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + _, _, e1 := syscall_syscall6(funcPC(libc___sysctl_trampoline), uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } +func libc___sysctl_trampoline() + +//go:linkname libc___sysctl libc___sysctl +//go:cgo_import_dynamic libc___sysctl __sysctl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { @@ -236,27 +331,37 @@ func utimes(path string, timeval *[2]Timeval) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_utimes_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_utimes_trampoline() + +//go:linkname libc_utimes libc_utimes +//go:cgo_import_dynamic libc_utimes utimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { - _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_futimes_trampoline), uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_futimes_trampoline() + +//go:linkname libc_futimes libc_futimes +//go:cgo_import_dynamic libc_futimes futimes "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -264,10 +369,15 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) { return } +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { - r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -275,6 +385,11 @@ func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { return } +func libc_poll_trampoline() + +//go:linkname libc_poll libc_poll +//go:cgo_import_dynamic libc_poll poll "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { @@ -284,13 +399,18 @@ func Madvise(b []byte, behav int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + _, _, e1 := syscall_syscall(funcPC(libc_madvise_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_madvise_trampoline() + +//go:linkname libc_madvise libc_madvise +//go:cgo_import_dynamic libc_madvise madvise "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { @@ -300,23 +420,33 @@ func Mlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlock_trampoline() + +//go:linkname libc_mlock libc_mlock +//go:cgo_import_dynamic libc_mlock mlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { - _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_mlockall_trampoline), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mlockall_trampoline() + +//go:linkname libc_mlockall libc_mlockall +//go:cgo_import_dynamic libc_mlockall mlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { @@ -326,13 +456,18 @@ func Mprotect(b []byte, prot int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + _, _, e1 := syscall_syscall(funcPC(libc_mprotect_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mprotect_trampoline() + +//go:linkname libc_mprotect libc_mprotect +//go:cgo_import_dynamic libc_mprotect mprotect "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { @@ -342,13 +477,18 @@ func Msync(b []byte, flags int) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_msync_trampoline), uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_msync_trampoline() + +//go:linkname libc_msync libc_msync +//go:cgo_import_dynamic libc_msync msync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { @@ -358,37 +498,67 @@ func Munlock(b []byte) (err error) { } else { _p0 = unsafe.Pointer(&_zero) } - _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlock_trampoline), uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlock_trampoline() + +//go:linkname libc_munlock libc_munlock +//go:cgo_import_dynamic libc_munlock munlock "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { - _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_munlockall_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munlockall_trampoline() + +//go:linkname libc_munlockall libc_munlockall +//go:cgo_import_dynamic libc_munlockall munlockall "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { - _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_ptrace_trampoline), uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_ptrace_trampoline() + +//go:linkname libc_ptrace libc_ptrace +//go:cgo_import_dynamic libc_ptrace ptrace "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_getattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getattrlist_trampoline() + +//go:linkname libc_getattrlist libc_getattrlist +//go:cgo_import_dynamic libc_getattrlist getattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, err error) { - r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_pipe_trampoline), 0, 0, 0) r = int(r0) w = int(r1) if e1 != 0 { @@ -397,6 +567,11 @@ func pipe() (r int, w int, err error) { return } +func libc_pipe_trampoline() + +//go:linkname libc_pipe libc_pipe +//go:cgo_import_dynamic libc_pipe pipe "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -410,7 +585,7 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o if err != nil { return } - r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_getxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -418,6 +593,11 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o return } +func libc_getxattr_trampoline() + +//go:linkname libc_getxattr libc_getxattr +//go:cgo_import_dynamic libc_getxattr getxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) { @@ -426,7 +606,7 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio if err != nil { return } - r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) + r0, _, e1 := syscall_syscall6(funcPC(libc_fgetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -434,6 +614,11 @@ func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, optio return } +func libc_fgetxattr_trampoline() + +//go:linkname libc_fgetxattr libc_fgetxattr +//go:cgo_import_dynamic libc_fgetxattr fgetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -447,13 +632,18 @@ func setxattr(path string, attr string, data *byte, size int, position uint32, o if err != nil { return } - _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_setxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setxattr_trampoline() + +//go:linkname libc_setxattr libc_setxattr +//go:cgo_import_dynamic libc_setxattr setxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) { @@ -462,13 +652,18 @@ func fsetxattr(fd int, attr string, data *byte, size int, position uint32, optio if err != nil { return } - _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) + _, _, e1 := syscall_syscall6(funcPC(libc_fsetxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsetxattr_trampoline() + +//go:linkname libc_fsetxattr libc_fsetxattr +//go:cgo_import_dynamic libc_fsetxattr fsetxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func removexattr(path string, attr string, options int) (err error) { @@ -482,13 +677,18 @@ func removexattr(path string, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_removexattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_removexattr_trampoline() + +//go:linkname libc_removexattr libc_removexattr +//go:cgo_import_dynamic libc_removexattr removexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fremovexattr(fd int, attr string, options int) (err error) { @@ -497,13 +697,18 @@ func fremovexattr(fd int, attr string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_fremovexattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fremovexattr_trampoline() + +//go:linkname libc_fremovexattr libc_fremovexattr +//go:cgo_import_dynamic libc_fremovexattr fremovexattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func listxattr(path string, dest *byte, size int, options int) (sz int, err error) { @@ -512,7 +717,7 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro if err != nil { return } - r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_listxattr_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -520,10 +725,15 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro return } +func libc_listxattr_trampoline() + +//go:linkname libc_listxattr libc_listxattr +//go:cgo_import_dynamic libc_listxattr listxattr "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { - r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_flistxattr_trampoline), uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -531,26 +741,71 @@ func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) { return } +func libc_flistxattr_trampoline() + +//go:linkname libc_flistxattr libc_flistxattr +//go:cgo_import_dynamic libc_flistxattr flistxattr "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_setattrlist_trampoline), uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_setattrlist_trampoline() + +//go:linkname libc_setattrlist libc_setattrlist +//go:cgo_import_dynamic libc_setattrlist setattrlist "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kill(pid int, signum int, posix int) (err error) { - _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) + _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_kill_trampoline() + +//go:linkname libc_kill libc_kill +//go:cgo_import_dynamic libc_kill kill "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { - _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + _, _, e1 := syscall_syscall(funcPC(libc_ioctl_trampoline), uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_ioctl_trampoline() + +//go:linkname libc_ioctl libc_ioctl +//go:cgo_import_dynamic libc_ioctl ioctl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { + _, _, e1 := syscall_syscall6(funcPC(libc_sendfile_trampoline), uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sendfile_trampoline() + +//go:linkname libc_sendfile libc_sendfile +//go:cgo_import_dynamic libc_sendfile sendfile "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { @@ -559,23 +814,33 @@ func Access(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_access_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_access_trampoline() + +//go:linkname libc_access libc_access +//go:cgo_import_dynamic libc_access access "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { - _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_adjtime_trampoline), uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_adjtime_trampoline() + +//go:linkname libc_adjtime libc_adjtime +//go:cgo_import_dynamic libc_adjtime adjtime "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { @@ -584,13 +849,18 @@ func Chdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chdir_trampoline() + +//go:linkname libc_chdir libc_chdir +//go:cgo_import_dynamic libc_chdir chdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { @@ -599,13 +869,18 @@ func Chflags(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chflags_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chflags_trampoline() + +//go:linkname libc_chflags libc_chflags +//go:cgo_import_dynamic libc_chflags chflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { @@ -614,13 +889,18 @@ func Chmod(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_chmod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chmod_trampoline() + +//go:linkname libc_chmod libc_chmod +//go:cgo_import_dynamic libc_chmod chmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { @@ -629,13 +909,18 @@ func Chown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_chown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chown_trampoline() + +//go:linkname libc_chown libc_chown +//go:cgo_import_dynamic libc_chown chown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { @@ -644,27 +929,37 @@ func Chroot(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_chroot_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_chroot_trampoline() + +//go:linkname libc_chroot libc_chroot +//go:cgo_import_dynamic libc_chroot chroot "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { - _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_close_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_close_trampoline() + +//go:linkname libc_close libc_close +//go:cgo_import_dynamic libc_close close "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { - r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -672,16 +967,26 @@ func Dup(fd int) (nfd int, err error) { return } +func libc_dup_trampoline() + +//go:linkname libc_dup libc_dup +//go:cgo_import_dynamic libc_dup dup "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { - _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + _, _, e1 := syscall_syscall(funcPC(libc_dup2_trampoline), uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_dup2_trampoline() + +//go:linkname libc_dup2 libc_dup2 +//go:cgo_import_dynamic libc_dup2 dup2 "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exchangedata(path1 string, path2 string, options int) (err error) { @@ -695,20 +1000,30 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) + _, _, e1 := syscall_syscall(funcPC(libc_exchangedata_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_exchangedata_trampoline() + +//go:linkname libc_exchangedata libc_exchangedata +//go:cgo_import_dynamic libc_exchangedata exchangedata "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { - Syscall(SYS_EXIT, uintptr(code), 0, 0) + syscall_syscall(funcPC(libc_exit_trampoline), uintptr(code), 0, 0) return } +func libc_exit_trampoline() + +//go:linkname libc_exit libc_exit +//go:cgo_import_dynamic libc_exit exit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -717,43 +1032,63 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_faccessat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_faccessat_trampoline() + +//go:linkname libc_faccessat libc_faccessat +//go:cgo_import_dynamic libc_faccessat faccessat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { - _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchdir_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchdir_trampoline() + +//go:linkname libc_fchdir libc_fchdir +//go:cgo_import_dynamic libc_fchdir fchdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { - _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchflags_trampoline), uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchflags_trampoline() + +//go:linkname libc_fchflags libc_fchflags +//go:cgo_import_dynamic libc_fchflags fchflags "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { - _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_fchmod_trampoline), uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmod_trampoline() + +//go:linkname libc_fchmod libc_fchmod +//go:cgo_import_dynamic libc_fchmod fchmod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { @@ -762,23 +1097,33 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchmodat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchmodat_trampoline() + +//go:linkname libc_fchmodat libc_fchmodat +//go:cgo_import_dynamic libc_fchmodat fchmodat "/usr/lib/libSystem.B.dylib" + // 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)) + _, _, e1 := syscall_syscall(funcPC(libc_fchown_trampoline), uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fchown_trampoline() + +//go:linkname libc_fchown libc_fchown +//go:cgo_import_dynamic libc_fchown fchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { @@ -787,142 +1132,135 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_fchownat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fchownat_trampoline() -func Flock(fd int, how int) (err error) { - _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fchownat libc_fchownat +//go:cgo_import_dynamic libc_fchownat fchownat "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fpathconf(fd int, name int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) - val = int(r0) +func Flock(fd int, how int) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_flock_trampoline() -func Fstat(fd int, stat *Stat_t) (err error) { - _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_flock libc_flock +//go:cgo_import_dynamic libc_flock flock "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fpathconf_trampoline), uintptr(fd), uintptr(name), 0) + val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_fpathconf_trampoline() -func Fstatfs(fd int, stat *Statfs_t) (err error) { - _, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_fpathconf libc_fpathconf +//go:cgo_import_dynamic libc_fpathconf fpathconf "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { - _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_fsync_trampoline), uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_fsync_trampoline() + +//go:linkname libc_fsync libc_fsync +//go:cgo_import_dynamic libc_fsync fsync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { - _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_ftruncate_trampoline), uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_ftruncate_trampoline() -func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_ftruncate libc_ftruncate +//go:cgo_import_dynamic libc_ftruncate ftruncate "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { - r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_getdtablesize_trampoline), 0, 0, 0) size = int(r0) return } +func libc_getdtablesize_trampoline() + +//go:linkname libc_getdtablesize libc_getdtablesize +//go:cgo_import_dynamic libc_getdtablesize getdtablesize "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { - r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getegid_trampoline), 0, 0, 0) egid = int(r0) return } +func libc_getegid_trampoline() + +//go:linkname libc_getegid libc_getegid +//go:cgo_import_dynamic libc_getegid getegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_geteuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_geteuid_trampoline() + +//go:linkname libc_geteuid libc_geteuid +//go:cgo_import_dynamic libc_geteuid geteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { - r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getgid_trampoline), 0, 0, 0) gid = int(r0) return } +func libc_getgid_trampoline() + +//go:linkname libc_getgid libc_getgid +//go:cgo_import_dynamic libc_getgid getgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getpgid_trampoline), uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -930,34 +1268,54 @@ func Getpgid(pid int) (pgid int, err error) { return } +func libc_getpgid_trampoline() + +//go:linkname libc_getpgid libc_getpgid +//go:cgo_import_dynamic libc_getpgid getpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { - r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpgrp_trampoline), 0, 0, 0) pgrp = int(r0) return } +func libc_getpgrp_trampoline() + +//go:linkname libc_getpgrp libc_getpgrp +//go:cgo_import_dynamic libc_getpgrp getpgrp "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { - r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getpid_trampoline), 0, 0, 0) pid = int(r0) return } +func libc_getpid_trampoline() + +//go:linkname libc_getpid libc_getpid +//go:cgo_import_dynamic libc_getpid getpid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { - r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getppid_trampoline), 0, 0, 0) ppid = int(r0) return } +func libc_getppid_trampoline() + +//go:linkname libc_getppid libc_getppid +//go:cgo_import_dynamic libc_getppid getppid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { - r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_getpriority_trampoline), uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -965,30 +1323,45 @@ func Getpriority(which int, who int) (prio int, err error) { return } +func libc_getpriority_trampoline() + +//go:linkname libc_getpriority libc_getpriority +//go:cgo_import_dynamic libc_getpriority getpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrlimit_trampoline() + +//go:linkname libc_getrlimit libc_getrlimit +//go:cgo_import_dynamic libc_getrlimit getrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { - _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_getrusage_trampoline), uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_getrusage_trampoline() + +//go:linkname libc_getrusage libc_getrusage +//go:cgo_import_dynamic libc_getrusage getrusage "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { - r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_getsid_trampoline), uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -996,26 +1369,41 @@ func Getsid(pid int) (sid int, err error) { return } +func libc_getsid_trampoline() + +//go:linkname libc_getsid libc_getsid +//go:cgo_import_dynamic libc_getsid getsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { - r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0) uid = int(r0) return } +func libc_getuid_trampoline() + +//go:linkname libc_getuid libc_getuid +//go:cgo_import_dynamic libc_getuid getuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { - r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0) + r0, _, _ := syscall_rawSyscall(funcPC(libc_issetugid_trampoline), 0, 0, 0) tainted = bool(r0 != 0) return } +func libc_issetugid_trampoline() + +//go:linkname libc_issetugid libc_issetugid +//go:cgo_import_dynamic libc_issetugid issetugid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { - r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + r0, _, e1 := syscall_syscall(funcPC(libc_kqueue_trampoline), 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1023,6 +1411,11 @@ func Kqueue() (fd int, err error) { return } +func libc_kqueue_trampoline() + +//go:linkname libc_kqueue libc_kqueue +//go:cgo_import_dynamic libc_kqueue kqueue "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { @@ -1031,13 +1424,18 @@ func Lchown(path string, uid int, gid int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + _, _, e1 := syscall_syscall(funcPC(libc_lchown_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_lchown_trampoline() + +//go:linkname libc_lchown libc_lchown +//go:cgo_import_dynamic libc_lchown lchown "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { @@ -1051,13 +1449,18 @@ func Link(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_link_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_link_trampoline() + +//go:linkname libc_link libc_link +//go:cgo_import_dynamic libc_link link "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { @@ -1071,37 +1474,32 @@ func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err er if err != nil { return } - _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_linkat_trampoline), uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_linkat_trampoline() + +//go:linkname libc_linkat libc_linkat +//go:cgo_import_dynamic libc_linkat linkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { - _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + _, _, e1 := syscall_syscall(funcPC(libc_listen_trampoline), uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_listen_trampoline() -func Lstat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_listen libc_listen +//go:cgo_import_dynamic libc_listen listen "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1111,13 +1509,18 @@ func Mkdir(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkdir_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdir_trampoline() + +//go:linkname libc_mkdir libc_mkdir +//go:cgo_import_dynamic libc_mkdir mkdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { @@ -1126,13 +1529,18 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + _, _, e1 := syscall_syscall(funcPC(libc_mkdirat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkdirat_trampoline() + +//go:linkname libc_mkdirat libc_mkdirat +//go:cgo_import_dynamic libc_mkdirat mkdirat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { @@ -1141,13 +1549,18 @@ func Mkfifo(path string, mode uint32) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + _, _, e1 := syscall_syscall(funcPC(libc_mkfifo_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mkfifo_trampoline() + +//go:linkname libc_mkfifo libc_mkfifo +//go:cgo_import_dynamic libc_mkfifo mkfifo "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { @@ -1156,13 +1569,18 @@ func Mknod(path string, mode uint32, dev int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + _, _, e1 := syscall_syscall(funcPC(libc_mknod_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_mknod_trampoline() + +//go:linkname libc_mknod libc_mknod +//go:cgo_import_dynamic libc_mknod mknod "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { @@ -1171,7 +1589,7 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + r0, _, e1 := syscall_syscall(funcPC(libc_open_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1179,6 +1597,11 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } +func libc_open_trampoline() + +//go:linkname libc_open libc_open +//go:cgo_import_dynamic libc_open open "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { @@ -1187,7 +1610,7 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { if err != nil { return } - r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_openat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1195,6 +1618,11 @@ func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) { return } +func libc_openat_trampoline() + +//go:linkname libc_openat libc_openat +//go:cgo_import_dynamic libc_openat openat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { @@ -1203,7 +1631,7 @@ func Pathconf(path string, name int) (val int, err error) { if err != nil { return } - r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + r0, _, e1 := syscall_syscall(funcPC(libc_pathconf_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1211,6 +1639,11 @@ func Pathconf(path string, name int) (val int, err error) { return } +func libc_pathconf_trampoline() + +//go:linkname libc_pathconf libc_pathconf +//go:cgo_import_dynamic libc_pathconf pathconf "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { @@ -1220,7 +1653,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pread_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1228,6 +1661,11 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pread_trampoline() + +//go:linkname libc_pread libc_pread +//go:cgo_import_dynamic libc_pread pread "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { @@ -1237,7 +1675,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_pwrite_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1245,6 +1683,11 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { return } +func libc_pwrite_trampoline() + +//go:linkname libc_pwrite libc_pwrite +//go:cgo_import_dynamic libc_pwrite pwrite "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { @@ -1254,7 +1697,7 @@ func read(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1262,6 +1705,11 @@ func read(fd int, p []byte) (n int, err error) { return } +func libc_read_trampoline() + +//go:linkname libc_read libc_read +//go:cgo_import_dynamic libc_read read "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { @@ -1276,7 +1724,7 @@ func Readlink(path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + r0, _, e1 := syscall_syscall(funcPC(libc_readlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1284,6 +1732,11 @@ func Readlink(path string, buf []byte) (n int, err error) { return } +func libc_readlink_trampoline() + +//go:linkname libc_readlink libc_readlink +//go:cgo_import_dynamic libc_readlink readlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { @@ -1298,7 +1751,7 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { } else { _p1 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) + r0, _, e1 := syscall_syscall6(funcPC(libc_readlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1306,6 +1759,11 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { return } +func libc_readlinkat_trampoline() + +//go:linkname libc_readlinkat libc_readlinkat +//go:cgo_import_dynamic libc_readlinkat readlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { @@ -1319,13 +1777,18 @@ func Rename(from string, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_rename_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rename_trampoline() + +//go:linkname libc_rename libc_rename +//go:cgo_import_dynamic libc_rename rename "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(fromfd int, from string, tofd int, to string) (err error) { @@ -1339,13 +1802,18 @@ func Renameat(fromfd int, from string, tofd int, to string) (err error) { if err != nil { return } - _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + _, _, e1 := syscall_syscall6(funcPC(libc_renameat_trampoline), uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_renameat_trampoline() + +//go:linkname libc_renameat libc_renameat +//go:cgo_import_dynamic libc_renameat renameat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { @@ -1354,13 +1822,18 @@ func Revoke(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_revoke_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_revoke_trampoline() + +//go:linkname libc_revoke libc_revoke +//go:cgo_import_dynamic libc_revoke revoke "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { @@ -1369,17 +1842,22 @@ func Rmdir(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_rmdir_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_rmdir_trampoline() + +//go:linkname libc_rmdir libc_rmdir +//go:cgo_import_dynamic libc_rmdir rmdir "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + r0, _, e1 := syscall_syscall(funcPC(libc_lseek_trampoline), uintptr(fd), uintptr(offset), uintptr(whence)) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) @@ -1387,46 +1865,71 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { return } +func libc_lseek_trampoline() + +//go:linkname libc_lseek libc_lseek +//go:cgo_import_dynamic libc_lseek lseek "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { - _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + _, _, e1 := syscall_syscall6(funcPC(libc_select_trampoline), uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_select_trampoline() + +//go:linkname libc_select libc_select +//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { - _, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setegid_trampoline), uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setegid_trampoline() + +//go:linkname libc_setegid libc_setegid +//go:cgo_import_dynamic libc_setegid setegid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_seteuid_trampoline), uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_seteuid_trampoline() + +//go:linkname libc_seteuid libc_seteuid +//go:cgo_import_dynamic libc_seteuid seteuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setgid_trampoline), uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setgid_trampoline() + +//go:linkname libc_setgid libc_setgid +//go:cgo_import_dynamic libc_setgid setgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { @@ -1435,77 +1938,112 @@ func Setlogin(name string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setlogin_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setlogin_trampoline() + +//go:linkname libc_setlogin libc_setlogin +//go:cgo_import_dynamic libc_setlogin setlogin "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setpgid_trampoline), uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpgid_trampoline() + +//go:linkname libc_setpgid libc_setpgid +//go:cgo_import_dynamic libc_setpgid setpgid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + _, _, e1 := syscall_syscall(funcPC(libc_setpriority_trampoline), uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setpriority_trampoline() + +//go:linkname libc_setpriority libc_setpriority +//go:cgo_import_dynamic libc_setpriority setpriority "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setprivexec(flag int) (err error) { - _, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_setprivexec_trampoline), uintptr(flag), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setprivexec_trampoline() + +//go:linkname libc_setprivexec libc_setprivexec +//go:cgo_import_dynamic libc_setprivexec setprivexec "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setregid_trampoline), uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setregid_trampoline() + +//go:linkname libc_setregid libc_setregid +//go:cgo_import_dynamic libc_setregid setregid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setreuid_trampoline), uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setreuid_trampoline() + +//go:linkname libc_setreuid libc_setreuid +//go:cgo_import_dynamic libc_setreuid setreuid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { - _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_setrlimit_trampoline), uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_setrlimit_trampoline() + +//go:linkname libc_setrlimit libc_setrlimit +//go:cgo_import_dynamic libc_setrlimit setrlimit "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { - r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + r0, _, e1 := syscall_rawSyscall(funcPC(libc_setsid_trampoline), 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1513,55 +2051,40 @@ func Setsid() (pid int, err error) { return } +func libc_setsid_trampoline() + +//go:linkname libc_setsid libc_setsid +//go:cgo_import_dynamic libc_setsid setsid "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { - _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + _, _, e1 := syscall_rawSyscall(funcPC(libc_settimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_settimeofday_trampoline() -func Setuid(uid int) (err error) { - _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_settimeofday libc_settimeofday +//go:cgo_import_dynamic libc_settimeofday settimeofday "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Stat(path string, stat *Stat_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) +func Setuid(uid int) (err error) { + _, _, e1 := syscall_rawSyscall(funcPC(libc_setuid_trampoline), uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func libc_setuid_trampoline() -func Statfs(path string, stat *Statfs_t) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} +//go:linkname libc_setuid libc_setuid +//go:cgo_import_dynamic libc_setuid setuid "/usr/lib/libSystem.B.dylib" // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT @@ -1576,13 +2099,18 @@ func Symlink(path string, link string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + _, _, e1 := syscall_syscall(funcPC(libc_symlink_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlink_trampoline() + +//go:linkname libc_symlink libc_symlink +//go:cgo_import_dynamic libc_symlink symlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { @@ -1596,23 +2124,33 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + _, _, e1 := syscall_syscall(funcPC(libc_symlinkat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } +func libc_symlinkat_trampoline() + +//go:linkname libc_symlinkat libc_symlinkat +//go:cgo_import_dynamic libc_symlinkat symlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { - _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_sync_trampoline), 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_sync_trampoline() + +//go:linkname libc_sync libc_sync +//go:cgo_import_dynamic libc_sync sync "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { @@ -1621,21 +2159,31 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_truncate_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_truncate_trampoline() + +//go:linkname libc_truncate libc_truncate +//go:cgo_import_dynamic libc_truncate truncate "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { - r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + r0, _, _ := syscall_syscall(funcPC(libc_umask_trampoline), uintptr(newmask), 0, 0) oldmask = int(r0) return } +func libc_umask_trampoline() + +//go:linkname libc_umask libc_umask +//go:cgo_import_dynamic libc_umask umask "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { @@ -1644,13 +2192,18 @@ func Undelete(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_undelete_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_undelete_trampoline() + +//go:linkname libc_undelete libc_undelete +//go:cgo_import_dynamic libc_undelete undelete "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { @@ -1659,13 +2212,18 @@ func Unlink(path string) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + _, _, e1 := syscall_syscall(funcPC(libc_unlink_trampoline), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlink_trampoline() + +//go:linkname libc_unlink libc_unlink +//go:cgo_import_dynamic libc_unlink unlink "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { @@ -1674,13 +2232,18 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + _, _, e1 := syscall_syscall(funcPC(libc_unlinkat_trampoline), uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unlinkat_trampoline() + +//go:linkname libc_unlinkat libc_unlinkat +//go:cgo_import_dynamic libc_unlinkat unlinkat "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { @@ -1689,13 +2252,18 @@ func Unmount(path string, flags int) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + _, _, e1 := syscall_syscall(funcPC(libc_unmount_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_unmount_trampoline() + +//go:linkname libc_unmount libc_unmount +//go:cgo_import_dynamic libc_unmount unmount "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { @@ -1705,7 +2273,7 @@ func write(fd int, p []byte) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1713,10 +2281,15 @@ func write(fd int, p []byte) (n int, err error) { return } +func libc_write_trampoline() + +//go:linkname libc_write libc_write +//go:cgo_import_dynamic libc_write write "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + r0, _, e1 := syscall_syscall6(funcPC(libc_mmap_trampoline), uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) @@ -1724,20 +2297,30 @@ func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) ( return } +func libc_mmap_trampoline() + +//go:linkname libc_mmap libc_mmap +//go:cgo_import_dynamic libc_mmap mmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { - _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + _, _, e1 := syscall_syscall(funcPC(libc_munmap_trampoline), uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } +func libc_munmap_trampoline() + +//go:linkname libc_munmap libc_munmap +//go:cgo_import_dynamic libc_munmap munmap "/usr/lib/libSystem.B.dylib" + // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_read_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1748,7 +2331,7 @@ func readlen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { - r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + r0, _, e1 := syscall_syscall(funcPC(libc_write_trampoline), uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1759,7 +2342,7 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { - r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0) sec = int64(r0) usec = int32(r1) if e1 != 0 { @@ -1767,3 +2350,134 @@ func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) { } return } + +func libc_gettimeofday_trampoline() + +//go:linkname libc_gettimeofday libc_gettimeofday +//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstat(fd int, stat *Stat_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstat_trampoline() + +//go:linkname libc_fstat libc_fstat +//go:cgo_import_dynamic libc_fstat fstat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(funcPC(libc_fstatat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatat_trampoline() + +//go:linkname libc_fstatat libc_fstatat +//go:cgo_import_dynamic libc_fstatat fstatat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fstatfs(fd int, stat *Statfs_t) (err error) { + _, _, e1 := syscall_syscall(funcPC(libc_fstatfs_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fstatfs_trampoline() + +//go:linkname libc_fstatfs libc_fstatfs +//go:cgo_import_dynamic libc_fstatfs fstatfs "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_getfsstat_trampoline), uintptr(buf), uintptr(size), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_getfsstat_trampoline() + +//go:linkname libc_getfsstat libc_getfsstat +//go:cgo_import_dynamic libc_getfsstat getfsstat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lstat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_lstat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_lstat_trampoline() + +//go:linkname libc_lstat libc_lstat +//go:cgo_import_dynamic libc_lstat lstat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Stat(path string, stat *Stat_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_stat_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_stat_trampoline() + +//go:linkname libc_stat libc_stat +//go:cgo_import_dynamic libc_stat stat "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Statfs(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(funcPC(libc_statfs_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_statfs_trampoline() + +//go:linkname libc_statfs libc_statfs +//go:cgo_import_dynamic libc_statfs statfs "/usr/lib/libSystem.B.dylib" diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s new file mode 100644 index 0000000000000..61dc0d4c12959 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -0,0 +1,282 @@ +// go run mkasm_darwin.go arm64 +// Code generated by the command above; DO NOT EDIT. + +// +build go1.12 + +#include "textflag.h" +TEXT ·libc_getgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgroups(SB) +TEXT ·libc_setgroups_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgroups(SB) +TEXT ·libc_wait4_trampoline(SB),NOSPLIT,$0-0 + JMP libc_wait4(SB) +TEXT ·libc_accept_trampoline(SB),NOSPLIT,$0-0 + JMP libc_accept(SB) +TEXT ·libc_bind_trampoline(SB),NOSPLIT,$0-0 + JMP libc_bind(SB) +TEXT ·libc_connect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_connect(SB) +TEXT ·libc_socket_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socket(SB) +TEXT ·libc_getsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockopt(SB) +TEXT ·libc_setsockopt_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsockopt(SB) +TEXT ·libc_getpeername_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpeername(SB) +TEXT ·libc_getsockname_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsockname(SB) +TEXT ·libc_shutdown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_shutdown(SB) +TEXT ·libc_socketpair_trampoline(SB),NOSPLIT,$0-0 + JMP libc_socketpair(SB) +TEXT ·libc_recvfrom_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvfrom(SB) +TEXT ·libc_sendto_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendto(SB) +TEXT ·libc_recvmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_recvmsg(SB) +TEXT ·libc_sendmsg_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendmsg(SB) +TEXT ·libc_kevent_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kevent(SB) +TEXT ·libc___sysctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc___sysctl(SB) +TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_utimes(SB) +TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 + JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 + JMP libc_poll(SB) +TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 + JMP libc_madvise(SB) +TEXT ·libc_mlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlock(SB) +TEXT ·libc_mlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mlockall(SB) +TEXT ·libc_mprotect_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mprotect(SB) +TEXT ·libc_msync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_msync(SB) +TEXT ·libc_munlock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlock(SB) +TEXT ·libc_munlockall_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munlockall(SB) +TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ptrace(SB) +TEXT ·libc_getattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getattrlist(SB) +TEXT ·libc_pipe_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pipe(SB) +TEXT ·libc_getxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getxattr(SB) +TEXT ·libc_fgetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fgetxattr(SB) +TEXT ·libc_setxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setxattr(SB) +TEXT ·libc_fsetxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsetxattr(SB) +TEXT ·libc_removexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_removexattr(SB) +TEXT ·libc_fremovexattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fremovexattr(SB) +TEXT ·libc_listxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listxattr(SB) +TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flistxattr(SB) +TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setattrlist(SB) +TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kill(SB) +TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ioctl(SB) +TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sendfile(SB) +TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0 + JMP libc_access(SB) +TEXT ·libc_adjtime_trampoline(SB),NOSPLIT,$0-0 + JMP libc_adjtime(SB) +TEXT ·libc_chdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chdir(SB) +TEXT ·libc_chflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chflags(SB) +TEXT ·libc_chmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chmod(SB) +TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chown(SB) +TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 + JMP libc_chroot(SB) +TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 + JMP libc_close(SB) +TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup(SB) +TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0 + JMP libc_dup2(SB) +TEXT ·libc_exchangedata_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exchangedata(SB) +TEXT ·libc_exit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_exit(SB) +TEXT ·libc_faccessat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_faccessat(SB) +TEXT ·libc_fchdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchdir(SB) +TEXT ·libc_fchflags_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchflags(SB) +TEXT ·libc_fchmod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmod(SB) +TEXT ·libc_fchmodat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchmodat(SB) +TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchown(SB) +TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fchownat(SB) +TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0 + JMP libc_flock(SB) +TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fpathconf(SB) +TEXT ·libc_fsync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fsync(SB) +TEXT ·libc_ftruncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_ftruncate(SB) +TEXT ·libc_getdtablesize_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getdtablesize(SB) +TEXT ·libc_getegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getegid(SB) +TEXT ·libc_geteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_geteuid(SB) +TEXT ·libc_getgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getgid(SB) +TEXT ·libc_getpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgid(SB) +TEXT ·libc_getpgrp_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpgrp(SB) +TEXT ·libc_getpid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpid(SB) +TEXT ·libc_getppid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getppid(SB) +TEXT ·libc_getpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getpriority(SB) +TEXT ·libc_getrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrlimit(SB) +TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getrusage(SB) +TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getsid(SB) +TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getuid(SB) +TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_issetugid(SB) +TEXT ·libc_kqueue_trampoline(SB),NOSPLIT,$0-0 + JMP libc_kqueue(SB) +TEXT ·libc_lchown_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lchown(SB) +TEXT ·libc_link_trampoline(SB),NOSPLIT,$0-0 + JMP libc_link(SB) +TEXT ·libc_linkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_linkat(SB) +TEXT ·libc_listen_trampoline(SB),NOSPLIT,$0-0 + JMP libc_listen(SB) +TEXT ·libc_mkdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdir(SB) +TEXT ·libc_mkdirat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkdirat(SB) +TEXT ·libc_mkfifo_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mkfifo(SB) +TEXT ·libc_mknod_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mknod(SB) +TEXT ·libc_open_trampoline(SB),NOSPLIT,$0-0 + JMP libc_open(SB) +TEXT ·libc_openat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_openat(SB) +TEXT ·libc_pathconf_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pathconf(SB) +TEXT ·libc_pread_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pread(SB) +TEXT ·libc_pwrite_trampoline(SB),NOSPLIT,$0-0 + JMP libc_pwrite(SB) +TEXT ·libc_read_trampoline(SB),NOSPLIT,$0-0 + JMP libc_read(SB) +TEXT ·libc_readlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlink(SB) +TEXT ·libc_readlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_readlinkat(SB) +TEXT ·libc_rename_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rename(SB) +TEXT ·libc_renameat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_renameat(SB) +TEXT ·libc_revoke_trampoline(SB),NOSPLIT,$0-0 + JMP libc_revoke(SB) +TEXT ·libc_rmdir_trampoline(SB),NOSPLIT,$0-0 + JMP libc_rmdir(SB) +TEXT ·libc_lseek_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lseek(SB) +TEXT ·libc_select_trampoline(SB),NOSPLIT,$0-0 + JMP libc_select(SB) +TEXT ·libc_setegid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setegid(SB) +TEXT ·libc_seteuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_seteuid(SB) +TEXT ·libc_setgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setgid(SB) +TEXT ·libc_setlogin_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setlogin(SB) +TEXT ·libc_setpgid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpgid(SB) +TEXT ·libc_setpriority_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setpriority(SB) +TEXT ·libc_setprivexec_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setprivexec(SB) +TEXT ·libc_setregid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setregid(SB) +TEXT ·libc_setreuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setreuid(SB) +TEXT ·libc_setrlimit_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setrlimit(SB) +TEXT ·libc_setsid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setsid(SB) +TEXT ·libc_settimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_settimeofday(SB) +TEXT ·libc_setuid_trampoline(SB),NOSPLIT,$0-0 + JMP libc_setuid(SB) +TEXT ·libc_symlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlink(SB) +TEXT ·libc_symlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_symlinkat(SB) +TEXT ·libc_sync_trampoline(SB),NOSPLIT,$0-0 + JMP libc_sync(SB) +TEXT ·libc_truncate_trampoline(SB),NOSPLIT,$0-0 + JMP libc_truncate(SB) +TEXT ·libc_umask_trampoline(SB),NOSPLIT,$0-0 + JMP libc_umask(SB) +TEXT ·libc_undelete_trampoline(SB),NOSPLIT,$0-0 + JMP libc_undelete(SB) +TEXT ·libc_unlink_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlink(SB) +TEXT ·libc_unlinkat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unlinkat(SB) +TEXT ·libc_unmount_trampoline(SB),NOSPLIT,$0-0 + JMP libc_unmount(SB) +TEXT ·libc_write_trampoline(SB),NOSPLIT,$0-0 + JMP libc_write(SB) +TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_mmap(SB) +TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0 + JMP libc_munmap(SB) +TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0 + JMP libc_gettimeofday(SB) +TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstat(SB) +TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatat(SB) +TEXT ·libc_fstatfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fstatfs(SB) +TEXT ·libc_getfsstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +TEXT ·libc_lstat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_lstat(SB) +TEXT ·libc_stat_trampoline(SB),NOSPLIT,$0-0 + JMP libc_stat(SB) +TEXT ·libc_statfs_trampoline(SB),NOSPLIT,$0-0 + JMP libc_statfs(SB) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 2d099367215c8..93480fcb16838 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -1,5 +1,5 @@ -// mksysnum_linux.pl -Ilinux/usr/include -m64 -D__arch64__ linux/usr/include/asm/unistd.h -// Code generated by the command above; DO NOT EDIT. +// go run linux/mksysnum.go -Wall -Werror -static -I/tmp/include /tmp/include/asm/unistd.h +// Code generated by the command above; see README.md. DO NOT EDIT. // +build sparc64,linux @@ -345,4 +345,6 @@ const ( SYS_COPY_FILE_RANGE = 357 SYS_PREADV2 = 358 SYS_PWRITEV2 = 359 + SYS_STATX = 360 + SYS_IO_PGETEVENTS = 361 ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index f56e164b70420..8ee54ec329e8d 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -98,7 +98,6 @@ type _Gid_t uint32 type Stat_t struct { Dev uint64 _ uint16 - _ [2]byte _ uint32 Mode uint32 Nlink uint32 @@ -106,7 +105,6 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [2]byte Size int64 Blksize int32 Blocks int64 @@ -257,7 +255,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -382,7 +379,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -652,7 +648,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [2]byte Filter *SockFilter } @@ -788,11 +783,10 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte + _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -1866,7 +1860,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index ac5f636a68773..dcfe391243554 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -162,7 +159,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -259,7 +255,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -338,7 +333,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -386,7 +380,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -656,7 +649,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -714,7 +706,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -733,7 +724,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]int8 Fpack [6]int8 @@ -806,11 +796,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -828,7 +816,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1200,7 +1187,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1886,7 +1872,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1904,7 +1889,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index eb7562da792e5..692f2966de318 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -98,7 +98,6 @@ type _Gid_t uint32 type Stat_t struct { Dev uint64 _ uint16 - _ [2]byte _ uint32 Mode uint32 Nlink uint32 @@ -106,7 +105,7 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [6]byte + _ [4]byte Size int64 Blksize int32 _ [4]byte @@ -260,7 +259,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -385,7 +383,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -655,7 +652,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [2]byte Filter *SockFilter } @@ -776,11 +772,10 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte + _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -1855,7 +1850,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 3c4fb88d76041..54ff596c50baa 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -163,7 +160,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -260,7 +256,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -339,7 +334,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -387,7 +381,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -657,7 +650,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -692,7 +684,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -711,7 +702,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]int8 Fpack [6]int8 @@ -785,11 +775,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -807,7 +795,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1179,7 +1166,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1865,7 +1851,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1883,7 +1868,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 647e40a7746ca..5dbe0c3186c16 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -258,7 +258,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -383,7 +382,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -653,7 +651,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [2]byte Filter *SockFilter } @@ -780,11 +777,10 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte + _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -1860,7 +1856,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index e0159b01d4065..26766ee37afe2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -163,7 +160,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -260,7 +256,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -339,7 +334,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -387,7 +381,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -657,7 +650,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -695,7 +687,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -714,7 +705,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]int8 Fpack [6]int8 @@ -787,11 +777,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -809,7 +797,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1181,7 +1168,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1867,7 +1853,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1885,7 +1870,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index c1a024dfd7936..2d23ed17a3a03 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -163,7 +160,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -260,7 +256,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -339,7 +334,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -387,7 +381,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -657,7 +650,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -695,7 +687,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -714,7 +705,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]int8 Fpack [6]int8 @@ -787,11 +777,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -809,7 +797,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1181,7 +1168,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1867,7 +1853,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1885,7 +1870,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 7e525eb7f99ea..dac6168ebac6b 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -258,7 +258,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -383,7 +382,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -653,7 +651,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [2]byte Filter *SockFilter } @@ -780,11 +777,10 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte + _ [4]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -1860,7 +1856,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 85ae2954dcd6a..d79111c36642c 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -164,7 +161,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -261,7 +257,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -340,7 +335,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -388,7 +382,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -658,7 +651,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -702,7 +694,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -721,7 +712,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]uint8 Fpack [6]uint8 @@ -795,11 +785,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -817,7 +805,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1189,7 +1176,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1875,7 +1861,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1893,7 +1878,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index d0c930a13fa32..f58b691b4530d 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -164,7 +161,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -261,7 +257,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -340,7 +335,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -388,7 +382,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -658,7 +651,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -702,7 +694,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -721,7 +712,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]uint8 Fpack [6]uint8 @@ -795,11 +785,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -817,7 +805,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1189,7 +1176,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1875,7 +1861,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1893,7 +1878,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index c1a20bcd3f491..2a493b5528c65 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -163,7 +160,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -260,7 +256,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -339,7 +334,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -387,7 +381,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -657,7 +650,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -720,7 +712,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -739,7 +730,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]uint8 Fpack [6]uint8 @@ -812,11 +802,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -834,7 +822,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1206,7 +1193,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1892,7 +1878,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1910,7 +1895,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index 3c26ea82ba797..4ff4097c216d9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -33,13 +33,11 @@ type Timeval struct { type Timex struct { Modes uint32 - _ [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - _ [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,7 +46,6 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - _ [4]byte Stabil int64 Jitcnt int64 Calcnt int64 @@ -162,7 +159,6 @@ type Fsid struct { type Flock_t struct { Type int16 Whence int16 - _ [4]byte Start int64 Len int64 Pid int32 @@ -259,7 +255,6 @@ type RawSockaddrRFCOMM struct { type RawSockaddrCAN struct { Family uint16 - _ [2]byte Ifindex int32 Addr [8]byte } @@ -338,7 +333,6 @@ type PacketMreq struct { type Msghdr struct { Name *byte Namelen uint32 - _ [4]byte Iov *Iovec Iovlen uint64 Control *byte @@ -386,7 +380,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - _ [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -656,7 +649,6 @@ type SockFilter struct { type SockFprog struct { Len uint16 - _ [6]byte Filter *SockFilter } @@ -686,18 +678,15 @@ type PtracePsw struct { type PtraceFpregs struct { Fpc uint32 - _ [4]byte Fprs [16]float64 } type PtracePer struct { _ [0]uint64 - _ [24]byte - _ [8]byte + _ [32]byte Starting_addr uint64 Ending_addr uint64 Perc_atmid uint16 - _ [6]byte Address uint64 Access_id uint8 _ [7]byte @@ -718,7 +707,6 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - _ [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 @@ -737,7 +725,6 @@ type Utsname struct { type Ustat_t struct { Tfree int32 - _ [4]byte Tinode uint64 Fname [6]int8 Fpack [6]int8 @@ -811,11 +798,9 @@ type Winsize struct { type Taskstats struct { Version uint16 - _ [2]byte Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -833,7 +818,6 @@ type Taskstats struct { Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 - _ [4]byte Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 @@ -1205,7 +1189,6 @@ type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 - _ [4]byte Start uint64 } @@ -1892,7 +1875,6 @@ type RTCTime struct { type RTCWkAlrm struct { Enabled uint8 Pending uint8 - _ [2]byte Time RTCTime } @@ -1910,7 +1892,6 @@ type BlkpgIoctlArg struct { Op int32 Flags int32 Datalen int32 - _ [4]byte Data *byte } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 1fc7f7dea9c3f..ec980c1ab6542 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -1,6 +1,7 @@ +// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + // +build sparc64,linux -// Created by cgo -godefs - DO NOT EDIT -// cgo -godefs types_linux.go | go run mkpost.go package unix @@ -26,20 +27,18 @@ type Timespec struct { } type Timeval struct { - Sec int64 - Usec int32 - Pad_cgo_0 [4]byte + Sec int64 + Usec int32 + _ [4]byte } type Timex struct { Modes uint32 - Pad_cgo_0 [4]byte Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 - Pad_cgo_1 [4]byte Constant int64 Precision int64 Tolerance int64 @@ -48,14 +47,13 @@ type Timex struct { Ppsfreq int64 Jitter int64 Shift int32 - Pad_cgo_2 [4]byte Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 - Pad_cgo_3 [44]byte + _ [44]byte } type Time_t int64 @@ -99,64 +97,96 @@ type Rlimit struct { type _Gid_t uint32 type Stat_t struct { - Dev uint64 - X__pad1 uint16 - Pad_cgo_0 [6]byte - Ino uint64 - Mode uint32 - Nlink uint32 - Uid uint32 - Gid uint32 - Rdev uint64 - X__pad2 uint16 - Pad_cgo_1 [6]byte - Size int64 - Blksize int64 - Blocks int64 - Atim Timespec - Mtim Timespec - Ctim Timespec - X__glibc_reserved4 uint64 - X__glibc_reserved5 uint64 + Dev uint64 + _ uint16 + Ino uint64 + Mode uint32 + Nlink uint32 + Uid uint32 + Gid uint32 + Rdev uint64 + _ uint16 + Size int64 + Blksize int64 + Blocks int64 + Atim Timespec + Mtim Timespec + Ctim Timespec + _ uint64 + _ uint64 } -type Statfs_t struct { - Type int64 - Bsize int64 - Blocks uint64 - Bfree uint64 - Bavail uint64 - Files uint64 - Ffree uint64 - Fsid Fsid - Namelen int64 - Frsize int64 - Flags int64 - Spare [4]int64 +type StatxTimestamp struct { + Sec int64 + Nsec uint32 + _ int32 +} + +type Statx_t struct { + Mask uint32 + Blksize uint32 + Attributes uint64 + Nlink uint32 + Uid uint32 + Gid uint32 + Mode uint16 + _ [1]uint16 + Ino uint64 + Size uint64 + Blocks uint64 + Attributes_mask uint64 + Atime StatxTimestamp + Btime StatxTimestamp + Ctime StatxTimestamp + Mtime StatxTimestamp + Rdev_major uint32 + Rdev_minor uint32 + Dev_major uint32 + Dev_minor uint32 + _ [14]uint64 } type Dirent struct { - Ino uint64 - Off int64 - Reclen uint16 - Type uint8 - Name [256]int8 - Pad_cgo_0 [5]byte + Ino uint64 + Off int64 + Reclen uint16 + Type uint8 + Name [256]int8 + _ [5]byte } type Fsid struct { - X__val [2]int32 + Val [2]int32 } type Flock_t struct { - Type int16 - Whence int16 - Pad_cgo_0 [4]byte - Start int64 - Len int64 - Pid int32 - X__glibc_reserved int16 - Pad_cgo_1 [2]byte + Type int16 + Whence int16 + Start int64 + Len int64 + Pid int32 + _ int16 + _ [2]byte +} + +type FscryptPolicy struct { + Version uint8 + Contents_encryption_mode uint8 + Filenames_encryption_mode uint8 + Flags uint8 + Master_key_descriptor [8]uint8 +} + +type FscryptKey struct { + Mode uint32 + Raw [64]uint8 + Size uint32 +} + +type KeyctlDHParams struct { + Private int32 + Prime int32 + Base int32 } const ( @@ -211,11 +241,26 @@ type RawSockaddrHCI struct { Channel uint16 } +type RawSockaddrL2 struct { + Family uint16 + Psm uint16 + Bdaddr [6]uint8 + Cid uint16 + Bdaddr_type uint8 + _ [1]byte +} + +type RawSockaddrRFCOMM struct { + Family uint16 + Bdaddr [6]uint8 + Channel uint8 + _ [1]byte +} + type RawSockaddrCAN struct { - Family uint16 - Pad_cgo_0 [2]byte - Ifindex int32 - Addr [8]byte + Family uint16 + Ifindex int32 + Addr [8]byte } type RawSockaddrALG struct { @@ -234,6 +279,16 @@ type RawSockaddrVM struct { Zero [4]uint8 } +type RawSockaddrXDP struct { + Family uint16 + Flags uint16 + Ifindex uint32 + Queue_id uint32 + Shared_umem_fd uint32 +} + +type RawSockaddrPPPoX [0x1e]byte + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -272,16 +327,22 @@ type IPv6Mreq struct { Interface uint32 } +type PacketMreq struct { + Ifindex int32 + Type uint16 + Alen uint16 + Address [8]uint8 +} + type Msghdr struct { Name *byte Namelen uint32 - Pad_cgo_0 [4]byte Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 - Pad_cgo_1 [4]byte + _ [4]byte } type Cmsghdr struct { @@ -323,7 +384,6 @@ type TCPInfo struct { Probes uint8 Backoff uint8 Options uint8 - Pad_cgo_0 [2]byte Rto uint32 Ato uint32 Snd_mss uint32 @@ -358,13 +418,19 @@ const ( SizeofSockaddrLinklayer = 0x14 SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 + SizeofSockaddrL2 = 0xe + SizeofSockaddrRFCOMM = 0xa SizeofSockaddrCAN = 0x10 SizeofSockaddrALG = 0x58 SizeofSockaddrVM = 0x10 + SizeofSockaddrXDP = 0x10 + SizeofSockaddrPPPoX = 0x1e SizeofLinger = 0x8 + SizeofIovec = 0x10 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc SizeofIPv6Mreq = 0x14 + SizeofPacketMreq = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 SizeofInet4Pktinfo = 0xc @@ -388,6 +454,7 @@ const ( IFLA_ADDRESS = 0x1 IFLA_BROADCAST = 0x2 IFLA_IFNAME = 0x3 + IFLA_INFO_KIND = 0x1 IFLA_MTU = 0x4 IFLA_LINK = 0x5 IFLA_QDISC = 0x6 @@ -431,7 +498,7 @@ const ( IFLA_EVENT = 0x2c IFLA_NEW_NETNSID = 0x2d IFLA_IF_NETNSID = 0x2e - IFLA_MAX = 0x2e + IFLA_MAX = 0x33 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -456,6 +523,20 @@ const ( RTA_FLOW = 0xb RTA_CACHEINFO = 0xc RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d RTN_UNSPEC = 0x0 RTN_UNICAST = 0x1 RTN_LOCAL = 0x2 @@ -523,12 +604,12 @@ type RtAttr struct { } type IfInfomsg struct { - Family uint8 - X__ifi_pad uint8 - Type uint16 - Index int32 - Flags uint32 - Change uint32 + Family uint8 + _ uint8 + Type uint16 + Index int32 + Flags uint32 + Change uint32 } type IfAddrmsg struct { @@ -571,9 +652,8 @@ type SockFilter struct { } type SockFprog struct { - Len uint16 - Pad_cgo_0 [6]byte - Filter *SockFilter + Len uint16 + Filter *SockFilter } type InotifyEvent struct { @@ -594,15 +674,6 @@ type PtraceRegs struct { Magic uint32 } -type ptracePsw struct { -} - -type ptraceFpregs struct { -} - -type ptracePer struct { -} - type FdSet struct { Bits [16]int64 } @@ -618,12 +689,11 @@ type Sysinfo_t struct { Freeswap uint64 Procs uint16 Pad uint16 - Pad_cgo_0 [4]byte Totalhigh uint64 Freehigh uint64 Unit uint32 - X_f [0]int8 - Pad_cgo_1 [4]byte + _ [0]int8 + _ [4]byte } type Utsname struct { @@ -636,26 +706,34 @@ type Utsname struct { } type Ustat_t struct { - Tfree int32 - Pad_cgo_0 [4]byte - Tinode uint64 - Fname [6]int8 - Fpack [6]int8 - Pad_cgo_1 [4]byte + Tfree int32 + Tinode uint64 + Fname [6]int8 + Fpack [6]int8 + _ [4]byte } type EpollEvent struct { - Events uint32 - X_padFd int32 - Fd int32 - Pad int32 + Events uint32 + _ int32 + Fd int32 + Pad int32 } const ( - AT_FDCWD = -0x64 - AT_REMOVEDIR = 0x200 + AT_EMPTY_PATH = 0x1000 + AT_FDCWD = -0x64 + AT_NO_AUTOMOUNT = 0x800 + AT_REMOVEDIR = 0x200 + + AT_STATX_SYNC_AS_STAT = 0x0 + AT_STATX_FORCE_SYNC = 0x2000 + AT_STATX_DONT_SYNC = 0x4000 + AT_SYMLINK_FOLLOW = 0x400 AT_SYMLINK_NOFOLLOW = 0x100 + + AT_EACCESS = 0x200 ) type PollFd struct { @@ -675,9 +753,13 @@ const ( ) type Sigset_t struct { - X__val [16]uint64 + Val [16]uint64 } +const RNDGETENTCNT = 0x40045200 + +const PERF_IOC_FLAG_GROUP = 0x1 + type Termios struct { Iflag uint32 Oflag uint32 @@ -688,3 +770,1212 @@ type Termios struct { Ispeed uint32 Ospeed uint32 } + +type Winsize struct { + Row uint16 + Col uint16 + Xpixel uint16 + Ypixel uint16 +} + +type Taskstats struct { + Version uint16 + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + _ [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type CGroupStats struct { + Sleeping uint64 + Running uint64 + Stopped uint64 + Uninterruptible uint64 + Io_wait uint64 +} + +const ( + CGROUPSTATS_CMD_UNSPEC = 0x3 + CGROUPSTATS_CMD_GET = 0x4 + CGROUPSTATS_CMD_NEW = 0x5 + CGROUPSTATS_TYPE_UNSPEC = 0x0 + CGROUPSTATS_TYPE_CGROUP_STATS = 0x1 + CGROUPSTATS_CMD_ATTR_UNSPEC = 0x0 + CGROUPSTATS_CMD_ATTR_FD = 0x1 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) + +type cpuMask uint64 + +const ( + _CPU_SETSIZE = 0x400 + _NCPUBITS = 0x40 +) + +const ( + BDADDR_BREDR = 0x0 + BDADDR_LE_PUBLIC = 0x1 + BDADDR_LE_RANDOM = 0x2 +) + +type PerfEventAttr struct { + Type uint32 + Size uint32 + Config uint64 + Sample uint64 + Sample_type uint64 + Read_format uint64 + Bits uint64 + Wakeup uint32 + Bp_type uint32 + Ext1 uint64 + Ext2 uint64 + Branch_sample_type uint64 + Sample_regs_user uint64 + Sample_stack_user uint32 + Clockid int32 + Sample_regs_intr uint64 + Aux_watermark uint32 + _ uint32 +} + +type PerfEventMmapPage struct { + Version uint32 + Compat_version uint32 + Lock uint32 + Index uint32 + Offset int64 + Time_enabled uint64 + Time_running uint64 + Capabilities uint64 + Pmc_width uint16 + Time_shift uint16 + Time_mult uint32 + Time_offset uint64 + Time_zero uint64 + Size uint32 + _ [948]uint8 + Data_head uint64 + Data_tail uint64 + Data_offset uint64 + Data_size uint64 + Aux_head uint64 + Aux_tail uint64 + Aux_offset uint64 + Aux_size uint64 +} + +const ( + PerfBitDisabled uint64 = CBitFieldMaskBit0 + PerfBitInherit = CBitFieldMaskBit1 + PerfBitPinned = CBitFieldMaskBit2 + PerfBitExclusive = CBitFieldMaskBit3 + PerfBitExcludeUser = CBitFieldMaskBit4 + PerfBitExcludeKernel = CBitFieldMaskBit5 + PerfBitExcludeHv = CBitFieldMaskBit6 + PerfBitExcludeIdle = CBitFieldMaskBit7 + PerfBitMmap = CBitFieldMaskBit8 + PerfBitComm = CBitFieldMaskBit9 + PerfBitFreq = CBitFieldMaskBit10 + PerfBitInheritStat = CBitFieldMaskBit11 + PerfBitEnableOnExec = CBitFieldMaskBit12 + PerfBitTask = CBitFieldMaskBit13 + PerfBitWatermark = CBitFieldMaskBit14 + PerfBitPreciseIPBit1 = CBitFieldMaskBit15 + PerfBitPreciseIPBit2 = CBitFieldMaskBit16 + PerfBitMmapData = CBitFieldMaskBit17 + PerfBitSampleIDAll = CBitFieldMaskBit18 + PerfBitExcludeHost = CBitFieldMaskBit19 + PerfBitExcludeGuest = CBitFieldMaskBit20 + PerfBitExcludeCallchainKernel = CBitFieldMaskBit21 + PerfBitExcludeCallchainUser = CBitFieldMaskBit22 + PerfBitMmap2 = CBitFieldMaskBit23 + PerfBitCommExec = CBitFieldMaskBit24 + PerfBitUseClockID = CBitFieldMaskBit25 + PerfBitContextSwitch = CBitFieldMaskBit26 +) + +const ( + PERF_TYPE_HARDWARE = 0x0 + PERF_TYPE_SOFTWARE = 0x1 + PERF_TYPE_TRACEPOINT = 0x2 + PERF_TYPE_HW_CACHE = 0x3 + PERF_TYPE_RAW = 0x4 + PERF_TYPE_BREAKPOINT = 0x5 + + PERF_COUNT_HW_CPU_CYCLES = 0x0 + PERF_COUNT_HW_INSTRUCTIONS = 0x1 + PERF_COUNT_HW_CACHE_REFERENCES = 0x2 + PERF_COUNT_HW_CACHE_MISSES = 0x3 + PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4 + PERF_COUNT_HW_BRANCH_MISSES = 0x5 + PERF_COUNT_HW_BUS_CYCLES = 0x6 + PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7 + PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8 + PERF_COUNT_HW_REF_CPU_CYCLES = 0x9 + + PERF_COUNT_HW_CACHE_L1D = 0x0 + PERF_COUNT_HW_CACHE_L1I = 0x1 + PERF_COUNT_HW_CACHE_LL = 0x2 + PERF_COUNT_HW_CACHE_DTLB = 0x3 + PERF_COUNT_HW_CACHE_ITLB = 0x4 + PERF_COUNT_HW_CACHE_BPU = 0x5 + PERF_COUNT_HW_CACHE_NODE = 0x6 + + PERF_COUNT_HW_CACHE_OP_READ = 0x0 + PERF_COUNT_HW_CACHE_OP_WRITE = 0x1 + PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2 + + PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0 + PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1 + + PERF_COUNT_SW_CPU_CLOCK = 0x0 + PERF_COUNT_SW_TASK_CLOCK = 0x1 + PERF_COUNT_SW_PAGE_FAULTS = 0x2 + PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3 + PERF_COUNT_SW_CPU_MIGRATIONS = 0x4 + PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5 + PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6 + PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7 + PERF_COUNT_SW_EMULATION_FAULTS = 0x8 + PERF_COUNT_SW_DUMMY = 0x9 + + PERF_SAMPLE_IP = 0x1 + PERF_SAMPLE_TID = 0x2 + PERF_SAMPLE_TIME = 0x4 + PERF_SAMPLE_ADDR = 0x8 + PERF_SAMPLE_READ = 0x10 + PERF_SAMPLE_CALLCHAIN = 0x20 + PERF_SAMPLE_ID = 0x40 + PERF_SAMPLE_CPU = 0x80 + PERF_SAMPLE_PERIOD = 0x100 + PERF_SAMPLE_STREAM_ID = 0x200 + PERF_SAMPLE_RAW = 0x400 + PERF_SAMPLE_BRANCH_STACK = 0x800 + + PERF_SAMPLE_BRANCH_USER = 0x1 + PERF_SAMPLE_BRANCH_KERNEL = 0x2 + PERF_SAMPLE_BRANCH_HV = 0x4 + PERF_SAMPLE_BRANCH_ANY = 0x8 + PERF_SAMPLE_BRANCH_ANY_CALL = 0x10 + PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20 + PERF_SAMPLE_BRANCH_IND_CALL = 0x40 + + PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1 + PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2 + PERF_FORMAT_ID = 0x4 + PERF_FORMAT_GROUP = 0x8 + + PERF_RECORD_MMAP = 0x1 + PERF_RECORD_LOST = 0x2 + PERF_RECORD_COMM = 0x3 + PERF_RECORD_EXIT = 0x4 + PERF_RECORD_THROTTLE = 0x5 + PERF_RECORD_UNTHROTTLE = 0x6 + PERF_RECORD_FORK = 0x7 + PERF_RECORD_READ = 0x8 + PERF_RECORD_SAMPLE = 0x9 + + PERF_CONTEXT_HV = -0x20 + PERF_CONTEXT_KERNEL = -0x80 + PERF_CONTEXT_USER = -0x200 + + PERF_CONTEXT_GUEST = -0x800 + PERF_CONTEXT_GUEST_KERNEL = -0x880 + PERF_CONTEXT_GUEST_USER = -0xa00 + + PERF_FLAG_FD_NO_GROUP = 0x1 + PERF_FLAG_FD_OUTPUT = 0x2 + PERF_FLAG_PID_CGROUP = 0x4 +) + +const ( + CBitFieldMaskBit0 = 0x8000000000000000 + CBitFieldMaskBit1 = 0x4000000000000000 + CBitFieldMaskBit2 = 0x2000000000000000 + CBitFieldMaskBit3 = 0x1000000000000000 + CBitFieldMaskBit4 = 0x800000000000000 + CBitFieldMaskBit5 = 0x400000000000000 + CBitFieldMaskBit6 = 0x200000000000000 + CBitFieldMaskBit7 = 0x100000000000000 + CBitFieldMaskBit8 = 0x80000000000000 + CBitFieldMaskBit9 = 0x40000000000000 + CBitFieldMaskBit10 = 0x20000000000000 + CBitFieldMaskBit11 = 0x10000000000000 + CBitFieldMaskBit12 = 0x8000000000000 + CBitFieldMaskBit13 = 0x4000000000000 + CBitFieldMaskBit14 = 0x2000000000000 + CBitFieldMaskBit15 = 0x1000000000000 + CBitFieldMaskBit16 = 0x800000000000 + CBitFieldMaskBit17 = 0x400000000000 + CBitFieldMaskBit18 = 0x200000000000 + CBitFieldMaskBit19 = 0x100000000000 + CBitFieldMaskBit20 = 0x80000000000 + CBitFieldMaskBit21 = 0x40000000000 + CBitFieldMaskBit22 = 0x20000000000 + CBitFieldMaskBit23 = 0x10000000000 + CBitFieldMaskBit24 = 0x8000000000 + CBitFieldMaskBit25 = 0x4000000000 + CBitFieldMaskBit26 = 0x2000000000 + CBitFieldMaskBit27 = 0x1000000000 + CBitFieldMaskBit28 = 0x800000000 + CBitFieldMaskBit29 = 0x400000000 + CBitFieldMaskBit30 = 0x200000000 + CBitFieldMaskBit31 = 0x100000000 + CBitFieldMaskBit32 = 0x80000000 + CBitFieldMaskBit33 = 0x40000000 + CBitFieldMaskBit34 = 0x20000000 + CBitFieldMaskBit35 = 0x10000000 + CBitFieldMaskBit36 = 0x8000000 + CBitFieldMaskBit37 = 0x4000000 + CBitFieldMaskBit38 = 0x2000000 + CBitFieldMaskBit39 = 0x1000000 + CBitFieldMaskBit40 = 0x800000 + CBitFieldMaskBit41 = 0x400000 + CBitFieldMaskBit42 = 0x200000 + CBitFieldMaskBit43 = 0x100000 + CBitFieldMaskBit44 = 0x80000 + CBitFieldMaskBit45 = 0x40000 + CBitFieldMaskBit46 = 0x20000 + CBitFieldMaskBit47 = 0x10000 + CBitFieldMaskBit48 = 0x8000 + CBitFieldMaskBit49 = 0x4000 + CBitFieldMaskBit50 = 0x2000 + CBitFieldMaskBit51 = 0x1000 + CBitFieldMaskBit52 = 0x800 + CBitFieldMaskBit53 = 0x400 + CBitFieldMaskBit54 = 0x200 + CBitFieldMaskBit55 = 0x100 + CBitFieldMaskBit56 = 0x80 + CBitFieldMaskBit57 = 0x40 + CBitFieldMaskBit58 = 0x20 + CBitFieldMaskBit59 = 0x10 + CBitFieldMaskBit60 = 0x8 + CBitFieldMaskBit61 = 0x4 + CBitFieldMaskBit62 = 0x2 + CBitFieldMaskBit63 = 0x1 +) + +type SockaddrStorage struct { + Family uint16 + _ [118]int8 + _ uint64 +} + +type TCPMD5Sig struct { + Addr SockaddrStorage + Flags uint8 + Prefixlen uint8 + Keylen uint16 + _ uint32 + Key [80]uint8 +} + +type HDDriveCmdHdr struct { + Command uint8 + Number uint8 + Feature uint8 + Count uint8 +} + +type HDGeometry struct { + Heads uint8 + Sectors uint8 + Cylinders uint16 + Start uint64 +} + +type HDDriveID struct { + Config uint16 + Cyls uint16 + Reserved2 uint16 + Heads uint16 + Track_bytes uint16 + Sector_bytes uint16 + Sectors uint16 + Vendor0 uint16 + Vendor1 uint16 + Vendor2 uint16 + Serial_no [20]uint8 + Buf_type uint16 + Buf_size uint16 + Ecc_bytes uint16 + Fw_rev [8]uint8 + Model [40]uint8 + Max_multsect uint8 + Vendor3 uint8 + Dword_io uint16 + Vendor4 uint8 + Capability uint8 + Reserved50 uint16 + Vendor5 uint8 + TPIO uint8 + Vendor6 uint8 + TDMA uint8 + Field_valid uint16 + Cur_cyls uint16 + Cur_heads uint16 + Cur_sectors uint16 + Cur_capacity0 uint16 + Cur_capacity1 uint16 + Multsect uint8 + Multsect_valid uint8 + Lba_capacity uint32 + Dma_1word uint16 + Dma_mword uint16 + Eide_pio_modes uint16 + Eide_dma_min uint16 + Eide_dma_time uint16 + Eide_pio uint16 + Eide_pio_iordy uint16 + Words69_70 [2]uint16 + Words71_74 [4]uint16 + Queue_depth uint16 + Words76_79 [4]uint16 + Major_rev_num uint16 + Minor_rev_num uint16 + Command_set_1 uint16 + Command_set_2 uint16 + Cfsse uint16 + Cfs_enable_1 uint16 + Cfs_enable_2 uint16 + Csf_default uint16 + Dma_ultra uint16 + Trseuc uint16 + TrsEuc uint16 + CurAPMvalues uint16 + Mprc uint16 + Hw_config uint16 + Acoustic uint16 + Msrqs uint16 + Sxfert uint16 + Sal uint16 + Spg uint32 + Lba_capacity_2 uint64 + Words104_125 [22]uint16 + Last_lun uint16 + Word127 uint16 + Dlf uint16 + Csfo uint16 + Words130_155 [26]uint16 + Word156 uint16 + Words157_159 [3]uint16 + Cfa_power uint16 + Words161_175 [15]uint16 + Words176_205 [30]uint16 + Words206_254 [49]uint16 + Integrity_word uint16 +} + +type Statfs_t struct { + Type int64 + Bsize int64 + Blocks uint64 + Bfree uint64 + Bavail uint64 + Files uint64 + Ffree uint64 + Fsid Fsid + Namelen int64 + Frsize int64 + Flags int64 + Spare [4]int64 +} + +const ( + ST_MANDLOCK = 0x40 + ST_NOATIME = 0x400 + ST_NODEV = 0x4 + ST_NODIRATIME = 0x800 + ST_NOEXEC = 0x8 + ST_NOSUID = 0x2 + ST_RDONLY = 0x1 + ST_RELATIME = 0x1000 + ST_SYNCHRONOUS = 0x10 +) + +type TpacketHdr struct { + Status uint64 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Sec uint32 + Usec uint32 + _ [4]byte +} + +type Tpacket2Hdr struct { + Status uint32 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Sec uint32 + Nsec uint32 + Vlan_tci uint16 + Vlan_tpid uint16 + _ [4]uint8 +} + +type Tpacket3Hdr struct { + Next_offset uint32 + Sec uint32 + Nsec uint32 + Snaplen uint32 + Len uint32 + Status uint32 + Mac uint16 + Net uint16 + Hv1 TpacketHdrVariant1 + _ [8]uint8 +} + +type TpacketHdrVariant1 struct { + Rxhash uint32 + Vlan_tci uint32 + Vlan_tpid uint16 + _ uint16 +} + +type TpacketBlockDesc struct { + Version uint32 + To_priv uint32 + Hdr [40]byte +} + +type TpacketReq struct { + Block_size uint32 + Block_nr uint32 + Frame_size uint32 + Frame_nr uint32 +} + +type TpacketReq3 struct { + Block_size uint32 + Block_nr uint32 + Frame_size uint32 + Frame_nr uint32 + Retire_blk_tov uint32 + Sizeof_priv uint32 + Feature_req_word uint32 +} + +type TpacketStats struct { + Packets uint32 + Drops uint32 +} + +type TpacketStatsV3 struct { + Packets uint32 + Drops uint32 + Freeze_q_cnt uint32 +} + +type TpacketAuxdata struct { + Status uint32 + Len uint32 + Snaplen uint32 + Mac uint16 + Net uint16 + Vlan_tci uint16 + Vlan_tpid uint16 +} + +const ( + TPACKET_V1 = 0x0 + TPACKET_V2 = 0x1 + TPACKET_V3 = 0x2 +) + +const ( + SizeofTpacketHdr = 0x20 + SizeofTpacket2Hdr = 0x20 + SizeofTpacket3Hdr = 0x30 +) + +const ( + NF_INET_PRE_ROUTING = 0x0 + NF_INET_LOCAL_IN = 0x1 + NF_INET_FORWARD = 0x2 + NF_INET_LOCAL_OUT = 0x3 + NF_INET_POST_ROUTING = 0x4 + NF_INET_NUMHOOKS = 0x5 +) + +const ( + NF_NETDEV_INGRESS = 0x0 + NF_NETDEV_NUMHOOKS = 0x1 +) + +const ( + NFPROTO_UNSPEC = 0x0 + NFPROTO_INET = 0x1 + NFPROTO_IPV4 = 0x2 + NFPROTO_ARP = 0x3 + NFPROTO_NETDEV = 0x5 + NFPROTO_BRIDGE = 0x7 + NFPROTO_IPV6 = 0xa + NFPROTO_DECNET = 0xc + NFPROTO_NUMPROTO = 0xd +) + +type Nfgenmsg struct { + Nfgen_family uint8 + Version uint8 + Res_id uint16 +} + +const ( + NFNL_BATCH_UNSPEC = 0x0 + NFNL_BATCH_GENID = 0x1 +) + +const ( + NFT_REG_VERDICT = 0x0 + NFT_REG_1 = 0x1 + NFT_REG_2 = 0x2 + NFT_REG_3 = 0x3 + NFT_REG_4 = 0x4 + NFT_REG32_00 = 0x8 + NFT_REG32_01 = 0x9 + NFT_REG32_02 = 0xa + NFT_REG32_03 = 0xb + NFT_REG32_04 = 0xc + NFT_REG32_05 = 0xd + NFT_REG32_06 = 0xe + NFT_REG32_07 = 0xf + NFT_REG32_08 = 0x10 + NFT_REG32_09 = 0x11 + NFT_REG32_10 = 0x12 + NFT_REG32_11 = 0x13 + NFT_REG32_12 = 0x14 + NFT_REG32_13 = 0x15 + NFT_REG32_14 = 0x16 + NFT_REG32_15 = 0x17 + NFT_CONTINUE = -0x1 + NFT_BREAK = -0x2 + NFT_JUMP = -0x3 + NFT_GOTO = -0x4 + NFT_RETURN = -0x5 + NFT_MSG_NEWTABLE = 0x0 + NFT_MSG_GETTABLE = 0x1 + NFT_MSG_DELTABLE = 0x2 + NFT_MSG_NEWCHAIN = 0x3 + NFT_MSG_GETCHAIN = 0x4 + NFT_MSG_DELCHAIN = 0x5 + NFT_MSG_NEWRULE = 0x6 + NFT_MSG_GETRULE = 0x7 + NFT_MSG_DELRULE = 0x8 + NFT_MSG_NEWSET = 0x9 + NFT_MSG_GETSET = 0xa + NFT_MSG_DELSET = 0xb + NFT_MSG_NEWSETELEM = 0xc + NFT_MSG_GETSETELEM = 0xd + NFT_MSG_DELSETELEM = 0xe + NFT_MSG_NEWGEN = 0xf + NFT_MSG_GETGEN = 0x10 + NFT_MSG_TRACE = 0x11 + NFT_MSG_NEWOBJ = 0x12 + NFT_MSG_GETOBJ = 0x13 + NFT_MSG_DELOBJ = 0x14 + NFT_MSG_GETOBJ_RESET = 0x15 + NFT_MSG_MAX = 0x19 + NFTA_LIST_UNPEC = 0x0 + NFTA_LIST_ELEM = 0x1 + NFTA_HOOK_UNSPEC = 0x0 + NFTA_HOOK_HOOKNUM = 0x1 + NFTA_HOOK_PRIORITY = 0x2 + NFTA_HOOK_DEV = 0x3 + NFT_TABLE_F_DORMANT = 0x1 + NFTA_TABLE_UNSPEC = 0x0 + NFTA_TABLE_NAME = 0x1 + NFTA_TABLE_FLAGS = 0x2 + NFTA_TABLE_USE = 0x3 + NFTA_CHAIN_UNSPEC = 0x0 + NFTA_CHAIN_TABLE = 0x1 + NFTA_CHAIN_HANDLE = 0x2 + NFTA_CHAIN_NAME = 0x3 + NFTA_CHAIN_HOOK = 0x4 + NFTA_CHAIN_POLICY = 0x5 + NFTA_CHAIN_USE = 0x6 + NFTA_CHAIN_TYPE = 0x7 + NFTA_CHAIN_COUNTERS = 0x8 + NFTA_CHAIN_PAD = 0x9 + NFTA_RULE_UNSPEC = 0x0 + NFTA_RULE_TABLE = 0x1 + NFTA_RULE_CHAIN = 0x2 + NFTA_RULE_HANDLE = 0x3 + NFTA_RULE_EXPRESSIONS = 0x4 + NFTA_RULE_COMPAT = 0x5 + NFTA_RULE_POSITION = 0x6 + NFTA_RULE_USERDATA = 0x7 + NFTA_RULE_PAD = 0x8 + NFTA_RULE_ID = 0x9 + NFT_RULE_COMPAT_F_INV = 0x2 + NFT_RULE_COMPAT_F_MASK = 0x2 + NFTA_RULE_COMPAT_UNSPEC = 0x0 + NFTA_RULE_COMPAT_PROTO = 0x1 + NFTA_RULE_COMPAT_FLAGS = 0x2 + NFT_SET_ANONYMOUS = 0x1 + NFT_SET_CONSTANT = 0x2 + NFT_SET_INTERVAL = 0x4 + NFT_SET_MAP = 0x8 + NFT_SET_TIMEOUT = 0x10 + NFT_SET_EVAL = 0x20 + NFT_SET_OBJECT = 0x40 + NFT_SET_POL_PERFORMANCE = 0x0 + NFT_SET_POL_MEMORY = 0x1 + NFTA_SET_DESC_UNSPEC = 0x0 + NFTA_SET_DESC_SIZE = 0x1 + NFTA_SET_UNSPEC = 0x0 + NFTA_SET_TABLE = 0x1 + NFTA_SET_NAME = 0x2 + NFTA_SET_FLAGS = 0x3 + NFTA_SET_KEY_TYPE = 0x4 + NFTA_SET_KEY_LEN = 0x5 + NFTA_SET_DATA_TYPE = 0x6 + NFTA_SET_DATA_LEN = 0x7 + NFTA_SET_POLICY = 0x8 + NFTA_SET_DESC = 0x9 + NFTA_SET_ID = 0xa + NFTA_SET_TIMEOUT = 0xb + NFTA_SET_GC_INTERVAL = 0xc + NFTA_SET_USERDATA = 0xd + NFTA_SET_PAD = 0xe + NFTA_SET_OBJ_TYPE = 0xf + NFT_SET_ELEM_INTERVAL_END = 0x1 + NFTA_SET_ELEM_UNSPEC = 0x0 + NFTA_SET_ELEM_KEY = 0x1 + NFTA_SET_ELEM_DATA = 0x2 + NFTA_SET_ELEM_FLAGS = 0x3 + NFTA_SET_ELEM_TIMEOUT = 0x4 + NFTA_SET_ELEM_EXPIRATION = 0x5 + NFTA_SET_ELEM_USERDATA = 0x6 + NFTA_SET_ELEM_EXPR = 0x7 + NFTA_SET_ELEM_PAD = 0x8 + NFTA_SET_ELEM_OBJREF = 0x9 + NFTA_SET_ELEM_LIST_UNSPEC = 0x0 + NFTA_SET_ELEM_LIST_TABLE = 0x1 + NFTA_SET_ELEM_LIST_SET = 0x2 + NFTA_SET_ELEM_LIST_ELEMENTS = 0x3 + NFTA_SET_ELEM_LIST_SET_ID = 0x4 + NFT_DATA_VALUE = 0x0 + NFT_DATA_VERDICT = 0xffffff00 + NFTA_DATA_UNSPEC = 0x0 + NFTA_DATA_VALUE = 0x1 + NFTA_DATA_VERDICT = 0x2 + NFTA_VERDICT_UNSPEC = 0x0 + NFTA_VERDICT_CODE = 0x1 + NFTA_VERDICT_CHAIN = 0x2 + NFTA_EXPR_UNSPEC = 0x0 + NFTA_EXPR_NAME = 0x1 + NFTA_EXPR_DATA = 0x2 + NFTA_IMMEDIATE_UNSPEC = 0x0 + NFTA_IMMEDIATE_DREG = 0x1 + NFTA_IMMEDIATE_DATA = 0x2 + NFTA_BITWISE_UNSPEC = 0x0 + NFTA_BITWISE_SREG = 0x1 + NFTA_BITWISE_DREG = 0x2 + NFTA_BITWISE_LEN = 0x3 + NFTA_BITWISE_MASK = 0x4 + NFTA_BITWISE_XOR = 0x5 + NFT_BYTEORDER_NTOH = 0x0 + NFT_BYTEORDER_HTON = 0x1 + NFTA_BYTEORDER_UNSPEC = 0x0 + NFTA_BYTEORDER_SREG = 0x1 + NFTA_BYTEORDER_DREG = 0x2 + NFTA_BYTEORDER_OP = 0x3 + NFTA_BYTEORDER_LEN = 0x4 + NFTA_BYTEORDER_SIZE = 0x5 + NFT_CMP_EQ = 0x0 + NFT_CMP_NEQ = 0x1 + NFT_CMP_LT = 0x2 + NFT_CMP_LTE = 0x3 + NFT_CMP_GT = 0x4 + NFT_CMP_GTE = 0x5 + NFTA_CMP_UNSPEC = 0x0 + NFTA_CMP_SREG = 0x1 + NFTA_CMP_OP = 0x2 + NFTA_CMP_DATA = 0x3 + NFT_RANGE_EQ = 0x0 + NFT_RANGE_NEQ = 0x1 + NFTA_RANGE_UNSPEC = 0x0 + NFTA_RANGE_SREG = 0x1 + NFTA_RANGE_OP = 0x2 + NFTA_RANGE_FROM_DATA = 0x3 + NFTA_RANGE_TO_DATA = 0x4 + NFT_LOOKUP_F_INV = 0x1 + NFTA_LOOKUP_UNSPEC = 0x0 + NFTA_LOOKUP_SET = 0x1 + NFTA_LOOKUP_SREG = 0x2 + NFTA_LOOKUP_DREG = 0x3 + NFTA_LOOKUP_SET_ID = 0x4 + NFTA_LOOKUP_FLAGS = 0x5 + NFT_DYNSET_OP_ADD = 0x0 + NFT_DYNSET_OP_UPDATE = 0x1 + NFT_DYNSET_F_INV = 0x1 + NFTA_DYNSET_UNSPEC = 0x0 + NFTA_DYNSET_SET_NAME = 0x1 + NFTA_DYNSET_SET_ID = 0x2 + NFTA_DYNSET_OP = 0x3 + NFTA_DYNSET_SREG_KEY = 0x4 + NFTA_DYNSET_SREG_DATA = 0x5 + NFTA_DYNSET_TIMEOUT = 0x6 + NFTA_DYNSET_EXPR = 0x7 + NFTA_DYNSET_PAD = 0x8 + NFTA_DYNSET_FLAGS = 0x9 + NFT_PAYLOAD_LL_HEADER = 0x0 + NFT_PAYLOAD_NETWORK_HEADER = 0x1 + NFT_PAYLOAD_TRANSPORT_HEADER = 0x2 + NFT_PAYLOAD_CSUM_NONE = 0x0 + NFT_PAYLOAD_CSUM_INET = 0x1 + NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1 + NFTA_PAYLOAD_UNSPEC = 0x0 + NFTA_PAYLOAD_DREG = 0x1 + NFTA_PAYLOAD_BASE = 0x2 + NFTA_PAYLOAD_OFFSET = 0x3 + NFTA_PAYLOAD_LEN = 0x4 + NFTA_PAYLOAD_SREG = 0x5 + NFTA_PAYLOAD_CSUM_TYPE = 0x6 + NFTA_PAYLOAD_CSUM_OFFSET = 0x7 + NFTA_PAYLOAD_CSUM_FLAGS = 0x8 + NFT_EXTHDR_F_PRESENT = 0x1 + NFT_EXTHDR_OP_IPV6 = 0x0 + NFT_EXTHDR_OP_TCPOPT = 0x1 + NFTA_EXTHDR_UNSPEC = 0x0 + NFTA_EXTHDR_DREG = 0x1 + NFTA_EXTHDR_TYPE = 0x2 + NFTA_EXTHDR_OFFSET = 0x3 + NFTA_EXTHDR_LEN = 0x4 + NFTA_EXTHDR_FLAGS = 0x5 + NFTA_EXTHDR_OP = 0x6 + NFTA_EXTHDR_SREG = 0x7 + NFT_META_LEN = 0x0 + NFT_META_PROTOCOL = 0x1 + NFT_META_PRIORITY = 0x2 + NFT_META_MARK = 0x3 + NFT_META_IIF = 0x4 + NFT_META_OIF = 0x5 + NFT_META_IIFNAME = 0x6 + NFT_META_OIFNAME = 0x7 + NFT_META_IIFTYPE = 0x8 + NFT_META_OIFTYPE = 0x9 + NFT_META_SKUID = 0xa + NFT_META_SKGID = 0xb + NFT_META_NFTRACE = 0xc + NFT_META_RTCLASSID = 0xd + NFT_META_SECMARK = 0xe + NFT_META_NFPROTO = 0xf + NFT_META_L4PROTO = 0x10 + NFT_META_BRI_IIFNAME = 0x11 + NFT_META_BRI_OIFNAME = 0x12 + NFT_META_PKTTYPE = 0x13 + NFT_META_CPU = 0x14 + NFT_META_IIFGROUP = 0x15 + NFT_META_OIFGROUP = 0x16 + NFT_META_CGROUP = 0x17 + NFT_META_PRANDOM = 0x18 + NFT_RT_CLASSID = 0x0 + NFT_RT_NEXTHOP4 = 0x1 + NFT_RT_NEXTHOP6 = 0x2 + NFT_RT_TCPMSS = 0x3 + NFT_HASH_JENKINS = 0x0 + NFT_HASH_SYM = 0x1 + NFTA_HASH_UNSPEC = 0x0 + NFTA_HASH_SREG = 0x1 + NFTA_HASH_DREG = 0x2 + NFTA_HASH_LEN = 0x3 + NFTA_HASH_MODULUS = 0x4 + NFTA_HASH_SEED = 0x5 + NFTA_HASH_OFFSET = 0x6 + NFTA_HASH_TYPE = 0x7 + NFTA_META_UNSPEC = 0x0 + NFTA_META_DREG = 0x1 + NFTA_META_KEY = 0x2 + NFTA_META_SREG = 0x3 + NFTA_RT_UNSPEC = 0x0 + NFTA_RT_DREG = 0x1 + NFTA_RT_KEY = 0x2 + NFT_CT_STATE = 0x0 + NFT_CT_DIRECTION = 0x1 + NFT_CT_STATUS = 0x2 + NFT_CT_MARK = 0x3 + NFT_CT_SECMARK = 0x4 + NFT_CT_EXPIRATION = 0x5 + NFT_CT_HELPER = 0x6 + NFT_CT_L3PROTOCOL = 0x7 + NFT_CT_SRC = 0x8 + NFT_CT_DST = 0x9 + NFT_CT_PROTOCOL = 0xa + NFT_CT_PROTO_SRC = 0xb + NFT_CT_PROTO_DST = 0xc + NFT_CT_LABELS = 0xd + NFT_CT_PKTS = 0xe + NFT_CT_BYTES = 0xf + NFT_CT_AVGPKT = 0x10 + NFT_CT_ZONE = 0x11 + NFT_CT_EVENTMASK = 0x12 + NFTA_CT_UNSPEC = 0x0 + NFTA_CT_DREG = 0x1 + NFTA_CT_KEY = 0x2 + NFTA_CT_DIRECTION = 0x3 + NFTA_CT_SREG = 0x4 + NFT_LIMIT_PKTS = 0x0 + NFT_LIMIT_PKT_BYTES = 0x1 + NFT_LIMIT_F_INV = 0x1 + NFTA_LIMIT_UNSPEC = 0x0 + NFTA_LIMIT_RATE = 0x1 + NFTA_LIMIT_UNIT = 0x2 + NFTA_LIMIT_BURST = 0x3 + NFTA_LIMIT_TYPE = 0x4 + NFTA_LIMIT_FLAGS = 0x5 + NFTA_LIMIT_PAD = 0x6 + NFTA_COUNTER_UNSPEC = 0x0 + NFTA_COUNTER_BYTES = 0x1 + NFTA_COUNTER_PACKETS = 0x2 + NFTA_COUNTER_PAD = 0x3 + NFTA_LOG_UNSPEC = 0x0 + NFTA_LOG_GROUP = 0x1 + NFTA_LOG_PREFIX = 0x2 + NFTA_LOG_SNAPLEN = 0x3 + NFTA_LOG_QTHRESHOLD = 0x4 + NFTA_LOG_LEVEL = 0x5 + NFTA_LOG_FLAGS = 0x6 + NFTA_QUEUE_UNSPEC = 0x0 + NFTA_QUEUE_NUM = 0x1 + NFTA_QUEUE_TOTAL = 0x2 + NFTA_QUEUE_FLAGS = 0x3 + NFTA_QUEUE_SREG_QNUM = 0x4 + NFT_QUOTA_F_INV = 0x1 + NFT_QUOTA_F_DEPLETED = 0x2 + NFTA_QUOTA_UNSPEC = 0x0 + NFTA_QUOTA_BYTES = 0x1 + NFTA_QUOTA_FLAGS = 0x2 + NFTA_QUOTA_PAD = 0x3 + NFTA_QUOTA_CONSUMED = 0x4 + NFT_REJECT_ICMP_UNREACH = 0x0 + NFT_REJECT_TCP_RST = 0x1 + NFT_REJECT_ICMPX_UNREACH = 0x2 + NFT_REJECT_ICMPX_NO_ROUTE = 0x0 + NFT_REJECT_ICMPX_PORT_UNREACH = 0x1 + NFT_REJECT_ICMPX_HOST_UNREACH = 0x2 + NFT_REJECT_ICMPX_ADMIN_PROHIBITED = 0x3 + NFTA_REJECT_UNSPEC = 0x0 + NFTA_REJECT_TYPE = 0x1 + NFTA_REJECT_ICMP_CODE = 0x2 + NFT_NAT_SNAT = 0x0 + NFT_NAT_DNAT = 0x1 + NFTA_NAT_UNSPEC = 0x0 + NFTA_NAT_TYPE = 0x1 + NFTA_NAT_FAMILY = 0x2 + NFTA_NAT_REG_ADDR_MIN = 0x3 + NFTA_NAT_REG_ADDR_MAX = 0x4 + NFTA_NAT_REG_PROTO_MIN = 0x5 + NFTA_NAT_REG_PROTO_MAX = 0x6 + NFTA_NAT_FLAGS = 0x7 + NFTA_MASQ_UNSPEC = 0x0 + NFTA_MASQ_FLAGS = 0x1 + NFTA_MASQ_REG_PROTO_MIN = 0x2 + NFTA_MASQ_REG_PROTO_MAX = 0x3 + NFTA_REDIR_UNSPEC = 0x0 + NFTA_REDIR_REG_PROTO_MIN = 0x1 + NFTA_REDIR_REG_PROTO_MAX = 0x2 + NFTA_REDIR_FLAGS = 0x3 + NFTA_DUP_UNSPEC = 0x0 + NFTA_DUP_SREG_ADDR = 0x1 + NFTA_DUP_SREG_DEV = 0x2 + NFTA_FWD_UNSPEC = 0x0 + NFTA_FWD_SREG_DEV = 0x1 + NFTA_OBJREF_UNSPEC = 0x0 + NFTA_OBJREF_IMM_TYPE = 0x1 + NFTA_OBJREF_IMM_NAME = 0x2 + NFTA_OBJREF_SET_SREG = 0x3 + NFTA_OBJREF_SET_NAME = 0x4 + NFTA_OBJREF_SET_ID = 0x5 + NFTA_GEN_UNSPEC = 0x0 + NFTA_GEN_ID = 0x1 + NFTA_GEN_PROC_PID = 0x2 + NFTA_GEN_PROC_NAME = 0x3 + NFTA_FIB_UNSPEC = 0x0 + NFTA_FIB_DREG = 0x1 + NFTA_FIB_RESULT = 0x2 + NFTA_FIB_FLAGS = 0x3 + NFT_FIB_RESULT_UNSPEC = 0x0 + NFT_FIB_RESULT_OIF = 0x1 + NFT_FIB_RESULT_OIFNAME = 0x2 + NFT_FIB_RESULT_ADDRTYPE = 0x3 + NFTA_FIB_F_SADDR = 0x1 + NFTA_FIB_F_DADDR = 0x2 + NFTA_FIB_F_MARK = 0x4 + NFTA_FIB_F_IIF = 0x8 + NFTA_FIB_F_OIF = 0x10 + NFTA_FIB_F_PRESENT = 0x20 + NFTA_CT_HELPER_UNSPEC = 0x0 + NFTA_CT_HELPER_NAME = 0x1 + NFTA_CT_HELPER_L3PROTO = 0x2 + NFTA_CT_HELPER_L4PROTO = 0x3 + NFTA_OBJ_UNSPEC = 0x0 + NFTA_OBJ_TABLE = 0x1 + NFTA_OBJ_NAME = 0x2 + NFTA_OBJ_TYPE = 0x3 + NFTA_OBJ_DATA = 0x4 + NFTA_OBJ_USE = 0x5 + NFTA_TRACE_UNSPEC = 0x0 + NFTA_TRACE_TABLE = 0x1 + NFTA_TRACE_CHAIN = 0x2 + NFTA_TRACE_RULE_HANDLE = 0x3 + NFTA_TRACE_TYPE = 0x4 + NFTA_TRACE_VERDICT = 0x5 + NFTA_TRACE_ID = 0x6 + NFTA_TRACE_LL_HEADER = 0x7 + NFTA_TRACE_NETWORK_HEADER = 0x8 + NFTA_TRACE_TRANSPORT_HEADER = 0x9 + NFTA_TRACE_IIF = 0xa + NFTA_TRACE_IIFTYPE = 0xb + NFTA_TRACE_OIF = 0xc + NFTA_TRACE_OIFTYPE = 0xd + NFTA_TRACE_MARK = 0xe + NFTA_TRACE_NFPROTO = 0xf + NFTA_TRACE_POLICY = 0x10 + NFTA_TRACE_PAD = 0x11 + NFT_TRACETYPE_UNSPEC = 0x0 + NFT_TRACETYPE_POLICY = 0x1 + NFT_TRACETYPE_RETURN = 0x2 + NFT_TRACETYPE_RULE = 0x3 + NFTA_NG_UNSPEC = 0x0 + NFTA_NG_DREG = 0x1 + NFTA_NG_MODULUS = 0x2 + NFTA_NG_TYPE = 0x3 + NFTA_NG_OFFSET = 0x4 + NFT_NG_INCREMENTAL = 0x0 + NFT_NG_RANDOM = 0x1 +) + +type RTCTime struct { + Sec int32 + Min int32 + Hour int32 + Mday int32 + Mon int32 + Year int32 + Wday int32 + Yday int32 + Isdst int32 +} + +type RTCWkAlrm struct { + Enabled uint8 + Pending uint8 + Time RTCTime +} + +type RTCPLLInfo struct { + Ctrl int32 + Value int32 + Max int32 + Min int32 + Posmult int32 + Negmult int32 + Clock int64 +} + +type BlkpgIoctlArg struct { + Op int32 + Flags int32 + Datalen int32 + Data *byte +} + +type BlkpgPartition struct { + Start int64 + Length int64 + Pno int32 + Devname [64]uint8 + Volname [64]uint8 + _ [4]byte +} + +const ( + BLKPG = 0x20001269 + BLKPG_ADD_PARTITION = 0x1 + BLKPG_DEL_PARTITION = 0x2 + BLKPG_RESIZE_PARTITION = 0x3 +) + +const ( + NETNSA_NONE = 0x0 + NETNSA_NSID = 0x1 + NETNSA_PID = 0x2 + NETNSA_FD = 0x3 +) + +type XDPRingOffset struct { + Producer uint64 + Consumer uint64 + Desc uint64 +} + +type XDPMmapOffsets struct { + Rx XDPRingOffset + Tx XDPRingOffset + Fr XDPRingOffset + Cr XDPRingOffset +} + +type XDPUmemReg struct { + Addr uint64 + Len uint64 + Size uint32 + Headroom uint32 +} + +type XDPStatistics struct { + Rx_dropped uint64 + Rx_invalid_descs uint64 + Tx_invalid_descs uint64 +} + +type XDPDesc struct { + Addr uint64 + Len uint32 + Options uint32 +} + +const ( + NCSI_CMD_UNSPEC = 0x0 + NCSI_CMD_PKG_INFO = 0x1 + NCSI_CMD_SET_INTERFACE = 0x2 + NCSI_CMD_CLEAR_INTERFACE = 0x3 + NCSI_ATTR_UNSPEC = 0x0 + NCSI_ATTR_IFINDEX = 0x1 + NCSI_ATTR_PACKAGE_LIST = 0x2 + NCSI_ATTR_PACKAGE_ID = 0x3 + NCSI_ATTR_CHANNEL_ID = 0x4 + NCSI_PKG_ATTR_UNSPEC = 0x0 + NCSI_PKG_ATTR = 0x1 + NCSI_PKG_ATTR_ID = 0x2 + NCSI_PKG_ATTR_FORCED = 0x3 + NCSI_PKG_ATTR_CHANNEL_LIST = 0x4 + NCSI_CHANNEL_ATTR_UNSPEC = 0x0 + NCSI_CHANNEL_ATTR = 0x1 + NCSI_CHANNEL_ATTR_ID = 0x2 + NCSI_CHANNEL_ATTR_VERSION_MAJOR = 0x3 + NCSI_CHANNEL_ATTR_VERSION_MINOR = 0x4 + NCSI_CHANNEL_ATTR_VERSION_STR = 0x5 + NCSI_CHANNEL_ATTR_LINK_STATE = 0x6 + NCSI_CHANNEL_ATTR_ACTIVE = 0x7 + NCSI_CHANNEL_ATTR_FORCED = 0x8 + NCSI_CHANNEL_ATTR_VLAN_LIST = 0x9 + NCSI_CHANNEL_ATTR_VLAN_ID = 0xa +) + +const ( + SOF_TIMESTAMPING_TX_HARDWARE = 0x1 + SOF_TIMESTAMPING_TX_SOFTWARE = 0x2 + SOF_TIMESTAMPING_RX_HARDWARE = 0x4 + SOF_TIMESTAMPING_RX_SOFTWARE = 0x8 + SOF_TIMESTAMPING_SOFTWARE = 0x10 + SOF_TIMESTAMPING_SYS_HARDWARE = 0x20 + SOF_TIMESTAMPING_RAW_HARDWARE = 0x40 + SOF_TIMESTAMPING_OPT_ID = 0x80 + SOF_TIMESTAMPING_TX_SCHED = 0x100 + SOF_TIMESTAMPING_TX_ACK = 0x200 + SOF_TIMESTAMPING_OPT_CMSG = 0x400 + SOF_TIMESTAMPING_OPT_TSONLY = 0x800 + SOF_TIMESTAMPING_OPT_STATS = 0x1000 + SOF_TIMESTAMPING_OPT_PKTINFO = 0x2000 + SOF_TIMESTAMPING_OPT_TX_SWHW = 0x4000 + + SOF_TIMESTAMPING_LAST = 0x4000 + SOF_TIMESTAMPING_MASK = 0x7fff +) diff --git a/src/cmd/vendor/vendor.json b/src/cmd/vendor/vendor.json index b44f022457098..73ce409ad60e6 100644 --- a/src/cmd/vendor/vendor.json +++ b/src/cmd/vendor/vendor.json @@ -131,10 +131,10 @@ "revisionTime": "2018-05-24T11:38:20Z" }, { - "checksumSHA1": "rx5/IrpHIVwz6KnAeqbTGHZe040=", + "checksumSHA1": "+vkAlXiYlfl8nFtxVtUiwoykPo8=", "path": "golang.org/x/sys/unix", - "revision": "4d1cda033e0619309c606fc686de3adcf599539e", - "revisionTime": "2018-12-13T07:38:38Z" + "revision": "b4a75ba826a64a70990f11a225237acd6ef35c9f", + "revisionTime": "2018-12-21T10:19:52Z" }, { "checksumSHA1": "WoSat9PbqZFXREek5bkUBr256/Q=", From bfaf11c158b5ccd7db3c43727357b8b1071d7fde Mon Sep 17 00:00:00 2001 From: Will Beason Date: Wed, 26 Dec 2018 01:17:47 +0000 Subject: [PATCH 432/594] math/big: fix incorrect comment variable reference Fix comment as w&1 is the parity of 'x', not of 'n'. Change-Id: Ia0e448f7e5896412ff9b164459ce15561ab624cc GitHub-Last-Rev: 54ba08ab1055b5e6e506fc8ac06c2920ff095b6e GitHub-Pull-Request: golang/go#29419 Reviewed-on: https://go-review.googlesource.com/c/155743 Reviewed-by: Robert Griesemer --- src/math/big/prime.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math/big/prime.go b/src/math/big/prime.go index 4c2c152f65e56..d9a5f1ec96838 100644 --- a/src/math/big/prime.go +++ b/src/math/big/prime.go @@ -51,7 +51,7 @@ func (x *Int) ProbablyPrime(n int) bool { } if w&1 == 0 { - return false // n is even + return false // x is even } const primesA = 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 * 37 From 6a64efc25004175e198e75191e215a7b1a08a2fa Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Tue, 25 Dec 2018 19:36:25 -0500 Subject: [PATCH 433/594] cmd/compile: fix MIPS SGTconst-with-shift rules (SGTconst [c] (SRLconst _ [d])) && 0 <= int32(c) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= int32(c) -> (MOVWconst [1]) This rule is problematic. 1<<(32-uint32(d)) <= int32(c) meant to say that it is true if c is greater than the largest possible value of the right shift. But when d==1, 1<<(32-1) is negative and results in the wrong comparison. Rewrite the rules in a more direct way. Fixes #29402. Change-Id: I5940fc9538d9bc3a4bcae8aa34672867540dc60e Reviewed-on: https://go-review.googlesource.com/c/155798 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/gen/MIPS.rules | 4 ++-- src/cmd/compile/internal/ssa/gen/MIPS64.rules | 4 ++-- src/cmd/compile/internal/ssa/rewriteMIPS.go | 8 +++---- src/cmd/compile/internal/ssa/rewriteMIPS64.go | 8 +++---- test/fixedbugs/issue29402.go | 23 +++++++++++++++++++ 5 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 test/fixedbugs/issue29402.go diff --git a/src/cmd/compile/internal/ssa/gen/MIPS.rules b/src/cmd/compile/internal/ssa/gen/MIPS.rules index 098e19c8a8264..db9c5bc63878b 100644 --- a/src/cmd/compile/internal/ssa/gen/MIPS.rules +++ b/src/cmd/compile/internal/ssa/gen/MIPS.rules @@ -670,8 +670,8 @@ (SGTUconst [c] (MOVHUreg _)) && 0xffff < uint32(c) -> (MOVWconst [1]) (SGTconst [c] (ANDconst [m] _)) && 0 <= int32(m) && int32(m) < int32(c) -> (MOVWconst [1]) (SGTUconst [c] (ANDconst [m] _)) && uint32(m) < uint32(c) -> (MOVWconst [1]) -(SGTconst [c] (SRLconst _ [d])) && 0 <= int32(c) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= int32(c) -> (MOVWconst [1]) -(SGTUconst [c] (SRLconst _ [d])) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= uint32(c) -> (MOVWconst [1]) +(SGTconst [c] (SRLconst _ [d])) && 0 <= int32(c) && uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c) -> (MOVWconst [1]) +(SGTUconst [c] (SRLconst _ [d])) && uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c) -> (MOVWconst [1]) // absorb constants into branches (EQ (MOVWconst [0]) yes no) -> (First nil yes no) diff --git a/src/cmd/compile/internal/ssa/gen/MIPS64.rules b/src/cmd/compile/internal/ssa/gen/MIPS64.rules index 70f4f0d616f75..9c16c3543847f 100644 --- a/src/cmd/compile/internal/ssa/gen/MIPS64.rules +++ b/src/cmd/compile/internal/ssa/gen/MIPS64.rules @@ -667,8 +667,8 @@ (SGTconst [c] (MOVWUreg _)) && c < 0 -> (MOVVconst [0]) (SGTconst [c] (ANDconst [m] _)) && 0 <= m && m < c -> (MOVVconst [1]) (SGTUconst [c] (ANDconst [m] _)) && uint64(m) < uint64(c) -> (MOVVconst [1]) -(SGTconst [c] (SRLVconst _ [d])) && 0 <= c && 0 < d && d <= 63 && 1< (MOVVconst [1]) -(SGTUconst [c] (SRLVconst _ [d])) && 0 < d && d <= 63 && 1< (MOVVconst [1]) +(SGTconst [c] (SRLVconst _ [d])) && 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c) -> (MOVVconst [1]) +(SGTUconst [c] (SRLVconst _ [d])) && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c) -> (MOVVconst [1]) // absorb constants into branches (EQ (MOVVconst [0]) yes no) -> (First nil yes no) diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS.go b/src/cmd/compile/internal/ssa/rewriteMIPS.go index e513981852598..951c5a5ef87f6 100644 --- a/src/cmd/compile/internal/ssa/rewriteMIPS.go +++ b/src/cmd/compile/internal/ssa/rewriteMIPS.go @@ -5625,7 +5625,7 @@ func rewriteValueMIPS_OpMIPSSGTUconst_0(v *Value) bool { return true } // match: (SGTUconst [c] (SRLconst _ [d])) - // cond: uint32(d) <= 31 && 1<<(32-uint32(d)) <= uint32(c) + // cond: uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c) // result: (MOVWconst [1]) for { c := v.AuxInt @@ -5634,7 +5634,7 @@ func rewriteValueMIPS_OpMIPSSGTUconst_0(v *Value) bool { break } d := v_0.AuxInt - if !(uint32(d) <= 31 && 1<<(32-uint32(d)) <= uint32(c)) { + if !(uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c)) { break } v.reset(OpMIPSMOVWconst) @@ -5862,7 +5862,7 @@ func rewriteValueMIPS_OpMIPSSGTconst_10(v *Value) bool { return true } // match: (SGTconst [c] (SRLconst _ [d])) - // cond: 0 <= int32(c) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= int32(c) + // cond: 0 <= int32(c) && uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c) // result: (MOVWconst [1]) for { c := v.AuxInt @@ -5871,7 +5871,7 @@ func rewriteValueMIPS_OpMIPSSGTconst_10(v *Value) bool { break } d := v_0.AuxInt - if !(0 <= int32(c) && uint32(d) <= 31 && 1<<(32-uint32(d)) <= int32(c)) { + if !(0 <= int32(c) && uint32(d) <= 31 && 0xffffffff>>uint32(d) < uint32(c)) { break } v.reset(OpMIPSMOVWconst) diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS64.go b/src/cmd/compile/internal/ssa/rewriteMIPS64.go index 04df5b8603d6b..9e12780664d60 100644 --- a/src/cmd/compile/internal/ssa/rewriteMIPS64.go +++ b/src/cmd/compile/internal/ssa/rewriteMIPS64.go @@ -6005,7 +6005,7 @@ func rewriteValueMIPS64_OpMIPS64SGTUconst_0(v *Value) bool { return true } // match: (SGTUconst [c] (SRLVconst _ [d])) - // cond: 0 < d && d <= 63 && 1<>uint64(d) < uint64(c) // result: (MOVVconst [1]) for { c := v.AuxInt @@ -6014,7 +6014,7 @@ func rewriteValueMIPS64_OpMIPS64SGTUconst_0(v *Value) bool { break } d := v_0.AuxInt - if !(0 < d && d <= 63 && 1<>uint64(d) < uint64(c)) { break } v.reset(OpMIPS64MOVVconst) @@ -6223,7 +6223,7 @@ func rewriteValueMIPS64_OpMIPS64SGTconst_10(v *Value) bool { return true } // match: (SGTconst [c] (SRLVconst _ [d])) - // cond: 0 <= c && 0 < d && d <= 63 && 1<>uint64(d) < uint64(c) // result: (MOVVconst [1]) for { c := v.AuxInt @@ -6232,7 +6232,7 @@ func rewriteValueMIPS64_OpMIPS64SGTconst_10(v *Value) bool { break } d := v_0.AuxInt - if !(0 <= c && 0 < d && d <= 63 && 1<>uint64(d) < uint64(c)) { break } v.reset(OpMIPS64MOVVconst) diff --git a/test/fixedbugs/issue29402.go b/test/fixedbugs/issue29402.go new file mode 100644 index 0000000000000..8a1f959d84280 --- /dev/null +++ b/test/fixedbugs/issue29402.go @@ -0,0 +1,23 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 29402: wrong optimization of comparison of +// constant and shift on MIPS. + +package main + +//go:noinline +func F(s []int) bool { + half := len(s) / 2 + return half >= 0 +} + +func main() { + b := F([]int{1, 2, 3, 4}) + if !b { + panic("FAIL") + } +} From c0914d5df3f12449f52e26eb0aaa58661ad92250 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 20 Dec 2018 15:09:41 -0800 Subject: [PATCH 434/594] os: add SyscallConn method for os.File Fixes #24331 Change-Id: I119c09a4259d852cdf8ea31b3e03e6f09a5f7bda Reviewed-on: https://go-review.googlesource.com/c/155517 Reviewed-by: Brad Fitzpatrick --- src/os/file.go | 9 ++++++ src/os/file_plan9.go | 18 +++++++++++ src/os/os_unix_test.go | 3 ++ src/os/os_windows_test.go | 3 ++ src/os/rawconn.go | 47 ++++++++++++++++++++++++++++ src/os/rawconn_test.go | 65 +++++++++++++++++++++++++++++++++++++++ src/syscall/net.go | 2 +- 7 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 src/os/rawconn.go create mode 100644 src/os/rawconn_test.go diff --git a/src/os/file.go b/src/os/file.go index 228777c67772f..fdead63bfc4cc 100644 --- a/src/os/file.go +++ b/src/os/file.go @@ -473,3 +473,12 @@ func (f *File) SetReadDeadline(t time.Time) error { func (f *File) SetWriteDeadline(t time.Time) error { return f.setWriteDeadline(t) } + +// SyscallConn returns a raw file. +// This implements the syscall.Conn interface. +func (f *File) SyscallConn() (syscall.RawConn, error) { + if err := f.checkValid("SyscallConn"); err != nil { + return nil, err + } + return newRawConn(f) +} diff --git a/src/os/file_plan9.go b/src/os/file_plan9.go index 2c74403434317..3fa12e681667c 100644 --- a/src/os/file_plan9.go +++ b/src/os/file_plan9.go @@ -534,3 +534,21 @@ func (f *File) checkValid(op string) error { } return nil } + +type rawConn struct{} + +func (c *rawConn) Control(f func(uintptr)) error { + return syscall.EPLAN9 +} + +func (c *rawConn) Read(f func(uintptr) bool) error { + return syscall.EPLAN9 +} + +func (c *rawConn) Write(f func(uintptr) bool) error { + return syscall.EPLAN9 +} + +func newRawConn(file *File) (*rawConn, error) { + return nil, syscall.EPLAN9 +} diff --git a/src/os/os_unix_test.go b/src/os/os_unix_test.go index 0317f7257ec51..2aa930ea80dd0 100644 --- a/src/os/os_unix_test.go +++ b/src/os/os_unix_test.go @@ -22,6 +22,9 @@ func init() { isReadonlyError = func(err error) bool { return err == syscall.EROFS } } +// For TestRawConnReadWrite. +type syscallDescriptor = int + func checkUidGid(t *testing.T, path string, uid, gid int) { dir, err := Lstat(path) if err != nil { diff --git a/src/os/os_windows_test.go b/src/os/os_windows_test.go index 1023b25e22584..285e1eb35e9d1 100644 --- a/src/os/os_windows_test.go +++ b/src/os/os_windows_test.go @@ -26,6 +26,9 @@ import ( "unsafe" ) +// For TestRawConnReadWrite. +type syscallDescriptor = syscall.Handle + func TestSameWindowsFile(t *testing.T) { temp, err := ioutil.TempDir("", "TestSameWindowsFile") if err != nil { diff --git a/src/os/rawconn.go b/src/os/rawconn.go new file mode 100644 index 0000000000000..9e11cda8c9aa9 --- /dev/null +++ b/src/os/rawconn.go @@ -0,0 +1,47 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !plan9 + +package os + +import ( + "runtime" +) + +// rawConn implements syscall.RawConn. +type rawConn struct { + file *File +} + +func (c *rawConn) Control(f func(uintptr)) error { + if err := c.file.checkValid("SyscallConn.Control"); err != nil { + return err + } + err := c.file.pfd.RawControl(f) + runtime.KeepAlive(c.file) + return err +} + +func (c *rawConn) Read(f func(uintptr) bool) error { + if err := c.file.checkValid("SyscallConn.Read"); err != nil { + return err + } + err := c.file.pfd.RawRead(f) + runtime.KeepAlive(c.file) + return err +} + +func (c *rawConn) Write(f func(uintptr) bool) error { + if err := c.file.checkValid("SyscallConn.Write"); err != nil { + return err + } + err := c.file.pfd.RawWrite(f) + runtime.KeepAlive(c.file) + return err +} + +func newRawConn(file *File) (*rawConn, error) { + return &rawConn{file: file}, nil +} diff --git a/src/os/rawconn_test.go b/src/os/rawconn_test.go new file mode 100644 index 0000000000000..820150d959b09 --- /dev/null +++ b/src/os/rawconn_test.go @@ -0,0 +1,65 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Test use of raw connections. +// +build !plan9,!nacl,!js + +package os_test + +import ( + "os" + "syscall" + "testing" +) + +func TestRawConnReadWrite(t *testing.T) { + t.Parallel() + + r, w, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + defer r.Close() + defer w.Close() + + rconn, err := r.SyscallConn() + if err != nil { + t.Fatal(err) + } + wconn, err := w.SyscallConn() + if err != nil { + t.Fatal(err) + } + + var operr error + err = wconn.Write(func(s uintptr) bool { + _, operr = syscall.Write(syscallDescriptor(s), []byte{'b'}) + return operr != syscall.EAGAIN + }) + if err != nil { + t.Fatal(err) + } + if operr != nil { + t.Fatal(err) + } + + var n int + buf := make([]byte, 1) + err = rconn.Read(func(s uintptr) bool { + n, operr = syscall.Read(syscallDescriptor(s), buf) + return operr != syscall.EAGAIN + }) + if err != nil { + t.Fatal(err) + } + if operr != nil { + t.Fatal(operr) + } + if n != 1 { + t.Errorf("read %d bytes, expected 1", n) + } + if buf[0] != 'b' { + t.Errorf("read %q, expected %q", buf, "b") + } +} diff --git a/src/syscall/net.go b/src/syscall/net.go index 272d3afc38745..531fa80d8f1af 100644 --- a/src/syscall/net.go +++ b/src/syscall/net.go @@ -26,7 +26,7 @@ type RawConn interface { Write(f func(fd uintptr) (done bool)) error } -// Conn is implemented by some types in the net package to provide +// Conn is implemented by some types in the net and os packages to provide // access to the underlying file descriptor or handle. type Conn interface { // SyscallConn returns a raw network connection. From b115207baf6c2decc3820ada4574ef4e5ad940ec Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Dec 2018 18:25:08 -0800 Subject: [PATCH 435/594] syscall: document LockOSThread with GNU/Linux SysProcAttr.Ptrace Fixes #28315 Change-Id: Ie02c72d02ad2f66c9cdbbba579a304641f327672 Reviewed-on: https://go-review.googlesource.com/c/155138 Reviewed-by: Brad Fitzpatrick --- src/syscall/exec_linux.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go index 7ae3177fdc087..6c761f85c4418 100644 --- a/src/syscall/exec_linux.go +++ b/src/syscall/exec_linux.go @@ -20,9 +20,12 @@ type SysProcIDMap struct { } type SysProcAttr struct { - Chroot string // Chroot. - Credential *Credential // Credential. - Ptrace bool // Enable tracing. + Chroot string // Chroot. + Credential *Credential // Credential. + // Ptrace tells the child to call ptrace(PTRACE_TRACEME). + // Call runtime.LockOSThread before starting a process with this set, + // and don't call UnlockOSThread until done with PtraceSyscall calls. + Ptrace bool Setsid bool // Create session. Setpgid bool // Set process group ID to Pgid, or, if Pgid == 0, to new pid. Setctty bool // Set controlling terminal to fd Ctty (only meaningful if Setsid is set) From c043fc4f655ce34f67a0e7fe2833139f6313a3f0 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 19 Dec 2018 16:47:50 -0800 Subject: [PATCH 436/594] os: don't let sendFile put a pipe into blocking mode Use SyscallConn to avoid calling the Fd method in sendFile on Unix systems, since Fd has the side effect of putting the descriptor into blocking mode. Fixes #28330 Change-Id: If093417a225fe44092bd2c0dbbc3937422e98c0b Reviewed-on: https://go-review.googlesource.com/c/155137 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/sendfile_linux.go | 14 ++++- src/net/sendfile_test.go | 104 +++++++++++++++++++++++++++++++++++ src/net/sendfile_unix_alt.go | 14 ++++- 3 files changed, 130 insertions(+), 2 deletions(-) diff --git a/src/net/sendfile_linux.go b/src/net/sendfile_linux.go index c537ea68b2b41..297e625d24b1d 100644 --- a/src/net/sendfile_linux.go +++ b/src/net/sendfile_linux.go @@ -32,7 +32,19 @@ func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) { return 0, nil, false } - written, err = poll.SendFile(&c.pfd, int(f.Fd()), remain) + sc, err := f.SyscallConn() + if err != nil { + return 0, nil, false + } + + var werr error + err = sc.Read(func(fd uintptr) bool { + written, werr = poll.SendFile(&c.pfd, int(fd), remain) + return true + }) + if werr == nil { + werr = err + } if lr != nil { lr.N = remain - written diff --git a/src/net/sendfile_test.go b/src/net/sendfile_test.go index f133744a66545..911e6139c57e3 100644 --- a/src/net/sendfile_test.go +++ b/src/net/sendfile_test.go @@ -12,8 +12,12 @@ import ( "encoding/hex" "fmt" "io" + "io/ioutil" "os" + "runtime" + "sync" "testing" + "time" ) const ( @@ -210,3 +214,103 @@ func TestSendfileSeeked(t *testing.T) { t.Error(err) } } + +// Test that sendfile doesn't put a pipe into blocking mode. +func TestSendfilePipe(t *testing.T) { + switch runtime.GOOS { + case "nacl", "plan9", "windows": + // These systems don't support deadlines on pipes. + t.Skipf("skipping on %s", runtime.GOOS) + } + + t.Parallel() + + ln, err := newLocalListener("tcp") + if err != nil { + t.Fatal(err) + } + defer ln.Close() + + r, w, err := os.Pipe() + if err != nil { + t.Fatal(err) + } + defer w.Close() + defer r.Close() + + copied := make(chan bool) + + var wg sync.WaitGroup + wg.Add(1) + go func() { + // Accept a connection and copy 1 byte from the read end of + // the pipe to the connection. This will call into sendfile. + defer wg.Done() + conn, err := ln.Accept() + if err != nil { + t.Error(err) + return + } + defer conn.Close() + _, err = io.CopyN(conn, r, 1) + if err != nil { + t.Error(err) + return + } + // Signal the main goroutine that we've copied the byte. + close(copied) + }() + + wg.Add(1) + go func() { + // Write 1 byte to the write end of the pipe. + defer wg.Done() + _, err := w.Write([]byte{'a'}) + if err != nil { + t.Error(err) + } + }() + + wg.Add(1) + go func() { + // Connect to the server started two goroutines up and + // discard any data that it writes. + defer wg.Done() + conn, err := Dial("tcp", ln.Addr().String()) + if err != nil { + t.Error(err) + return + } + defer conn.Close() + io.Copy(ioutil.Discard, conn) + }() + + // Wait for the byte to be copied, meaning that sendfile has + // been called on the pipe. + <-copied + + // Set a very short deadline on the read end of the pipe. + if err := r.SetDeadline(time.Now().Add(time.Microsecond)); err != nil { + t.Fatal(err) + } + + wg.Add(1) + go func() { + // Wait for much longer than the deadline and write a byte + // to the pipe. + defer wg.Done() + time.Sleep(50 * time.Millisecond) + w.Write([]byte{'b'}) + }() + + // If this read does not time out, the pipe was incorrectly + // put into blocking mode. + _, err = r.Read(make([]byte, 1)) + if err == nil { + t.Error("Read did not time out") + } else if !os.IsTimeout(err) { + t.Errorf("got error %v, expected a time out", err) + } + + wg.Wait() +} diff --git a/src/net/sendfile_unix_alt.go b/src/net/sendfile_unix_alt.go index 9b3ba4ee624a3..43df3bfd15eff 100644 --- a/src/net/sendfile_unix_alt.go +++ b/src/net/sendfile_unix_alt.go @@ -58,7 +58,19 @@ func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) { return 0, err, false } - written, err = poll.SendFile(&c.pfd, int(f.Fd()), pos, remain) + sc, err := f.SyscallConn() + if err != nil { + return 0, nil, false + } + + var werr error + err = sc.Read(func(fd uintptr) bool { + written, werr = poll.SendFile(&c.pfd, int(fd), pos, remain) + return true + }) + if werr == nil { + werr = err + } if lr != nil { lr.N = remain - written From 69c2c56453cdea1ad32d50fc82193f06b1b33f93 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 4 Dec 2018 07:58:18 -0800 Subject: [PATCH 437/594] cmd/compile,runtime: redo mid-stack inlining tracebacks Work involved in getting a stack trace is divided between runtime.Callers and runtime.CallersFrames. Before this CL, runtime.Callers returns a pc per runtime frame. runtime.CallersFrames is responsible for expanding a runtime frame into potentially multiple user frames. After this CL, runtime.Callers returns a pc per user frame. runtime.CallersFrames just maps those to user frame info. Entries in the result of runtime.Callers are now pcs of the calls (or of the inline marks), not of the instruction just after the call. Fixes #29007 Fixes #28640 Update #26320 Change-Id: I1c9567596ff73dc73271311005097a9188c3406f Reviewed-on: https://go-review.googlesource.com/c/152537 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: David Chase --- misc/cgo/test/callback.go | 4 - src/cmd/compile/internal/amd64/ggen.go | 3 +- src/cmd/compile/internal/arm/ggen.go | 3 +- src/cmd/compile/internal/arm64/ggen.go | 3 +- src/cmd/compile/internal/gc/fmt.go | 4 + src/cmd/compile/internal/gc/go.go | 2 +- src/cmd/compile/internal/gc/inl.go | 9 + src/cmd/compile/internal/gc/order.go | 2 +- src/cmd/compile/internal/gc/ssa.go | 12 + src/cmd/compile/internal/gc/syntax.go | 2 + src/cmd/compile/internal/gc/walk.go | 3 + src/cmd/compile/internal/mips/ggen.go | 3 +- src/cmd/compile/internal/mips64/ggen.go | 3 +- src/cmd/compile/internal/ppc64/ggen.go | 9 +- src/cmd/compile/internal/s390x/ggen.go | 3 +- src/cmd/compile/internal/ssa/deadcode.go | 2 +- .../compile/internal/ssa/gen/genericOps.go | 4 + src/cmd/compile/internal/ssa/lower.go | 2 +- src/cmd/compile/internal/ssa/opGen.go | 7 + src/cmd/compile/internal/wasm/ssa.go | 6 +- src/cmd/compile/internal/x86/ggen.go | 3 +- src/cmd/internal/goobj/read.go | 10 +- src/cmd/internal/obj/inl.go | 13 +- src/cmd/internal/obj/link.go | 28 +- src/cmd/internal/obj/objfile.go | 1 + src/cmd/internal/obj/pcln.go | 16 + src/cmd/internal/obj/wasm/wasmobj.go | 3 +- src/cmd/internal/objabi/funcid.go | 63 ++++ src/cmd/link/internal/ld/pcln.go | 52 +--- src/cmd/link/internal/objfile/objfile.go | 1 + src/cmd/link/internal/sym/symbol.go | 15 +- src/runtime/extern.go | 24 +- src/runtime/pprof/proto.go | 15 +- src/runtime/pprof/proto_test.go | 4 +- src/runtime/pprof/protomem_test.go | 6 +- src/runtime/symtab.go | 288 +++++------------- src/runtime/traceback.go | 88 +++--- test/fixedbugs/issue5856.go | 2 +- test/inline_callers.go | 10 +- 39 files changed, 341 insertions(+), 387 deletions(-) diff --git a/misc/cgo/test/callback.go b/misc/cgo/test/callback.go index 58e126b41b6ff..4fc6b39ffa627 100644 --- a/misc/cgo/test/callback.go +++ b/misc/cgo/test/callback.go @@ -179,7 +179,6 @@ func testCallbackCallers(t *testing.T) { pc := make([]uintptr, 100) n := 0 name := []string{ - "runtime.call16", "runtime.cgocallbackg1", "runtime.cgocallbackg", "runtime.cgocallback_gofunc", @@ -193,9 +192,6 @@ func testCallbackCallers(t *testing.T) { "testing.tRunner", "runtime.goexit", } - if unsafe.Sizeof((*byte)(nil)) == 8 { - name[0] = "runtime.call32" - } nestedCall(func() { n = runtime.Callers(4, pc) }) diff --git a/src/cmd/compile/internal/amd64/ggen.go b/src/cmd/compile/internal/amd64/ggen.go index df0a69a441762..ee4f872bd87e7 100644 --- a/src/cmd/compile/internal/amd64/ggen.go +++ b/src/cmd/compile/internal/amd64/ggen.go @@ -141,7 +141,7 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { // This is actually not the x86 NOP anymore, // but at the point where it gets used, AX is dead // so it's okay if we lose the high bits. @@ -150,4 +150,5 @@ func ginsnop(pp *gc.Progs) { p.From.Reg = x86.REG_AX p.To.Type = obj.TYPE_REG p.To.Reg = x86.REG_AX + return p } diff --git a/src/cmd/compile/internal/arm/ggen.go b/src/cmd/compile/internal/arm/ggen.go index b2fc272ec65cc..f525517c49af4 100644 --- a/src/cmd/compile/internal/arm/ggen.go +++ b/src/cmd/compile/internal/arm/ggen.go @@ -68,11 +68,12 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { p := pp.Prog(arm.AAND) p.From.Type = obj.TYPE_REG p.From.Reg = arm.REG_R0 p.To.Type = obj.TYPE_REG p.To.Reg = arm.REG_R0 p.Scond = arm.C_SCOND_EQ + return p } diff --git a/src/cmd/compile/internal/arm64/ggen.go b/src/cmd/compile/internal/arm64/ggen.go index 204391fef1c77..9d8fe53cfdc87 100644 --- a/src/cmd/compile/internal/arm64/ggen.go +++ b/src/cmd/compile/internal/arm64/ggen.go @@ -79,7 +79,8 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { p := pp.Prog(arm64.AHINT) p.From.Type = obj.TYPE_CONST + return p } diff --git a/src/cmd/compile/internal/gc/fmt.go b/src/cmd/compile/internal/gc/fmt.go index baea4cc7161c4..fc1af603a2b2b 100644 --- a/src/cmd/compile/internal/gc/fmt.go +++ b/src/cmd/compile/internal/gc/fmt.go @@ -174,6 +174,7 @@ var goopnames = []string{ OGT: ">", OIF: "if", OIMAG: "imag", + OINLMARK: "inlmark", ODEREF: "*", OLEN: "len", OLE: "<=", @@ -942,6 +943,9 @@ func (n *Node) stmtfmt(s fmt.State, mode fmtMode) { case ORETJMP: mode.Fprintf(s, "retjmp %v", n.Sym) + case OINLMARK: + mode.Fprintf(s, "inlmark %d", n.Xoffset) + case OGO: mode.Fprintf(s, "go %v", n.Left) diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go index c5ff8b6dbe865..376637ba9adca 100644 --- a/src/cmd/compile/internal/gc/go.go +++ b/src/cmd/compile/internal/gc/go.go @@ -257,7 +257,7 @@ type Arch struct { PadFrame func(int64) int64 ZeroRange func(*Progs, *obj.Prog, int64, int64, *uint32) *obj.Prog - Ginsnop func(*Progs) + Ginsnop func(*Progs) *obj.Prog // SSAMarkMoves marks any MOVXconst ops that need to avoid clobbering flags. SSAMarkMoves func(*SSAGenState, *ssa.Block) diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index 4699bcfa1f5dc..81cad31a13a12 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -1063,6 +1063,15 @@ func mkinlcall(n, fn *Node, maxCost int32) *Node { } newIndex := Ctxt.InlTree.Add(parent, n.Pos, fn.Sym.Linksym()) + // Add a inline mark just before the inlined body. + // This mark is inline in the code so that it's a reasonable spot + // to put a breakpoint. Not sure if that's really necessary or not + // (in which case it could go at the end of the function instead). + inlMark := nod(OINLMARK, nil, nil) + inlMark.Pos = n.Pos + inlMark.Xoffset = int64(newIndex) + ninit.Append(inlMark) + if genDwarfInline > 0 { if !fn.Sym.Linksym().WasInlined() { Ctxt.DwFixups.SetPrecursorFunc(fn.Sym.Linksym(), fn) diff --git a/src/cmd/compile/internal/gc/order.go b/src/cmd/compile/internal/gc/order.go index 2eec537e4e6cb..4848a02bb6a8c 100644 --- a/src/cmd/compile/internal/gc/order.go +++ b/src/cmd/compile/internal/gc/order.go @@ -553,7 +553,7 @@ func (o *Order) stmt(n *Node) { default: Fatalf("orderstmt %v", n.Op) - case OVARKILL, OVARLIVE: + case OVARKILL, OVARLIVE, OINLMARK: o.out = append(o.out, n) case OAS: diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index 2eeea79ff99cc..db26f135f59b7 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -1204,6 +1204,9 @@ func (s *state) stmt(n *Node) { p := s.expr(n.Left) s.nilCheck(p) + case OINLMARK: + s.newValue1I(ssa.OpInlMark, types.TypeVoid, n.Xoffset, s.mem()) + default: s.Fatalf("unhandled stmt %v", n.Op) } @@ -5163,6 +5166,14 @@ func genssa(f *ssa.Func, pp *Progs) { if v.Args[0].Reg() != v.Reg() { v.Fatalf("OpConvert should be a no-op: %s; %s", v.Args[0].LongString(), v.LongString()) } + case ssa.OpInlMark: + p := thearch.Ginsnop(s.pp) + if pp.curfn.Func.lsym != nil { + // lsym is nil if the function name is "_". + pp.curfn.Func.lsym.Func.AddInlMark(p, v.AuxInt32()) + } + // TODO: if matching line number, merge somehow with previous instruction? + default: // let the backend handle it // Special case for first line in function; move it to the start. @@ -5543,6 +5554,7 @@ func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog { s.PrepareCall(v) p := s.Prog(obj.ACALL) + p.Pos = v.Pos if sym, ok := v.Aux.(*obj.LSym); ok { p.To.Type = obj.TYPE_MEM p.To.Name = obj.NAME_EXTERN diff --git a/src/cmd/compile/internal/gc/syntax.go b/src/cmd/compile/internal/gc/syntax.go index c7becf53e5615..5f07c6c52ad25 100644 --- a/src/cmd/compile/internal/gc/syntax.go +++ b/src/cmd/compile/internal/gc/syntax.go @@ -46,6 +46,7 @@ type Node struct { // - ODOT, ODOTPTR, and OINDREGSP use it to indicate offset relative to their base address. // - OSTRUCTKEY uses it to store the named field's offset. // - Named OLITERALs use it to store their ambient iota value. + // - OINLMARK stores an index into the inlTree data structure. // Possibly still more uses. If you find any, document them. Xoffset int64 @@ -750,6 +751,7 @@ const ( OVARKILL // variable is dead OVARLIVE // variable is alive OINDREGSP // offset plus indirect of REGSP, such as 8(SP). + OINLMARK // start of an inlined body, with file/line of caller. Xoffset is an index into the inline tree. // arch-specific opcodes ORETJMP // return to other function diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go index f23a5916479a6..509579d21fe9c 100644 --- a/src/cmd/compile/internal/gc/walk.go +++ b/src/cmd/compile/internal/gc/walk.go @@ -322,6 +322,9 @@ func walkstmt(n *Node) *Node { case ORETJMP: break + case OINLMARK: + break + case OSELECT: walkselect(n) diff --git a/src/cmd/compile/internal/mips/ggen.go b/src/cmd/compile/internal/mips/ggen.go index acbe4a91de727..eab60756ba77d 100644 --- a/src/cmd/compile/internal/mips/ggen.go +++ b/src/cmd/compile/internal/mips/ggen.go @@ -59,10 +59,11 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { p := pp.Prog(mips.ANOR) p.From.Type = obj.TYPE_REG p.From.Reg = mips.REG_R0 p.To.Type = obj.TYPE_REG p.To.Reg = mips.REG_R0 + return p } diff --git a/src/cmd/compile/internal/mips64/ggen.go b/src/cmd/compile/internal/mips64/ggen.go index a7e07d3740837..80c1f0296c0bf 100644 --- a/src/cmd/compile/internal/mips64/ggen.go +++ b/src/cmd/compile/internal/mips64/ggen.go @@ -63,10 +63,11 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { p := pp.Prog(mips.ANOR) p.From.Type = obj.TYPE_REG p.From.Reg = mips.REG_R0 p.To.Type = obj.TYPE_REG p.To.Reg = mips.REG_R0 + return p } diff --git a/src/cmd/compile/internal/ppc64/ggen.go b/src/cmd/compile/internal/ppc64/ggen.go index 5dda2d6e80ccc..ea66baa007da1 100644 --- a/src/cmd/compile/internal/ppc64/ggen.go +++ b/src/cmd/compile/internal/ppc64/ggen.go @@ -58,15 +58,16 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { p := pp.Prog(ppc64.AOR) p.From.Type = obj.TYPE_REG p.From.Reg = ppc64.REG_R0 p.To.Type = obj.TYPE_REG p.To.Reg = ppc64.REG_R0 + return p } -func ginsnop2(pp *gc.Progs) { +func ginsnop2(pp *gc.Progs) *obj.Prog { // PPC64 is unusual because TWO nops are required // (see gc/cgen.go, gc/plive.go -- copy of comment below) // @@ -87,7 +88,7 @@ func ginsnop2(pp *gc.Progs) { p.From.Reg = ppc64.REGSP p.To.Type = obj.TYPE_REG p.To.Reg = ppc64.REG_R2 - } else { - ginsnop(pp) + return p } + return ginsnop(pp) } diff --git a/src/cmd/compile/internal/s390x/ggen.go b/src/cmd/compile/internal/s390x/ggen.go index 636ab16dd4ab4..ba5f2dfc2bd14 100644 --- a/src/cmd/compile/internal/s390x/ggen.go +++ b/src/cmd/compile/internal/s390x/ggen.go @@ -104,10 +104,11 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { p := pp.Prog(s390x.AOR) p.From.Type = obj.TYPE_REG p.From.Reg = int16(s390x.REG_R0) p.To.Type = obj.TYPE_REG p.To.Reg = int16(s390x.REG_R0) + return p } diff --git a/src/cmd/compile/internal/ssa/deadcode.go b/src/cmd/compile/internal/ssa/deadcode.go index 13b7d7e1e84a6..72cce448ce6cb 100644 --- a/src/cmd/compile/internal/ssa/deadcode.go +++ b/src/cmd/compile/internal/ssa/deadcode.go @@ -85,7 +85,7 @@ func liveValues(f *Func, reachable []bool) (live []bool, liveOrderStmts []*Value } } if v.Type.IsVoid() && !live[v.ID] { - // The only Void ops are nil checks. We must keep these. + // The only Void ops are nil checks and inline marks. We must keep these. live[v.ID] = true q = append(q, v) if v.Pos.IsStmt() != src.PosNotStmt { diff --git a/src/cmd/compile/internal/ssa/gen/genericOps.go b/src/cmd/compile/internal/ssa/gen/genericOps.go index ba8d93cf2cc69..89e6961bd79a5 100644 --- a/src/cmd/compile/internal/ssa/gen/genericOps.go +++ b/src/cmd/compile/internal/ssa/gen/genericOps.go @@ -480,6 +480,10 @@ var genericOps = []opData{ {name: "VarLive", argLength: 1, aux: "Sym", symEffect: "Read", zeroWidth: true}, // aux is a *gc.Node of a variable that must be kept live. arg0=mem, returns mem {name: "KeepAlive", argLength: 2, typ: "Mem", zeroWidth: true}, // arg[0] is a value that must be kept alive until this mark. arg[1]=mem, returns mem + // InlMark marks the start of an inlined function body. Its AuxInt field + // distinguishes which entry in the local inline tree it is marking. + {name: "InlMark", argLength: 1, aux: "Int32", typ: "Void"}, // arg[0]=mem, returns void. + // Ops for breaking 64-bit operations on 32-bit architectures {name: "Int64Make", argLength: 2, typ: "UInt64"}, // arg0=hi, arg1=lo {name: "Int64Hi", argLength: 1, typ: "UInt32"}, // high 32-bit of arg0 diff --git a/src/cmd/compile/internal/ssa/lower.go b/src/cmd/compile/internal/ssa/lower.go index 24f927f144edb..ab0fa803bfdea 100644 --- a/src/cmd/compile/internal/ssa/lower.go +++ b/src/cmd/compile/internal/ssa/lower.go @@ -21,7 +21,7 @@ func checkLower(f *Func) { continue // lowered } switch v.Op { - case OpSP, OpSB, OpInitMem, OpArg, OpPhi, OpVarDef, OpVarKill, OpVarLive, OpKeepAlive, OpSelect0, OpSelect1, OpConvert: + case OpSP, OpSB, OpInitMem, OpArg, OpPhi, OpVarDef, OpVarKill, OpVarLive, OpKeepAlive, OpSelect0, OpSelect1, OpConvert, OpInlMark: continue // ok not to lower case OpGetG: if f.Config.hasGReg { diff --git a/src/cmd/compile/internal/ssa/opGen.go b/src/cmd/compile/internal/ssa/opGen.go index f6568be660f4e..2278407a260e7 100644 --- a/src/cmd/compile/internal/ssa/opGen.go +++ b/src/cmd/compile/internal/ssa/opGen.go @@ -2398,6 +2398,7 @@ const ( OpVarKill OpVarLive OpKeepAlive + OpInlMark OpInt64Make OpInt64Hi OpInt64Lo @@ -29796,6 +29797,12 @@ var opcodeTable = [...]opInfo{ zeroWidth: true, generic: true, }, + { + name: "InlMark", + auxType: auxInt32, + argLen: 1, + generic: true, + }, { name: "Int64Make", argLen: 2, diff --git a/src/cmd/compile/internal/wasm/ssa.go b/src/cmd/compile/internal/wasm/ssa.go index d82b1f7953dde..6e6dc557b4937 100644 --- a/src/cmd/compile/internal/wasm/ssa.go +++ b/src/cmd/compile/internal/wasm/ssa.go @@ -58,8 +58,8 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { - pp.Prog(wasm.ANop) +func ginsnop(pp *gc.Progs) *obj.Prog { + return pp.Prog(wasm.ANop) } func ssaMarkMoves(s *gc.SSAGenState, b *ssa.Block) { @@ -134,10 +134,12 @@ func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) { if sym, ok := v.Aux.(*obj.LSym); ok { p := s.Prog(obj.ACALL) p.To = obj.Addr{Type: obj.TYPE_MEM, Name: obj.NAME_EXTERN, Sym: sym} + p.Pos = v.Pos } else { getValue64(s, v.Args[0]) p := s.Prog(obj.ACALL) p.To = obj.Addr{Type: obj.TYPE_NONE} + p.Pos = v.Pos } case ssa.OpWasmLoweredMove: diff --git a/src/cmd/compile/internal/x86/ggen.go b/src/cmd/compile/internal/x86/ggen.go index ef380bd74067b..1851af57c4bd7 100644 --- a/src/cmd/compile/internal/x86/ggen.go +++ b/src/cmd/compile/internal/x86/ggen.go @@ -53,10 +53,11 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } } -func ginsnop(pp *gc.Progs) { +func ginsnop(pp *gc.Progs) *obj.Prog { p := pp.Prog(x86.AXCHGL) p.From.Type = obj.TYPE_REG p.From.Reg = x86.REG_AX p.To.Type = obj.TYPE_REG p.To.Reg = x86.REG_AX + return p } diff --git a/src/cmd/internal/goobj/read.go b/src/cmd/internal/goobj/read.go index 2081098ca8f80..84aed6eeea496 100644 --- a/src/cmd/internal/goobj/read.go +++ b/src/cmd/internal/goobj/read.go @@ -119,10 +119,11 @@ type FuncData struct { // An InlinedCall is a node in an InlTree. // See cmd/internal/obj.InlTree for details. type InlinedCall struct { - Parent int64 - File string - Line int64 - Func SymID + Parent int64 + File string + Line int64 + Func SymID + ParentPC int64 } // A Package is a parsed Go object file or archive defining a Go package. @@ -610,6 +611,7 @@ func (r *objReader) parseObject(prefix []byte) error { f.InlTree[i].File = r.readSymID().Name f.InlTree[i].Line = r.readInt() f.InlTree[i].Func = r.readSymID() + f.InlTree[i].ParentPC = r.readInt() } } } diff --git a/src/cmd/internal/obj/inl.go b/src/cmd/internal/obj/inl.go index 671239444c7b9..8860069e4771b 100644 --- a/src/cmd/internal/obj/inl.go +++ b/src/cmd/internal/obj/inl.go @@ -47,9 +47,10 @@ type InlTree struct { // InlinedCall is a node in an InlTree. type InlinedCall struct { - Parent int // index of the parent in the InlTree or < 0 if outermost call - Pos src.XPos // position of the inlined call - Func *LSym // function that was inlined + Parent int // index of the parent in the InlTree or < 0 if outermost call + Pos src.XPos // position of the inlined call + Func *LSym // function that was inlined + ParentPC int32 // PC of instruction just before inlined body. Only valid in local trees. } // Add adds a new call to the tree, returning its index. @@ -76,6 +77,10 @@ func (tree *InlTree) CallPos(inlIndex int) src.XPos { return tree.nodes[inlIndex].Pos } +func (tree *InlTree) setParentPC(inlIndex int, pc int32) { + tree.nodes[inlIndex].ParentPC = pc +} + // OutermostPos returns the outermost position corresponding to xpos, // which is where xpos was ultimately inlined to. In the example for // InlTree, main() contains inlined AST nodes from h(), but the @@ -106,6 +111,6 @@ func (ctxt *Link) InnermostPos(xpos src.XPos) src.Pos { func dumpInlTree(ctxt *Link, tree InlTree) { for i, call := range tree.nodes { pos := ctxt.PosTable.Pos(call.Pos) - ctxt.Logf("%0d | %0d | %s (%s)\n", i, call.Parent, call.Func, pos) + ctxt.Logf("%0d | %0d | %s (%s) pc=%d\n", i, call.Parent, call.Func, pos, call.ParentPC) } } diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index dfecdfbb37981..7df8e2e516857 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -393,11 +393,12 @@ type LSym struct { // A FuncInfo contains extra fields for STEXT symbols. type FuncInfo struct { - Args int32 - Locals int32 - Text *Prog - Autom []*Auto - Pcln Pcln + Args int32 + Locals int32 + Text *Prog + Autom []*Auto + Pcln Pcln + InlMarks []InlMark dwarfInfoSym *LSym dwarfLocSym *LSym @@ -411,6 +412,23 @@ type FuncInfo struct { StackObjects *LSym } +type InlMark struct { + // When unwinding from an instruction in an inlined body, mark + // where we should unwind to. + // id records the global inlining id of the inlined body. + // p records the location of an instruction in the parent (inliner) frame. + p *Prog + id int32 +} + +// Mark p as the instruction to set as the pc when +// "unwinding" the inlining global frame id. Usually it should be +// instruction with a file:line at the callsite, and occur +// just before the body of the inlined function. +func (fi *FuncInfo) AddInlMark(p *Prog, id int32) { + fi.InlMarks = append(fi.InlMarks, InlMark{p: p, id: id}) +} + //go:generate stringer -type ABI // ABI is the calling convention of a text symbol. diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 49301f04d504b..c6d2de4273e2d 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -388,6 +388,7 @@ func (w *objWriter) writeSym(s *LSym) { w.writeRefIndex(fsym) w.writeInt(int64(l)) w.writeRefIndex(call.Func) + w.writeInt(int64(call.ParentPC)) } } diff --git a/src/cmd/internal/obj/pcln.go b/src/cmd/internal/obj/pcln.go index d72d797ee5a47..84dd494930ee3 100644 --- a/src/cmd/internal/obj/pcln.go +++ b/src/cmd/internal/obj/pcln.go @@ -193,6 +193,19 @@ func (s *pcinlineState) addBranch(ctxt *Link, globalIndex int) int { return localIndex } +func (s *pcinlineState) setParentPC(ctxt *Link, globalIndex int, pc int32) { + localIndex, ok := s.globalToLocal[globalIndex] + if !ok { + // We know where to unwind to when we need to unwind a body identified + // by globalIndex. But there may be no instructions generated by that + // body (it's empty, or its instructions were CSEd with other things, etc.). + // In that case, we don't need an unwind entry. + // TODO: is this really right? Seems to happen a whole lot... + return + } + s.localTree.setParentPC(localIndex, pc) +} + // pctoinline computes the index into the local inlining tree to use at p. // If p is not the result of inlining, pctoinline returns -1. Because p.Pos // applies to p, phase == 0 (before p) takes care of the update. @@ -323,6 +336,9 @@ func linkpcln(ctxt *Link, cursym *LSym) { pcinlineState := new(pcinlineState) funcpctab(ctxt, &pcln.Pcinline, cursym, "pctoinline", pcinlineState.pctoinline, nil) + for _, inlMark := range cursym.Func.InlMarks { + pcinlineState.setParentPC(ctxt, int(inlMark.id), int32(inlMark.p.Pc)) + } pcln.InlTree = pcinlineState.localTree if ctxt.Debugpcln == "pctoinline" && len(pcln.InlTree.nodes) > 0 { ctxt.Logf("-- inlining tree for %s:\n", cursym) diff --git a/src/cmd/internal/obj/wasm/wasmobj.go b/src/cmd/internal/obj/wasm/wasmobj.go index a1b758836a5d1..52c9710ff09ee 100644 --- a/src/cmd/internal/obj/wasm/wasmobj.go +++ b/src/cmd/internal/obj/wasm/wasmobj.go @@ -243,7 +243,6 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) { for p := s.Func.Text; p != nil; p = p.Link { prevBase := base base = ctxt.PosTable.Pos(p.Pos).Base() - switch p.As { case ABlock, ALoop, AIf: explicitBlockDepth++ @@ -279,7 +278,7 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) { // more often to avoid bloat of the BrTable instruction. // The "base != prevBase" condition detects inlined instructions. They are an // implicit call, so entering and leaving this section affects the stack trace. - if p.As == ACALLNORESUME || p.As == obj.ANOP || p.Spadj != 0 || base != prevBase { + if p.As == ACALLNORESUME || p.As == obj.ANOP || p.As == ANop || p.Spadj != 0 || base != prevBase { pc++ } } diff --git a/src/cmd/internal/objabi/funcid.go b/src/cmd/internal/objabi/funcid.go index 92799107da04c..fc9e421836926 100644 --- a/src/cmd/internal/objabi/funcid.go +++ b/src/cmd/internal/objabi/funcid.go @@ -4,6 +4,11 @@ package objabi +import ( + "strconv" + "strings" +) + // A FuncID identifies particular functions that need to be treated // specially by the runtime. // Note that in some situations involving plugins, there may be multiple @@ -30,4 +35,62 @@ const ( FuncID_gogo FuncID_externalthreadhandler FuncID_debugCallV1 + FuncID_gopanic + FuncID_panicwrap + FuncID_wrapper // any autogenerated code (hash/eq algorithms, method wrappers, etc.) ) + +// Get the function ID for the named function in the named file. +// The function should be package-qualified. +func GetFuncID(name, file string) FuncID { + switch name { + case "runtime.main": + return FuncID_runtime_main + case "runtime.goexit": + return FuncID_goexit + case "runtime.jmpdefer": + return FuncID_jmpdefer + case "runtime.mcall": + return FuncID_mcall + case "runtime.morestack": + return FuncID_morestack + case "runtime.mstart": + return FuncID_mstart + case "runtime.rt0_go": + return FuncID_rt0_go + case "runtime.asmcgocall": + return FuncID_asmcgocall + case "runtime.sigpanic": + return FuncID_sigpanic + case "runtime.runfinq": + return FuncID_runfinq + case "runtime.gcBgMarkWorker": + return FuncID_gcBgMarkWorker + case "runtime.systemstack_switch": + return FuncID_systemstack_switch + case "runtime.systemstack": + return FuncID_systemstack + case "runtime.cgocallback_gofunc": + return FuncID_cgocallback_gofunc + case "runtime.gogo": + return FuncID_gogo + case "runtime.externalthreadhandler": + return FuncID_externalthreadhandler + case "runtime.debugCallV1": + return FuncID_debugCallV1 + case "runtime.gopanic": + return FuncID_gopanic + case "runtime.panicwrap": + return FuncID_panicwrap + } + if file == "" && !strings.HasSuffix(name, ".init") { + return FuncID_wrapper + } + if strings.HasPrefix(name, "runtime.call") { + if _, err := strconv.Atoi(name[12:]); err == nil { + // runtime.callXX reflect call wrappers. + return FuncID_wrapper + } + } + return FuncID_normal +} diff --git a/src/cmd/link/internal/ld/pcln.go b/src/cmd/link/internal/ld/pcln.go index ba098611c084e..e4db834622dd4 100644 --- a/src/cmd/link/internal/ld/pcln.go +++ b/src/cmd/link/internal/ld/pcln.go @@ -368,10 +368,13 @@ func (ctxt *Link) pclntab() { numberfile(ctxt, call.File) nameoff := nameToOffset(call.Func.Name) - inlTreeSym.SetUint32(ctxt.Arch, int64(i*16+0), uint32(call.Parent)) - inlTreeSym.SetUint32(ctxt.Arch, int64(i*16+4), uint32(call.File.Value)) - inlTreeSym.SetUint32(ctxt.Arch, int64(i*16+8), uint32(call.Line)) - inlTreeSym.SetUint32(ctxt.Arch, int64(i*16+12), uint32(nameoff)) + inlTreeSym.SetUint16(ctxt.Arch, int64(i*20+0), uint16(call.Parent)) + inlTreeSym.SetUint8(ctxt.Arch, int64(i*20+2), uint8(objabi.GetFuncID(call.Func.Name, call.Func.File))) + // byte 3 is unused + inlTreeSym.SetUint32(ctxt.Arch, int64(i*20+4), uint32(call.File.Value)) + inlTreeSym.SetUint32(ctxt.Arch, int64(i*20+8), uint32(call.Line)) + inlTreeSym.SetUint32(ctxt.Arch, int64(i*20+12), uint32(nameoff)) + inlTreeSym.SetUint32(ctxt.Arch, int64(i*20+16), uint32(call.ParentPC)) } pcln.Funcdata[objabi.FUNCDATA_InlTree] = inlTreeSym @@ -386,43 +389,12 @@ func (ctxt *Link) pclntab() { off = int32(ftab.SetUint32(ctxt.Arch, int64(off), uint32(len(pcln.Pcdata)))) // funcID uint8 - funcID := objabi.FuncID_normal - switch s.Name { - case "runtime.main": - funcID = objabi.FuncID_runtime_main - case "runtime.goexit": - funcID = objabi.FuncID_goexit - case "runtime.jmpdefer": - funcID = objabi.FuncID_jmpdefer - case "runtime.mcall": - funcID = objabi.FuncID_mcall - case "runtime.morestack": - funcID = objabi.FuncID_morestack - case "runtime.mstart": - funcID = objabi.FuncID_mstart - case "runtime.rt0_go": - funcID = objabi.FuncID_rt0_go - case "runtime.asmcgocall": - funcID = objabi.FuncID_asmcgocall - case "runtime.sigpanic": - funcID = objabi.FuncID_sigpanic - case "runtime.runfinq": - funcID = objabi.FuncID_runfinq - case "runtime.gcBgMarkWorker": - funcID = objabi.FuncID_gcBgMarkWorker - case "runtime.systemstack_switch": - funcID = objabi.FuncID_systemstack_switch - case "runtime.systemstack": - funcID = objabi.FuncID_systemstack - case "runtime.cgocallback_gofunc": - funcID = objabi.FuncID_cgocallback_gofunc - case "runtime.gogo": - funcID = objabi.FuncID_gogo - case "runtime.externalthreadhandler": - funcID = objabi.FuncID_externalthreadhandler - case "runtime.debugCallV1": - funcID = objabi.FuncID_debugCallV1 + var file string + if s.FuncInfo != nil && len(s.FuncInfo.File) > 0 { + file = s.FuncInfo.File[0].Name } + funcID := objabi.GetFuncID(s.Name, file) + off = int32(ftab.SetUint8(ctxt.Arch, int64(off), uint8(funcID))) // unused diff --git a/src/cmd/link/internal/objfile/objfile.go b/src/cmd/link/internal/objfile/objfile.go index a85ba1ebee95b..b39e0521066bd 100644 --- a/src/cmd/link/internal/objfile/objfile.go +++ b/src/cmd/link/internal/objfile/objfile.go @@ -318,6 +318,7 @@ overwrite: pc.InlTree[i].File = r.readSymIndex() pc.InlTree[i].Line = r.readInt32() pc.InlTree[i].Func = r.readSymIndex() + pc.InlTree[i].ParentPC = r.readInt32() } if !dupok { diff --git a/src/cmd/link/internal/sym/symbol.go b/src/cmd/link/internal/sym/symbol.go index a1af4670a28b5..24b0d682c4b77 100644 --- a/src/cmd/link/internal/sym/symbol.go +++ b/src/cmd/link/internal/sym/symbol.go @@ -28,7 +28,7 @@ type Symbol struct { Sub *Symbol Outer *Symbol Gotype *Symbol - File string + File string // actually package! auxinfo *AuxSymbol Sect *Section FuncInfo *FuncInfo @@ -150,6 +150,10 @@ func (s *Symbol) SetUint8(arch *sys.Arch, r int64, v uint8) int64 { return s.setUintXX(arch, r, uint64(v), 1) } +func (s *Symbol) SetUint16(arch *sys.Arch, r int64, v uint16) int64 { + return s.setUintXX(arch, r, uint64(v), 2) +} + func (s *Symbol) SetUint32(arch *sys.Arch, r int64, v uint32) int64 { return s.setUintXX(arch, r, uint64(v), 4) } @@ -507,10 +511,11 @@ type FuncInfo struct { // InlinedCall is a node in a local inlining tree (FuncInfo.InlTree). type InlinedCall struct { - Parent int32 // index of parent in InlTree - File *Symbol // file of the inlined call - Line int32 // line number of the inlined call - Func *Symbol // function that was inlined + Parent int32 // index of parent in InlTree + File *Symbol // file of the inlined call + Line int32 // line number of the inlined call + Func *Symbol // function that was inlined + ParentPC int32 // PC of the instruction just before the inlined body (offset from function start) } type Pcdata struct { diff --git a/src/runtime/extern.go b/src/runtime/extern.go index 997e1cb278d72..5e11eadb92a84 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go @@ -166,27 +166,13 @@ import "runtime/internal/sys" // program counter, file name, and line number within the file of the corresponding // call. The boolean ok is false if it was not possible to recover the information. func Caller(skip int) (pc uintptr, file string, line int, ok bool) { - // Make room for three PCs: the one we were asked for, - // what it called, so that CallersFrames can see if it "called" - // sigpanic, and possibly a PC for skipPleaseUseCallersFrames. - var rpc [3]uintptr - if callers(skip, rpc[:]) < 2 { + rpc := make([]uintptr, 1) + n := callers(skip+1, rpc[:]) + if n < 1 { return } - var stackExpander stackExpander - callers := stackExpander.init(rpc[:]) - // We asked for one extra, so skip that one. If this is sigpanic, - // stepping over this frame will set up state in Frames so the - // next frame is correct. - callers, _, ok = stackExpander.next(callers, true) - if !ok { - return - } - _, frame, _ := stackExpander.next(callers, true) - pc = frame.PC - file = frame.File - line = frame.Line - return + frame, _ := CallersFrames(rpc).Next() + return frame.PC, frame.File, frame.Line, frame.PC != 0 } // Callers fills the slice pc with the return program counters of function invocations diff --git a/src/runtime/pprof/proto.go b/src/runtime/pprof/proto.go index bd5c8f7afcb85..7621fe213447c 100644 --- a/src/runtime/pprof/proto.go +++ b/src/runtime/pprof/proto.go @@ -208,7 +208,7 @@ func (b *profileBuilder) pbMapping(tag int, id, base, limit, offset uint64, file } // locForPC returns the location ID for addr. -// addr must be a return PC. This returns the location of the call. +// addr must a PC which is part of a call or the PC of an inline marker. This returns the location of the call. // It may emit to b.pb, so there must be no message encoding in progress. func (b *profileBuilder) locForPC(addr uintptr) uint64 { id := uint64(b.locs[addr]) @@ -236,7 +236,7 @@ func (b *profileBuilder) locForPC(addr uintptr) uint64 { if frame.PC == 0 { // If we failed to resolve the frame, at least make up // a reasonable call PC. This mostly happens in tests. - frame.PC = addr - 1 + frame.PC = addr } // We can't write out functions while in the middle of the @@ -403,16 +403,7 @@ func (b *profileBuilder) build() { } locs = locs[:0] - for i, addr := range e.stk { - // Addresses from stack traces point to the - // next instruction after each call, except - // for the leaf, which points to where the - // signal occurred. locForPC expects return - // PCs, so increment the leaf address to look - // like a return PC. - if i == 0 { - addr++ - } + for _, addr := range e.stk { l := b.locForPC(addr) if l == 0 { // runtime.goexit continue diff --git a/src/runtime/pprof/proto_test.go b/src/runtime/pprof/proto_test.go index 4452d5123158e..9b2de5f644c80 100644 --- a/src/runtime/pprof/proto_test.go +++ b/src/runtime/pprof/proto_test.go @@ -133,11 +133,11 @@ func TestConvertCPUProfile(t *testing.T) { samples := []*profile.Sample{ {Value: []int64{20, 20 * 2000 * 1000}, Location: []*profile.Location{ {ID: 1, Mapping: map1, Address: addr1}, - {ID: 2, Mapping: map1, Address: addr1 + 1}, + {ID: 2, Mapping: map1, Address: addr1 + 2}, }}, {Value: []int64{40, 40 * 2000 * 1000}, Location: []*profile.Location{ {ID: 3, Mapping: map2, Address: addr2}, - {ID: 4, Mapping: map2, Address: addr2 + 1}, + {ID: 4, Mapping: map2, Address: addr2 + 2}, }}, } checkProfile(t, p, period, periodType, sampleType, samples, "") diff --git a/src/runtime/pprof/protomem_test.go b/src/runtime/pprof/protomem_test.go index 471b1ae9c3291..65ef4edf8f7f2 100644 --- a/src/runtime/pprof/protomem_test.go +++ b/src/runtime/pprof/protomem_test.go @@ -14,11 +14,7 @@ import ( func TestConvertMemProfile(t *testing.T) { addr1, addr2, map1, map2 := testPCs(t) - // MemProfileRecord stacks are return PCs, so add one to the - // addresses recorded in the "profile". The proto profile - // locations are call PCs, so conversion will subtract one - // from these and get back to addr1 and addr2. - a1, a2 := uintptr(addr1)+1, uintptr(addr2)+1 + a1, a2 := uintptr(addr1), uintptr(addr2) rate := int64(512 * 1024) rec := []runtime.MemProfileRecord{ {AllocBytes: 4096, FreeBytes: 1024, AllocObjects: 4, FreeObjects: 1, Stack0: [32]uintptr{a1, a2}}, diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index edda45c669f67..0fd43309442f2 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -13,17 +13,12 @@ import ( // Frames may be used to get function/file/line information for a // slice of PC values returned by Callers. type Frames struct { - // callers is a slice of PCs that have not yet been expanded. + // callers is a slice of PCs that have not yet been expanded to frames. callers []uintptr - // stackExpander expands callers into a sequence of Frames, - // tracking the necessary state across PCs. - stackExpander stackExpander - - // elideWrapper indicates that, if the next frame is an - // autogenerated wrapper function, it should be elided from - // the stack. - elideWrapper bool + // frames is a slice of Frames that have yet to be returned. + frames []Frame + frameStore [2]Frame } // Frame is the information returned by Frames for each call frame. @@ -59,224 +54,79 @@ type Frame struct { Entry uintptr } -// stackExpander expands a call stack of PCs into a sequence of -// Frames. It tracks state across PCs necessary to perform this -// expansion. -// -// This is the core of the Frames implementation, but is a separate -// internal API to make it possible to use within the runtime without -// heap-allocating the PC slice. The only difference with the public -// Frames API is that the caller is responsible for threading the PC -// slice between expansion steps in this API. If escape analysis were -// smarter, we may not need this (though it may have to be a lot -// smarter). -type stackExpander struct { - // pcExpander expands the current PC into a sequence of Frames. - pcExpander pcExpander - - // If previous caller in iteration was a panic, then the next - // PC in the call stack is the address of the faulting - // instruction instead of the return address of the call. - wasPanic bool - - // skip > 0 indicates that skip frames in the expansion of the - // first PC should be skipped over and callers[1] should also - // be skipped. - skip int -} - // CallersFrames takes a slice of PC values returned by Callers and // prepares to return function/file/line information. // Do not change the slice until you are done with the Frames. func CallersFrames(callers []uintptr) *Frames { - ci := &Frames{} - ci.callers = ci.stackExpander.init(callers) - return ci -} - -func (se *stackExpander) init(callers []uintptr) []uintptr { - if len(callers) >= 1 { - pc := callers[0] - s := pc - skipPC - if s >= 0 && s < sizeofSkipFunction { - // Ignore skip frame callers[0] since this means the caller trimmed the PC slice. - return callers[1:] - } - } - if len(callers) >= 2 { - pc := callers[1] - s := pc - skipPC - if s > 0 && s < sizeofSkipFunction { - // Skip the first s inlined frames when we expand the first PC. - se.skip = int(s) - } - } - return callers + f := &Frames{callers: callers} + f.frames = f.frameStore[:0] + return f } // Next returns frame information for the next caller. // If more is false, there are no more callers (the Frame value is valid). func (ci *Frames) Next() (frame Frame, more bool) { - ci.callers, frame, more = ci.stackExpander.next(ci.callers, ci.elideWrapper) - ci.elideWrapper = elideWrapperCalling(frame.Function) - return -} - -func (se *stackExpander) next(callers []uintptr, elideWrapper bool) (ncallers []uintptr, frame Frame, more bool) { - ncallers = callers -again: - if !se.pcExpander.more { - // Expand the next PC. - if len(ncallers) == 0 { - se.wasPanic = false - return ncallers, Frame{}, false + for len(ci.frames) < 2 { + // Find the next frame. + // We need to look for 2 frames so we know what + // to return for the "more" result. + if len(ci.callers) == 0 { + break } - se.pcExpander.init(ncallers[0], se.wasPanic) - ncallers = ncallers[1:] - se.wasPanic = se.pcExpander.funcInfo.valid() && se.pcExpander.funcInfo.funcID == funcID_sigpanic - if se.skip > 0 { - for ; se.skip > 0; se.skip-- { - se.pcExpander.next() + pc := ci.callers[0] + ci.callers = ci.callers[1:] + funcInfo := findfunc(pc) + if !funcInfo.valid() { + if cgoSymbolizer != nil { + // Pre-expand cgo frames. We could do this + // incrementally, too, but there's no way to + // avoid allocation in this case anyway. + ci.frames = append(ci.frames, expandCgoFrames(pc)...) } - se.skip = 0 - // Drop skipPleaseUseCallersFrames. - ncallers = ncallers[1:] - } - if !se.pcExpander.more { - // No symbolic information for this PC. - // However, we return at least one frame for - // every PC, so return an invalid frame. - return ncallers, Frame{}, len(ncallers) > 0 - } - } - - frame = se.pcExpander.next() - if elideWrapper && frame.File == "" { - // Ignore autogenerated functions such as pointer - // method forwarding functions. These are an - // implementation detail that doesn't reflect the - // source code. - goto again - } - return ncallers, frame, se.pcExpander.more || len(ncallers) > 0 -} - -// A pcExpander expands a single PC into a sequence of Frames. -type pcExpander struct { - // more indicates that the next call to next will return a - // valid frame. - more bool - - // pc is the pc being expanded. - pc uintptr - - // frames is a pre-expanded set of Frames to return from the - // iterator. If this is set, then this is everything that will - // be returned from the iterator. - frames []Frame - - // funcInfo is the funcInfo of the function containing pc. - funcInfo funcInfo - - // inlTree is the inlining tree of the function containing pc. - inlTree *[1 << 20]inlinedCall - - // file and line are the file name and line number of the next - // frame. - file string - line int32 - - // inlIndex is the inlining index of the next frame, or -1 if - // the next frame is an outermost frame. - inlIndex int32 -} - -// init initializes this pcExpander to expand pc. It sets ex.more if -// pc expands to any Frames. -// -// A pcExpander can be reused by calling init again. -// -// If pc was a "call" to sigpanic, panicCall should be true. In this -// case, pc is treated as the address of a faulting instruction -// instead of the return address of a call. -func (ex *pcExpander) init(pc uintptr, panicCall bool) { - ex.more = false - - ex.funcInfo = findfunc(pc) - if !ex.funcInfo.valid() { - if cgoSymbolizer != nil { - // Pre-expand cgo frames. We could do this - // incrementally, too, but there's no way to - // avoid allocation in this case anyway. - ex.frames = expandCgoFrames(pc) - ex.more = len(ex.frames) > 0 + continue } - return - } - - ex.more = true - entry := ex.funcInfo.entry - ex.pc = pc - if ex.pc > entry && !panicCall { - ex.pc-- - } - - // file and line are the innermost position at pc. - ex.file, ex.line = funcline1(ex.funcInfo, ex.pc, false) - - // Get inlining tree at pc - inldata := funcdata(ex.funcInfo, _FUNCDATA_InlTree) - if inldata != nil { - ex.inlTree = (*[1 << 20]inlinedCall)(inldata) - ex.inlIndex = pcdatavalue(ex.funcInfo, _PCDATA_InlTreeIndex, ex.pc, nil) - } else { - ex.inlTree = nil - ex.inlIndex = -1 - } -} - -// next returns the next Frame in the expansion of pc and sets ex.more -// if there are more Frames to follow. -func (ex *pcExpander) next() Frame { - if !ex.more { - return Frame{} - } - - if len(ex.frames) > 0 { - // Return pre-expended frame. - frame := ex.frames[0] - ex.frames = ex.frames[1:] - ex.more = len(ex.frames) > 0 - return frame - } - - if ex.inlIndex >= 0 { - // Return inner inlined frame. - call := ex.inlTree[ex.inlIndex] - frame := Frame{ - PC: ex.pc, - Func: nil, // nil for inlined functions - Function: funcnameFromNameoff(ex.funcInfo, call.func_), - File: ex.file, - Line: int(ex.line), - Entry: ex.funcInfo.entry, + f := funcInfo._Func() + entry := f.Entry() + name := funcname(funcInfo) + file, line := funcline1(funcInfo, pc, false) + if inldata := funcdata(funcInfo, _FUNCDATA_InlTree); inldata != nil { + inltree := (*[1 << 20]inlinedCall)(inldata) + ix := pcdatavalue(funcInfo, _PCDATA_InlTreeIndex, pc, nil) + if ix >= 0 { + // Note: entry is not modified. It always refers to a real frame, not an inlined one. + f = nil + name = funcnameFromNameoff(funcInfo, inltree[ix].func_) + // File/line is already correct. + // TODO: remove file/line from InlinedCall? + } } - ex.file = funcfile(ex.funcInfo, call.file) - ex.line = call.line - ex.inlIndex = call.parent - return frame + ci.frames = append(ci.frames, Frame{ + PC: pc, + Func: f, + Function: name, + File: file, + Line: int(line), + Entry: entry, + }) } - // No inlining or pre-expanded frames. - ex.more = false - return Frame{ - PC: ex.pc, - Func: ex.funcInfo._Func(), - Function: funcname(ex.funcInfo), - File: ex.file, - Line: int(ex.line), - Entry: ex.funcInfo.entry, - } + // Pop one frame from the frame list. Keep the rest. + // Avoid allocation in the common case, which is 1 or 2 frames. + switch len(ci.frames) { + case 0: // In the rare case when there are no frames at all, we return Frame{}. + case 1: + frame = ci.frames[0] + ci.frames = ci.frameStore[:0] + case 2: + frame = ci.frames[0] + ci.frameStore[0] = ci.frames[1] + ci.frames = ci.frameStore[:1] + default: + frame = ci.frames[0] + ci.frames = ci.frames[1:] + } + more = len(ci.frames) > 0 + return } // expandCgoFrames expands frame information for pc, known to be @@ -378,6 +228,9 @@ const ( funcID_gogo funcID_externalthreadhandler funcID_debugCallV1 + funcID_gopanic + funcID_panicwrap + funcID_wrapper // any autogenerated code (hash/eq algorithms, method wrappers, etc.) ) // moduledata records information about the layout of the executable @@ -943,8 +796,11 @@ func stackmapdata(stkmap *stackmap, n int32) bitvector { // inlinedCall is the encoding of entries in the FUNCDATA_InlTree table. type inlinedCall struct { - parent int32 // index of parent in the inltree, or < 0 - file int32 // fileno index into filetab - line int32 // line number of the call site - func_ int32 // offset into pclntab for name of called function + parent int16 // index of parent in the inltree, or < 0 + funcID funcID // type of the called function + _ byte + file int32 // fileno index into filetab + line int32 // line number of the call site + func_ int32 // offset into pclntab for name of called function + parentPc int32 // position of an instruction whose source position is the call site (offset from entry) } diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 0328fee4e640d..da15ed0680d86 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -179,6 +179,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in var cache pcvalueCache + lastFuncID := funcID_normal n := 0 for n < max { // Typically: @@ -344,48 +345,44 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in } if pcbuf != nil { - if skip == 0 { - (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = frame.pc - } else { - // backup to CALL instruction to read inlining info (same logic as below) - tracepc := frame.pc - if (n > 0 || flags&_TraceTrap == 0) && frame.pc > f.entry && !waspanic { - tracepc-- - } - inldata := funcdata(f, _FUNCDATA_InlTree) - - // no inlining info, skip the physical frame - if inldata == nil { - skip-- - goto skipped - } + // backup to CALL instruction to read inlining info (same logic as below) + tracepc := frame.pc + if (n > 0 || flags&_TraceTrap == 0) && frame.pc > f.entry && !waspanic { + tracepc-- + } - ix := pcdatavalue(f, _PCDATA_InlTreeIndex, tracepc, &cache) + // If there is inlining info, record the inner frames. + if inldata := funcdata(f, _FUNCDATA_InlTree); inldata != nil { inltree := (*[1 << 20]inlinedCall)(inldata) - // skip the logical (inlined) frames - logicalSkipped := 0 - for ix >= 0 && skip > 0 { - skip-- - logicalSkipped++ - ix = inltree[ix].parent - } - - // skip the physical frame if there's more to skip - if skip > 0 { - skip-- - goto skipped - } - - // now we have a partially skipped frame - (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = frame.pc - - // if there's room, pcbuf[1] is a skip PC that encodes the number of skipped frames in pcbuf[0] - if n+1 < max { - n++ - pc := skipPC + uintptr(logicalSkipped) - (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = pc + for { + ix := pcdatavalue(f, _PCDATA_InlTreeIndex, tracepc, &cache) + if ix < 0 { + break + } + if inltree[ix].funcID == funcID_wrapper && elideWrapperCalling(lastFuncID) { + // ignore wrappers + } else if skip > 0 { + skip-- + } else if n < max { + (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = tracepc + n++ + } + lastFuncID = inltree[ix].funcID + // Back up to an instruction in the "caller". + tracepc = frame.fn.entry + uintptr(inltree[ix].parentPc) } } + // Record the main frame. + if f.funcID == funcID_wrapper && elideWrapperCalling(lastFuncID) { + // Ignore wrapper functions (except when they trigger panics). + } else if skip > 0 { + skip-- + } else if n < max { + (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = tracepc + n++ + } + lastFuncID = f.funcID + n-- // offset n++ below } if printing { @@ -396,7 +393,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in // called panic rather than the wrapped // function. Otherwise, leave them out. name := funcname(f) - nextElideWrapper := elideWrapperCalling(name) + nextElideWrapper := elideWrapperCalling(f.funcID) if (flags&_TraceRuntimeFrames) != 0 || showframe(f, gp, nprint == 0, elideWrapper && nprint != 0) { // Print during crash. // main(0x1, 0x2, 0x3) @@ -418,7 +415,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in file = funcfile(f, inltree[ix].file) line = inltree[ix].line - ix = inltree[ix].parent + ix = int32(inltree[ix].parent) } } if name == "runtime.gopanic" { @@ -451,7 +448,6 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in } n++ - skipped: if f.funcID == funcID_cgocallback_gofunc && len(cgoCtxt) > 0 { ctxt := cgoCtxt[len(cgoCtxt)-1] cgoCtxt = cgoCtxt[:len(cgoCtxt)-1] @@ -798,7 +794,7 @@ func printAncestorTracebackFuncInfo(f funcInfo, pc uintptr) bool { file = funcfile(f, inltree[ix].file) line = inltree[ix].line - ix = inltree[ix].parent + ix = int32(inltree[ix].parent) } } name := funcname(f) @@ -811,7 +807,7 @@ func printAncestorTracebackFuncInfo(f funcInfo, pc uintptr) bool { print(" +", hex(pc-f.entry)) } print("\n") - return elideWrapperCalling(name) + return elideWrapperCalling(f.funcID) } func callers(skip int, pcbuf []uintptr) int { @@ -877,11 +873,11 @@ func isExportedRuntime(name string) bool { } // elideWrapperCalling reports whether a wrapper function that called -// function "name" should be elided from stack traces. -func elideWrapperCalling(name string) bool { +// function id should be elided from stack traces. +func elideWrapperCalling(id funcID) bool { // If the wrapper called a panic function instead of the // wrapped function, we want to include it in stacks. - return !(name == "runtime.gopanic" || name == "runtime.sigpanic" || name == "runtime.panicwrap") + return !(id == funcID_gopanic || id == funcID_sigpanic || id == funcID_panicwrap) } var gStatusStrings = [...]string{ diff --git a/test/fixedbugs/issue5856.go b/test/fixedbugs/issue5856.go index 5e16c78b4d9b3..f13258854e5c4 100644 --- a/test/fixedbugs/issue5856.go +++ b/test/fixedbugs/issue5856.go @@ -29,7 +29,7 @@ func f() { } func g() { - _, file, line, _ := runtime.Caller(3) + _, file, line, _ := runtime.Caller(2) if !strings.HasSuffix(file, "issue5856.go") || line != 28 { fmt.Printf("BUG: defer called from %s:%d, want issue5856.go:28\n", file, line) os.Exit(1) diff --git a/test/inline_callers.go b/test/inline_callers.go index 6df6861951281..f2c05622dd1d7 100644 --- a/test/inline_callers.go +++ b/test/inline_callers.go @@ -56,11 +56,11 @@ func testCallersFrames(skp int) (frames []string) { } var expectedFrames [][]string = [][]string{ - 0: {"runtime.Callers", "main.testCallers", "main.main"}, - 1: {"main.testCallers", "main.main"}, - 2: {"main.testCallers", "runtime.skipPleaseUseCallersFrames", "main.main"}, - 3: {"main.testCallers", "runtime.skipPleaseUseCallersFrames", "main.main"}, - 4: {"main.testCallers", "runtime.skipPleaseUseCallersFrames", "main.main"}, + 0: {"runtime.Callers", "main.testCallers", "main.testCallers", "main.testCallers", "main.testCallers", "main.main"}, + 1: {"main.testCallers", "main.testCallers", "main.testCallers", "main.testCallers", "main.main"}, + 2: {"main.testCallers", "main.testCallers", "main.testCallers", "main.main"}, + 3: {"main.testCallers", "main.testCallers", "main.main"}, + 4: {"main.testCallers", "main.main"}, 5: {"main.main"}, } From d4599629674251e9134ea8e0aa4039d9de3dd678 Mon Sep 17 00:00:00 2001 From: Mostyn Bramley-Moore Date: Fri, 28 Dec 2018 20:02:13 +0000 Subject: [PATCH 438/594] encoding/gob: mention that Encoder and Decoder are safe for concurrent use Fixes #29416 Change-Id: I24364bfee77aceace53f85f1046ef4d73f8feebb Change-Id: I24364bfee77aceace53f85f1046ef4d73f8feebb GitHub-Last-Rev: ad9f31145763dc16f53dd9f3154667b162759f69 GitHub-Pull-Request: golang/go#29417 Reviewed-on: https://go-review.googlesource.com/c/155742 Reviewed-by: Ian Lance Taylor --- src/encoding/gob/decoder.go | 3 ++- src/encoding/gob/encoder.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/encoding/gob/decoder.go b/src/encoding/gob/decoder.go index f4f740ef4227c..b52aabe54b532 100644 --- a/src/encoding/gob/decoder.go +++ b/src/encoding/gob/decoder.go @@ -18,7 +18,8 @@ import ( const tooBig = (1 << 30) << (^uint(0) >> 62) // A Decoder manages the receipt of type and data information read from the -// remote side of a connection. +// remote side of a connection. It is safe for concurrent use by multiple +// goroutines. // // The Decoder does only basic sanity checking on decoded input sizes, // and its limits are not configurable. Take caution when decoding gob data diff --git a/src/encoding/gob/encoder.go b/src/encoding/gob/encoder.go index 40ec81b6e6936..53e2cace16674 100644 --- a/src/encoding/gob/encoder.go +++ b/src/encoding/gob/encoder.go @@ -12,7 +12,8 @@ import ( ) // An Encoder manages the transmission of type and data information to the -// other side of a connection. +// other side of a connection. It is safe for concurrent use by multiple +// goroutines. type Encoder struct { mutex sync.Mutex // each item must be sent atomically w []io.Writer // where to send the data From 14bdcc76fd9aa3edda64ef07a526fbeeed8b4326 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 28 Dec 2018 12:43:48 -0800 Subject: [PATCH 439/594] cmd/compile: fix racewalk{enter,exit} removal We can't remove race instrumentation unless there are no calls, not just no static calls. Closure and interface calls also count. The problem in issue 29329 is that there was a racefuncenter, an InterCall, and a racefuncexit. The racefuncenter was removed, then the InterCall was rewritten to a StaticCall. That prevented the racefuncexit from being removed. That caused an imbalance in racefuncenter/racefuncexit calls, which made the race detector barf. Bug introduced at CL 121235 Fixes #29329 Change-Id: I2c94ac6cf918dd910b74b2a0de5dc2480d236f16 Reviewed-on: https://go-review.googlesource.com/c/155917 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/ssa/rewrite.go | 6 +- test/fixedbugs/issue29329.go | 106 ++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 test/fixedbugs/issue29329.go diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go index 69365c4e6066b..a154249371a29 100644 --- a/src/cmd/compile/internal/ssa/rewrite.go +++ b/src/cmd/compile/internal/ssa/rewrite.go @@ -1111,7 +1111,8 @@ func needRaceCleanup(sym interface{}, v *Value) bool { } for _, b := range f.Blocks { for _, v := range b.Values { - if v.Op == OpStaticCall { + switch v.Op { + case OpStaticCall: switch v.Aux.(fmt.Stringer).String() { case "runtime.racefuncenter", "runtime.racefuncexit", "runtime.panicindex", "runtime.panicslice", "runtime.panicdivide", "runtime.panicwrap": @@ -1122,6 +1123,9 @@ func needRaceCleanup(sym interface{}, v *Value) bool { // for accurate stacktraces. return false } + case OpClosureCall, OpInterCall: + // We must keep the race functions if there are any other call types. + return false } } } diff --git a/test/fixedbugs/issue29329.go b/test/fixedbugs/issue29329.go new file mode 100644 index 0000000000000..1c2825e3bc0ae --- /dev/null +++ b/test/fixedbugs/issue29329.go @@ -0,0 +1,106 @@ +// run -race + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build linux,amd64 + +package main + +import ( + "fmt" +) + +type LineString []Point +type Point [2]float64 + +//go:noinline +func benchmarkData() LineString { + return LineString{{1.0, 2.0}} +} + +func (ls LineString) Clone() LineString { + ps := MultiPoint(ls) + return LineString(ps.Clone()) +} + +type MultiPoint []Point + +func (mp MultiPoint) Clone() MultiPoint { + if mp == nil { + return nil + } + + points := make([]Point, len(mp)) + copy(points, mp) + + return MultiPoint(points) +} + +func F1() { + cases := []struct { + threshold float64 + length int + }{ + {0.1, 1118}, + {0.5, 257}, + {1.0, 144}, + {1.5, 95}, + {2.0, 71}, + {3.0, 46}, + {4.0, 39}, + {5.0, 33}, + } + + ls := benchmarkData() + + for k := 0; k < 100; k++ { + for i, tc := range cases { + r := DouglasPeucker(tc.threshold).LineString(ls.Clone()) + if len(r) == tc.length { + fmt.Printf("%d: unexpected\n", i) + } + } + } +} + +// A DouglasPeuckerSimplifier wraps the DouglasPeucker function. +type DouglasPeuckerSimplifier struct { + Threshold float64 +} + +// DouglasPeucker creates a new DouglasPeuckerSimplifier. +func DouglasPeucker(threshold float64) *DouglasPeuckerSimplifier { + return &DouglasPeuckerSimplifier{ + Threshold: threshold, + } +} + +func (s *DouglasPeuckerSimplifier) LineString(ls LineString) LineString { + return lineString(s, ls) +} + +type simplifier interface { + simplify(LineString, bool) (LineString, []int) +} + +func lineString(s simplifier, ls LineString) LineString { + return runSimplify(s, ls) +} + +func runSimplify(s simplifier, ls LineString) LineString { + if len(ls) <= 2 { + return ls + } + ls, _ = s.simplify(ls, false) + return ls +} + +func (s *DouglasPeuckerSimplifier) simplify(ls LineString, wim bool) (LineString, []int) { + return nil, nil +} + +func main() { + F1() +} From ed15e82413c7b16e21a493f5a647f68b46e965ee Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 28 Dec 2018 14:34:48 -0800 Subject: [PATCH 440/594] runtime: panic on uncomparable map key, even if map is empty Reorg map flags a bit so we don't need any extra space for the extra flag. Fixes #23734 Change-Id: I436812156240ae90de53d0943fe1aabf3ea37417 Reviewed-on: https://go-review.googlesource.com/c/155918 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/compile/internal/gc/reflect.go | 44 ++++++++++++++++--- src/reflect/type.go | 58 +++++++++++++++++------- src/runtime/map.go | 61 +++++++++++++++----------- src/runtime/type.go | 37 +++++++++++----- test/fixedbugs/issue23734.go | 32 ++++++++++++++ 5 files changed, 172 insertions(+), 60 deletions(-) create mode 100644 test/fixedbugs/issue23734.go diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 2863d4b5d0ca7..7a93ece8b9036 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -1095,6 +1095,28 @@ func needkeyupdate(t *types.Type) bool { } } +// hashMightPanic reports whether the hash of a map key of type t might panic. +func hashMightPanic(t *types.Type) bool { + switch t.Etype { + case TINTER: + return true + + case TARRAY: + return hashMightPanic(t.Elem()) + + case TSTRUCT: + for _, t1 := range t.Fields().Slice() { + if hashMightPanic(t1.Type) { + return true + } + } + return false + + default: + return false + } +} + // formalType replaces byte and rune aliases with real types. // They've been separate internally to make error messages // better, but we have to merge them in the reflect tables. @@ -1257,25 +1279,33 @@ func dtypesym(t *types.Type) *obj.LSym { ot = dsymptr(lsym, ot, s1, 0) ot = dsymptr(lsym, ot, s2, 0) ot = dsymptr(lsym, ot, s3, 0) + var flags uint32 + // Note: flags must match maptype accessors in ../../../../runtime/type.go + // and maptype builder in ../../../../reflect/type.go:MapOf. if t.Key().Width > MAXKEYSIZE { ot = duint8(lsym, ot, uint8(Widthptr)) - ot = duint8(lsym, ot, 1) // indirect + flags |= 1 // indirect key } else { ot = duint8(lsym, ot, uint8(t.Key().Width)) - ot = duint8(lsym, ot, 0) // not indirect } if t.Elem().Width > MAXVALSIZE { ot = duint8(lsym, ot, uint8(Widthptr)) - ot = duint8(lsym, ot, 1) // indirect + flags |= 2 // indirect value } else { ot = duint8(lsym, ot, uint8(t.Elem().Width)) - ot = duint8(lsym, ot, 0) // not indirect } - ot = duint16(lsym, ot, uint16(bmap(t).Width)) - ot = duint8(lsym, ot, uint8(obj.Bool2int(isreflexive(t.Key())))) - ot = duint8(lsym, ot, uint8(obj.Bool2int(needkeyupdate(t.Key())))) + if isreflexive(t.Key()) { + flags |= 4 // reflexive key + } + if needkeyupdate(t.Key()) { + flags |= 8 // need key update + } + if hashMightPanic(t.Key()) { + flags |= 16 // hash might panic + } + ot = duint32(lsym, ot, flags) ot = dextratype(lsym, ot, t, 0) case TPTR: diff --git a/src/reflect/type.go b/src/reflect/type.go index f48f9cf09de46..5ce80c61dcfdf 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -394,16 +394,13 @@ type interfaceType struct { // mapType represents a map type. type mapType struct { rtype - key *rtype // map key type - elem *rtype // map element (value) type - bucket *rtype // internal bucket structure - keysize uint8 // size of key slot - indirectkey uint8 // store ptr to key instead of key itself - valuesize uint8 // size of value slot - indirectvalue uint8 // store ptr to value instead of value itself - bucketsize uint16 // size of bucket - reflexivekey bool // true if k==k for all keys - needkeyupdate bool // true if we need to update key on an overwrite + key *rtype // map key type + elem *rtype // map element (value) type + bucket *rtype // internal bucket structure + keysize uint8 // size of key slot + valuesize uint8 // size of value slot + bucketsize uint16 // size of bucket + flags uint32 } // ptrType represents a pointer type. @@ -1859,6 +1856,8 @@ func MapOf(key, elem Type) Type { } // Make a map type. + // Note: flag values must match those used in the TMAP case + // in ../cmd/compile/internal/gc/reflect.go:dtypesym. var imap interface{} = (map[unsafe.Pointer]unsafe.Pointer)(nil) mt := **(**mapType)(unsafe.Pointer(&imap)) mt.str = resolveReflectName(newName(s, "", false)) @@ -1867,23 +1866,29 @@ func MapOf(key, elem Type) Type { mt.key = ktyp mt.elem = etyp mt.bucket = bucketOf(ktyp, etyp) + mt.flags = 0 if ktyp.size > maxKeySize { mt.keysize = uint8(ptrSize) - mt.indirectkey = 1 + mt.flags |= 1 // indirect key } else { mt.keysize = uint8(ktyp.size) - mt.indirectkey = 0 } if etyp.size > maxValSize { mt.valuesize = uint8(ptrSize) - mt.indirectvalue = 1 + mt.flags |= 2 // indirect value } else { mt.valuesize = uint8(etyp.size) - mt.indirectvalue = 0 } mt.bucketsize = uint16(mt.bucket.size) - mt.reflexivekey = isReflexive(ktyp) - mt.needkeyupdate = needKeyUpdate(ktyp) + if isReflexive(ktyp) { + mt.flags |= 4 + } + if needKeyUpdate(ktyp) { + mt.flags |= 8 + } + if hashMightPanic(ktyp) { + mt.flags |= 16 + } mt.ptrToThis = 0 ti, _ := lookupCache.LoadOrStore(ckey, &mt.rtype) @@ -2122,6 +2127,27 @@ func needKeyUpdate(t *rtype) bool { } } +// hashMightPanic reports whether the hash of a map key of type t might panic. +func hashMightPanic(t *rtype) bool { + switch t.Kind() { + case Interface: + return true + case Array: + tt := (*arrayType)(unsafe.Pointer(t)) + return hashMightPanic(tt.elem) + case Struct: + tt := (*structType)(unsafe.Pointer(t)) + for _, f := range tt.fields { + if hashMightPanic(f.typ) { + return true + } + } + return false + default: + return false + } +} + // Make sure these routines stay in sync with ../../runtime/map.go! // These types exist only for GC, so we only fill out GC relevant info. // Currently, that's just size and the GC program. We also fill in string diff --git a/src/runtime/map.go b/src/runtime/map.go index d835cc831aafa..9c25b63348f5b 100644 --- a/src/runtime/map.go +++ b/src/runtime/map.go @@ -404,6 +404,9 @@ func mapaccess1(t *maptype, h *hmap, key unsafe.Pointer) unsafe.Pointer { msanread(key, t.key.size) } if h == nil || h.count == 0 { + if t.hashMightPanic() { + t.key.alg.hash(key, 0) // see issue 23734 + } return unsafe.Pointer(&zeroVal[0]) } if h.flags&hashWriting != 0 { @@ -434,12 +437,12 @@ bucketloop: continue } k := add(unsafe.Pointer(b), dataOffset+i*uintptr(t.keysize)) - if t.indirectkey { + if t.indirectkey() { k = *((*unsafe.Pointer)(k)) } if alg.equal(key, k) { v := add(unsafe.Pointer(b), dataOffset+bucketCnt*uintptr(t.keysize)+i*uintptr(t.valuesize)) - if t.indirectvalue { + if t.indirectvalue() { v = *((*unsafe.Pointer)(v)) } return v @@ -460,6 +463,9 @@ func mapaccess2(t *maptype, h *hmap, key unsafe.Pointer) (unsafe.Pointer, bool) msanread(key, t.key.size) } if h == nil || h.count == 0 { + if t.hashMightPanic() { + t.key.alg.hash(key, 0) // see issue 23734 + } return unsafe.Pointer(&zeroVal[0]), false } if h.flags&hashWriting != 0 { @@ -490,12 +496,12 @@ bucketloop: continue } k := add(unsafe.Pointer(b), dataOffset+i*uintptr(t.keysize)) - if t.indirectkey { + if t.indirectkey() { k = *((*unsafe.Pointer)(k)) } if alg.equal(key, k) { v := add(unsafe.Pointer(b), dataOffset+bucketCnt*uintptr(t.keysize)+i*uintptr(t.valuesize)) - if t.indirectvalue { + if t.indirectvalue() { v = *((*unsafe.Pointer)(v)) } return v, true @@ -535,12 +541,12 @@ bucketloop: continue } k := add(unsafe.Pointer(b), dataOffset+i*uintptr(t.keysize)) - if t.indirectkey { + if t.indirectkey() { k = *((*unsafe.Pointer)(k)) } if alg.equal(key, k) { v := add(unsafe.Pointer(b), dataOffset+bucketCnt*uintptr(t.keysize)+i*uintptr(t.valuesize)) - if t.indirectvalue { + if t.indirectvalue() { v = *((*unsafe.Pointer)(v)) } return k, v @@ -620,14 +626,14 @@ bucketloop: continue } k := add(unsafe.Pointer(b), dataOffset+i*uintptr(t.keysize)) - if t.indirectkey { + if t.indirectkey() { k = *((*unsafe.Pointer)(k)) } if !alg.equal(key, k) { continue } // already have a mapping for key. Update it. - if t.needkeyupdate { + if t.needkeyupdate() { typedmemmove(t.key, k, key) } val = add(unsafe.Pointer(b), dataOffset+bucketCnt*uintptr(t.keysize)+i*uintptr(t.valuesize)) @@ -658,12 +664,12 @@ bucketloop: } // store new key/value at insert position - if t.indirectkey { + if t.indirectkey() { kmem := newobject(t.key) *(*unsafe.Pointer)(insertk) = kmem insertk = kmem } - if t.indirectvalue { + if t.indirectvalue() { vmem := newobject(t.elem) *(*unsafe.Pointer)(val) = vmem } @@ -676,7 +682,7 @@ done: throw("concurrent map writes") } h.flags &^= hashWriting - if t.indirectvalue { + if t.indirectvalue() { val = *((*unsafe.Pointer)(val)) } return val @@ -693,6 +699,9 @@ func mapdelete(t *maptype, h *hmap, key unsafe.Pointer) { msanread(key, t.key.size) } if h == nil || h.count == 0 { + if t.hashMightPanic() { + t.key.alg.hash(key, 0) // see issue 23734 + } return } if h.flags&hashWriting != 0 { @@ -724,20 +733,20 @@ search: } k := add(unsafe.Pointer(b), dataOffset+i*uintptr(t.keysize)) k2 := k - if t.indirectkey { + if t.indirectkey() { k2 = *((*unsafe.Pointer)(k2)) } if !alg.equal(key, k2) { continue } // Only clear key if there are pointers in it. - if t.indirectkey { + if t.indirectkey() { *(*unsafe.Pointer)(k) = nil } else if t.key.kind&kindNoPointers == 0 { memclrHasPointers(k, t.key.size) } v := add(unsafe.Pointer(b), dataOffset+bucketCnt*uintptr(t.keysize)+i*uintptr(t.valuesize)) - if t.indirectvalue { + if t.indirectvalue() { *(*unsafe.Pointer)(v) = nil } else if t.elem.kind&kindNoPointers == 0 { memclrHasPointers(v, t.elem.size) @@ -897,7 +906,7 @@ next: continue } k := add(unsafe.Pointer(b), dataOffset+uintptr(offi)*uintptr(t.keysize)) - if t.indirectkey { + if t.indirectkey() { k = *((*unsafe.Pointer)(k)) } v := add(unsafe.Pointer(b), dataOffset+bucketCnt*uintptr(t.keysize)+uintptr(offi)*uintptr(t.valuesize)) @@ -909,7 +918,7 @@ next: // through the oldbucket, skipping any keys that will go // to the other new bucket (each oldbucket expands to two // buckets during a grow). - if t.reflexivekey || alg.equal(k, k) { + if t.reflexivekey() || alg.equal(k, k) { // If the item in the oldbucket is not destined for // the current new bucket in the iteration, skip it. hash := alg.hash(k, uintptr(h.hash0)) @@ -930,13 +939,13 @@ next: } } if (b.tophash[offi] != evacuatedX && b.tophash[offi] != evacuatedY) || - !(t.reflexivekey || alg.equal(k, k)) { + !(t.reflexivekey() || alg.equal(k, k)) { // This is the golden data, we can return it. // OR // key!=key, so the entry can't be deleted or updated, so we can just return it. // That's lucky for us because when key!=key we can't look it up successfully. it.key = k - if t.indirectvalue { + if t.indirectvalue() { v = *((*unsafe.Pointer)(v)) } it.value = v @@ -1160,7 +1169,7 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { throw("bad map state") } k2 := k - if t.indirectkey { + if t.indirectkey() { k2 = *((*unsafe.Pointer)(k2)) } var useY uint8 @@ -1168,7 +1177,7 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { // Compute hash to make our evacuation decision (whether we need // to send this key/value to bucket x or bucket y). hash := t.key.alg.hash(k2, uintptr(h.hash0)) - if h.flags&iterator != 0 && !t.reflexivekey && !t.key.alg.equal(k2, k2) { + if h.flags&iterator != 0 && !t.reflexivekey() && !t.key.alg.equal(k2, k2) { // If key != key (NaNs), then the hash could be (and probably // will be) entirely different from the old hash. Moreover, // it isn't reproducible. Reproducibility is required in the @@ -1203,12 +1212,12 @@ func evacuate(t *maptype, h *hmap, oldbucket uintptr) { dst.v = add(dst.k, bucketCnt*uintptr(t.keysize)) } dst.b.tophash[dst.i&(bucketCnt-1)] = top // mask dst.i as an optimization, to avoid a bounds check - if t.indirectkey { + if t.indirectkey() { *(*unsafe.Pointer)(dst.k) = k2 // copy pointer } else { typedmemmove(t.key, dst.k, k) // copy value } - if t.indirectvalue { + if t.indirectvalue() { *(*unsafe.Pointer)(dst.v) = *(*unsafe.Pointer)(v) } else { typedmemmove(t.elem, dst.v, v) @@ -1274,12 +1283,12 @@ func reflect_makemap(t *maptype, cap int) *hmap { if !ismapkey(t.key) { throw("runtime.reflect_makemap: unsupported map key type") } - if t.key.size > maxKeySize && (!t.indirectkey || t.keysize != uint8(sys.PtrSize)) || - t.key.size <= maxKeySize && (t.indirectkey || t.keysize != uint8(t.key.size)) { + if t.key.size > maxKeySize && (!t.indirectkey() || t.keysize != uint8(sys.PtrSize)) || + t.key.size <= maxKeySize && (t.indirectkey() || t.keysize != uint8(t.key.size)) { throw("key size wrong") } - if t.elem.size > maxValueSize && (!t.indirectvalue || t.valuesize != uint8(sys.PtrSize)) || - t.elem.size <= maxValueSize && (t.indirectvalue || t.valuesize != uint8(t.elem.size)) { + if t.elem.size > maxValueSize && (!t.indirectvalue() || t.valuesize != uint8(sys.PtrSize)) || + t.elem.size <= maxValueSize && (t.indirectvalue() || t.valuesize != uint8(t.elem.size)) { throw("value size wrong") } if t.key.align > bucketCnt { diff --git a/src/runtime/type.go b/src/runtime/type.go index 88a44a37ed3da..f7f99924eaf75 100644 --- a/src/runtime/type.go +++ b/src/runtime/type.go @@ -361,17 +361,32 @@ type interfacetype struct { } type maptype struct { - typ _type - key *_type - elem *_type - bucket *_type // internal type representing a hash bucket - keysize uint8 // size of key slot - indirectkey bool // store ptr to key instead of key itself - valuesize uint8 // size of value slot - indirectvalue bool // store ptr to value instead of value itself - bucketsize uint16 // size of bucket - reflexivekey bool // true if k==k for all keys - needkeyupdate bool // true if we need to update key on an overwrite + typ _type + key *_type + elem *_type + bucket *_type // internal type representing a hash bucket + keysize uint8 // size of key slot + valuesize uint8 // size of value slot + bucketsize uint16 // size of bucket + flags uint32 +} + +// Note: flag values must match those used in the TMAP case +// in ../cmd/compile/internal/gc/reflect.go:dtypesym. +func (mt *maptype) indirectkey() bool { // store ptr to key instead of key itself + return mt.flags&1 != 0 +} +func (mt *maptype) indirectvalue() bool { // store ptr to value instead of value itself + return mt.flags&2 != 0 +} +func (mt *maptype) reflexivekey() bool { // true if k==k for all keys + return mt.flags&4 != 0 +} +func (mt *maptype) needkeyupdate() bool { // true if we need to update key on an overwrite + return mt.flags&8 != 0 +} +func (mt *maptype) hashMightPanic() bool { // true if hash function might panic + return mt.flags&16 != 0 } type arraytype struct { diff --git a/test/fixedbugs/issue23734.go b/test/fixedbugs/issue23734.go new file mode 100644 index 0000000000000..dd5869b8f0039 --- /dev/null +++ b/test/fixedbugs/issue23734.go @@ -0,0 +1,32 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func main() { + m := map[interface{}]int{} + k := []int{} + + mustPanic(func() { + _ = m[k] + }) + mustPanic(func() { + _, _ = m[k] + }) + mustPanic(func() { + delete(m, k) + }) +} + +func mustPanic(f func()) { + defer func() { + r := recover() + if r == nil { + panic("didn't panic") + } + }() + f() +} From efbd01f1dc34a05136244886ed95eea318a8d053 Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Sat, 29 Dec 2018 13:11:34 +0100 Subject: [PATCH 441/594] test: disable issue 29329 test when cgo is not enabled CL 155917 added a -race test that shouldn't be run when cgo is not enabled. Enforce this in the test file, with a buildflag. Fixes the nocgo builder. Change-Id: I9fe0d8f21da4d6e2de3f8fe9395e1fa7e9664b02 Reviewed-on: https://go-review.googlesource.com/c/155957 Run-TryBot: Alberto Donizetti Reviewed-by: Brad Fitzpatrick --- test/fixedbugs/issue29329.go | 1 + 1 file changed, 1 insertion(+) diff --git a/test/fixedbugs/issue29329.go b/test/fixedbugs/issue29329.go index 1c2825e3bc0ae..7818bca30a02e 100644 --- a/test/fixedbugs/issue29329.go +++ b/test/fixedbugs/issue29329.go @@ -1,3 +1,4 @@ +// +build cgo // run -race // Copyright 2018 The Go Authors. All rights reserved. From 58a17b43d14a1e31e5aa2738747157488168cd96 Mon Sep 17 00:00:00 2001 From: Taufiq Rahman Date: Sat, 29 Dec 2018 16:18:11 +0000 Subject: [PATCH 442/594] net/http: fix typographical error in transport.go Change-Id: I5f9de0daa3c18ecd7d6cd30ea13d147e227b3550 GitHub-Last-Rev: 5eabcbd91f8988c8f74f5bd11fb0e79cb85a9451 GitHub-Pull-Request: golang/go#29454 Reviewed-on: https://go-review.googlesource.com/c/155920 Reviewed-by: Brad Fitzpatrick --- src/net/http/transport.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/http/transport.go b/src/net/http/transport.go index 44d27d05c2f1d..a8c5efe6aaff2 100644 --- a/src/net/http/transport.go +++ b/src/net/http/transport.go @@ -134,7 +134,7 @@ type Transport struct { // // DialContext runs concurrently with calls to RoundTrip. // A RoundTrip call that initiates a dial may end up using - // an connection dialed previously when the earlier connection + // a connection dialed previously when the earlier connection // becomes idle before the later DialContext completes. DialContext func(ctx context.Context, network, addr string) (net.Conn, error) @@ -142,7 +142,7 @@ type Transport struct { // // Dial runs concurrently with calls to RoundTrip. // A RoundTrip call that initiates a dial may end up using - // an connection dialed previously when the earlier connection + // a connection dialed previously when the earlier connection // becomes idle before the later Dial completes. // // Deprecated: Use DialContext instead, which allows the transport From 3e89272f9c87f69dc687b96687b1e3d29e9f5d84 Mon Sep 17 00:00:00 2001 From: Jordan Rhee Date: Sat, 29 Dec 2018 16:19:16 -0800 Subject: [PATCH 443/594] runtime: use EnumTimeFormatsEx instead of EnumWindows in callback tests Use EnumTimeFormatsEx() to test panics across callback boundaries instead of EnumWindows(). EnumWindows() is incompatible with Go's panic unwinding mechanism. See the associated issue for more information. Updates #26148 Change-Id: If1dd70885d9c418b980b6827942cb1fd16c73803 Reviewed-on: https://go-review.googlesource.com/c/155923 Run-TryBot: Alex Brainman Reviewed-by: Alex Brainman --- src/runtime/syscall_windows_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go index 0882e9cb73b6d..3ad6512976774 100644 --- a/src/runtime/syscall_windows_test.go +++ b/src/runtime/syscall_windows_test.go @@ -157,7 +157,7 @@ func TestEnumWindows(t *testing.T) { } } -func callback(hwnd syscall.Handle, lparam uintptr) uintptr { +func callback(timeFormatString unsafe.Pointer, lparam uintptr) uintptr { (*(*func())(unsafe.Pointer(&lparam)))() return 0 // stop enumeration } @@ -165,9 +165,10 @@ func callback(hwnd syscall.Handle, lparam uintptr) uintptr { // nestedCall calls into Windows, back into Go, and finally to f. func nestedCall(t *testing.T, f func()) { c := syscall.NewCallback(callback) - d := GetDLL(t, "user32.dll") + d := GetDLL(t, "kernel32.dll") defer d.Release() - d.Proc("EnumWindows").Call(c, uintptr(*(*unsafe.Pointer)(unsafe.Pointer(&f)))) + const LOCALE_NAME_USER_DEFAULT = 0 + d.Proc("EnumTimeFormatsEx").Call(c, LOCALE_NAME_USER_DEFAULT, 0, uintptr(*(*unsafe.Pointer)(unsafe.Pointer(&f)))) } func TestCallback(t *testing.T) { From f4f1b14ab497539bc2fd326965c8a4b40bbae49d Mon Sep 17 00:00:00 2001 From: Hidetatsu Yaginuma Date: Sun, 30 Dec 2018 16:03:53 +0900 Subject: [PATCH 444/594] strconv: add missing package name into doc.go(godoc overview) Change-Id: I336ad707a85bf0c81b6c2230c90452c0b3b92924 Reviewed-on: https://go-review.googlesource.com/c/155998 Reviewed-by: Robert Griesemer --- src/strconv/doc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strconv/doc.go b/src/strconv/doc.go index cba898426afe7..8db725f96ae5c 100644 --- a/src/strconv/doc.go +++ b/src/strconv/doc.go @@ -46,8 +46,8 @@ // The latter guarantees that the result is an ASCII string, by escaping // any non-ASCII Unicode with \u: // -// q := Quote("Hello, 世界") -// q := QuoteToASCII("Hello, 世界") +// q := strconv.Quote("Hello, 世界") +// q := strconv.QuoteToASCII("Hello, 世界") // // QuoteRune and QuoteRuneToASCII are similar but accept runes and // return quoted Go rune literals. From 480373c7560cd64e4b6c624d84e9d0de6d72c076 Mon Sep 17 00:00:00 2001 From: Yuval Pavel Zholkover Date: Sat, 29 Dec 2018 14:27:15 +0200 Subject: [PATCH 445/594] syscall: revert to pre-FreeBSD 10 / POSIX-2008 timespec field names in Stat_t on FreeBSD CL 138595 introduced the new names when the hardcoded stat8 definitions was replaced with a cgo generated one. Fixes #29393 Updates #22448 Change-Id: I6309958306329ff301c17344b2e0ead0cc874224 Reviewed-on: https://go-review.googlesource.com/c/155958 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- api/except.txt | 24 --------- api/go1.12.txt | 24 --------- src/archive/tar/stat_actime1.go | 2 +- src/archive/tar/stat_actime2.go | 2 +- src/os/stat_freebsd.go | 4 +- src/syscall/mkpost.go | 8 ++- src/syscall/syscall_freebsd.go | 32 +++++------ src/syscall/ztypes_freebsd_386.go | 82 ++++++++++++++--------------- src/syscall/ztypes_freebsd_amd64.go | 72 ++++++++++++------------- src/syscall/ztypes_freebsd_arm.go | 72 ++++++++++++------------- 10 files changed, 140 insertions(+), 182 deletions(-) diff --git a/api/except.txt b/api/except.txt index a911783c6bab0..637be18135917 100644 --- a/api/except.txt +++ b/api/except.txt @@ -386,15 +386,11 @@ pkg syscall (windows-amd64), type RawSockaddrAny struct, Pad [96]int8 pkg syscall (freebsd-386), func Mknod(string, uint32, int) error pkg syscall (freebsd-386), type Dirent struct, Fileno uint32 pkg syscall (freebsd-386), type Dirent struct, Namlen uint8 -pkg syscall (freebsd-386), type Stat_t struct, Atimespec Timespec -pkg syscall (freebsd-386), type Stat_t struct, Birthtimespec Timespec pkg syscall (freebsd-386), type Stat_t struct, Blksize uint32 -pkg syscall (freebsd-386), type Stat_t struct, Ctimespec Timespec pkg syscall (freebsd-386), type Stat_t struct, Dev uint32 pkg syscall (freebsd-386), type Stat_t struct, Gen uint32 pkg syscall (freebsd-386), type Stat_t struct, Ino uint32 pkg syscall (freebsd-386), type Stat_t struct, Lspare int32 -pkg syscall (freebsd-386), type Stat_t struct, Mtimespec Timespec pkg syscall (freebsd-386), type Stat_t struct, Nlink uint16 pkg syscall (freebsd-386), type Stat_t struct, Pad_cgo_0 [8]uint8 pkg syscall (freebsd-386), type Stat_t struct, Rdev uint32 @@ -403,15 +399,11 @@ pkg syscall (freebsd-386), type Statfs_t struct, Mntonname [88]int8 pkg syscall (freebsd-386-cgo), func Mknod(string, uint32, int) error pkg syscall (freebsd-386-cgo), type Dirent struct, Fileno uint32 pkg syscall (freebsd-386-cgo), type Dirent struct, Namlen uint8 -pkg syscall (freebsd-386-cgo), type Stat_t struct, Atimespec Timespec -pkg syscall (freebsd-386-cgo), type Stat_t struct, Birthtimespec Timespec pkg syscall (freebsd-386-cgo), type Stat_t struct, Blksize uint32 -pkg syscall (freebsd-386-cgo), type Stat_t struct, Ctimespec Timespec pkg syscall (freebsd-386-cgo), type Stat_t struct, Dev uint32 pkg syscall (freebsd-386-cgo), type Stat_t struct, Gen uint32 pkg syscall (freebsd-386-cgo), type Stat_t struct, Ino uint32 pkg syscall (freebsd-386-cgo), type Stat_t struct, Lspare int32 -pkg syscall (freebsd-386-cgo), type Stat_t struct, Mtimespec Timespec pkg syscall (freebsd-386-cgo), type Stat_t struct, Nlink uint16 pkg syscall (freebsd-386-cgo), type Stat_t struct, Pad_cgo_0 [8]uint8 pkg syscall (freebsd-386-cgo), type Stat_t struct, Rdev uint32 @@ -420,15 +412,11 @@ pkg syscall (freebsd-386-cgo), type Statfs_t struct, Mntonname [88]int8 pkg syscall (freebsd-amd64), func Mknod(string, uint32, int) error pkg syscall (freebsd-amd64), type Dirent struct, Fileno uint32 pkg syscall (freebsd-amd64), type Dirent struct, Namlen uint8 -pkg syscall (freebsd-amd64), type Stat_t struct, Atimespec Timespec -pkg syscall (freebsd-amd64), type Stat_t struct, Birthtimespec Timespec pkg syscall (freebsd-amd64), type Stat_t struct, Blksize uint32 -pkg syscall (freebsd-amd64), type Stat_t struct, Ctimespec Timespec pkg syscall (freebsd-amd64), type Stat_t struct, Dev uint32 pkg syscall (freebsd-amd64), type Stat_t struct, Gen uint32 pkg syscall (freebsd-amd64), type Stat_t struct, Ino uint32 pkg syscall (freebsd-amd64), type Stat_t struct, Lspare int32 -pkg syscall (freebsd-amd64), type Stat_t struct, Mtimespec Timespec pkg syscall (freebsd-amd64), type Stat_t struct, Nlink uint16 pkg syscall (freebsd-amd64), type Stat_t struct, Rdev uint32 pkg syscall (freebsd-amd64), type Statfs_t struct, Mntfromname [88]int8 @@ -436,15 +424,11 @@ pkg syscall (freebsd-amd64), type Statfs_t struct, Mntonname [88]int8 pkg syscall (freebsd-amd64-cgo), func Mknod(string, uint32, int) error pkg syscall (freebsd-amd64-cgo), type Dirent struct, Fileno uint32 pkg syscall (freebsd-amd64-cgo), type Dirent struct, Namlen uint8 -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Atimespec Timespec -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Birthtimespec Timespec pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Blksize uint32 -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ctimespec Timespec pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Dev uint32 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Gen uint32 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ino uint32 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Lspare int32 -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Mtimespec Timespec pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Nlink uint16 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Rdev uint32 pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntfromname [88]int8 @@ -452,15 +436,11 @@ pkg syscall (freebsd-amd64-cgo), type Statfs_t struct, Mntonname [88]int8 pkg syscall (freebsd-arm), func Mknod(string, uint32, int) error pkg syscall (freebsd-arm), type Dirent struct, Fileno uint32 pkg syscall (freebsd-arm), type Dirent struct, Namlen uint8 -pkg syscall (freebsd-arm), type Stat_t struct, Atimespec Timespec -pkg syscall (freebsd-arm), type Stat_t struct, Birthtimespec Timespec pkg syscall (freebsd-arm), type Stat_t struct, Blksize uint32 -pkg syscall (freebsd-arm), type Stat_t struct, Ctimespec Timespec pkg syscall (freebsd-arm), type Stat_t struct, Dev uint32 pkg syscall (freebsd-arm), type Stat_t struct, Gen uint32 pkg syscall (freebsd-arm), type Stat_t struct, Ino uint32 pkg syscall (freebsd-arm), type Stat_t struct, Lspare int32 -pkg syscall (freebsd-arm), type Stat_t struct, Mtimespec Timespec pkg syscall (freebsd-arm), type Stat_t struct, Nlink uint16 pkg syscall (freebsd-arm), type Stat_t struct, Rdev uint32 pkg syscall (freebsd-arm), type Statfs_t struct, Mntfromname [88]int8 @@ -468,15 +448,11 @@ pkg syscall (freebsd-arm), type Statfs_t struct, Mntonname [88]int8 pkg syscall (freebsd-arm-cgo), func Mknod(string, uint32, int) error pkg syscall (freebsd-arm-cgo), type Dirent struct, Fileno uint32 pkg syscall (freebsd-arm-cgo), type Dirent struct, Namlen uint8 -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Atimespec Timespec -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Birthtimespec Timespec pkg syscall (freebsd-arm-cgo), type Stat_t struct, Blksize uint32 -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ctimespec Timespec pkg syscall (freebsd-arm-cgo), type Stat_t struct, Dev uint32 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Gen uint32 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ino uint32 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Lspare int32 -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Mtimespec Timespec pkg syscall (freebsd-arm-cgo), type Stat_t struct, Nlink uint16 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Rdev uint32 pkg syscall (freebsd-arm-cgo), type Statfs_t struct, Mntfromname [88]int8 diff --git a/api/go1.12.txt b/api/go1.12.txt index 865f04b76b43e..319bb6f145eb1 100644 --- a/api/go1.12.txt +++ b/api/go1.12.txt @@ -67,17 +67,13 @@ pkg syscall (freebsd-386), type Dirent struct, Namlen uint16 pkg syscall (freebsd-386), type Dirent struct, Off int64 pkg syscall (freebsd-386), type Dirent struct, Pad0 uint8 pkg syscall (freebsd-386), type Dirent struct, Pad1 uint16 -pkg syscall (freebsd-386), type Stat_t struct, Atim Timespec pkg syscall (freebsd-386), type Stat_t struct, Atim_ext int32 -pkg syscall (freebsd-386), type Stat_t struct, Birthtim Timespec pkg syscall (freebsd-386), type Stat_t struct, Blksize int32 pkg syscall (freebsd-386), type Stat_t struct, Btim_ext int32 -pkg syscall (freebsd-386), type Stat_t struct, Ctim Timespec pkg syscall (freebsd-386), type Stat_t struct, Ctim_ext int32 pkg syscall (freebsd-386), type Stat_t struct, Dev uint64 pkg syscall (freebsd-386), type Stat_t struct, Gen uint64 pkg syscall (freebsd-386), type Stat_t struct, Ino uint64 -pkg syscall (freebsd-386), type Stat_t struct, Mtim Timespec pkg syscall (freebsd-386), type Stat_t struct, Mtim_ext int32 pkg syscall (freebsd-386), type Stat_t struct, Nlink uint64 pkg syscall (freebsd-386), type Stat_t struct, Padding0 int16 @@ -97,17 +93,13 @@ pkg syscall (freebsd-386-cgo), type Dirent struct, Namlen uint16 pkg syscall (freebsd-386-cgo), type Dirent struct, Off int64 pkg syscall (freebsd-386-cgo), type Dirent struct, Pad0 uint8 pkg syscall (freebsd-386-cgo), type Dirent struct, Pad1 uint16 -pkg syscall (freebsd-386-cgo), type Stat_t struct, Atim Timespec pkg syscall (freebsd-386-cgo), type Stat_t struct, Atim_ext int32 -pkg syscall (freebsd-386-cgo), type Stat_t struct, Birthtim Timespec pkg syscall (freebsd-386-cgo), type Stat_t struct, Blksize int32 pkg syscall (freebsd-386-cgo), type Stat_t struct, Btim_ext int32 -pkg syscall (freebsd-386-cgo), type Stat_t struct, Ctim Timespec pkg syscall (freebsd-386-cgo), type Stat_t struct, Ctim_ext int32 pkg syscall (freebsd-386-cgo), type Stat_t struct, Dev uint64 pkg syscall (freebsd-386-cgo), type Stat_t struct, Gen uint64 pkg syscall (freebsd-386-cgo), type Stat_t struct, Ino uint64 -pkg syscall (freebsd-386-cgo), type Stat_t struct, Mtim Timespec pkg syscall (freebsd-386-cgo), type Stat_t struct, Mtim_ext int32 pkg syscall (freebsd-386-cgo), type Stat_t struct, Nlink uint64 pkg syscall (freebsd-386-cgo), type Stat_t struct, Padding0 int16 @@ -127,14 +119,10 @@ pkg syscall (freebsd-amd64), type Dirent struct, Namlen uint16 pkg syscall (freebsd-amd64), type Dirent struct, Off int64 pkg syscall (freebsd-amd64), type Dirent struct, Pad0 uint8 pkg syscall (freebsd-amd64), type Dirent struct, Pad1 uint16 -pkg syscall (freebsd-amd64), type Stat_t struct, Atim Timespec -pkg syscall (freebsd-amd64), type Stat_t struct, Birthtim Timespec pkg syscall (freebsd-amd64), type Stat_t struct, Blksize int32 -pkg syscall (freebsd-amd64), type Stat_t struct, Ctim Timespec pkg syscall (freebsd-amd64), type Stat_t struct, Dev uint64 pkg syscall (freebsd-amd64), type Stat_t struct, Gen uint64 pkg syscall (freebsd-amd64), type Stat_t struct, Ino uint64 -pkg syscall (freebsd-amd64), type Stat_t struct, Mtim Timespec pkg syscall (freebsd-amd64), type Stat_t struct, Nlink uint64 pkg syscall (freebsd-amd64), type Stat_t struct, Padding0 int16 pkg syscall (freebsd-amd64), type Stat_t struct, Padding1 int32 @@ -153,14 +141,10 @@ pkg syscall (freebsd-amd64-cgo), type Dirent struct, Namlen uint16 pkg syscall (freebsd-amd64-cgo), type Dirent struct, Off int64 pkg syscall (freebsd-amd64-cgo), type Dirent struct, Pad0 uint8 pkg syscall (freebsd-amd64-cgo), type Dirent struct, Pad1 uint16 -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Atim Timespec -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Birthtim Timespec pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Blksize int32 -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ctim Timespec pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Dev uint64 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Gen uint64 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Ino uint64 -pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Mtim Timespec pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Nlink uint64 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Padding0 int16 pkg syscall (freebsd-amd64-cgo), type Stat_t struct, Padding1 int32 @@ -179,14 +163,10 @@ pkg syscall (freebsd-arm), type Dirent struct, Namlen uint16 pkg syscall (freebsd-arm), type Dirent struct, Off int64 pkg syscall (freebsd-arm), type Dirent struct, Pad0 uint8 pkg syscall (freebsd-arm), type Dirent struct, Pad1 uint16 -pkg syscall (freebsd-arm), type Stat_t struct, Atim Timespec -pkg syscall (freebsd-arm), type Stat_t struct, Birthtim Timespec pkg syscall (freebsd-arm), type Stat_t struct, Blksize int32 -pkg syscall (freebsd-arm), type Stat_t struct, Ctim Timespec pkg syscall (freebsd-arm), type Stat_t struct, Dev uint64 pkg syscall (freebsd-arm), type Stat_t struct, Gen uint64 pkg syscall (freebsd-arm), type Stat_t struct, Ino uint64 -pkg syscall (freebsd-arm), type Stat_t struct, Mtim Timespec pkg syscall (freebsd-arm), type Stat_t struct, Nlink uint64 pkg syscall (freebsd-arm), type Stat_t struct, Padding0 int16 pkg syscall (freebsd-arm), type Stat_t struct, Padding1 int32 @@ -205,14 +185,10 @@ pkg syscall (freebsd-arm-cgo), type Dirent struct, Namlen uint16 pkg syscall (freebsd-arm-cgo), type Dirent struct, Off int64 pkg syscall (freebsd-arm-cgo), type Dirent struct, Pad0 uint8 pkg syscall (freebsd-arm-cgo), type Dirent struct, Pad1 uint16 -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Atim Timespec -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Birthtim Timespec pkg syscall (freebsd-arm-cgo), type Stat_t struct, Blksize int32 -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ctim Timespec pkg syscall (freebsd-arm-cgo), type Stat_t struct, Dev uint64 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Gen uint64 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Ino uint64 -pkg syscall (freebsd-arm-cgo), type Stat_t struct, Mtim Timespec pkg syscall (freebsd-arm-cgo), type Stat_t struct, Nlink uint64 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Padding0 int16 pkg syscall (freebsd-arm-cgo), type Stat_t struct, Padding1 int32 diff --git a/src/archive/tar/stat_actime1.go b/src/archive/tar/stat_actime1.go index eb82edb6d97b9..cf9cc79c5915b 100644 --- a/src/archive/tar/stat_actime1.go +++ b/src/archive/tar/stat_actime1.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build linux dragonfly freebsd openbsd solaris +// +build linux dragonfly openbsd solaris package tar diff --git a/src/archive/tar/stat_actime2.go b/src/archive/tar/stat_actime2.go index f7070127145d1..6f17dbe30725c 100644 --- a/src/archive/tar/stat_actime2.go +++ b/src/archive/tar/stat_actime2.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin netbsd +// +build darwin freebsd netbsd package tar diff --git a/src/os/stat_freebsd.go b/src/os/stat_freebsd.go index d36afa9ffd5e7..bab4ffa7984cf 100644 --- a/src/os/stat_freebsd.go +++ b/src/os/stat_freebsd.go @@ -12,7 +12,7 @@ import ( func fillFileStatFromSys(fs *fileStat, name string) { fs.name = basename(name) fs.size = fs.sys.Size - fs.modTime = timespecToTime(fs.sys.Mtim) + fs.modTime = timespecToTime(fs.sys.Mtimespec) fs.mode = FileMode(fs.sys.Mode & 0777) switch fs.sys.Mode & syscall.S_IFMT { case syscall.S_IFBLK: @@ -47,5 +47,5 @@ func timespecToTime(ts syscall.Timespec) time.Time { // For testing. func atime(fi FileInfo) time.Time { - return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim) + return timespecToTime(fi.Sys().(*syscall.Stat_t).Atimespec) } diff --git a/src/syscall/mkpost.go b/src/syscall/mkpost.go index e75ba1502a94a..d5f5c8d6d62b2 100644 --- a/src/syscall/mkpost.go +++ b/src/syscall/mkpost.go @@ -30,7 +30,8 @@ func main() { goarch := os.Getenv("GOARCH") goos := os.Getenv("GOOS") - if goarch == "s390x" && goos == "linux" { + switch { + case goarch == "s390x" && goos == "linux": // Export the types of PtraceRegs fields. re := regexp.MustCompile("ptrace(Psw|Fpregs|Per)") s = re.ReplaceAllString(s, "Ptrace$1") @@ -53,6 +54,11 @@ func main() { // the existing gccgo API. re = regexp.MustCompile("(Data\\s+\\[14\\])uint8") s = re.ReplaceAllString(s, "${1}int8") + + case goos == "freebsd": + // Keep pre-FreeBSD 10 / non-POSIX 2008 names for timespec fields + re := regexp.MustCompile("(A|M|C|Birth)tim\\s+Timespec") + s = re.ReplaceAllString(s, "${1}timespec Timespec") } // gofmt diff --git a/src/syscall/syscall_freebsd.go b/src/syscall/syscall_freebsd.go index adeb9c2852746..87a27b1ff74c2 100644 --- a/src/syscall/syscall_freebsd.go +++ b/src/syscall/syscall_freebsd.go @@ -300,22 +300,22 @@ func roundup(x, y int) int { func (s *Stat_t) convertFrom(old *stat_freebsd11_t) { *s = Stat_t{ - Dev: uint64(old.Dev), - Ino: uint64(old.Ino), - Nlink: uint64(old.Nlink), - Mode: old.Mode, - Uid: old.Uid, - Gid: old.Gid, - Rdev: uint64(old.Rdev), - Atim: old.Atim, - Mtim: old.Mtim, - Ctim: old.Ctim, - Birthtim: old.Birthtim, - Size: old.Size, - Blocks: old.Blocks, - Blksize: old.Blksize, - Flags: old.Flags, - Gen: uint64(old.Gen), + Dev: uint64(old.Dev), + Ino: uint64(old.Ino), + Nlink: uint64(old.Nlink), + Mode: old.Mode, + Uid: old.Uid, + Gid: old.Gid, + Rdev: uint64(old.Rdev), + Atimespec: old.Atimespec, + Mtimespec: old.Mtimespec, + Ctimespec: old.Ctimespec, + Birthtimespec: old.Birthtimespec, + Size: old.Size, + Blocks: old.Blocks, + Blksize: old.Blksize, + Flags: old.Flags, + Gen: uint64(old.Gen), } } diff --git a/src/syscall/ztypes_freebsd_386.go b/src/syscall/ztypes_freebsd_386.go index 3ca31f287272d..27d82dea1028b 100644 --- a/src/syscall/ztypes_freebsd_386.go +++ b/src/syscall/ztypes_freebsd_386.go @@ -81,50 +81,50 @@ const ( ) type Stat_t struct { - Dev uint64 - Ino uint64 - Nlink uint64 - Mode uint16 - Padding0 int16 - Uid uint32 - Gid uint32 - Padding1 int32 - Rdev uint64 - Atim_ext int32 - Atim Timespec - Mtim_ext int32 - Mtim Timespec - Ctim_ext int32 - Ctim Timespec - Btim_ext int32 - Birthtim Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint64 - Spare [10]uint64 + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint16 + Padding0 int16 + Uid uint32 + Gid uint32 + Padding1 int32 + Rdev uint64 + Atim_ext int32 + Atimespec Timespec + Mtim_ext int32 + Mtimespec Timespec + Ctim_ext int32 + Ctimespec Timespec + Btim_ext int32 + Birthtimespec Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint64 + Spare [10]uint64 } type stat_freebsd11_t struct { - Dev uint32 - Ino uint32 - Mode uint16 - Nlink uint16 - Uid uint32 - Gid uint32 - Rdev uint32 - Atim Timespec - Mtim Timespec - Ctim Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint32 - Lspare int32 - Birthtim Timespec - Pad_cgo_0 [8]byte + Dev uint32 + Ino uint32 + Mode uint16 + Nlink uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Atimespec Timespec + Mtimespec Timespec + Ctimespec Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + Lspare int32 + Birthtimespec Timespec + Pad_cgo_0 [8]byte } type Statfs_t struct { diff --git a/src/syscall/ztypes_freebsd_amd64.go b/src/syscall/ztypes_freebsd_amd64.go index 797a3bab088d6..8abfbb45d692a 100644 --- a/src/syscall/ztypes_freebsd_amd64.go +++ b/src/syscall/ztypes_freebsd_amd64.go @@ -81,45 +81,45 @@ const ( ) type Stat_t struct { - Dev uint64 - Ino uint64 - Nlink uint64 - Mode uint16 - Padding0 int16 - Uid uint32 - Gid uint32 - Padding1 int32 - Rdev uint64 - Atim Timespec - Mtim Timespec - Ctim Timespec - Birthtim Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint64 - Spare [10]uint64 + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint16 + Padding0 int16 + Uid uint32 + Gid uint32 + Padding1 int32 + Rdev uint64 + Atimespec Timespec + Mtimespec Timespec + Ctimespec Timespec + Birthtimespec Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint64 + Spare [10]uint64 } type stat_freebsd11_t struct { - Dev uint32 - Ino uint32 - Mode uint16 - Nlink uint16 - Uid uint32 - Gid uint32 - Rdev uint32 - Atim Timespec - Mtim Timespec - Ctim Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint32 - Lspare int32 - Birthtim Timespec + Dev uint32 + Ino uint32 + Mode uint16 + Nlink uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Atimespec Timespec + Mtimespec Timespec + Ctimespec Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + Lspare int32 + Birthtimespec Timespec } type Statfs_t struct { diff --git a/src/syscall/ztypes_freebsd_arm.go b/src/syscall/ztypes_freebsd_arm.go index 9be8752e18bae..ff552a6a63f9d 100644 --- a/src/syscall/ztypes_freebsd_arm.go +++ b/src/syscall/ztypes_freebsd_arm.go @@ -83,45 +83,45 @@ const ( ) type Stat_t struct { - Dev uint64 - Ino uint64 - Nlink uint64 - Mode uint16 - Padding0 int16 - Uid uint32 - Gid uint32 - Padding1 int32 - Rdev uint64 - Atim Timespec - Mtim Timespec - Ctim Timespec - Birthtim Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint64 - Spare [10]uint64 + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint16 + Padding0 int16 + Uid uint32 + Gid uint32 + Padding1 int32 + Rdev uint64 + Atimespec Timespec + Mtimespec Timespec + Ctimespec Timespec + Birthtimespec Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint64 + Spare [10]uint64 } type stat_freebsd11_t struct { - Dev uint32 - Ino uint32 - Mode uint16 - Nlink uint16 - Uid uint32 - Gid uint32 - Rdev uint32 - Atim Timespec - Mtim Timespec - Ctim Timespec - Size int64 - Blocks int64 - Blksize int32 - Flags uint32 - Gen uint32 - Lspare int32 - Birthtim Timespec + Dev uint32 + Ino uint32 + Mode uint16 + Nlink uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Atimespec Timespec + Mtimespec Timespec + Ctimespec Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + Lspare int32 + Birthtimespec Timespec } type Statfs_t struct { From ed78c90a784f9703857c3303d871b973ee2f0102 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Sun, 30 Dec 2018 08:22:27 -1000 Subject: [PATCH 446/594] strconv: make docs for Itoa and Atoi slightly higher level Fixes #29461 Change-Id: I5db8bc80e5bd0778dced8471581c67e66853aada Reviewed-on: https://go-review.googlesource.com/c/155924 Reviewed-by: Rob Pike --- src/strconv/atoi.go | 2 +- src/strconv/itoa.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strconv/atoi.go b/src/strconv/atoi.go index bbfdb7dc3934e..ff33d555e4983 100644 --- a/src/strconv/atoi.go +++ b/src/strconv/atoi.go @@ -198,7 +198,7 @@ func ParseInt(s string, base int, bitSize int) (i int64, err error) { return n, nil } -// Atoi returns the result of ParseInt(s, 10, 0) converted to type int. +// Atoi is equivalent to ParseInt(s, 10, 0), converted to type int. func Atoi(s string) (int, error) { const fnAtoi = "Atoi" diff --git a/src/strconv/itoa.go b/src/strconv/itoa.go index 4aaf57830cf71..45e4192c82e16 100644 --- a/src/strconv/itoa.go +++ b/src/strconv/itoa.go @@ -30,7 +30,7 @@ func FormatInt(i int64, base int) string { return s } -// Itoa is shorthand for FormatInt(int64(i), 10). +// Itoa is equivalent to FormatInt(int64(i), 10). func Itoa(i int) string { return FormatInt(int64(i), 10) } From c6282e7ac5a73809b8423a2abc45940148eb5bc7 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 31 Dec 2018 18:43:38 -1000 Subject: [PATCH 447/594] doc: 2019 is the Year of the Gopher whereas this is a longstanding tradition and insofaras it is worth continuing such traditions and notwithstanding an attempt at future-proofing thetruthofthematter is that I have been waiting for years to send this change so despiteallobjections I have updated the copyright year. Change-Id: I55961b15a7eda35d84fdd9250afdbe19f0bf8412 Reviewed-on: https://go-review.googlesource.com/c/155928 Reviewed-by: Emmanuel Odeke --- doc/contribute.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/contribute.html b/doc/contribute.html index 53088c99c63a3..68b2387d35f86 100644 --- a/doc/contribute.html +++ b/doc/contribute.html @@ -922,13 +922,13 @@

    -// Copyright 2018 The Go Authors. All rights reserved.
    +// Copyright 2019 The Go Authors. All rights reserved.
     // Use of this source code is governed by a BSD-style
     // license that can be found in the LICENSE file.
     

    -(Use the current year if you're reading this in 2019 or beyond.) +(Use the current year if you're reading this in 2020 or beyond.) Files in the repository are copyrighted the year they are added. Do not update the copyright year on files that you change.

    From 204a8f55dc2e0ac8d27a781dab0da609b98560da Mon Sep 17 00:00:00 2001 From: Michael McLoughlin Date: Mon, 31 Dec 2018 17:14:54 -0800 Subject: [PATCH 448/594] runtime: fix REFLECTMETHOD macro Removes spurious equals sign from REFLECTMETHOD macro. Fixes #29487 Change-Id: Iaa3d85ff57087aa79a259f28816f8b0a552536f3 Reviewed-on: https://go-review.googlesource.com/c/155927 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/textflag.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/textflag.h b/src/runtime/textflag.h index 929e9b36a909b..d1bb52cc004ac 100644 --- a/src/runtime/textflag.h +++ b/src/runtime/textflag.h @@ -31,4 +31,4 @@ // TODO(mwhudson): only implemented for ppc64x at present. #define NOFRAME 512 // Function can call reflect.Type.Method or reflect.Type.MethodByName. -#define REFLECTMETHOD = 1024 +#define REFLECTMETHOD 1024 From f4f65941246bfee2ef742a5a4920f86d80ab4762 Mon Sep 17 00:00:00 2001 From: Richard Musiol Date: Tue, 11 Dec 2018 13:59:18 +0100 Subject: [PATCH 449/594] runtime: fix notetsleepg deadline on js/wasm A notetsleepg may get stuck if its timeout callback gets invoked exactly on its deadline due to low precision of nanotime. This change fixes the comparison so it also resolves the note if the timestamps are equal. Updates #28975 Change-Id: I045d2f48b7f41cea0caec19b56876e9de01dcd6c Reviewed-on: https://go-review.googlesource.com/c/153558 Run-TryBot: Richard Musiol TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/lock_js.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/lock_js.go b/src/runtime/lock_js.go index b04ccdb107e4e..f58c915b630a9 100644 --- a/src/runtime/lock_js.go +++ b/src/runtime/lock_js.go @@ -127,7 +127,7 @@ func notetsleepg(n *note, ns int64) bool { func checkTimeouts() { now := nanotime() for n, nt := range notesWithTimeout { - if n.key == note_cleared && now > nt.deadline { + if n.key == note_cleared && now >= nt.deadline { n.key = note_timeout goready(nt.gp, 1) } From ad1644943ba691740c3bec29280f350f9d81c1b1 Mon Sep 17 00:00:00 2001 From: Iskander Sharipov Date: Sat, 29 Dec 2018 23:16:01 +0300 Subject: [PATCH 450/594] cmd/compile/internal/gc: remove unused methodbyname type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit methodbyname was used for sorting in bexport.go, until https://golang.org/cl/139338 removed the code that invoked sorting function. R=1.13 Change-Id: I13e313fb60111a142ed3883d81916af254445fdc Reviewed-on: https://go-review.googlesource.com/c/155959 Run-TryBot: Iskander Sharipov TryBot-Result: Gobot Gobot Reviewed-by: Daniel Martí Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/internal/gc/export.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/cmd/compile/internal/gc/export.go b/src/cmd/compile/internal/gc/export.go index 4fe1f8b95f12d..791fc063b7fce 100644 --- a/src/cmd/compile/internal/gc/export.go +++ b/src/cmd/compile/internal/gc/export.go @@ -62,13 +62,6 @@ func autoexport(n *Node, ctxt Class) { } } -// methodbyname sorts types by symbol name. -type methodbyname []*types.Field - -func (x methodbyname) Len() int { return len(x) } -func (x methodbyname) Swap(i, j int) { x[i], x[j] = x[j], x[i] } -func (x methodbyname) Less(i, j int) bool { return x[i].Sym.Name < x[j].Sym.Name } - func dumpexport(bout *bio.Writer) { // The linker also looks for the $$ marker - use char after $$ to distinguish format. exportf(bout, "\n$$B\n") // indicate binary export format From 04eda1a94da4dfec61e65f094583b85e556306f3 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Fri, 21 Dec 2018 14:18:50 +0530 Subject: [PATCH 451/594] net/url: clarify documentation about (*URL).String Fixes #23669 Change-Id: Ib7f0aab0b066f778a3097583f432f8092310fb81 Reviewed-on: https://go-review.googlesource.com/c/155598 Reviewed-by: Brad Fitzpatrick --- src/net/url/url.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net/url/url.go b/src/net/url/url.go index 702f9124bfe8d..d84c95adb0318 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -755,6 +755,7 @@ func validOptionalPort(port string) bool { // // If u.Opaque is non-empty, String uses the first form; // otherwise it uses the second form. +// Any non-ASCII characters in host are escaped. // To obtain the path, String uses u.EscapedPath(). // // In the second form, the following rules apply: From 8962b71c4947cdc915ae6dd837e644e03d2e7435 Mon Sep 17 00:00:00 2001 From: Daniel Ingram Date: Sat, 22 Dec 2018 22:11:25 +0000 Subject: [PATCH 452/594] runtime: fix string formatting Change-Id: I87d0bc78a246e479d97b3f83cf77c1f701975413 GitHub-Last-Rev: 22cd684e08464f0e01f1cba2235443371dba3a5d GitHub-Pull-Request: golang/go#29157 Reviewed-on: https://go-review.googlesource.com/c/153298 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Emmanuel Odeke Reviewed-by: Austin Clements --- src/runtime/runtime-gdb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/runtime-gdb.py b/src/runtime/runtime-gdb.py index 4c32c633cf1f1..48960b7f6133f 100644 --- a/src/runtime/runtime-gdb.py +++ b/src/runtime/runtime-gdb.py @@ -353,7 +353,8 @@ def to_string(self): return "" if dtype is None: # trouble looking up, print something reasonable - return "({0}){0}".format(iface_dtype_name(self.val), self.val['data']) + return "({typename}){data}".format( + typename=iface_dtype_name(self.val), data=self.val['data']) try: return self.val['data'].cast(dtype).dereference() From 2175177497b74a1be52cc98a892e4197973c4ea6 Mon Sep 17 00:00:00 2001 From: Julien Salleyron Date: Wed, 2 Jan 2019 16:29:49 +0000 Subject: [PATCH 453/594] net/http/httputil: fix missing previous headers in response when switching protocol in ReverseProxy When using switching protocol, previous headers set before the reverse proxy are lost. Fixes #29407 Change-Id: Ia2b9784022d9bccef8625519ccbabbe8a276dfc0 GitHub-Last-Rev: 79bb493dcbb9b76d9d2ff9cd0854b29d634f8b73 GitHub-Pull-Request: golang/go#29408 Reviewed-on: https://go-review.googlesource.com/c/155741 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/net/http/httputil/reverseproxy.go | 3 +++ src/net/http/httputil/reverseproxy_test.go | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index 5d07ba3d36187..c13b99ff72fed 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -497,6 +497,9 @@ func (p *ReverseProxy) handleUpgradeResponse(rw http.ResponseWriter, req *http.R p.getErrorHandler()(rw, req, fmt.Errorf("backend tried to switch protocol %q when %q was requested", resUpType, reqUpType)) return } + + copyHeader(res.Header, rw.Header()) + hj, ok := rw.(http.Hijacker) if !ok { p.getErrorHandler()(rw, req, fmt.Errorf("can't switch protocols using non-Hijacker ResponseWriter type %T", rw)) diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go index 5caa2060660a9..bda569acc73bd 100644 --- a/src/net/http/httputil/reverseproxy_test.go +++ b/src/net/http/httputil/reverseproxy_test.go @@ -1013,7 +1013,12 @@ func TestReverseProxyWebSocket(t *testing.T) { rproxy := NewSingleHostReverseProxy(backURL) rproxy.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests - frontendProxy := httptest.NewServer(rproxy) + handler := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { + rw.Header().Set("X-Header", "X-Value") + rproxy.ServeHTTP(rw, req) + }) + + frontendProxy := httptest.NewServer(handler) defer frontendProxy.Close() req, _ := http.NewRequest("GET", frontendProxy.URL, nil) @@ -1028,6 +1033,13 @@ func TestReverseProxyWebSocket(t *testing.T) { if res.StatusCode != 101 { t.Fatalf("status = %v; want 101", res.Status) } + + got := res.Header.Get("X-Header") + want := "X-Value" + if got != want { + t.Errorf("Header(XHeader) = %q; want %q", got, want) + } + if upgradeType(res.Header) != "websocket" { t.Fatalf("not websocket upgrade; got %#v", res.Header) } @@ -1042,8 +1054,8 @@ func TestReverseProxyWebSocket(t *testing.T) { if !bs.Scan() { t.Fatalf("Scan: %v", bs.Err()) } - got := bs.Text() - want := `backend got "Hello"` + got = bs.Text() + want = `backend got "Hello"` if got != want { t.Errorf("got %#q, want %#q", got, want) } From 1f035d036c2a49c1b858af3260552ccaac80858d Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 2 Jan 2019 18:53:23 +0000 Subject: [PATCH 454/594] runtime: disable GDB tests on freebsd/arm for now Updates #29508 Updates #28679 Change-Id: I19bc9f88aeb2b1f3e69856173a00c5a4d5ed3613 Reviewed-on: https://go-review.googlesource.com/c/155932 Run-TryBot: Brad Fitzpatrick Reviewed-by: Katie Hockman --- src/runtime/runtime-gdb_test.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go index 2c1653172e8f9..442ee9ca813a1 100644 --- a/src/runtime/runtime-gdb_test.go +++ b/src/runtime/runtime-gdb_test.go @@ -26,18 +26,22 @@ func checkGdbEnvironment(t *testing.T) { case "darwin": t.Skip("gdb does not work on darwin") case "netbsd": - t.Skip("gdb does not work with threads on NetBSD; see golang.org/issue/22893 and gnats.netbsd.org/52548") + t.Skip("gdb does not work with threads on NetBSD; see https://golang.org/issue/22893 and https://gnats.netbsd.org/52548") case "windows": t.Skip("gdb tests fail on Windows: https://golang.org/issue/22687") case "linux": if runtime.GOARCH == "ppc64" { - t.Skip("skipping gdb tests on linux/ppc64; see golang.org/issue/17366") + t.Skip("skipping gdb tests on linux/ppc64; see https://golang.org/issue/17366") } if runtime.GOARCH == "mips" { t.Skip("skipping gdb tests on linux/mips; see https://golang.org/issue/25939") } case "aix": - t.Skip("gdb does not work on AIX; see golang.org/issue/28558") + t.Skip("gdb does not work on AIX; see https://golang.org/issue/28558") + case "freebsd": + if runtime.GOARCH == "arm" { + t.Skip("skipping gdb tests on freebsd/arm; see https://golang.org/issue/29508") + } } if final := os.Getenv("GOROOT_FINAL"); final != "" && runtime.GOROOT() != final { t.Skip("gdb test can fail with GOROOT_FINAL pending") From 2e217fa726a624093eea5b099d1531c79e27a423 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Wed, 2 Jan 2019 12:27:55 -0500 Subject: [PATCH 455/594] cmd/compile: fix deriving from x+d >= w on overflow in prove pass In the case of x+d >= w, where d and w are constants, we are deriving x is within the bound of min=w-d and max=maxInt-d. When there is an overflow (min >= max), we know only one of x >= min or x <= max is true, and we derive this by excluding the other. When excluding x >= min, we did not consider the equal case, so we could incorrectly derive x <= max when x == min. Fixes #29502. Change-Id: Ia9f7d814264b1a3ddf78f52e2ce23377450e6e8a Reviewed-on: https://go-review.googlesource.com/c/156019 Reviewed-by: David Chase --- src/cmd/compile/internal/ssa/prove.go | 19 +++++++++++++++---- test/prove.go | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/cmd/compile/internal/ssa/prove.go b/src/cmd/compile/internal/ssa/prove.go index 0656bb45c59d8..1e5f4e9c6cce2 100644 --- a/src/cmd/compile/internal/ssa/prove.go +++ b/src/cmd/compile/internal/ssa/prove.go @@ -197,6 +197,9 @@ func newFactsTable(f *Func) *factsTable { // update updates the set of relations between v and w in domain d // restricting it to r. func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) { + if parent.Func.pass.debug > 2 { + parent.Func.Warnl(parent.Pos, "parent=%s, update %s %s %s", parent, v, w, r) + } // No need to do anything else if we already found unsat. if ft.unsat { return @@ -234,6 +237,9 @@ func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) { panic("unknown relation") } if !ok { + if parent.Func.pass.debug > 2 { + parent.Func.Warnl(parent.Pos, "unsat %s %s %s", v, w, r) + } ft.unsat = true return } @@ -260,6 +266,9 @@ func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) { ft.facts[p] = oldR & r // If this relation is not satisfiable, mark it and exit right away if oldR&r == 0 { + if parent.Func.pass.debug > 2 { + parent.Func.Warnl(parent.Pos, "unsat %s %s %s", v, w, r) + } ft.unsat = true return } @@ -361,7 +370,7 @@ func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) { lim = old.intersect(lim) ft.limits[v.ID] = lim if v.Block.Func.pass.debug > 2 { - v.Block.Func.Warnl(parent.Pos, "parent=%s, new limits %s %s %s", parent, v, w, lim.String()) + v.Block.Func.Warnl(parent.Pos, "parent=%s, new limits %s %s %s %s", parent, v, w, r, lim.String()) } if lim.min > lim.max || lim.umin > lim.umax { ft.unsat = true @@ -442,7 +451,7 @@ func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) { if r == gt || r == gt|eq { if x, delta := isConstDelta(v); x != nil && d == signed { if parent.Func.pass.debug > 1 { - parent.Func.Warnl(parent.Pos, "x+d >= w; x:%v %v delta:%v w:%v d:%v", x, parent.String(), delta, w.AuxInt, d) + parent.Func.Warnl(parent.Pos, "x+d %s w; x:%v %v delta:%v w:%v d:%v", r, x, parent.String(), delta, w.AuxInt, d) } if !w.isGenericIntConst() { // If we know that x+delta > w but w is not constant, we can derive: @@ -503,8 +512,10 @@ func (ft *factsTable) update(parent *Block, v, w *Value, d domain, r relation) { // the other must be true if l, has := ft.limits[x.ID]; has { if l.max <= min { - // x>min is impossible, so it must be x<=max - ft.update(parent, vmax, x, d, r|eq) + if r&eq == 0 || l.max < min { + // x>min (x>=min) is impossible, so it must be x<=max + ft.update(parent, vmax, x, d, r|eq) + } } else if l.min > max { // x<=max is impossible, so it must be x>min ft.update(parent, x, vmin, d, r) diff --git a/test/prove.go b/test/prove.go index a881b2d6e2ef8..eb0fb2a15e813 100644 --- a/test/prove.go +++ b/test/prove.go @@ -488,6 +488,20 @@ func f18(b []int, x int, y uint) { } } +func f19() (e int64, err error) { + // Issue 29502: slice[:0] is incorrectly disproved. + var stack []int64 + stack = append(stack, 123) + if len(stack) > 1 { + panic("too many elements") + } + last := len(stack) - 1 + e = stack[last] + // Buggy compiler prints "Disproved Geq64" for the next line. + stack = stack[:last] // ERROR "Proved IsSliceInBounds" + return e, nil +} + func sm1(b []int, x int) { // Test constant argument to slicemask. useSlice(b[2:8]) // ERROR "Proved slicemask not needed$" From 5ec5c5741ec7d0e051667f13094f532833d41578 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 28 Dec 2018 11:46:35 +0100 Subject: [PATCH 456/594] cmd/dist: list only supported platforms Introduce an incomplete map in dist alongside cgoEnabled and filter out the incomplete ports in 'dist list'. Fixes #28944 Change-Id: I15aae56aec570e1cd9e28906900cd5ba0db77811 Reviewed-on: https://go-review.googlesource.com/c/155839 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/dist/build.go | 10 ++++++++++ src/cmd/dist/test.go | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index da677c81ada5a..ad2c96436a069 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -1458,6 +1458,13 @@ var cgoEnabled = map[string]bool{ "windows/arm": false, } +// List of platforms which are supported but not complete yet. These get +// filtered out of cgoEnabled for 'dist list'. See golang.org/issue/28944 +var incomplete = map[string]bool{ + "linux/riscv64": true, + "linux/sparc64": true, +} + func needCC() bool { switch os.Getenv("CGO_ENABLED") { case "1": @@ -1576,6 +1583,9 @@ func cmdlist() { var plats []string for p := range cgoEnabled { + if incomplete[p] { + continue + } plats = append(plats, p) } sort.Strings(plats) diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 82e2e17424f5d..74cee8f42169b 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -212,6 +212,9 @@ func (t *tester) run() { if t.failed { fmt.Println("\nFAILED") os.Exit(1) + } else if incomplete[goos+"/"+goarch] { + fmt.Println("\nFAILED (incomplete port)") + os.Exit(1) } else if t.partial { fmt.Println("\nALL TESTS PASSED (some were excluded)") } else { From 8e6396115e56d8e0cbecd6904f94c8d893db1724 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 30 Dec 2018 20:04:16 -0500 Subject: [PATCH 457/594] runtime: don't spin in checkPut if non-preemptible Currently it's possible for the runtime to deadlock if checkPut is called in a non-preemptible context. In this case, checkPut may spin, so it won't leave the non-preemptible context, but the thread running gcMarkDone needs to preempt all of the goroutines before it can release the checkPut spin loops. Fix this by returning from checkPut if it's called under any of the conditions that would prevent gcMarkDone from preempting it. In this case, it leaves a note behind that this happened; if the runtime does later detect left-over work it can at least indicate that it was unable to catch it in the act. For #27993. Updates #29385 (may fix it). Change-Id: Ic71c10701229febb4ddf8c104fb10e06d84b122e Reviewed-on: https://go-review.googlesource.com/c/156017 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- src/runtime/mgc.go | 3 +++ src/runtime/mgcwork.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 9d21dc4fa0c9f..f5d6374ce648f 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1519,6 +1519,9 @@ top: print(" wbuf2.n=", gcw.wbuf2.nobj) } print("\n") + if gcw.pauseGen == gcw.putGen { + println("runtime: checkPut already failed at this generation") + } throw("throwOnGCWork") } } diff --git a/src/runtime/mgcwork.go b/src/runtime/mgcwork.go index 0ed07134423e2..f2c16d7d8c4df 100644 --- a/src/runtime/mgcwork.go +++ b/src/runtime/mgcwork.go @@ -98,6 +98,9 @@ type gcWork struct { // gcWorkPauseGen if debugCachedWork is true. pauseGen uint32 + // putGen is the pauseGen of the last putGen. + putGen uint32 + // pauseStack is the stack at which this P was paused if // debugCachedWork is true. pauseStack [16]uintptr @@ -121,10 +124,23 @@ func (w *gcWork) init() { func (w *gcWork) checkPut(ptr uintptr, ptrs []uintptr) { if debugCachedWork { + alreadyFailed := w.putGen == w.pauseGen + w.putGen = w.pauseGen + if m := getg().m; m.locks > 0 || m.mallocing != 0 || m.preemptoff != "" || m.p.ptr().status != _Prunning { + // If we were to spin, the runtime may + // deadlock: the condition above prevents + // preemption (see newstack), which could + // prevent gcMarkDone from finishing the + // ragged barrier and releasing the spin. + return + } for atomic.Load(&gcWorkPauseGen) == w.pauseGen { } if throwOnGCWork { printlock() + if alreadyFailed { + println("runtime: checkPut already failed at this generation") + } println("runtime: late gcWork put") if ptr != 0 { gcDumpObject("ptr", ptr, ^uintptr(0)) From 22738f07c88ac9dd1159da15675fedeeba80c45d Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 2 Jan 2019 18:47:06 +0000 Subject: [PATCH 458/594] runtime: add GODEBUG=madvdontneed=1 Fixes #28466 Change-Id: I05b2e0da09394d111913963b60f2ec865c9b4744 Reviewed-on: https://go-review.googlesource.com/c/155931 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/extern.go | 5 +++++ src/runtime/mem_linux.go | 7 ++++++- src/runtime/runtime1.go | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/runtime/extern.go b/src/runtime/extern.go index 5e11eadb92a84..af858a331f63c 100644 --- a/src/runtime/extern.go +++ b/src/runtime/extern.go @@ -89,6 +89,11 @@ It is a comma-separated list of name=val pairs setting these named variables: released: # MB released to the system consumed: # MB allocated from the system + madvdontneed: setting madvdontneed=1 will use MADV_DONTNEED + instead of MADV_FREE on Linux when returning memory to the + kernel. This is less efficient, but causes RSS numbers to drop + more quickly. + memprofilerate: setting memprofilerate=X will update the value of runtime.MemProfileRate. When set to 0 memory profiling is disabled. Refer to the description of MemProfileRate for the default value. diff --git a/src/runtime/mem_linux.go b/src/runtime/mem_linux.go index 845f72ded2c16..1e45ed6301568 100644 --- a/src/runtime/mem_linux.go +++ b/src/runtime/mem_linux.go @@ -105,7 +105,12 @@ func sysUnused(v unsafe.Pointer, n uintptr) { throw("unaligned sysUnused") } - advise := atomic.Load(&adviseUnused) + var advise uint32 + if debug.madvdontneed != 0 { + advise = _MADV_DONTNEED + } else { + advise = atomic.Load(&adviseUnused) + } if errno := madvise(v, n, int32(advise)); advise == _MADV_FREE && errno != 0 { // MADV_FREE was added in Linux 4.5. Fall back to MADV_DONTNEED if it is // not supported. diff --git a/src/runtime/runtime1.go b/src/runtime/runtime1.go index 8b8f4dcb1e980..c5667e73adc4d 100644 --- a/src/runtime/runtime1.go +++ b/src/runtime/runtime1.go @@ -308,6 +308,7 @@ var debug struct { gcstoptheworld int32 gctrace int32 invalidptr int32 + madvdontneed int32 // for Linux; issue 28466 sbrk int32 scavenge int32 scheddetail int32 @@ -325,6 +326,7 @@ var dbgvars = []dbgVar{ {"gcstoptheworld", &debug.gcstoptheworld}, {"gctrace", &debug.gctrace}, {"invalidptr", &debug.invalidptr}, + {"madvdontneed", &debug.madvdontneed}, {"sbrk", &debug.sbrk}, {"scavenge", &debug.scavenge}, {"scheddetail", &debug.scheddetail}, From 64096dbb6911c4b33c5a613748a3a03b74b28078 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 2 Jan 2019 19:16:43 +0000 Subject: [PATCH 459/594] api: add os.(*File).SyscallConn to go1.12.txt Fixes #29507 Change-Id: I8cf52e4b89fd28126f252757260d07a31d9dad61 Reviewed-on: https://go-review.googlesource.com/c/155933 Reviewed-by: Katie Hockman Run-TryBot: Brad Fitzpatrick --- api/go1.12.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/api/go1.12.txt b/api/go1.12.txt index 319bb6f145eb1..7d525cb86eef0 100644 --- a/api/go1.12.txt +++ b/api/go1.12.txt @@ -37,6 +37,7 @@ pkg net/http, const StatusTooEarly ideal-int pkg net/http, method (*Client) CloseIdleConnections() pkg os, const ModeType = 2401763328 pkg os, func UserHomeDir() (string, error) +pkg os, method (*File) SyscallConn() (syscall.RawConn, error) pkg os, method (*ProcessState) ExitCode() int pkg os/exec, method (ExitError) ExitCode() int pkg reflect, method (*MapIter) Key() Value From 57879fea4605b616aeeea144cfd7d2d09c14226a Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Wed, 2 Jan 2019 16:16:49 -0500 Subject: [PATCH 460/594] cmd/compile: fix format test CL 156019 adds some debug output, including printing ssa.relation as string. Update the map. Change-Id: I0299d2008d199da10d86e5b47a50385b3a314c68 Reviewed-on: https://go-review.googlesource.com/c/156020 Run-TryBot: Cherry Zhang Reviewed-by: Brad Fitzpatrick --- src/cmd/compile/fmtmap_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/compile/fmtmap_test.go b/src/cmd/compile/fmtmap_test.go index 063445cc9dcb2..81ba20ff0fe8c 100644 --- a/src/cmd/compile/fmtmap_test.go +++ b/src/cmd/compile/fmtmap_test.go @@ -121,6 +121,7 @@ var knownFormats = map[string]string{ "cmd/compile/internal/ssa.rbrank %d": "", "cmd/compile/internal/ssa.regMask %d": "", "cmd/compile/internal/ssa.register %d": "", + "cmd/compile/internal/ssa.relation %s": "", "cmd/compile/internal/syntax.Error %q": "", "cmd/compile/internal/syntax.Expr %#v": "", "cmd/compile/internal/syntax.Node %T": "", From ae68cf4c53f585f3c4519f9415499e2f465a55f8 Mon Sep 17 00:00:00 2001 From: David Chase Date: Wed, 2 Jan 2019 16:52:49 -0500 Subject: [PATCH 461/594] cmd/compile: Update ssa/debug_test reference files for delve and gdb Recent changes to compiler backtraces perturbed the line number assignment, some better, some worse, probably net worse. For purposes of passing the long tests, update the reference files (delve's file was also stale). TODO: Figure out a less delicate way to locate statement boundaries for 1.13. Fixes #29511. Change-Id: If0e488341d848ba6012045b126c86b1250408d65 Reviewed-on: https://go-review.googlesource.com/c/156021 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- .../internal/ssa/testdata/hist.dlv-opt.nexts | 14 ++++++++++++++ .../internal/ssa/testdata/hist.gdb-opt.nexts | 4 ++++ .../internal/ssa/testdata/scopes.dlv-opt.nexts | 2 +- .../internal/ssa/testdata/scopes.gdb-opt.nexts | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts b/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts index 89d0b1b6373fc..1e4d35051b6b3 100644 --- a/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts +++ b/src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts @@ -8,47 +8,57 @@ 63: hist := make([]int, 7) //gdb-opt=(dx/O,dy/O) // TODO sink is missing if this code is in 'test' instead of 'main' 64: var reader io.Reader = strings.NewReader(cannedInput) //gdb-dbg=(hist/A) // TODO cannedInput/A is missing if this code is in 'test' instead of 'main' 65: if len(os.Args) > 1 { +73: scanner := bufio.NewScanner(reader) 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) 82: hist[int(i)]++ 74: for scanner.Scan() { //gdb-opt=(scanner/A) +75: s := scanner.Text() 76: i, err := strconv.ParseInt(s, 10, 64) 77: if err != nil { //gdb-dbg=(i) //gdb-opt=(err,hist,i) 81: hist = ensure(int(i), hist) @@ -60,12 +70,14 @@ 87: if a == 0 { //gdb-opt=(a,n,t) 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { 87: if a == 0 { //gdb-opt=(a,n,t) 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { @@ -74,12 +86,14 @@ 87: if a == 0 { //gdb-opt=(a,n,t) 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { 87: if a == 0 { //gdb-opt=(a,n,t) 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { diff --git a/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts b/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts index b2f32167078a6..65c5d0a2cee41 100644 --- a/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts +++ b/src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts @@ -122,6 +122,7 @@ n = 0 t = 0 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { @@ -131,6 +132,7 @@ n = 3 t = 3 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { @@ -145,6 +147,7 @@ n = 6 t = 9 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { @@ -154,6 +157,7 @@ n = 8 t = 17 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 91: n += a +92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 90: t += i * a 92: fmt.Fprintf(os.Stderr, "%d\t%d\t%d\t%d\t%d\n", i, a, n, i*a, t) //gdb-dbg=(n,i,t) 86: for i, a := range hist { diff --git a/src/cmd/compile/internal/ssa/testdata/scopes.dlv-opt.nexts b/src/cmd/compile/internal/ssa/testdata/scopes.dlv-opt.nexts index 3cc2ec5121d49..b5e41aa906e8c 100644 --- a/src/cmd/compile/internal/ssa/testdata/scopes.dlv-opt.nexts +++ b/src/cmd/compile/internal/ssa/testdata/scopes.dlv-opt.nexts @@ -15,6 +15,7 @@ 26: for i := x; i < 3; i++ { 31: fmt.Println(x, y) 30: y = x + y //gdb-dbg=(x,y)//gdb-opt=(x,y) +31: fmt.Println(x, y) 33: for x := 0; x <= 1; x++ { // From delve scopetest.go 35: f1(a) 38: f2(b) @@ -42,5 +43,4 @@ 58: if i == f { 59: fmt.Println("foo") 64: helloworld() -66: } 15: } diff --git a/src/cmd/compile/internal/ssa/testdata/scopes.gdb-opt.nexts b/src/cmd/compile/internal/ssa/testdata/scopes.gdb-opt.nexts index a66eab83cd388..5a186b5440b51 100644 --- a/src/cmd/compile/internal/ssa/testdata/scopes.gdb-opt.nexts +++ b/src/cmd/compile/internal/ssa/testdata/scopes.gdb-opt.nexts @@ -23,6 +23,7 @@ y = 1 30: y = x + y //gdb-dbg=(x,y)//gdb-opt=(x,y) x = 0 y = 5 +31: fmt.Println(x, y) 0: 5 35: f1(a) 38: f2(b) From 5de0c37ecf49b986f6231a9cf5273861101b634b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 20 Dec 2018 15:30:31 -0800 Subject: [PATCH 462/594] doc: go1.12: clarify use of MADV_FREE Fixes #29337 Change-Id: I1d632d19058c63dac8e25d2a5ad55555c1aec9d4 Reviewed-on: https://go-review.googlesource.com/c/155438 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 1a0127d88f5fd..527a7c73d459e 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -314,10 +314,9 @@

    Runtime

    - On Linux, the Go runtime now releases memory back to the operating - system only when the OS is under memory pressure. This is more - efficient, but means a process's RSS (resident set size) won't - decrease unless the OS is running out of memory. + On Linux, the runtime now uses MADV_FREE to release unused + memory. This is more efficient but may result in higher reported + RSS. The kernel will reclaim the unused data when it is needed.

    From 0175064e697d3e072573b32173299b7edbda7360 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 2 Jan 2019 19:57:11 -0800 Subject: [PATCH 463/594] net: skip TestUDPZeroBytePayload on Darwin Updates #29225 Change-Id: I4c9b7a108861ce5c9ab84f7324ced3da51e7bf2a Reviewed-on: https://go-review.googlesource.com/c/156119 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/udpsock_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/net/udpsock_test.go b/src/net/udpsock_test.go index c5a2439d6cd49..397b6649cda29 100644 --- a/src/net/udpsock_test.go +++ b/src/net/udpsock_test.go @@ -337,6 +337,8 @@ func TestUDPZeroBytePayload(t *testing.T) { switch runtime.GOOS { case "nacl", "plan9": t.Skipf("not supported on %s", runtime.GOOS) + case "darwin": + testenv.SkipFlaky(t, 29225) } c, err := newLocalPacketListener("udp") From abd1dde1f717f86f94774ce9ab56053947f2d175 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 31 Dec 2018 15:03:33 -0800 Subject: [PATCH 464/594] cmd/compile: fix no-op instruction used by s390x CL 152537 introduced a new use for ginsnop, the arch-dependent routine that generates nops. The previous s390x nop clobbered flags. It turns out the previous uses of this nop did not require flags to be preserved, but the new use does. Use a real nop: the 4-byte preferred nop. Fixes #29453 Change-Id: I95310dfdd831932e26f5d5b6608324687f4c3162 Reviewed-on: https://go-review.googlesource.com/c/155926 Reviewed-by: Michael Munday --- src/cmd/compile/internal/s390x/ggen.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cmd/compile/internal/s390x/ggen.go b/src/cmd/compile/internal/s390x/ggen.go index ba5f2dfc2bd14..6a72b27ac5682 100644 --- a/src/cmd/compile/internal/s390x/ggen.go +++ b/src/cmd/compile/internal/s390x/ggen.go @@ -105,10 +105,8 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) { } func ginsnop(pp *gc.Progs) *obj.Prog { - p := pp.Prog(s390x.AOR) - p.From.Type = obj.TYPE_REG - p.From.Reg = int16(s390x.REG_R0) - p.To.Type = obj.TYPE_REG - p.To.Reg = int16(s390x.REG_R0) + p := pp.Prog(s390x.AWORD) + p.From.Type = obj.TYPE_CONST + p.From.Offset = 0x47000000 // nop 0 return p } From 374546d800124e9ab4d51b75e335a71f866f3ef8 Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Wed, 19 Sep 2018 14:45:45 +0200 Subject: [PATCH 465/594] cmd/go: respect gcflags, ldflags in 'go test' Fixes bug introduced by https://golang.org/cl/129059 where gcflags='all=...' and ldflags='all=...' would not be applied to some packages built by 'go test'. LoadImport used to set gcflags/ldflags for the Package objects it created, in https://golang.org/cl/129059 this code was factored out to setToolFlags. The codepath of `go build` was updated to call setToolFlags appropriatley, but the codepath of `go test -c` wasn't, resulting in gcflags/ldflags being applied inconsistently when building tests. This commit changes TestPackagesFor to call setToolFlags on the package objects it creates. Fixes #27681 Change-Id: Idcbec0c989ee96ec066207184611f08818873e8d Reviewed-on: https://go-review.googlesource.com/c/136275 Run-TryBot: Jay Conrod TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- src/cmd/go/internal/load/test.go | 6 ++++++ src/cmd/go/testdata/script/gcflags_patterns.txt | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/cmd/go/internal/load/test.go b/src/cmd/go/internal/load/test.go index bb9568d07e32d..bd6f00bb669fb 100644 --- a/src/cmd/go/internal/load/test.go +++ b/src/cmd/go/internal/load/test.go @@ -227,6 +227,12 @@ func TestPackagesFor(p *Package, cover *TestCover) (pmain, ptest, pxtest *Packag } } + allTestImports := make([]*Package, 0, len(pmain.Internal.Imports)+len(imports)+len(ximports)) + allTestImports = append(allTestImports, pmain.Internal.Imports...) + allTestImports = append(allTestImports, imports...) + allTestImports = append(allTestImports, ximports...) + setToolFlags(allTestImports...) + // Do initial scan for metadata needed for writing _testmain.go // Use that metadata to update the list of imports for package main. // The list of imports is used by recompileForTest and by the loop diff --git a/src/cmd/go/testdata/script/gcflags_patterns.txt b/src/cmd/go/testdata/script/gcflags_patterns.txt index fe2cf6f0fb6d4..2d7e88647b370 100644 --- a/src/cmd/go/testdata/script/gcflags_patterns.txt +++ b/src/cmd/go/testdata/script/gcflags_patterns.txt @@ -21,6 +21,10 @@ stderr 'compile.* -p y' go build -n -v -gcflags=' z1 = -e ' z1 stderr 'compile.* -e .*-p z1' +# -gcflags='all=-N -l' should apply to all packages, even with go test +go test -c -n -gcflags='all=-N -l' z1 +stderr 'compile.* -N -l .*-p z3 ' + # -ldflags for implicit test package applies to test binary go test -c -n -gcflags=-N -ldflags=-X=x.y=z z1 stderr 'compile.* -N .*z_test.go' @@ -58,11 +62,15 @@ import _ "z2" -- z1/z_test.go -- package z1_test import "testing" +import _ "z3" func Test(t *testing.T) {} -- z2/z.go -- package z2 +-- z3/z.go -- +package z3 + -- y/y.go -- package y From 30c0a0d33faee0355db2cb91e8599d6fd85fae76 Mon Sep 17 00:00:00 2001 From: Stepan Shabalin Date: Thu, 3 Jan 2019 17:55:15 +0700 Subject: [PATCH 466/594] runtime: remove redundant slicing In the twoNonZero function in hash_test, the buffer is sliced as [:] three times. This change deletes them. Change-Id: I0701d0c810b4f3e267f80133a0dcdb4ed81fe356 Reviewed-on: https://go-review.googlesource.com/c/156138 Reviewed-by: Keith Randall Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot --- src/runtime/hash_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runtime/hash_test.go b/src/runtime/hash_test.go index 7b8ebc4f3c00f..fe25a7f84be38 100644 --- a/src/runtime/hash_test.go +++ b/src/runtime/hash_test.go @@ -177,13 +177,13 @@ func twoNonZero(h *HashSet, n int) { b := make([]byte, n) // all zero - h.addB(b[:]) + h.addB(b) // one non-zero byte for i := 0; i < n; i++ { for x := 1; x < 256; x++ { b[i] = byte(x) - h.addB(b[:]) + h.addB(b) b[i] = 0 } } @@ -195,7 +195,7 @@ func twoNonZero(h *HashSet, n int) { for j := i + 1; j < n; j++ { for y := 1; y < 256; y++ { b[j] = byte(y) - h.addB(b[:]) + h.addB(b) b[j] = 0 } } From 5372257e600989ab4cf742b35e3fa649cad3f45c Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 27 Dec 2018 00:47:20 +0900 Subject: [PATCH 467/594] runtime: skip stack barrier copy when there are no pointers After CL 31455, "go fun(n)" may put "n" to write barrier buffer when there are no pointers in fun's arguments. Fixes #29362 Change-Id: Icfa42b8759ce8ad9267dcb3859c626feb6fda381 Reviewed-on: https://go-review.googlesource.com/c/155779 Reviewed-by: Keith Randall --- src/runtime/proc.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/runtime/proc.go b/src/runtime/proc.go index bdf73e041204b..f2e7f707ed0cf 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -3303,9 +3303,11 @@ func newproc1(fn *funcval, argp *uint8, narg int32, callergp *g, callerpc uintpt if writeBarrier.needed && !_g_.m.curg.gcscandone { f := findfunc(fn.fn) stkmap := (*stackmap)(funcdata(f, _FUNCDATA_ArgsPointerMaps)) - // We're in the prologue, so it's always stack map index 0. - bv := stackmapdata(stkmap, 0) - bulkBarrierBitmap(spArg, spArg, uintptr(narg), 0, bv.bytedata) + if stkmap.nbit > 0 { + // We're in the prologue, so it's always stack map index 0. + bv := stackmapdata(stkmap, 0) + bulkBarrierBitmap(spArg, spArg, uintptr(narg), 0, bv.bytedata) + } } } From af4320350b3a156de0d1cfa9845ab1e48dcbfefa Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Thu, 3 Jan 2019 11:03:19 -0800 Subject: [PATCH 468/594] runtime: add test for go function argument scanning Derived from Naoki's reproducer. Update #29362 Change-Id: I1cbd33b38a2f74905dbc22c5ecbad4a87a24bdd1 Reviewed-on: https://go-review.googlesource.com/c/156122 Run-TryBot: Keith Randall Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- test/fixedbugs/issue29362.go | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 test/fixedbugs/issue29362.go diff --git a/test/fixedbugs/issue29362.go b/test/fixedbugs/issue29362.go new file mode 100644 index 0000000000000..a8bd607c4a29b --- /dev/null +++ b/test/fixedbugs/issue29362.go @@ -0,0 +1,42 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Verify that we don't consider a Go'd function's +// arguments as pointers when they aren't. + +package main + +import ( + "unsafe" +) + +var badPtr uintptr + +var sink []byte + +func init() { + // Allocate large enough to use largeAlloc. + b := make([]byte, 1<<16-1) + sink = b // force heap allocation + // Any space between the object and the end of page is invalid to point to. + badPtr = uintptr(unsafe.Pointer(&b[len(b)-1])) + 1 +} + +var throttle = make(chan struct{}, 10) + +func noPointerArgs(a, b, c, d uintptr) { + sink = make([]byte, 4096) + <-throttle +} + +func main() { + const N = 1000 + for i := 0; i < N; i++ { + throttle <- struct{}{} + go noPointerArgs(badPtr, badPtr, badPtr, badPtr) + sink = make([]byte, 4096) + } +} From 5073bf388694fd85d4419923c536af481df4e33b Mon Sep 17 00:00:00 2001 From: Jason LeBrun Date: Thu, 3 Jan 2019 21:06:29 +0000 Subject: [PATCH 469/594] crypto/sha256: fix casting of d.nx in UnmarshalBinary Fixes #29517 Change-Id: I7e741d82bb9f8e6ab39b6d9ab37ba6163176a097 GitHub-Last-Rev: 764d0bd9579cd90868c6a134cbb06dda584474d7 GitHub-Pull-Request: golang/go#29519 Reviewed-on: https://go-review.googlesource.com/c/156118 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/crypto/sha256/sha256.go | 2 +- src/crypto/sha256/sha256_test.go | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/crypto/sha256/sha256.go b/src/crypto/sha256/sha256.go index 1389de272771c..3fd446f94b6f2 100644 --- a/src/crypto/sha256/sha256.go +++ b/src/crypto/sha256/sha256.go @@ -100,7 +100,7 @@ func (d *digest) UnmarshalBinary(b []byte) error { b, d.h[7] = consumeUint32(b) b = b[copy(d.x[:], b):] b, d.len = consumeUint64(b) - d.nx = int(d.len) % chunk + d.nx = int(d.len % chunk) return nil } diff --git a/src/crypto/sha256/sha256_test.go b/src/crypto/sha256/sha256_test.go index cd402864e52d3..a606190753505 100644 --- a/src/crypto/sha256/sha256_test.go +++ b/src/crypto/sha256/sha256_test.go @@ -226,6 +226,69 @@ func TestBlockGeneric(t *testing.T) { } } +// Tests for unmarshaling hashes that have hashed a large amount of data +// The initial hash generation is omitted from the test, because it takes a long time. +// The test contains some already-generated states, and their expected sums +// Tests a problem that is outlined in Github issue #29517 +// The problem is triggered when an amount of data has been hashed for which +// the data length has a 1 in the 32nd bit. When casted to int, this changes +// the sign of the value, and causes the modulus operation to return a +// different result. +type unmarshalTest struct { + state string + sum string +} + +var largeUnmarshalTests = []unmarshalTest{ + // Data length: 7_115_087_207 + unmarshalTest{ + state: "sha\x03yX\xaf\xb7\x04*\x8f\xaa\x9bx\xc5#\x1f\xeb\x94\xfdz1\xaf\xfbk֗\n\xc93\xcf\x02\v.\xa5\xe4\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xa8\x17\x9dg", + sum: "f5e06371f0c115e9968455c8e48a318aba548b9f15676fa41de123f7d1c99c55", + }, + + // Data length: 7_070_038_086 + unmarshalTest{ + state: "sha\x03$\x933u\nV\v\xe2\xf7:0!ʳ\xa4\x13\xd3 6\xdcBB\xb5\x19\xcd=\xc1h\xee=\xb4\x9c@ABCDE\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xa5h8F", + sum: "a280b08df5eba060fcd0eb3d29320bbc038afb95781661f91bbfd0a6fc9fdd6e", + }, + + // Data length: 6_464_878_887 + unmarshalTest{ + state: "sha\x03\x9f\x12\x87G\xf2\xdf<\x82\xa0\x11/*W\x02&IKWlh\x03\x95\xb1\xab\f\n\xf6Ze\xf9\x1d\x1b\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x81V9'", + sum: "d2fffb762f105ab71e2d70069346c44c38c4fe183aad8cfcf5a76397c0457806", + }, +} + +func safeSum(h hash.Hash) (sum []byte, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("sum panic: %v", r) + } + }() + + return h.Sum(nil), nil +} +func TestLargeHashes(t *testing.T) { + for i, test := range largeUnmarshalTests { + + h := New() + if err := h.(encoding.BinaryUnmarshaler).UnmarshalBinary([]byte(test.state)); err != nil { + t.Errorf("test %d could not unmarshal: %v", i, err) + continue + } + + sum, err := safeSum(h) + if err != nil { + t.Errorf("test %d could not sum: %v", i, err) + continue + } + + if fmt.Sprintf("%x", sum) != test.sum { + t.Errorf("test %d sum mismatch: expect %s got %x", i, test.sum, sum) + } + } +} + var bench = New() var buf = make([]byte, 8192) From 688667716ede8b133d361db0a1d47eab24ced7f7 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Thu, 3 Jan 2019 12:13:53 -0800 Subject: [PATCH 470/594] runtime: don't scan go'd function args past length of ptr bitmap Use the length of the bitmap to decide how much to pass to the write barrier, not the total length of the arguments. The test needs enough arguments so that two distinct bitmaps get interpreted as a single longer bitmap. Update #29362 Change-Id: I78f3f7f9ec89c2ad4678f0c52d3d3def9cac8e72 Reviewed-on: https://go-review.googlesource.com/c/156123 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/proc.go | 2 +- test/fixedbugs/issue29362b.go | 53 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 test/fixedbugs/issue29362b.go diff --git a/src/runtime/proc.go b/src/runtime/proc.go index f2e7f707ed0cf..6e56b4b1d1b6f 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -3306,7 +3306,7 @@ func newproc1(fn *funcval, argp *uint8, narg int32, callergp *g, callerpc uintpt if stkmap.nbit > 0 { // We're in the prologue, so it's always stack map index 0. bv := stackmapdata(stkmap, 0) - bulkBarrierBitmap(spArg, spArg, uintptr(narg), 0, bv.bytedata) + bulkBarrierBitmap(spArg, spArg, uintptr(bv.n)*sys.PtrSize, 0, bv.bytedata) } } } diff --git a/test/fixedbugs/issue29362b.go b/test/fixedbugs/issue29362b.go new file mode 100644 index 0000000000000..d1e3b4733f8ab --- /dev/null +++ b/test/fixedbugs/issue29362b.go @@ -0,0 +1,53 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Verify that we don't consider a Go'd function's +// arguments as pointers when they aren't. + +package main + +import ( + "unsafe" +) + +var badPtr uintptr + +var sink []byte + +func init() { + // Allocate large enough to use largeAlloc. + b := make([]byte, 1<<16-1) + sink = b // force heap allocation + // Any space between the object and the end of page is invalid to point to. + badPtr = uintptr(unsafe.Pointer(&b[len(b)-1])) + 1 +} + +var throttle = make(chan struct{}, 10) + +// There are 2 arg bitmaps for this function, each with 2 bits. +// In the first, p and q are both live, so that bitmap is 11. +// In the second, only p is live, so that bitmap is 10. +// Bitmaps are byte aligned, so if the first bitmap is interpreted as +// extending across the entire argument area, we incorrectly concatenate +// the bitmaps and end up using 110000001. That bad bitmap causes a6 +// to be considered a pointer. +func noPointerArgs(p, q *byte, a0, a1, a2, a3, a4, a5, a6 uintptr) { + sink = make([]byte, 4096) + sinkptr = q + <-throttle + sinkptr = p +} + +var sinkptr *byte + +func main() { + const N = 1000 + for i := 0; i < N; i++ { + throttle <- struct{}{} + go noPointerArgs(nil, nil, badPtr, badPtr, badPtr, badPtr, badPtr, badPtr, badPtr) + sink = make([]byte, 4096) + } +} From af134b17da99344812344bba65247e45fa22d53b Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 10 Dec 2018 12:49:19 -0800 Subject: [PATCH 471/594] runtime: proper panic tracebacks with mid-stack inlining As a followon to CL 152537, modify the panic-printing traceback to also handle mid-stack inlining correctly. Also declare -fm functions (aka method functions) as wrappers, so that they get elided during traceback. This fixes part 2 of #26839. Fixes #28640 Fixes #24488 Update #26839 Change-Id: I1c535a9b87a9a1ea699621be1e6526877b696c21 Reviewed-on: https://go-review.googlesource.com/c/153477 Reviewed-by: David Chase --- src/cmd/internal/objabi/funcid.go | 3 + src/runtime/traceback.go | 102 ++++++++++++++---------------- test/fixedbugs/issue24488.go | 38 +++++++++++ 3 files changed, 89 insertions(+), 54 deletions(-) create mode 100644 test/fixedbugs/issue24488.go diff --git a/src/cmd/internal/objabi/funcid.go b/src/cmd/internal/objabi/funcid.go index fc9e421836926..1792df7cc1d0f 100644 --- a/src/cmd/internal/objabi/funcid.go +++ b/src/cmd/internal/objabi/funcid.go @@ -92,5 +92,8 @@ func GetFuncID(name, file string) FuncID { return FuncID_wrapper } } + if strings.HasSuffix(name, "-fm") { + return FuncID_wrapper + } return FuncID_normal } diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index da15ed0680d86..9b7fafcad70b3 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -146,7 +146,6 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in cgoCtxt := gp.cgoCtxt printing := pcbuf == nil && callback == nil _defer := gp._defer - elideWrapper := false for _defer != nil && _defer.sp == _NoArgs { _defer = _defer.link @@ -392,32 +391,39 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in // any frames. And don't elide wrappers that // called panic rather than the wrapped // function. Otherwise, leave them out. - name := funcname(f) - nextElideWrapper := elideWrapperCalling(f.funcID) - if (flags&_TraceRuntimeFrames) != 0 || showframe(f, gp, nprint == 0, elideWrapper && nprint != 0) { - // Print during crash. - // main(0x1, 0x2, 0x3) - // /home/rsc/go/src/runtime/x.go:23 +0xf - // - tracepc := frame.pc // back up to CALL instruction for funcline. - if (n > 0 || flags&_TraceTrap == 0) && frame.pc > f.entry && !waspanic { - tracepc-- - } - file, line := funcline(f, tracepc) - inldata := funcdata(f, _FUNCDATA_InlTree) - if inldata != nil { - inltree := (*[1 << 20]inlinedCall)(inldata) + + // backup to CALL instruction to read inlining info (same logic as below) + tracepc := frame.pc + if (n > 0 || flags&_TraceTrap == 0) && frame.pc > f.entry && !waspanic { + tracepc-- + } + // If there is inlining info, print the inner frames. + if inldata := funcdata(f, _FUNCDATA_InlTree); inldata != nil { + inltree := (*[1 << 20]inlinedCall)(inldata) + for { ix := pcdatavalue(f, _PCDATA_InlTreeIndex, tracepc, nil) - for ix != -1 { + if ix < 0 { + break + } + if (flags&_TraceRuntimeFrames) != 0 || showframe(f, gp, nprint == 0, inltree[ix].funcID, lastFuncID) { name := funcnameFromNameoff(f, inltree[ix].func_) + file, line := funcline(f, tracepc) print(name, "(...)\n") print("\t", file, ":", line, "\n") - - file = funcfile(f, inltree[ix].file) - line = inltree[ix].line - ix = int32(inltree[ix].parent) + nprint++ } + lastFuncID = inltree[ix].funcID + // Back up to an instruction in the "caller". + tracepc = frame.fn.entry + uintptr(inltree[ix].parentPc) } + } + if (flags&_TraceRuntimeFrames) != 0 || showframe(f, gp, nprint == 0, f.funcID, lastFuncID) { + // Print during crash. + // main(0x1, 0x2, 0x3) + // /home/rsc/go/src/runtime/x.go:23 +0xf + // + name := funcname(f) + file, line := funcline(f, tracepc) if name == "runtime.gopanic" { name = "panic" } @@ -444,7 +450,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in print("\n") nprint++ } - elideWrapper = nextElideWrapper + lastFuncID = f.funcID } n++ @@ -669,7 +675,7 @@ func printcreatedby(gp *g) { // Show what created goroutine, except main goroutine (goid 1). pc := gp.gopc f := findfunc(pc) - if f.valid() && showframe(f, gp, false, false) && gp.goid != 1 { + if f.valid() && showframe(f, gp, false, funcID_normal, funcID_normal) && gp.goid != 1 { printcreatedby1(f, pc) } } @@ -756,11 +762,10 @@ func traceback1(pc, sp, lr uintptr, gp *g, flags uint) { // TODO: Unify this with gentraceback and CallersFrames. func printAncestorTraceback(ancestor ancestorInfo) { print("[originating from goroutine ", ancestor.goid, "]:\n") - elideWrapper := false for fidx, pc := range ancestor.pcs { f := findfunc(pc) // f previously validated - if showfuncinfo(f, fidx == 0, elideWrapper && fidx != 0) { - elideWrapper = printAncestorTracebackFuncInfo(f, pc) + if showfuncinfo(f, fidx == 0, funcID_normal, funcID_normal) { + printAncestorTracebackFuncInfo(f, pc) } } if len(ancestor.pcs) == _TracebackMaxFrames { @@ -768,7 +773,7 @@ func printAncestorTraceback(ancestor ancestorInfo) { } // Show what created goroutine, except main goroutine (goid 1). f := findfunc(ancestor.gopc) - if f.valid() && showfuncinfo(f, false, false) && ancestor.goid != 1 { + if f.valid() && showfuncinfo(f, false, funcID_normal, funcID_normal) && ancestor.goid != 1 { printcreatedby1(f, ancestor.gopc) } } @@ -777,27 +782,16 @@ func printAncestorTraceback(ancestor ancestorInfo) { // within an ancestor traceback. The precision of this info is reduced // due to only have access to the pcs at the time of the caller // goroutine being created. -func printAncestorTracebackFuncInfo(f funcInfo, pc uintptr) bool { - tracepc := pc // back up to CALL instruction for funcline. - if pc > f.entry { - tracepc -= sys.PCQuantum - } - file, line := funcline(f, tracepc) - inldata := funcdata(f, _FUNCDATA_InlTree) - if inldata != nil { +func printAncestorTracebackFuncInfo(f funcInfo, pc uintptr) { + name := funcname(f) + if inldata := funcdata(f, _FUNCDATA_InlTree); inldata != nil { inltree := (*[1 << 20]inlinedCall)(inldata) - ix := pcdatavalue(f, _PCDATA_InlTreeIndex, tracepc, nil) - for ix != -1 { - name := funcnameFromNameoff(f, inltree[ix].func_) - print(name, "(...)\n") - print("\t", file, ":", line, "\n") - - file = funcfile(f, inltree[ix].file) - line = inltree[ix].line - ix = int32(inltree[ix].parent) + ix := pcdatavalue(f, _PCDATA_InlTreeIndex, pc, nil) + if ix >= 0 { + name = funcnameFromNameoff(f, inltree[ix].func_) } } - name := funcname(f) + file, line := funcline(f, pc) if name == "runtime.gopanic" { name = "panic" } @@ -807,7 +801,6 @@ func printAncestorTracebackFuncInfo(f funcInfo, pc uintptr) bool { print(" +", hex(pc-f.entry)) } print("\n") - return elideWrapperCalling(f.funcID) } func callers(skip int, pcbuf []uintptr) int { @@ -825,15 +818,19 @@ func gcallers(gp *g, skip int, pcbuf []uintptr) int { return gentraceback(^uintptr(0), ^uintptr(0), 0, gp, skip, &pcbuf[0], len(pcbuf), nil, nil, 0) } -func showframe(f funcInfo, gp *g, firstFrame, elideWrapper bool) bool { +// showframe reports whether the frame with the given characteristics should +// be printed during a traceback. +func showframe(f funcInfo, gp *g, firstFrame bool, funcID, childID funcID) bool { g := getg() if g.m.throwing > 0 && gp != nil && (gp == g.m.curg || gp == g.m.caughtsig.ptr()) { return true } - return showfuncinfo(f, firstFrame, elideWrapper) + return showfuncinfo(f, firstFrame, funcID, childID) } -func showfuncinfo(f funcInfo, firstFrame, elideWrapper bool) bool { +// showfuncinfo reports whether a function with the given characteristics should +// be printed during a traceback. +func showfuncinfo(f funcInfo, firstFrame bool, funcID, childID funcID) bool { level, _, _ := gotraceback() if level > 1 { // Show all frames. @@ -844,11 +841,8 @@ func showfuncinfo(f funcInfo, firstFrame, elideWrapper bool) bool { return false } - if elideWrapper { - file, _ := funcline(f, f.entry) - if file == "" { - return false - } + if funcID == funcID_wrapper && elideWrapperCalling(childID) { + return false } name := funcname(f) diff --git a/test/fixedbugs/issue24488.go b/test/fixedbugs/issue24488.go new file mode 100644 index 0000000000000..b3deab48228d8 --- /dev/null +++ b/test/fixedbugs/issue24488.go @@ -0,0 +1,38 @@ +// run + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "runtime" + "strings" +) + +type Func func() + +func (f Func) Foo() { + if f != nil { + f() + } +} + +func (f Func) Bar() { + if f != nil { + f() + } + buf := make([]byte, 4000) + n := runtime.Stack(buf, true) + s := string(buf[:n]) + if strings.Contains(s, "-fm") { + panic("wrapper present in stack trace:\n" + s) + } +} + +func main() { + foo := Func(func() {}) + foo = foo.Bar + foo.Foo() +} From 9a7278ae47fd2ef9675e4303409e726e429d64e3 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Thu, 3 Jan 2019 18:33:36 -0500 Subject: [PATCH 472/594] cmd/go: fix failure in TestScript/build_runtime_gcflags This test case failed on the longtest builder. It relied on runtime/internal/atomic not being compiled with the -l flag in the cache. The test case now creates its own GOCACHE, similar to build_cache_compile and a few others. Also, mention the correct issue the test case verifies. Fixes #29395 Change-Id: Id50e9dfc50db03fb11582d3dd6b69c3e1ed750eb Reviewed-on: https://go-review.googlesource.com/c/156237 Run-TryBot: Jay Conrod TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/go/testdata/script/build_runtime_gcflags.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/testdata/script/build_runtime_gcflags.txt b/src/cmd/go/testdata/script/build_runtime_gcflags.txt index dc0767c569f17..767b768b82f87 100644 --- a/src/cmd/go/testdata/script/build_runtime_gcflags.txt +++ b/src/cmd/go/testdata/script/build_runtime_gcflags.txt @@ -1,4 +1,8 @@ -# This test verifies the standard library (specifically runtime/internal/atomic) -# can be built with -gcflags when -n is given. See golang.org/issue/26092. +# Set up fresh GOCACHE. +env GOCACHE=$WORK/gocache +mkdir $GOCACHE + +# Verify the standard library (specifically runtime/internal/atomic) can be +# built with -gcflags when -n is given. See golang.org/issue/29346. go build -n -gcflags=all='-l' std stderr 'compile.* -l .* runtime/internal/atomic' From 95a6f112c6db064d3394f9f66aa569e9bbeb3617 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 3 Jan 2019 14:48:30 -0500 Subject: [PATCH 473/594] runtime: work around "P has cached GC work" failures We still don't understand what's causing there to be remaining GC work when we enter mark termination, but in order to move forward on this issue, this CL implements a work-around for the problem. If debugCachedWork is false, this CL does a second check for remaining GC work as soon as it stops the world for mark termination. If it finds any work, it starts the world again and re-enters concurrent mark. This will increase STW time by a small amount proportional to GOMAXPROCS, but fixes a serious correctness issue. This works-around #27993. Change-Id: Ia23b85dd6c792ee8d623428bd1a3115631e387b8 Reviewed-on: https://go-review.googlesource.com/c/156140 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Michael Knyszek Reviewed-by: Rick Hudson --- src/runtime/mgc.go | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index f5d6374ce648f..4d4cdc14ca810 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1367,7 +1367,7 @@ var gcMarkDoneFlushed uint32 // termination. // // For debugging issue #27993. -const debugCachedWork = true +const debugCachedWork = false // gcWorkPauseGen is for debugging the mark completion algorithm. // gcWork put operations spin while gcWork.pauseGen == gcWorkPauseGen. @@ -1525,6 +1525,33 @@ top: throw("throwOnGCWork") } } + } else { + // For unknown reasons (see issue #27993), there is + // sometimes work left over when we enter mark + // termination. Detect this and resume concurrent + // mark. This is obviously unfortunate. + // + // Switch to the system stack to call wbBufFlush1, + // though in this case it doesn't matter because we're + // non-preemptible anyway. + restart := false + systemstack(func() { + for _, p := range allp { + wbBufFlush1(p) + if !p.gcw.empty() { + restart = true + break + } + } + }) + if restart { + getg().m.preemptoff = "" + systemstack(func() { + now := startTheWorldWithSema(true) + work.pauseNS += now - work.pauseStart + }) + goto top + } } // Disable assists and background workers. We must do From 0d6a2d5f9a0cd3c7111f38abd12a2255363bbd51 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Dec 2018 16:06:54 -0800 Subject: [PATCH 474/594] runtime: skip writes to persistent memory in cgo checker Fixes #23899 Fixes #28458 Change-Id: Ie177f2d4c399445d8d5e1a327f2419c7866cb45e Reviewed-on: https://go-review.googlesource.com/c/155697 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- misc/cgo/errors/ptr_test.go | 33 ++++++++++++++++++------------ src/runtime/cgocheck.go | 7 +++++++ src/runtime/malloc.go | 40 +++++++++++++++++++++++++++++++++---- 3 files changed, 63 insertions(+), 17 deletions(-) diff --git a/misc/cgo/errors/ptr_test.go b/misc/cgo/errors/ptr_test.go index 165c2d407c6b2..254671f179eb7 100644 --- a/misc/cgo/errors/ptr_test.go +++ b/misc/cgo/errors/ptr_test.go @@ -406,6 +406,24 @@ var ptrTests = []ptrTest{ body: `var b bytes.Buffer; b.WriteString("a"); C.f(unsafe.Pointer(&b.Bytes()[0]))`, fail: false, }, + { + // Test that bgsweep releasing a finalizer is OK. + name: "finalizer", + c: `// Nothing to declare.`, + imports: []string{"os"}, + support: `func open() { os.Open(os.Args[0]) }; var G [][]byte`, + body: `for i := 0; i < 10000; i++ { G = append(G, make([]byte, 4096)); if i % 100 == 0 { G = nil; open() } }`, + fail: false, + }, + { + // Test that converting generated struct to interface is OK. + name: "structof", + c: `// Nothing to declare.`, + imports: []string{"reflect"}, + support: `type MyInt int; func (i MyInt) Get() int { return int(i) }; type Getter interface { Get() int }`, + body: `t := reflect.StructOf([]reflect.StructField{{Name: "MyInt", Type: reflect.TypeOf(MyInt(0)), Anonymous: true}}); v := reflect.New(t).Elem(); v.Interface().(Getter).Get()`, + fail: false, + }, } func TestPointerChecks(t *testing.T) { @@ -478,7 +496,7 @@ func testOne(t *testing.T, pt ptrTest) { cmd := exec.Command("go", "build") cmd.Dir = src - cmd.Env = addEnv("GOPATH", gopath) + cmd.Env = append(os.Environ(), "GOPATH="+gopath) buf, err := cmd.CombinedOutput() if err != nil { t.Logf("%#q:\n%s", args(cmd), buf) @@ -550,16 +568,5 @@ func testOne(t *testing.T, pt ptrTest) { } func cgocheckEnv(val string) []string { - return addEnv("GODEBUG", "cgocheck="+val) -} - -func addEnv(key, val string) []string { - env := []string{key + "=" + val} - look := key + "=" - for _, e := range os.Environ() { - if !strings.HasPrefix(e, look) { - env = append(env, e) - } - } - return env + return append(os.Environ(), "GODEBUG=cgocheck="+val) } diff --git a/src/runtime/cgocheck.go b/src/runtime/cgocheck.go index ac57e0344eea6..7f3c4aa803079 100644 --- a/src/runtime/cgocheck.go +++ b/src/runtime/cgocheck.go @@ -43,6 +43,13 @@ func cgoCheckWriteBarrier(dst *uintptr, src uintptr) { return } + // It's OK if writing to memory allocated by persistentalloc. + // Do this check last because it is more expensive and rarely true. + // If it is false the expense doesn't matter since we are crashing. + if inPersistentAlloc(uintptr(unsafe.Pointer(dst))) { + return + } + systemstack(func() { println("write of Go pointer", hex(src), "to non-Go memory", hex(uintptr(unsafe.Pointer(dst)))) throw(cgoWriteBarrierFail) diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 678e68931150b..c1a89dc588d7d 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -1167,6 +1167,15 @@ var globalAlloc struct { persistentAlloc } +// persistentChunkSize is the number of bytes we allocate when we grow +// a persistentAlloc. +const persistentChunkSize = 256 << 10 + +// persistentChunks is a list of all the persistent chunks we have +// allocated. The list is maintained through the first word in the +// persistent chunk. This is updated atomically. +var persistentChunks *notInHeap + // Wrapper around sysAlloc that can allocate small chunks. // There is no associated free operation. // Intended for things like function/type/debug-related persistent data. @@ -1187,7 +1196,6 @@ func persistentalloc(size, align uintptr, sysStat *uint64) unsafe.Pointer { //go:systemstack func persistentalloc1(size, align uintptr, sysStat *uint64) *notInHeap { const ( - chunk = 256 << 10 maxBlock = 64 << 10 // VM reservation granularity is 64K on windows ) @@ -1218,15 +1226,24 @@ func persistentalloc1(size, align uintptr, sysStat *uint64) *notInHeap { persistent = &globalAlloc.persistentAlloc } persistent.off = round(persistent.off, align) - if persistent.off+size > chunk || persistent.base == nil { - persistent.base = (*notInHeap)(sysAlloc(chunk, &memstats.other_sys)) + if persistent.off+size > persistentChunkSize || persistent.base == nil { + persistent.base = (*notInHeap)(sysAlloc(persistentChunkSize, &memstats.other_sys)) if persistent.base == nil { if persistent == &globalAlloc.persistentAlloc { unlock(&globalAlloc.mutex) } throw("runtime: cannot allocate memory") } - persistent.off = 0 + + // Add the new chunk to the persistentChunks list. + for { + chunks := uintptr(unsafe.Pointer(persistentChunks)) + *(*uintptr)(unsafe.Pointer(persistent.base)) = chunks + if atomic.Casuintptr((*uintptr)(unsafe.Pointer(&persistentChunks)), chunks, uintptr(unsafe.Pointer(persistent.base))) { + break + } + } + persistent.off = sys.PtrSize } p := persistent.base.add(persistent.off) persistent.off += size @@ -1242,6 +1259,21 @@ func persistentalloc1(size, align uintptr, sysStat *uint64) *notInHeap { return p } +// inPersistentAlloc reports whether p points to memory allocated by +// persistentalloc. This must be nosplit because it is called by the +// cgo checker code, which is called by the write barrier code. +//go:nosplit +func inPersistentAlloc(p uintptr) bool { + chunk := atomic.Loaduintptr((*uintptr)(unsafe.Pointer(&persistentChunks))) + for chunk != 0 { + if p >= chunk && p < chunk+persistentChunkSize { + return true + } + chunk = *(*uintptr)(unsafe.Pointer(chunk)) + } + return false +} + // linearAlloc is a simple linear allocator that pre-reserves a region // of memory and then maps that region as needed. The caller is // responsible for locking. From 23c22ca42c60194c32cf9692604fb25ca38d6f30 Mon Sep 17 00:00:00 2001 From: Jason LeBrun Date: Fri, 4 Jan 2019 00:21:15 +0000 Subject: [PATCH 475/594] crypto/sha512: fix casting of d.nx in UnmarshalBinary Fixes #29541 Change-Id: I006915b020b6e710298c32c05e3de77a7f9b54f3 GitHub-Last-Rev: c7a90a4bbe17fd1904c0942e8b343264fb85cba1 GitHub-Pull-Request: golang/go#29542 Reviewed-on: https://go-review.googlesource.com/c/156277 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/crypto/sha512/sha512.go | 2 +- src/crypto/sha512/sha512_test.go | 57 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/crypto/sha512/sha512.go b/src/crypto/sha512/sha512.go index 24fde7dce708b..c685319480c24 100644 --- a/src/crypto/sha512/sha512.go +++ b/src/crypto/sha512/sha512.go @@ -191,7 +191,7 @@ func (d *digest) UnmarshalBinary(b []byte) error { b, d.h[7] = consumeUint64(b) b = b[copy(d.x[:], b):] b, d.len = consumeUint64(b) - d.nx = int(d.len) % chunk + d.nx = int(d.len % chunk) return nil } diff --git a/src/crypto/sha512/sha512_test.go b/src/crypto/sha512/sha512_test.go index 4423cf5f18952..96a1aa69a4fcc 100644 --- a/src/crypto/sha512/sha512_test.go +++ b/src/crypto/sha512/sha512_test.go @@ -11,6 +11,7 @@ import ( "crypto/rand" "encoding" "encoding/hex" + "fmt" "hash" "io" "testing" @@ -831,6 +832,62 @@ func TestBlockGeneric(t *testing.T) { } } +// Tests for unmarshaling hashes that have hashed a large amount of data +// The initial hash generation is omitted from the test, because it takes a long time. +// The test contains some already-generated states, and their expected sums +// Tests a problem that is outlined in Github issue #29541 +// The problem is triggered when an amount of data has been hashed for which +// the data length has a 1 in the 32nd bit. When casted to int, this changes +// the sign of the value, and causes the modulus operation to return a +// different result. +type unmarshalTest struct { + state string + sum string +} + +var largeUnmarshalTests = []unmarshalTest{ + // Data length: 6_565_544_823 + unmarshalTest{ + state: "sha\aηe\x0f\x0f\xe1r]#\aoJ!.{5B\xe4\x140\x91\xdd\x00a\xe1\xb3E&\xb9\xbb\aJ\x9f^\x9f\x03ͺD\x96H\x80\xb0X\x9d\xdeʸ\f\xf7:\xd5\xe6'\xb9\x93f\xddA\xf0~\xe1\x02\x14\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuv\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x87VCw", + sum: "12d612357a1dbc74a28883dff79b83e7d2b881ae40d7a67fd7305490bc8a641cd1ce9ece598192080d6e9ac7e75d5988567a58a9812991299eb99a04ecb69523", + }, + unmarshalTest{ + state: "sha\a2\xd2\xdc\xf5\xd7\xe2\xf9\x97\xaa\xe7}Fϱ\xbc\x8e\xbf\x12h\x83Z\xa1\xc7\xf5p>bfS T\xea\xee\x1e\xa6Z\x9c\xa4ڶ\u0086\bn\xe47\x8fsGs3\xe0\xda\\\x9dqZ\xa5\xf6\xd0kM\xa1\xf2\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuv\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xa7VCw", + sum: "94a04b9a901254cd94ca0313557e4be3ab1ca86e920c1f3efdc22d361e9ae12be66bc6d6dc5db79a0a4aa6eca6f293c1e9095bbae127ae405f6c325478343299", + }, +} + +func safeSum(h hash.Hash) (sum []byte, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("sum panic: %v", r) + } + }() + + return h.Sum(nil), nil +} + +func TestLargeHashes(t *testing.T) { + for i, test := range largeUnmarshalTests { + + h := New() + if err := h.(encoding.BinaryUnmarshaler).UnmarshalBinary([]byte(test.state)); err != nil { + t.Errorf("test %d could not unmarshal: %v", i, err) + continue + } + + sum, err := safeSum(h) + if err != nil { + t.Errorf("test %d could not sum: %v", i, err) + continue + } + + if fmt.Sprintf("%x", sum) != test.sum { + t.Errorf("test %d sum mismatch: expect %s got %x", i, test.sum, sum) + } + } +} + var bench = New() var buf = make([]byte, 8192) From d15ffca108b81f15e9042993b80e8b91c56968c4 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 2 Jan 2019 18:22:42 +0000 Subject: [PATCH 476/594] doc/go1.12: mention Conn.SetDeadline improvements, GODEBUG=madvdontneed=1 Fixes #29439 Updates #28466 Change-Id: Ifa0779a089a969f99f1a47127e23565f31eec24f Reviewed-on: https://go-review.googlesource.com/c/155929 Reviewed-by: Tobias Klauser Reviewed-by: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- doc/go1.12.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 527a7c73d459e..975550fea4fb7 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -313,10 +313,18 @@

    Runtime

    can't reuse existing heap space.

    +

    + The Go runtime's timer and deadline code is faster and scales better + with higher numbers of CPUs. In particular, this improves the + performance of manipulating network connection deadlines. +

    +

    - On Linux, the runtime now uses MADV_FREE to release unused + On Linux, the runtime now uses MADV_FREE to release unused memory. This is more efficient but may result in higher reported RSS. The kernel will reclaim the unused data when it is needed. + To revert to the Go 1.11 behavior (MADV_DONTNEED), set the + environment variable GODEBUG=madvdontneed=1.

    From 0dc7a1daf69ccfef2fe82c66da580c48d83d197d Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 21 Dec 2018 16:57:42 -0500 Subject: [PATCH 477/594] doc/go1.12: document RSA-PSS support in crypto/tls Change-Id: I9350e5a72e3c375f6b76897708f09f1f50c7be14 Reviewed-on: https://go-review.googlesource.com/c/155482 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 975550fea4fb7..01bc6f50e380d 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -442,9 +442,14 @@

    Minor changes to the library

    crypto/tls
    +

    + TLS 1.2 clients and servers will now advertise and accept RSA-PSS + signature algorithms for use with regular RSA public keys. +

    +

    If a client sends an initial message that does not look like TLS, the server - will now not reply with an alert, and it will expose the underlying + will no longer reply with an alert, and it will expose the underlying net.Conn in the new field Conn of RecordHeaderError.

    From 4c3b4dfd798fa24ef33cd0f5c80e4b9857d9849e Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Thu, 3 Jan 2019 19:44:55 -0500 Subject: [PATCH 478/594] CONTRIBUTORS: first round of automated updates for Go 1.12 These updates have been automatically generated using a modified version of the updateac command with the following changes: - code to automatically update the AUTHORS file has been removed, since we're not updating that file automatically after Go 1.11 (see CL 128877) - CLA checking code has been removed, since it was primarily needed for updating the AUTHORS file - instead of executing the misc/sortac binary, its code was embedded into the updateac command itself The modified updateac command will be added to x/build repository soon, and the misc/sortac command can be removed afterwards. Updates #12042 Change-Id: Ibf73068698b14b1aad4df4490747b488508ff5fd Reviewed-on: https://go-review.googlesource.com/c/156278 Reviewed-by: Filippo Valsorda --- CONTRIBUTORS | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 305f6d8d801ce..f6a0df11f7184 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -32,6 +32,7 @@ Aaron Stein Aaron Torres Aaron Zinman Aarti Parikh +Abdullah Al Maruf Abe Haskins Abhinav Gupta Adam Azarchs @@ -66,6 +67,7 @@ Aishraj Dahal Akhil Indurti Akihiro Suda Akshat Kumar +Alan Braithwaite Alan Donovan Alan Shreve Albert Nigmatzianov @@ -74,8 +76,10 @@ Albert Yu Alberto Bertogli Alberto Donizetti Alberto García Hierro +Aleksa Sarai Aleksandar Dezelin Aleksandr Lukinykh +Aleksandr Razumov Alekseev Artem Alessandro Arzilli Alessandro Baffa @@ -85,6 +89,7 @@ Alex Bramley Alex Browne Alex Carol Alex Jin +Alex Kohler Alex Myasoedov Alex Plugaru Alex Schroeder @@ -106,15 +111,19 @@ Alexander Polcyn Alexander Reece Alexander Surma Alexander Zhavnerchik +Alexander Zillion Alexander Zolotov Alexandre Cesaro Alexandre Fiori +Alexandre Maari Alexandre Normand Alexandre Parentea Alexandre Viau Alexandru Moșoi Alexei Sholik +Alexey Alexandrov Alexey Borzenkov +Alexey Naidonov Alexey Neganov Alexey Palazhchenko Alexis Hildebrandt @@ -133,14 +142,17 @@ Anand K. Mistry Anders Pearson André Carvalho Andre Nathan +Andrea Nodari Andrea Spadaccini Andreas Auernhammer Andreas Jellinghaus Andreas Litt +Andrei Gherzan Andrei Korzhevskii Andrei Tudor Călin Andrei Vieru Andres Erbsen +Andres Lowrie Andrew Austin Andrew Balholm Andrew Benton @@ -155,9 +167,11 @@ Andrew Jackura Andrew Lutomirski Andrew Pilloud Andrew Pogrebnoy +Andrew Poydence Andrew Pritchard Andrew Radev Andrew Skiba +Andrew Stribblehill Andrew Szeto Andrew Werner Andrew Wilkins @@ -178,17 +192,21 @@ Anfernee Yongkun Gui Angelo Bulfone Anh Hai Trinh Anit Gandhi +Ankit Goyal Anmol Sethi Anschel Schaffer-Cohen Anthony Alves Anthony Canino Anthony Eufemio +Anthony Fok Anthony Martin Anthony Sottile Anthony Starks Anthony Voutas Anthony Woods +Antoine GIRARD Antoine Martin +Anton Gyllenberg Antonin Amand Antonio Antelo Antonio Bibiano @@ -204,6 +222,7 @@ Arnaud Ysmal Arne Hormann Arnout Engelen Aron Nopanen +Arthur Fabre Arthur Khashaev Artyom Pervukhin Arvindh Rajesh Tamilmani @@ -217,6 +236,7 @@ Augusto Roman Aulus Egnatius Varialus Aurélien Rainone Austin Clements +Avi Flax awaw fumin Awn Umar Axel Wagner @@ -224,6 +244,7 @@ Ayanamist Yang Aymerick Jéhanne Azat Kaumov Baiju Muthukadan +Balaram Makam Balazs Lecz Baokun Lee Bartosz Grzybowski @@ -233,6 +254,7 @@ Ben Burkert Ben Eitzen Ben Fried Ben Haines +Ben Hoyt Ben Laurie Ben Lubar Ben Lynn @@ -263,6 +285,7 @@ Blake Mizerany Blixt Bob Briski Bob Potter +Bobby DeSimone Bobby Powers Boris Nagaev Borja Clemente @@ -313,6 +336,7 @@ Carlo Alberto Ferraris Carlos Castillo Carlos Cirello Carlos Eduardo Seo +Carlos Souza Carolyn Van Slyck Cary Hull Case Nelson @@ -324,7 +348,9 @@ Cedric Staub Cezar Sá Espinola Chad Rosier ChaiShushan +Channing Kimble-Brown Charles Fenwick Elliott +Charles Kenney Charles L. Dorian Charles Lee Charles Weill @@ -355,6 +381,7 @@ Christian Alexander Christian Couder Christian Himpel Christian Pellegrin +Christian R. Petrin Christine Hansmann Christoffer Buchholz Christoph Blecker @@ -371,12 +398,14 @@ Christopher Wedgwood Christos Zoulas Christy Perez CL Sung +Clément Chigot Clement Skau Cody Oss Colby Ranger Colin Cross Colin Edwards Colin Kennedy +Colin Nelson Colin Rice Conrad Irwin Conrad Meyer @@ -401,10 +430,13 @@ Dan Caddigan Dan Callahan Dan Harrington Dan Jacques +Dan Johnson Dan Peterson Dan Pupius Dan Sinclair +Daniël de Kok Daniel Fleischman +Daniel Ingram Daniel Johansson Daniel Kerwin Daniel Krech @@ -421,6 +453,7 @@ Daniel Upton Daniela Petruzalek Danny Rosseau Daria Kolistratova +Darien Raymond Darren Elwood Darshan Parajuli Datong Sun @@ -445,12 +478,15 @@ David du Colombier <0intro@gmail.com> David Forsythe David G. Andersen David Glasser +David Heuschmann David Howden David Hubbard David Jakob Fritz +David Jones David Lazar David Leon Gil David McLeish +David Ndungu David NewHamlet David Presotto David R. Jenni @@ -458,7 +494,9 @@ David Sansome David Stainton David Symonds David Thomas +David Timm David Titarenco +David Tolpin David Url David Volquartz Lebech David Wimmer @@ -471,6 +509,7 @@ Denis Brandolini Denis Nagorny Dennis Kuhnert Denys Honsiorovskyi +Denys Smirnov Derek Buitenhuis Derek Che Derek McGowan @@ -485,9 +524,11 @@ Dhiru Kholia Dhruvdutt Jadhav Di Xiao Didier Spezia +Diego Siqueira Dieter Plaetinck Dimitri Sokolyuk Dimitri Tcaciuc +Dina Garmash Diogo Pinela Dirk Gadsden Diwaker Gupta @@ -499,16 +540,20 @@ Dmitriy Shelenin Dmitriy Vyukov Dmitry Chestnykh Dmitry Doroginin +Dmitry Neverov Dmitry Savintsev Dmitry Yakunin +Domen Ipavec Dominic Green Dominik Honnef Dominik Vogt +Don Byington Donald Huang Dong-hee Na Donovan Hide Doug Anderson Doug Fawley +Drew Flower Drew Hintz Duncan Holm Dustin Carlino @@ -520,6 +565,7 @@ Dvir Volk Dylan Waits Edan Bedrik <3d4nb3@gmail.com> Eden Li +Eduard Urbach Eduardo Ramalho Edward Muller Egon Elbre @@ -547,6 +593,7 @@ Eric Koleda Eric Lagergren Eric Milliken Eric Pauley +Eric Ponce Eric Rescorla Eric Roshan-Eisner Eric Rykwalder @@ -555,6 +602,7 @@ Erik Dubbelboer Erik St. Martin Erik Staab Erik Westrup +Erin Masatsugu Ernest Chiang Erwin Oegema Esko Luontola @@ -566,6 +614,7 @@ Evan Broder Evan Brown Evan Hicks Evan Jones +Evan Klitzke Evan Kroske Evan Martin Evan Phoenix @@ -591,8 +640,10 @@ Felix Geisendörfer Felix Kollmann Filip Gruszczyński Filip Haglund +Filip Stanis Filippo Valsorda Firmansyah Adiputra +Florian Forster Florian Uekermann Florian Weimer Florin Patan @@ -613,6 +664,7 @@ Fredrik Wallgren Frithjof Schulze Frits van Bommel Fumitoshi Ukai +G. Hussain Chinoy Gaal Yahas Gabríel Arthúr Pétursson Gabriel Aszalos @@ -627,6 +679,7 @@ Gaurish Sharma Gautham Thambidorai Gauthier Jolly Geert-Johan Riemer +Genevieve Luyt Gengliang Wang Geoff Berry Geoffroy Lorieux @@ -634,24 +687,40 @@ Geon Kim Georg Reinke George Gkirtsou George Shammas +Gerasimos (Makis) Maropoulos Gerasimos Dimitriadis +Gergely Brautigam Getulio Sánchez +Gianguido Sora` Gideon Jan-Wessel Redelinghuys Giles Lean Giovanni Bajo GitHub User @ajnirp (1688456) +GitHub User @andrius4669 (4699695) GitHub User @as (8127015) GitHub User @bgadrian (830001) GitHub User @bontequero (2674999) GitHub User @cch123 (384546) GitHub User @chanxuehong (3416908) +GitHub User @dupoxy (1143957) GitHub User @erifan (31343225) +GitHub User @esell (9735165) +GitHub User @itchyny (375258) +GitHub User @kc1212 (1093806) GitHub User @Kropekk (13366453) +GitHub User @LotusFenn (13775899) GitHub User @madiganz (18340029) +GitHub User @mkishere (224617) <224617+mkishere@users.noreply.github.com> +GitHub User @OlgaVlPetrova (44112727) GitHub User @pityonline (438222) GitHub User @pytimer (17105586) GitHub User @shogo-ma (9860598) +GitHub User @tkivisik (13732144) +GitHub User @uhei (2116845) +GitHub User @uropek (39370426) Giulio Iotti +Giulio Micheloni +Giuseppe Valente Gleb Stepanov Glenn Brown Glenn Lewis @@ -660,6 +729,7 @@ Graham King Graham Miller Grant Griffiths Greg Poirier +Greg Steuck Greg Ward Grégoire Delattre Gregory Man @@ -668,6 +738,7 @@ Guilherme Goncalves Guilherme Rezende Guillaume J. Charmes Guobiao Mei +Guoliang Wang Gustav Paul Gustav Westling Gustavo Franco @@ -702,6 +773,7 @@ Henry Clifford Herbert Georg Fischer Herbie Ong Heschi Kreinick +Hidetatsu Yaginuma Hilko Bengen Hiroaki Nakamura Hironao OTSUBO @@ -715,11 +787,16 @@ Hsin Tsao Hsin-Ho Yeh Hu Keping Hugues Bruant +Huy Le Hyang-Ah Hana Kim Ian Cottrell +Ian Davis Ian Gudger +Ian Haken Ian Kent Ian Lance Taylor +Ian Leue +Ian Zapolsky Ibrahim AshShohail Icarus Sparry Iccha Sethi @@ -727,6 +804,7 @@ Idora Shinatose Igor Bernstein Igor Dolzhikov Igor Vashyst +Igor Zhilianin Ilya Tocar INADA Naoki Inanc Gumus @@ -743,9 +821,12 @@ Issac Trotts Ivan Babrou Ivan Bertona Ivan Krasin +Ivan Kutuzov Ivan Markin Ivan Moscoso +Ivan Sharavuev Ivan Ukhov +Ivy Evans Jaana Burcu Dogan Jack Britton Jack Lindamood @@ -753,6 +834,7 @@ Jacob Baskin Jacob H. Haven Jacob Hoffman-Andrews Jae Kwon +Jake B Jakob Borg Jakob Weisblat Jakub Čajka @@ -762,6 +844,7 @@ James Bardin James Chacon James Clarke James Cowgill +James Craig Burley James David Chalfant James Fysh James Gray @@ -804,6 +887,8 @@ Jason Buberel Jason Chu Jason Del Ponte Jason Hall +Jason Keene +Jason LeBrun Jason Smale Jason Travis Jason Wangsadinata @@ -831,6 +916,8 @@ Jeffrey H Jelte Fennema Jens Frederich Jeremiah Harmsen +Jeremy Banks <_@jeremy.ca> +Jeremy Canady Jeremy Jackins Jeremy Schlatter Jeroen Bobbeldijk @@ -854,6 +941,7 @@ Jiong Du Jirka Daněk Jiulong Wang Joakim Sernbrant +Joe Bowbeer Joe Cortopassi Joe Farrell Joe Harrison @@ -877,6 +965,7 @@ John C Barstow John DeNero John Dethridge John Gibb +John Gilik John Graham-Cumming John Howard Palevich John Jeffery @@ -910,6 +999,7 @@ Joonas Kuorilehto Joop Kiefte Jordan Krage Jordan Lewis +Jordan Rhee Jos Visser Jose Luis Vázquez González Joseph Bonneau @@ -936,6 +1026,7 @@ Julia Hansbrough Julian Kornberger Julian Pastarmov Julian Phillips +Julie Qiu Julien Salleyron Julien Schmidt Julio Montes @@ -961,10 +1052,12 @@ Karoly Negyesi Karsten Köhler Kashav Madan Kate Manson +Katie Hockman Kato Kazuyoshi Katrina Owen Kaviraj Kanagaraj Kay Zhu +Kazuhiro Sera KB Sriram Keegan Carruthers-Smith Kei Son @@ -989,6 +1082,7 @@ Kevin Klues Kevin Malachowski Kevin Ruffin Kevin Vu +Kevin Zita Kieran Colford Kim Shrier Kim Yongbin @@ -1000,6 +1094,7 @@ Klaus Post Kodie Goodwin Koichi Shiraishi Koki Ide +Komu Wairagu Konstantin Konstantin Shaposhnikov Kris Kwiatkowski @@ -1015,13 +1110,16 @@ Kyle Jones Kyle Lemons Kyle Shannon Kyle Spiers +Kyle Wood Kyohei Kadota Kyrylo Silin L Campbell Lai Jiangshan +Lajos Papp Lakshay Garg Lann Martin Lanre Adelowo +Larry Clapp Larry Hosken Lars Jeppesen Lars Lehtonen @@ -1066,9 +1164,11 @@ Luuk van Dijk Lyle Franklin Lynn Boger Ma Peiqi +Maarten Bezemer Maciej Dębski Magnus Hiie Maicon Costa +Mak Kolybabi Maksym Trykur Mal Curtis Manfred Touron @@ -1086,6 +1186,7 @@ Marcel van Lohuizen Marcelo Cantos Marcelo E. Magallon Marco Hennings +Marcus Willock Marga Manterola Marin Bašić Mario Arranz @@ -1102,12 +1203,14 @@ Mark Theunissen Mark Wolfe Mark Zavislak Marko Juhani Silokunnas +Marko Kevac Marko Mikulicic Marko Mudrinic Marko Tiikkaja Markus Duft Markus Sonderegger Markus Zimmermann +Marten Seemann Martin Bertschler Martin Garton Martin Habbecke @@ -1122,6 +1225,7 @@ Martin Olsen Martin Olsson Martin Probst Martin Sucha +Martin Tournoij Martins Sipenko Martynas Budriūnas Marvin Stenger @@ -1165,11 +1269,13 @@ Matthew Dempsky Matthew Denton Matthew Holt Matthew Horsnell +Matthew Waters Matthieu Hauglustaine Matthieu Olivier Matthijs Kooijman Max Riveiro Max Schmitt +Max Ushakov Maxim Khitrov Maxim Pimenov Maxim Ushakov @@ -1181,15 +1287,18 @@ Meir Fischer Meng Zhuo Mhd Sulhan Micah Stetson +Michael Anthony Knyszek Michael Brandenburg Michael Chaten Michael Darakananda Michael Dorner Michael Edwards Michael Elkins +Michael Ellis Michael Fraenkel Michael Fromberger Michael Gehring +Michael Henderson Michael Hendricks Michael Hoisie Michael Hudson-Doyle @@ -1214,18 +1323,21 @@ Michael Stapelberg Michael Steinert Michael T. Jones Michael Teichgräber +Michael Traver Michael Vetter Michal Bohuslávek Michal Cierniak Michał Derkacz Michal Franc Michal Pristas +Michal Rostecki Michalis Kargakis Michel Lespinasse Miek Gieben Miguel Mendez Miguel Molina Mihai Borobocea +Mihai Todor Mihail Minaev Mikael Tillenius Mike Andrews @@ -1244,6 +1356,7 @@ Mikhail Panchenko Miki Tebeka Mikio Hara Mikkel Krautz +Mikołaj Baranowski Milan Knezevic Milutin Jovanović MinJae Kwon @@ -1286,6 +1399,7 @@ Niall Sheridan Nic Day Nicholas Katsaros Nicholas Maniscalco +Nicholas Ng Nicholas Presta Nicholas Sullivan Nicholas Waples @@ -1326,12 +1440,15 @@ Oleg Vakheta Oleku Konko Oling Cat Oliver Hookins +Oliver Stenbom Oliver Tonnhofer Olivier Antoine Olivier Duperray Olivier Poitrey Olivier Saingre Omar Jarjur +Oryan Moshe +Osamu TONOMORI Özgür Kesim Pablo Lalloni Pablo Rozas Larraondo @@ -1360,6 +1477,7 @@ Paul Hammond Paul Hankin Paul Jolly Paul Lalonde +Paul M Furley Paul Marks Paul Meyer Paul Nasrat @@ -1388,6 +1506,7 @@ Peter Collingbourne Peter Conerly Peter Froehlich Peter Gonda +Peter Hoyes Peter Kleiweg Peter McKenzie Peter Moody @@ -1421,11 +1540,13 @@ Piers Pieter Droogendijk Pietro Gagliardi Piyush Mishra +Plekhanov Maxim Pontus Leitzler Prasanna Swaminathan Prashant Varanasi Pravendra Singh Preetam Jinka +Qais Patankar Qiuxuan Zhu Quan Tran Quan Yong Zhai @@ -1437,6 +1558,7 @@ Quoc-Viet Nguyen Radek Sohlich Radu Berinde Rafal Jeczalik +Raghavendra Nagaraj Rahul Chaudhry Raif S. Naffah Rajat Goel @@ -1470,6 +1592,7 @@ Richard Musiol Rick Arnold Rick Hudson Rick Sayre +Rijnard van Tonder Riku Voipio Risto Jaakko Saarelma Rob Earhart @@ -1488,14 +1611,18 @@ Robert Snedegar Robert Stepanek Robert-André Mauchin Roberto Clapis +Roberto Selbach Robin Eklind Rodolfo Carvalho +Rodolfo Rodriguez Rodrigo Moraes de Oliveira Rodrigo Rafael Monti Kochenburger Roger Pau Monné Roger Peppe +Roland Illig Roland Shoemaker Roman Budnikov +Roman Shchekin Ron Hashimoto Ron Minnich Ross Chater @@ -1504,6 +1631,7 @@ Rowan Marshall Rowan Worth Rudi Kramer Rui Ueyama +Ruslan Nigmatullin Russ Cox Russell Haering Ryan Bagwell @@ -1511,6 +1639,7 @@ Ryan Barrett Ryan Boehning Ryan Brown Ryan Canty +Ryan Dahl Ryan Hitchman Ryan Lower Ryan Roden-Corrent @@ -1534,9 +1663,11 @@ Sam Whited Sameer Ajmani Sami Commerot Sami Pönkänen +Samuel Kelemen Samuel Tan Samuele Pedroni Sanjay Menakuru +Santhosh Kumar Tekuri Sarah Adams Sascha Brawer Sasha Lionheart @@ -1568,6 +1699,7 @@ Sergey Mudrik Sergey Semin Sergio Luis O. B. Correia Sergiusz Bazanski +Serhii Aheienko Seth Hoenig Seth Vargo Shahar Kohanim @@ -1581,9 +1713,11 @@ Shawn Walker-Salas Shenghou Ma Shengyu Zhang Shi Han Ng +Shijie Hao Shinji Tanaka Shintaro Kaneko Shivakumar GN +Shivansh Rai Shun Fan Silvan Jegen Simon Jefford @@ -1603,6 +1737,7 @@ Stan Schwertly Stanislav Afanasev Steeve Morin Stefan Nilsson +Stepan Shabalin Stephan Renatus Stéphane Travostino Stephen Lewis @@ -1613,6 +1748,7 @@ Stephen Searles Stephen Weinberg Steve Francia Steve Gilbert +Steve LoFurno Steve McCoy Steve Newman Steve Phillips @@ -1621,7 +1757,10 @@ Steven Buss Steven Elliot Harris Steven Erenst Steven Hartland +Steven Littiebrant Steven Wilkin +Stuart Jansen +Sue Spence Sugu Sougoumarane Suharsh Sivakumar Sukrit Handa @@ -1636,6 +1775,8 @@ Syohei YOSHIDA Szabolcs Nagy Tad Fisher Tad Glines +Tadas Valiukas +Taesu Pyo Taj Khattra Takashi Matsuo Takayoshi Nishida @@ -1644,11 +1785,14 @@ Takuto Ikuta Takuya Ueda Tal Shprecher Tamir Duberstein +Tao Shen Tao Wang Tarmigan Casebolt Taro Aoki Taru Karttunen Tatsuhiro Tsujikawa +Tatsuya Kaneko +Taufiq Rahman Teague Cole Ted Kornish Tejasvi Nareddy @@ -1664,6 +1808,7 @@ Thomas Alan Copeland Thomas Bonfort Thomas Bouldin Thomas Bruyelle +Thomas Bushnell, BSG Thomas de Zeeuw Thomas Desrosiers Thomas Habets @@ -1682,6 +1827,7 @@ Tim Henderson Tim Hockin Tim Swast Tim Wright +Tim Xu Timo Savola Timo Truyts Timothy Studd @@ -1705,6 +1851,7 @@ Tom Wilkie Tommy Schaefer Tomoya Ishizaki Tonis Tiigi +Tony Reix Tony Walker Tor Andersson Tormod Erevik Lea @@ -1732,7 +1879,9 @@ Tzu-Jung Lee Ugorji Nwoke Ulf Holm Nielsen Ulrich Kunitz +Umang Parmar Uriel Mangado +Urvil Patel Uttam C Pawar Vadim Grek Vadim Vygonets @@ -1750,8 +1899,10 @@ Vincent Vanackere Vinu Rajashekhar Vish Subramanian Vishvananda Ishaya +Visweswara R Vitor De Mario Vlad Krasnov +Vladimir Kovpak Vladimir Kuzmin Vladimir Mihailenco Vladimir Nikishenko @@ -1763,17 +1914,22 @@ W. Trevor King Wade Simmons Walter Poupore Wander Lairson Costa +Warren Fernandes Wayne Ashley Berry Wedson Almeida Filho +Weerasak Chongnguluam Wèi Cōngruì Wei Fu Wei Guangjing Wei Xiao Weichao Tang Wembley G. Leach, Jr +Wil Selwood Wilfried Teiken +Will Beason Will Chan Will Faught +Will Morrow Will Norris Will Storey Willem van der Schyff @@ -1814,6 +1970,7 @@ Yosuke Akatsuka Yu Heng Zhang Yu Xuan Zhang Yuji Yaginuma +Yuki OKUSHI Yuki Yugui Sonoda Yukihiro Nishinaka <6elpinal@gmail.com> Yury Smolsky @@ -1824,12 +1981,14 @@ Yves Junqueira Zac Bergquist Zach Bintliff Zach Gershman +Zachary Amsden Zachary Gershman Zak Zakatell Kanda Zellyn Hunter Zev Goldstein Zheng Dayu +Zheng Xu Zhengyu He Zhongpeng Lin Zhongtao Chen From 86e31bc5fdde06d406b95cf8b5971755c78ec549 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 4 Jan 2019 13:04:31 -0500 Subject: [PATCH 479/594] doc/go1.12: remove known issue note A workaround has been submitted. Updates #27993 Change-Id: Ife6443c32673b38000b90dd2efb2985db37ab773 Reviewed-on: https://go-review.googlesource.com/c/156318 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 01bc6f50e380d..d8547e9f96875 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -31,12 +31,6 @@

    DRAFT RELEASE NOTES - Introduction to Go 1.12

    We expect almost all Go programs to continue to compile and run as before.

    -

    - There is a known issue in - the garbage collector that can cause rare crashes. It is being investigated. - Please report any issues you encounter. -

    -

    Changes to the language

    From 28fb8c69871ff3edecb0951e50f7caf38943ec5d Mon Sep 17 00:00:00 2001 From: David Chase Date: Fri, 4 Jan 2019 11:43:23 -0500 Subject: [PATCH 480/594] cmd/compile: modify swt.go to skip repeated walks of switch The compiler appears to contain several squirrelly corner cases where nodes are double walked, some where new nodes are created from walked parts. Rather than trust that we had searched hard enough for the last one, change exprSwitch.walk() to return immediately if it has already been walked. This appears to be the only case where double-walking a node is actually harmful. Fixes #29562. Change-Id: I0667e8769aba4c3236666cd836a934e256c0bfc5 Reviewed-on: https://go-review.googlesource.com/c/156317 Run-TryBot: David Chase TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/swt.go | 4 ++-- test/fixedbugs/issue29562.go | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 test/fixedbugs/issue29562.go diff --git a/src/cmd/compile/internal/gc/swt.go b/src/cmd/compile/internal/gc/swt.go index a985626a02e26..cc9a8f8b2cd73 100644 --- a/src/cmd/compile/internal/gc/swt.go +++ b/src/cmd/compile/internal/gc/swt.go @@ -243,7 +243,7 @@ func walkswitch(sw *Node) { func (s *exprSwitch) walk(sw *Node) { // Guard against double walk, see #25776. if sw.List.Len() == 0 && sw.Nbody.Len() > 0 { - Fatalf("second walk of switch") + return // Was fatal, but eliminating every possible source of double-walking is hard } casebody(sw, nil) @@ -302,7 +302,7 @@ func (s *exprSwitch) walk(sw *Node) { s.exprname = cond } else { s.exprname = temp(cond.Type) - cas = []*Node{nod(OAS, s.exprname, cond)} + cas = []*Node{nod(OAS, s.exprname, cond)} // This gets walk()ed again in walkstmtlist just before end of this function. See #29562. typecheckslice(cas, ctxStmt) } diff --git a/test/fixedbugs/issue29562.go b/test/fixedbugs/issue29562.go new file mode 100644 index 0000000000000..cbcd77d5df76b --- /dev/null +++ b/test/fixedbugs/issue29562.go @@ -0,0 +1,26 @@ +// compile + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Triggers a double walk of the (inlined) switch in il + +package p + +func il(s string) string { + switch len(s) { + case 0: + return "zero" + case 1: + return "one" + } + return s +} + +func f() { + var s string + var as []string + switch false && (s+"a"+as[0]+il(s)+as[0]+s == "") { + } +} From 303a596d8cf2e96d27d60288fca690e1703c0dd9 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 4 Jan 2019 19:09:01 -0500 Subject: [PATCH 481/594] crypto/x509: ignore 5 phantom 1024-bit roots in TestSystemRoots On macOS 10.11, but not 10.10 and 10.12, the C API returns 5 old root CAs which are not in SystemRootCertificates.keychain (but seem to be in X509Anchors and maybe SystemCACertificates.keychain, along with many others that the C API does not return). They all are moribund 1024-bit roots which are now gone from the Apple store. Since we can't seem to find a way to make the no-cgo code see them, ignore them rather than skipping the test. Fixes #21416 Change-Id: I24ff0461f71cec953b888a60b05b99bc37dad2ed Reviewed-on: https://go-review.googlesource.com/c/156329 Reviewed-by: Brad Fitzpatrick --- src/crypto/x509/root_darwin_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/crypto/x509/root_darwin_test.go b/src/crypto/x509/root_darwin_test.go index 27806538121f6..5ad19d72cd12a 100644 --- a/src/crypto/x509/root_darwin_test.go +++ b/src/crypto/x509/root_darwin_test.go @@ -5,6 +5,7 @@ package x509 import ( + "crypto/rsa" "os" "os/exec" "path/filepath" @@ -104,6 +105,14 @@ func TestSystemRoots(t *testing.T) { continue } + // On 10.11 there are five unexplained roots that only show up from the + // C API. They have in common the fact that they are old, 1024-bit + // certificates. It's arguably better to ignore them anyway. + if key, ok := c.PublicKey.(*rsa.PublicKey); ok && key.N.BitLen() == 1024 { + t.Logf("1024-bit certificate only present in cgo pool (acceptable): %v", c.Subject) + continue + } + t.Errorf("certificate only present in cgo pool: %v", c.Subject) } From 35f4ec152b44ae5fc83aaf68e2eb3aa1a778e5cd Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 4 Jan 2019 19:27:08 -0500 Subject: [PATCH 482/594] crypto/x509: ignore harmless edge case in TestSystemRoots The no-cgo validation hack lets in certificates from the root store that are not marked as roots themselves, but are signed by a root; the cgo path correctly excludes them. When TestSystemRoots compares cgo and no-cgo results it tries to ignore them by ignoring certificates which pass validation, but expired certificates were failing validation. Letting through expired certs is harmless anyway because we will refuse to build chains to them. Fixes #29497 Change-Id: I341e50c0f3426de2763468672f9ba1d13ad6cfba Reviewed-on: https://go-review.googlesource.com/c/156330 Reviewed-by: Brad Fitzpatrick --- src/crypto/x509/root_darwin_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/crypto/x509/root_darwin_test.go b/src/crypto/x509/root_darwin_test.go index 5ad19d72cd12a..1165a97e205b9 100644 --- a/src/crypto/x509/root_darwin_test.go +++ b/src/crypto/x509/root_darwin_test.go @@ -64,13 +64,15 @@ func TestSystemRoots(t *testing.T) { if _, ok := sysPool[string(c.Raw)]; ok { delete(sysPool, string(c.Raw)) } else { - // verify-cert lets in certificates that are not trusted roots, but are - // signed by trusted roots. This should not be a problem, so confirm that's - // the case and skip them. + // verify-cert lets in certificates that are not trusted roots, but + // are signed by trusted roots. This is not great, but unavoidable + // until we parse real policies without cgo, so confirm that's the + // case and skip them. if _, err := c.Verify(VerifyOptions{ Roots: sysRoots, Intermediates: allCerts, KeyUsages: []ExtKeyUsage{ExtKeyUsageAny}, + CurrentTime: c.NotBefore, // verify-cert does not check expiration }); err != nil { t.Errorf("certificate only present in non-cgo pool: %v (verify error: %v)", c.Subject, err) } else { From fd752d5ede482cdf52a920c75486677cbcb441b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 6 Jan 2019 18:19:35 +0100 Subject: [PATCH 483/594] cmd/vendor: update to golang.org/x/tools@3ef68632 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mainly to pull in the bug fix in the structtag pass, where filenames could sometimes be wrong. The bug wasn't present in 1.11, so it was a regression and needs fixing before 1.12 is out. Fixes #29130. Change-Id: Ie9d9bff84873f34d748ebd8f056b6bc2ac822a55 Reviewed-on: https://go-review.googlesource.com/c/156378 Run-TryBot: Daniel Martí TryBot-Result: Gobot Gobot Reviewed-by: Alan Donovan --- .../golang.org/x/tools/go/analysis/doc.go | 4 ---- .../go/analysis/passes/asmdecl/asmdecl.go | 4 ++-- .../x/tools/go/analysis/passes/bools/bools.go | 2 +- .../go/analysis/passes/structtag/structtag.go | 21 +++++++++++++++---- .../go/analysis/unitchecker/unitchecker.go | 2 +- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go index 5dee615181b89..f925849ab5089 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go @@ -3,10 +3,6 @@ The analysis package defines the interface between a modular static analysis and an analysis driver program. - -THIS INTERFACE IS EXPERIMENTAL AND SUBJECT TO CHANGE. -We aim to finalize it by November 2018. - Background A static analysis is a function that inspects a package of Go code and diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go index 0f8abb5748127..dce1ef7bd5e6d 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go @@ -490,7 +490,7 @@ func appendComponentsRecursive(arch *asmArch, t types.Type, cc []component, suff offsets := arch.sizes.Offsetsof(fields) elemoff := int(offsets[1]) for i := 0; i < int(tu.Len()); i++ { - cc = appendComponentsRecursive(arch, elem, cc, suffix+"_"+strconv.Itoa(i), i*elemoff) + cc = appendComponentsRecursive(arch, elem, cc, suffix+"_"+strconv.Itoa(i), off+i*elemoff) } } @@ -514,7 +514,7 @@ func asmParseDecl(pass *analysis.Pass, decl *ast.FuncDecl) map[string]*asmFunc { for _, fld := range list { t := pass.TypesInfo.Types[fld.Type].Type - // Work around github.com/golang/go/issues/28277. + // Work around https://golang.org/issue/28277. if t == nil { if ell, ok := fld.Type.(*ast.Ellipsis); ok { t = types.NewSlice(pass.TypesInfo.Types[ell.Elt].Type) diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/bools/bools.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/bools/bools.go index 0e6f2695f3dc7..833c9d7aae1c4 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/bools/bools.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/bools/bools.go @@ -45,7 +45,7 @@ func run(pass *analysis.Pass) (interface{}, error) { // TODO(adonovan): this reports n(n-1)/2 errors for an // expression e||...||e of depth n. Fix. - // See https://github.com/golang/go/issues/28086. + // See https://golang.org/issue/28086. comm := op.commutativeSets(pass.TypesInfo, e) for _, exprs := range comm { op.checkRedundant(pass, exprs) diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go index 78133fe6f30a9..2b67c376bab8b 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go @@ -136,10 +136,23 @@ func checkTagDuplicates(pass *analysis.Pass, tag, key string, nearest, field *ty *seen = map[[2]string]token.Pos{} } if pos, ok := (*seen)[[2]string{key, val}]; ok { - posn := pass.Fset.Position(pos) - posn.Filename = filepath.Base(posn.Filename) - posn.Column = 0 - pass.Reportf(nearest.Pos(), "struct field %s repeats %s tag %q also at %s", field.Name(), key, val, posn) + alsoPos := pass.Fset.Position(pos) + alsoPos.Column = 0 + + // Make the "also at" position relative to the current position, + // to ensure that all warnings are unambiguous and correct. For + // example, via anonymous struct fields, it's possible for the + // two fields to be in different packages and directories. + thisPos := pass.Fset.Position(field.Pos()) + rel, err := filepath.Rel(filepath.Dir(thisPos.Filename), alsoPos.Filename) + if err != nil { + // Possibly because the paths are relative; leave the + // filename alone. + } else { + alsoPos.Filename = rel + } + + pass.Reportf(nearest.Pos(), "struct field %s repeats %s tag %q also at %s", field.Name(), key, val, alsoPos) } else { (*seen)[[2]string{key, val}] = field.Pos() } diff --git a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index 018191a5e7a25..76dabc28b9043 100644 --- a/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -182,7 +182,7 @@ func readConfig(filename string) (*Config, error) { } var importerForCompiler = func(_ *token.FileSet, compiler string, lookup importer.Lookup) types.Importer { - // broken legacy implementation (github.com/golang/go/issues/28995) + // broken legacy implementation (https://golang.org/issue/28995) return importer.For(compiler, lookup) } From 11847cb8e0dce51c29971b4d76482400633ecf70 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sun, 6 Jan 2019 11:33:23 -0800 Subject: [PATCH 484/594] cmd: vendor x/sys/unix into the stdlib upstream git hash: 1775db3f06b568179d273425900dd09125831dd5 Update #17490 Change-Id: I95e3c57137756c5c7a9b7334075caef66f205231 Reviewed-on: https://go-review.googlesource.com/c/156365 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- .../golang.org/x/sys/unix/asm_freebsd_arm64.s | 29 + src/cmd/vendor/golang.org/x/sys/unix/fcntl.go | 2 +- .../golang.org/x/sys/unix/fcntl_darwin.go | 18 + src/cmd/vendor/golang.org/x/sys/unix/mkall.sh | 33 +- .../golang.org/x/sys/unix/mksysnum_darwin.pl | 39 - .../x/sys/unix/mksysnum_dragonfly.pl | 50 - .../golang.org/x/sys/unix/mksysnum_freebsd.pl | 50 - .../golang.org/x/sys/unix/mksysnum_netbsd.pl | 58 - .../golang.org/x/sys/unix/mksysnum_openbsd.pl | 50 - .../x/sys/unix/syscall_freebsd_arm64.go | 52 + .../x/sys/unix/syscall_linux_mips64x.go | 9 +- .../x/sys/unix/zerrors_freebsd_arm64.go | 1794 +++++++++++++++ .../x/sys/unix/zerrors_linux_386.go | 19 +- .../x/sys/unix/zerrors_linux_amd64.go | 19 +- .../x/sys/unix/zerrors_linux_arm.go | 19 +- .../x/sys/unix/zerrors_linux_arm64.go | 19 +- .../x/sys/unix/zerrors_linux_mips.go | 19 +- .../x/sys/unix/zerrors_linux_mips64.go | 19 +- .../x/sys/unix/zerrors_linux_mips64le.go | 19 +- .../x/sys/unix/zerrors_linux_mipsle.go | 19 +- .../x/sys/unix/zerrors_linux_ppc64.go | 21 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 21 +- .../x/sys/unix/zerrors_linux_riscv64.go | 19 +- .../x/sys/unix/zerrors_linux_s390x.go | 19 +- .../x/sys/unix/zerrors_linux_sparc64.go | 19 +- .../x/sys/unix/zsyscall_freebsd_arm64.go | 2015 +++++++++++++++++ .../x/sys/unix/zsyscall_linux_mips64.go | 30 +- .../x/sys/unix/zsyscall_linux_mips64le.go | 30 +- .../x/sys/unix/zsysnum_darwin_386.go | 2 +- .../x/sys/unix/zsysnum_darwin_amd64.go | 2 +- .../x/sys/unix/zsysnum_darwin_arm.go | 2 +- .../x/sys/unix/zsysnum_darwin_arm64.go | 2 +- .../x/sys/unix/zsysnum_dragonfly_amd64.go | 176 +- .../x/sys/unix/zsysnum_freebsd_386.go | 452 ++-- .../x/sys/unix/zsysnum_freebsd_amd64.go | 452 ++-- .../x/sys/unix/zsysnum_freebsd_arm.go | 452 ++-- .../x/sys/unix/zsysnum_freebsd_arm64.go | 395 ++++ .../x/sys/unix/zsysnum_netbsd_386.go | 4 +- .../x/sys/unix/zsysnum_netbsd_amd64.go | 4 +- .../x/sys/unix/zsysnum_netbsd_arm.go | 4 +- .../x/sys/unix/zsysnum_openbsd_386.go | 216 +- .../x/sys/unix/zsysnum_openbsd_amd64.go | 216 +- .../x/sys/unix/zsysnum_openbsd_arm.go | 216 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 602 +++++ .../golang.org/x/sys/unix/ztypes_linux_386.go | 2 + .../x/sys/unix/ztypes_linux_amd64.go | 2 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 2 + .../x/sys/unix/ztypes_linux_arm64.go | 2 + .../x/sys/unix/ztypes_linux_mips.go | 2 + .../x/sys/unix/ztypes_linux_mips64.go | 2 + .../x/sys/unix/ztypes_linux_mips64le.go | 2 + .../x/sys/unix/ztypes_linux_mipsle.go | 2 + .../x/sys/unix/ztypes_linux_ppc64.go | 2 + .../x/sys/unix/ztypes_linux_ppc64le.go | 2 + .../x/sys/unix/ztypes_linux_riscv64.go | 2 + .../x/sys/unix/ztypes_linux_s390x.go | 2 + .../x/sys/unix/ztypes_linux_sparc64.go | 2 + src/cmd/vendor/vendor.json | 10 +- 58 files changed, 6321 insertions(+), 1422 deletions(-) create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/fcntl_darwin.go delete mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl delete mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl delete mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl delete mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl delete mode 100755 src/cmd/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go create mode 100644 src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go diff --git a/src/cmd/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s b/src/cmd/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s new file mode 100644 index 0000000000000..d9318cbf034d8 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s @@ -0,0 +1,29 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !gccgo + +#include "textflag.h" + +// +// System call support for ARM64, FreeBSD +// + +// Just jump to package syscall's implementation for all these functions. +// The runtime may know about them. + +TEXT ·Syscall(SB),NOSPLIT,$0-56 + JMP syscall·Syscall(SB) + +TEXT ·Syscall6(SB),NOSPLIT,$0-80 + JMP syscall·Syscall6(SB) + +TEXT ·Syscall9(SB),NOSPLIT,$0-104 + JMP syscall·Syscall9(SB) + +TEXT ·RawSyscall(SB),NOSPLIT,$0-56 + JMP syscall·RawSyscall(SB) + +TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 + JMP syscall·RawSyscall6(SB) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/fcntl.go b/src/cmd/vendor/golang.org/x/sys/unix/fcntl.go index 9379ba9cef77c..39c03f1ef135b 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/fcntl.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/fcntl.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin dragonfly freebsd linux netbsd openbsd +// +build dragonfly freebsd linux netbsd openbsd package unix diff --git a/src/cmd/vendor/golang.org/x/sys/unix/fcntl_darwin.go b/src/cmd/vendor/golang.org/x/sys/unix/fcntl_darwin.go new file mode 100644 index 0000000000000..5868a4a47b456 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/fcntl_darwin.go @@ -0,0 +1,18 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package unix + +import "unsafe" + +// FcntlInt performs a fcntl syscall on fd with the provided command and argument. +func FcntlInt(fd uintptr, cmd, arg int) (int, error) { + return fcntl(int(fd), cmd, arg) +} + +// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. +func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { + _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) + return err +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh b/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh index b21f0118e1dea..b9804c0ca6b42 100755 --- a/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh +++ b/src/cmd/vendor/golang.org/x/sys/unix/mkall.sh @@ -73,70 +73,75 @@ aix_ppc64) darwin_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32" - mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" + mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" mkasm="go run mkasm_darwin.go" ;; darwin_amd64) mkerrors="$mkerrors -m64" - mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" + mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" mkasm="go run mkasm_darwin.go" ;; darwin_arm) mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32" - mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" + mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" mkasm="go run mkasm_darwin.go" ;; darwin_arm64) mkerrors="$mkerrors -m64" - mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" + mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" mkasm="go run mkasm_darwin.go" ;; dragonfly_amd64) mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -dragonfly" - mksysnum="curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl" + mksysnum="go run mksysnum.go 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32" - mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" + mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_amd64) mkerrors="$mkerrors -m64" - mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" + mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_arm) mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32 -arm" - mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" + mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; +freebsd_arm64) + mkerrors="$mkerrors -m64" + mksysnum="go run mksysnum.go 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master'" + mktypes="GOARCH=$GOARCH go tool cgo -godefs" + ;; netbsd_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32 -netbsd" - mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" + mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_amd64) mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -netbsd" - mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" + mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_arm) mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32 -netbsd -arm" - mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" + mksysnum="go run mksysnum.go 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master'" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" @@ -145,21 +150,21 @@ openbsd_386) mkerrors="$mkerrors -m32" mksyscall="go run mksyscall.go -l32 -openbsd" mksysctl="./mksysctl_openbsd.pl" - mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" + mksysnum="go run mksysnum.go 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_amd64) mkerrors="$mkerrors -m64" mksyscall="go run mksyscall.go -openbsd" mksysctl="./mksysctl_openbsd.pl" - mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" + mksysnum="go run mksysnum.go 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_arm) mkerrors="$mkerrors" mksyscall="go run mksyscall.go -l32 -openbsd -arm" mksysctl="./mksysctl_openbsd.pl" - mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" + mksysnum="go run mksysnum.go 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'" # Let the type of C char be signed for making the bare syscall # API consistent across platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl deleted file mode 100755 index 5453c53b19231..0000000000000 --- a/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env perl -# Copyright 2009 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. -# -# Generate system call table for Darwin from sys/syscall.h - -use strict; - -if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { - print STDERR "GOARCH or GOOS not defined in environment\n"; - exit 1; -} - -my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); - -print <){ - if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ - my $name = $1; - my $num = $2; - $name =~ y/a-z/A-Z/; - print " SYS_$name = $num;" - } -} - -print <){ - if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ - my $num = $1; - my $proto = $2; - my $name = "SYS_$3"; - $name =~ y/a-z/A-Z/; - - # There are multiple entries for enosys and nosys, so comment them out. - if($name =~ /^SYS_E?NOSYS$/){ - $name = "// $name"; - } - if($name eq 'SYS_SYS_EXIT'){ - $name = 'SYS_EXIT'; - } - - print " $name = $num; // $proto\n"; - } -} - -print <){ - if(/^([0-9]+)\s+\S+\s+(?:NO)?STD\s+({ \S+\s+(\w+).*)$/){ - my $num = $1; - my $proto = $2; - my $name = "SYS_$3"; - $name =~ y/a-z/A-Z/; - - # There are multiple entries for enosys and nosys, so comment them out. - if($name =~ /^SYS_E?NOSYS$/){ - $name = "// $name"; - } - if($name eq 'SYS_SYS_EXIT'){ - $name = 'SYS_EXIT'; - } - - print " $name = $num; // $proto\n"; - } -} - -print <){ - if($line =~ /^(.*)\\$/) { - # Handle continuation - $line = $1; - $_ =~ s/^\s+//; - $line .= $_; - } else { - # New line - $line = $_; - } - next if $line =~ /\\$/; - if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { - my $num = $1; - my $proto = $6; - my $compat = $8; - my $name = "$7_$9"; - - $name = "$7_$11" if $11 ne ''; - $name =~ y/a-z/A-Z/; - - if($compat eq '' || $compat eq '13' || $compat eq '30' || $compat eq '50') { - print " $name = $num; // $proto\n"; - } - } -} - -print <){ - if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ - my $num = $1; - my $proto = $3; - my $name = $4; - $name =~ y/a-z/A-Z/; - - # There are multiple entries for enosys and nosys, so comment them out. - if($name =~ /^SYS_E?NOSYS$/){ - $name = "// $name"; - } - if($name eq 'SYS_SYS_EXIT'){ - $name = 'SYS_EXIT'; - } - - print " $name = $num; // $proto\n"; - } -} - -print < 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { + r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { + r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimes(path string, timeval *[2]Timeval) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func futimes(fd int, timeval *[2]Timeval) (err error) { + _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { + r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Madvise(b []byte, behav int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mlockall(flags int) (err error) { + _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mprotect(b []byte, prot int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Msync(b []byte, flags int) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlock(b []byte) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Munlockall() (err error) { + _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe2(p *[2]_C_int, flags int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getcwd(buf []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 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 ioctl(fd int, req uint, arg uintptr) (err error) { + _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Access(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { + _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func CapEnter() (err error) { + _, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func capRightsGet(version int, fd int, rightsp *CapRights) (err error) { + _, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func capRightsLimit(fd int, rightsp *CapRights) (err error) { + _, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chflags(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chmod(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Chroot(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Close(fd int) (err error) { + _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup(fd int) (nfd int, err error) { + r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) + nfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Dup2(from int, to int) (err error) { + _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Exit(code int) { + Syscall(SYS_EXIT, uintptr(code), 0, 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(file) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) + ret = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(attrname) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(link) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) + ret = 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_POSIX_FADVISE, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchdir(fd int) (err error) { + _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchflags(fd int, flags int) (err error) { + _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmod(fd int, mode uint32) (err error) { + _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + 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 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Flock(fd int, how int) (err error) { + _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fpathconf(fd int, name int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstat(fd int, stat *stat_freebsd11_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstat_freebsd12(fd int, stat *Stat_t) (err error) { + _, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) { + _, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Fsync(fd int) (err error) { + _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Ftruncate(fd int, length int64) (err error) { + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 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 getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) { + var _p0 unsafe.Pointer + if len(buf) > 0 { + _p0 = unsafe.Pointer(&buf[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 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 Getdtablesize() (size int) { + r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) + size = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getegid() (egid int) { + r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) + egid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Geteuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getgid() (gid int) { + r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) + gid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgid(pid int) (pgid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) + pgid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpgrp() (pgrp int) { + r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) + pgrp = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpid() (pid int) { + r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) + pid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getppid() (ppid int) { + r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) + ppid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getpriority(which int, who int) (prio int, err error) { + r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) + prio = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getrusage(who int, rusage *Rusage) (err error) { + _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getsid(pid int) (sid int, err error) { + r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) + sid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Gettimeofday(tv *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Getuid() (uid int) { + r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) + uid = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Issetugid() (tainted bool) { + r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) + tainted = bool(r0 != 0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kill(pid int, signum syscall.Signal) (err error) { + _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Kqueue() (fd int, err error) { + r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Lchown(path string, uid int, gid int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Link(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Listen(s int, backlog int) (err error) { + _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func lstat(path string, stat *stat_freebsd11_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdir(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkdirat(dirfd int, path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mkfifo(path string, mode uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mknod(path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mknodat(fd int, path string, mode uint32, dev int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Nanosleep(time *Timespec, leftover *Timespec) (err error) { + _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Open(path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0) + fd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pathconf(path string, name int) (val int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Pread(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 Pwrite(fd int, p []byte, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 read(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlink(path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 unsafe.Pointer + if len(buf) > 0 { + _p1 = unsafe.Pointer(&buf[0]) + } else { + _p1 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 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 Rename(from string, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Renameat(fromfd int, from string, tofd int, to string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Revoke(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Rmdir(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { + r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) + newoffset = int64(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { + _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setegid(egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Seteuid(euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setgid(gid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setlogin(name string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(name) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpgid(pid int, pgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setpriority(which int, who int, prio int) (err error) { + _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setregid(rgid int, egid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setreuid(ruid int, euid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresgid(rgid int, egid int, sgid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setresuid(ruid int, euid int, suid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setrlimit(which int, lim *Rlimit) (err error) { + _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setsid() (pid int, err error) { + r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) + pid = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Settimeofday(tp *Timeval) (err error) { + _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Setuid(uid int) (err error) { + _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func stat(path string, stat *stat_freebsd11_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func statfs(path string, stat *statfs_freebsd11_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func statfs_freebsd12(path string, stat *Statfs_t) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlink(path string, link string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(link) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(oldpath) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(newpath) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Sync() (err error) { + _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Truncate(path string, length int64) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Umask(newmask int) (oldmask int) { + r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) + oldmask = int(r0) + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Undelete(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlink(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unlinkat(dirfd int, path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Unmount(path string, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func write(fd int, p []byte) (n int, err error) { + var _p0 unsafe.Pointer + if len(p) > 0 { + _p0 = unsafe.Pointer(&p[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { + r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + ret = uintptr(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func munmap(addr uintptr, length uintptr) (err error) { + _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func readlen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writelen(fd int, buf *byte, nbuf int) (n int, err error) { + r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { + r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) + nfd = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index caf1408ec4e53..25026415ddc11 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -1719,21 +1719,6 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { @@ -2293,6 +2278,21 @@ func fstat(fd int, st *stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fstatat(dirfd int, path string, st *stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func lstat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index 266be8b4abbf9..83d8bb8af8c1f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -1719,21 +1719,6 @@ func Fchown(fd int, uid int, gid int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { - var _p0 *byte - _p0, err = BytePtrFromString(path) - if err != nil { - return - } - _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { @@ -2293,6 +2278,21 @@ func fstat(fd int, st *stat_t) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fstatat(dirfd int, path string, st *stat_t, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func lstat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go index d1d36da3f5127..f33614532f999 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go @@ -1,4 +1,4 @@ -// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/syscall.h +// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,darwin diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go index e35de4145ed90..9e2837e0e326f 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go @@ -1,4 +1,4 @@ -// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/syscall.h +// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,darwin diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go index f2df27db2c237..103a72ed1c0eb 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go @@ -1,4 +1,4 @@ -// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h +// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,darwin diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go index 9694630232f5a..7ab2130b967b1 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go @@ -1,4 +1,4 @@ -// mksysnum_darwin.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h +// go run mksysnum.go /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.1.sdk/usr/include/sys/syscall.h // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm64,darwin diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go index b2c9ef81b8196..ff3976edbbb14 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go @@ -1,4 +1,4 @@ -// mksysnum_dragonfly.pl +// go run mksysnum.go http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,dragonfly @@ -13,7 +13,7 @@ const ( SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, \ + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } wait4 wait_args int SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } @@ -22,17 +22,17 @@ const ( SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int - SYS_GETFSSTAT = 18 // { int getfsstat(struct statfs *buf, long bufsize, \ + SYS_GETFSSTAT = 18 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, \ + SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, \ + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } SYS_SENDMSG = 28 // { int sendmsg(int s, caddr_t msg, int flags); } - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, \ + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, caddr_t from, int *fromlenaddr); } SYS_ACCEPT = 30 // { int accept(int s, caddr_t name, int *anamelen); } SYS_GETPEERNAME = 31 // { int getpeername(int fdes, caddr_t asa, int *alen); } SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, caddr_t asa, int *alen); } @@ -45,8 +45,8 @@ const ( SYS_DUP = 41 // { int dup(int fd); } SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, \ + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } @@ -67,32 +67,32 @@ const ( SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } SYS_MPROTECT = 74 // { int mprotect(void *addr, size_t len, int prot); } SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, \ + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(int from, int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } @@ -100,15 +100,15 @@ const ( SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, \ + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_STATFS = 157 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 158 // { int fstatfs(int fd, struct statfs *buf); } SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } @@ -116,53 +116,53 @@ const ( SYS_SETDOMAINNAME = 163 // { int setdomainname(char *domainname, int len); } SYS_UNAME = 164 // { int uname(struct utsname *name); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_EXTPREAD = 173 // { ssize_t extpread(int fd, void *buf, \ - SYS_EXTPWRITE = 174 // { ssize_t extpwrite(int fd, const void *buf, \ + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } + SYS_EXTPREAD = 173 // { ssize_t extpread(int fd, void *buf, size_t nbyte, int flags, off_t offset); } + SYS_EXTPWRITE = 174 // { ssize_t extpwrite(int fd, const void *buf, size_t nbyte, int flags, off_t offset); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } SYS_SETEGID = 182 // { int setegid(gid_t egid); } SYS_SETEUID = 183 // { int seteuid(uid_t euid); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_MMAP = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, \ + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int + SYS_MMAP = 197 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } // SYS_NOSYS = 198; // { int nosys(void); } __syscall __syscall_args int - SYS_LSEEK = 199 // { off_t lseek(int fd, int pad, off_t offset, \ + SYS_LSEEK = 199 // { off_t lseek(int fd, int pad, off_t offset, int whence); } SYS_TRUNCATE = 200 // { int truncate(char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int ftruncate(int fd, int pad, off_t length); } - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, \ + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS___SEMCTL = 220 // { int __semctl(int semid, int semnum, int cmd, \ + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } + SYS___SEMCTL = 220 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } - SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ - SYS_MSGCTL = 224 // { int msgctl(int msqid, int cmd, \ + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, u_int nsops); } + SYS_MSGCTL = 224 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, \ - SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, \ - SYS_SHMAT = 228 // { caddr_t shmat(int shmid, const void *shmaddr, \ - SYS_SHMCTL = 229 // { int shmctl(int shmid, int cmd, \ + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { caddr_t shmat(int shmid, const void *shmaddr, int shmflg); } + SYS_SHMCTL = 229 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 233 // { int clock_settime(clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, \ + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } - SYS_EXTPREADV = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, \ - SYS_EXTPWRITEV = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,\ + SYS_EXTPREADV = 289 // { ssize_t extpreadv(int fd, struct iovec *iovp, u_int iovcnt, int flags, off_t offset); } + SYS_EXTPWRITEV = 290 // { ssize_t extpwritev(int fd, struct iovec *iovp,u_int iovcnt, int flags, off_t offset); } SYS_FHSTATFS = 297 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } SYS_MODNEXT = 300 // { int modnext(int modid); } @@ -200,34 +200,34 @@ const ( SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, \ + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } - SYS_SIGACTION = 342 // { int sigaction(int sig, const struct sigaction *act, \ + SYS_SIGACTION = 342 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } SYS_SIGRETURN = 344 // { int sigreturn(ucontext_t *sigcntxp); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set,\ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set,\ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set,siginfo_t *info, const struct timespec *timeout); } + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set,siginfo_t *info); } + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { int extattr_set_file(const char *path, \ - SYS_EXTATTR_GET_FILE = 357 // { int extattr_get_file(const char *path, \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } + SYS_EXTATTR_SET_FILE = 356 // { int extattr_set_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FILE = 357 // { int extattr_get_file(const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete(struct aiocb **aiocbp, struct timespec *timeout); } SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ + SYS_KEVENT = 363 // { int kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } SYS_LCHFLAGS = 391 // { int lchflags(char *path, int flags); } SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, \ + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } SYS_VARSYM_SET = 450 // { int varsym_set(int level, const char *name, const char *data); } SYS_VARSYM_GET = 451 // { int varsym_get(int mask, const char *wild, char *buf, int bufsize); } SYS_VARSYM_LIST = 452 // { int varsym_list(int level, char *buf, int maxsize, int *marker); } @@ -245,58 +245,58 @@ const ( SYS_FSTAT = 476 // { int fstat(int fd, struct stat *sb); } SYS_LSTAT = 477 // { int lstat(const char *path, struct stat *ub); } SYS_FHSTAT = 478 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } - SYS_GETDIRENTRIES = 479 // { int getdirentries(int fd, char *buf, u_int count, \ + SYS_GETDIRENTRIES = 479 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } SYS_GETDENTS = 480 // { int getdents(int fd, char *buf, size_t count); } - SYS_USCHED_SET = 481 // { int usched_set(pid_t pid, int cmd, void *data, \ + SYS_USCHED_SET = 481 // { int usched_set(pid_t pid, int cmd, void *data, int bytes); } SYS_EXTACCEPT = 482 // { int extaccept(int s, int flags, caddr_t name, int *anamelen); } SYS_EXTCONNECT = 483 // { int extconnect(int s, int flags, caddr_t name, int namelen); } SYS_MCONTROL = 485 // { int mcontrol(void *addr, size_t len, int behav, off_t value); } SYS_VMSPACE_CREATE = 486 // { int vmspace_create(void *id, int type, void *data); } SYS_VMSPACE_DESTROY = 487 // { int vmspace_destroy(void *id); } - SYS_VMSPACE_CTL = 488 // { int vmspace_ctl(void *id, int cmd, \ - SYS_VMSPACE_MMAP = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, \ - SYS_VMSPACE_MUNMAP = 490 // { int vmspace_munmap(void *id, void *addr, \ - SYS_VMSPACE_MCONTROL = 491 // { int vmspace_mcontrol(void *id, void *addr, \ - SYS_VMSPACE_PREAD = 492 // { ssize_t vmspace_pread(void *id, void *buf, \ - SYS_VMSPACE_PWRITE = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, \ + SYS_VMSPACE_CTL = 488 // { int vmspace_ctl(void *id, int cmd, struct trapframe *tframe, struct vextframe *vframe); } + SYS_VMSPACE_MMAP = 489 // { int vmspace_mmap(void *id, void *addr, size_t len, int prot, int flags, int fd, off_t offset); } + SYS_VMSPACE_MUNMAP = 490 // { int vmspace_munmap(void *id, void *addr, size_t len); } + SYS_VMSPACE_MCONTROL = 491 // { int vmspace_mcontrol(void *id, void *addr, size_t len, int behav, off_t value); } + SYS_VMSPACE_PREAD = 492 // { ssize_t vmspace_pread(void *id, void *buf, size_t nbyte, int flags, off_t offset); } + SYS_VMSPACE_PWRITE = 493 // { ssize_t vmspace_pwrite(void *id, const void *buf, size_t nbyte, int flags, off_t offset); } SYS_EXTEXIT = 494 // { void extexit(int how, int status, void *addr); } SYS_LWP_CREATE = 495 // { int lwp_create(struct lwp_params *params); } SYS_LWP_GETTID = 496 // { lwpid_t lwp_gettid(void); } SYS_LWP_KILL = 497 // { int lwp_kill(pid_t pid, lwpid_t tid, int signum); } SYS_LWP_RTPRIO = 498 // { int lwp_rtprio(int function, pid_t pid, lwpid_t tid, struct rtprio *rtp); } - SYS_PSELECT = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, \ + SYS_PSELECT = 499 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sigmask); } SYS_STATVFS = 500 // { int statvfs(const char *path, struct statvfs *buf); } SYS_FSTATVFS = 501 // { int fstatvfs(int fd, struct statvfs *buf); } SYS_FHSTATVFS = 502 // { int fhstatvfs(const struct fhandle *u_fhp, struct statvfs *buf); } - SYS_GETVFSSTAT = 503 // { int getvfsstat(struct statfs *buf, \ + SYS_GETVFSSTAT = 503 // { int getvfsstat(struct statfs *buf, struct statvfs *vbuf, long vbufsize, int flags); } SYS_OPENAT = 504 // { int openat(int fd, char *path, int flags, int mode); } - SYS_FSTATAT = 505 // { int fstatat(int fd, char *path, \ - SYS_FCHMODAT = 506 // { int fchmodat(int fd, char *path, int mode, \ - SYS_FCHOWNAT = 507 // { int fchownat(int fd, char *path, int uid, int gid, \ + SYS_FSTATAT = 505 // { int fstatat(int fd, char *path, struct stat *sb, int flags); } + SYS_FCHMODAT = 506 // { int fchmodat(int fd, char *path, int mode, int flags); } + SYS_FCHOWNAT = 507 // { int fchownat(int fd, char *path, int uid, int gid, int flags); } SYS_UNLINKAT = 508 // { int unlinkat(int fd, char *path, int flags); } - SYS_FACCESSAT = 509 // { int faccessat(int fd, char *path, int amode, \ - SYS_MQ_OPEN = 510 // { mqd_t mq_open(const char * name, int oflag, \ + SYS_FACCESSAT = 509 // { int faccessat(int fd, char *path, int amode, int flags); } + SYS_MQ_OPEN = 510 // { mqd_t mq_open(const char * name, int oflag, mode_t mode, struct mq_attr *attr); } SYS_MQ_CLOSE = 511 // { int mq_close(mqd_t mqdes); } SYS_MQ_UNLINK = 512 // { int mq_unlink(const char *name); } - SYS_MQ_GETATTR = 513 // { int mq_getattr(mqd_t mqdes, \ - SYS_MQ_SETATTR = 514 // { int mq_setattr(mqd_t mqdes, \ - SYS_MQ_NOTIFY = 515 // { int mq_notify(mqd_t mqdes, \ - SYS_MQ_SEND = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, \ - SYS_MQ_RECEIVE = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, \ - SYS_MQ_TIMEDSEND = 518 // { int mq_timedsend(mqd_t mqdes, \ - SYS_MQ_TIMEDRECEIVE = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, \ + SYS_MQ_GETATTR = 513 // { int mq_getattr(mqd_t mqdes, struct mq_attr *mqstat); } + SYS_MQ_SETATTR = 514 // { int mq_setattr(mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat); } + SYS_MQ_NOTIFY = 515 // { int mq_notify(mqd_t mqdes, const struct sigevent *notification); } + SYS_MQ_SEND = 516 // { int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio); } + SYS_MQ_RECEIVE = 517 // { ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio); } + SYS_MQ_TIMEDSEND = 518 // { int mq_timedsend(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio, const struct timespec *abs_timeout); } + SYS_MQ_TIMEDRECEIVE = 519 // { ssize_t mq_timedreceive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } SYS_IOPRIO_SET = 520 // { int ioprio_set(int which, int who, int prio); } SYS_IOPRIO_GET = 521 // { int ioprio_get(int which, int who); } SYS_CHROOT_KERNEL = 522 // { int chroot_kernel(char *path); } - SYS_RENAMEAT = 523 // { int renameat(int oldfd, char *old, int newfd, \ + SYS_RENAMEAT = 523 // { int renameat(int oldfd, char *old, int newfd, char *new); } SYS_MKDIRAT = 524 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 525 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 526 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_READLINKAT = 527 // { int readlinkat(int fd, char *path, char *buf, \ + SYS_MKNODAT = 526 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } + SYS_READLINKAT = 527 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); } SYS_SYMLINKAT = 528 // { int symlinkat(char *path1, int fd, char *path2); } SYS_SWAPOFF = 529 // { int swapoff(char *name); } - SYS_VQUOTACTL = 530 // { int vquotactl(const char *path, \ - SYS_LINKAT = 531 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_VQUOTACTL = 530 // { int vquotactl(const char *path, struct plistref *pref); } + SYS_LINKAT = 531 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flags); } SYS_EACCESS = 532 // { int eaccess(char *path, int flags); } SYS_LPATHCONF = 533 // { int lpathconf(char *path, int name); } SYS_VMM_GUEST_CTL = 534 // { int vmm_guest_ctl(int op, struct vmm_guest_options *options); } @@ -308,7 +308,7 @@ const ( SYS_FUTIMENS = 540 // { int futimens(int fd, const struct timespec *ts); } SYS_ACCEPT4 = 541 // { int accept4(int s, caddr_t name, int *anamelen, int flags); } SYS_LWP_SETNAME = 542 // { int lwp_setname(lwpid_t tid, const char *name); } - SYS_PPOLL = 543 // { int ppoll(struct pollfd *fds, u_int nfds, \ + SYS_PPOLL = 543 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *sigmask); } SYS_LWP_SETAFFINITY = 544 // { int lwp_setaffinity(pid_t pid, lwpid_t tid, const cpumask_t *mask); } SYS_LWP_GETAFFINITY = 545 // { int lwp_getaffinity(pid_t pid, lwpid_t tid, cpumask_t *mask); } SYS_LWP_CREATE2 = 546 // { int lwp_create2(struct lwp_params *params, const cpumask_t *mask); } diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go index 1ab8780c3b0b3..b1e81b7172208 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go @@ -1,4 +1,4 @@ -// mksysnum_freebsd.pl +// go run mksysnum.go http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,freebsd @@ -7,13 +7,13 @@ package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int - SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } - SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ - SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } @@ -21,20 +21,20 @@ const ( SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } - SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ - SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ - SYS_ACCEPT = 30 // { int accept(int s, \ - SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ - SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } + SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } @@ -44,55 +44,55 @@ const ( SYS_DUP = 41 // { int dup(u_int fd); } SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } - SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } - SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ - SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } - SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ - SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ - SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int SYS_CHROOT = 61 // { int chroot(char *path); } - SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } - SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise ovadvise_args int SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ - SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ - SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, int prot); } + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } - SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } - SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ - SYS_SOCKET = 97 // { int socket(int domain, int type, \ - SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } + SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } - SYS_BIND = 104 // { int bind(int s, caddr_t name, \ - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ - SYS_GETRUSAGE = 117 // { int getrusage(int who, \ - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ - SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } + SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } @@ -100,26 +100,26 @@ const ( SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } - SYS_UTIMES = 138 // { int utimes(char *path, \ - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } - SYS_LGETFH = 160 // { int lgetfh(char *fname, \ - SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } + SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ - SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ - SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } + SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } + SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } @@ -130,274 +130,274 @@ const ( SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } + SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } + SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, off_t offset, int whence); } + SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, off_t length); } + SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, off_t length); } + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ - SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ - SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ - SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } - SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 233 // { int clock_settime( clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } - SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ - SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } - SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ - SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ - SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); } + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); } + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } - SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } - SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ - SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); } + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, size_t count); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } - SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } - SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ - SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ - SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ - SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_MODNEXT = 300 // { int modnext(int modid); } - SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat *stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } - SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } - SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ - SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } - SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ - SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } - SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, \ + SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, struct oaiocb * const *acb_list, int nent, struct osigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } - SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ - SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ - SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } - SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } - SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ - SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ - SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ - SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( \ - SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ - SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } + SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ - SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ - SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ - SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS_KEVENT = 363 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } - SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } - SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ - SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ - SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ - SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ - SYS_KENV = 390 // { int kenv(int what, const char *name, \ - SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ - SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ - SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ - SYS_STATFS = 396 // { int statfs(char *path, \ + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } + SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } + SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } - SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ - SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } - SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ - SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ - SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ - SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ - SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ - SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ - SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ - SYS_SIGACTION = 416 // { int sigaction(int sig, \ - SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( const char *path, int attrnamespace, const char *attrname); } + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } + SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } + SYS_SIGRETURN = 417 // { int sigreturn( const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } - SYS_SETCONTEXT = 422 // { int setcontext( \ - SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SETCONTEXT = 422 // { int setcontext( const struct __ucontext *ucp); } + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } - SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ - SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ - SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ - SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ - SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ - SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } - SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ - SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ - SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ - SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ - SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } + SYS_THR_SUSPEND = 442 // { int thr_suspend( const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } - SYS_AUDIT = 445 // { int audit(const void *record, \ - SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } - SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ - SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } - SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ - SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } - SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ - SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ - SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ - SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ - SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len,unsigned msg_prio, const struct timespec *abs_timeout);} + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } - SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } - SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ - SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ - SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ - SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ - SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ - SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ - SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr * from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } - SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } - SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ - SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ - SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ - SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ - SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ - SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ - SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ - SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ - SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ - SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ - SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ - SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ - SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ - SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); } + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } - SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ - SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } - SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ - SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ - SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } - SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } - SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ - SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } - SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ - SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ - SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ - SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ - SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ - SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ - SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ - SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ - SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ - SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ - SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ - SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ - SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ - SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ - SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ - SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ - SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } + SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } - SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ - SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ - SYS_FUTIMENS = 546 // { int futimens(int fd, \ - SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } + SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } + SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go index b66f900dff768..73e277fe7a094 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go @@ -1,4 +1,4 @@ -// mksysnum_freebsd.pl +// go run mksysnum.go http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,freebsd @@ -7,13 +7,13 @@ package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int - SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } - SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ - SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } @@ -21,20 +21,20 @@ const ( SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } - SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ - SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ - SYS_ACCEPT = 30 // { int accept(int s, \ - SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ - SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } + SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } @@ -44,55 +44,55 @@ const ( SYS_DUP = 41 // { int dup(u_int fd); } SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } - SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } - SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ - SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } - SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ - SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ - SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int SYS_CHROOT = 61 // { int chroot(char *path); } - SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } - SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise ovadvise_args int SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ - SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ - SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, int prot); } + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } - SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } - SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ - SYS_SOCKET = 97 // { int socket(int domain, int type, \ - SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } + SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } - SYS_BIND = 104 // { int bind(int s, caddr_t name, \ - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ - SYS_GETRUSAGE = 117 // { int getrusage(int who, \ - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ - SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } + SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } @@ -100,26 +100,26 @@ const ( SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } - SYS_UTIMES = 138 // { int utimes(char *path, \ - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } - SYS_LGETFH = 160 // { int lgetfh(char *fname, \ - SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } + SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ - SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ - SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } + SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } + SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } @@ -130,274 +130,274 @@ const ( SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } + SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } + SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, off_t offset, int whence); } + SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, off_t length); } + SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, off_t length); } + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ - SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ - SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ - SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } - SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 233 // { int clock_settime( clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } - SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ - SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } - SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ - SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ - SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); } + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); } + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } - SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } - SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ - SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); } + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, size_t count); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } - SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } - SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ - SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ - SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ - SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_MODNEXT = 300 // { int modnext(int modid); } - SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat *stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } - SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } - SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ - SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } - SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ - SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } - SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, \ + SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, struct oaiocb * const *acb_list, int nent, struct osigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } - SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ - SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ - SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } - SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } - SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ - SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ - SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ - SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( \ - SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ - SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } + SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ - SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ - SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ - SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS_KEVENT = 363 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } - SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } - SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ - SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ - SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ - SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ - SYS_KENV = 390 // { int kenv(int what, const char *name, \ - SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ - SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ - SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ - SYS_STATFS = 396 // { int statfs(char *path, \ + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } + SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } + SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } - SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ - SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } - SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ - SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ - SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ - SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ - SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ - SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ - SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ - SYS_SIGACTION = 416 // { int sigaction(int sig, \ - SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( const char *path, int attrnamespace, const char *attrname); } + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } + SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } + SYS_SIGRETURN = 417 // { int sigreturn( const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } - SYS_SETCONTEXT = 422 // { int setcontext( \ - SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SETCONTEXT = 422 // { int setcontext( const struct __ucontext *ucp); } + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } - SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ - SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ - SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ - SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ - SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ - SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } - SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ - SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ - SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ - SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ - SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } + SYS_THR_SUSPEND = 442 // { int thr_suspend( const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } - SYS_AUDIT = 445 // { int audit(const void *record, \ - SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } - SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ - SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } - SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ - SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } - SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ - SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ - SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ - SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ - SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len,unsigned msg_prio, const struct timespec *abs_timeout);} + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } - SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } - SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ - SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ - SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ - SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ - SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ - SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ - SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr * from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } - SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } - SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ - SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ - SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ - SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ - SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ - SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ - SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ - SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ - SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ - SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ - SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ - SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ - SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ - SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); } + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } - SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ - SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } - SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ - SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ - SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } - SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } - SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ - SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } - SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ - SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ - SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ - SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ - SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ - SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ - SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ - SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ - SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ - SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ - SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ - SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ - SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ - SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ - SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ - SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ - SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } + SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } - SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ - SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ - SYS_FUTIMENS = 546 // { int futimens(int fd, \ - SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } + SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } + SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go index d61941ba7e002..e12b4691969d2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go @@ -1,4 +1,4 @@ -// mksysnum_freebsd.pl +// go run mksysnum.go http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,freebsd @@ -7,13 +7,13 @@ package unix const ( // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int - SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_EXIT = 1 // { void sys_exit(int rval); } exit sys_exit_args void SYS_FORK = 2 // { int fork(void); } - SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ - SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_READ = 3 // { ssize_t read(int fd, void *buf, size_t nbyte); } + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, size_t nbyte); } SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } SYS_CLOSE = 6 // { int close(int fd); } - SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, int options, struct rusage *rusage); } SYS_LINK = 9 // { int link(char *path, char *link); } SYS_UNLINK = 10 // { int unlink(char *path); } SYS_CHDIR = 12 // { int chdir(char *path); } @@ -21,20 +21,20 @@ const ( SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } SYS_CHMOD = 15 // { int chmod(char *path, int mode); } SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } - SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_OBREAK = 17 // { int obreak(char *nsize); } break obreak_args int SYS_GETPID = 20 // { pid_t getpid(void); } - SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_MOUNT = 21 // { int mount(char *type, char *path, int flags, caddr_t data); } SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } SYS_SETUID = 23 // { int setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t getuid(void); } SYS_GETEUID = 25 // { uid_t geteuid(void); } - SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ - SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ - SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ - SYS_ACCEPT = 30 // { int accept(int s, \ - SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ - SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, caddr_t addr, int data); } + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, int flags); } + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, int flags); } + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, size_t len, int flags, struct sockaddr * __restrict from, __socklen_t * __restrict fromlenaddr); } + SYS_ACCEPT = 30 // { int accept(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen); } + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, struct sockaddr * __restrict asa, __socklen_t * __restrict alen); } SYS_ACCESS = 33 // { int access(char *path, int amode); } SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } @@ -44,55 +44,55 @@ const ( SYS_DUP = 41 // { int dup(u_int fd); } SYS_PIPE = 42 // { int pipe(void); } SYS_GETEGID = 43 // { gid_t getegid(void); } - SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, size_t offset, u_int scale); } + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, int facs, int pid); } SYS_GETGID = 47 // { gid_t getgid(void); } - SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int namelen); } SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } SYS_ACCT = 51 // { int acct(char *path); } - SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ - SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, stack_t *oss); } + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, caddr_t data); } SYS_REBOOT = 55 // { int reboot(int opt); } SYS_REVOKE = 56 // { int revoke(char *path); } SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } - SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ - SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ - SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, size_t count); } + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, char **envv); } + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args int SYS_CHROOT = 61 // { int chroot(char *path); } - SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, int flags); } SYS_VFORK = 66 // { int vfork(void); } SYS_SBRK = 69 // { int sbrk(int incr); } SYS_SSTK = 70 // { int sstk(int incr); } - SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise ovadvise_args int SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ - SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ - SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ - SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, int prot); } + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, int behav); } + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, char *vec); } + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, gid_t *gidset); } + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, gid_t *gidset); } SYS_GETPGRP = 81 // { int getpgrp(void); } SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } - SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct itimerval *itv, struct itimerval *oitv); } SYS_SWAPON = 85 // { int swapon(char *name); } - SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETITIMER = 86 // { int getitimer(u_int which, struct itimerval *itv); } SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } - SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } SYS_FSYNC = 95 // { int fsync(int fd); } - SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ - SYS_SOCKET = 97 // { int socket(int domain, int type, \ - SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, int prio); } + SYS_SOCKET = 97 // { int socket(int domain, int type, int protocol); } + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, int namelen); } SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } - SYS_BIND = 104 // { int bind(int s, caddr_t name, \ - SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_BIND = 104 // { int bind(int s, caddr_t name, int namelen); } + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, caddr_t val, int valsize); } SYS_LISTEN = 106 // { int listen(int s, int backlog); } - SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ - SYS_GETRUSAGE = 117 // { int getrusage(int who, \ - SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ - SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ - SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ - SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, struct timezone *tzp); } + SYS_GETRUSAGE = 117 // { int getrusage(int who, struct rusage *rusage); } + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, caddr_t val, int *avalsize); } + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, u_int iovcnt); } + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, struct timezone *tzp); } SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } @@ -100,26 +100,26 @@ const ( SYS_RENAME = 128 // { int rename(char *from, char *to); } SYS_FLOCK = 131 // { int flock(int fd, int how); } SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } - SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, int flags, caddr_t to, int tolen); } SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } SYS_RMDIR = 137 // { int rmdir(char *path); } - SYS_UTIMES = 138 // { int utimes(char *path, \ - SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_UTIMES = 138 // { int utimes(char *path, struct timeval *tptr); } + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, struct timeval *olddelta); } SYS_SETSID = 147 // { int setsid(void); } - SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, caddr_t arg); } SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } - SYS_LGETFH = 160 // { int lgetfh(char *fname, \ - SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_LGETFH = 160 // { int lgetfh(char *fname, struct fhandle *fhp); } + SYS_GETFH = 161 // { int getfh(char *fname, struct fhandle *fhp); } SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } - SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ - SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ - SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ - SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ - SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, \ - SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, \ + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, struct rtprio *rtp); } + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, int a4, int a5); } + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, int a4, int a5, int a6); } + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, int a4); } + SYS_FREEBSD6_PREAD = 173 // { ssize_t freebsd6_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } + SYS_FREEBSD6_PWRITE = 174 // { ssize_t freebsd6_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETFIB = 175 // { int setfib(int fibnum); } SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } SYS_SETGID = 181 // { int setgid(gid_t gid); } @@ -130,274 +130,274 @@ const ( SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } - SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ - SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ - SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ - SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, \ - SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, \ - SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, \ - SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, \ - SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, struct rlimit *rlp); } getrlimit __getrlimit_args int + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, struct rlimit *rlp); } setrlimit __setrlimit_args int + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, u_int count, long *basep); } + SYS_FREEBSD6_MMAP = 197 // { caddr_t freebsd6_mmap(caddr_t addr, size_t len, int prot, int flags, int fd, int pad, off_t pos); } + SYS_FREEBSD6_LSEEK = 199 // { off_t freebsd6_lseek(int fd, int pad, off_t offset, int whence); } + SYS_FREEBSD6_TRUNCATE = 200 // { int freebsd6_truncate(char *path, int pad, off_t length); } + SYS_FREEBSD6_FTRUNCATE = 201 // { int freebsd6_ftruncate(int fd, int pad, off_t length); } + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } __sysctl sysctl_args int SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } SYS_UNDELETE = 205 // { int undelete(char *path); } SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } SYS_GETPGID = 207 // { int getpgid(pid_t pid); } - SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ - SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ - SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, int timeout); } + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, int semflg); } + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, size_t nsops); } SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ - SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ - SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } - SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ - SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ - SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ - SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, int shmflg); } + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 233 // { int clock_settime( clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, struct timespec *tp); } + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, struct sigevent *evp, int *timerid); } SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } - SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ - SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue); } + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct itimerspec *value); } SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } - SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } - SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ - SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ - SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( struct ffclock_estimate *cest); } + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( struct ffclock_estimate *cest); } + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,int which, clockid_t *clock_id); } SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } - SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, int inherit); } SYS_RFORK = 251 // { int rfork(int flags); } - SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int issetugid(void); } SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } - SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ - SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, struct aiocb * const *acb_list, int nent, struct sigevent *sig); } + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, size_t count); } SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } - SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_LUTIMES = 276 // { int lutimes(char *path, struct timeval *tptr); } SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } - SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ - SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ - SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ - SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, u_int iovcnt, off_t offset); } + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, int flags); } + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, struct stat *sb); } SYS_MODNEXT = 300 // { int modnext(int modid); } - SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODSTAT = 301 // { int modstat(int modid, struct module_stat *stat); } SYS_MODFNEXT = 302 // { int modfnext(int modid); } SYS_MODFIND = 303 // { int modfind(const char *name); } SYS_KLDLOAD = 304 // { int kldload(const char *file); } SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } SYS_KLDFIND = 306 // { int kldfind(const char *file); } SYS_KLDNEXT = 307 // { int kldnext(int fileid); } - SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct kld_file_stat* stat); } SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } SYS_GETSID = 310 // { int getsid(pid_t pid); } - SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ - SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, uid_t suid); } + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, gid_t sgid); } SYS_AIO_RETURN = 314 // { int aio_return(struct aiocb *aiocbp); } - SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ - SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_SUSPEND = 315 // { int aio_suspend( struct aiocb * const * aiocbp, int nent, const struct timespec *timeout); } + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, struct aiocb *aiocbp); } SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } SYS_OAIO_READ = 318 // { int oaio_read(struct oaiocb *aiocbp); } SYS_OAIO_WRITE = 319 // { int oaio_write(struct oaiocb *aiocbp); } - SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, \ + SYS_OLIO_LISTIO = 320 // { int olio_listio(int mode, struct oaiocb * const *acb_list, int nent, struct osigevent *sig); } SYS_YIELD = 321 // { int yield(void); } SYS_MLOCKALL = 324 // { int mlockall(int how); } SYS_MUNLOCKALL = 325 // { int munlockall(void); } SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } - SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ - SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ - SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, const struct sched_param *param); } + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct sched_param *param); } + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int policy, const struct sched_param *param); } SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } SYS_SCHED_YIELD = 331 // { int sched_yield (void); } SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } - SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, struct timespec *interval); } SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } - SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, void *data); } SYS_JAIL = 338 // { int jail(struct jail *jail); } - SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, const sigset_t *set, sigset_t *oset); } SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } - SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ - SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ - SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ - SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ - SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ - SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ - SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ - SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ - SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ - SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ - SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ - SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ - SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ - SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ - SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( \ - SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ - SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, siginfo_t *info, const struct timespec *timeout); } + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, siginfo_t *info); } + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, acl_type_t type); } + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, acl_type_t type); } + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, acl_type_t type, struct acl *aclp); } + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, const char *filename, int attrnamespace, const char *attrname); } + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, int attrnamespace, const char *attrname); } + SYS_AIO_WAITCOMPLETE = 359 // { int aio_waitcomplete( struct aiocb **aiocbp, struct timespec *timeout); } + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } SYS_KQUEUE = 362 // { int kqueue(void); } - SYS_KEVENT = 363 // { int kevent(int fd, \ - SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ - SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ - SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS_KEVENT = 363 // { int kevent(int fd, struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, int attrnamespace, const char *attrname); } SYS___SETUGID = 374 // { int __setugid(int flag); } SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } - SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } - SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ - SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ - SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ - SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ - SYS_KENV = 390 // { int kenv(int what, const char *name, \ - SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ - SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ - SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ - SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ - SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ - SYS_STATFS = 396 // { int statfs(char *path, \ + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, struct mac *mac_p); } + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, struct mac *mac_p); } + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, struct mac *mac_p); } + SYS_KENV = 390 // { int kenv(int what, const char *name, char *value, int len); } + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, u_long flags); } + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, int count); } + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, size_t nbytes, struct sf_hdtr *hdtr, off_t *sbytes, int flags); } + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, int call, void *arg); } + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, long bufsize, int flags); } + SYS_STATFS = 396 // { int statfs(char *path, struct statfs *buf); } SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, struct statfs *buf); } SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } - SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ - SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, unsigned int value); } + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, const char *name, int oflag, mode_t mode, unsigned int value); } SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } - SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ - SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ - SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ - SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ - SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ - SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ - SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ - SYS_SIGACTION = 416 // { int sigaction(int sig, \ - SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, struct mac *mac_p); } + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, struct mac *mac_p); } + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, struct mac *mac_p); } + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( const char *path, int attrnamespace, const char *attrname, void *data, size_t nbytes); } + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( const char *path, int attrnamespace, const char *attrname); } + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, char **envv, struct mac *mac_p); } + SYS_SIGACTION = 416 // { int sigaction(int sig, const struct sigaction *act, struct sigaction *oact); } + SYS_SIGRETURN = 417 // { int sigreturn( const struct __ucontext *sigcntxp); } SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } - SYS_SETCONTEXT = 422 // { int setcontext( \ - SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SETCONTEXT = 422 // { int setcontext( const struct __ucontext *ucp); } + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, const struct __ucontext *ucp); } SYS_SWAPOFF = 424 // { int swapoff(const char *name); } - SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ - SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ - SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ - SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ - SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ - SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, acl_type_t type); } + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, acl_type_t type, struct acl *aclp); } + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, int *sig); } + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, int flags); } SYS_THR_EXIT = 431 // { void thr_exit(long *state); } SYS_THR_SELF = 432 // { int thr_self(long *id); } SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } SYS__UMTX_LOCK = 434 // { int _umtx_lock(struct umtx *umtx); } SYS__UMTX_UNLOCK = 435 // { int _umtx_unlock(struct umtx *umtx); } SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } - SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ - SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ - SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ - SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ - SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( const char *path, int attrnamespace, void *data, size_t nbytes); } + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, const struct timespec *abstime); } + SYS_THR_SUSPEND = 442 // { int thr_suspend( const struct timespec *timeout); } SYS_THR_WAKE = 443 // { int thr_wake(long id); } SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } - SYS_AUDIT = 445 // { int audit(const void *record, \ - SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_AUDIT = 445 // { int audit(const void *record, u_int length); } + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, u_int length); } SYS_GETAUID = 447 // { int getauid(uid_t *auid); } SYS_SETAUID = 448 // { int setauid(uid_t *auid); } SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } - SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ - SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( struct auditinfo_addr *auditinfo_addr, u_int length); } SYS_AUDITCTL = 453 // { int auditctl(char *path); } - SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ - SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, u_long val, void *uaddr1, void *uaddr2); } + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, int param_size); } SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } - SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ - SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ - SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ - SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ - SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, mode_t mode, const struct mq_attr *attr); } + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, const struct mq_attr *attr, struct mq_attr *oattr); } + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, char *msg_ptr, size_t msg_len, unsigned *msg_prio, const struct timespec *abs_timeout); } + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, const char *msg_ptr, size_t msg_len,unsigned msg_prio, const struct timespec *abs_timeout);} + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, const struct sigevent *sigev); } SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } - SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp); } SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } - SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ - SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ - SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ - SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ - SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ - SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ - SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, caddr_t to, __socklen_t tolen, struct sctp_sndrcvinfo *sinfo, int flags); } + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, struct sockaddr * from, __socklen_t *fromlenaddr, struct sctp_sndrcvinfo *sinfo, int *msg_flags); } + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, size_t nbyte, off_t offset); } + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, size_t nbyte, off_t offset); } + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, int prot, int flags, int fd, off_t pos); } + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, int whence); } SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } - SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, mode_t mode); } SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } - SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ - SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ - SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ - SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ - SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ - SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ - SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ - SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ - SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ - SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ - SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, cpusetid_t setid); } + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, cpuwhich_t which, id_t id, cpusetid_t *setid); } + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, cpuset_t *mask); } + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, const cpuset_t *mask); } + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, int flag); } + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, int flag); } + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, gid_t gid, int flag); } + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, char **envv); } + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, struct stat *buf, int flag); } + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, struct timeval *times); } + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, char *path2, int flag); } SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } - SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ - SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ - SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ - SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ - SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, dev_t dev); } + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, mode_t mode); } + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, size_t bufsize); } + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, char *new); } + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, char *path2); } SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } - SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ - SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, unsigned int iovcnt, int flags); } + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, unsigned int iovcnt, int flags); } SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } - SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ - SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ - SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, int cmd, union semun *arg); } + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, struct msqid_ds *buf); } + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, struct shmid_ds *buf); } SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } - SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, int fd, cap_rights_t *rightsp); } SYS_CAP_ENTER = 516 // { int cap_enter(void); } SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } - SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ - SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *sm); } + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, size_t namelen); } SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } - SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ - SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ - SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ - SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ - SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ - SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ - SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ - SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ - SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ - SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ - SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ - SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ - SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ - SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ - SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ - SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ - SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, size_t inbuflen, void *outbufp, size_t outbuflen); } + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, off_t offset, off_t len); } + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, off_t len, int advice); } + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, int *status, int options, struct __wrusage *wrusage, siginfo_t *info); } + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, cap_rights_t *rightsp); } + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, const u_long *cmds, size_t ncmds); } + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, u_long *cmds, size_t maxcmds); } + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, uint32_t fcntlrights); } + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, uint32_t *fcntlrightsp); } + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, int namelen); } + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, int namelen); } + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, u_long flags, int atflag); } + SYS_ACCEPT4 = 541 // { int accept4(int s, struct sockaddr * __restrict name, __socklen_t * __restrict anamelen, int flags); } SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } - SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ - SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ - SYS_FUTIMENS = 546 // { int futimens(int fd, \ - SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, int com, void *data); } + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *set); } + SYS_FUTIMENS = 546 // { int futimens(int fd, struct timespec *times); } + SYS_UTIMENSAT = 547 // { int utimensat(int fd, char *path, struct timespec *times, int flag); } ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go new file mode 100644 index 0000000000000..8c1e16ca516d2 --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go @@ -0,0 +1,395 @@ +// mksysnum_freebsd.pl +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build arm64,freebsd + +package unix + +const ( + // SYS_NOSYS = 0; // { int nosys(void); } syscall nosys_args int + SYS_EXIT = 1 // { void sys_exit(int rval); } exit \ + SYS_FORK = 2 // { int fork(void); } + SYS_READ = 3 // { ssize_t read(int fd, void *buf, \ + SYS_WRITE = 4 // { ssize_t write(int fd, const void *buf, \ + SYS_OPEN = 5 // { int open(char *path, int flags, int mode); } + SYS_CLOSE = 6 // { int close(int fd); } + SYS_WAIT4 = 7 // { int wait4(int pid, int *status, \ + SYS_LINK = 9 // { int link(char *path, char *link); } + SYS_UNLINK = 10 // { int unlink(char *path); } + SYS_CHDIR = 12 // { int chdir(char *path); } + SYS_FCHDIR = 13 // { int fchdir(int fd); } + SYS_MKNOD = 14 // { int mknod(char *path, int mode, int dev); } + SYS_CHMOD = 15 // { int chmod(char *path, int mode); } + SYS_CHOWN = 16 // { int chown(char *path, int uid, int gid); } + SYS_OBREAK = 17 // { int obreak(char *nsize); } break \ + SYS_GETPID = 20 // { pid_t getpid(void); } + SYS_MOUNT = 21 // { int mount(char *type, char *path, \ + SYS_UNMOUNT = 22 // { int unmount(char *path, int flags); } + SYS_SETUID = 23 // { int setuid(uid_t uid); } + SYS_GETUID = 24 // { uid_t getuid(void); } + SYS_GETEUID = 25 // { uid_t geteuid(void); } + SYS_PTRACE = 26 // { int ptrace(int req, pid_t pid, \ + SYS_RECVMSG = 27 // { int recvmsg(int s, struct msghdr *msg, \ + SYS_SENDMSG = 28 // { int sendmsg(int s, struct msghdr *msg, \ + SYS_RECVFROM = 29 // { int recvfrom(int s, caddr_t buf, \ + SYS_ACCEPT = 30 // { int accept(int s, \ + SYS_GETPEERNAME = 31 // { int getpeername(int fdes, \ + SYS_GETSOCKNAME = 32 // { int getsockname(int fdes, \ + SYS_ACCESS = 33 // { int access(char *path, int amode); } + SYS_CHFLAGS = 34 // { int chflags(const char *path, u_long flags); } + SYS_FCHFLAGS = 35 // { int fchflags(int fd, u_long flags); } + SYS_SYNC = 36 // { int sync(void); } + SYS_KILL = 37 // { int kill(int pid, int signum); } + SYS_GETPPID = 39 // { pid_t getppid(void); } + SYS_DUP = 41 // { int dup(u_int fd); } + SYS_GETEGID = 43 // { gid_t getegid(void); } + SYS_PROFIL = 44 // { int profil(caddr_t samples, size_t size, \ + SYS_KTRACE = 45 // { int ktrace(const char *fname, int ops, \ + SYS_GETGID = 47 // { gid_t getgid(void); } + SYS_GETLOGIN = 49 // { int getlogin(char *namebuf, u_int \ + SYS_SETLOGIN = 50 // { int setlogin(char *namebuf); } + SYS_ACCT = 51 // { int acct(char *path); } + SYS_SIGALTSTACK = 53 // { int sigaltstack(stack_t *ss, \ + SYS_IOCTL = 54 // { int ioctl(int fd, u_long com, \ + SYS_REBOOT = 55 // { int reboot(int opt); } + SYS_REVOKE = 56 // { int revoke(char *path); } + SYS_SYMLINK = 57 // { int symlink(char *path, char *link); } + SYS_READLINK = 58 // { ssize_t readlink(char *path, char *buf, \ + SYS_EXECVE = 59 // { int execve(char *fname, char **argv, \ + SYS_UMASK = 60 // { int umask(int newmask); } umask umask_args \ + SYS_CHROOT = 61 // { int chroot(char *path); } + SYS_MSYNC = 65 // { int msync(void *addr, size_t len, \ + SYS_VFORK = 66 // { int vfork(void); } + SYS_SBRK = 69 // { int sbrk(int incr); } + SYS_SSTK = 70 // { int sstk(int incr); } + SYS_OVADVISE = 72 // { int ovadvise(int anom); } vadvise \ + SYS_MUNMAP = 73 // { int munmap(void *addr, size_t len); } + SYS_MPROTECT = 74 // { int mprotect(const void *addr, size_t len, \ + SYS_MADVISE = 75 // { int madvise(void *addr, size_t len, \ + SYS_MINCORE = 78 // { int mincore(const void *addr, size_t len, \ + SYS_GETGROUPS = 79 // { int getgroups(u_int gidsetsize, \ + SYS_SETGROUPS = 80 // { int setgroups(u_int gidsetsize, \ + SYS_GETPGRP = 81 // { int getpgrp(void); } + SYS_SETPGID = 82 // { int setpgid(int pid, int pgid); } + SYS_SETITIMER = 83 // { int setitimer(u_int which, struct \ + SYS_SWAPON = 85 // { int swapon(char *name); } + SYS_GETITIMER = 86 // { int getitimer(u_int which, \ + SYS_GETDTABLESIZE = 89 // { int getdtablesize(void); } + SYS_DUP2 = 90 // { int dup2(u_int from, u_int to); } + SYS_FCNTL = 92 // { int fcntl(int fd, int cmd, long arg); } + SYS_SELECT = 93 // { int select(int nd, fd_set *in, fd_set *ou, \ + SYS_FSYNC = 95 // { int fsync(int fd); } + SYS_SETPRIORITY = 96 // { int setpriority(int which, int who, \ + SYS_SOCKET = 97 // { int socket(int domain, int type, \ + SYS_CONNECT = 98 // { int connect(int s, caddr_t name, \ + SYS_GETPRIORITY = 100 // { int getpriority(int which, int who); } + SYS_BIND = 104 // { int bind(int s, caddr_t name, \ + SYS_SETSOCKOPT = 105 // { int setsockopt(int s, int level, int name, \ + SYS_LISTEN = 106 // { int listen(int s, int backlog); } + SYS_GETTIMEOFDAY = 116 // { int gettimeofday(struct timeval *tp, \ + SYS_GETRUSAGE = 117 // { int getrusage(int who, \ + SYS_GETSOCKOPT = 118 // { int getsockopt(int s, int level, int name, \ + SYS_READV = 120 // { int readv(int fd, struct iovec *iovp, \ + SYS_WRITEV = 121 // { int writev(int fd, struct iovec *iovp, \ + SYS_SETTIMEOFDAY = 122 // { int settimeofday(struct timeval *tv, \ + SYS_FCHOWN = 123 // { int fchown(int fd, int uid, int gid); } + SYS_FCHMOD = 124 // { int fchmod(int fd, int mode); } + SYS_SETREUID = 126 // { int setreuid(int ruid, int euid); } + SYS_SETREGID = 127 // { int setregid(int rgid, int egid); } + SYS_RENAME = 128 // { int rename(char *from, char *to); } + SYS_FLOCK = 131 // { int flock(int fd, int how); } + SYS_MKFIFO = 132 // { int mkfifo(char *path, int mode); } + SYS_SENDTO = 133 // { int sendto(int s, caddr_t buf, size_t len, \ + SYS_SHUTDOWN = 134 // { int shutdown(int s, int how); } + SYS_SOCKETPAIR = 135 // { int socketpair(int domain, int type, \ + SYS_MKDIR = 136 // { int mkdir(char *path, int mode); } + SYS_RMDIR = 137 // { int rmdir(char *path); } + SYS_UTIMES = 138 // { int utimes(char *path, \ + SYS_ADJTIME = 140 // { int adjtime(struct timeval *delta, \ + SYS_SETSID = 147 // { int setsid(void); } + SYS_QUOTACTL = 148 // { int quotactl(char *path, int cmd, int uid, \ + SYS_NLM_SYSCALL = 154 // { int nlm_syscall(int debug_level, int grace_period, int addr_count, char **addrs); } + SYS_NFSSVC = 155 // { int nfssvc(int flag, caddr_t argp); } + SYS_LGETFH = 160 // { int lgetfh(char *fname, \ + SYS_GETFH = 161 // { int getfh(char *fname, \ + SYS_SYSARCH = 165 // { int sysarch(int op, char *parms); } + SYS_RTPRIO = 166 // { int rtprio(int function, pid_t pid, \ + SYS_SEMSYS = 169 // { int semsys(int which, int a2, int a3, \ + SYS_MSGSYS = 170 // { int msgsys(int which, int a2, int a3, \ + SYS_SHMSYS = 171 // { int shmsys(int which, int a2, int a3, \ + SYS_SETFIB = 175 // { int setfib(int fibnum); } + SYS_NTP_ADJTIME = 176 // { int ntp_adjtime(struct timex *tp); } + SYS_SETGID = 181 // { int setgid(gid_t gid); } + SYS_SETEGID = 182 // { int setegid(gid_t egid); } + SYS_SETEUID = 183 // { int seteuid(uid_t euid); } + SYS_STAT = 188 // { int stat(char *path, struct stat *ub); } + SYS_FSTAT = 189 // { int fstat(int fd, struct stat *sb); } + SYS_LSTAT = 190 // { int lstat(char *path, struct stat *ub); } + SYS_PATHCONF = 191 // { int pathconf(char *path, int name); } + SYS_FPATHCONF = 192 // { int fpathconf(int fd, int name); } + SYS_GETRLIMIT = 194 // { int getrlimit(u_int which, \ + SYS_SETRLIMIT = 195 // { int setrlimit(u_int which, \ + SYS_GETDIRENTRIES = 196 // { int getdirentries(int fd, char *buf, \ + SYS___SYSCTL = 202 // { int __sysctl(int *name, u_int namelen, \ + SYS_MLOCK = 203 // { int mlock(const void *addr, size_t len); } + SYS_MUNLOCK = 204 // { int munlock(const void *addr, size_t len); } + SYS_UNDELETE = 205 // { int undelete(char *path); } + SYS_FUTIMES = 206 // { int futimes(int fd, struct timeval *tptr); } + SYS_GETPGID = 207 // { int getpgid(pid_t pid); } + SYS_POLL = 209 // { int poll(struct pollfd *fds, u_int nfds, \ + SYS_SEMGET = 221 // { int semget(key_t key, int nsems, \ + SYS_SEMOP = 222 // { int semop(int semid, struct sembuf *sops, \ + SYS_MSGGET = 225 // { int msgget(key_t key, int msgflg); } + SYS_MSGSND = 226 // { int msgsnd(int msqid, const void *msgp, \ + SYS_MSGRCV = 227 // { int msgrcv(int msqid, void *msgp, \ + SYS_SHMAT = 228 // { int shmat(int shmid, const void *shmaddr, \ + SYS_SHMDT = 230 // { int shmdt(const void *shmaddr); } + SYS_SHMGET = 231 // { int shmget(key_t key, size_t size, \ + SYS_CLOCK_GETTIME = 232 // { int clock_gettime(clockid_t clock_id, \ + SYS_CLOCK_SETTIME = 233 // { int clock_settime( \ + SYS_CLOCK_GETRES = 234 // { int clock_getres(clockid_t clock_id, \ + SYS_KTIMER_CREATE = 235 // { int ktimer_create(clockid_t clock_id, \ + SYS_KTIMER_DELETE = 236 // { int ktimer_delete(int timerid); } + SYS_KTIMER_SETTIME = 237 // { int ktimer_settime(int timerid, int flags, \ + SYS_KTIMER_GETTIME = 238 // { int ktimer_gettime(int timerid, struct \ + SYS_KTIMER_GETOVERRUN = 239 // { int ktimer_getoverrun(int timerid); } + SYS_NANOSLEEP = 240 // { int nanosleep(const struct timespec *rqtp, \ + SYS_FFCLOCK_GETCOUNTER = 241 // { int ffclock_getcounter(ffcounter *ffcount); } + SYS_FFCLOCK_SETESTIMATE = 242 // { int ffclock_setestimate( \ + SYS_FFCLOCK_GETESTIMATE = 243 // { int ffclock_getestimate( \ + SYS_CLOCK_NANOSLEEP = 244 // { int clock_nanosleep(clockid_t clock_id, \ + SYS_CLOCK_GETCPUCLOCKID2 = 247 // { int clock_getcpuclockid2(id_t id,\ + SYS_NTP_GETTIME = 248 // { int ntp_gettime(struct ntptimeval *ntvp); } + SYS_MINHERIT = 250 // { int minherit(void *addr, size_t len, \ + SYS_RFORK = 251 // { int rfork(int flags); } + SYS_OPENBSD_POLL = 252 // { int openbsd_poll(struct pollfd *fds, \ + SYS_ISSETUGID = 253 // { int issetugid(void); } + SYS_LCHOWN = 254 // { int lchown(char *path, int uid, int gid); } + SYS_AIO_READ = 255 // { int aio_read(struct aiocb *aiocbp); } + SYS_AIO_WRITE = 256 // { int aio_write(struct aiocb *aiocbp); } + SYS_LIO_LISTIO = 257 // { int lio_listio(int mode, \ + SYS_GETDENTS = 272 // { int getdents(int fd, char *buf, \ + SYS_LCHMOD = 274 // { int lchmod(char *path, mode_t mode); } + SYS_LUTIMES = 276 // { int lutimes(char *path, \ + SYS_NSTAT = 278 // { int nstat(char *path, struct nstat *ub); } + SYS_NFSTAT = 279 // { int nfstat(int fd, struct nstat *sb); } + SYS_NLSTAT = 280 // { int nlstat(char *path, struct nstat *ub); } + SYS_PREADV = 289 // { ssize_t preadv(int fd, struct iovec *iovp, \ + SYS_PWRITEV = 290 // { ssize_t pwritev(int fd, struct iovec *iovp, \ + SYS_FHOPEN = 298 // { int fhopen(const struct fhandle *u_fhp, \ + SYS_FHSTAT = 299 // { int fhstat(const struct fhandle *u_fhp, \ + SYS_MODNEXT = 300 // { int modnext(int modid); } + SYS_MODSTAT = 301 // { int modstat(int modid, \ + SYS_MODFNEXT = 302 // { int modfnext(int modid); } + SYS_MODFIND = 303 // { int modfind(const char *name); } + SYS_KLDLOAD = 304 // { int kldload(const char *file); } + SYS_KLDUNLOAD = 305 // { int kldunload(int fileid); } + SYS_KLDFIND = 306 // { int kldfind(const char *file); } + SYS_KLDNEXT = 307 // { int kldnext(int fileid); } + SYS_KLDSTAT = 308 // { int kldstat(int fileid, struct \ + SYS_KLDFIRSTMOD = 309 // { int kldfirstmod(int fileid); } + SYS_GETSID = 310 // { int getsid(pid_t pid); } + SYS_SETRESUID = 311 // { int setresuid(uid_t ruid, uid_t euid, \ + SYS_SETRESGID = 312 // { int setresgid(gid_t rgid, gid_t egid, \ + SYS_AIO_RETURN = 314 // { ssize_t aio_return(struct aiocb *aiocbp); } + SYS_AIO_SUSPEND = 315 // { int aio_suspend( \ + SYS_AIO_CANCEL = 316 // { int aio_cancel(int fd, \ + SYS_AIO_ERROR = 317 // { int aio_error(struct aiocb *aiocbp); } + SYS_YIELD = 321 // { int yield(void); } + SYS_MLOCKALL = 324 // { int mlockall(int how); } + SYS_MUNLOCKALL = 325 // { int munlockall(void); } + SYS___GETCWD = 326 // { int __getcwd(char *buf, u_int buflen); } + SYS_SCHED_SETPARAM = 327 // { int sched_setparam (pid_t pid, \ + SYS_SCHED_GETPARAM = 328 // { int sched_getparam (pid_t pid, struct \ + SYS_SCHED_SETSCHEDULER = 329 // { int sched_setscheduler (pid_t pid, int \ + SYS_SCHED_GETSCHEDULER = 330 // { int sched_getscheduler (pid_t pid); } + SYS_SCHED_YIELD = 331 // { int sched_yield (void); } + SYS_SCHED_GET_PRIORITY_MAX = 332 // { int sched_get_priority_max (int policy); } + SYS_SCHED_GET_PRIORITY_MIN = 333 // { int sched_get_priority_min (int policy); } + SYS_SCHED_RR_GET_INTERVAL = 334 // { int sched_rr_get_interval (pid_t pid, \ + SYS_UTRACE = 335 // { int utrace(const void *addr, size_t len); } + SYS_KLDSYM = 337 // { int kldsym(int fileid, int cmd, \ + SYS_JAIL = 338 // { int jail(struct jail *jail); } + SYS_SIGPROCMASK = 340 // { int sigprocmask(int how, \ + SYS_SIGSUSPEND = 341 // { int sigsuspend(const sigset_t *sigmask); } + SYS_SIGPENDING = 343 // { int sigpending(sigset_t *set); } + SYS_SIGTIMEDWAIT = 345 // { int sigtimedwait(const sigset_t *set, \ + SYS_SIGWAITINFO = 346 // { int sigwaitinfo(const sigset_t *set, \ + SYS___ACL_GET_FILE = 347 // { int __acl_get_file(const char *path, \ + SYS___ACL_SET_FILE = 348 // { int __acl_set_file(const char *path, \ + SYS___ACL_GET_FD = 349 // { int __acl_get_fd(int filedes, \ + SYS___ACL_SET_FD = 350 // { int __acl_set_fd(int filedes, \ + SYS___ACL_DELETE_FILE = 351 // { int __acl_delete_file(const char *path, \ + SYS___ACL_DELETE_FD = 352 // { int __acl_delete_fd(int filedes, \ + SYS___ACL_ACLCHECK_FILE = 353 // { int __acl_aclcheck_file(const char *path, \ + SYS___ACL_ACLCHECK_FD = 354 // { int __acl_aclcheck_fd(int filedes, \ + SYS_EXTATTRCTL = 355 // { int extattrctl(const char *path, int cmd, \ + SYS_EXTATTR_SET_FILE = 356 // { ssize_t extattr_set_file( \ + SYS_EXTATTR_GET_FILE = 357 // { ssize_t extattr_get_file( \ + SYS_EXTATTR_DELETE_FILE = 358 // { int extattr_delete_file(const char *path, \ + SYS_AIO_WAITCOMPLETE = 359 // { ssize_t aio_waitcomplete( \ + SYS_GETRESUID = 360 // { int getresuid(uid_t *ruid, uid_t *euid, \ + SYS_GETRESGID = 361 // { int getresgid(gid_t *rgid, gid_t *egid, \ + SYS_KQUEUE = 362 // { int kqueue(void); } + SYS_KEVENT = 363 // { int kevent(int fd, \ + SYS_EXTATTR_SET_FD = 371 // { ssize_t extattr_set_fd(int fd, \ + SYS_EXTATTR_GET_FD = 372 // { ssize_t extattr_get_fd(int fd, \ + SYS_EXTATTR_DELETE_FD = 373 // { int extattr_delete_fd(int fd, \ + SYS___SETUGID = 374 // { int __setugid(int flag); } + SYS_EACCESS = 376 // { int eaccess(char *path, int amode); } + SYS_NMOUNT = 378 // { int nmount(struct iovec *iovp, \ + SYS___MAC_GET_PROC = 384 // { int __mac_get_proc(struct mac *mac_p); } + SYS___MAC_SET_PROC = 385 // { int __mac_set_proc(struct mac *mac_p); } + SYS___MAC_GET_FD = 386 // { int __mac_get_fd(int fd, \ + SYS___MAC_GET_FILE = 387 // { int __mac_get_file(const char *path_p, \ + SYS___MAC_SET_FD = 388 // { int __mac_set_fd(int fd, \ + SYS___MAC_SET_FILE = 389 // { int __mac_set_file(const char *path_p, \ + SYS_KENV = 390 // { int kenv(int what, const char *name, \ + SYS_LCHFLAGS = 391 // { int lchflags(const char *path, \ + SYS_UUIDGEN = 392 // { int uuidgen(struct uuid *store, \ + SYS_SENDFILE = 393 // { int sendfile(int fd, int s, off_t offset, \ + SYS_MAC_SYSCALL = 394 // { int mac_syscall(const char *policy, \ + SYS_GETFSSTAT = 395 // { int getfsstat(struct statfs *buf, \ + SYS_STATFS = 396 // { int statfs(char *path, \ + SYS_FSTATFS = 397 // { int fstatfs(int fd, struct statfs *buf); } + SYS_FHSTATFS = 398 // { int fhstatfs(const struct fhandle *u_fhp, \ + SYS_KSEM_CLOSE = 400 // { int ksem_close(semid_t id); } + SYS_KSEM_POST = 401 // { int ksem_post(semid_t id); } + SYS_KSEM_WAIT = 402 // { int ksem_wait(semid_t id); } + SYS_KSEM_TRYWAIT = 403 // { int ksem_trywait(semid_t id); } + SYS_KSEM_INIT = 404 // { int ksem_init(semid_t *idp, \ + SYS_KSEM_OPEN = 405 // { int ksem_open(semid_t *idp, \ + SYS_KSEM_UNLINK = 406 // { int ksem_unlink(const char *name); } + SYS_KSEM_GETVALUE = 407 // { int ksem_getvalue(semid_t id, int *val); } + SYS_KSEM_DESTROY = 408 // { int ksem_destroy(semid_t id); } + SYS___MAC_GET_PID = 409 // { int __mac_get_pid(pid_t pid, \ + SYS___MAC_GET_LINK = 410 // { int __mac_get_link(const char *path_p, \ + SYS___MAC_SET_LINK = 411 // { int __mac_set_link(const char *path_p, \ + SYS_EXTATTR_SET_LINK = 412 // { ssize_t extattr_set_link( \ + SYS_EXTATTR_GET_LINK = 413 // { ssize_t extattr_get_link( \ + SYS_EXTATTR_DELETE_LINK = 414 // { int extattr_delete_link( \ + SYS___MAC_EXECVE = 415 // { int __mac_execve(char *fname, char **argv, \ + SYS_SIGACTION = 416 // { int sigaction(int sig, \ + SYS_SIGRETURN = 417 // { int sigreturn( \ + SYS_GETCONTEXT = 421 // { int getcontext(struct __ucontext *ucp); } + SYS_SETCONTEXT = 422 // { int setcontext( \ + SYS_SWAPCONTEXT = 423 // { int swapcontext(struct __ucontext *oucp, \ + SYS_SWAPOFF = 424 // { int swapoff(const char *name); } + SYS___ACL_GET_LINK = 425 // { int __acl_get_link(const char *path, \ + SYS___ACL_SET_LINK = 426 // { int __acl_set_link(const char *path, \ + SYS___ACL_DELETE_LINK = 427 // { int __acl_delete_link(const char *path, \ + SYS___ACL_ACLCHECK_LINK = 428 // { int __acl_aclcheck_link(const char *path, \ + SYS_SIGWAIT = 429 // { int sigwait(const sigset_t *set, \ + SYS_THR_CREATE = 430 // { int thr_create(ucontext_t *ctx, long *id, \ + SYS_THR_EXIT = 431 // { void thr_exit(long *state); } + SYS_THR_SELF = 432 // { int thr_self(long *id); } + SYS_THR_KILL = 433 // { int thr_kill(long id, int sig); } + SYS_JAIL_ATTACH = 436 // { int jail_attach(int jid); } + SYS_EXTATTR_LIST_FD = 437 // { ssize_t extattr_list_fd(int fd, \ + SYS_EXTATTR_LIST_FILE = 438 // { ssize_t extattr_list_file( \ + SYS_EXTATTR_LIST_LINK = 439 // { ssize_t extattr_list_link( \ + SYS_KSEM_TIMEDWAIT = 441 // { int ksem_timedwait(semid_t id, \ + SYS_THR_SUSPEND = 442 // { int thr_suspend( \ + SYS_THR_WAKE = 443 // { int thr_wake(long id); } + SYS_KLDUNLOADF = 444 // { int kldunloadf(int fileid, int flags); } + SYS_AUDIT = 445 // { int audit(const void *record, \ + SYS_AUDITON = 446 // { int auditon(int cmd, void *data, \ + SYS_GETAUID = 447 // { int getauid(uid_t *auid); } + SYS_SETAUID = 448 // { int setauid(uid_t *auid); } + SYS_GETAUDIT = 449 // { int getaudit(struct auditinfo *auditinfo); } + SYS_SETAUDIT = 450 // { int setaudit(struct auditinfo *auditinfo); } + SYS_GETAUDIT_ADDR = 451 // { int getaudit_addr( \ + SYS_SETAUDIT_ADDR = 452 // { int setaudit_addr( \ + SYS_AUDITCTL = 453 // { int auditctl(char *path); } + SYS__UMTX_OP = 454 // { int _umtx_op(void *obj, int op, \ + SYS_THR_NEW = 455 // { int thr_new(struct thr_param *param, \ + SYS_SIGQUEUE = 456 // { int sigqueue(pid_t pid, int signum, void *value); } + SYS_KMQ_OPEN = 457 // { int kmq_open(const char *path, int flags, \ + SYS_KMQ_SETATTR = 458 // { int kmq_setattr(int mqd, \ + SYS_KMQ_TIMEDRECEIVE = 459 // { int kmq_timedreceive(int mqd, \ + SYS_KMQ_TIMEDSEND = 460 // { int kmq_timedsend(int mqd, \ + SYS_KMQ_NOTIFY = 461 // { int kmq_notify(int mqd, \ + SYS_KMQ_UNLINK = 462 // { int kmq_unlink(const char *path); } + SYS_ABORT2 = 463 // { int abort2(const char *why, int nargs, void **args); } + SYS_THR_SET_NAME = 464 // { int thr_set_name(long id, const char *name); } + SYS_AIO_FSYNC = 465 // { int aio_fsync(int op, struct aiocb *aiocbp); } + SYS_RTPRIO_THREAD = 466 // { int rtprio_thread(int function, \ + SYS_SCTP_PEELOFF = 471 // { int sctp_peeloff(int sd, uint32_t name); } + SYS_SCTP_GENERIC_SENDMSG = 472 // { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ + SYS_SCTP_GENERIC_SENDMSG_IOV = 473 // { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ + SYS_SCTP_GENERIC_RECVMSG = 474 // { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ + SYS_PREAD = 475 // { ssize_t pread(int fd, void *buf, \ + SYS_PWRITE = 476 // { ssize_t pwrite(int fd, const void *buf, \ + SYS_MMAP = 477 // { caddr_t mmap(caddr_t addr, size_t len, \ + SYS_LSEEK = 478 // { off_t lseek(int fd, off_t offset, \ + SYS_TRUNCATE = 479 // { int truncate(char *path, off_t length); } + SYS_FTRUNCATE = 480 // { int ftruncate(int fd, off_t length); } + SYS_THR_KILL2 = 481 // { int thr_kill2(pid_t pid, long id, int sig); } + SYS_SHM_OPEN = 482 // { int shm_open(const char *path, int flags, \ + SYS_SHM_UNLINK = 483 // { int shm_unlink(const char *path); } + SYS_CPUSET = 484 // { int cpuset(cpusetid_t *setid); } + SYS_CPUSET_SETID = 485 // { int cpuset_setid(cpuwhich_t which, id_t id, \ + SYS_CPUSET_GETID = 486 // { int cpuset_getid(cpulevel_t level, \ + SYS_CPUSET_GETAFFINITY = 487 // { int cpuset_getaffinity(cpulevel_t level, \ + SYS_CPUSET_SETAFFINITY = 488 // { int cpuset_setaffinity(cpulevel_t level, \ + SYS_FACCESSAT = 489 // { int faccessat(int fd, char *path, int amode, \ + SYS_FCHMODAT = 490 // { int fchmodat(int fd, char *path, mode_t mode, \ + SYS_FCHOWNAT = 491 // { int fchownat(int fd, char *path, uid_t uid, \ + SYS_FEXECVE = 492 // { int fexecve(int fd, char **argv, \ + SYS_FSTATAT = 493 // { int fstatat(int fd, char *path, \ + SYS_FUTIMESAT = 494 // { int futimesat(int fd, char *path, \ + SYS_LINKAT = 495 // { int linkat(int fd1, char *path1, int fd2, \ + SYS_MKDIRAT = 496 // { int mkdirat(int fd, char *path, mode_t mode); } + SYS_MKFIFOAT = 497 // { int mkfifoat(int fd, char *path, mode_t mode); } + SYS_MKNODAT = 498 // { int mknodat(int fd, char *path, mode_t mode, \ + SYS_OPENAT = 499 // { int openat(int fd, char *path, int flag, \ + SYS_READLINKAT = 500 // { int readlinkat(int fd, char *path, char *buf, \ + SYS_RENAMEAT = 501 // { int renameat(int oldfd, char *old, int newfd, \ + SYS_SYMLINKAT = 502 // { int symlinkat(char *path1, int fd, \ + SYS_UNLINKAT = 503 // { int unlinkat(int fd, char *path, int flag); } + SYS_POSIX_OPENPT = 504 // { int posix_openpt(int flags); } + SYS_GSSD_SYSCALL = 505 // { int gssd_syscall(char *path); } + SYS_JAIL_GET = 506 // { int jail_get(struct iovec *iovp, \ + SYS_JAIL_SET = 507 // { int jail_set(struct iovec *iovp, \ + SYS_JAIL_REMOVE = 508 // { int jail_remove(int jid); } + SYS_CLOSEFROM = 509 // { int closefrom(int lowfd); } + SYS___SEMCTL = 510 // { int __semctl(int semid, int semnum, \ + SYS_MSGCTL = 511 // { int msgctl(int msqid, int cmd, \ + SYS_SHMCTL = 512 // { int shmctl(int shmid, int cmd, \ + SYS_LPATHCONF = 513 // { int lpathconf(char *path, int name); } + SYS___CAP_RIGHTS_GET = 515 // { int __cap_rights_get(int version, \ + SYS_CAP_ENTER = 516 // { int cap_enter(void); } + SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); } + SYS_PDFORK = 518 // { int pdfork(int *fdp, int flags); } + SYS_PDKILL = 519 // { int pdkill(int fd, int signum); } + SYS_PDGETPID = 520 // { int pdgetpid(int fd, pid_t *pidp); } + SYS_PSELECT = 522 // { int pselect(int nd, fd_set *in, \ + SYS_GETLOGINCLASS = 523 // { int getloginclass(char *namebuf, \ + SYS_SETLOGINCLASS = 524 // { int setloginclass(const char *namebuf); } + SYS_RCTL_GET_RACCT = 525 // { int rctl_get_racct(const void *inbufp, \ + SYS_RCTL_GET_RULES = 526 // { int rctl_get_rules(const void *inbufp, \ + SYS_RCTL_GET_LIMITS = 527 // { int rctl_get_limits(const void *inbufp, \ + SYS_RCTL_ADD_RULE = 528 // { int rctl_add_rule(const void *inbufp, \ + SYS_RCTL_REMOVE_RULE = 529 // { int rctl_remove_rule(const void *inbufp, \ + SYS_POSIX_FALLOCATE = 530 // { int posix_fallocate(int fd, \ + SYS_POSIX_FADVISE = 531 // { int posix_fadvise(int fd, off_t offset, \ + SYS_WAIT6 = 532 // { int wait6(idtype_t idtype, id_t id, \ + SYS_CAP_RIGHTS_LIMIT = 533 // { int cap_rights_limit(int fd, \ + SYS_CAP_IOCTLS_LIMIT = 534 // { int cap_ioctls_limit(int fd, \ + SYS_CAP_IOCTLS_GET = 535 // { ssize_t cap_ioctls_get(int fd, \ + SYS_CAP_FCNTLS_LIMIT = 536 // { int cap_fcntls_limit(int fd, \ + SYS_CAP_FCNTLS_GET = 537 // { int cap_fcntls_get(int fd, \ + SYS_BINDAT = 538 // { int bindat(int fd, int s, caddr_t name, \ + SYS_CONNECTAT = 539 // { int connectat(int fd, int s, caddr_t name, \ + SYS_CHFLAGSAT = 540 // { int chflagsat(int fd, const char *path, \ + SYS_ACCEPT4 = 541 // { int accept4(int s, \ + SYS_PIPE2 = 542 // { int pipe2(int *fildes, int flags); } + SYS_AIO_MLOCK = 543 // { int aio_mlock(struct aiocb *aiocbp); } + SYS_PROCCTL = 544 // { int procctl(idtype_t idtype, id_t id, \ + SYS_PPOLL = 545 // { int ppoll(struct pollfd *fds, u_int nfds, \ + SYS_FUTIMENS = 546 // { int futimens(int fd, \ + SYS_UTIMENSAT = 547 // { int utimensat(int fd, \ + SYS_NUMA_GETAFFINITY = 548 // { int numa_getaffinity(cpuwhich_t which, \ + SYS_NUMA_SETAFFINITY = 549 // { int numa_setaffinity(cpuwhich_t which, \ + SYS_FDATASYNC = 550 // { int fdatasync(int fd); } +) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go index f0daa05a9cbf7..e66a8c9d39eae 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go @@ -1,5 +1,5 @@ -// mksysnum_netbsd.pl -// Code generated by the command above; DO NOT EDIT. +// go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master +// Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,netbsd diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go index ddb25b94f36d8..42c788f2490c2 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go @@ -1,5 +1,5 @@ -// mksysnum_netbsd.pl -// Code generated by the command above; DO NOT EDIT. +// go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master +// Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,netbsd diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go index 315bd63f89041..0a0757179ba41 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go @@ -1,5 +1,5 @@ -// mksysnum_netbsd.pl -// Code generated by the command above; DO NOT EDIT. +// go run mksysnum.go http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master +// Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,netbsd diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go index f93f391d26be6..d5bf3c449930a 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go @@ -1,4 +1,4 @@ -// mksysnum_openbsd.pl +// go run mksysnum.go http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build 386,openbsd @@ -9,35 +9,35 @@ const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } - SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, \ - SYS_OPEN = 5 // { int sys_open(const char *path, \ + SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } + SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } - SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, \ + SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } - SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, \ + SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } - SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, \ + SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } - SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, \ + SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } - SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, \ + SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } - SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, \ + SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } - SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \ - SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, \ - SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \ - SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, \ - SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, \ - SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, \ + SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } + SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } + SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } + SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } + SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } + SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } + SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } @@ -46,81 +46,81 @@ const ( SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } - SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, \ + SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } - SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, \ - SYS_SIGACTION = 46 // { int sys_sigaction(int signum, \ + SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } + SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } + SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } - SYS_IOCTL = 54 // { int sys_ioctl(int fd, \ + SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } - SYS_SYMLINK = 57 // { int sys_symlink(const char *path, \ - SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, \ - SYS_EXECVE = 59 // { int sys_execve(const char *path, \ + SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } + SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } + SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } - SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \ - SYS_STATFS = 63 // { int sys_statfs(const char *path, \ + SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } + SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, \ + SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } - SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, \ - SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, \ - SYS_SETITIMER = 69 // { int sys_setitimer(int which, \ - SYS_GETITIMER = 70 // { int sys_getitimer(int which, \ - SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, \ - SYS_KEVENT = 72 // { int sys_kevent(int fd, \ + SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } + SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } + SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } + SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } + SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } + SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, \ - SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, \ - SYS_UTIMES = 76 // { int sys_utimes(const char *path, \ - SYS_FUTIMES = 77 // { int sys_futimes(int fd, \ - SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, \ - SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, \ + SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } + SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } + SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } + SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } + SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, char *vec); } + SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } + SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } - SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, \ - SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, \ - SYS_FUTIMENS = 85 // { int sys_futimens(int fd, \ - SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, \ - SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, \ - SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, \ + SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } + SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } + SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } + SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } + SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } - SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, \ + SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } - SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, \ - SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, \ + SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } + SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } - SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, \ + SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } - SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, \ - SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, \ + SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } + SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } - SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, \ - SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, \ - SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, \ - SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \ + SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } + SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } + SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } + SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } - SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, \ - SYS_UNVEIL = 114 // { int sys_unveil(const char *path, \ - SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \ + SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } + SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } + SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } - SYS_READV = 120 // { ssize_t sys_readv(int fd, \ - SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \ + SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } + SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } @@ -129,90 +129,90 @@ const ( SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } - SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, \ + SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, \ + SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } - SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, \ + SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } - SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, \ + SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } - SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, \ - SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \ + SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } + SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } - SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, \ - SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, \ - SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \ - SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \ - SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, \ + SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } + SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } + SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } + SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } + SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } - SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, \ + SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } - SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, \ + SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \ - SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \ - SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \ + SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } - SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, \ - SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, \ + SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } + SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } - SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, \ - SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, \ + SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } + SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } - SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \ - SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \ - SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \ - SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \ - SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \ + SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } + SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } + SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } + SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } + SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } - SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \ + SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } - SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, \ - SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, \ - SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, \ - SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, \ - SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, \ + SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } + SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } + SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } + SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } + SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } - SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, \ + SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } - SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \ + SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } - SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, \ + SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } - SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, \ - SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, \ - SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, \ - SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \ - SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, \ - SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, \ - SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, \ - SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, \ - SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \ - SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, \ - SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, \ - SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, \ + SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } + SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } + SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } + SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } + SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } + SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } + SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } + SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } + SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } + SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } + SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } + SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go index bc7fa57956a95..cbcfdfb3367a9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go @@ -1,4 +1,4 @@ -// mksysnum_openbsd.pl +// go run mksysnum.go http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build amd64,openbsd @@ -9,35 +9,35 @@ const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } - SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, \ - SYS_OPEN = 5 // { int sys_open(const char *path, \ + SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } + SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } - SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, \ + SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } - SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, \ + SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } - SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, \ + SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } - SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, \ + SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } - SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, \ + SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } - SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, \ + SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } - SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \ - SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, \ - SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \ - SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, \ - SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, \ - SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, \ + SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } + SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } + SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } + SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } + SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } + SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } + SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } @@ -46,81 +46,81 @@ const ( SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } - SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, \ + SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } - SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, \ - SYS_SIGACTION = 46 // { int sys_sigaction(int signum, \ + SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } + SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } + SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } - SYS_IOCTL = 54 // { int sys_ioctl(int fd, \ + SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } - SYS_SYMLINK = 57 // { int sys_symlink(const char *path, \ - SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, \ - SYS_EXECVE = 59 // { int sys_execve(const char *path, \ + SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } + SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } + SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } - SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \ - SYS_STATFS = 63 // { int sys_statfs(const char *path, \ + SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } + SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, \ + SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } - SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, \ - SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, \ - SYS_SETITIMER = 69 // { int sys_setitimer(int which, \ - SYS_GETITIMER = 70 // { int sys_getitimer(int which, \ - SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, \ - SYS_KEVENT = 72 // { int sys_kevent(int fd, \ + SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } + SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } + SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } + SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } + SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } + SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, \ - SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, \ - SYS_UTIMES = 76 // { int sys_utimes(const char *path, \ - SYS_FUTIMES = 77 // { int sys_futimes(int fd, \ - SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, \ - SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, \ + SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } + SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } + SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } + SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } + SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, char *vec); } + SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } + SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } - SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, \ - SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, \ - SYS_FUTIMENS = 85 // { int sys_futimens(int fd, \ - SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, \ - SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, \ - SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, \ + SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } + SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } + SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } + SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } + SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } - SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, \ + SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } - SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, \ - SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, \ + SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } + SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } - SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, \ + SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } - SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, \ - SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, \ + SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } + SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } - SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, \ - SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, \ - SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, \ - SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \ + SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } + SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } + SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } + SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } - SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, \ - SYS_UNVEIL = 114 // { int sys_unveil(const char *path, \ - SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \ + SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } + SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } + SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } - SYS_READV = 120 // { ssize_t sys_readv(int fd, \ - SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \ + SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } + SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } @@ -129,90 +129,90 @@ const ( SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } - SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, \ + SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, \ + SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } - SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, \ + SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } - SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, \ + SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } - SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, \ - SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \ + SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } + SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } - SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, \ - SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, \ - SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \ - SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \ - SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, \ + SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } + SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } + SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } + SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } + SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } - SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, \ + SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } - SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, \ + SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \ - SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \ - SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \ + SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } - SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, \ - SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, \ + SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } + SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } - SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, \ - SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, \ + SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } + SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } - SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \ - SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \ - SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \ - SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \ - SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \ + SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } + SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } + SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } + SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } + SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } - SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \ + SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } - SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, \ - SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, \ - SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, \ - SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, \ - SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, \ + SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } + SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } + SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } + SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } + SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } - SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, \ + SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } - SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \ + SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } - SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, \ + SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } - SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, \ - SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, \ - SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, \ - SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \ - SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, \ - SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, \ - SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, \ - SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, \ - SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \ - SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, \ - SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, \ - SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, \ + SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } + SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } + SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } + SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } + SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } + SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } + SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } + SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } + SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } + SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } + SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } + SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go index be1198d91633c..a84cead963dc6 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go @@ -1,4 +1,4 @@ -// mksysnum_openbsd.pl +// go run mksysnum.go http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm,openbsd @@ -9,35 +9,35 @@ const ( SYS_EXIT = 1 // { void sys_exit(int rval); } SYS_FORK = 2 // { int sys_fork(void); } SYS_READ = 3 // { ssize_t sys_read(int fd, void *buf, size_t nbyte); } - SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, \ - SYS_OPEN = 5 // { int sys_open(const char *path, \ + SYS_WRITE = 4 // { ssize_t sys_write(int fd, const void *buf, size_t nbyte); } + SYS_OPEN = 5 // { int sys_open(const char *path, int flags, ... mode_t mode); } SYS_CLOSE = 6 // { int sys_close(int fd); } SYS_GETENTROPY = 7 // { int sys_getentropy(void *buf, size_t nbyte); } - SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, \ + SYS___TFORK = 8 // { int sys___tfork(const struct __tfork *param, size_t psize); } SYS_LINK = 9 // { int sys_link(const char *path, const char *link); } SYS_UNLINK = 10 // { int sys_unlink(const char *path); } - SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, \ + SYS_WAIT4 = 11 // { pid_t sys_wait4(pid_t pid, int *status, int options, struct rusage *rusage); } SYS_CHDIR = 12 // { int sys_chdir(const char *path); } SYS_FCHDIR = 13 // { int sys_fchdir(int fd); } - SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, \ + SYS_MKNOD = 14 // { int sys_mknod(const char *path, mode_t mode, dev_t dev); } SYS_CHMOD = 15 // { int sys_chmod(const char *path, mode_t mode); } - SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, \ + SYS_CHOWN = 16 // { int sys_chown(const char *path, uid_t uid, gid_t gid); } SYS_OBREAK = 17 // { int sys_obreak(char *nsize); } break SYS_GETDTABLECOUNT = 18 // { int sys_getdtablecount(void); } - SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, \ + SYS_GETRUSAGE = 19 // { int sys_getrusage(int who, struct rusage *rusage); } SYS_GETPID = 20 // { pid_t sys_getpid(void); } - SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, \ + SYS_MOUNT = 21 // { int sys_mount(const char *type, const char *path, int flags, void *data); } SYS_UNMOUNT = 22 // { int sys_unmount(const char *path, int flags); } SYS_SETUID = 23 // { int sys_setuid(uid_t uid); } SYS_GETUID = 24 // { uid_t sys_getuid(void); } SYS_GETEUID = 25 // { uid_t sys_geteuid(void); } - SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \ - SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \ - SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, \ - SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \ - SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, \ - SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, \ - SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, \ + SYS_PTRACE = 26 // { int sys_ptrace(int req, pid_t pid, caddr_t addr, int data); } + SYS_RECVMSG = 27 // { ssize_t sys_recvmsg(int s, struct msghdr *msg, int flags); } + SYS_SENDMSG = 28 // { ssize_t sys_sendmsg(int s, const struct msghdr *msg, int flags); } + SYS_RECVFROM = 29 // { ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlenaddr); } + SYS_ACCEPT = 30 // { int sys_accept(int s, struct sockaddr *name, socklen_t *anamelen); } + SYS_GETPEERNAME = 31 // { int sys_getpeername(int fdes, struct sockaddr *asa, socklen_t *alen); } + SYS_GETSOCKNAME = 32 // { int sys_getsockname(int fdes, struct sockaddr *asa, socklen_t *alen); } SYS_ACCESS = 33 // { int sys_access(const char *path, int amode); } SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); } SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); } @@ -46,81 +46,81 @@ const ( SYS_GETPPID = 39 // { pid_t sys_getppid(void); } SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); } SYS_DUP = 41 // { int sys_dup(int fd); } - SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, \ + SYS_FSTATAT = 42 // { int sys_fstatat(int fd, const char *path, struct stat *buf, int flag); } SYS_GETEGID = 43 // { gid_t sys_getegid(void); } - SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, \ - SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, \ - SYS_SIGACTION = 46 // { int sys_sigaction(int signum, \ + SYS_PROFIL = 44 // { int sys_profil(caddr_t samples, size_t size, u_long offset, u_int scale); } + SYS_KTRACE = 45 // { int sys_ktrace(const char *fname, int ops, int facs, pid_t pid); } + SYS_SIGACTION = 46 // { int sys_sigaction(int signum, const struct sigaction *nsa, struct sigaction *osa); } SYS_GETGID = 47 // { gid_t sys_getgid(void); } SYS_SIGPROCMASK = 48 // { int sys_sigprocmask(int how, sigset_t mask); } SYS_SETLOGIN = 50 // { int sys_setlogin(const char *namebuf); } SYS_ACCT = 51 // { int sys_acct(const char *path); } SYS_SIGPENDING = 52 // { int sys_sigpending(void); } SYS_FSTAT = 53 // { int sys_fstat(int fd, struct stat *sb); } - SYS_IOCTL = 54 // { int sys_ioctl(int fd, \ + SYS_IOCTL = 54 // { int sys_ioctl(int fd, u_long com, ... void *data); } SYS_REBOOT = 55 // { int sys_reboot(int opt); } SYS_REVOKE = 56 // { int sys_revoke(const char *path); } - SYS_SYMLINK = 57 // { int sys_symlink(const char *path, \ - SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, \ - SYS_EXECVE = 59 // { int sys_execve(const char *path, \ + SYS_SYMLINK = 57 // { int sys_symlink(const char *path, const char *link); } + SYS_READLINK = 58 // { ssize_t sys_readlink(const char *path, char *buf, size_t count); } + SYS_EXECVE = 59 // { int sys_execve(const char *path, char * const *argp, char * const *envp); } SYS_UMASK = 60 // { mode_t sys_umask(mode_t newmask); } SYS_CHROOT = 61 // { int sys_chroot(const char *path); } - SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \ - SYS_STATFS = 63 // { int sys_statfs(const char *path, \ + SYS_GETFSSTAT = 62 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, int flags); } + SYS_STATFS = 63 // { int sys_statfs(const char *path, struct statfs *buf); } SYS_FSTATFS = 64 // { int sys_fstatfs(int fd, struct statfs *buf); } - SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, \ + SYS_FHSTATFS = 65 // { int sys_fhstatfs(const fhandle_t *fhp, struct statfs *buf); } SYS_VFORK = 66 // { int sys_vfork(void); } - SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, \ - SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, \ - SYS_SETITIMER = 69 // { int sys_setitimer(int which, \ - SYS_GETITIMER = 70 // { int sys_getitimer(int which, \ - SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, \ - SYS_KEVENT = 72 // { int sys_kevent(int fd, \ + SYS_GETTIMEOFDAY = 67 // { int sys_gettimeofday(struct timeval *tp, struct timezone *tzp); } + SYS_SETTIMEOFDAY = 68 // { int sys_settimeofday(const struct timeval *tv, const struct timezone *tzp); } + SYS_SETITIMER = 69 // { int sys_setitimer(int which, const struct itimerval *itv, struct itimerval *oitv); } + SYS_GETITIMER = 70 // { int sys_getitimer(int which, struct itimerval *itv); } + SYS_SELECT = 71 // { int sys_select(int nd, fd_set *in, fd_set *ou, fd_set *ex, struct timeval *tv); } + SYS_KEVENT = 72 // { int sys_kevent(int fd, const struct kevent *changelist, int nchanges, struct kevent *eventlist, int nevents, const struct timespec *timeout); } SYS_MUNMAP = 73 // { int sys_munmap(void *addr, size_t len); } - SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, \ - SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, \ - SYS_UTIMES = 76 // { int sys_utimes(const char *path, \ - SYS_FUTIMES = 77 // { int sys_futimes(int fd, \ - SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, \ - SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, \ - SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, \ + SYS_MPROTECT = 74 // { int sys_mprotect(void *addr, size_t len, int prot); } + SYS_MADVISE = 75 // { int sys_madvise(void *addr, size_t len, int behav); } + SYS_UTIMES = 76 // { int sys_utimes(const char *path, const struct timeval *tptr); } + SYS_FUTIMES = 77 // { int sys_futimes(int fd, const struct timeval *tptr); } + SYS_MINCORE = 78 // { int sys_mincore(void *addr, size_t len, char *vec); } + SYS_GETGROUPS = 79 // { int sys_getgroups(int gidsetsize, gid_t *gidset); } + SYS_SETGROUPS = 80 // { int sys_setgroups(int gidsetsize, const gid_t *gidset); } SYS_GETPGRP = 81 // { int sys_getpgrp(void); } SYS_SETPGID = 82 // { int sys_setpgid(pid_t pid, pid_t pgid); } - SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, \ - SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, \ - SYS_FUTIMENS = 85 // { int sys_futimens(int fd, \ - SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, \ - SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, \ - SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, \ - SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, \ + SYS_FUTEX = 83 // { int sys_futex(uint32_t *f, int op, int val, const struct timespec *timeout, uint32_t *g); } + SYS_UTIMENSAT = 84 // { int sys_utimensat(int fd, const char *path, const struct timespec *times, int flag); } + SYS_FUTIMENS = 85 // { int sys_futimens(int fd, const struct timespec *times); } + SYS_KBIND = 86 // { int sys_kbind(const struct __kbind *param, size_t psize, int64_t proc_cookie); } + SYS_CLOCK_GETTIME = 87 // { int sys_clock_gettime(clockid_t clock_id, struct timespec *tp); } + SYS_CLOCK_SETTIME = 88 // { int sys_clock_settime(clockid_t clock_id, const struct timespec *tp); } + SYS_CLOCK_GETRES = 89 // { int sys_clock_getres(clockid_t clock_id, struct timespec *tp); } SYS_DUP2 = 90 // { int sys_dup2(int from, int to); } - SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, \ + SYS_NANOSLEEP = 91 // { int sys_nanosleep(const struct timespec *rqtp, struct timespec *rmtp); } SYS_FCNTL = 92 // { int sys_fcntl(int fd, int cmd, ... void *arg); } - SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, \ - SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, \ + SYS_ACCEPT4 = 93 // { int sys_accept4(int s, struct sockaddr *name, socklen_t *anamelen, int flags); } + SYS___THRSLEEP = 94 // { int sys___thrsleep(const volatile void *ident, clockid_t clock_id, const struct timespec *tp, void *lock, const int *abort); } SYS_FSYNC = 95 // { int sys_fsync(int fd); } SYS_SETPRIORITY = 96 // { int sys_setpriority(int which, id_t who, int prio); } SYS_SOCKET = 97 // { int sys_socket(int domain, int type, int protocol); } - SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, \ + SYS_CONNECT = 98 // { int sys_connect(int s, const struct sockaddr *name, socklen_t namelen); } SYS_GETDENTS = 99 // { int sys_getdents(int fd, void *buf, size_t buflen); } SYS_GETPRIORITY = 100 // { int sys_getpriority(int which, id_t who); } SYS_PIPE2 = 101 // { int sys_pipe2(int *fdp, int flags); } SYS_DUP3 = 102 // { int sys_dup3(int from, int to, int flags); } SYS_SIGRETURN = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); } - SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, \ - SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, \ + SYS_BIND = 104 // { int sys_bind(int s, const struct sockaddr *name, socklen_t namelen); } + SYS_SETSOCKOPT = 105 // { int sys_setsockopt(int s, int level, int name, const void *val, socklen_t valsize); } SYS_LISTEN = 106 // { int sys_listen(int s, int backlog); } - SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, \ - SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, \ - SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, \ - SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, \ + SYS_CHFLAGSAT = 107 // { int sys_chflagsat(int fd, const char *path, u_int flags, int atflags); } + SYS_PLEDGE = 108 // { int sys_pledge(const char *promises, const char *execpromises); } + SYS_PPOLL = 109 // { int sys_ppoll(struct pollfd *fds, u_int nfds, const struct timespec *ts, const sigset_t *mask); } + SYS_PSELECT = 110 // { int sys_pselect(int nd, fd_set *in, fd_set *ou, fd_set *ex, const struct timespec *ts, const sigset_t *mask); } SYS_SIGSUSPEND = 111 // { int sys_sigsuspend(int mask); } - SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, \ - SYS_UNVEIL = 114 // { int sys_unveil(const char *path, \ - SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \ + SYS_SENDSYSLOG = 112 // { int sys_sendsyslog(const char *buf, size_t nbyte, int flags); } + SYS_UNVEIL = 114 // { int sys_unveil(const char *path, const char *permissions); } + SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, void *val, socklen_t *avalsize); } SYS_THRKILL = 119 // { int sys_thrkill(pid_t tid, int signum, void *tcb); } - SYS_READV = 120 // { ssize_t sys_readv(int fd, \ - SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \ + SYS_READV = 120 // { ssize_t sys_readv(int fd, const struct iovec *iovp, int iovcnt); } + SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, const struct iovec *iovp, int iovcnt); } SYS_KILL = 122 // { int sys_kill(int pid, int signum); } SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); } SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); } @@ -129,90 +129,90 @@ const ( SYS_RENAME = 128 // { int sys_rename(const char *from, const char *to); } SYS_FLOCK = 131 // { int sys_flock(int fd, int how); } SYS_MKFIFO = 132 // { int sys_mkfifo(const char *path, mode_t mode); } - SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, \ + SYS_SENDTO = 133 // { ssize_t sys_sendto(int s, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen); } SYS_SHUTDOWN = 134 // { int sys_shutdown(int s, int how); } - SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, \ + SYS_SOCKETPAIR = 135 // { int sys_socketpair(int domain, int type, int protocol, int *rsv); } SYS_MKDIR = 136 // { int sys_mkdir(const char *path, mode_t mode); } SYS_RMDIR = 137 // { int sys_rmdir(const char *path); } - SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, \ + SYS_ADJTIME = 140 // { int sys_adjtime(const struct timeval *delta, struct timeval *olddelta); } SYS_GETLOGIN_R = 141 // { int sys_getlogin_r(char *namebuf, u_int namelen); } SYS_SETSID = 147 // { int sys_setsid(void); } - SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, \ + SYS_QUOTACTL = 148 // { int sys_quotactl(const char *path, int cmd, int uid, char *arg); } SYS_NFSSVC = 155 // { int sys_nfssvc(int flag, void *argp); } SYS_GETFH = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); } SYS_SYSARCH = 165 // { int sys_sysarch(int op, void *parms); } - SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, \ - SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \ + SYS_PREAD = 173 // { ssize_t sys_pread(int fd, void *buf, size_t nbyte, int pad, off_t offset); } + SYS_PWRITE = 174 // { ssize_t sys_pwrite(int fd, const void *buf, size_t nbyte, int pad, off_t offset); } SYS_SETGID = 181 // { int sys_setgid(gid_t gid); } SYS_SETEGID = 182 // { int sys_setegid(gid_t egid); } SYS_SETEUID = 183 // { int sys_seteuid(uid_t euid); } SYS_PATHCONF = 191 // { long sys_pathconf(const char *path, int name); } SYS_FPATHCONF = 192 // { long sys_fpathconf(int fd, int name); } SYS_SWAPCTL = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); } - SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, \ - SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, \ - SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \ - SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \ - SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, \ + SYS_GETRLIMIT = 194 // { int sys_getrlimit(int which, struct rlimit *rlp); } + SYS_SETRLIMIT = 195 // { int sys_setrlimit(int which, const struct rlimit *rlp); } + SYS_MMAP = 197 // { void *sys_mmap(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } + SYS_LSEEK = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, int whence); } + SYS_TRUNCATE = 200 // { int sys_truncate(const char *path, int pad, off_t length); } SYS_FTRUNCATE = 201 // { int sys_ftruncate(int fd, int pad, off_t length); } - SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, \ + SYS_SYSCTL = 202 // { int sys_sysctl(const int *name, u_int namelen, void *old, size_t *oldlenp, void *new, size_t newlen); } SYS_MLOCK = 203 // { int sys_mlock(const void *addr, size_t len); } SYS_MUNLOCK = 204 // { int sys_munlock(const void *addr, size_t len); } SYS_GETPGID = 207 // { pid_t sys_getpgid(pid_t pid); } - SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, \ + SYS_UTRACE = 209 // { int sys_utrace(const char *label, const void *addr, size_t len); } SYS_SEMGET = 221 // { int sys_semget(key_t key, int nsems, int semflg); } SYS_MSGGET = 225 // { int sys_msgget(key_t key, int msgflg); } - SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \ - SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \ - SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \ + SYS_MSGSND = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); } + SYS_MSGRCV = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg); } + SYS_SHMAT = 228 // { void *sys_shmat(int shmid, const void *shmaddr, int shmflg); } SYS_SHMDT = 230 // { int sys_shmdt(const void *shmaddr); } - SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, \ - SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, \ + SYS_MINHERIT = 250 // { int sys_minherit(void *addr, size_t len, int inherit); } + SYS_POLL = 252 // { int sys_poll(struct pollfd *fds, u_int nfds, int timeout); } SYS_ISSETUGID = 253 // { int sys_issetugid(void); } SYS_LCHOWN = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); } SYS_GETSID = 255 // { pid_t sys_getsid(pid_t pid); } SYS_MSYNC = 256 // { int sys_msync(void *addr, size_t len, int flags); } SYS_PIPE = 263 // { int sys_pipe(int *fdp); } SYS_FHOPEN = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); } - SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, \ - SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, \ + SYS_PREADV = 267 // { ssize_t sys_preadv(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } + SYS_PWRITEV = 268 // { ssize_t sys_pwritev(int fd, const struct iovec *iovp, int iovcnt, int pad, off_t offset); } SYS_KQUEUE = 269 // { int sys_kqueue(void); } SYS_MLOCKALL = 271 // { int sys_mlockall(int flags); } SYS_MUNLOCKALL = 272 // { int sys_munlockall(void); } - SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \ - SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \ - SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \ - SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \ - SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \ + SYS_GETRESUID = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); } + SYS_SETRESUID = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, uid_t suid); } + SYS_GETRESGID = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); } + SYS_SETRESGID = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, gid_t sgid); } + SYS_MQUERY = 286 // { void *sys_mquery(void *addr, size_t len, int prot, int flags, int fd, long pad, off_t pos); } SYS_CLOSEFROM = 287 // { int sys_closefrom(int fd); } - SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \ + SYS_SIGALTSTACK = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, struct sigaltstack *oss); } SYS_SHMGET = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); } - SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, \ - SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, \ - SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, \ - SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, \ - SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, \ + SYS_SEMOP = 290 // { int sys_semop(int semid, struct sembuf *sops, size_t nsops); } + SYS_FHSTAT = 294 // { int sys_fhstat(const fhandle_t *fhp, struct stat *sb); } + SYS___SEMCTL = 295 // { int sys___semctl(int semid, int semnum, int cmd, union semun *arg); } + SYS_SHMCTL = 296 // { int sys_shmctl(int shmid, int cmd, struct shmid_ds *buf); } + SYS_MSGCTL = 297 // { int sys_msgctl(int msqid, int cmd, struct msqid_ds *buf); } SYS_SCHED_YIELD = 298 // { int sys_sched_yield(void); } SYS_GETTHRID = 299 // { pid_t sys_getthrid(void); } - SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, \ + SYS___THRWAKEUP = 301 // { int sys___thrwakeup(const volatile void *ident, int n); } SYS___THREXIT = 302 // { void sys___threxit(pid_t *notdead); } - SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \ + SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, siginfo_t *info, const struct timespec *timeout); } SYS___GETCWD = 304 // { int sys___getcwd(char *buf, size_t len); } - SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, \ + SYS_ADJFREQ = 305 // { int sys_adjfreq(const int64_t *freq, int64_t *oldfreq); } SYS_SETRTABLE = 310 // { int sys_setrtable(int rtableid); } SYS_GETRTABLE = 311 // { int sys_getrtable(void); } - SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, \ - SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, \ - SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, \ - SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \ - SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, \ - SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, \ - SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, \ - SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, \ - SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \ - SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, \ - SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, \ - SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, \ + SYS_FACCESSAT = 313 // { int sys_faccessat(int fd, const char *path, int amode, int flag); } + SYS_FCHMODAT = 314 // { int sys_fchmodat(int fd, const char *path, mode_t mode, int flag); } + SYS_FCHOWNAT = 315 // { int sys_fchownat(int fd, const char *path, uid_t uid, gid_t gid, int flag); } + SYS_LINKAT = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, const char *path2, int flag); } + SYS_MKDIRAT = 318 // { int sys_mkdirat(int fd, const char *path, mode_t mode); } + SYS_MKFIFOAT = 319 // { int sys_mkfifoat(int fd, const char *path, mode_t mode); } + SYS_MKNODAT = 320 // { int sys_mknodat(int fd, const char *path, mode_t mode, dev_t dev); } + SYS_OPENAT = 321 // { int sys_openat(int fd, const char *path, int flags, ... mode_t mode); } + SYS_READLINKAT = 322 // { ssize_t sys_readlinkat(int fd, const char *path, char *buf, size_t count); } + SYS_RENAMEAT = 323 // { int sys_renameat(int fromfd, const char *from, int tofd, const char *to); } + SYS_SYMLINKAT = 324 // { int sys_symlinkat(const char *path, int fd, const char *link); } + SYS_UNLINKAT = 325 // { int sys_unlinkat(int fd, const char *path, int flag); } SYS___SET_TCB = 329 // { void sys___set_tcb(void *tcb); } SYS___GET_TCB = 330 // { void *sys___get_tcb(void); } ) diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go new file mode 100644 index 0000000000000..2aadc1a4d8ffd --- /dev/null +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -0,0 +1,602 @@ +// cgo -godefs types_freebsd.go | go run mkpost.go +// Code generated by the command above; see README.md. DO NOT EDIT. + +// +build arm64,freebsd + +package unix + +const ( + SizeofPtr = 0x8 + SizeofShort = 0x2 + SizeofInt = 0x4 + SizeofLong = 0x8 + SizeofLongLong = 0x8 +) + +type ( + _C_short int16 + _C_int int32 + _C_long int64 + _C_long_long int64 +) + +type Timespec struct { + Sec int64 + Nsec int64 +} + +type Timeval struct { + Sec int64 + Usec int64 +} + +type Rusage struct { + Utime Timeval + Stime Timeval + Maxrss int64 + Ixrss int64 + Idrss int64 + Isrss int64 + Minflt int64 + Majflt int64 + Nswap int64 + Inblock int64 + Oublock int64 + Msgsnd int64 + Msgrcv int64 + Nsignals int64 + Nvcsw int64 + Nivcsw int64 +} + +type Rlimit struct { + Cur int64 + Max int64 +} + +type _Gid_t uint32 + +const ( + _statfsVersion = 0x20140518 + _dirblksiz = 0x400 +) + +type Stat_t struct { + Dev uint64 + Ino uint64 + Nlink uint64 + Mode uint16 + _0 int16 + Uid uint32 + Gid uint32 + _1 int32 + Rdev uint64 + Atim Timespec + Mtim Timespec + Ctim Timespec + Birthtim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint64 + Spare [10]uint64 +} + +type stat_freebsd11_t struct { + Dev uint32 + Ino uint32 + Mode uint16 + Nlink uint16 + Uid uint32 + Gid uint32 + Rdev uint32 + Atim Timespec + Mtim Timespec + Ctim Timespec + Size int64 + Blocks int64 + Blksize int32 + Flags uint32 + Gen uint32 + Lspare int32 + Birthtim Timespec +} + +type Statfs_t struct { + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]int8 + Fstypename [16]int8 + Mntfromname [1024]int8 + Mntonname [1024]int8 +} + +type statfs_freebsd11_t struct { + Version uint32 + Type uint32 + Flags uint64 + Bsize uint64 + Iosize uint64 + Blocks uint64 + Bfree uint64 + Bavail int64 + Files uint64 + Ffree int64 + Syncwrites uint64 + Asyncwrites uint64 + Syncreads uint64 + Asyncreads uint64 + Spare [10]uint64 + Namemax uint32 + Owner uint32 + Fsid Fsid + Charspare [80]int8 + Fstypename [16]int8 + Mntfromname [88]int8 + Mntonname [88]int8 +} + +type Flock_t struct { + Start int64 + Len int64 + Pid int32 + Type int16 + Whence int16 + Sysid int32 + _ [4]byte +} + +type Dirent struct { + Fileno uint64 + Off int64 + Reclen uint16 + Type uint8 + Pad0 uint8 + Namlen uint16 + Pad1 uint16 + Name [256]int8 +} + +type dirent_freebsd11 struct { + Fileno uint32 + Reclen uint16 + Type uint8 + Namlen uint8 + Name [256]int8 +} + +type Fsid struct { + Val [2]int32 +} + +const ( + PathMax = 0x400 +) + +const ( + FADV_NORMAL = 0x0 + FADV_RANDOM = 0x1 + FADV_SEQUENTIAL = 0x2 + FADV_WILLNEED = 0x3 + FADV_DONTNEED = 0x4 + FADV_NOREUSE = 0x5 +) + +type RawSockaddrInet4 struct { + Len uint8 + Family uint8 + Port uint16 + Addr [4]byte /* in_addr */ + Zero [8]int8 +} + +type RawSockaddrInet6 struct { + Len uint8 + Family uint8 + Port uint16 + Flowinfo uint32 + Addr [16]byte /* in6_addr */ + Scope_id uint32 +} + +type RawSockaddrUnix struct { + Len uint8 + Family uint8 + Path [104]int8 +} + +type RawSockaddrDatalink struct { + Len uint8 + Family uint8 + Index uint16 + Type uint8 + Nlen uint8 + Alen uint8 + Slen uint8 + Data [46]int8 +} + +type RawSockaddr struct { + Len uint8 + Family uint8 + Data [14]int8 +} + +type RawSockaddrAny struct { + Addr RawSockaddr + Pad [92]int8 +} + +type _Socklen uint32 + +type Linger struct { + Onoff int32 + Linger int32 +} + +type Iovec struct { + Base *byte + Len uint64 +} + +type IPMreq struct { + Multiaddr [4]byte /* in_addr */ + Interface [4]byte /* in_addr */ +} + +type IPMreqn struct { + Multiaddr [4]byte /* in_addr */ + Address [4]byte /* in_addr */ + Ifindex int32 +} + +type IPv6Mreq struct { + Multiaddr [16]byte /* in6_addr */ + Interface uint32 +} + +type Msghdr struct { + Name *byte + Namelen uint32 + _ [4]byte + Iov *Iovec + Iovlen int32 + _ [4]byte + Control *byte + Controllen uint32 + Flags int32 +} + +type Cmsghdr struct { + Len uint32 + Level int32 + Type int32 +} + +type Inet6Pktinfo struct { + Addr [16]byte /* in6_addr */ + Ifindex uint32 +} + +type IPv6MTUInfo struct { + Addr RawSockaddrInet6 + Mtu uint32 +} + +type ICMPv6Filter struct { + Filt [8]uint32 +} + +const ( + SizeofSockaddrInet4 = 0x10 + SizeofSockaddrInet6 = 0x1c + SizeofSockaddrAny = 0x6c + SizeofSockaddrUnix = 0x6a + SizeofSockaddrDatalink = 0x36 + SizeofLinger = 0x8 + SizeofIPMreq = 0x8 + SizeofIPMreqn = 0xc + SizeofIPv6Mreq = 0x14 + SizeofMsghdr = 0x30 + SizeofCmsghdr = 0xc + SizeofInet6Pktinfo = 0x14 + SizeofIPv6MTUInfo = 0x20 + SizeofICMPv6Filter = 0x20 +) + +const ( + PTRACE_TRACEME = 0x0 + PTRACE_CONT = 0x7 + PTRACE_KILL = 0x8 +) + +type Kevent_t struct { + Ident uint64 + Filter int16 + Flags uint16 + Fflags uint32 + Data int64 + Udata *byte +} + +type FdSet struct { + Bits [16]uint64 +} + +const ( + sizeofIfMsghdr = 0xa8 + SizeofIfMsghdr = 0xa8 + sizeofIfData = 0x98 + SizeofIfData = 0x98 + SizeofIfaMsghdr = 0x14 + SizeofIfmaMsghdr = 0x10 + SizeofIfAnnounceMsghdr = 0x18 + SizeofRtMsghdr = 0x98 + SizeofRtMetrics = 0x70 +) + +type ifMsghdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data ifData +} + +type IfMsghdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Data IfData +} + +type ifData struct { + Type uint8 + Physical uint8 + Addrlen uint8 + Hdrlen uint8 + Link_state uint8 + Vhid uint8 + Datalen uint16 + Mtu uint32 + Metric uint32 + Baudrate uint64 + Ipackets uint64 + Ierrors uint64 + Opackets uint64 + Oerrors uint64 + Collisions uint64 + Ibytes uint64 + Obytes uint64 + Imcasts uint64 + Omcasts uint64 + Iqdrops uint64 + Oqdrops uint64 + Noproto uint64 + Hwassist uint64 + _ [8]byte + _ [16]byte +} + +type IfData struct { + Type uint8 + Physical uint8 + Addrlen uint8 + Hdrlen uint8 + Link_state uint8 + Spare_char1 uint8 + Spare_char2 uint8 + Datalen uint8 + Mtu uint64 + Metric uint64 + Baudrate uint64 + Ipackets uint64 + Ierrors uint64 + Opackets uint64 + Oerrors uint64 + Collisions uint64 + Ibytes uint64 + Obytes uint64 + Imcasts uint64 + Omcasts uint64 + Iqdrops uint64 + Noproto uint64 + Hwassist uint64 + Epoch int64 + Lastchange Timeval +} + +type IfaMsghdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte + Metric int32 +} + +type IfmaMsghdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Addrs int32 + Flags int32 + Index uint16 + _ [2]byte +} + +type IfAnnounceMsghdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Index uint16 + Name [16]int8 + What uint16 +} + +type RtMsghdr struct { + Msglen uint16 + Version uint8 + Type uint8 + Index uint16 + _ [2]byte + Flags int32 + Addrs int32 + Pid int32 + Seq int32 + Errno int32 + Fmask int32 + Inits uint64 + Rmx RtMetrics +} + +type RtMetrics struct { + Locks uint64 + Mtu uint64 + Hopcount uint64 + Expire uint64 + Recvpipe uint64 + Sendpipe uint64 + Ssthresh uint64 + Rtt uint64 + Rttvar uint64 + Pksent uint64 + Weight uint64 + Filler [3]uint64 +} + +const ( + SizeofBpfVersion = 0x4 + SizeofBpfStat = 0x8 + SizeofBpfZbuf = 0x18 + SizeofBpfProgram = 0x10 + SizeofBpfInsn = 0x8 + SizeofBpfHdr = 0x20 + SizeofBpfZbufHeader = 0x20 +) + +type BpfVersion struct { + Major uint16 + Minor uint16 +} + +type BpfStat struct { + Recv uint32 + Drop uint32 +} + +type BpfZbuf struct { + Bufa *byte + Bufb *byte + Buflen uint64 +} + +type BpfProgram struct { + Len uint32 + _ [4]byte + Insns *BpfInsn +} + +type BpfInsn struct { + Code uint16 + Jt uint8 + Jf uint8 + K uint32 +} + +type BpfHdr struct { + Tstamp Timeval + Caplen uint32 + Datalen uint32 + Hdrlen uint16 + _ [6]byte +} + +type BpfZbufHeader struct { + Kernel_gen uint32 + Kernel_len uint32 + User_gen uint32 + _ [5]uint32 +} + +type Termios struct { + Iflag uint32 + Oflag uint32 + Cflag uint32 + Lflag uint32 + Cc [20]uint8 + Ispeed uint32 + Ospeed uint32 +} + +type Winsize struct { + Row uint16 + Col uint16 + Xpixel uint16 + Ypixel uint16 +} + +const ( + AT_FDCWD = -0x64 + AT_REMOVEDIR = 0x800 + AT_SYMLINK_FOLLOW = 0x400 + AT_SYMLINK_NOFOLLOW = 0x200 +) + +type PollFd struct { + Fd int32 + Events int16 + Revents int16 +} + +const ( + POLLERR = 0x8 + POLLHUP = 0x10 + POLLIN = 0x1 + POLLINIGNEOF = 0x2000 + POLLNVAL = 0x20 + POLLOUT = 0x4 + POLLPRI = 0x2 + POLLRDBAND = 0x80 + POLLRDNORM = 0x40 + POLLWRBAND = 0x100 + POLLWRNORM = 0x4 +) + +type CapRights struct { + Rights [2]uint64 +} + +type Utsname struct { + Sysname [256]byte + Nodename [256]byte + Release [256]byte + Version [256]byte + Machine [256]byte +} diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index 8ee54ec329e8d..ebf10d48d364c 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -828,6 +828,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index dcfe391243554..99a6900d21156 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -839,6 +839,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 692f2966de318..5ccc4b5414a03 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -817,6 +817,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 54ff596c50baa..be375d9bb2e5d 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -818,6 +818,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 5dbe0c3186c16..195f7e1f85b35 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -822,6 +822,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 26766ee37afe2..77acf56985d68 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -820,6 +820,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 2d23ed17a3a03..2fb7498da65dc 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -820,6 +820,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index dac6168ebac6b..41cb14863c8cd 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -822,6 +822,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index d79111c36642c..8e6b5fa68e8de 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -828,6 +828,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index f58b691b4530d..019d2d6a9d94d 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -828,6 +828,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 2a493b5528c65..cf110ce2b34ef 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -845,6 +845,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index 4ff4097c216d9..abdc0863df2dd 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -841,6 +841,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index ec980c1ab6542..b0c9798d75af9 100644 --- a/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -823,6 +823,8 @@ type Taskstats struct { Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 + Thrashing_count uint64 + Thrashing_delay_total uint64 } const ( diff --git a/src/cmd/vendor/vendor.json b/src/cmd/vendor/vendor.json index 73ce409ad60e6..ef7255acd1940 100644 --- a/src/cmd/vendor/vendor.json +++ b/src/cmd/vendor/vendor.json @@ -104,6 +104,10 @@ "revision": "fc6590592b44fedfff586c5d94647c090fbd6bac", "revisionTime": "2018-05-24T22:59:00Z" }, + { + "path": "github.com/x/sys/unix", + "revision": "" + }, { "path": "golang.org/x/arch/arm/armasm", "revision": "5099b4b992f2813e39cfe2623c6f638718bd0fc6", @@ -131,10 +135,10 @@ "revisionTime": "2018-05-24T11:38:20Z" }, { - "checksumSHA1": "+vkAlXiYlfl8nFtxVtUiwoykPo8=", + "checksumSHA1": "VmY64lAjYXrfzg4lPNIXh9HqIg0=", "path": "golang.org/x/sys/unix", - "revision": "b4a75ba826a64a70990f11a225237acd6ef35c9f", - "revisionTime": "2018-12-21T10:19:52Z" + "revision": "1775db3f06b568179d273425900dd09125831dd5", + "revisionTime": "2019-01-06T17:38:07Z" }, { "checksumSHA1": "WoSat9PbqZFXREek5bkUBr256/Q=", From f7248ba75321ace8e76f9723e9ef3badea2bdd4d Mon Sep 17 00:00:00 2001 From: LE Manh Cuong Date: Sat, 5 Jan 2019 23:39:24 +0700 Subject: [PATCH 485/594] archive/zip: fix casting overflow on 32-bit arch Fixes #29555 Change-Id: Ia3c0dd65bcf94dea3f6e04c23c1fe5d6d0b2c1e9 Reviewed-on: https://go-review.googlesource.com/c/156399 Run-TryBot: Brad Fitzpatrick Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/archive/zip/zip_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go index 50218a2bbd72b..3d5c759851a3a 100644 --- a/src/archive/zip/zip_test.go +++ b/src/archive/zip/zip_test.go @@ -159,7 +159,7 @@ func (r *rleBuffer) Write(p []byte) (n int, err error) { return len(p), nil } -func min(x, y int) int { +func min(x, y int64) int64 { if x < y { return x } @@ -190,7 +190,7 @@ func (r *rleBuffer) ReadAt(p []byte, off int64) (n int, err error) { if len(parts) > 0 { skipBytes := off - parts[0].off for _, part := range parts { - repeat := min(int(part.n-skipBytes), len(p)-n) + repeat := int(min(part.n-skipBytes, int64(len(p)-n))) memset(p[n:n+repeat], part.b) n += repeat if n == len(p) { From 73fb3c38a685158591503a3d760ae6e1d1a2a565 Mon Sep 17 00:00:00 2001 From: Gabriel Aszalos Date: Mon, 7 Jan 2019 09:48:39 +0100 Subject: [PATCH 486/594] doc: remove incorrect space in %T and %v output examples Change-Id: I321890237f703b945711e59c15233ccf59c4f190 Reviewed-on: https://go-review.googlesource.com/c/156477 Run-TryBot: Gabriel Aszalos TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- doc/effective_go.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/effective_go.html b/doc/effective_go.html index ddfea76d433ef..34131868a4c75 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -1710,7 +1710,7 @@

    Printing

    &{7 -2.35 abc def} &{a:7 b:-2.35 c:abc def} &main.T{a:7, b:-2.35, c:"abc\tdef"} -map[string] int{"CST":-21600, "PST":-28800, "EST":-18000, "UTC":0, "MST":-25200} +map[string]int{"CST":-21600, "PST":-28800, "EST":-18000, "UTC":0, "MST":-25200}

    (Note the ampersands.) @@ -1733,7 +1733,7 @@

    Printing

    prints

    -map[string] int
    +map[string]int
     

    If you want to control the default format for a custom type, all that's required is to define From e1b903788ac5e35ed0d0fb20d904eafedca02c81 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Fri, 4 Jan 2019 17:30:36 -0500 Subject: [PATCH 487/594] cmd/go: deflake TestScript/gcflags_patterns The check below can fail incorrectly if the buildid ends with '-p'. ! stderr 'compile.* -e .*-p [^z]' This fix changes regular expressions to '-e.* -p' or '-N.* -p' instead of '-e .*-p'. '-l' is no longer used because the compiler accepts multiple flags starting with '-l' ('-e' and '-N' do not have this problem), so there could be false matches. Change-Id: I827c411de28624019a287f853acc9666e87cbfb9 Reviewed-on: https://go-review.googlesource.com/c/156327 Reviewed-by: Brad Fitzpatrick --- .../go/testdata/script/gcflags_patterns.txt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/cmd/go/testdata/script/gcflags_patterns.txt b/src/cmd/go/testdata/script/gcflags_patterns.txt index 2d7e88647b370..40f80b7d6e971 100644 --- a/src/cmd/go/testdata/script/gcflags_patterns.txt +++ b/src/cmd/go/testdata/script/gcflags_patterns.txt @@ -2,28 +2,28 @@ # -gcflags=-e applies to named packages, not dependencies go build -n -v -gcflags=-e z1 z2 -stderr 'compile.* -e .*-p z1' -stderr 'compile.* -e .*-p z2' +stderr 'compile.* -e.* -p z1' +stderr 'compile.* -e.* -p z2' stderr 'compile.* -p y' -! stderr 'compile.* -e .*-p [^z]' +! stderr 'compile.* -e.* -p [^z]' # -gcflags can specify package=flags, and can be repeated; last match wins go build -n -v -gcflags=-e -gcflags=z1=-N z1 z2 -stderr 'compile.* -N .*-p z1' -! stderr 'compile.* -e .*-p z1' -! stderr 'compile.* -N .*-p z2' -stderr 'compile.* -e .*-p z2' +stderr 'compile.* -N.* -p z1' +! stderr 'compile.* -e.* -p z1' +! stderr 'compile.* -N.* -p z2' +stderr 'compile.* -e.* -p z2' stderr 'compile.* -p y' -! stderr 'compile.* -e .*-p [^z]' -! stderr 'compile.* -N .*-p [^z]' +! stderr 'compile.* -e.* -p [^z]' +! stderr 'compile.* -N.* -p [^z]' # -gcflags can have arbitrary spaces around the flags go build -n -v -gcflags=' z1 = -e ' z1 -stderr 'compile.* -e .*-p z1' +stderr 'compile.* -e.* -p z1' -# -gcflags='all=-N -l' should apply to all packages, even with go test -go test -c -n -gcflags='all=-N -l' z1 -stderr 'compile.* -N -l .*-p z3 ' +# -gcflags='all=-e' should apply to all packages, even with go test +go test -c -n -gcflags='all=-e' z1 +stderr 'compile.* -e.* -p z3 ' # -ldflags for implicit test package applies to test binary go test -c -n -gcflags=-N -ldflags=-X=x.y=z z1 From 857b339993146f2eab5fd9b9bef8357de8db144a Mon Sep 17 00:00:00 2001 From: Jason LeBrun Date: Fri, 4 Jan 2019 01:30:15 +0000 Subject: [PATCH 488/594] crypto/sha1: fix casting of d.nx in UnmarshalBinary Fixes #29543 Change-Id: Ib7f3c32cc1e57c583ee52c486673a5b9568c2df8 GitHub-Last-Rev: 0cb3dc536245bb4f414cf09bb353fbafd5ca7537 GitHub-Pull-Request: golang/go#29544 Reviewed-on: https://go-review.googlesource.com/c/156279 Run-TryBot: Emmanuel Odeke Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/crypto/sha1/sha1.go | 2 +- src/crypto/sha1/sha1_test.go | 58 ++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/crypto/sha1/sha1.go b/src/crypto/sha1/sha1.go index db70b7d09aa8c..8c48042b1ce3f 100644 --- a/src/crypto/sha1/sha1.go +++ b/src/crypto/sha1/sha1.go @@ -75,7 +75,7 @@ func (d *digest) UnmarshalBinary(b []byte) error { b, d.h[4] = consumeUint32(b) b = b[copy(d.x[:], b):] b, d.len = consumeUint64(b) - d.nx = int(d.len) % chunk + d.nx = int(d.len % chunk) return nil } diff --git a/src/crypto/sha1/sha1_test.go b/src/crypto/sha1/sha1_test.go index 4f229262adb8e..c047204bf3164 100644 --- a/src/crypto/sha1/sha1_test.go +++ b/src/crypto/sha1/sha1_test.go @@ -11,6 +11,7 @@ import ( "crypto/rand" "encoding" "fmt" + "hash" "io" "testing" ) @@ -152,6 +153,63 @@ func TestBlockGeneric(t *testing.T) { } } +// Tests for unmarshaling hashes that have hashed a large amount of data +// The initial hash generation is omitted from the test, because it takes a long time. +// The test contains some already-generated states, and their expected sums +// Tests a problem that is outlined in Github issue #29543 +// The problem is triggered when an amount of data has been hashed for which +// the data length has a 1 in the 32nd bit. When casted to int, this changes +// the sign of the value, and causes the modulus operation to return a +// different result. +type unmarshalTest struct { + state string + sum string +} + +var largeUnmarshalTests = []unmarshalTest{ + // Data length: 7_102_415_735 + unmarshalTest{ + state: "sha\x01\x13\xbc\xfe\x83\x8c\xbd\xdfP\x1f\xd8ڿ<\x9eji8t\xe1\xa5@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuv\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xa7VCw", + sum: "bc6245c9959cc33e1c2592e5c9ea9b5d0431246c", + }, + // Data length: 6_565_544_823 + unmarshalTest{ + state: "sha\x01m;\x16\xa6R\xbe@\xa9nĈ\xf9S\x03\x00B\xc2\xdcv\xcf@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuv\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x87VCw", + sum: "8f2d1c0e4271768f35feb918bfe21ea1387a2072", + }, +} + +func safeSum(h hash.Hash) (sum []byte, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("sum panic: %v", r) + } + }() + + return h.Sum(nil), nil +} + +func TestLargeHashes(t *testing.T) { + for i, test := range largeUnmarshalTests { + + h := New() + if err := h.(encoding.BinaryUnmarshaler).UnmarshalBinary([]byte(test.state)); err != nil { + t.Errorf("test %d could not unmarshal: %v", i, err) + continue + } + + sum, err := safeSum(h) + if err != nil { + t.Errorf("test %d could not sum: %v", i, err) + continue + } + + if fmt.Sprintf("%x", sum) != test.sum { + t.Errorf("test %d sum mismatch: expect %s got %x", i, test.sum, sum) + } + } +} + var bench = New() var buf = make([]byte, 8192) From 55dec44010bdabbbac8f58d1059b1fb83e869408 Mon Sep 17 00:00:00 2001 From: Jason LeBrun Date: Fri, 4 Jan 2019 01:41:06 +0000 Subject: [PATCH 489/594] crypto/md5: fix casting of d.nx in UnmarshalBinary Fixes #29545 Change-Id: Ida98c23b8fc5c676d8bf0b3daad8320e495ebf64 GitHub-Last-Rev: d38e8a90c75f92031f6a8cf1f69f7bc7c28a52d8 GitHub-Pull-Request: golang/go#29546 Reviewed-on: https://go-review.googlesource.com/c/156297 Run-TryBot: Emmanuel Odeke Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/crypto/md5/md5.go | 2 +- src/crypto/md5/md5_test.go | 58 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/src/crypto/md5/md5.go b/src/crypto/md5/md5.go index 3e66db6d0d7f1..011578404751a 100644 --- a/src/crypto/md5/md5.go +++ b/src/crypto/md5/md5.go @@ -83,7 +83,7 @@ func (d *digest) UnmarshalBinary(b []byte) error { b, d.s[3] = consumeUint32(b) b = b[copy(d.x[:], b):] b, d.len = consumeUint64(b) - d.nx = int(d.len) % BlockSize + d.nx = int(d.len % BlockSize) return nil } diff --git a/src/crypto/md5/md5_test.go b/src/crypto/md5/md5_test.go index 64a62e4730587..34c7f541c5740 100644 --- a/src/crypto/md5/md5_test.go +++ b/src/crypto/md5/md5_test.go @@ -9,6 +9,7 @@ import ( "crypto/rand" "encoding" "fmt" + "hash" "io" "testing" "unsafe" @@ -153,6 +154,63 @@ func TestBlockGeneric(t *testing.T) { } } +// Tests for unmarshaling hashes that have hashed a large amount of data +// The initial hash generation is omitted from the test, because it takes a long time. +// The test contains some already-generated states, and their expected sums +// Tests a problem that is outlined in Github issue #29541 +// The problem is triggered when an amount of data has been hashed for which +// the data length has a 1 in the 32nd bit. When casted to int, this changes +// the sign of the value, and causes the modulus operation to return a +// different result. +type unmarshalTest struct { + state string + sum string +} + +var largeUnmarshalTests = []unmarshalTest{ + // Data length: 7_102_415_735 + unmarshalTest{ + state: "md5\x01\xa5\xf7\xf0=\xd6S\x85\xd9M\n}\xc3\u0601\x89\xe7@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuv\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xa7VCw", + sum: "cddefcf74ffec709a0b45a6a987564d5", + }, + // Data length: 6_565_544_823 + unmarshalTest{ + state: "md5\x01{\xda\x1a\xc7\xc9'?\x83EX\xe0\x88q\xfeG\x18@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuv\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x87VCw", + sum: "fd9f41874ab240698e7bc9c3ae70c8e4", + }, +} + +func safeSum(h hash.Hash) (sum []byte, err error) { + defer func() { + if r := recover(); r != nil { + err = fmt.Errorf("sum panic: %v", r) + } + }() + + return h.Sum(nil), nil +} + +func TestLargeHashes(t *testing.T) { + for i, test := range largeUnmarshalTests { + + h := New() + if err := h.(encoding.BinaryUnmarshaler).UnmarshalBinary([]byte(test.state)); err != nil { + t.Errorf("test %d could not unmarshal: %v", i, err) + continue + } + + sum, err := safeSum(h) + if err != nil { + t.Errorf("test %d could not sum: %v", i, err) + continue + } + + if fmt.Sprintf("%x", sum) != test.sum { + t.Errorf("test %d sum mismatch: expect %s got %x", i, test.sum, sum) + } + } +} + var bench = New() var buf = make([]byte, 8192+1) var sum = make([]byte, bench.Size()) From 649294d0a5a647517eba7f91afef2e635b92a0da Mon Sep 17 00:00:00 2001 From: Brian Kessler Date: Thu, 3 Jan 2019 10:00:49 -0700 Subject: [PATCH 490/594] math: fix ternary correction statement in Log1p The original port of Log1p incorrectly translated a ternary statement so that a correction was only applied to one of the branches. Fixes #29488 Change-Id: I035b2fc741f76fe7c0154c63da6e298b575e08a4 Reviewed-on: https://go-review.googlesource.com/c/156120 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Katie Hockman Reviewed-by: Robert Griesemer --- src/math/all_test.go | 2 ++ src/math/log1p.go | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/math/all_test.go b/src/math/all_test.go index c2d2efcd97fd3..ed42941780973 100644 --- a/src/math/all_test.go +++ b/src/math/all_test.go @@ -1528,6 +1528,7 @@ var vflog1pSC = []float64{ 0, Inf(1), NaN(), + 4503599627370496.5, // Issue #29488 } var log1pSC = []float64{ NaN(), @@ -1537,6 +1538,7 @@ var log1pSC = []float64{ 0, Inf(1), NaN(), + 36.04365338911715, // Issue #29488 } var vfmodfSC = []float64{ diff --git a/src/math/log1p.go b/src/math/log1p.go index b128a1620c880..c4ec61b2259eb 100644 --- a/src/math/log1p.go +++ b/src/math/log1p.go @@ -151,12 +151,13 @@ func log1p(x float64) float64 { u = 1.0 + x iu = Float64bits(u) k = int((iu >> 52) - 1023) + // correction term if k > 0 { c = 1.0 - (u - x) } else { - c = x - (u - 1.0) // correction term - c /= u + c = x - (u - 1.0) } + c /= u } else { u = x iu = Float64bits(u) From af3c4809675d1f8c0a96a6593795ce89c52ead2a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 7 Jan 2019 11:54:35 -0800 Subject: [PATCH 491/594] lib/time: update tzdata to 2018i Updates #22487 Change-Id: Iab4874ddef8e47eb99cd03e1c40af8372cce65c6 Reviewed-on: https://go-review.googlesource.com/c/156637 Run-TryBot: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- lib/time/update.bash | 4 ++-- lib/time/zoneinfo.zip | Bin 363811 -> 365447 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/time/update.bash b/lib/time/update.bash index 8b1f453fb5cd5..8d6785b9af6d2 100755 --- a/lib/time/update.bash +++ b/lib/time/update.bash @@ -8,8 +8,8 @@ # Consult https://www.iana.org/time-zones for the latest versions. # Versions to use. -CODE=2018g -DATA=2018g +CODE=2018i +DATA=2018i set -e rm -rf work diff --git a/lib/time/zoneinfo.zip b/lib/time/zoneinfo.zip index 99d5ee1213b1706896a96b1c0a5e722b1a193c23..bacb724322bcdea720f864b69e6edf13b6de7502 100644 GIT binary patch delta 74538 zcmdVD34Baf`#3&#=8iQX2x19AtV!G?25gpk-nOp=j|Bs0k*gD4^`MX6%SQAMLw zTD3N9r$sGYDAl5iR$EFJl-jBrir;h2y)*ZoG3Vyw_xt_7|NlSl`{d2Xd+u|e^X%t2 z&pG#%bqyA6ZBQ#I-XPY{;h*=Wv>masR@2srJG-S~aLlTy6U4y5I-QuDCg|va&VpJE zTMad(+w3;0c}z-mox%5GPN7c3rxN};a zArij4_6?n>o%|Ss$-CV+oqgN3)EeiZ@lK1jTH^rUKs*;gU;KA}y-tUrj;^ULdYavm zVd@lXDm10%nyeWnEvD3I7ivrcmK&X;!q1g_9TbxKd2Ctgf7u~ZUff+a<=EFDQ|;qJ zrk2eqOON_EBzi6J>zr$Ta8 z|5=t7**_#N!&GLg`AeCtPxX-ev!lui0(O_#cij!KpARl8db+Hv=&g@KW~BI+%~+aS zHmk$iA)&LzpDio?w`IuePNgAFe15F#iT`ed%zd>WWbT)%%S!C$LrS*w4{;`*3r2Hp z=$oMTyBgX$^CE((W1SJIB_yUeg$9AOYk29$7j4_K*jT6Ca!GvQ)!VSf2-PM@V@}j& z=>mvX9+MQNAu@T)?ugc`cL6;Eut?ubNUSv*CWWE4BGP1&EiJ{Cr>W(2+J#T{n-9;e zy0m=$#JI%)sU7yM5cCF7r>l~r(>;3hPX_#-_y_)_R)DUW^fxe1Hxyu8bPD`~fd3JG z)qsEM?9I=)9osSJM=Q?@;ZAGqi4w!MHDNIftsE_cqW;ed)ye~!rVG;W-E|tSd{mQx zT4C|fx~*7afPJ+v`(i`aKBx=UP*?BV7}%IGn$Tdxv#sL%CveaI+q&PHNB0G1mtGyv zg=C=`YFuJy>O5pOI)A9&*Z{(E-l^ZBE=bH&gPreEQd%KRo=CYQI=DU+ANG- z^8cYz2!r>uKLo)$pAD{9@}q*7hC})G)~#52=LC0G{!}ZyJdj$G~sj)Z7XqRJ4$8nDKp(r3VXl{6BnJ6ALqAn_`pF;n!kQ#@LoX=kJE z=tIj}*7#R1p)9DS$y!gE@OC2>p~TEQMF#5i)z|s`ryIsBe38@B&!rUlUGK9KJhlKWJwiu;A)e=;l$$ z1cEY|qLdW2`Rn>>Xnv-UE{U_|e3r%%MJdmle@0dkAh-h;t&{SZ?uE$wK>jfq<>mU? z#5x~D*L00;Ae@lKJCn9BiN)dA`R10X5*NbPF%e@!bS+yaw2~#<@KhLMR+28vIh7z& zdrA<3T8_3An(P*vh6-Vec~2JdSfjwyf1C}v-ZTmmB|^}HV5SFmZTedONcM~uI&Y0)OLJ{+BTTQH)&5yCi0ZH|Ayau|eb=(8z8 zHRs~9^_^weeyGF_YrIJx)|WYc(8Sc`f@H{kg46HH9G`1uQ-uRGIyq0QhSGY9Ms(RM zjFw2tInbzCrYT25LOvW7iVkLm4vAN<1Pfy&Ui})zGz4NZUV(1$%r>2TSDCzuSPyzl zUpNPradQmLoli7GcYhN78Zj$bl5+N+l_4{A^Annms=U^myYk4Zf3iXYiBWNX8H^Gm zYb<6Blok_~#ZO2BUmw6UOIk|Kpr|B?hY2CtmZ- zzcN=Ei2jKc+VTY(G-0g3Vyt&)L?aV~NQN&_jU^Fjf#sFEXw+z-8L}n`tcoGlCgR%3 zBX12YJT5(Q1S!&=8dk6}C$J&Q29NF-VhicKaaV50sZ73_;bW2%)bY1@ek({-NP$>UdzoF1@jq z_B+U&8la7FQ24mMStyexmO5TwW&>_U93bzy-D1eoC^r?}wfv!2L;GE!F5t&Hc|M7w zg^mo~VX?Y>{fHFiFv4QjJ1K&kDx>&eLO27ZBo1Kb=V<;=SY0lEwVCtxAG@R78A5gR zbDS_ins?2Wf@YL;Syu{H*^QE9bC501VuhNpwqJxrwL9f#d6wy>Nf@7hwxR4OUYW#7 z49H}hRa3trL_2f0Gie4!hL)e){-I2A%SLR^?_PNim5?@j$fWbXLHeNb{D*F&3D2>S zlJ(x}&k0i`p*xr5v3v<}e&yHlawSroOII)hGM<$4_Z3p+j9%Nxc4c^^tI94RM0RE6 z|1sk$$#mw;6I52!tYED5VofM-bJRha3l+@5);24X_npO8>^Z51IeOlt`UOe ztR(F|iwSt7^U(d9lG+aJ$@Ke@k-XGXcpwwo>NYEnb`$GYKL7SKnb<0A*#R7L0fh|K zS99gJ6+&eeUs=pd%?OJJE%{nvZ>uXzI;gPXe0md$2~wz1OwyTlKgc;{Aae<-=9zO{ zG}CG@q2&*vzmct`Pb(&OiNJ1M(p%)&FaB0T6BI9iE@d)ph7Q!d{h7)lB~Z_85}tN7 zuO-ZpE$sQvn29&h+Pj}MmZw$Lhb>y-4D@{kSyp&ypWmO!S88dWzLag^*c??Ala@o6 zlEse0`P7g(B*r}I)9Rk{9WzT`q@=Chv^+r&oTXWE2z#kE+b@vmL6uQenyQ*h(R<*!^6u2MB#+Z~o$Wrd<#(rHb?`Uu9>)r(YG$Nj87M$y6c9=3x(L zx*TiQL@;@QH5g6VCe(HrItuq?)mXTdiJNHrPg{is^3cxjFspsopSYlMF;n&>KV=E6 zIrGEtY-ZH=cq!NO*}`I(iuJRFF09B;k|V`QppYDPmO#cnog+Lc<1L=cqyt^-C`P!h z&J}F(*jq&vBxn;Hf;(p3DyV>lv36mNj5lN!TOA0!3uXy{@>oA>1^J83D#+=&^V2R& zgL2!4lnbEOtFt`?QQn$0gbuQhr*vi7g{w45%#;c3@Fr6uiC=R!nzXR=>iY z7f|3ciFH2c&I;g^k9FRe$Qp+`5h9!uCk>WN4rhF5q#*b+RE=n|35VsNir(4V3(g$!Mjr8yG(LzXaK zLMlXR$0L_1Qizp9(YJ$`39MVe6bI~d9A~nN?C^bi{9RdhjyGZ(1kf4k>eyJQEvw`B zQl>f*Pqz1}{!cmC3VwzixNtO@^UP0#2Tn1UWjGjRxhc1;>~=eCs(@J#y!G;=^j$Ow zMW!yoUFr3!dovkDj8PR}A9N3DIn-{pnlkwpDDVtA)PuQtrgePho0_bsS$;^Go-^ql z)5b8-&YkymNV6+C!oo;4dJz=jx|HjW%H>n%kExn?%ll8BCyV!q4NURk1r2(%LiBSz zdtd*WoXXwl&%`Y6&Qm7@rdmGyFOOX%E#Re2&K@AMN#$y&SXX=b88+_=kckt|OMr)s8C@b4W*bkIv3@wv{k6wskdswpU_7w8af3Gux9hp7kN;Tve zeXx&3Cn6=+R{ICZGisg9;=QznQHA9-yO>Bx*!X8xxy=0Rx7qH+U0qHk`h<=e*m6>e ziQ%GL2XS^>z?2msV(Ee>WC!akXV>Dfs=98L3l3QWu{(;k7Fn_!{O+i*D>H8s}#J;#{@&*-R!w3*HwZ$tq?4$(7;g)^R8hChZq$ zFj535NXLH)Ri_R6g)HeE@kg|^)3yDGut?_j!B5%rke!O=CxjX@N4kB)o+hcxtolfJ zTaHy1_OfXp^BlfU=q{1l^Efjp2Kx*}FC7=+q>+OTu_HA}T~!m?_C7nsBV+v!2;Jm~ zJ-Ls~1e~&=Yx@MLdldbCT$=|7WRWjX8}Yfo*%*tgpEI3=WYDKRckhd%T3-l_Nv~~% z{kE6Tm?^uVHxPp#?oBMTm^!7TTXHRhTFp$v*}3{B>X9tVglht;VTrh~najoI^3VzA z+2#u>vQpyA=&Nk^fn|esT@_xCh92#vXT4jZvqg9PV)^9-7d4Yv`Q?72^sK#c;%3pL zTzw5!!6^L^8SS}R><6&-LcMD1Ka{Bbb_A1J%qi4$q`pKN**BRv(gn``6`?oY5?{Oe zh2=ki^f1(LOEA%tVba>#lr-ktMEx;&0*USP%~}3~sQ1)PdRe^<|FBsIy&0jdDgOvR z%4m=M&QuGjV$kZkFh+JW3&!f15rA0Z#j*NZvNcZrPa7|C{U9woXhXk>ZMfXT2O(05wy_9<2Q_#bYzhgntJ5grSyOr-s?A zS!wa`OJn1K2sId5`*l?S>MXQmtT>+7tJm@Got;08FPQa3V)-rP`bmh?zjGPg_(?b> z;$CK_se5z}oi2wQ7s#KFTbbvr5TKQL=3?n@oxe_p{~fnA4~xf;oT3{JphF#g5t{bJ zB;UL8M*2Z`CkBrri?!w2^3pX80S7R&@h)sdweF_hDDm{=-`KtfjG+tiyDG#;L%+Jf zHU<*I6!!m@qh~G$aPH;;r*cZx0>eW#TB0#i9tvN{V`Eye?FOg~NBM*F@@8#dSGJq- znpm4N8fJs@mDKiby&Ca=t=`1KwmfiecIm%khek3l({~Erc3$Pc_dlF4L34AdO`(3W3>zll#C z7ySIIHc&(i9-ka`C1+63N5k|Z`eB7OEj{4B3G5GpzuN{!*$RtHR#UN-31U9_ zcZWCE1PIvHXmKj)*j@jyN_99{(RVXi@2BsGrba^V&8-yZ4UNCYj^kdA^}mjqdKZC|=#u{>Tk}a_s%dY1u0+7frc9Yg8x`2I_aVG= zt?IZIju2p|>E>mMIood1YE33VQpj|Db4yq&7zMp(5K;6VAq{=|hcLZq&)%K7b`Kxk zwMRGjU#~uWbh$5^jYQA=SBXsxL|24@rj5pdq%e4NWsoD?q?vya-(nu_Ho?L$HiO;S zQZ;lYOutHE-J{wSL=6S?!m8}4U@^NcR@KMJfv%y6O$M2^-K2L1x&&>V2uHg*>gAmN zR2o~*WOfl#^_QfH4a#6oj5yhi8J?u=ek-;^Ce%(0)t{8@|LX~Cyu`^W)PC1T&#V!+ zqfIYl@2fA6NRGbCjyCS`uS-Ka8`xPIo}HAJIt`vF4*!K|qqN(S@bB%#o~4)ZWt-VD zfl9zr62hcLdS+?C?PsgI_BPU=k@-AfGJA%kYOuJ6SSaCc^CL5sxFB1z$rzt+!q!QW z_1tXYj{5=8?3ZJOKoE7SyX?{W<1+3S1DH%8?0wYFP~Rog(eDvRj`HujBUA2y3&P;Z zQASuYY_RCk@aSX#75t5GQBHmb#xgAuhK8fHR(&R6(dr)TsbkH0d!^nXkc2Pkg-egN zK%l|kN%%$;&o0ij*)}^Gy70$V`?^2V_Z-ZmYV?4XU#PX5j)+sA^L{0)9qws z@`qLjv?G$K-$ci%^w95?b!7W>aUq+ro~GVd^73gCwtJk6&i5K0xl_uCOaY zp=?)^jZBOlx8-`zsQ*L~`y8=$+zrrN3?8w^m~tE%Mn%@~uCV(0ujO~$P|z5r#BnO8UL~CSis^=>Er#A-yZd*)X~qsp#9b*XTURhsoMat_0-Cvt z4t|4}43*MOWsR`9JzMoKA6&qP`7+P8rLxD8sOUG@9m79jQy?k6b}>U!l%zVKDrUS> zml=T-x7@s*ez!c0yY1N1puNKyo4y%m!8c$T(=4UZN2Au_4w-=M`D|4pRnw+V>DS4Y z`C1`!ESVfx7F8+ISC_g#P^?YQ+FC&n)0atJdGA8D+L0`;(bM{`WC{*G$@F2Q*6dPI zTd$ajSE1HktQTc!XU}7Ejfh!QzU>H!!n!esi}z z*r}s4>-Afuk$&$m$l4+uCqz=Ay@t;y}O9`#bIrF6mG14m1!5464%35^#|nlmu}F0 zKM)-u2je|^wK+%l(R81_r98gFacz2i@*~()@k1`vOO9=35+yB^;V6;37|Gki9O|Vb z&%dr`^;!`A{rkGUyFAH~H}#F1MaQOSgk!ewohvl;+ogKXq1Tvl@}6h@5lt4VRqDc8 zO+`UOq$(93xsw@dy%h@>!z^)O+x02^{h#T1_l(wm!3=CJ@apbnpsuI2`R3Ibb@odp zRy;waNBF^K%z;E6%BiryID3ahgy*L!Wbd(1>B=;9($E^Ob2n(!B~9&hDQ&Z;=m)k` zeKb>|tgo46@vlKcd(X`lk8yYZ~s8e zA3uz)-_tkYjE52TnJFFe)k}kVKVlj__&rFeA?U6&8O4N4Z#eHQ}~qB+R#A4{!9l= z>_leQJIMU#aHa1oU$g1XF`I^HNT{JH>91MTWz#4$vbmvt)21BsUS=9# zf_>)GgB^BTzPU1SvdL+t-mB6DiL^y$46ODY7o@i)xxiE7Cj)Djo~!}=CK>!)GY=ZJ zNo()bA2RPbl6sf|s)?uNWqR#{23FUWFVtx3Lj$WJg9IShy=mYIcx2cmmyfQ-F}dLr z|4%!Z_(@KPpo&!8HGHSRB~ReJ66OokEWGs+bC}fcmQZGhmAjBbdKy@pkz|fgEev!m z?rCsuCVW1NO*5&#MHCy-WZY3NYT|Y|Uo=dRhYr5NMyu=t?zm!b?*lHns__6`EM2;4 zaF-X}8_d)^Nkjg z8uu_2)D^wQ&_kBpin(l2kPXJ)=NjC7l8^2fn7yV%Y${zF5W{2`VFK7*Yng<|ZA`R; z3BWHu*K^wpBjxeUZZJtEsFMzh6J>t=X<&L#2{m*sxspV2ii}!FWHL=5#gu4>l=0_u zW0FGlwp>TMc~odYfXIpwNSFdveKA0clIb`)naMpDj6En1ySRe+dKU=KUv@xa_c3Sn z7?nFFvds;f4}>VU$98UJ>bcru|5`(21wHk!_MO?PjbE(l0kEB5(})f1gA;}^^3*>v zF&Qb@ZOe2+lsxvtE%sP%uT=Lwlk<|dv)(sE%2Il>Dw6?^dBzqFHeRv;IoDxGl<~Iy zfWvvr|G+Rpp5H5dnByfic-Y6VUG^Sh7c%J}Ui8g{2Kj;mbiIHnjmM_f>Q^?4$p)`? zR`A6UCLLW>M8We0Bv_e_7Gb}8G>Xs|FVopv)UG4u&}vHwC7KY z;joPIy*#!-dOOmw;mp@d?0qZTP$1*Io5Gx$G?r{2l7+Os=ehgtA^~1V4>4sF+3Z@q zmBay(wfmAlF{le(jXyCnzRy^wuwl>xlA$pgYfwpEd z({R(+g%knR#R6O?!&g9S5a@ZhyLY9*C_NnUfAln8JxWR;4z>`r7Dl9=(GydtZdR`b zRN_8$D7XKAu1#Gkm|v^9D+)?%7;sf}7++NtZ4MQi5WQLcWaEuTpw9&Z)|-)*{4ylDyWo7g>D<;4Y;LhEeq}W-@}J!`z*H zmm`>If`Tf$gUDLFA=r2Cjeh7LwwFk|+>RZ6piM>YCw!MpoATBt!`W{o9bp&4Md^e) z+TK=Vri!Giq;@+|KABOotp--yY+u;cJ#<(*CU5Y0k91=7CRM*Pw)(jL#~PiNb`hH} z9Ff%4LzGs$y5#j!pz#>6(hfJ}nY3@PB2|AU98M;VsL#2?9n0WZ4A>D3H|1-0ZhKlq zNo{*a%cGMv!J`;(Z99IZX}T%bY|-43Be59Ybej=0AD%mWJ@VACt2L&c98!Ag(bG+m z!e`VPSn}x6BRIe!h(>V!>o344-MZcQ$jY)Zd=vk?6*|91kH!tu1?Y6I9nuBj<11lZ zx&U<6g>~+&i|Eo7{_ct&LofCexoMRl0V=6u70=b`%BnRyV++SY?J6#xXaxh|| zmY*hR4>_JH8BN^7sFv^`25dAVCPu^#i`LpIb45QPMi@$PP{c~*{=q>p$&_K4W~t03 z*|Lm}uOF>RJ;3?f*^!7|qJ`G-f7E>Ff){KL*#X)4lVY9KD zKl&k^8T_$x?|N7}Yn zOp#u)E{`3&i0}V9PuwL9Ju_W1;&egLIby6dG%$w3p8zB?3S{gdc#x_0@L-*T6xp!@xg-s?Iddwnr@W-mRW!1i^^Fe9mqm?;gLq>4G z{wX|$eA;AfomVcD^}c%xd)F`O)Vd{kRY5NZj~?|q0f?|WC1(P$Q^kKvj+8i2bT~mT zInFhyOaie{qRFXZu{7(}xoieOQj;x>`p3c+AzZG$NgCBHotgC@ke)1(l43CkmF0`9 zTYMxPg-U}qbT@nad+Yv-I^Dylw#yy~&2*0@kH4iu;W}Z6BVRwWmd?;-Tz=Jjq^o-3^ew+? zD|LQz7KQsCe13i{^DFs%Vy8?6{W5s{2b@X|d~S}?w{^P(;6_tWy8z6Nq0rfYWB1TO zDZ1Ef(&nH;QQ2Z+NgXm~SKuNP+v_)pt%bn62=wYCQM#iUf%-60U3Z#NO1Ns8Y)#w> zGuVorn5U6O!1?5o>M#r+(hZyszkI0)&T@Jz&62Ym0n|mrCOI?##`{nh$Z#Of!TFE3 z+Q>N$evJIo=m%L43N8_AOH6y+%C%ahPnGQ`pWDcMLf@ z5B75{pCY~>kdHK}Z4Q5=NwK+XYra|QEZ+Z!(MfaqELUXp`l>GX?w==4Alk4j_Tjhd zfaUAZwi!%qa689psXjH~WdEW0SQBKgjI{uKaoKzd#JQOM`?&?bJ z|NYpEa!ev?KZvYUq8tNQU!>rhJ=r4=3&;#2`)~atmwvQXJ zn#pf>saWb|loa8$)y#xY8IJptqP^Fsm_1{XD^rSiZX>h2hQ*-zNWic+w5cLrx=}96 zj(UgbP^29M)y1yU*071deSV&g=n#=^f3!cI#A8{cFyUdQnI?-?cHxO`r4oy;yecwV zSMjtxUwuH+UuM!qkg9GeNA1^XV^zL)bZb955PPjI7rwC|>v~dhec{2-x>@ib z23&F-7m++h!`QJoxKz9JJ3nOR1&ZYad?W@*TCg$C7*uj48uZBhf!HxAM(JC*k9}TO z&^I$EU*df`Cv<)iJcgmRE(l{FKV_vDoBXv|0|WFrr$=#i0IWr8aQ9GF2lorIbwo4yu6Cef^(S3Zo*#KH_Cvdcv=AHrBfiqveHBY+ILE9RO0iBHu@2P`X;biW>>(o z`}jhzZ&JJ|`DD+BZJt7Rz7Xpf%S!XB=$seZHf+Q9C^~eMOd`4}`T_om;+RB=F8?Lp ziuXfRH1C+$pt4BnQUYEWfSseVLz2uTQ z9-Ju-s|7wJ=zFf-C{gWWL;%;}W5Kcj5>16>I~wOK)zDVMCeZi z7@`w>%SvMdJS(M7gHga2VuMy30oCn%$2C)C z2WEz^JLH=in~EC>O63#IK9TxhdIID(pbJko_mBn3M84_l6T@T7VSC=DAs&?R7N{Kf zW;o_|iI;|FF3fmgD#TO_bRt(C;=vhXDJ(Q`drmo4lTb}t;=~pZ!QI|C-IQ*!a@)WY zgPZ7g^$>?o>0flGK2{-V|%lrhjlR8-8)V!dsZEhGOn7-=^lt2pm273^MYv(!FW~=@36n zh1qP2@iG`>Jt77TEGr!o=Aj}wGt*L-7L65}*TbL|9}`}LhI_EY;$)8d`I}#gLH)`~ z2Y2#3pJKP<+cYfSdmc$A$wFmiXOs(n@nn8#mromZSQif&@us}|O5`-)cE}IPnqdrp zh5O$aQ=XY9IWIHDoV@?F1N;I8I%xEQ9wIlk6w7qb7EKBHsp|n~#CL>2e@CL}--%6l z807c&vO&XP{fnUvl{21#Ykb{=#AaKv9VYlM@BC6bjQVZ^Bu2Uo0Q9=d+#3nMhz+^S z@AIo-(8RLRggy!>u&%LM^3B|frIXL}- zQf@|+4vq9Pa;;Ur|M_~byRbqpc>jn&!nb_&1ND4pB+tewT#C0tPnu;!L^eDAhNm~D8|Xxz zD~D6ph$lS`%HX!J=pz2LCwlgV7&N}Dba}G!e2mRf$UQMI13%VI4a6T@GFcVlWoVS08Frl}ckHS6{z zF$ij4*=b}ZPQO*vc%S^Cx)BGc*bIfOiQs-6{F=VLmN6){tn{f&1w#_-jHTJ8r6uQ^ zaF43Diuh(LdhRwUn6@x0h!Vk`ZL@u783V;lgAr#AL0Jllp$=1#Ij<6-4lVmx42mu* zy`(}i!JM0Go0(&+j4@)qfJ|EE=+Jw$j7_+Fzx5*V8i#VwGZ)1sJSr64Y*pJ^5XUgk z_Ik^zLwo)a8}eWYJMlzDF_;Gi+7E`=bXtQiZrV?JHZTB4xNdq;)K-2od5(OzZ z2>dl^Gj|w3c|VdE8T+h)B(A`e>#!8@Qufir>v6NdP%zNb-MB(QnqW#xGR^jlv+m;+ z6@=sCxU$kID-{&cnI`U3=2orif(;15KwEIj)jE_EEHvPa2qW&1SaKd7%ef~u;W0IM zr{_nJ6^^aP*P!Pht>HoPpx5+;b3oV_=wMhMp-VrBEqRbs-4Xh7T}b9I&`2(=LqmTS zTXMPKXa5j`2EY#2ONuN;m}jOT-f|MFt2$js8*ewyZx`weHkH}VUAR*(cH>JmrHA$$>YrO{^5@~<^mi+9EhoT>k z%$J_|_?dDD3m6(x)Sr1rM)gdpP=k|<)dR^4&b=#7Jl|M@hlpN#A|LJp0x-}-e6d$1 zV%sCppNEI2L{CV#xSu@Of>Ve!I$vz;UjERz{pABP1@p!WwK&-T_w5sDTt6f~yZoW( z-&+xbaO&-+(IA|107&K_+CMpXen@*bMft^d~O^K zfVK4GveK336&%CN_B{B;1*`#ivBYlIU+WEl4+G7{jX&y;t+uf~mlIoYhp1b~&uBaR z#iMRX_q+e@u5HpUUiynNp^?)qR#O(YQZz~X?Nz8#)F&kmCBefbk7k!qN2ogSc=wDs zr_S_%ybJ@4XG}DCdq6$ZEEl9)b%=<4nc;8<1@E$S^2)M_X)ZF>t0l!`q-61rCPxM_&cZHQy7KyF>v6e=j!X z;nwqOj^;fHa>qbx)L&H!+Kvv_RL~|DrKM!s@=TS8sY<1u zmhB`z1?^aiJqy?LV)(pizq5BHH39#Ofu{8jKeY32KA*PjY{z-s00D*uR30(Dwn7;; z`3RFEBFS#CW^hN5H4lhbzpo>pU3~=JIv0Caqd`4|A`rn?OpBE}q>n+*{VFzutZz>} z!CA1h9%sI1Yy3}#)nL~cynJFq!P#Xu?M_d&P_Pb%zAr|V(^n0spFdf%>}@5WvR8#5-c?5DnxuyR zeW>!{(Ppqx?)Z)#K+OkwmAAA}FpRL|TeA4Q61oYrgZHl6K|zrS`@{U({-!^-#xDR* ziGl8ZSQ4(_9HG_97w)xr4(8zbQ5-O?6(n~S(CsXt9xsb;8%Z0*hR(>piZO&McWYja zJhHMI>RZj&itCZ2Dn$O)9s=r=BQ)kEu2g!{#NKE_HDgE=$NKWt>A-j0ixPUFJ)j?& zU)9)xC!aer|H!mm;3+UPq};MKN|sw66i6HT*CMbHezy)?_L_ilp_aAFu}U;X+>1?>o% z-Db_^b|}~U8;6Fw>nQZ9x9%wP(2sLFY{fUkPuEIT2uZ<-J%2Cm(Eiqou#cz1K+kTA z3Mq)#3=Qc%<3~Lo?T-l8R40{{j!jVrg8-7?$l!0x+~;?>6ylE#1I?kEDFPBMiH&(| za9izet6}R#hk=gR6UGYY@D`yyuM@cdP6YgS_&8-s2^Rjk!R-#)<}LstFwl%{J6^#U z3%$k}?3C2(-KKXouhs4s03!w(>z^vDNzn6ewaoG+y|*)ppi7mR%Vn8U7K+B z$Y%$;uSHm)C{%bCXLZc5aBu3oad1uc5m1!+_!n*G2WALs?r=`#^zS5G zd@7aw!@GOV4zK* z{(J>1HU&#%O3`I!#h?jgr6CIx9IRGGH^aa;GqU&;mJy!4oXURk3cjdfTm z(Fd(j?^q|GD6l&oATHlws!My~8@R?L!u$-rg|boTYsR>66CA9wO)yFi)+!nY|?inrQk zrNxclO=@-=c}+M0WMH64sksv*1UQ$SBnxb{MMLICQBM*c%3VhDQ&hPW3rwxVxSaHycHMM9nb8 zZp-DiIP_8-QaDOHBA}al`PY0?0!hi_<`FbIkgss0<|Vxd+I$oh)H8BziQnrV+%N%n zhJjw~I6tMBkZ8&%aG2~C-z#$;OFO^cnzVi=8`KyBEs}`O1+;RX5Xie8ejj)PV!7}+ zMNupqPG%HzAJ4Cle9J}oNx(sjQp+YOlYAbH+no%d2?HIT{#1}9z$M|uW@svd>IKu- zYkSp1Q9uK*s4LOWe+fhtS~T4RMbafSX3B0z&oI#S*)QFwQqnEZ#KCb!3wE#Y1v=`> zi4<3cOIpXimZ?iI!NC^}j1t24zP$C!(;#{bbX9)HH!{LlQ*MSMtcbt66`g8ATu{Al zWejkOC1mPw>Y2%NFP6K``R&>ST*E+5)BmiDGrFM2mad`ZaNVQ&(35(ev@Gs?Cu5Aa z<>tTwmX}84*O|=n;P>+L(5wi@0JvSy?{jJ&!Pi7#peed>&P|acBOC63(x7MxHOayH zhE>)AIt(=10)CWH!cheae=!hEfjRarE4}W1JQ|LS@*kK*|8*fOI)2gf_DXDDy+6dd z-|d-dP}TBVKg;+=fxIf(HV4arA8b5@#*)+jf<|GWIllfE8DX3~$5B+st*04N&Q!62 z!@)o^{JTps#$hGqbf^St$dD4@l6`?YsslC*bk_FlRT<+DXimyoSUDQ)PCl5?{~OL2nNMdX^_|xMvAIwSt2yHPu)BT<=N<`s1eidD{&5paEaD9Edg+ zW&(RKRHyXfh1)W^p-|JW5M5PSEzr5f#-N^Mr33$xpB|aVuK_3xSlg?tboxK?!-Gs2 zz7Bc$ZjnF_+Y$R32P!Fr7P}*_fZKVKmqV_1$Nl)A>`GitqW+2ot!fwU%H-e=Yox`K zFKaMmlSb+9y(@2|9|Xo?pl$50`!dp4TdpmS|IPw5M~Wu*{*#{{Yk~d%2qzlOpZ5J< z|NG=5cV11?wC#b6GagP#XKA<+?|sra50=IL25tlcy#N^cP(VqMM!x$TMm8sAFdMFl zC*n_p7PCzLtuxcM@&N_FXbiLjcj#q|@us3|*o@0$UvltRy0fXh5uawCW{^?fi$QX1 z+&&SNH6%J6D9X=|wiKH(vnw=5m;-jwYk(ywWu?2_PY;3wiTBy1{~c(386<*%mWtV^ zhyH(|9_P-*tQR&sV}x8A1DzGEsp@7d+{lz!%-<2%y?xtN3k8H)80&(?{#0E?6PsXJ`Gr1UdPY@HTO9_Pw%s*lq+<$;B1V{*7Z8*@R&YI=nEiHbz=wfWq(A*-oY95Z zIncmr;&#*Hf}elYeZGbc-zD+2-Apv4^CwKEr3d`oNg+M)hi-hMY!DW$6&;hCtlXTC zw<{(cI?HqzXq=bo$TX&aYsjfYM-uXbhyYjXbgw5PNCr*G$~JLpG1?A60Ss_Lpo{=2 zEcVJA3*8Ru6?ndCeffE4mCmy9ryyv4DDg_)xu1`Pt@kWww$@5SsUV>K7!92;=o-4Y zYKA#!WJTV$a$F1}G@WZCKOct$T?yq83Ys=@#{gOzCj`qV2f;-{nnEg3FDTw^w#iry zJ_`dKRQ_}$9FA{4OE&jJ6;8#wGe+v;J7qr*V6ek^qMk!eO-O_{|SYYlIOZQjNh6jN3@ zyS@DU*j!VlWd`^s{z!^hg_61&10i5+4^uHGU5huAB|4r;@c#ffje)N2ObV9~#^amX zpc5l6-@%&R;{ii`RWThfvY{u5FidrOF*A3hXsy28Cb)Ad+C)q29o@6HRU$W6M>Sgg zU+OI5gQ%7TL9GIdQr)dI@AijV;UKII1Fb24b&+vS!0uMVwb9AxOC53+%>rZ?XigsO zDkDrnZLtd`|J>bzVl97ximI zN`Wu-ke?otYXWa=;#jQ%7o@Q;&0bl2W5+kqQ${aiD z;X+^-23o^U50o(`LJ)%8P?l-?xBzRDv?$pSEn|R7(jWoi&i|8Mxb$cX@CXCVr-E1+ zR83vvNL2C7-)BRC`rZ{W472G z8V zI(ckaX}$68iJG#qGx^s?@y{K+UIccFfwtX?6HrJOBj43?;ZkvA{Y3W^3X1savwxw8 zrBIsHVW3GUN|o^?n_$(Kt6kco^5QvS?Kr3k>M+pNx%E>#jLP9oU@mlbyuJZYVW81{ zHdRJ9G7PS<;`Nwl7gV&Naeqg;{B%+_+=r2tWVUiwC{Q9eZG7=WhKyp6qY##OTALBH ziXSg+K5;up9Rppa*qVt3w&rUWRDWrL(&y3*W|^*Jv#k=VYgH`?^@=e1L0Ec!nv4mm zNZLgtFNaoZ@rsErfW$D+Zo!cyqm0hYGZkrV40`4G36PM$PDHXrem=$yCjd2*j@edo zB{mz}g|%M_WF+wp_>zQ%XQj0cU5qpaB}31H9UjLG@6htVy}PRZ1~KiGKeVIWy^W2y zdSx#5AmQfgA{7NgOlG@{yOf*Nq}!&g&$ccIox^ReyR83=>; z+ixyP=wakKsW`t@&A+ZgD8WG6aE*B?LSol;8-0npOPQ*{5EbzI*F0Pz8*xgN;DausJ=vZ>phPq_2m@E zE$NY7tC3$nBiDUJ=Xd_p_ZZNPf!50*YtZ2+zMS>1H^1EkS0d;z(8fCsp@IQMuJ1wA zIGeV92xOZWXiqd_Ey|BJHsV<)w~foa-(BfQ44tFgRqvOV8Lf)1Ip5n>+Kj zsxiZH)Jk+3p;0hRXul44LydzN5iezGvC*>Mv=fEI7`Z;JGIqhZFNcBhV4#t7ds9sr zEZ}lYmP~H8h4w!7?Wku!wK34@ee`WLVmKLA#Ghyj+eQTy`Vq(80*4@)UMCeXhtND<3&Td@*=N9_k+V$a0kR}OD=cbh>~K- zB6+Uz=r}lW!TVi*osL_+)$4F}lF8pzsJ^i6x+-i#vXI$XO6m$<$Or<`Si;0C{G zfF={x3fwy>2;bfbj2``y2aS8N!7Ft2WuA1c@43q!q!S!D>>B&yU*Nhqm{9fCRSyCz zEwi1wOs~F*hfaWo-}2y;zaY$*XvAaN?vn<-mCzH8c3_~9e)1>UGlVaz%E-7@?*7gb z?SO{fMY{*_EoWN2e|KXehz}SHR8LjI`!GHHSv7b?r+cy=9e7u zk0aAL5de>673Xt1>Cr!)4QdTbO$_v8F4Y567XBNhjuysWn?C^51p_^qIMB?&$=nRC zxw+jv)MXgiI{ip`G;%P%d^{=)e<)MJN}L`HbQJLyPQ+Im#eRZ>L}MTnkILkShbE>( zbm_vYEGTL;=}&CaOnNmu9oCim;ouZwP-I!@>+-{6_){}C0v`92eYy9OzcDThG``&`e32F6gU2yC z^m`&{u<6!9B4(l^m%E-Fa69-O8U^YAF|u5K9;-u7-j{c{(sve~2L^gBJzFZg>0Ti^ zPxtGT1X9@Ct2`aigA9uEA2o zKuhuq1z%W&#Q4GEgq0=l1P^piXG|M~B7VKD4XOZgIIDWN2RAPsNP0B6t@7qB{8Bsz zJ`UC>Kf9l{o6XjlmJI%N@+iq!Ww-OZK8)X4eGYPjw_j5|%uV`@E7zVxEmDku;AO4t zrMHhsfp3QMr2?o72#45kU49gMcYYm0*v*2->>WJQj^I{6v=c-Ie&~+!a2U5A`UEZC z5)GP%L8)WnlSnhdJhX&W>`8D_9#P*beXcAR2!CUs&EdWZA-_H@2aSTs%?tNX6H#%* zfOliB^wY;dLB1!akMN)it2l&vY;)McGk4rsz#;`jM3;&kwM-J44?5bTtkl1whX8&- zCqlpiEqPXXHiG}f1(J%@fzKLY7mvL&e|(UaxvTNR4!bR%KlxXum2^GijDie$HY?bi zhF!qcz(Pr`Pt1((GZxZR4D^C4CK9d87`4D={0hPXmmTBuODV@=V$MI0Xwu9=<3SAK_0rs+H$jO zS$6)u28lFi@5J=cf=h*}vaAIY9q=VIZtp(i)R(i|SE$gG7RDLS?Hva0O{Ha%iKkza z;GqQ0gl4i!3Eo$eppH`sf^MTd2;g=T(_`17G7FxlY%JNYIWrdRhrf7weU?}Gwe2h@ z5n!NaKVc$zl*-pHkho<~(`kSJ1KkPQB+WCG1jj5h9L=f3SEln`|NggsM}Y$2wnLh@ z6B!=7V{+l@0^5vA9IMKoX2jogt2NDoBL)sb!p%n&)Yw!FdkdR~oc|3L{TOItf7OE0 z#`Eo^zEU*iwX1*t1Fg(w@;s!$PAc5n$ZNa*u81ED5lt5ct7ETbwyJitDUHu~CujGM zhiaA%1I_nY@VP+Q$`Yo7f1D2GMPAw@tmuPmW8HDkbUe$0DLKcMKb?CoWYLB6K;NF_ z+!IKc$XSp-m_;J^-MJnrqQO+{{9D#5mc7vn_r7DGHQ@Yw56-ccT&soI06*=qipzpN z)n1GQgc#`Z>*56-q?J9MfFjb2_~V;Z7JE>{vGQBp z@UW4W-D0EpRp(g`#$@QjEwZs2XC6CGHs3@XUf6SJJ^aPfsJYQqdiN*rCm3j>+q6nW zM`gal?QsTZW|pxwtQU_z@4+-$>xNXX4h?i;9AWXlYdw#TnVp>lm!5Ik|MZ40{E-dH zgMr>mC|vJBIvT!q%rx3`FQQ&}Ftjf8Rp~I${0b@aU`(_XX4qyjaeARdwJk>c^}x?x z_8@>>mWp#NPpb8H+^zT#Ko15w-YnZs2^ZOp5abK0>+e(a%Sr~@`_DsiL8zweGrxu@49>fo1G4EXA}2WutU z?$L=1!uSTCdoV=j;q9bMlMfF0KKlL3$lo%?gEC;CXZyhy9<0#hSXgMz_1Vc*;_HGY zbyh%Q&G<&aYR<(`h1-BmADnz?1UM@UitbLtYyCCfd9dPR*_BN+r1XU*H0-pALa2m=qv#1FKGeJKL6Bf6Os~X}ZUcmL z$O!DP)#DM5nO{0MI6z1F6@%w-ES*C5Jd4ED(8m;wHZL!&S%|br@)A_6`uy;W2#cCG|B-baLYt=$YKeLjLap>3g2LKM=AC z0F*P`=nqxa%?(A}5EI-e%HPt7c0djQCe%7e)D4Z{m5VweRi(CRUBMVnL}fNNlU9{X zNcFwBIieL{OXS|%Oj@NNQg$cFB~TI~Mq#k756uh7H3oGnD;*q4D5ym3Sbp#W=|TRz zJyNj-Nkp}VH&(XFufDRR8YPfJfDYeQ0$m{-$J9qk<-k_gs_u#c-NHa`H=k?^==isr z(WpGK%NpNK)Wu~$-(V#gX5{xaAJlvJ#f*&f@i|SeH+z=vF19!NiMqtc zd!g99U9wje2EudZS#Tl|`*|u7z2cS7fFe@E_%p^s zPYf_RnR#WyV`WRU{8w^u{p!JJXOXdCF2^@-nzf#O(s#m=5(i{dB0P3+knng?daP$6 zewdXilv}fwWqcgx{%SlO?>|yu8)2!iG*%rSJ815h7?Hb;QokwCKm6= zfNsOopaS*LB;@}T-$vUfSN!jP0-V7>&t*v}$}izOlKo&VVd>h*%Jhf8B@DJ{+^ReI zvx4q!p3*L4_!I?c3S7Kh#5e&9*8+I+qsCbO*5hGf7-;SJO@(xvDTh0xqaC2jQDvoz z(iEbSAc2FU`IY!U@P8#_r?1mg1<4SH)ilk)n%m=3n|S2?*W6R1`E`0K%Ad=(a^13O z-_-fQ8w~WywZNp1Ho=t7>o|Um+c$F+AOlGBiUd8<6^tWnjyyAWh--R2D+=wIVGIP# z4#+?U=Yg(qxbmwXzmv8GXu&`yr0-^^NwH6ZOK^E7_+jM!w}9>Fo!Q1ZKn}`8pUyTm z=GoES{%C*vIv@oDon-ejqeJtJ4SA4!RB-d&N62URcv)YvNWNtUb2^ZL|d2 z=O}37Z8%NlRmvHAwhtc*_%P6#9+a!#9BRr-w@6>y4K;A633>>eg3HZaDjZ3cq70LT z{|E`%Sxf@M^gM-*A(rV35B|89Q|miDvviw+F$uoOsd4}JV+*K-+tTCl@*e|z0Iy%Z zf;GnG$b!>EmHJ@Fve<{;x{cf;UHqD|(&_~Y>O|9YXbj^OuR5!vJ;yZ_&S*zQj_)E& ziSON*9jZkQZ6#kj6jCdg%LJBAZdZCKV-Ep+1V}CF{`Fd zV4s+u68gmuHxoU2MAT@1u|n!Nyrs)sI)bEL%IVR)r;N4XRC4NU1r=1Gin95gwc7pD z^c|gx4wmx85cMe~8p*Ho6w0J?O1!r6@>jc~;PVi=;rJIVWV6#nA6^y9_?;`P2<2ycY%Q1Vws_a8n!B?uZdG0?@{`p;lo_9E~}6)mAbPhh2! z0Jf;U#hfno+MWY+qxn0wPcI~^*=JV3W63GKk}9#9ZT2)_M!V-l-RP0rZ&cs)LzBK? zHAWQAs}bbdM)da6#(K~V{LUItSLsU{(IaUF`;e$haoBVCzwPl$@tr{5)r8J3in>ai zOS*BTM^K20$iEcs;=^9y>j7QzE6KXIpE~?5!N-@cD+jWGjlhYi@XVD1ZFaL8i2K$sM20?mlfnbo*;J?cZ9MY_w`+<(L zX+e&-y6q*5&oR{7$B|U6il?!^d$sR@$JT3Fq2(pfV8Bq-;AaS%kZ(;j2S=E#`L@J_ zN(Lk2ed`-HbGEN#{797F_qw^#~olXE>$foJW) z?MQ9gl0gGH`kL6xk?fyIh*r_HF0k;Tu*X6>$B#mPnEwOTaLw(x`I&9!r4N#;mdznJTob3ZcRZn8VnWU z42Gvq|Cb8*@Q-9LRIh398XS{g7yvLLECK#eAW#|p5)@jQb_zWTS67UM|Bn?M+p9P5 zG*?p)U@m#Aru2SCsK_2<5cXI}1wCB3glKE=NhL_j!X&htDvln`FQj}(AG-eU&0L}Ko zqTQX?v7Atcf>dl%HZ7%P$Vw(NgSDNiIwr-;!To>Ze zkEjl8U`sYao!wzxMqAU(*;Y@wOY!p6K#x;WDHv^Jxn$baVuQY1pUBVVMQ7tA@cUEbJ#wQA1j)%1#6Qsad$0gC@wA3YU zMupZ4l`G??uC#2h+{cS=><%BM&SQD1a*7XTj>8Mdj^JA|lV0-jC{OU@)v+BdUNqrG z5xArxVY%eTpcIS1)D`tZA8M{vhPT zI?N?m;dp<{A(?Rbw-;VSax5h7@?e2wVnKB2W#)28)Vpdo$tg1>?!0f~2y;=6$7#r} zefN3UwIgYtz&7z$nmNbs6WYj82=a?(6LK~!Nw$Ot4~ioXK^vC}ESV7DIk)zehANTI z8YVt@9)0?Rk@up#xdO|s9AK}`0B>Q8Q6bS6^{gY*V5x;`DyaQz_Iwq;k{~mF-3Hc# zh=i^*1Yc2UW1>7*>cS#aR^9Y21@e?88U+?J<&jtK-jzpwBC#hAONwKht%|dwNjRwp za=~b!4P*8+R~>r?vdj#er6SH5K1?$4>>Z6Zc%d6ULZM9R;nf0bQA0y73eB8>YlJr? znNzK2Gv`mjj`_1I$|7~NyTL@-c$3s_*Q+-y%E-;{v1TOe-kBI_x-xX%Al6W9rub(E&P}n(i z5o?)5q1Paa+rH?5q9ECO*+@a|B!)8VSb7ho`U=bi1yUI25nmxkaAdsE5+yVcrpgp| ze~*nEKNEPwB>|LcWulj*^@UYvsRRLME-|GATDU9t`)oy8UuLoF&w;b9(Cp8Zfmgb) zl#0l|_Y0xQz@bqrCZIot2*HkhQUA$8{dQ%GVE1`;8K?iaYv!C6A!T^c=y<_}L@B$DX)@y$JYrdx1N<9`t}Rq?{Q2mF{QlM%f+wtKZieuK zJo0cI_DF0z+MC9t!cG(G|8|VYw|l{pDBRk>`{ zNoIwZyRMH86wtWu#HG8k%s(h}tQpPH02sbZk-&!|Ix^Hm#W`}<^id6D9Y9TIGC78Z zbe4QkO(a!yHhe0+BjaE3277S;eck<3$W^qfM-j_A5r@|&_IH#wOz7`e_gN)0<7Hu# z%*1Z_Oy$K3-NA-n>Na7Q z!ne%@Oq-D3?^P%qQ8zwohJ);c?3jLtILn39Gm7by(ykm#rgeZgy_;_=ByB2_8s$Q zhdQlO1eaU-_6sJv)EK4b7^d|SoX&M)guRNWCe#qxGE9QFuPo5BxViUzz-bc}zmd%RiqdyrhWqbQNYKr3Pn?i6@y>go89kjstP zc>vbsZcT&*ieHI}WZ4{1;grImBmXhiP+Sml>f*9hKQZS7 zlsbC9uzc6NpVukG23tH1?i2f^WAubiWgb9+KMI_rKB>?_OCN4f;c&e>8Y>=pf;0*tuncgANV>}-en~+1hK=FBRJas$g)2< zNLlrx5~Tclp2acQ!@oIQth#IX1*c*zX$i~~L1h&B$wMlIW#-9a=L|NF}UubeP7nN8%24EuNO72rgwKOK{rkW=Am-T4J=nL#SL^iC~Y0{mb=!HI29B*jqQ@yDLJO%e+->}IRS zB}R6N7f{kLp`N4b9wlX{{%Jc8Z$+?1e~D_oEVM-Jn+lyAc|$5WHh!iA%GdTY3C4jy z)Pc7Yjs9*&XAke#)hBj^GVs=3PsGRp17W~y>)Q`#2E0^g!T-Rk=Nfkp~76nzrEN+U|J0@-}yrq zVU{xV-$-^UfQRbpWH0t92WuZ;rGj;EPl4qKoXdI&H(YdvGgo!&Go9DM1#e~Ox{g99 zWBPcgmg1v~ZcIiIq-VMbQxv4#M+mI#H#BjCa6}f;xfJHICTG=JR*%LyJg6OnUi%$F zS4HoKrm~dJdGxI4D)VG7V^OF}j~%tXW8uOIw=4I%af($MKWA1QXfEDt#-7N|D(#$y zABZUm&d0y8?9#dHo){*FP>!ehtWk1ql3dVKVa)74tN;pK{|PF{zx1i6#3uh_dW<3v z1iCLfzt0k0lqp4xhO(7i=PVD&a{sI;TRUMiYS&EICyz`Y&U6iAawxB^SP7jSE?DI8 zjoL7oD{IvBHbOl`M;n(iV-?{?nbBiNOpp*z_!#nswA^QxgYb_$A9M(x-ZjQ3=m z58DY!tr{&pAT;81wqG4!n|x@X7=(Hp6gtbY9DSTEdouKs<3cBSXpb+MQxUai#}HVV?>)^5pM)$$U2g76qZ21d~!mu zue~zyqo)PV)=4CuVOk}bP1+fuyD_5d-nu3 z%vxkl%kVJQvhQ2h%kwOpeZDYWSA7?y9`p)oNhrCx_>Vj^_HTiyt+?69G~-)gl}zk~Z`ig<>MC(J_|N0Aa zEGaF7-w+aw#J1`=b84)ChH4C|Z6#PT@;!Fo5Yiylt>i52Ac262pFVwxg!*C{LY<_n z23Rl+-VYR`jKt+6HhS&jRp4$gs4iz{(bS@BTfWD=4YC=C zE~krC(2WT31nN~wY>3W8ihiI4cOu1}$XQElfL5o7)lsZftRc_gUL}zgk&-1hwz8P5 zOyR%FOtmDMG2)7FOh)=BKxD42;E7Y@QL}rn1p@2~a{kss+^M|#8=J^Vbeu5uvNG(w zaZE*%w@Sri@f&4qX+^d~c2@C4ug?~%?(q_DE5lcG6j`kSIDrasKJ6%;SH_O$%2Z3j zsrS2zZ^%6OwJw_nno@4IFqM+vd%QwYIKMlMyNe=hN|0MKh zM^DlA$!2Szr-fUM)(Dd7bC)K$tWjMi!m@MBg+(5bTm$C=rZ`g|CwTS-tT*j~H~<4V z!GpuqLFO!Texb+WpRy2oAxnU`T;}kl@t##2I{+_d53}e>&vTlyIZUK?rnwj;<4*VX zI5Y@h-pWHQ|1zDw9Di!TR^yROtXO-UFOC##if{{!%%NDgO6XwxkLifig>R!wX2Xk2 zGM%uXY!SNQ71vZZ;OEaF4!}^^73GEHl+%n$Vvn3eafe7WWyT-JHZ21AVo)_@lsPxu z=BYEeY##AfEv8qJ=N4C6yd%%e+K%ZHRW^|IKLiOu;zaqOTlLxa$(CQhYm%R0_a)Kn zwE^d$B=#l@{3pI-#%)-yFsKZS$gq0UZn0j;3rVTS2PKSA+EeWEs-}c1> z_V6-psb(f~s1sVBT(yi*HJE-Dt6w{`zlInq^AW+AgB;pi1 ziINxFR^JP*Q0Wny0%zzo;cbP`11U_6)7k&sQA{@BoDd)1@iun*i=wOmny-Y!ml-Exw_P^nHCxL;eaz}|!xuZVQRDeF>@LZkaOFLAPJsu4 zfmU&*-V^#N?DcQK6fQ|@rnV4&k$Kj)Dccc~K%CS8N}H;6fV7tE>4AWoIbj`lt@+<{ zV3UE#zH5~#p&lJYxuXCr8o-Xch^7NAr z7Uzorob}K_(?w=Y9%IG@ZZGt~bWv%9oW6uf2{g25M}^Rjg-kQT2IAaOBCb|6{_14* zP*)V}>@`KKq_j8WV zv5h=_NC{KSWhdx6gH13_ye7{OzgBqRyVMgenxSh^#!AlOrQ!$5__O)!3F5$Jdn;+H zqL*=t*i>L%fVViI4880S134Aw$3r4(<4NAd2-qujQWo?VGIiJqI_$#Oe}!jC(c!nnO|onkZ(_0vzdY3WaFf_bA#~$9 z=2++Tbz+e+?3>+e!Q%P@Y;r5%QD!M~IxM-DK%)=Xq4R$+(c-9&97^bb z<$kST6k%Jk&VILR+Pm^tp)oJ`rD#eaEyXVnfcw>%bFs`s(gD3i?!J zo>V8@&5o;+sygF}rJjn{&!}MZbg91)?KM&%^$cQuWyTOkOW$t^B~)L~aI`Zk9x zB@CF}7Wjk#8*jh(gwFjUJz>E!K)`G`$J)TyO%YC>zp*~2qHOawvNA19U@)p3U<@FQ zb)TWd8`0C&#=3qTJSeU_t6$n01Ia^6in0^Y(so8~zmDZR6pXqwGy2Pl9vEz7?w}E( zW(B*3&TM1!@oyVa4)Q2M%)~ZPa|ki$X$xZoMyMvwdQeNFKY8Yr(Dg%+ttH2-gHgMt z#sGN&LR*g$2tp|^KpvXavK#@NZm9@h*V=2-WL|bEXS%`YNqdF@cIC`869&jL?a`>5p=)7)JQSqrNdc6K>Wi(JJ_t)u zPv)WW-VJsrtNHz`)HSk_+-X)0!@4zhX<^MEk3tMW`7od>w(vH;_L$Na`~!wc*uo1_ zgW;B&w&jU52yJX)3?NP-ZuzJ&E;mD*gp8sboltld+tkR4Kg;rLQY()_2tpTNfGn>^ zt;?DJ*fxqoxYj%SuFT%pz;f8TD$wXpcsAzOscYTwtb9MT0-Tpj;X==P8jS9?a|!d0 zmL6Fo`;t>WTkgqzp*-Icj1Dz-QPB|0(t}|sGI~%RS{aOvw=nv<4P5)#^KE&S z=LuW~)Rb7;tLB!zvlOzmt3wDk`ip zvY4h0cc!f})>p>wvN99Q&jmFMO z0^9fz8!uGyn>nXHGCq}icu@myHaE)D$!<+EGTXC&$HC6T7meE#dAxFvJr++5!PKfb z?;kY2r_eli2b0aH@m84MFFTBD6uzA~#~w>+vhBZu*jDyy?e7|W(Cc<1>$)!IQM>VP zg@*eTC6>a;?Fe4dQH6v$RVAh_W47s}3>2`~rhj?%b+*t*9R1mKV~q0l^du%qLg?`% zW3n>;?aSF{39qU+jGrq)D;>-piw$m1jIozeUOjt@J(Q?!&~2mZXx2|T?6HJ|zPZM; z%FO;TGF{X&YB1-6a`1L}S-Pp<^`6U2-{7>nF;&rky7_FELxhl*Z>+7LY@N)sNbDG# z)02&(6d{BSD~Hn8hZ!T3vFi^rDJ2`LIw6#-HL^UJ>=Q1nH4agzEs0{Q49+N_ysTU! zfVwSVPYmn!swFB9_D^9>Ot0IwXR>`FW>v2eb&>dTFZ1PO`cB<~(lv}Nt+M{J{?E*@ znj0_t*%+&cVfNq5nUxhovoAfd*4H`tOJkyf^`~GqRxMeUJy%?3CezANuyS@e4pFzS zzIQ$cBkC+LdMPGxr#l;WSth6a$s7wzrj+cvR3_8pj;8Q5qpPFIZvuNP2?VB1FuHac z+P}%VpK2tzocO}!N3PTc=W_kcsfD(DkKIosv-RBg@A}g(xAZ89Ak?*$ zq*T{NwPN2%S!QQ-d>e^(%fu^GVugY7E^}U}q~p{GM!L*EURn7JD1C9KiG zH8i9>JG6rSqENJ^y%a8MN58g`$KC+-rfjq%sGM2B-g#AIY%jHzG1qM;G0Q7JL=c+V zPEwluuD53o#m-bCVskK)2(lMiIYb&KzkYoiW`vJ9+YU)>rC##TkK3_1>v}ygUwtn> zHs7fKubTJ+I!g^1&O~l6Ax=yBZQi?Qpm>G>JFP+H95YB?KSvk!|ELd>FLuEeeo@??;J5yCAYkWh8luGI~dxAc0e!ovBmw+fXr{_fufg zeLbs}?k-a#Mli>cuu69c$J_nbrht7Hx!rmROnmBH92wbxIdmWD1)q>{ZeF6sbr?`bjoZmF0HGb~(~OdFbg$60;RaB^eEv zEGZpaQ*xNgfOC6}^r2D@SwGwJw1hd*_c8%uk;FQmp?WuzRV0m;hi^z@udmC-N$pWB zi`1EHuZ`UB+Xd7+i5-Ti(-UWSqpe9&OZg2;XEA3;l9pSur1u3Pc-3R0+jfand{-y& z|K3HDX;pY_{AZ|2I&)h1eQ+$?t5)r|Z?u)Z_~7usGvRT0wH8R9p%>GoA@UqYj$`W* za505g)#?*h^3%XVG3c#ofZd$q$*S;ORjsSdgr~Ykj2kbAPoH+_1b;Csd=r0v0e;Kh zUx2fa5gBk0@>GV@K&I;3B(~Ck2S!~-ODpA(SI4vISH+5knq69ZJe3{55!-2&CQX-7 zZyd`WN@BfQ}EQls}exTVJBbw-)YH8u?!iR%Xm!~mCacN}&6q6JXDpQ(MJ^GMXH|PZSEjR5 z!2g5x6YQrJH@R#DE3u+R6WQ3Y2DZXso*d#q=gONiv2Ec9kHmJww%S5$hvT}Ly~KvZ zlozIc5;Yx$VbGg$tkv#mxmA4^>O4vsBTIh8D7NY01zsL?ZZuPyHKg6gxO6l=lP$n! z#eFM-snI0HkV(j#%GPFV^G*`r5Z?D+b#TfgV9g}dH;c)8mF})pXTn%4gf0ux`^th4 zAYgv&B>b~Z67rv2u{M^+n^B^YD4!@|bJ1l#UF3OOpTiC+$Q}Tx)suR{!J{X}`9ie@ z1Fk2;+42kR@bM8(?x^gp*7POpY+pOs_}Wrt^oaT7yt5Q8MIpg*gX1@T>{> zLn1tpLnK2EhLfjbza6*ed*CVt`RQm6Ph;1B@S#eQQ1$6k`qD@690r_F#anaJ&3QJ@ zeOI^&RrUb(=cpVB=xW5h*Ra_~%4^#G_`WsFMO^Eb2*VL3OhEm?Tu6+6p1tc^8<{l` z-K|N;`hmo3*TPcK-7!0PEfeE2DaoxJ%(42ba~5na=k55mRwCAh$u~E=45=*!ELLDf zShl&q&63ryl(FbMudHd<1I@2CR1@JZJPuhvd5=DekO#JfLdRUHMNkSfb=QkZJ;?e=>ZwiD$$dx;4q`4fB3 zeD_Zf1B}`y0`Zrr(6UpKcdybC{Jiq`0CS2h-NgC>){r6nUOs5FG7rCAG- z!&1z+1DF%b)f19$_tKIU6;&*e_-Hrx^H|_gX~}_#sL^+lcT@affpSz0HU5U^$S^3x zDa?z^w5HhXh46haKB^N8dF$Y#b_NW!D3JzKQjy|?-xd^Wo8(Tcb(ODQmXYg`3xu?N z8kPu)9UlbdqpMYozb;h=J;hLkqN`>#m99agL7R=RrdzuN9;a4E?Z1`k_2J;LwO${u zX}}x|w9fxm9mSpH6x5OI%#Iw~33cOls-rPnCsbB@LEJxBa~Nj=t=y;ZFJvXjHiRy)+) z`LL$VNnJG_lnn!|aQ^jFq~X?r0<&F4*@VMUOqUmvk2MTo+38kGegQ94cvW-xiJH_@ zBVgVx*Kg0X=cL&4-76C?8tz{!<0g_X68C>uLlRa1A6Rpb!5so+{n%7rrNZ^GNj`R? zY}rxuZlEE+Zl8ap*0Y9op+Z9y=U{sZu*O`F;a1DN)7(w1_i19RYc(t*ths3!HVagt zIVYzC5gGm}A(1vam@6-W;GZUUj{xn)P?Zw?nvEG^lKuAk@gBJB8QNMn_TaC2^^ z9dcwo38^Simy=Qr2tt0=Fb%Pr)6Ho%d%8`rbPhwu0tfFrvx%Obbh}%vbE|YE=ZMnz zG*uBqXTbe5Haiq)`KE+U!fFH&*|cUV3i$d}zHJh|FP#$w4(cHI4Q;NXNU(xu$tvXL zgypScB>|wd7--G?T!+-2Yh~(7&1amI;%kChs#Fa$=bLc_fOA^kpOkz}r6nJ?G&mMj z@M*#M6!ww8j1{fa*Mg6P7xTVW)iH1~)hQ!RZmpt>fX%Wj+|T2lsN%BB(C_WiNdM80 zCgfZ5Z1`if?va+osgH4LQ-p>KZPAlcQhlC?P5Y#2*^u^1TeKb|z!NZhw)0qvmw;aw z==JWcAeCn^Hn2}CdrgYawMW8fsR0jdYLvhHCG3eQcEv!|Y#MJcxh-1O_@bvvkmKCS=&NnLgoJuVSue@(n93xeL2m zF0Lftgo}TbzVzeo{wVaM+Pks|FO(-D4QO;_Q$wz2YW*eoj)t(KpEmRO z!sKXcVIgygFS`KQ8vL)#3eZ^$^rXG}8_;%8iM|{vG0E9w$v!BEVW1O&zX3~N9g`2w zGS+oT?4CxT=NM>O9z>(uU#0q7O!5DhFvS9H-Q`@uav{vlH>WdQR9UXXPH8%CB~XEZ zUJJX#qrP_}A0B7ZDQRiN@4?Yvppn#rd#zox4YL&3vh9W3q=BaaM*}+=*wfG+xo47w zHY~rKN|8RTM~f?xmF8z10$3(2x%??1ItaQ5&UnRW^zC1gAD5*5t4`i}c8o?ggw4=o z&F@3D+$4ebPP2w0YN9#Yj&Hi;b0`QeMi6UOwP+~9;LEk?cJ62se^t082pI#dx1~Cy zF_yw?sE)#~XG!bmJ_2YKUgxMw4e4r&Plf>%dz-i_K?U~XKlX*307IF$HA|Z_+(nYg zU$S|6cU06Im@b<1k5m&}(2N`nQ;c<@-NNs9WBT-16#oO@!a%$9m^_2ya+XgxpCqgP zvoLZH;J`pTq3H!E?=oK$y!q|nryBvIFwo4ZJxQD5FbnkCahog{D)|9!>nX#5;nc|* z(r8O=p*=OL2(~8qCaisM*j7Ef98wv$Fv#x-Rr<0479uK_L9b=utIB=Eem%A^YKW&;iOo;;)E7x zquCnTf#ykY7Y{Ge;TLk|zY1hxph^Aj6%A*&IX?x88F(o!=GsT|?ptfs9YBeJ_Uzxy z)uFXyTevF|bIy+J^2lJQXMkU2NUbs7fR0u%)#Gy2Js}VPCz-H7qoZGLf%4H&K1m#? zdZWY-tO^5d=5>~6SR>83kmzT@M!}@AGVc5uE6w?_|FTm@VS*TF2RwZ#y7muW5)IF) zKXp}W!bUoO87lrk@`>bC5B%+G*9JRnQWs@RX!MU#6&~ZfS|zcPdrTj!AT&9SjP~Mm zk9DkLXS#3&sPn^_#FAAQS92~!7+QmbsX4D3P;L!QEP2xXGUnS<3@Q8zlp280e_z;74d8 zgwH&dbj1F@YOc(TmcWGL8gY^4$p!qeyE01ys{fZ%6Ab&y&r#4{dlcAep8L2ejm z!%07(krQXnEi@;G;ZI|8r^D}EM4^wRdXR{}e9C|ZKbHJ>*t4VKFPRpg1w%c`wN^T# z(GzaYu$q%$vm_06`?x9cYjd+`^a2nb20AJ@bPk=pE_w4%=>H(&$XYNT3^d1xkRxc=pDPy2{x9Ez7br5Xga##9#?)O{V1Y%_jx<$nV>*$ng==4>-V0Xl( zozcI5wqT$Q>c&qRVG(xgbF|~QiWbE<H?R%{vP~doj>1 zZlFm+8gFICAGMw(3v(FOK(UhGn7FYHXCUPL`rm&>02LT?o)H}5no1fauvLT?Kv)O4 zU2bvDi}y!21eL)+$1rWHX_%pQSZK-5=kFJlOQ~`tmDa{(H8ivlc9i*4s?4Qkcb}5l zbI+REHckwdPsLCxYCqIBr(eYh&I&UmMtiffnFjA?RpT zzAdJXr)RAi1(t<@MiSQn#Z@qIZS0J!|4*GUKm`U`Sob?=^9zFwC%YNqB3=z82@#r5 z&r~O=v}AP`4O5IcA2`LG{8y;4t7bi5JqCJ?9bOO|*YENA^JzypIuA!g={*ZU(iQGI@o5nMi)%7X0!Vh z$}Z9{ef38}j0=M|BLv4E@7HO?D`C|0PhyUpBLx)thvb9u{*)^5Y`K3hpx^|0^H0ee z7UiD($xBhIds0;%AH2UoPES`3Y|1BB`+RSU3YeVasZSbLjwv`hd~5Y zBOWZ@_R0Nu8(_fDh{6&!Sa8%jR@d=lNA(DIUg24x>k~YBa#68_O^#~&Dz@Rng_9B& zlY7VEr~P=Br?s+N`wYYM`*G4fY<1J*y}$zu^(j8|O^`+0_CBA8^&F)O&e6j$Mc$5w z+bVNXRXOB(1DAB@GI8uknJTY8rCL04zE!PRJNK9pk_5Eu52+cC>MuC|$$ZpTR{f+g zG6k>Pld5sWW2d3T1aeICIL!f!GH1b|3~pzNs$PfGrnID1iiRS>TnK?wKEBw7PqWaX zpGaI-IZZe{7VaY1A=HiWDH+Vzct_l}(n(kNyNHNfh!k-h+wn`?hvn%kd z`lGFV*jIm@j>d^5uGG7K=O!PmhX4TsZI}TW0@@!U@LG6PTNi)Vr4nF4r_+&k;N*R?}IJNzFCQK)2U z%!8!&)B0XPKm`Umlc+rf-I4e*iElS8*z^h@z~DzY%f(X#w5_8M$eE>1zPmMj86d$x z3pZ=JroU0pqzAD_@NjExDsF?}NZ&>p4EU(=O<&Y$H|QV+dOKjqOb!2FD}N@2Vylon zw?QQWx}GBNhHo7&S`Q6{5D)`huvq`HMo6q#J62P+wDs(AJ7M{@fPY~#-S95}jkNoG z4QULp&d$LynPcn?l&P@c>&kt?(#*;pQ*rrp_SpG))MQvzG0a5|3)rU6vVt&qvHzb9x-5`7uM2^XuFq*ulsSWK=x-R zZ_>z#vE*C%E8=Kp9m1JA?+PfSRN$`AT>g=yHsiKJT_?+zcU@DS`VXFZGmZNxKPWdt zg<>^CmoE1ZX(`ON@pt{D)!ADQw|HTogAKp;HKeil{CbA_FwgDTzUt6R2xpPz?9yw~A4wVMZIV4x@1@*ssa(mcuCLQv0r$0yq1WAcR)dJoYT zJ|?cSKM#BP`wWH^2?M<f75fFQ$RQv=s2(S2?168 zRPf{Mo7z=!|5f*rzH$PEHRP*1rqw+1OH+^#26|cD`2{))^W{t4;EIl6zlQ~W35+2Y z>Cqtd+;|m@*bxuH#Xv8}PFukpgEyD;CTL+NlkW?qC7r)k zo)1g2@Vs4qdDU*j)t`1f9BGH1#oQF`a1zC}AYRD#yo-8kkvT1cWA^0z|Lz@<@DP*< z1D$4k;6fM+hnPS@o-kI`O9$Gl z%gk-FsD?k`N%R%v=?HUns=bhZ=OK5}Fgw&(3>avy?0Z!~nV4+`F_|G?Wb{C|+os*o zjL>!bnt~)6jS9dBZrJ!VV4$~>d;TOCiix?0;fbg4*UvWGcro|};KNXf%G;O! ztk5|mhfBW_35{LuWVC-3aABxS;X4SgkV%|a$ZFPjRy1ggEZSFZDo+o$LK{Bh{@jKf zFyIgK`yf~hv?L;bQ*gqyycne`fqf=_b+ZG12;6M9(vse{6ch<&Yo3MsSTS1Gh$!rV z+sfkuEh!MndU6GNPoTe6oc7hZ_gwT?GRR%y9yBXScSV#pdZQo>)*cMB8pPgLFb*(J z^`!ok_M<-X{Qmw&c{nN`s=8ciM6^hMvmGt7jt>-!y36hub1W`%vxk0#qs^z+Ll;t5 zBGNO=+;W`uvDf?Wf?i>uwLRsLP%Nu^WX5yc9d)84FbR5#4H#(24*AbTqnW)eOWBXI z3a^*fvA&O$=OeBB$KMStw*B-wSTY9MG5+mB7lUtvDEGXFb{QG!*^#JzEBNFFaR+d5 zOhy)eKcilXv}*h(C>SF$z^P7z2DC_U8$HTtM;JG`qC!z5Y;qK&^4IYa8@=}NDj*00&ACQZ z6qG}YrWR#G-xbr)pSg6QQ|p$?=Kw+sbfPX)Q;>o1!(j`JTlJ@`dVN0VqyYo1 zs{hn;u^PN$T9K=L^qJN1nZUh%#SGKGKpqCV3=m#lL`On6v#Ir=gj+8|R~c~>(YW!> z{cT0=(g(Jqc*#$}7y-R*>2P?1?I@DVsFD7#rbq5J|0qae>K#&+{4q4hN7zg27Aw4EHRCIT(ll@)TCNN;2 zUC_98GRETIA#jrho8vUYM^_EYPCP?} z4(jvx+gaR(@$lEpDTjff7-*(`;KCST%eLisye4rRC3olLs@q{x$AE#>&3zpeBEu#Y z+Mc7vQUW}JYQ(zEuE%r0r|@$qm~d!ISLNwZxW2^wc+U3ll!`DD4D`Y`qnm;-0m=wj zkZyXQs2ar~w4*)g131|oorFK}Y{kv)?zN^fcy0_d85esfWJEznX>JPtqM}w=P}k0; z8nC(~_E9iFaU~ZzyWul=9;QUi=%4tK8IYtJFwhI07^WbF^~#g)D5i})ZTQe9b3i9C z(DUsOp&*O_cLclM+%)Q!D;nh!K#7`mH`V5m#Mb3E-Wmx~z(Awf6RA*^V1cVMCs`-) za&LtHs~bpvHQtk_*_Sv_!5M9S4$-m`POm5hU!*zp+0Lg7*3oQXqF;U2Mi5Ql-zq}5 zsf6F{-Dyecu1n!i5(yL%3kri`pXd6_Y^bb2)%a`JFd+yMQXpY1;3wd50IAHJh*h44 zW(TXgJ3Sa1JYlVfQ`s~`c^nFAkf*^#0lYF_+{t#ql}pl&_eq?B6K)=W1`PK4Sffnr zgkm8g0Xq(gcM(-sl+Ry7OFRE%w+v7~40MiGIZ;6vmyv7BNshC4h&s#W%+X5@|6T|f zG0^66z=d^?xyYQyx_lKLD_ilOcffmVC9pmWblf>%XoHQ0qtfyOZCOR!HT|6rcT{zi zF=29C5fqu=Fc~{{EMvs}XHuWK5+FJ&ZZHAGb>iDi)~``CcVjcqo1OVOkzRbfFv8`b z=v3@ZmWTqIo49Uo&@bfld>ZE}JW9-j{2H29bD==U%_qe||fz}CA zkq&7LTyJ1?f6uG?<5zcklZKh>8Bq9{C-UCe;C1-(P*)=fePF-JEFCrR@Lhq7U!dZ@d=aySRHWsZ)Xa7%uUon1UFyWG|B zdN=Dl5P^YSmw%j#YW3yos9rp)!5h$sVZcC}p|}w3=xO4*cXROUM+<)h1Q=-PdoR|_ zFCOxcZ2t3`vI#4;tgThplEan)T3E%QO7I*#3LEx>RgHnz00Z4iGl#+liD0U2vNe|& zA*U_p3?%-&(W`pG!XgrQ!@kG_TOGIw!GM95!&W4skXJ?S+bNF@AUWi@*U;qwCceul zW5dWJmbEA|%+!!4*;zT^r8@nAjTmT&7rd_LK!iO%-^%TXI&WPzFxQAo5vJPEs9=N! zeND&%;V^f;r&OBCJCV5`@rnmZ^*Es6uaLVgind0OKBdJQ^e6_y_D1qR+hp!JHS6~I zxAQ@$7-&wt{|*Wsz;`53ueo#s*URtfsSD4yLBSz;Ae?{WRlL8^<1iosx(m1JG4->j z@@GBWj}%V50A2_K9m|Jp(<2=`Fp5FeglB^JE8BkP@j37e1MS_Ccj|G*S)NCx*i2!r z6W`aPh>ah?Aj>0FwDW(mTaR)C+?C718C2Gh51&2atASuh7--wC;S^Ea`~0>)CX!6= z?frUM$TG(wrYtQjqq6V0H|$P_D5OPcx$a$gh`ZgC_UC>-a|9%bfu7>WN72Lx&hF=- z;lxj!`3U8No9gp)KFS`&V90%jwJFC%WIo2v+MU2!xRt{11UePTNiP267WC3>J0%*z z^UYJO+1x>={+0kb0lBLo>t|-`m@3waz;JwS1&xa$CGBQ#sggoWq{UMMG(4vwap9;2 zIKX-qpHp#o((|&9>n|&zC-ucwD#CJaDXF5{n?RVuoqrGW{YEsv1*gzRz|CQVuN;66 z7>&{%b)^QprlLRAL1zXlze6=+ObvJx^hu4S@5MvVjDbcn;d>FC{$Awn&>uXQL?9L5 zo>hex$_ICO=cB(uf%dqwe?f-_@uhWecb+rG44L-0P1)gA_+l~Vtp(mI=j>9~C->x2*2naCHuDR_~7e%tb zq6#2)=C0)Q{;=b6v?A8z-MO^nq-Zom#3yu#h~#Dzx)MwHn^^%KeU8hn&%l@7KY=&| zgHdHLZba@`*=Xp;FDd-FL1Z6d^6m(Idez|3^rAfGnqJn|p@TzAzFkU7M%IJ}t^6NU z`Ly8HOcXcGR@XLYeS*mwTE^Gw5b(df@i6lC=6>qi+lKJIePWxaIppoIyl&JG1a;v>@Ji_V zq3%V|#$Tl;sC-_MbQ=c@^S&y1*carAK`WzS+3wH~wtaz@zOgq~{N(1a;#@fPz8VU|ex?u4W0_98QDywhIb-Z3cUdh20GWipdd@kwZaXM1?4u-$dxs0>**OuclrW8479C} zX|593md}j?x=m*m`-K524D_;aRgaEe^RD&IzU%UiX)RQWg19Lf^Xt^Lcybu%3I3{~ zYg@jnSF@>WV8O#mOR`#O#Bdv7-11Rl+)MB-3K_w7@#86O;PZmP;T4S z(}XT1nW}T`2jN-1I_5EtyQ|(axBWQV~I8Mr=t7b#OJ^c>|+H(B7ar2 z<{$nKU5fK!8UZ@K21J9>;kAGj6AA3o|5X9{WT`6zH zcJO+8zAcYGT|fbO#OVyw9u0@>hCC0YsvQH36l2h-dgzgm(`0;jPZ zRTOdfay9M}D~e4f6RZ7#iXh3H2Zy_-W)yKFdAw)m$WLJZ0t206uIR3!jfT(qGP-x% zP3-kF`8IX9Z9(BpJTxH}vQW6GxSY-<%?JB?s~DoK76t`w9=~lNRq&8-_3^~18R@_o z?ko;H8BgZ0xu1$+xEUW7=g!{I)3HQ4-$$t!lI;1`RPI9j?x=gwv7*6%fzER84^~me zTXQDBo+sSP;dUW)dz}A8U@rK%g+o*GbQ(6vOr6{toUUz5_mOQZWiXoLf-GWL1|p`&I~9iFOY%*IH+2{1DZ zw1tMQQD-;UKE(nZ?Dl-_?xL8}!?ujc0-R%>;o1-DRJ?FiwKQ$u%ou-*Kr__jc z95!-q{fA8;htyiWr&2NuzI?-w-ZR4Mf99(x7eR0sXrupnE6N?mxp4deF%RsM{ci`V z2Ehl{y%#aC=z%WhfNHzKq%2!rCU@wzbm8W%DWEJE=&1A!r;2j8H9ObJKJEDIS8T6j z5UK_qP*K3XS)mnb;FGvnx+Sq;uxl-*mmcA;igvg;&Ca-=5mNNBA$U~vf7+*m@?oG+ z`h29KjDux|yLU^kf3zd`xa)Bh=Tz$S*F+A^) z3)B2}_caEy!$1pl#Z?t49O`4Yus*B5+sBXy?!W6Qf^a(oaOwP)py(X}9l_Q88Qsg_ zYcR`s_tH(*X-?X!yznc^9nTj^^!k0>L09J%jid;cSjB0C!;xP2c0I?YxFWb!j|bFF z7vWp0>A-ec!)o49(Z<*cpc{UgL~jhV8?)RdF3pqIF+d{C+K;$U*ndGqsF-QUylUB^D+GUuXkngdo&`CahFW>rB@ThL#K?1zfK;v zJW4Aq)3`b{CRFk7NFuyd1X0;e{2+WWEO+vAlx+0Z7kN>0>Hr_s!Z#N|uLeiZT|wC{ z$u1zYbZZ6=^Y4i3dz)$1*bRuHQZ3KZ&R{^|R9LKj4?EZbo+bAO2lMLa$Cs{Lah;N* zm#@bfvS>>_)I6c}-xJoFYAZSvliL}VOmrPHexs#IRg5`2sy%wo^A z@~6*h27lMW{pqla8cwLLz{z~paRPTWeIpx};8qgCS zvrK_|3b{Qcip4#%r6qHc)efFUrnb5t;NV}xA}{4xp$KolP)1Yx6GSh>@HcwJMo(!vZzW*DK-3cGYJ&RUpiw(>VQBVjHHUy8>f|G6fRstf$K+nE6?1s4XGZtb=?%AX9 z#l+QDfU2_#K>~d5x{zDfR-d?%kDVF@ntvN~I6>I#@^IN3B>ppd-QEu9Fwp!PlA$9L z5>2>(E024wNyk5Y$EB8(&oGumS<&g4rn)>ksK0%(CwV0hhJkj9H?1ge7T;ltt#6$( zV=se&M)FyvHpBjK-;Heo_p+@lBZJ7|MAsLm!p@dUyrax{yh}RTQbM%DCtG_QHooEO zPzC%Sx}Ec0N;Ho2G0=x|59`o|+wAFZ5to|}{1vlzV?X<~+M~|^Ee6^k7UpOa_nQD; z?BbpBq@7y^xlWkNl9Amigz0N?QQjQR?uM~53FErkG&1_zbIlX%{DxI|c(vv(b)^mK zdmYvh<}B9S+(f%OXOX37Y92Z@%jDCWW1-c5VSru}$06G*e2cX{zM;i5(5~?ZE?wjg za8$2@wTd$4k{ddl@o@Vxe~NZ$ag)m~tE6!{CTVoWm@}b0&!ta|%1a?pt?4G;;iV;! zlQk5vR{kD19J-E$Nn)UhsyGD|Pv^Xqz&wL2>(Kx>GNJ1Rq4AO?Z3{ecbvRBj40JS-?>c1ilLIyhw#unz;x!n7G0 zRnazFXmH7u7At63*+Rp(X6O35%#%jiq*y~b0@vNSt1|k|4JwK2Sn?4@YI~l#CVFE5 zImjT*#!tf6n$r0LEp!{61*VUi2hR@UJ_*q9?24D&r?f@$0a1KH*Es%^wn6dn8$Wi1 zs0;&r;LB&RWEeJtn=Jk1tTdv9OE98nZlUY%AE&#ZH!PJ5yAyw{V!YegQf}$^aQ`# zKrlY%`CN2eo?!RQ=<=+%H51FiW9y9vI5X1Jl(+KLw+3RyxLGeY-}r!lXCl&=c%qG%Rg z=cucSM`u35KGbMAXd6e!rjHo3(itu^|8S5{_FU_)-ai-(C}|pLPb~QmF!3J|``rBF z8y~@@IR?!sV3Pg=L?ies(4?~i{ka^r|4U0A9f48~*p9yv> TA;}ff#6KY0@cUQ-qc!|L@fEVc From 902b1f605908cc412e418ede6821fd8122979297 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Sun, 30 Dec 2018 23:53:27 -0500 Subject: [PATCH 492/594] runtime/pprof: add a test for gccgo bug #29448 With gccgo, if a profiling signal arrives in certain time during traceback, it may crash or hang. The fix is CL 156037 and CL 156038. This CL adds a test. Updates #29448. Change-Id: Idb36af176b4865b8fb31a85cad185ed4c07ade0c Reviewed-on: https://go-review.googlesource.com/c/156018 Reviewed-by: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/runtime/pprof/pprof_test.go | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/runtime/pprof/pprof_test.go b/src/runtime/pprof/pprof_test.go index e395d153102c2..7c6043ffdb2e8 100644 --- a/src/runtime/pprof/pprof_test.go +++ b/src/runtime/pprof/pprof_test.go @@ -1010,3 +1010,38 @@ func TestAtomicLoadStore64(t *testing.T) { atomic.StoreUint64(&flag, 1) <-done } + +func TestTracebackAll(t *testing.T) { + // With gccgo, if a profiling signal arrives at the wrong time + // during traceback, it may crash or hang. See issue #29448. + f, err := ioutil.TempFile("", "proftraceback") + if err != nil { + t.Fatalf("TempFile: %v", err) + } + defer os.Remove(f.Name()) + defer f.Close() + + if err := StartCPUProfile(f); err != nil { + t.Fatal(err) + } + defer StopCPUProfile() + + ch := make(chan int) + defer close(ch) + + count := 10 + for i := 0; i < count; i++ { + go func() { + <-ch // block + }() + } + + N := 10000 + if testing.Short() { + N = 500 + } + buf := make([]byte, 10*1024) + for i := 0; i < N; i++ { + runtime.Stack(buf, true) + } +} From 5a0743b020d3bf7875edd5ed50c9ee69d728e10e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 7 Jan 2019 13:35:53 -0800 Subject: [PATCH 493/594] cmd/go: improve error message for names forbidden by Windows Fixes #29589 Change-Id: I69ad461e70b236d9729a42053e35128437449e32 Reviewed-on: https://go-review.googlesource.com/c/156658 Run-TryBot: Ian Lance Taylor Run-TryBot: Bryan C. Mills Reviewed-by: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/go/internal/module/module.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/internal/module/module.go b/src/cmd/go/internal/module/module.go index 8afd2739b86b1..481a90b1c46d3 100644 --- a/src/cmd/go/internal/module/module.go +++ b/src/cmd/go/internal/module/module.go @@ -226,7 +226,7 @@ func checkElem(elem string, fileName bool) error { } for _, bad := range badWindowsNames { if strings.EqualFold(bad, short) { - return fmt.Errorf("disallowed path element %q", elem) + return fmt.Errorf("%q disallowed as path element component on Windows", short) } } return nil From e3eb2ff8270a3d0f542808136519a044f39c50d9 Mon Sep 17 00:00:00 2001 From: Yuval Pavel Zholkover Date: Tue, 8 Jan 2019 00:54:58 +0200 Subject: [PATCH 494/594] runtime: disable GDB tests on freebsd on all GOARCH values The in-tree GDB is too old (6.1.1) on all the builders except the FreeBSD 12.0 one, where it was removed from the base system. Update #29508 Change-Id: Ib6091cd86440ea005f3f903549a0223a96621a6f Reviewed-on: https://go-review.googlesource.com/c/156717 Reviewed-by: Ian Lance Taylor Reviewed-by: Brad Fitzpatrick Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/runtime/runtime-gdb_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/runtime/runtime-gdb_test.go b/src/runtime/runtime-gdb_test.go index 442ee9ca813a1..a988d1d702d95 100644 --- a/src/runtime/runtime-gdb_test.go +++ b/src/runtime/runtime-gdb_test.go @@ -39,9 +39,7 @@ func checkGdbEnvironment(t *testing.T) { case "aix": t.Skip("gdb does not work on AIX; see https://golang.org/issue/28558") case "freebsd": - if runtime.GOARCH == "arm" { - t.Skip("skipping gdb tests on freebsd/arm; see https://golang.org/issue/29508") - } + t.Skip("skipping gdb tests on FreeBSD; see https://golang.org/issue/29508") } if final := os.Getenv("GOROOT_FINAL"); final != "" && runtime.GOROOT() != final { t.Skip("gdb test can fail with GOROOT_FINAL pending") From a1d5e8adfa4d2f1043f4617fe20994ddbb7cc25c Mon Sep 17 00:00:00 2001 From: Mark Rushakoff Date: Tue, 8 Jan 2019 01:13:01 +0000 Subject: [PATCH 495/594] cmd/go: fix typo in output of go help importpath The output refers to 'go help modules-get' but the actual command is 'go help module-get', singular. Change-Id: Ie001f4181d80d3bf1995af2f257bf789dad5b33f GitHub-Last-Rev: ce9b90e9a656fbab097d440458e93ab29ba014af GitHub-Pull-Request: golang/go#29605 Reviewed-on: https://go-review.googlesource.com/c/156737 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor --- src/cmd/go/alldocs.go | 2 +- src/cmd/go/internal/help/helpdoc.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 9108775e75e31..9d9304a3b64fa 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -2054,7 +2054,7 @@ // (See 'go help gopath-get' and 'go help gopath'.) // // When using modules, downloaded packages are stored in the module cache. -// (See 'go help modules-get' and 'go help goproxy'.) +// (See 'go help module-get' and 'go help goproxy'.) // // When using modules, an additional variant of the go-import meta tag is // recognized and is preferred over those listing version control systems. diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index ba9b14a4e6e5b..973bfbc611d89 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -266,7 +266,7 @@ listed in the GOPATH environment variable. (See 'go help gopath-get' and 'go help gopath'.) When using modules, downloaded packages are stored in the module cache. -(See 'go help modules-get' and 'go help goproxy'.) +(See 'go help module-get' and 'go help goproxy'.) When using modules, an additional variant of the go-import meta tag is recognized and is preferred over those listing version control systems. From 232c9793092115870a430ef3c9ef9ae04f9e25c9 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 7 Jan 2019 12:24:01 -0800 Subject: [PATCH 496/594] runtime: store incremented PC in result of runtime.Callers In 1.11 we stored "return addresses" in the result of runtime.Callers. I changed that behavior in CL 152537 to store an address in the call instruction itself. This CL reverts that part of 152537. The change in 152537 was made because we now store pcs of inline marks in the result of runtime.Callers as well. This CL will now store the address of the inline mark + 1 in the results of runtime.Callers, so that the subsequent -1 done in CallersFrames will pick out the correct inline mark instruction. This CL means that the results of runtime.Callers can be passed to runtime.FuncForPC as they were before. There are a bunch of packages in the wild that take the results of runtime.Callers, subtract 1, and then call FuncForPC. This CL keeps that pattern working as it did in 1.11. The changes to runtime/pprof in this CL are exactly a revert of the changes to that package in 152537 (except the locForPC comment). Update #29582 Change-Id: I04d232000fb482f0f0ff6277f8d7b9c72e97eb48 Reviewed-on: https://go-review.googlesource.com/c/156657 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- src/runtime/pprof/proto.go | 15 ++++++++++++--- src/runtime/pprof/proto_test.go | 4 ++-- src/runtime/pprof/protomem_test.go | 6 +++++- src/runtime/symtab.go | 7 +++++++ src/runtime/traceback.go | 8 +++++--- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/runtime/pprof/proto.go b/src/runtime/pprof/proto.go index 7621fe213447c..7864dd79ad0c6 100644 --- a/src/runtime/pprof/proto.go +++ b/src/runtime/pprof/proto.go @@ -208,7 +208,7 @@ func (b *profileBuilder) pbMapping(tag int, id, base, limit, offset uint64, file } // locForPC returns the location ID for addr. -// addr must a PC which is part of a call or the PC of an inline marker. This returns the location of the call. +// addr must a return PC or 1 + the PC of an inline marker. This returns the location of the corresponding call. // It may emit to b.pb, so there must be no message encoding in progress. func (b *profileBuilder) locForPC(addr uintptr) uint64 { id := uint64(b.locs[addr]) @@ -236,7 +236,7 @@ func (b *profileBuilder) locForPC(addr uintptr) uint64 { if frame.PC == 0 { // If we failed to resolve the frame, at least make up // a reasonable call PC. This mostly happens in tests. - frame.PC = addr + frame.PC = addr - 1 } // We can't write out functions while in the middle of the @@ -403,7 +403,16 @@ func (b *profileBuilder) build() { } locs = locs[:0] - for _, addr := range e.stk { + for i, addr := range e.stk { + // Addresses from stack traces point to the + // next instruction after each call, except + // for the leaf, which points to where the + // signal occurred. locForPC expects return + // PCs, so increment the leaf address to look + // like a return PC. + if i == 0 { + addr++ + } l := b.locForPC(addr) if l == 0 { // runtime.goexit continue diff --git a/src/runtime/pprof/proto_test.go b/src/runtime/pprof/proto_test.go index 9b2de5f644c80..4452d5123158e 100644 --- a/src/runtime/pprof/proto_test.go +++ b/src/runtime/pprof/proto_test.go @@ -133,11 +133,11 @@ func TestConvertCPUProfile(t *testing.T) { samples := []*profile.Sample{ {Value: []int64{20, 20 * 2000 * 1000}, Location: []*profile.Location{ {ID: 1, Mapping: map1, Address: addr1}, - {ID: 2, Mapping: map1, Address: addr1 + 2}, + {ID: 2, Mapping: map1, Address: addr1 + 1}, }}, {Value: []int64{40, 40 * 2000 * 1000}, Location: []*profile.Location{ {ID: 3, Mapping: map2, Address: addr2}, - {ID: 4, Mapping: map2, Address: addr2 + 2}, + {ID: 4, Mapping: map2, Address: addr2 + 1}, }}, } checkProfile(t, p, period, periodType, sampleType, samples, "") diff --git a/src/runtime/pprof/protomem_test.go b/src/runtime/pprof/protomem_test.go index 65ef4edf8f7f2..471b1ae9c3291 100644 --- a/src/runtime/pprof/protomem_test.go +++ b/src/runtime/pprof/protomem_test.go @@ -14,7 +14,11 @@ import ( func TestConvertMemProfile(t *testing.T) { addr1, addr2, map1, map2 := testPCs(t) - a1, a2 := uintptr(addr1), uintptr(addr2) + // MemProfileRecord stacks are return PCs, so add one to the + // addresses recorded in the "profile". The proto profile + // locations are call PCs, so conversion will subtract one + // from these and get back to addr1 and addr2. + a1, a2 := uintptr(addr1)+1, uintptr(addr2)+1 rate := int64(512 * 1024) rec := []runtime.MemProfileRecord{ {AllocBytes: 4096, FreeBytes: 1024, AllocObjects: 4, FreeObjects: 1, Stack0: [32]uintptr{a1, a2}}, diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 0fd43309442f2..245a7e6b01a2e 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -87,6 +87,13 @@ func (ci *Frames) Next() (frame Frame, more bool) { } f := funcInfo._Func() entry := f.Entry() + if pc > entry { + // We store the pc of the start of the instruction following + // the instruction in question (the call or the inline mark). + // This is done for historical reasons, and to make FuncForPC + // work correctly for entries in the result of runtime.Callers. + pc-- + } name := funcname(funcInfo) file, line := funcline1(funcInfo, pc, false) if inldata := funcdata(funcInfo, _FUNCDATA_InlTree); inldata != nil { diff --git a/src/runtime/traceback.go b/src/runtime/traceback.go index 9b7fafcad70b3..a536fb2a7166c 100644 --- a/src/runtime/traceback.go +++ b/src/runtime/traceback.go @@ -344,8 +344,9 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in } if pcbuf != nil { + pc := frame.pc // backup to CALL instruction to read inlining info (same logic as below) - tracepc := frame.pc + tracepc := pc if (n > 0 || flags&_TraceTrap == 0) && frame.pc > f.entry && !waspanic { tracepc-- } @@ -363,12 +364,13 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in } else if skip > 0 { skip-- } else if n < max { - (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = tracepc + (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = pc n++ } lastFuncID = inltree[ix].funcID // Back up to an instruction in the "caller". tracepc = frame.fn.entry + uintptr(inltree[ix].parentPc) + pc = tracepc + 1 } } // Record the main frame. @@ -377,7 +379,7 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in } else if skip > 0 { skip-- } else if n < max { - (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = tracepc + (*[1 << 20]uintptr)(unsafe.Pointer(pcbuf))[n] = pc n++ } lastFuncID = f.funcID From 871256210921227802de309d1ae5e94e9b3646f4 Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Tue, 8 Jan 2019 19:59:08 +0100 Subject: [PATCH 497/594] doc: make link relative in 1.12 cgo release notes Change a link in the cgo section of the 1.12 release notes from https://golang.org/cmd/cgo ... to /cmd/cgo/ ... to uniform it with other links on the page, and to ensure correct target when the page is displayed on tip.golang.org. Change-Id: I7653a6ea15ce111a60929c7ae7e9fb0dc9515502 Reviewed-on: https://go-review.googlesource.com/c/156858 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index d8547e9f96875..046be21093f3f 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -135,7 +135,7 @@

    Cgo

    Go 1.12 will translate the C type EGLDisplay to the Go type uintptr. This change is similar to how Go 1.10 and newer treats Darwin's CoreFoundation and Java's JNI types. See the - cgo documentation + cgo documentation for more information.

    From 033b6501817aefebc6fc56b6212ff6abf14c8127 Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Tue, 8 Jan 2019 19:47:52 +0100 Subject: [PATCH 498/594] doc: update tzdata version in 1.12 release notes It was recently updated (again) to version 2018i. Since we're here, wrap the paragraph at ~70 columns, like all the others. Change-Id: I0a380385f34f1df1258a9f2af447234967422f37 Reviewed-on: https://go-review.googlesource.com/c/156857 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 046be21093f3f..cb17b552f07ec 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -545,7 +545,10 @@

    Minor changes to the library

    lib/time

    - The time zone database in $GOROOT/lib/time/zoneinfo.zip has been updated to version 2018g. Note that this ZIP file is only used if a time zone database is not provided by the operating system. + The time zone database in $GOROOT/lib/time/zoneinfo.zip + has been updated to version 2018i. Note that this ZIP file is + only used if a time zone database is not provided by the operating + system.

    From 956879dd0bf31b26d2425c2eadbeb19b90812187 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Sat, 5 Jan 2019 14:31:23 -0800 Subject: [PATCH 499/594] runtime: make FuncForPC return the innermost inlined frame Returning the innermost frame instead of the outermost makes code that walks the results of runtime.Caller{,s} still work correctly in the presence of mid-stack inlining. Fixes #29582 Change-Id: I2392e3dd5636eb8c6f58620a61cef2194fe660a7 Reviewed-on: https://go-review.googlesource.com/c/156364 Run-TryBot: Keith Randall Reviewed-by: Ian Lance Taylor --- src/runtime/race.go | 2 +- src/runtime/runtime2.go | 11 +++++++++++ src/runtime/symtab.go | 40 +++++++++++++++++++++++++++++++++++++--- test/inline_caller.go | 6 +++--- test/inline_callers.go | 10 +++++----- 5 files changed, 57 insertions(+), 12 deletions(-) diff --git a/src/runtime/race.go b/src/runtime/race.go index 08d53a10d2ba5..adb2198c55470 100644 --- a/src/runtime/race.go +++ b/src/runtime/race.go @@ -156,7 +156,7 @@ func racecallback(cmd uintptr, ctx unsafe.Pointer) { } func raceSymbolizeCode(ctx *symbolizeCodeContext) { - f := FuncForPC(ctx.pc) + f := findfunc(ctx.pc)._Func() if f != nil { file, line := f.FileLine(ctx.pc) if line != 0 { diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 290a7bd3111a7..df9cbaef203e7 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -663,6 +663,17 @@ type _func struct { nfuncdata uint8 // must be last } +// Pseudo-Func that is returned for PCs that occur in inlined code. +// A *Func can be either a *_func or a *funcinl, and they are distinguished +// by the first uintptr. +type funcinl struct { + zero uintptr // set to 0 to distinguish from _func + entry uintptr // entry of the real (the "outermost") frame. + name string + file string + line int +} + // layout of Itab known to compilers // allocated in non-garbage-collected memory // Needs to be in sync with diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index 245a7e6b01a2e..e7ce3de497473 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -466,9 +466,28 @@ func moduledataverify1(datap *moduledata) { // given program counter address, or else nil. // // If pc represents multiple functions because of inlining, it returns -// the *Func describing the outermost function. +// the a *Func describing the innermost function, but with an entry +// of the outermost function. func FuncForPC(pc uintptr) *Func { - return findfunc(pc)._Func() + f := findfunc(pc) + if !f.valid() { + return nil + } + if inldata := funcdata(f, _FUNCDATA_InlTree); inldata != nil { + if ix := pcdatavalue(f, _PCDATA_InlTreeIndex, pc, nil); ix >= 0 { + inltree := (*[1 << 20]inlinedCall)(inldata) + name := funcnameFromNameoff(f, inltree[ix].func_) + file, line := funcline(f, pc) + fi := &funcinl{ + entry: f.entry, // entry of the real (the outermost) function. + name: name, + file: file, + line: int(line), + } + return (*Func)(unsafe.Pointer(fi)) + } + } + return f._Func() } // Name returns the name of the function. @@ -476,12 +495,22 @@ func (f *Func) Name() string { if f == nil { return "" } + fn := f.raw() + if fn.entry == 0 { // inlined version + fi := (*funcinl)(unsafe.Pointer(fn)) + return fi.name + } return funcname(f.funcInfo()) } // Entry returns the entry address of the function. func (f *Func) Entry() uintptr { - return f.raw().entry + fn := f.raw() + if fn.entry == 0 { // inlined version + fi := (*funcinl)(unsafe.Pointer(fn)) + return fi.entry + } + return fn.entry } // FileLine returns the file name and line number of the @@ -489,6 +518,11 @@ func (f *Func) Entry() uintptr { // The result will not be accurate if pc is not a program // counter within f. func (f *Func) FileLine(pc uintptr) (file string, line int) { + fn := f.raw() + if fn.entry == 0 { // inlined version + fi := (*funcinl)(unsafe.Pointer(fn)) + return fi.file, fi.line + } // Pass strict=false here, because anyone can call this function, // and they might just be wrong about targetpc belonging to f. file, line32 := funcline1(f.funcInfo(), pc, false) diff --git a/test/inline_caller.go b/test/inline_caller.go index 79039a6bb532e..daff145a9229f 100644 --- a/test/inline_caller.go +++ b/test/inline_caller.go @@ -54,9 +54,9 @@ type wantFrame struct { // -1 means don't care var expected = []wantFrame{ - 0: {"main.testCaller", 36}, - 1: {"main.testCaller", 31}, - 2: {"main.testCaller", 27}, + 0: {"main.h", 36}, + 1: {"main.g", 31}, + 2: {"main.f", 27}, 3: {"main.testCaller", 42}, 4: {"main.main", 68}, 5: {"runtime.main", -1}, diff --git a/test/inline_callers.go b/test/inline_callers.go index f2c05622dd1d7..ee7d6470728cb 100644 --- a/test/inline_callers.go +++ b/test/inline_callers.go @@ -31,7 +31,7 @@ func testCallers(skp int) (frames []string) { skip = skp f() for i := 0; i < npcs; i++ { - fn := runtime.FuncForPC(pcs[i]) + fn := runtime.FuncForPC(pcs[i] - 1) frames = append(frames, fn.Name()) if fn.Name() == "main.main" { break @@ -56,10 +56,10 @@ func testCallersFrames(skp int) (frames []string) { } var expectedFrames [][]string = [][]string{ - 0: {"runtime.Callers", "main.testCallers", "main.testCallers", "main.testCallers", "main.testCallers", "main.main"}, - 1: {"main.testCallers", "main.testCallers", "main.testCallers", "main.testCallers", "main.main"}, - 2: {"main.testCallers", "main.testCallers", "main.testCallers", "main.main"}, - 3: {"main.testCallers", "main.testCallers", "main.main"}, + 0: {"runtime.Callers", "main.h", "main.g", "main.f", "main.testCallers", "main.main"}, + 1: {"main.h", "main.g", "main.f", "main.testCallers", "main.main"}, + 2: {"main.g", "main.f", "main.testCallers", "main.main"}, + 3: {"main.f", "main.testCallers", "main.main"}, 4: {"main.testCallers", "main.main"}, 5: {"main.main"}, } From 1d2e548b428373461e92c7490edb49fc39df0c85 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 8 Jan 2019 15:18:44 -0800 Subject: [PATCH 500/594] doc: go1.12: mention os.File.SyscallConn Updates #24331 Change-Id: I2d7c996bbe29d5b3922588e199a106eb722c02e6 Reviewed-on: https://go-review.googlesource.com/c/156839 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index cb17b552f07ec..568920df6d715 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -653,6 +653,15 @@

    Minor changes to the library

    This may cause the method to run more slowly than in previous releases.

    +

    + File now supports + a SyscallConn + method returning + a syscall.RawConn + interface value. This may be used to invoke system-specific + operations on the underlying file descriptor. +

    +
    path/filepath
    From 9473c044f1d492a6ba49ec695042dec4365d70ca Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 2 Jan 2019 18:33:31 +0000 Subject: [PATCH 501/594] bufio: document relationship between UnreadByte/UnreadRune and Peek Fixes #29387 Change-Id: I2d9981f63ac16630ed39d6da6692c81396f4e9ea Reviewed-on: https://go-review.googlesource.com/c/155930 Reviewed-by: Ian Lance Taylor --- src/bufio/bufio.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/bufio/bufio.go b/src/bufio/bufio.go index ffb278ad9e2d0..0125d729d1b31 100644 --- a/src/bufio/bufio.go +++ b/src/bufio/bufio.go @@ -33,8 +33,8 @@ type Reader struct { rd io.Reader // reader provided by the client r, w int // buf read and write positions err error - lastByte int - lastRuneSize int + lastByte int // last byte read for UnreadByte; -1 means invalid + lastRuneSize int // size of last rune read for UnreadRune; -1 means invalid } const minReadBufferSize = 16 @@ -123,6 +123,9 @@ func (b *Reader) readErr() error { // being valid at the next read call. If Peek returns fewer than n bytes, it // also returns an error explaining why the read is short. The error is // ErrBufferFull if n is larger than b's buffer size. +// +// Calling Peek prevents a UnreadByte or UnreadRune call from succeeding +// until the next read operation. func (b *Reader) Peek(n int) ([]byte, error) { if n < 0 { return nil, ErrNegativeCount @@ -252,6 +255,10 @@ func (b *Reader) ReadByte() (byte, error) { } // UnreadByte unreads the last byte. Only the most recently read byte can be unread. +// +// UnreadByte returns an error if the most recent method called on the +// Reader was not a read operation. Notably, Peek is not considered a +// read operation. func (b *Reader) UnreadByte() error { if b.lastByte < 0 || b.r == 0 && b.w > 0 { return ErrInvalidUnreadByte @@ -290,8 +297,8 @@ func (b *Reader) ReadRune() (r rune, size int, err error) { return r, size, nil } -// UnreadRune unreads the last rune. If the most recent read operation on -// the buffer was not a ReadRune, UnreadRune returns an error. (In this +// UnreadRune unreads the last rune. If the most recent method called on +// the Reader was not a ReadRune, UnreadRune returns an error. (In this // regard it is stricter than UnreadByte, which will unread the last byte // from any read operation.) func (b *Reader) UnreadRune() error { From 79c50c4d5728d785485fce8c75b9c2b2f93641ea Mon Sep 17 00:00:00 2001 From: Yuval Pavel Zholkover Date: Mon, 7 Jan 2019 02:06:38 +0200 Subject: [PATCH 502/594] os: disable the use of netpoll on regular files on *BSDs. The kqueue based netpoller always registers file descriptors with EVFILT_READ and EVFILT_WRITE. However only EVFILT_READ notification is supported for regular files. On FreeBSD a regular file is always reported as ready for writing, resulting in a busy wait. On Darwin, Dragonfly, NetBSD and OpenBSD, a regular file is reported as ready for both reading and writing only once. Updates #19093 Change-Id: If284341f60c6c2332fb5499637d4cfa7a4e26b7b Reviewed-on: https://go-review.googlesource.com/c/156379 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/os/file_unix.go | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/os/file_unix.go b/src/os/file_unix.go index 688b68e1c3547..c91efa818542b 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -117,23 +117,29 @@ func newFile(fd uintptr, name string, kind newFileKind) *File { pollable := kind == kindOpenFile || kind == kindPipe || kind == kindNonBlock - // Don't try to use kqueue with regular files on FreeBSD. - // It crashes the system unpredictably while running all.bash. - // Issue 19093. // If the caller passed a non-blocking filedes (kindNonBlock), // we assume they know what they are doing so we allow it to be // used with kqueue. - if runtime.GOOS == "freebsd" && kind == kindOpenFile { - pollable = false - } - - // On Darwin, kqueue does not work properly with fifos: - // closing the last writer does not cause a kqueue event - // for any readers. See issue #24164. - if runtime.GOOS == "darwin" && kind == kindOpenFile { + if kind == kindOpenFile { var st syscall.Stat_t - if err := syscall.Fstat(fdi, &st); err == nil && st.Mode&syscall.S_IFMT == syscall.S_IFIFO { - pollable = false + switch runtime.GOOS { + // Don't try to use kqueue with regular files on *BSDs. + // on FreeBSD with older kernels it used to crash the system unpredictably while running all.bash. + // while with newer kernels a regular file is always reported as ready for writing. + // on Dragonfly, NetBSD and OpenBSD the fd is signaled only once as ready (both read and write). + // Issue 19093. + case "dragonfly", "freebsd", "netbsd", "openbsd": + if err := syscall.Fstat(fdi, &st); err == nil && st.Mode&syscall.S_IFMT == syscall.S_IFREG { + pollable = false + } + case "darwin": + // In addition to the behavior described above for regular files, + // on Darwin, kqueue does not work properly with fifos: + // closing the last writer does not cause a kqueue event + // for any readers. See issue #24164. + if err := syscall.Fstat(fdi, &st); err == nil && (st.Mode&syscall.S_IFMT == syscall.S_IFIFO || st.Mode&syscall.S_IFMT == syscall.S_IFREG) { + pollable = false + } } } From 5efe9a8f11c81116f102f56c49a9415fd992c038 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 8 Jan 2019 14:14:27 +0100 Subject: [PATCH 503/594] runtime: follow convention for generated code comment in fastlog2table Follow the convertion (https://golang.org/s/generatedcode) for generated code in fastlog2table.go Change-Id: Ib40ae2848924d98afaf8d4fcaf180a4583edc3fe Reviewed-on: https://go-review.googlesource.com/c/156817 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/fastlog2table.go | 2 +- src/runtime/mkfastlog2table.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/fastlog2table.go b/src/runtime/fastlog2table.go index c36d5835f64b3..6ba4a7d3f24cc 100644 --- a/src/runtime/fastlog2table.go +++ b/src/runtime/fastlog2table.go @@ -1,4 +1,4 @@ -// AUTO-GENERATED by mkfastlog2table.go +// Code generated by mkfastlog2table.go; DO NOT EDIT. // Run go generate from src/runtime to update. // See mkfastlog2table.go for comments. diff --git a/src/runtime/mkfastlog2table.go b/src/runtime/mkfastlog2table.go index 587ebf476d388..305c84a7c1169 100644 --- a/src/runtime/mkfastlog2table.go +++ b/src/runtime/mkfastlog2table.go @@ -20,7 +20,7 @@ import ( func main() { var buf bytes.Buffer - fmt.Fprintln(&buf, "// AUTO-GENERATED by mkfastlog2table.go") + fmt.Fprintln(&buf, "// Code generated by mkfastlog2table.go; DO NOT EDIT.") fmt.Fprintln(&buf, "// Run go generate from src/runtime to update.") fmt.Fprintln(&buf, "// See mkfastlog2table.go for comments.") fmt.Fprintln(&buf) From dd7d6c261f586bdffdda78cff23aeda8b3dba6cc Mon Sep 17 00:00:00 2001 From: LE Manh Cuong Date: Wed, 9 Jan 2019 09:27:54 +0700 Subject: [PATCH 504/594] debug/gosym: remove outdated comment Change-Id: I2bba13064c8d21ded41499c6ec225ef83d1a533e Reviewed-on: https://go-review.googlesource.com/c/156997 Reviewed-by: Ian Lance Taylor --- src/debug/gosym/symtab.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/debug/gosym/symtab.go b/src/debug/gosym/symtab.go index a995209934ffb..a84b7f6def1d9 100644 --- a/src/debug/gosym/symtab.go +++ b/src/debug/gosym/symtab.go @@ -7,11 +7,6 @@ // by the gc compilers. package gosym -// The table format is a variant of the format used in Plan 9's a.out -// format, documented at https://9p.io/magic/man2html/6/a.out. -// The best reference for the differences between the Plan 9 format -// and the Go format is the runtime source, specifically ../../runtime/symtab.c. - import ( "bytes" "encoding/binary" From 99ea99ec4ca727ec3408521b07a6eb6a6bd3b829 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 9 Jan 2019 14:24:44 +0100 Subject: [PATCH 505/594] net/http/httputil: fix typo in ReverseProxy godoc Change-Id: Iea33fe64403ca2e6f87a4e070af5e97d96506e41 Reviewed-on: https://go-review.googlesource.com/c/157118 Reviewed-by: Brad Fitzpatrick --- src/net/http/httputil/reverseproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index c13b99ff72fed..1c9feb7d7d2f5 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -45,7 +45,7 @@ type ReverseProxy struct { // after each write to the client. // The FlushInterval is ignored when ReverseProxy // recognizes a response as a streaming response; - // for such reponses, writes are flushed to the client + // for such responses, writes are flushed to the client // immediately. FlushInterval time.Duration From a14ed2a82a1563ba89e1f22ab517bf3c9abe416f Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 9 Jan 2019 15:06:20 +0000 Subject: [PATCH 506/594] net/http/httputil: run the ReverseProxy.ModifyResponse hook for upgrades Fixes #29627 Change-Id: I08a5b45151a11b5a4f3b5a2d984c0322cf904697 Reviewed-on: https://go-review.googlesource.com/c/157098 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/net/http/httputil/reverseproxy.go | 25 ++++++++++++++++------ src/net/http/httputil/reverseproxy_test.go | 8 +++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index 1c9feb7d7d2f5..4e10bf399711b 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -171,6 +171,20 @@ func (p *ReverseProxy) getErrorHandler() func(http.ResponseWriter, *http.Request return p.defaultErrorHandler } +// modifyResponse conditionally runs the optional ModifyResponse hook +// and reports whether the request should proceed. +func (p *ReverseProxy) modifyResponse(rw http.ResponseWriter, res *http.Response, req *http.Request) bool { + if p.ModifyResponse == nil { + return true + } + if err := p.ModifyResponse(res); err != nil { + res.Body.Close() + p.getErrorHandler()(rw, req, err) + return false + } + return true +} + func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { transport := p.Transport if transport == nil { @@ -250,6 +264,9 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { // Deal with 101 Switching Protocols responses: (WebSocket, h2c, etc) if res.StatusCode == http.StatusSwitchingProtocols { + if !p.modifyResponse(rw, res, outreq) { + return + } p.handleUpgradeResponse(rw, outreq, res) return } @@ -260,12 +277,8 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) { res.Header.Del(h) } - if p.ModifyResponse != nil { - if err := p.ModifyResponse(res); err != nil { - res.Body.Close() - p.getErrorHandler()(rw, outreq, err) - return - } + if !p.modifyResponse(rw, res, outreq) { + return } copyHeader(rw.Header(), res.Header) diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go index bda569acc73bd..5edefa08e55a3 100644 --- a/src/net/http/httputil/reverseproxy_test.go +++ b/src/net/http/httputil/reverseproxy_test.go @@ -1012,6 +1012,10 @@ func TestReverseProxyWebSocket(t *testing.T) { backURL, _ := url.Parse(backendServer.URL) rproxy := NewSingleHostReverseProxy(backURL) rproxy.ErrorLog = log.New(ioutil.Discard, "", 0) // quiet for tests + rproxy.ModifyResponse = func(res *http.Response) error { + res.Header.Add("X-Modified", "true") + return nil + } handler := http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) { rw.Header().Set("X-Header", "X-Value") @@ -1049,6 +1053,10 @@ func TestReverseProxyWebSocket(t *testing.T) { } defer rwc.Close() + if got, want := res.Header.Get("X-Modified"), "true"; got != want { + t.Errorf("response X-Modified header = %q; want %q", got, want) + } + io.WriteString(rwc, "Hello\n") bs := bufio.NewScanner(rwc) if !bs.Scan() { From 8765a786b6e8199959bba8244ac5f95aa3eb9474 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 8 Jan 2019 22:39:13 -0800 Subject: [PATCH 507/594] go/types: don't create new context string for each argument of each call The argument context string is only used in error messages. Don't format the function AST into a string for every single argument of every single call that is type-checked. Instead do it once per call (still not great, but much much better). Performance optimization. Change-Id: Iec87f9ad34128d7b3eee58577ad37dbaa8e6db44 Reviewed-on: https://go-review.googlesource.com/c/157037 Run-TryBot: Robert Griesemer TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/go/types/call.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/go/types/call.go b/src/go/types/call.go index 0ea1623903dae..1abc1d8a5e47d 100644 --- a/src/go/types/call.go +++ b/src/go/types/call.go @@ -233,6 +233,7 @@ func (check *Checker) arguments(x *operand, call *ast.CallExpr, sig *Signature, } // evaluate arguments + context := check.sprintf("argument to %s", call.Fun) for i := 0; i < n; i++ { arg(x, i) if x.mode != invalid { @@ -240,7 +241,7 @@ func (check *Checker) arguments(x *operand, call *ast.CallExpr, sig *Signature, if i == n-1 && call.Ellipsis.IsValid() { ellipsis = call.Ellipsis } - check.argument(call.Fun, sig, i, x, ellipsis) + check.argument(call.Fun, sig, i, x, ellipsis, context) } } @@ -258,7 +259,7 @@ func (check *Checker) arguments(x *operand, call *ast.CallExpr, sig *Signature, // argument checks passing of argument x to the i'th parameter of the given signature. // If ellipsis is valid, the argument is followed by ... at that position in the call. -func (check *Checker) argument(fun ast.Expr, sig *Signature, i int, x *operand, ellipsis token.Pos) { +func (check *Checker) argument(fun ast.Expr, sig *Signature, i int, x *operand, ellipsis token.Pos, context string) { check.singleValue(x) if x.mode == invalid { return @@ -298,7 +299,7 @@ func (check *Checker) argument(fun ast.Expr, sig *Signature, i int, x *operand, typ = typ.(*Slice).elem } - check.assignment(x, typ, check.sprintf("argument to %s", fun)) + check.assignment(x, typ, context) } func (check *Checker) selector(x *operand, e *ast.SelectorExpr) { From 52cae2763ee59ea63e885e9a41708e3ce677039a Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Wed, 9 Jan 2019 11:21:07 -0500 Subject: [PATCH 508/594] cmd/internal/obj/wasm: increment PC by 2 at sigpanic On Wasm, PC is not the instruction counter but the block ID. We advance the PC only when necessary. In the case of sigpanic (used in nil check), the panic stack trace expects the PC at the call of sigpanic, not the next one. However, runtime.Caller subtracts 1 from the PC. To make both PC and PC-1 work (have the same line number), we advance the PC by 2 at sigpanic. Fixes #29632. Change-Id: Ieb4d0bb9dc6a8103855a194e3d289f1db4bfb1e5 Reviewed-on: https://go-review.googlesource.com/c/157157 Reviewed-by: Keith Randall Reviewed-by: Richard Musiol Run-TryBot: Richard Musiol TryBot-Result: Gobot Gobot --- src/cmd/internal/obj/wasm/wasmobj.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cmd/internal/obj/wasm/wasmobj.go b/src/cmd/internal/obj/wasm/wasmobj.go index 52c9710ff09ee..23283a12cf657 100644 --- a/src/cmd/internal/obj/wasm/wasmobj.go +++ b/src/cmd/internal/obj/wasm/wasmobj.go @@ -280,6 +280,13 @@ func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) { // implicit call, so entering and leaving this section affects the stack trace. if p.As == ACALLNORESUME || p.As == obj.ANOP || p.As == ANop || p.Spadj != 0 || base != prevBase { pc++ + if p.To.Sym == sigpanic { + // The panic stack trace expects the PC at the call of sigpanic, + // not the next one. However, runtime.Caller subtracts 1 from the + // PC. To make both PC and PC-1 work (have the same line number), + // we advance the PC by 2 at sigpanic. + pc++ + } } } tableIdxs = append(tableIdxs, uint64(numResumePoints)) From 9a5a5043e10dbc8338e21b8c7f4081a56a019b7d Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 9 Jan 2019 21:32:11 +0100 Subject: [PATCH 509/594] cmd/go: skip tests using Git on Plan 9 TestScript/get_unicode, TestScript/get_dotfiles and TestScript/get_brace are failing on Plan 9 since they expect a full-featured git command, while the git tool has been emulated as a simple rc script on Plan 9. This change skips tests using Git on Plan 9. Fixes #29640. Change-Id: Id7f6fdca552167f4631fe401f63167e5653daafa Reviewed-on: https://go-review.googlesource.com/c/157119 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/go/script_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index 4aa92625dde3c..c56c1fd3e42a1 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -283,6 +283,11 @@ Script: if strings.HasPrefix(cond, "exec:") { prog := cond[len("exec:"):] ok = execCache.Do(prog, func() interface{} { + if runtime.GOOS == "plan9" && prog == "git" { + // The Git command is usually not the real Git on Plan 9. + // See https://golang.org/issues/29640. + return false + } _, err := exec.LookPath(prog) return err == nil }).(bool) From a5318bf5d676b3dfc10a1843668e3593cbdc87c5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 9 Jan 2019 10:04:58 -0800 Subject: [PATCH 510/594] os: always treat files as unpollable on FreeBSD Fixes #29633 Updates #27619 Change-Id: I1e38569ea2a02423b028331f2ed987d3ae47fd2e Reviewed-on: https://go-review.googlesource.com/c/157099 Reviewed-by: Brad Fitzpatrick --- src/os/file_unix.go | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/os/file_unix.go b/src/os/file_unix.go index c91efa818542b..7d68a7659f5bc 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -123,15 +123,25 @@ func newFile(fd uintptr, name string, kind newFileKind) *File { if kind == kindOpenFile { var st syscall.Stat_t switch runtime.GOOS { - // Don't try to use kqueue with regular files on *BSDs. - // on FreeBSD with older kernels it used to crash the system unpredictably while running all.bash. - // while with newer kernels a regular file is always reported as ready for writing. - // on Dragonfly, NetBSD and OpenBSD the fd is signaled only once as ready (both read and write). - // Issue 19093. - case "dragonfly", "freebsd", "netbsd", "openbsd": + case "freebsd": + // On FreeBSD before 10.4 it used to crash the + // system unpredictably while running all.bash. + // When we stop supporting FreeBSD 10 we can merge + // this into the dragonfly/netbsd/openbsd case. + // Issue 27619. + pollable = false + + case "dragonfly", "netbsd", "openbsd": + // Don't try to use kqueue with regular files on *BSDs. + // On FreeBSD a regular file is always + // reported as ready for writing. + // On Dragonfly, NetBSD and OpenBSD the fd is signaled + // only once as ready (both read and write). + // Issue 19093. if err := syscall.Fstat(fdi, &st); err == nil && st.Mode&syscall.S_IFMT == syscall.S_IFREG { pollable = false } + case "darwin": // In addition to the behavior described above for regular files, // on Darwin, kqueue does not work properly with fifos: From 20ac64a2dd1f7993101d7e069eab3b84ab2c0bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 9 Jan 2019 14:05:17 +0100 Subject: [PATCH 511/594] cmd/dist, cmd/link, runtime: fix stack size when cross-compiling aix/ppc64 This commit allows to cross-compiling aix/ppc64. The nosplit limit must twice as large as on others platforms because of AIX syscalls. The stack limit, especially stackGuardMultiplier, was set by cmd/dist during the bootstrap and doesn't depend on GOOS/GOARCH target. Fixes #29572 Change-Id: Id51e38885e1978d981aa9e14972eaec17294322e Reviewed-on: https://go-review.googlesource.com/c/157117 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/dist/buildruntime.go | 14 +++++--------- src/cmd/internal/obj/arm/obj5.go | 4 ++-- src/cmd/internal/obj/arm64/obj7.go | 4 ++-- src/cmd/internal/obj/mips/obj0.go | 4 ++-- src/cmd/internal/obj/ppc64/obj9.go | 4 ++-- src/cmd/internal/obj/s390x/objz.go | 4 ++-- src/cmd/internal/obj/x86/obj6.go | 4 ++-- src/cmd/internal/objabi/stack.go | 17 +++++++++++++++-- src/cmd/link/internal/ld/lib.go | 2 +- src/runtime/internal/sys/stubs.go | 3 +++ 10 files changed, 36 insertions(+), 24 deletions(-) diff --git a/src/cmd/dist/buildruntime.go b/src/cmd/dist/buildruntime.go index 10d1552c944d2..5aadc8da674ff 100644 --- a/src/cmd/dist/buildruntime.go +++ b/src/cmd/dist/buildruntime.go @@ -31,7 +31,7 @@ func mkzversion(dir, file string) { fmt.Fprintln(&buf) fmt.Fprintf(&buf, "const TheVersion = `%s`\n", findgoversion()) fmt.Fprintf(&buf, "const Goexperiment = `%s`\n", os.Getenv("GOEXPERIMENT")) - fmt.Fprintf(&buf, "const StackGuardMultiplier = %d\n", stackGuardMultiplier()) + fmt.Fprintf(&buf, "const StackGuardMultiplierDefault = %d\n", stackGuardMultiplierDefault()) writefile(buf.String(), file, writeSkipSame) } @@ -49,7 +49,7 @@ func mkzversion(dir, file string) { // const defaultGOARCH = runtime.GOARCH // const defaultGO_EXTLINK_ENABLED = // const version = -// const stackGuardMultiplier = +// const stackGuardMultiplierDefault = // const goexperiment = // // The use of runtime.GOOS and runtime.GOARCH makes sure that @@ -77,20 +77,16 @@ func mkzbootstrap(file string) { fmt.Fprintf(&buf, "const defaultGOARCH = runtime.GOARCH\n") fmt.Fprintf(&buf, "const defaultGO_EXTLINK_ENABLED = `%s`\n", goextlinkenabled) fmt.Fprintf(&buf, "const version = `%s`\n", findgoversion()) - fmt.Fprintf(&buf, "const stackGuardMultiplier = %d\n", stackGuardMultiplier()) + fmt.Fprintf(&buf, "const stackGuardMultiplierDefault = %d\n", stackGuardMultiplierDefault()) fmt.Fprintf(&buf, "const goexperiment = `%s`\n", os.Getenv("GOEXPERIMENT")) writefile(buf.String(), file, writeSkipSame) } -// stackGuardMultiplier returns a multiplier to apply to the default +// stackGuardMultiplierDefault returns a multiplier to apply to the default // stack guard size. Larger multipliers are used for non-optimized // builds that have larger stack frames. -func stackGuardMultiplier() int { - // On AIX, a larger stack is needed for syscalls - if goos == "aix" { - return 2 - } +func stackGuardMultiplierDefault() int { for _, s := range strings.Split(os.Getenv("GO_GCFLAGS"), " ") { if s == "-N" { return 2 diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go index c17bf2a8ac1db..34bd5d6baf1a4 100644 --- a/src/cmd/internal/obj/arm/obj5.go +++ b/src/cmd/internal/obj/arm/obj5.go @@ -723,7 +723,7 @@ func (c *ctxt5) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p.As = AMOVW p.From.Type = obj.TYPE_ADDR p.From.Reg = REGSP - p.From.Offset = objabi.StackGuard + p.From.Offset = int64(objabi.StackGuard) p.To.Type = obj.TYPE_REG p.To.Reg = REG_R2 p.Scond = C_SCOND_NE @@ -739,7 +739,7 @@ func (c *ctxt5) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p = obj.Appendp(p, c.newprog) p.As = AMOVW p.From.Type = obj.TYPE_ADDR - p.From.Offset = int64(framesize) + (objabi.StackGuard - objabi.StackSmall) + p.From.Offset = int64(framesize) + (int64(objabi.StackGuard) - objabi.StackSmall) p.To.Type = obj.TYPE_REG p.To.Reg = REG_R3 p.Scond = C_SCOND_NE diff --git a/src/cmd/internal/obj/arm64/obj7.go b/src/cmd/internal/obj/arm64/obj7.go index d0e354eabd19e..e47857ab5fede 100644 --- a/src/cmd/internal/obj/arm64/obj7.go +++ b/src/cmd/internal/obj/arm64/obj7.go @@ -125,7 +125,7 @@ func (c *ctxt7) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p = obj.Appendp(p, c.newprog) p.As = AADD p.From.Type = obj.TYPE_CONST - p.From.Offset = objabi.StackGuard + p.From.Offset = int64(objabi.StackGuard) p.Reg = REGSP p.To.Type = obj.TYPE_REG p.To.Reg = REG_R2 @@ -140,7 +140,7 @@ func (c *ctxt7) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p = obj.Appendp(p, c.newprog) p.As = AMOVD p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + (objabi.StackGuard - objabi.StackSmall) + p.From.Offset = int64(framesize) + (int64(objabi.StackGuard) - objabi.StackSmall) p.To.Type = obj.TYPE_REG p.To.Reg = REG_R3 diff --git a/src/cmd/internal/obj/mips/obj0.go b/src/cmd/internal/obj/mips/obj0.go index 5a2546af9ed42..f096c7ff14940 100644 --- a/src/cmd/internal/obj/mips/obj0.go +++ b/src/cmd/internal/obj/mips/obj0.go @@ -739,7 +739,7 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p = obj.Appendp(p, c.newprog) p.As = add p.From.Type = obj.TYPE_CONST - p.From.Offset = objabi.StackGuard + p.From.Offset = int64(objabi.StackGuard) p.Reg = REGSP p.To.Type = obj.TYPE_REG p.To.Reg = REG_R2 @@ -754,7 +754,7 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p = obj.Appendp(p, c.newprog) p.As = mov p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + objabi.StackGuard - objabi.StackSmall + p.From.Offset = int64(framesize) + int64(objabi.StackGuard) - objabi.StackSmall p.To.Type = obj.TYPE_REG p.To.Reg = REG_R1 diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 2286916098820..30a8414d4ad40 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -1041,7 +1041,7 @@ func (c *ctxt9) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p = obj.Appendp(p, c.newprog) p.As = AADD p.From.Type = obj.TYPE_CONST - p.From.Offset = objabi.StackGuard + p.From.Offset = int64(objabi.StackGuard) p.Reg = REGSP p.To.Type = obj.TYPE_REG p.To.Reg = REG_R4 @@ -1056,7 +1056,7 @@ func (c *ctxt9) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p = obj.Appendp(p, c.newprog) p.As = AMOVD p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + objabi.StackGuard - objabi.StackSmall + p.From.Offset = int64(framesize) + int64(objabi.StackGuard) - objabi.StackSmall p.To.Type = obj.TYPE_REG p.To.Reg = REGTMP diff --git a/src/cmd/internal/obj/s390x/objz.go b/src/cmd/internal/obj/s390x/objz.go index b7b8a2c7a6373..b7a2873106f6e 100644 --- a/src/cmd/internal/obj/s390x/objz.go +++ b/src/cmd/internal/obj/s390x/objz.go @@ -641,7 +641,7 @@ func (c *ctxtz) stacksplitPre(p *obj.Prog, framesize int32) (*obj.Prog, *obj.Pro p = obj.Appendp(p, c.newprog) p.As = AADD p.From.Type = obj.TYPE_CONST - p.From.Offset = objabi.StackGuard + p.From.Offset = int64(objabi.StackGuard) p.Reg = REGSP p.To.Type = obj.TYPE_REG p.To.Reg = REG_R4 @@ -656,7 +656,7 @@ func (c *ctxtz) stacksplitPre(p *obj.Prog, framesize int32) (*obj.Prog, *obj.Pro p = obj.Appendp(p, c.newprog) p.As = AMOVD p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(framesize) + objabi.StackGuard - objabi.StackSmall + p.From.Offset = int64(framesize) + int64(objabi.StackGuard) - objabi.StackSmall p.To.Type = obj.TYPE_REG p.To.Reg = REGTMP diff --git a/src/cmd/internal/obj/x86/obj6.go b/src/cmd/internal/obj/x86/obj6.go index 139f293b136f0..babfd38ad2351 100644 --- a/src/cmd/internal/obj/x86/obj6.go +++ b/src/cmd/internal/obj/x86/obj6.go @@ -1115,7 +1115,7 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA p.As = lea p.From.Type = obj.TYPE_MEM p.From.Reg = REG_SP - p.From.Offset = objabi.StackGuard + p.From.Offset = int64(objabi.StackGuard) p.To.Type = obj.TYPE_REG p.To.Reg = REG_AX @@ -1131,7 +1131,7 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA p.From.Type = obj.TYPE_REG p.From.Reg = REG_AX p.To.Type = obj.TYPE_CONST - p.To.Offset = int64(framesize) + (objabi.StackGuard - objabi.StackSmall) + p.To.Offset = int64(framesize) + (int64(objabi.StackGuard) - objabi.StackSmall) } // common diff --git a/src/cmd/internal/objabi/stack.go b/src/cmd/internal/objabi/stack.go index 11433932e2dcf..62ab0398a6653 100644 --- a/src/cmd/internal/objabi/stack.go +++ b/src/cmd/internal/objabi/stack.go @@ -10,11 +10,24 @@ const ( STACKSYSTEM = 0 StackSystem = STACKSYSTEM StackBig = 4096 - StackGuard = 880*stackGuardMultiplier + StackSystem StackSmall = 128 - StackLimit = StackGuard - StackSystem - StackSmall ) const ( StackPreempt = -1314 // 0xfff...fade ) + +// Initialize StackGuard and StackLimit according to target system. +var StackGuard = 880*stackGuardMultiplier() + StackSystem +var StackLimit = StackGuard - StackSystem - StackSmall + +// stackGuardMultiplier returns a multiplier to apply to the default +// stack guard size. Larger multipliers are used for non-optimized +// builds that have larger stack frames or for specific targets. +func stackGuardMultiplier() int { + // On AIX, a larger stack is needed for syscalls. + if GOOS == "aix" { + return 2 + } + return stackGuardMultiplierDefault +} diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index b45397e7278a2..2cb7ae72e4d2d 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -2007,7 +2007,7 @@ func stkcheck(ctxt *Link, up *chain, depth int) int { if s.FuncInfo != nil { locals = s.FuncInfo.Locals } - limit = int(objabi.StackLimit+locals) + int(ctxt.FixedFrameSize()) + limit = objabi.StackLimit + int(locals) + int(ctxt.FixedFrameSize()) } // Walk through sp adjustments in function, consuming relocs. diff --git a/src/runtime/internal/sys/stubs.go b/src/runtime/internal/sys/stubs.go index 53280232682b8..10b0173f601d5 100644 --- a/src/runtime/internal/sys/stubs.go +++ b/src/runtime/internal/sys/stubs.go @@ -11,3 +11,6 @@ const RegSize = 4 << (^Uintreg(0) >> 63) // unsafe.Sizeof(uintreg(0)) const SpAlign = 1*(1-GoarchArm64) + 16*GoarchArm64 // SP alignment: 1 normally, 16 for ARM64 var DefaultGoroot string // set at link time + +// AIX requires a larger stack for syscalls. +const StackGuardMultiplier = StackGuardMultiplierDefault*(1-GoosAix) + 2*GoosAix From 9aa2c06cb5cb4603500e5fbc35385fe890c6779b Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Thu, 10 Jan 2019 05:14:40 +0900 Subject: [PATCH 512/594] net: update BUG sections for go1.12 To confirm this change with the go commaned, please run 'go doc net' instead of 'go doc -all net'; the -all option surpresses BUG sections. Change-Id: Iac7bc85fbef48e91d5ede16da0ce4a7ab8cae539 Reviewed-on: https://go-review.googlesource.com/c/157297 Run-TryBot: Mikio Hara TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/net/interface.go | 4 ++-- src/net/unixsock.go | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/net/interface.go b/src/net/interface.go index 8d29a44db804b..58248560a25c5 100644 --- a/src/net/interface.go +++ b/src/net/interface.go @@ -13,8 +13,8 @@ import ( // BUG(mikio): On JS and NaCl, methods and functions related to // Interface are not implemented. -// BUG(mikio): On DragonFly BSD, NetBSD, OpenBSD, Plan 9 and Solaris, -// the MulticastAddrs method of Interface is not implemented. +// BUG(mikio): On AIX, DragonFly BSD, NetBSD, OpenBSD, Plan 9 and +// Solaris, the MulticastAddrs method of Interface is not implemented. var ( errInvalidInterface = errors.New("invalid network interface") diff --git a/src/net/unixsock.go b/src/net/unixsock.go index 3ae62f6a8b84a..ae912a46ddb8c 100644 --- a/src/net/unixsock.go +++ b/src/net/unixsock.go @@ -12,8 +12,11 @@ import ( "time" ) -// BUG(mikio): On JS, NaCl, Plan 9 and Windows, methods and functions -// related to UnixConn and UnixListener are not implemented. +// BUG(mikio): On JS, NaCl and Plan 9, methods and functions related +// to UnixConn and UnixListener are not implemented. + +// BUG(mikio): On Windows, methods and functions related to UnixConn +// and UnixListener don't work for "unixgram" and "unixpacket". // UnixAddr represents the address of a Unix domain socket end point. type UnixAddr struct { From 94d9a2045398b471c8aec0b701cad06536e049b3 Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Thu, 10 Jan 2019 05:14:40 +0900 Subject: [PATCH 513/594] net: drop confusing comment On AIX, we don't need to be aware of any change on the protocol stack of Linux kernel. Change-Id: Ib8b14fa930acddb3bc720d401271e8daf567b784 Reviewed-on: https://go-review.googlesource.com/c/157298 Run-TryBot: Mikio Hara TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/net/sockopt_aix.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/net/sockopt_aix.go b/src/net/sockopt_aix.go index 6fb207fc92771..b49c4d5c7c720 100644 --- a/src/net/sockopt_aix.go +++ b/src/net/sockopt_aix.go @@ -9,8 +9,6 @@ import ( "syscall" ) -// This was copied from sockopt_linux.go - func setDefaultSockopts(s, family, sotype int, ipv6only bool) error { if family == syscall.AF_INET6 && sotype != syscall.SOCK_RAW { // Allow both IP versions even if the OS default From 44cf595a7efcd3d7048c745d1d1531696bcb5941 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 5 Jan 2019 18:35:27 +1100 Subject: [PATCH 514/594] path/filepath: return special error from EvalSymlinks CL 155597 attempted to fix #29372. But it failed to make all new test cases pass. Also CL 155597 broke some existing code (see #29449 for details). Make small adjustment to CL 155597 that fixes both #29372 and #29449. Suggested by Ian. Updates #29372 Fixes #29449 Change-Id: I9777a615514d3f152af5acb65fb1239e696607b6 Reviewed-on: https://go-review.googlesource.com/c/156398 Run-TryBot: Alex Brainman Reviewed-by: Ian Lance Taylor --- src/path/filepath/path_test.go | 25 +++++++------------- src/path/filepath/path_windows_test.go | 32 ++++++++++++++++++++++---- src/path/filepath/symlink.go | 3 +-- src/path/filepath/symlink_unix.go | 9 ++++++++ src/path/filepath/symlink_windows.go | 26 ++++++++------------- 5 files changed, 54 insertions(+), 41 deletions(-) diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go index 1b9f286c4d87a..cbddda88b6693 100644 --- a/src/path/filepath/path_test.go +++ b/src/path/filepath/path_test.go @@ -1382,27 +1382,18 @@ func TestIssue29372(t *testing.T) { path := f.Name() defer os.Remove(path) - isWin := runtime.GOOS == "windows" pathSeparator := string(filepath.Separator) - tests := []struct { - path string - skip bool - }{ - {path + strings.Repeat(pathSeparator, 1), false}, - {path + strings.Repeat(pathSeparator, 2), false}, - {path + strings.Repeat(pathSeparator, 1) + ".", false}, - {path + strings.Repeat(pathSeparator, 2) + ".", false}, - // windows.GetFinalPathNameByHandle return the directory part with trailing dot dot - // C:\path\to\existing_dir\existing_file\.. returns C:\path\to\existing_dir - {path + strings.Repeat(pathSeparator, 1) + "..", isWin}, - {path + strings.Repeat(pathSeparator, 2) + "..", isWin}, + tests := []string{ + path + strings.Repeat(pathSeparator, 1), + path + strings.Repeat(pathSeparator, 2), + path + strings.Repeat(pathSeparator, 1) + ".", + path + strings.Repeat(pathSeparator, 2) + ".", + path + strings.Repeat(pathSeparator, 1) + "..", + path + strings.Repeat(pathSeparator, 2) + "..", } for i, test := range tests { - if test.skip { - continue - } - _, err = filepath.EvalSymlinks(test.path) + _, err = filepath.EvalSymlinks(test) if err != syscall.ENOTDIR { t.Fatalf("test#%d: want %q, got %q", i, syscall.ENOTDIR, err) } diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go index 63eab18116cf5..3fcccfab785c6 100644 --- a/src/path/filepath/path_windows_test.go +++ b/src/path/filepath/path_windows_test.go @@ -536,17 +536,39 @@ func TestNTNamespaceSymlink(t *testing.T) { } target := strings.Trim(string(output), " \n\r") - link := filepath.Join(tmpdir, "link") - output, err = exec.Command("cmd", "/c", "mklink", "/J", link, target).CombinedOutput() + dirlink := filepath.Join(tmpdir, "dirlink") + output, err = exec.Command("cmd", "/c", "mklink", "/J", dirlink, target).CombinedOutput() if err != nil { - t.Fatalf("failed to run mklink %v %v: %v %q", link, target, err, output) + t.Fatalf("failed to run mklink %v %v: %v %q", dirlink, target, err, output) } - got, err := filepath.EvalSymlinks(link) + got, err := filepath.EvalSymlinks(dirlink) if err != nil { t.Fatal(err) } if want := vol + `\`; got != want { - t.Errorf(`EvalSymlinks(%q): got %q, want %q`, link, got, want) + t.Errorf(`EvalSymlinks(%q): got %q, want %q`, dirlink, got, want) + } + + file := filepath.Join(tmpdir, "file") + err = ioutil.WriteFile(file, []byte(""), 0666) + if err != nil { + t.Fatal(err) + } + + target += file[len(filepath.VolumeName(file)):] + + filelink := filepath.Join(tmpdir, "filelink") + output, err = exec.Command("cmd", "/c", "mklink", filelink, target).CombinedOutput() + if err != nil { + t.Fatalf("failed to run mklink %v %v: %v %q", filelink, target, err, output) + } + + got, err = filepath.EvalSymlinks(filelink) + if err != nil { + t.Fatal(err) + } + if want := file; got != want { + t.Errorf(`EvalSymlinks(%q): got %q, want %q`, filelink, got, want) } } diff --git a/src/path/filepath/symlink.go b/src/path/filepath/symlink.go index a08b85a29cdb3..4b41039e25f75 100644 --- a/src/path/filepath/symlink.go +++ b/src/path/filepath/symlink.go @@ -8,7 +8,6 @@ import ( "errors" "os" "runtime" - "syscall" ) func walkSymlinks(path string) (string, error) { @@ -79,7 +78,7 @@ func walkSymlinks(path string) (string, error) { if fi.Mode()&os.ModeSymlink == 0 { if !fi.Mode().IsDir() && end < len(path) { - return "", syscall.ENOTDIR + return "", slashAfterFilePathError } continue } diff --git a/src/path/filepath/symlink_unix.go b/src/path/filepath/symlink_unix.go index d20e63a987e9a..b57e7f2277e3e 100644 --- a/src/path/filepath/symlink_unix.go +++ b/src/path/filepath/symlink_unix.go @@ -2,6 +2,15 @@ package filepath +import ( + "syscall" +) + +// walkSymlinks returns slashAfterFilePathError error for paths like +// //path/to/existing_file/ and /path/to/existing_file/. and /path/to/existing_file/.. + +var slashAfterFilePathError = syscall.ENOTDIR + func evalSymlinks(path string) (string, error) { return walkSymlinks(path) } diff --git a/src/path/filepath/symlink_windows.go b/src/path/filepath/symlink_windows.go index 1108b3ddff0bd..531dc26fc0e4f 100644 --- a/src/path/filepath/symlink_windows.go +++ b/src/path/filepath/symlink_windows.go @@ -159,18 +159,6 @@ func evalSymlinksUsingGetFinalPathNameByHandle(path string) (string, error) { return "", errors.New("GetFinalPathNameByHandle returned unexpected path=" + s) } -func symlinkOrDir(path string) (string, error) { - fi, err := os.Lstat(path) - if err != nil { - return "", err - } - - if fi.Mode()&os.ModeSymlink == 0 && !fi.Mode().IsDir() { - return "", syscall.ENOTDIR - } - return path, nil -} - func samefile(path1, path2 string) bool { fi1, err := os.Lstat(path1) if err != nil { @@ -183,16 +171,20 @@ func samefile(path1, path2 string) bool { return os.SameFile(fi1, fi2) } +// walkSymlinks returns slashAfterFilePathError error for paths like +// //path/to/existing_file/ and /path/to/existing_file/. and /path/to/existing_file/.. + +var slashAfterFilePathError = errors.New("attempting to walk past file path.") + func evalSymlinks(path string) (string, error) { newpath, err := walkSymlinks(path) + if err == slashAfterFilePathError { + return "", syscall.ENOTDIR + } if err != nil { newpath2, err2 := evalSymlinksUsingGetFinalPathNameByHandle(path) if err2 == nil { - normPath, toNormErr := toNorm(newpath2, normBase) - if toNormErr != nil { - return "", toNormErr - } - return symlinkOrDir(normPath) + return toNorm(newpath2, normBase) } return "", err } From 4b3f04c63b5b1a1bbc4dfd71c34341ea4e935115 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Fri, 4 Jan 2019 20:17:15 +0000 Subject: [PATCH 515/594] runtime: make mTreap iterator bidirectional This change makes mTreap's iterator type, treapIter, bidirectional instead of unidirectional. This change helps support moving the find operation on a treap to return an iterator instead of a treapNode, in order to hide the details of the treap when accessing elements. For #28479. Change-Id: I5dbea4fd4fb9bede6e81bfd089f2368886f98943 Reviewed-on: https://go-review.googlesource.com/c/156918 Reviewed-by: Austin Clements Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot --- src/runtime/export_test.go | 2 +- src/runtime/mgclarge.go | 54 ++++++++++++++++++-------------------- src/runtime/mheap.go | 14 +++++----- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go index de66b07c68ebb..9eaf92dc7cbb4 100644 --- a/src/runtime/export_test.go +++ b/src/runtime/export_test.go @@ -337,7 +337,7 @@ func ReadMemStatsSlow() (base, slow MemStats) { slow.BySize[i].Frees = bySize[i].Frees } - for i := mheap_.scav.iter(); i.valid(); i = i.next() { + for i := mheap_.scav.start(); i.valid(); i = i.next() { slow.HeapReleased += uint64(i.span().released()) } diff --git a/src/runtime/mgclarge.go b/src/runtime/mgclarge.go index 2a04d4a7933fa..7b01a117808fc 100644 --- a/src/runtime/mgclarge.go +++ b/src/runtime/mgclarge.go @@ -153,15 +153,14 @@ func checkTreapNode(t *treapNode) { } } -// treapIter is a unidirectional iterator type which may be used to iterate over a +// treapIter is a bidirectional iterator type which may be used to iterate over a // an mTreap in-order forwards (increasing order) or backwards (decreasing order). // Its purpose is to hide details about the treap from users when trying to iterate // over it. // -// To create iterators over the treap, call iter or rev on an mTreap. +// To create iterators over the treap, call start or end on an mTreap. type treapIter struct { - t *treapNode - inc bool // if true, iterate in increasing order, otherwise decreasing order. + t *treapNode } // span returns the span at the current position in the treap. @@ -179,42 +178,41 @@ func (i *treapIter) valid() bool { // next moves the iterator forward by one. Once the iterator // ceases to be valid, calling next will panic. func (i treapIter) next() treapIter { - if i.inc { - i.t = i.t.succ() - } else { - i.t = i.t.pred() - } + i.t = i.t.succ() return i } -// iter returns an iterator which may be used to iterate over the treap -// in increasing order of span size ("forwards"). -func (root *mTreap) iter() treapIter { - i := treapIter{inc: true} +// prev moves the iterator backwards by one. Once the iterator +// ceases to be valid, calling prev will panic. +func (i treapIter) prev() treapIter { + i.t = i.t.pred() + return i +} + +// start returns an iterator which points to the start of the treap (the +// left-most node in the treap). +func (root *mTreap) start() treapIter { t := root.treap if t == nil { - return i + return treapIter{} } for t.left != nil { t = t.left } - i.t = t - return i + return treapIter{t: t} } -// rev returns an iterator which may be used to iterate over the treap -// in decreasing order of span size ("reverse"). -func (root *mTreap) rev() treapIter { - i := treapIter{inc: false} +// end returns an iterator which points to the end of the treap (the +// right-most node in the treap). +func (root *mTreap) end() treapIter { t := root.treap if t == nil { - return i + return treapIter{} } for t.right != nil { t = t.right } - i.t = t - return i + return treapIter{t: t} } // insert adds span to the large span treap. @@ -342,13 +340,11 @@ func (root *mTreap) removeSpan(span *mspan) { } // erase removes the element referred to by the current position of the -// iterator and returns i.next(). This operation consumes the given -// iterator, so it should no longer be used and iteration should continue -// from the returned iterator. -func (root *mTreap) erase(i treapIter) treapIter { - n := i.next() +// iterator. This operation consumes the given iterator, so it should no +// longer be used. It is up to the caller to get the next or previous +// iterator before calling erase, if need be. +func (root *mTreap) erase(i treapIter) { root.removeNode(i.t) - return n } // rotateLeft rotates the tree rooted at node x. diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 9d7d683cd1008..f5b5ba99b8418 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -1287,7 +1287,7 @@ func (h *mheap) scavengeLargest(nbytes uintptr) { // Iterate over the treap backwards (from largest to smallest) scavenging spans // until we've reached our quota of nbytes. released := uintptr(0) - for t := h.free.rev(); released < nbytes && t.valid(); { + for t := h.free.end(); released < nbytes && t.valid(); { s := t.span() r := s.scavenge() if r == 0 { @@ -1302,7 +1302,9 @@ func (h *mheap) scavengeLargest(nbytes uintptr) { // those which have it unset are only in the `free` treap. return } - t = h.free.erase(t) + n := t.prev() + h.free.erase(t) + t = n h.scav.insert(s) released += r } @@ -1314,18 +1316,18 @@ func (h *mheap) scavengeLargest(nbytes uintptr) { func (h *mheap) scavengeAll(now, limit uint64) uintptr { // Iterate over the treap scavenging spans if unused for at least limit time. released := uintptr(0) - for t := h.free.iter(); t.valid(); { + for t := h.free.start(); t.valid(); { s := t.span() + n := t.next() if (now - uint64(s.unusedsince)) > limit { r := s.scavenge() if r != 0 { - t = h.free.erase(t) + h.free.erase(t) h.scav.insert(s) released += r - continue } } - t = t.next() + t = n } return released } From 5f699e400a0a982bcc3ad1ff864dca70b1255d8b Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 10 Jan 2019 11:12:28 -0800 Subject: [PATCH 516/594] doc: add Go 1.12 release note for trigonometric reductions in math Worth mentioning because the results are not bit-for-bit identical. This causes a test failure in github.com/fogleman/gg. Updates #6794 Change-Id: I701f34927731fb5c658a1be271c04388e5e7e3f7 Reviewed-on: https://go-review.googlesource.com/c/157417 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 568920df6d715..e228d98a8cc88 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -553,6 +553,20 @@

    Minor changes to the library

    +
    math
    +
    +

    + The functions + Sin, + Cos, + Tan, + and Sincos now + apply Payne-Hanek range reduction to huge arguments. This + produces more accurate answers, but they will not be bit-for-bit + identical with the results in earlier releases. +

    +
    +
    math/bits

    From a2e79571a9d3dbe3cf10dcaeb1f9c01732219869 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 8 Jan 2019 22:23:52 -0500 Subject: [PATCH 517/594] cmd/compile: separate data and function LSyms Currently, obj.Ctxt's symbol table does not distinguish between ABI0 and ABIInternal symbols. This is *almost* okay, since a given symbol name in the final object file is only going to belong to one ABI or the other, but it requires that the compiler mark a Sym as being a function symbol before it retrieves its LSym. If it retrieves the LSym first, that LSym will be created as ABI0, and later marking the Sym as a function symbol won't change the LSym's ABI. Marking a Sym as a function symbol before looking up its LSym sounds easy, except Syms have a dual purpose: they are used just as interned strings (every function, variable, parameter, etc with the same textual name shares a Sym), and *also* to store state for whatever package global has that name. As a result, it's easy to slip up and look up an LSym when a Sym is serving as the name of a local variable, and then later mark it as a function when it's serving as the global with the name. In general, we were careful to avoid this, but #29610 demonstrates one case where we messed up. Because of on-demand importing from indexed export data, it's possible to compile a method wrapper for a type imported from another package before importing an init function from that package. If the argument of the method is named "init", the "init" LSym will be created as a data symbol when compiling the wrapper, before it gets marked as a function symbol. To fix this, we separate obj.Ctxt's symbol tables for ABI0 and ABIInternal symbols. This way, the compiler will simply get a different LSym once the Sym takes on its package-global meaning as a function. This fixes the above ordering issue, and means we no longer need to go out of our way to create the "init" function early and mark it as a function symbol. Fixes #29610. Updates #27539. Change-Id: Id9458b40017893d46ef9e4a3f9b47fc49e1ce8df Reviewed-on: https://go-review.googlesource.com/c/157017 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- src/cmd/compile/internal/gc/main.go | 5 ----- src/cmd/compile/internal/gc/ssa.go | 2 +- src/cmd/compile/internal/types/sym.go | 4 +--- src/cmd/internal/obj/arm/asm5.go | 3 +-- src/cmd/internal/obj/link.go | 3 ++- src/cmd/internal/obj/sym.go | 25 +++++++++++++++++++++++++ src/cmd/internal/obj/wasm/wasmobj.go | 12 +++++++----- src/cmd/internal/obj/x86/asm6.go | 3 +-- test/fixedbugs/issue29610.dir/a.go | 15 +++++++++++++++ test/fixedbugs/issue29610.dir/b.go | 17 +++++++++++++++++ test/fixedbugs/issue29610.dir/main.go | 11 +++++++++++ test/fixedbugs/issue29610.go | 13 +++++++++++++ 12 files changed, 94 insertions(+), 19 deletions(-) create mode 100644 test/fixedbugs/issue29610.dir/a.go create mode 100644 test/fixedbugs/issue29610.dir/b.go create mode 100644 test/fixedbugs/issue29610.dir/main.go create mode 100644 test/fixedbugs/issue29610.go diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index f44d19b4390ef..98ff2a3d27a1c 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -563,11 +563,6 @@ func Main(archInit func(*Arch)) { errorexit() } - // The "init" function is the only user-spellable symbol that - // we construct later. Mark it as a function now before - // anything can ask for its Linksym. - lookup("init").SetFunc(true) - // Phase 4: Decide how to capture closed variables. // This needs to run before escape analysis, // because variables captured by value do not escape. diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index db26f135f59b7..e20137669aaac 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -106,7 +106,7 @@ func initssaconfig() { WasmDiv = sysvar("wasmDiv") WasmTruncS = sysvar("wasmTruncS") WasmTruncU = sysvar("wasmTruncU") - SigPanic = sysvar("sigpanic") + SigPanic = sysfunc("sigpanic") } // buildssa builds an SSA function for fn. diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go index 86f5022b5c84f..13761c7615b40 100644 --- a/src/cmd/compile/internal/types/sym.go +++ b/src/cmd/compile/internal/types/sym.go @@ -79,9 +79,7 @@ func (sym *Sym) Linksym() *obj.LSym { } if sym.Func() { // This is a function symbol. Mark it as "internal ABI". - return Ctxt.LookupInit(sym.LinksymName(), func(s *obj.LSym) { - s.SetABI(obj.ABIInternal) - }) + return Ctxt.LookupABI(sym.LinksymName(), obj.ABIInternal) } return Ctxt.Lookup(sym.LinksymName()) } diff --git a/src/cmd/internal/obj/arm/asm5.go b/src/cmd/internal/obj/arm/asm5.go index 316937bde0892..b1fb1d394411a 100644 --- a/src/cmd/internal/obj/arm/asm5.go +++ b/src/cmd/internal/obj/arm/asm5.go @@ -1529,8 +1529,7 @@ func buildop(ctxt *obj.Link) { return } - deferreturn = ctxt.Lookup("runtime.deferreturn") - deferreturn.SetABI(obj.ABIInternal) + deferreturn = ctxt.LookupABI("runtime.deferreturn", obj.ABIInternal) symdiv = ctxt.Lookup("runtime._div") symdivu = ctxt.Lookup("runtime._divu") diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index 7df8e2e516857..f506f60d065d4 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -626,8 +626,9 @@ type Link struct { Flag_locationlists bool Bso *bufio.Writer Pathname string - hashmu sync.Mutex // protects hash + hashmu sync.Mutex // protects hash, funchash hash map[string]*LSym // name -> sym mapping + funchash map[string]*LSym // name -> sym mapping for ABIInternal syms statichash map[string]*LSym // name -> sym mapping for static syms PosTable src.PosTable InlTree InlTree // global inlining tree used by gc/inl.go diff --git a/src/cmd/internal/obj/sym.go b/src/cmd/internal/obj/sym.go index 3fc17fa850711..15a501c3aa514 100644 --- a/src/cmd/internal/obj/sym.go +++ b/src/cmd/internal/obj/sym.go @@ -41,6 +41,7 @@ import ( func Linknew(arch *LinkArch) *Link { ctxt := new(Link) ctxt.hash = make(map[string]*LSym) + ctxt.funchash = make(map[string]*LSym) ctxt.statichash = make(map[string]*LSym) ctxt.Arch = arch ctxt.Pathname = objabi.WorkingDir() @@ -74,6 +75,30 @@ func (ctxt *Link) LookupStatic(name string) *LSym { return s } +// LookupABI looks up a symbol with the given ABI. +// If it does not exist, it creates it. +func (ctxt *Link) LookupABI(name string, abi ABI) *LSym { + var hash map[string]*LSym + switch abi { + case ABI0: + hash = ctxt.hash + case ABIInternal: + hash = ctxt.funchash + default: + panic("unknown ABI") + } + + ctxt.hashmu.Lock() + s := hash[name] + if s == nil { + s = &LSym{Name: name} + s.SetABI(abi) + hash[name] = s + } + ctxt.hashmu.Unlock() + return s +} + // Lookup looks up the symbol with name name. // If it does not exist, it creates it. func (ctxt *Link) Lookup(name string) *LSym { diff --git a/src/cmd/internal/obj/wasm/wasmobj.go b/src/cmd/internal/obj/wasm/wasmobj.go index 23283a12cf657..fbea103dcb080 100644 --- a/src/cmd/internal/obj/wasm/wasmobj.go +++ b/src/cmd/internal/obj/wasm/wasmobj.go @@ -125,11 +125,13 @@ func instinit(ctxt *obj.Link) { morestack = ctxt.Lookup("runtime.morestack") morestackNoCtxt = ctxt.Lookup("runtime.morestack_noctxt") gcWriteBarrier = ctxt.Lookup("runtime.gcWriteBarrier") - sigpanic = ctxt.Lookup("runtime.sigpanic") - sigpanic.SetABI(obj.ABIInternal) - deferreturn = ctxt.Lookup("runtime.deferreturn") - deferreturn.SetABI(obj.ABIInternal) - jmpdefer = ctxt.Lookup(`"".jmpdefer`) + sigpanic = ctxt.LookupABI("runtime.sigpanic", obj.ABIInternal) + deferreturn = ctxt.LookupABI("runtime.deferreturn", obj.ABIInternal) + // jmpdefer is defined in assembly as ABI0, but what we're + // looking for is the *call* to jmpdefer from the Go function + // deferreturn, so we're looking for the ABIInternal version + // of jmpdefer that's called by Go. + jmpdefer = ctxt.LookupABI(`"".jmpdefer`, obj.ABIInternal) } func preprocess(ctxt *obj.Link, s *obj.LSym, newprog obj.ProgAlloc) { diff --git a/src/cmd/internal/obj/x86/asm6.go b/src/cmd/internal/obj/x86/asm6.go index 520f4be8f5653..c3da29ce2cbd4 100644 --- a/src/cmd/internal/obj/x86/asm6.go +++ b/src/cmd/internal/obj/x86/asm6.go @@ -2064,8 +2064,7 @@ func instinit(ctxt *obj.Link) { case objabi.Hplan9: plan9privates = ctxt.Lookup("_privates") case objabi.Hnacl: - deferreturn = ctxt.Lookup("runtime.deferreturn") - deferreturn.SetABI(obj.ABIInternal) + deferreturn = ctxt.LookupABI("runtime.deferreturn", obj.ABIInternal) } for i := range avxOptab { diff --git a/test/fixedbugs/issue29610.dir/a.go b/test/fixedbugs/issue29610.dir/a.go new file mode 100644 index 0000000000000..ccbe451bca9cb --- /dev/null +++ b/test/fixedbugs/issue29610.dir/a.go @@ -0,0 +1,15 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package a + +type I interface { + M(init bool) +} + +var V I + +func init() { + V = nil +} diff --git a/test/fixedbugs/issue29610.dir/b.go b/test/fixedbugs/issue29610.dir/b.go new file mode 100644 index 0000000000000..c2016de3d05ca --- /dev/null +++ b/test/fixedbugs/issue29610.dir/b.go @@ -0,0 +1,17 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package b + +import "./a" + +type S struct { + a.I +} + +var V a.I + +func init() { + V = S{} +} diff --git a/test/fixedbugs/issue29610.dir/main.go b/test/fixedbugs/issue29610.dir/main.go new file mode 100644 index 0000000000000..29437bfa61863 --- /dev/null +++ b/test/fixedbugs/issue29610.dir/main.go @@ -0,0 +1,11 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "./b" + +var v b.S + +func main() {} diff --git a/test/fixedbugs/issue29610.go b/test/fixedbugs/issue29610.go new file mode 100644 index 0000000000000..8d49ba6b8c19c --- /dev/null +++ b/test/fixedbugs/issue29610.go @@ -0,0 +1,13 @@ +// rundir + +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 29610: Symbol import and initialization order caused function +// symbols to be recorded as non-function symbols. + +// This uses rundir not because we actually want to run the final +// binary, but because we need to at least link it. + +package ignored From a2bb68de4d1cb1ca35279523365e9caf36fb9896 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 11 Jan 2019 15:28:04 +0000 Subject: [PATCH 518/594] cmd/go: remove note about GOCACHE=off in docs This patch removes mention of GOCACHE=off from the help/docs. It is no longer supported in Go 1.12, per the release notes. Fixes #29680 Change-Id: I53ab15a62743f2e55ae1d8aa50629b1bf1ae32ad GitHub-Last-Rev: 31e904f51dece13645696a87b1164d86c984457f GitHub-Pull-Request: golang/go#29681 Reviewed-on: https://go-review.googlesource.com/c/157517 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/go/alldocs.go | 1 - src/cmd/go/internal/help/helpdoc.go | 1 - 2 files changed, 2 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 9d9304a3b64fa..5a6a1c82cce01 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1397,7 +1397,6 @@ // in the standard user cache directory for the current operating system. // Setting the GOCACHE environment variable overrides this default, // and running 'go env GOCACHE' prints the current cache directory. -// You can set the variable to 'off' to disable the cache. // // The go command periodically deletes cached data that has not been // used recently. Running 'go clean -cache' deletes all cached data. diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index 973bfbc611d89..6545a43abe49d 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -705,7 +705,6 @@ The default location for cache data is a subdirectory named go-build in the standard user cache directory for the current operating system. Setting the GOCACHE environment variable overrides this default, and running 'go env GOCACHE' prints the current cache directory. -You can set the variable to 'off' to disable the cache. The go command periodically deletes cached data that has not been used recently. Running 'go clean -cache' deletes all cached data. From 7cbfa55b5d17c8deaecff05e4221f828467cfa97 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 11 Jan 2019 14:26:24 -0800 Subject: [PATCH 519/594] net: pass if at least one matching entry in TestLookupGmailTXT Fixes #29698 Change-Id: I0531c0a274b120af8871aa2f5975744ff6c912a3 Reviewed-on: https://go-review.googlesource.com/c/157638 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/lookup_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go index 1da0e49a28c30..6dc5f61728ab3 100644 --- a/src/net/lookup_test.go +++ b/src/net/lookup_test.go @@ -237,11 +237,16 @@ func TestLookupGmailTXT(t *testing.T) { if len(txts) == 0 { t.Error("got no record") } + found := false for _, txt := range txts { - if !strings.Contains(txt, tt.txt) || (!strings.HasSuffix(txt, tt.host) && !strings.HasSuffix(txt, tt.host+".")) { - t.Errorf("got %s; want a record containing %s, %s", txt, tt.txt, tt.host) + if strings.Contains(txt, tt.txt) && (strings.HasSuffix(txt, tt.host) || strings.HasSuffix(txt, tt.host+".")) { + found = true + break } } + if !found { + t.Errorf("got %v; want a record containing %s, %s", txts, tt.txt, tt.host) + } } } From 4e8aaf6b22557a485cd3af874bf5be2722b07835 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sun, 13 Jan 2019 22:11:44 +0100 Subject: [PATCH 520/594] net: skip TestLookupGmailTXT on Plan 9 CL 157638 updated TestLookupGmailTXT. However, this test is failing on Plan 9, because the DNS resolver (ndb/dns) only returns a single TXT record. Updates #29722. Change-Id: I01cd94e6167902361c3f5d615868f6f763a31fb1 Reviewed-on: https://go-review.googlesource.com/c/157737 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/net/lookup_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net/lookup_test.go b/src/net/lookup_test.go index 6dc5f61728ab3..85bcb2b8960b2 100644 --- a/src/net/lookup_test.go +++ b/src/net/lookup_test.go @@ -207,6 +207,9 @@ var lookupGmailTXTTests = []struct { } func TestLookupGmailTXT(t *testing.T) { + if runtime.GOOS == "plan9" { + t.Skip("skipping on plan9; see https://golang.org/issue/29722") + } t.Parallel() mustHaveExternalNetwork(t) From 70931c087b7ceb660aa969382b8c273efba63426 Mon Sep 17 00:00:00 2001 From: Daniel Theophanes Date: Fri, 11 Jan 2019 14:20:41 -0800 Subject: [PATCH 521/594] database/sql: fix logic for pulling a Conn from DB The logic for pulling a database connection from the DB pool should proceed as follows: attempt to pull either a cached connection or new connection N times in a loop. If each connection results in a bad connection, then create a new connection (no cache). Previously pulling a Conn from the pool, the last step also looked at the cache, rather then always creating a new connection. Fixes #29684 Change-Id: I8f436fd9b96eb35502a620ebe8da4ab89fb06a2e Reviewed-on: https://go-review.googlesource.com/c/157637 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/database/sql/sql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/database/sql/sql.go b/src/database/sql/sql.go index b0353ab4dc782..38a173adba852 100644 --- a/src/database/sql/sql.go +++ b/src/database/sql/sql.go @@ -1698,7 +1698,7 @@ func (db *DB) Conn(ctx context.Context) (*Conn, error) { } } if err == driver.ErrBadConn { - dc, err = db.conn(ctx, cachedOrNewConn) + dc, err = db.conn(ctx, alwaysNewConn) } if err != nil { return nil, err From 7502ed3b90eeb4d8f1f9bd781df3517f41ea912c Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 8 Jan 2019 13:46:49 -0800 Subject: [PATCH 522/594] cmd/compile: when merging instructions, prefer line number of faulting insn Normally this happens when combining a sign extension and a load. We want the resulting combo-instruction to get the line number of the load, not the line number of the sign extension. For each rule, compute where we should get its line number by finding a value on the match side that can fault. Use that line number for all the new values created on the right-hand side. Fixes #27201 Change-Id: I19b3c6f468fff1a3c0bfbce2d6581828557064a3 Reviewed-on: https://go-review.googlesource.com/c/156937 Reviewed-by: David Chase --- src/cmd/compile/internal/ssa/gen/rulegen.go | 51 ++- src/cmd/compile/internal/ssa/rewrite386.go | 32 +- src/cmd/compile/internal/ssa/rewriteAMD64.go | 346 ++++++++-------- src/cmd/compile/internal/ssa/rewriteARM64.go | 144 +++---- src/cmd/compile/internal/ssa/rewriteMIPS.go | 8 +- src/cmd/compile/internal/ssa/rewritePPC64.go | 414 +++++++++---------- src/cmd/compile/internal/ssa/rewriteS390X.go | 294 ++++++------- test/fixedbugs/issue27201.go | 37 ++ 8 files changed, 693 insertions(+), 633 deletions(-) create mode 100644 test/fixedbugs/issue27201.go diff --git a/src/cmd/compile/internal/ssa/gen/rulegen.go b/src/cmd/compile/internal/ssa/gen/rulegen.go index 34517b4cb9aa8..730e768ed64dc 100644 --- a/src/cmd/compile/internal/ssa/gen/rulegen.go +++ b/src/cmd/compile/internal/ssa/gen/rulegen.go @@ -209,7 +209,11 @@ func genRules(arch arch) { canFail = false fmt.Fprintf(buf, "for {\n") - if genMatch(buf, arch, match, rule.loc) { + pos, matchCanFail := genMatch(buf, arch, match, rule.loc) + if pos == "" { + pos = "v.Pos" + } + if matchCanFail { canFail = true } @@ -221,7 +225,7 @@ func genRules(arch arch) { log.Fatalf("unconditional rule %s is followed by other rules", match) } - genResult(buf, arch, result, rule.loc) + genResult(buf, arch, result, rule.loc, pos) if *genLog { fmt.Fprintf(buf, "logRule(\"%s\")\n", rule.loc) } @@ -291,10 +295,11 @@ func genRules(arch arch) { _, _, _, aux, s := extract(match) // remove parens, then split // check match of control value + pos := "" if s[0] != "nil" { fmt.Fprintf(w, "v := b.Control\n") if strings.Contains(s[0], "(") { - genMatch0(w, arch, s[0], "v", map[string]struct{}{}, false, rule.loc) + pos, _ = genMatch0(w, arch, s[0], "v", map[string]struct{}{}, false, rule.loc) } else { fmt.Fprintf(w, "_ = v\n") // in case we don't use v fmt.Fprintf(w, "%s := b.Control\n", s[0]) @@ -335,7 +340,10 @@ func genRules(arch arch) { if t[0] == "nil" { fmt.Fprintf(w, "b.SetControl(nil)\n") } else { - fmt.Fprintf(w, "b.SetControl(%s)\n", genResult0(w, arch, t[0], new(int), false, false, rule.loc)) + if pos == "" { + pos = "v.Pos" + } + fmt.Fprintf(w, "b.SetControl(%s)\n", genResult0(w, arch, t[0], new(int), false, false, rule.loc, pos)) } if aux != "" { fmt.Fprintf(w, "b.Aux = %s\n", aux) @@ -386,15 +394,17 @@ func genRules(arch arch) { } } -// genMatch reports whether the match can fail. -func genMatch(w io.Writer, arch arch, match string, loc string) bool { +// genMatch returns the variable whose source position should be used for the +// result (or "" if no opinion), and a boolean that reports whether the match can fail. +func genMatch(w io.Writer, arch arch, match string, loc string) (string, bool) { return genMatch0(w, arch, match, "v", map[string]struct{}{}, true, loc) } -func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, top bool, loc string) bool { +func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, top bool, loc string) (string, bool) { if match[0] != '(' || match[len(match)-1] != ')' { panic("non-compound expr in genMatch0: " + match) } + pos := "" canFail := false op, oparch, typ, auxint, aux, args := parseValue(match, arch, loc) @@ -404,6 +414,10 @@ func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, t fmt.Fprintf(w, "if %s.Op != Op%s%s {\nbreak\n}\n", v, oparch, op.name) canFail = true } + if op.faultOnNilArg0 || op.faultOnNilArg1 { + // Prefer the position of an instruction which could fault. + pos = v + ".Pos" + } if typ != "" { if !isVariable(typ) { @@ -494,7 +508,16 @@ func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, t argname = fmt.Sprintf("%s_%d", v, i) } fmt.Fprintf(w, "%s := %s.Args[%d]\n", argname, v, i) - if genMatch0(w, arch, arg, argname, m, false, loc) { + argPos, argCanFail := genMatch0(w, arch, arg, argname, m, false, loc) + if argPos != "" { + // Keep the argument in preference to the parent, as the + // argument is normally earlier in program flow. + // Keep the argument in preference to an earlier argument, + // as that prefers the memory argument which is also earlier + // in the program flow. + pos = argPos + } + if argCanFail { canFail = true } } @@ -503,10 +526,10 @@ func genMatch0(w io.Writer, arch arch, match, v string, m map[string]struct{}, t fmt.Fprintf(w, "if len(%s.Args) != %d {\nbreak\n}\n", v, len(args)) canFail = true } - return canFail + return pos, canFail } -func genResult(w io.Writer, arch arch, result string, loc string) { +func genResult(w io.Writer, arch arch, result string, loc string, pos string) { move := false if result[0] == '@' { // parse @block directive @@ -515,9 +538,9 @@ func genResult(w io.Writer, arch arch, result string, loc string) { result = s[1] move = true } - genResult0(w, arch, result, new(int), true, move, loc) + genResult0(w, arch, result, new(int), true, move, loc, pos) } -func genResult0(w io.Writer, arch arch, result string, alloc *int, top, move bool, loc string) string { +func genResult0(w io.Writer, arch arch, result string, alloc *int, top, move bool, loc string, pos string) string { // TODO: when generating a constant result, use f.constVal to avoid // introducing copies just to clean them up again. if result[0] != '(' { @@ -554,7 +577,7 @@ func genResult0(w io.Writer, arch arch, result string, alloc *int, top, move boo } v = fmt.Sprintf("v%d", *alloc) *alloc++ - fmt.Fprintf(w, "%s := b.NewValue0(v.Pos, Op%s%s, %s)\n", v, oparch, op.name, typ) + fmt.Fprintf(w, "%s := b.NewValue0(%s, Op%s%s, %s)\n", v, pos, oparch, op.name, typ) if move && top { // Rewrite original into a copy fmt.Fprintf(w, "v.reset(OpCopy)\n") @@ -569,7 +592,7 @@ func genResult0(w io.Writer, arch arch, result string, alloc *int, top, move boo fmt.Fprintf(w, "%s.Aux = %s\n", v, aux) } for _, arg := range args { - x := genResult0(w, arch, arg, alloc, false, move, loc) + x := genResult0(w, arch, arg, alloc, false, move, loc, pos) fmt.Fprintf(w, "%s.AddArg(%s)\n", v, x) } diff --git a/src/cmd/compile/internal/ssa/rewrite386.go b/src/cmd/compile/internal/ssa/rewrite386.go index b6fb6c8b97fec..75b6de8055f3c 100644 --- a/src/cmd/compile/internal/ssa/rewrite386.go +++ b/src/cmd/compile/internal/ssa/rewrite386.go @@ -3197,7 +3197,7 @@ func rewriteValue386_Op386CMPB_0(v *Value) bool { break } v.reset(Op386InvertFlags) - v0 := b.NewValue0(v.Pos, Op386CMPBload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, Op386CMPBload, types.TypeFlags) v0.AuxInt = off v0.Aux = sym v0.AddArg(ptr) @@ -3381,7 +3381,7 @@ func rewriteValue386_Op386CMPBconst_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, Op386CMPBconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, Op386CMPBconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(c, off) @@ -3501,7 +3501,7 @@ func rewriteValue386_Op386CMPL_0(v *Value) bool { break } v.reset(Op386InvertFlags) - v0 := b.NewValue0(v.Pos, Op386CMPLload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, Op386CMPLload, types.TypeFlags) v0.AuxInt = off v0.Aux = sym v0.AddArg(ptr) @@ -3704,7 +3704,7 @@ func rewriteValue386_Op386CMPLconst_10(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, Op386CMPLconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, Op386CMPLconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(c, off) @@ -3824,7 +3824,7 @@ func rewriteValue386_Op386CMPW_0(v *Value) bool { break } v.reset(Op386InvertFlags) - v0 := b.NewValue0(v.Pos, Op386CMPWload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, Op386CMPWload, types.TypeFlags) v0.AuxInt = off v0.Aux = sym v0.AddArg(ptr) @@ -4008,7 +4008,7 @@ func rewriteValue386_Op386CMPWconst_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, Op386CMPWconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, Op386CMPWconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(c, off) @@ -4957,7 +4957,7 @@ func rewriteValue386_Op386MOVBLSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, Op386MOVBLSXload, v.Type) + v0 := b.NewValue0(x.Pos, Op386MOVBLSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -5062,7 +5062,7 @@ func rewriteValue386_Op386MOVBLZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, Op386MOVBload, v.Type) + v0 := b.NewValue0(x.Pos, Op386MOVBload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -10726,7 +10726,7 @@ func rewriteValue386_Op386MOVWLSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, Op386MOVWLSXload, v.Type) + v0 := b.NewValue0(x.Pos, Op386MOVWLSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -10831,7 +10831,7 @@ func rewriteValue386_Op386MOVWLZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, Op386MOVWload, v.Type) + v0 := b.NewValue0(x.Pos, Op386MOVWload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -14209,7 +14209,7 @@ func rewriteValue386_Op386ORL_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16) + v0 := b.NewValue0(x1.Pos, Op386MOVWload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14258,7 +14258,7 @@ func rewriteValue386_Op386ORL_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, Op386MOVWload, typ.UInt16) + v0 := b.NewValue0(x0.Pos, Op386MOVWload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14334,7 +14334,7 @@ func rewriteValue386_Op386ORL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32) + v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14410,7 +14410,7 @@ func rewriteValue386_Op386ORL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32) + v0 := b.NewValue0(x2.Pos, Op386MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14486,7 +14486,7 @@ func rewriteValue386_Op386ORL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32) + v0 := b.NewValue0(x1.Pos, Op386MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14562,7 +14562,7 @@ func rewriteValue386_Op386ORL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, Op386MOVLload, typ.UInt32) + v0 := b.NewValue0(x0.Pos, Op386MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 diff --git a/src/cmd/compile/internal/ssa/rewriteAMD64.go b/src/cmd/compile/internal/ssa/rewriteAMD64.go index 43d77c97a4308..b52e53f9d2340 100644 --- a/src/cmd/compile/internal/ssa/rewriteAMD64.go +++ b/src/cmd/compile/internal/ssa/rewriteAMD64.go @@ -2197,7 +2197,7 @@ func rewriteValueAMD64_OpAMD64ADDLload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ADDL) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLf2i, typ.UInt32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLf2i, typ.UInt32) v0.AddArg(y) v.AddArg(v0) return true @@ -3158,7 +3158,7 @@ func rewriteValueAMD64_OpAMD64ADDQload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ADDQ) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQf2i, typ.UInt64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQf2i, typ.UInt64) v0.AddArg(y) v.AddArg(v0) return true @@ -3360,7 +3360,7 @@ func rewriteValueAMD64_OpAMD64ADDSDload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ADDSD) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQi2f, typ.Float64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQi2f, typ.Float64) v0.AddArg(y) v.AddArg(v0) return true @@ -3506,7 +3506,7 @@ func rewriteValueAMD64_OpAMD64ADDSSload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ADDSS) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLi2f, typ.Float32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLi2f, typ.Float32) v0.AddArg(y) v.AddArg(v0) return true @@ -3971,7 +3971,7 @@ func rewriteValueAMD64_OpAMD64ANDLload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ANDL) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLf2i, typ.UInt32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLf2i, typ.UInt32) v0.AddArg(y) v.AddArg(v0) return true @@ -4508,7 +4508,7 @@ func rewriteValueAMD64_OpAMD64ANDQload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ANDQ) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQf2i, typ.UInt64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQf2i, typ.UInt64) v0.AddArg(y) v.AddArg(v0) return true @@ -8876,7 +8876,7 @@ func rewriteValueAMD64_OpAMD64CMPB_0(v *Value) bool { break } v.reset(OpAMD64InvertFlags) - v0 := b.NewValue0(v.Pos, OpAMD64CMPBload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPBload, types.TypeFlags) v0.AuxInt = off v0.Aux = sym v0.AddArg(ptr) @@ -9054,7 +9054,7 @@ func rewriteValueAMD64_OpAMD64CMPBconst_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPBconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPBconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(c, off) @@ -9279,7 +9279,7 @@ func rewriteValueAMD64_OpAMD64CMPL_0(v *Value) bool { break } v.reset(OpAMD64InvertFlags) - v0 := b.NewValue0(v.Pos, OpAMD64CMPLload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPLload, types.TypeFlags) v0.AuxInt = off v0.Aux = sym v0.AddArg(ptr) @@ -9476,7 +9476,7 @@ func rewriteValueAMD64_OpAMD64CMPLconst_10(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPLconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPLconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(c, off) @@ -9707,7 +9707,7 @@ func rewriteValueAMD64_OpAMD64CMPQ_0(v *Value) bool { break } v.reset(OpAMD64InvertFlags) - v0 := b.NewValue0(v.Pos, OpAMD64CMPQload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPQload, types.TypeFlags) v0.AuxInt = off v0.Aux = sym v0.AddArg(ptr) @@ -10021,7 +10021,7 @@ func rewriteValueAMD64_OpAMD64CMPQconst_10(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPQconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPQconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(c, off) @@ -10246,7 +10246,7 @@ func rewriteValueAMD64_OpAMD64CMPW_0(v *Value) bool { break } v.reset(OpAMD64InvertFlags) - v0 := b.NewValue0(v.Pos, OpAMD64CMPWload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPWload, types.TypeFlags) v0.AuxInt = off v0.Aux = sym v0.AddArg(ptr) @@ -10424,7 +10424,7 @@ func rewriteValueAMD64_OpAMD64CMPWconst_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPWconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPWconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(c, off) @@ -12054,7 +12054,7 @@ func rewriteValueAMD64_OpAMD64MOVBQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12080,7 +12080,7 @@ func rewriteValueAMD64_OpAMD64MOVBQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12106,7 +12106,7 @@ func rewriteValueAMD64_OpAMD64MOVBQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12132,7 +12132,7 @@ func rewriteValueAMD64_OpAMD64MOVBQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12246,7 +12246,7 @@ func rewriteValueAMD64_OpAMD64MOVBQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12272,7 +12272,7 @@ func rewriteValueAMD64_OpAMD64MOVBQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12298,7 +12298,7 @@ func rewriteValueAMD64_OpAMD64MOVBQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12324,7 +12324,7 @@ func rewriteValueAMD64_OpAMD64MOVBQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVBload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVBload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -13256,7 +13256,7 @@ func rewriteValueAMD64_OpAMD64MOVBstore_10(v *Value) bool { v.AuxInt = i - 1 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64ROLWconst, w.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ROLWconst, w.Type) v0.AuxInt = 8 v0.AddArg(w) v.AddArg(v0) @@ -13352,7 +13352,7 @@ func rewriteValueAMD64_OpAMD64MOVBstore_10(v *Value) bool { v.AuxInt = i - 3 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPL, w.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64BSWAPL, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -13550,7 +13550,7 @@ func rewriteValueAMD64_OpAMD64MOVBstore_20(v *Value) bool { v.AuxInt = i - 7 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPQ, w.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64BSWAPQ, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -13984,7 +13984,7 @@ func rewriteValueAMD64_OpAMD64MOVBstore_20(v *Value) bool { v.AuxInt = i - 1 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v0 := b.NewValue0(x2.Pos, OpAMD64MOVWload, typ.UInt16) v0.AuxInt = j - 1 v0.Aux = s2 v0.AddArg(p2) @@ -15099,7 +15099,7 @@ func rewriteValueAMD64_OpAMD64MOVLQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVLQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVLQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15125,7 +15125,7 @@ func rewriteValueAMD64_OpAMD64MOVLQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVLQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVLQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15265,7 +15265,7 @@ func rewriteValueAMD64_OpAMD64MOVLQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVLload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15291,7 +15291,7 @@ func rewriteValueAMD64_OpAMD64MOVLQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVLload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -16657,7 +16657,7 @@ func rewriteValueAMD64_OpAMD64MOVLstore_10(v *Value) bool { v.AuxInt = i - 4 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) + v0 := b.NewValue0(x2.Pos, OpAMD64MOVQload, typ.UInt64) v0.AuxInt = j - 4 v0.Aux = s2 v0.AddArg(p2) @@ -17851,7 +17851,7 @@ func rewriteValueAMD64_OpAMD64MOVLstoreconst_0(v *Value) bool { v.AuxInt = ValAndOff(a).Off() v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQconst, typ.UInt64) + v0 := b.NewValue0(x.Pos, OpAMD64MOVQconst, typ.UInt64) v0.AuxInt = ValAndOff(a).Val()&0xffffffff | ValAndOff(c).Val()<<32 v.AddArg(v0) v.AddArg(mem) @@ -17885,7 +17885,7 @@ func rewriteValueAMD64_OpAMD64MOVLstoreconst_0(v *Value) bool { v.AuxInt = ValAndOff(a).Off() v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQconst, typ.UInt64) + v0 := b.NewValue0(x.Pos, OpAMD64MOVQconst, typ.UInt64) v0.AuxInt = ValAndOff(a).Val()&0xffffffff | ValAndOff(c).Val()<<32 v.AddArg(v0) v.AddArg(mem) @@ -20804,7 +20804,7 @@ func rewriteValueAMD64_OpAMD64MOVQstoreconst_0(v *Value) bool { v.AuxInt = ValAndOff(c2).Off() v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64MOVOconst, types.TypeInt128) + v0 := b.NewValue0(x.Pos, OpAMD64MOVOconst, types.TypeInt128) v0.AuxInt = 0 v.AddArg(v0) v.AddArg(mem) @@ -22627,7 +22627,7 @@ func rewriteValueAMD64_OpAMD64MOVWQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVWQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVWQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -22653,7 +22653,7 @@ func rewriteValueAMD64_OpAMD64MOVWQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVWQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVWQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -22679,7 +22679,7 @@ func rewriteValueAMD64_OpAMD64MOVWQSX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVWQSXload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVWQSXload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -22806,7 +22806,7 @@ func rewriteValueAMD64_OpAMD64MOVWQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVWload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -22832,7 +22832,7 @@ func rewriteValueAMD64_OpAMD64MOVWQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVWload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -22858,7 +22858,7 @@ func rewriteValueAMD64_OpAMD64MOVWQZX_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, v.Type) + v0 := b.NewValue0(x.Pos, OpAMD64MOVWload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -23981,7 +23981,7 @@ func rewriteValueAMD64_OpAMD64MOVWstore_10(v *Value) bool { v.AuxInt = i - 2 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v0 := b.NewValue0(x2.Pos, OpAMD64MOVLload, typ.UInt32) v0.AuxInt = j - 2 v0.Aux = s2 v0.AddArg(p2) @@ -26300,7 +26300,7 @@ func rewriteValueAMD64_OpAMD64MULSDload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64MULSD) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQi2f, typ.Float64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQi2f, typ.Float64) v0.AddArg(y) v.AddArg(v0) return true @@ -26446,7 +26446,7 @@ func rewriteValueAMD64_OpAMD64MULSSload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64MULSS) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLi2f, typ.Float32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLi2f, typ.Float32) v0.AddArg(y) v.AddArg(v0) return true @@ -29975,7 +29975,7 @@ func rewriteValueAMD64_OpAMD64ORL_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v0 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -30024,7 +30024,7 @@ func rewriteValueAMD64_OpAMD64ORL_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v0 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -30073,7 +30073,7 @@ func rewriteValueAMD64_OpAMD64ORL_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v0 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -30122,7 +30122,7 @@ func rewriteValueAMD64_OpAMD64ORL_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v0 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -30180,12 +30180,12 @@ func rewriteValueAMD64_OpAMD64ORL_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -30244,12 +30244,12 @@ func rewriteValueAMD64_OpAMD64ORL_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -30308,12 +30308,12 @@ func rewriteValueAMD64_OpAMD64ORL_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -30379,12 +30379,12 @@ func rewriteValueAMD64_OpAMD64ORL_60(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -32423,11 +32423,11 @@ func rewriteValueAMD64_OpAMD64ORL_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ROLWconst, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ROLWconst, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 8 - v1 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v1 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -32475,11 +32475,11 @@ func rewriteValueAMD64_OpAMD64ORL_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ROLWconst, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ROLWconst, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 8 - v1 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v1 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -32541,10 +32541,10 @@ func rewriteValueAMD64_OpAMD64ORL_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPL, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64BSWAPL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v1 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -32606,10 +32606,10 @@ func rewriteValueAMD64_OpAMD64ORL_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPL, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64BSWAPL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v1 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -32666,14 +32666,14 @@ func rewriteValueAMD64_OpAMD64ORL_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -32733,14 +32733,14 @@ func rewriteValueAMD64_OpAMD64ORL_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -32800,14 +32800,14 @@ func rewriteValueAMD64_OpAMD64ORL_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -32874,14 +32874,14 @@ func rewriteValueAMD64_OpAMD64ORL_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORL, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLLconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLLconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -35364,7 +35364,7 @@ func rewriteValueAMD64_OpAMD64ORLload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ORL) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLf2i, typ.UInt32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLf2i, typ.UInt32) v0.AddArg(y) v.AddArg(v0) return true @@ -36784,7 +36784,7 @@ func rewriteValueAMD64_OpAMD64ORQ_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v0 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -36833,7 +36833,7 @@ func rewriteValueAMD64_OpAMD64ORQ_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v0 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -36882,7 +36882,7 @@ func rewriteValueAMD64_OpAMD64ORQ_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v0 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -36931,7 +36931,7 @@ func rewriteValueAMD64_OpAMD64ORQ_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v0 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -36980,7 +36980,7 @@ func rewriteValueAMD64_OpAMD64ORQ_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) + v0 := b.NewValue0(x1.Pos, OpAMD64MOVQload, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -37036,7 +37036,7 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) + v0 := b.NewValue0(x0.Pos, OpAMD64MOVQload, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -37094,12 +37094,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -37158,12 +37158,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -37222,12 +37222,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -37286,12 +37286,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -37350,12 +37350,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -37414,12 +37414,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -37478,12 +37478,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -37542,12 +37542,12 @@ func rewriteValueAMD64_OpAMD64ORQ_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -41143,11 +41143,11 @@ func rewriteValueAMD64_OpAMD64ORQ_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ROLWconst, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ROLWconst, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 8 - v1 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v1 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -41195,11 +41195,11 @@ func rewriteValueAMD64_OpAMD64ORQ_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ROLWconst, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ROLWconst, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 8 - v1 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v1 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -41261,10 +41261,10 @@ func rewriteValueAMD64_OpAMD64ORQ_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPL, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64BSWAPL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v1 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -41326,10 +41326,10 @@ func rewriteValueAMD64_OpAMD64ORQ_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPL, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64BSWAPL, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v1 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -41385,10 +41385,10 @@ func rewriteValueAMD64_OpAMD64ORQ_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64BSWAPQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) + v1 := b.NewValue0(x0.Pos, OpAMD64MOVQload, typ.UInt64) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -41451,10 +41451,10 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64BSWAPQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64BSWAPQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64MOVQload, typ.UInt64) + v1 := b.NewValue0(x1.Pos, OpAMD64MOVQload, typ.UInt64) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -41511,14 +41511,14 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -41578,14 +41578,14 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x1.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -41645,14 +41645,14 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -41712,14 +41712,14 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64ROLWconst, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpAMD64ROLWconst, typ.UInt16) v2.AuxInt = 8 - v3 := b.NewValue0(v.Pos, OpAMD64MOVWload, typ.UInt16) + v3 := b.NewValue0(x0.Pos, OpAMD64MOVWload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -41793,13 +41793,13 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64BSWAPL, typ.UInt32) - v3 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpAMD64BSWAPL, typ.UInt32) + v3 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -41873,13 +41873,13 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x1.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64BSWAPL, typ.UInt32) - v3 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpAMD64BSWAPL, typ.UInt32) + v3 := b.NewValue0(x1.Pos, OpAMD64MOVLload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -41953,13 +41953,13 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64BSWAPL, typ.UInt32) - v3 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpAMD64BSWAPL, typ.UInt32) + v3 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -42033,13 +42033,13 @@ func rewriteValueAMD64_OpAMD64ORQ_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpAMD64ORQ, v.Type) + v0 := b.NewValue0(x0.Pos, OpAMD64ORQ, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpAMD64SHLQconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpAMD64SHLQconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpAMD64BSWAPL, typ.UInt32) - v3 := b.NewValue0(v.Pos, OpAMD64MOVLload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpAMD64BSWAPL, typ.UInt32) + v3 := b.NewValue0(x0.Pos, OpAMD64MOVLload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -46413,7 +46413,7 @@ func rewriteValueAMD64_OpAMD64ORQload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64ORQ) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQf2i, typ.UInt64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQf2i, typ.UInt64) v0.AddArg(y) v.AddArg(v0) return true @@ -55238,7 +55238,7 @@ func rewriteValueAMD64_OpAMD64SUBLload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64SUBL) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLf2i, typ.UInt32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLf2i, typ.UInt32) v0.AddArg(y) v.AddArg(v0) return true @@ -55554,7 +55554,7 @@ func rewriteValueAMD64_OpAMD64SUBQload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64SUBQ) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQf2i, typ.UInt64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQf2i, typ.UInt64) v0.AddArg(y) v.AddArg(v0) return true @@ -55730,7 +55730,7 @@ func rewriteValueAMD64_OpAMD64SUBSDload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64SUBSD) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQi2f, typ.Float64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQi2f, typ.Float64) v0.AddArg(y) v.AddArg(v0) return true @@ -55850,7 +55850,7 @@ func rewriteValueAMD64_OpAMD64SUBSSload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64SUBSS) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLi2f, typ.Float32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLi2f, typ.Float32) v0.AddArg(y) v.AddArg(v0) return true @@ -55911,7 +55911,7 @@ func rewriteValueAMD64_OpAMD64TESTB_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPBconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPBconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -55939,7 +55939,7 @@ func rewriteValueAMD64_OpAMD64TESTB_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPBconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPBconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -56023,7 +56023,7 @@ func rewriteValueAMD64_OpAMD64TESTL_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPLconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPLconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -56051,7 +56051,7 @@ func rewriteValueAMD64_OpAMD64TESTL_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPLconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPLconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -56141,7 +56141,7 @@ func rewriteValueAMD64_OpAMD64TESTQ_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPQconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPQconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -56169,7 +56169,7 @@ func rewriteValueAMD64_OpAMD64TESTQ_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPQconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPQconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -56253,7 +56253,7 @@ func rewriteValueAMD64_OpAMD64TESTW_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPWconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPWconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -56281,7 +56281,7 @@ func rewriteValueAMD64_OpAMD64TESTW_0(v *Value) bool { break } b = l.Block - v0 := b.NewValue0(v.Pos, OpAMD64CMPWconstload, types.TypeFlags) + v0 := b.NewValue0(l.Pos, OpAMD64CMPWconstload, types.TypeFlags) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = makeValAndOff(0, off) @@ -57226,7 +57226,7 @@ func rewriteValueAMD64_OpAMD64XORLload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64XORL) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVLf2i, typ.UInt32) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVLf2i, typ.UInt32) v0.AddArg(y) v.AddArg(v0) return true @@ -57764,7 +57764,7 @@ func rewriteValueAMD64_OpAMD64XORQload_0(v *Value) bool { y := v_2.Args[1] v.reset(OpAMD64XORQ) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpAMD64MOVQf2i, typ.UInt64) + v0 := b.NewValue0(v_2.Pos, OpAMD64MOVQf2i, typ.UInt64) v0.AddArg(y) v.AddArg(v0) return true diff --git a/src/cmd/compile/internal/ssa/rewriteARM64.go b/src/cmd/compile/internal/ssa/rewriteARM64.go index 1e4b1ef0cf341..2afd0f335ea64 100644 --- a/src/cmd/compile/internal/ssa/rewriteARM64.go +++ b/src/cmd/compile/internal/ssa/rewriteARM64.go @@ -10466,7 +10466,7 @@ func rewriteValueARM64_OpARM64MOVBstore_20(v *Value) bool { v.AuxInt = i - 7 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REV, w.Type) + v0 := b.NewValue0(x6.Pos, OpARM64REV, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -10655,7 +10655,7 @@ func rewriteValueARM64_OpARM64MOVBstore_20(v *Value) bool { v.reset(OpARM64MOVDstoreidx) v.AddArg(ptr0) v.AddArg(idx0) - v0 := b.NewValue0(v.Pos, OpARM64REV, w.Type) + v0 := b.NewValue0(x5.Pos, OpARM64REV, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -10750,7 +10750,7 @@ func rewriteValueARM64_OpARM64MOVBstore_20(v *Value) bool { v.AuxInt = i - 3 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REVW, w.Type) + v0 := b.NewValue0(x2.Pos, OpARM64REVW, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -10843,7 +10843,7 @@ func rewriteValueARM64_OpARM64MOVBstore_20(v *Value) bool { v.reset(OpARM64MOVWstoreidx) v.AddArg(ptr0) v.AddArg(idx0) - v0 := b.NewValue0(v.Pos, OpARM64REVW, w.Type) + v0 := b.NewValue0(x1.Pos, OpARM64REVW, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -10950,7 +10950,7 @@ func rewriteValueARM64_OpARM64MOVBstore_20(v *Value) bool { v.AuxInt = i - 3 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REVW, w.Type) + v0 := b.NewValue0(x2.Pos, OpARM64REVW, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11055,7 +11055,7 @@ func rewriteValueARM64_OpARM64MOVBstore_20(v *Value) bool { v.reset(OpARM64MOVWstoreidx) v.AddArg(ptr0) v.AddArg(idx0) - v0 := b.NewValue0(v.Pos, OpARM64REVW, w.Type) + v0 := b.NewValue0(x1.Pos, OpARM64REVW, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11155,7 +11155,7 @@ func rewriteValueARM64_OpARM64MOVBstore_30(v *Value) bool { v.AuxInt = i - 3 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REVW, w.Type) + v0 := b.NewValue0(x2.Pos, OpARM64REVW, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11248,7 +11248,7 @@ func rewriteValueARM64_OpARM64MOVBstore_30(v *Value) bool { v.reset(OpARM64MOVWstoreidx) v.AddArg(ptr0) v.AddArg(idx0) - v0 := b.NewValue0(v.Pos, OpARM64REVW, w.Type) + v0 := b.NewValue0(x1.Pos, OpARM64REVW, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11295,7 +11295,7 @@ func rewriteValueARM64_OpARM64MOVBstore_30(v *Value) bool { v.AuxInt = i - 1 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REV16W, w.Type) + v0 := b.NewValue0(x.Pos, OpARM64REV16W, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11389,7 +11389,7 @@ func rewriteValueARM64_OpARM64MOVBstore_30(v *Value) bool { v.AuxInt = i - 1 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REV16W, w.Type) + v0 := b.NewValue0(x.Pos, OpARM64REV16W, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11487,7 +11487,7 @@ func rewriteValueARM64_OpARM64MOVBstore_30(v *Value) bool { v.AuxInt = i - 1 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REV16W, w.Type) + v0 := b.NewValue0(x.Pos, OpARM64REV16W, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11585,7 +11585,7 @@ func rewriteValueARM64_OpARM64MOVBstore_30(v *Value) bool { v.AuxInt = i - 1 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REV16W, w.Type) + v0 := b.NewValue0(x.Pos, OpARM64REV16W, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -11688,7 +11688,7 @@ func rewriteValueARM64_OpARM64MOVBstore_40(v *Value) bool { v.AuxInt = i - 1 v.Aux = s v.AddArg(ptr) - v0 := b.NewValue0(v.Pos, OpARM64REV16W, w.Type) + v0 := b.NewValue0(x.Pos, OpARM64REV16W, w.Type) v0.AddArg(w) v.AddArg(v0) v.AddArg(mem) @@ -21981,11 +21981,11 @@ func rewriteValueARM64_OpARM64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, t) + v0 := b.NewValue0(x3.Pos, OpARM64MOVWUload, t) v.reset(OpCopy) v.AddArg(v0) v0.Aux = s - v1 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v1 := b.NewValue0(x3.Pos, OpOffPtr, p.Type) v1.AuxInt = i0 v1.AddArg(p) v0.AddArg(v1) @@ -22095,11 +22095,11 @@ func rewriteValueARM64_OpARM64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, t) + v0 := b.NewValue0(x2.Pos, OpARM64MOVWUload, t) v.reset(OpCopy) v.AddArg(v0) v0.Aux = s - v1 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v1 := b.NewValue0(x2.Pos, OpOffPtr, p.Type) v1.AuxInt = i0 v1.AddArg(p) v0.AddArg(v1) @@ -22214,7 +22214,7 @@ func rewriteValueARM64_OpARM64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64MOVWUloadidx, t) + v0 := b.NewValue0(x2.Pos, OpARM64MOVWUloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) @@ -22330,7 +22330,7 @@ func rewriteValueARM64_OpARM64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64MOVWUloadidx, t) + v0 := b.NewValue0(x2.Pos, OpARM64MOVWUloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) @@ -22805,11 +22805,11 @@ func rewriteValueARM64_OpARM64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpARM64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.Aux = s - v1 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v1 := b.NewValue0(x7.Pos, OpOffPtr, p.Type) v1.AuxInt = i0 v1.AddArg(p) v0.AddArg(v1) @@ -23032,11 +23032,11 @@ func rewriteValueARM64_OpARM64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64MOVDload, t) + v0 := b.NewValue0(x6.Pos, OpARM64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.Aux = s - v1 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v1 := b.NewValue0(x6.Pos, OpOffPtr, p.Type) v1.AuxInt = i0 v1.AddArg(p) v0.AddArg(v1) @@ -23267,7 +23267,7 @@ func rewriteValueARM64_OpARM64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64MOVDloadidx, t) + v0 := b.NewValue0(x6.Pos, OpARM64MOVDloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) @@ -23499,7 +23499,7 @@ func rewriteValueARM64_OpARM64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64MOVDloadidx, t) + v0 := b.NewValue0(x6.Pos, OpARM64MOVDloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) @@ -24130,12 +24130,12 @@ func rewriteValueARM64_OpARM64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64REVW, t) + v0 := b.NewValue0(x3.Pos, OpARM64REVW, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVWUload, t) + v1 := b.NewValue0(x3.Pos, OpARM64MOVWUload, t) v1.Aux = s - v2 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v2 := b.NewValue0(x3.Pos, OpOffPtr, p.Type) v2.AuxInt = i0 v2.AddArg(p) v1.AddArg(v2) @@ -24246,12 +24246,12 @@ func rewriteValueARM64_OpARM64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64REVW, t) + v0 := b.NewValue0(x2.Pos, OpARM64REVW, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVWUload, t) + v1 := b.NewValue0(x2.Pos, OpARM64MOVWUload, t) v1.Aux = s - v2 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v2 := b.NewValue0(x2.Pos, OpOffPtr, p.Type) v2.AuxInt = i0 v2.AddArg(p) v1.AddArg(v2) @@ -24367,10 +24367,10 @@ func rewriteValueARM64_OpARM64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64REVW, t) + v0 := b.NewValue0(x3.Pos, OpARM64REVW, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVWUloadidx, t) + v1 := b.NewValue0(x3.Pos, OpARM64MOVWUloadidx, t) v1.AddArg(ptr0) v1.AddArg(idx0) v1.AddArg(mem) @@ -24485,10 +24485,10 @@ func rewriteValueARM64_OpARM64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3) - v0 := b.NewValue0(v.Pos, OpARM64REVW, t) + v0 := b.NewValue0(x2.Pos, OpARM64REVW, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVWUloadidx, t) + v1 := b.NewValue0(x2.Pos, OpARM64MOVWUloadidx, t) v1.AddArg(ptr0) v1.AddArg(idx0) v1.AddArg(mem) @@ -24971,12 +24971,12 @@ func rewriteValueARM64_OpARM64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64REV, t) + v0 := b.NewValue0(x7.Pos, OpARM64REV, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVDload, t) + v1 := b.NewValue0(x7.Pos, OpARM64MOVDload, t) v1.Aux = s - v2 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v2 := b.NewValue0(x7.Pos, OpOffPtr, p.Type) v2.AuxInt = i0 v2.AddArg(p) v1.AddArg(v2) @@ -25195,12 +25195,12 @@ func rewriteValueARM64_OpARM64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64REV, t) + v0 := b.NewValue0(x6.Pos, OpARM64REV, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVDload, t) + v1 := b.NewValue0(x6.Pos, OpARM64MOVDload, t) v1.Aux = s - v2 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v2 := b.NewValue0(x6.Pos, OpOffPtr, p.Type) v2.AuxInt = i0 v2.AddArg(p) v1.AddArg(v2) @@ -25432,10 +25432,10 @@ func rewriteValueARM64_OpARM64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64REV, t) + v0 := b.NewValue0(x7.Pos, OpARM64REV, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVDloadidx, t) + v1 := b.NewValue0(x7.Pos, OpARM64MOVDloadidx, t) v1.AddArg(ptr0) v1.AddArg(idx0) v1.AddArg(mem) @@ -25666,10 +25666,10 @@ func rewriteValueARM64_OpARM64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpARM64REV, t) + v0 := b.NewValue0(x6.Pos, OpARM64REV, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVDloadidx, t) + v1 := b.NewValue0(x6.Pos, OpARM64MOVDloadidx, t) v1.AddArg(ptr0) v1.AddArg(idx0) v1.AddArg(mem) @@ -26726,11 +26726,11 @@ func rewriteValueARM64_OpARM64ORshiftLL_0(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, t) + v0 := b.NewValue0(x1.Pos, OpARM64MOVHUload, t) v.reset(OpCopy) v.AddArg(v0) v0.Aux = s - v1 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v1 := b.NewValue0(x1.Pos, OpOffPtr, p.Type) v1.AuxInt = i0 v1.AddArg(p) v0.AddArg(v1) @@ -26785,7 +26785,7 @@ func rewriteValueARM64_OpARM64ORshiftLL_0(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpARM64MOVHUloadidx, t) + v0 := b.NewValue0(x1.Pos, OpARM64MOVHUloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) @@ -26924,11 +26924,11 @@ func rewriteValueARM64_OpARM64ORshiftLL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, t) + v0 := b.NewValue0(x2.Pos, OpARM64MOVWUload, t) v.reset(OpCopy) v.AddArg(v0) v0.Aux = s - v1 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v1 := b.NewValue0(x2.Pos, OpOffPtr, p.Type) v1.AuxInt = i0 v1.AddArg(p) v0.AddArg(v1) @@ -27006,7 +27006,7 @@ func rewriteValueARM64_OpARM64ORshiftLL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpARM64MOVWUloadidx, t) + v0 := b.NewValue0(x2.Pos, OpARM64MOVWUloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) @@ -27175,11 +27175,11 @@ func rewriteValueARM64_OpARM64ORshiftLL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpARM64MOVWUloadidx, t) + v0 := b.NewValue0(x2.Pos, OpARM64MOVWUloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) - v1 := b.NewValue0(v.Pos, OpARM64SLLconst, idx0.Type) + v1 := b.NewValue0(x2.Pos, OpARM64SLLconst, idx0.Type) v1.AuxInt = 1 v1.AddArg(idx0) v0.AddArg(v1) @@ -27308,11 +27308,11 @@ func rewriteValueARM64_OpARM64ORshiftLL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpARM64MOVDload, t) + v0 := b.NewValue0(x4.Pos, OpARM64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.Aux = s - v1 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v1 := b.NewValue0(x4.Pos, OpOffPtr, p.Type) v1.AuxInt = i0 v1.AddArg(p) v0.AddArg(v1) @@ -27448,7 +27448,7 @@ func rewriteValueARM64_OpARM64ORshiftLL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpARM64MOVDloadidx, t) + v0 := b.NewValue0(x4.Pos, OpARM64MOVDloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) @@ -27588,11 +27588,11 @@ func rewriteValueARM64_OpARM64ORshiftLL_10(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpARM64MOVDloadidx, t) + v0 := b.NewValue0(x4.Pos, OpARM64MOVDloadidx, t) v.reset(OpCopy) v.AddArg(v0) v0.AddArg(ptr0) - v1 := b.NewValue0(v.Pos, OpARM64SLLconst, idx0.Type) + v1 := b.NewValue0(x4.Pos, OpARM64SLLconst, idx0.Type) v1.AuxInt = 2 v1.AddArg(idx0) v0.AddArg(v1) @@ -27797,10 +27797,10 @@ func rewriteValueARM64_OpARM64ORshiftLL_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpARM64REV16W, t) + v0 := b.NewValue0(x1.Pos, OpARM64REV16W, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVHUload, t) + v1 := b.NewValue0(x1.Pos, OpARM64MOVHUload, t) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -27861,10 +27861,10 @@ func rewriteValueARM64_OpARM64ORshiftLL_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpARM64REV16W, t) + v0 := b.NewValue0(x0.Pos, OpARM64REV16W, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVHUloadidx, t) + v1 := b.NewValue0(x0.Pos, OpARM64MOVHUloadidx, t) v1.AddArg(ptr0) v1.AddArg(idx0) v1.AddArg(mem) @@ -28003,12 +28003,12 @@ func rewriteValueARM64_OpARM64ORshiftLL_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpARM64REVW, t) + v0 := b.NewValue0(x2.Pos, OpARM64REVW, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVWUload, t) + v1 := b.NewValue0(x2.Pos, OpARM64MOVWUload, t) v1.Aux = s - v2 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v2 := b.NewValue0(x2.Pos, OpOffPtr, p.Type) v2.AuxInt = i0 v2.AddArg(p) v1.AddArg(v2) @@ -28091,10 +28091,10 @@ func rewriteValueARM64_OpARM64ORshiftLL_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpARM64REVW, t) + v0 := b.NewValue0(x1.Pos, OpARM64REVW, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVWUloadidx, t) + v1 := b.NewValue0(x1.Pos, OpARM64MOVWUloadidx, t) v1.AddArg(ptr0) v1.AddArg(idx0) v1.AddArg(mem) @@ -28320,12 +28320,12 @@ func rewriteValueARM64_OpARM64ORshiftLL_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpARM64REV, t) + v0 := b.NewValue0(x4.Pos, OpARM64REV, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVDload, t) + v1 := b.NewValue0(x4.Pos, OpARM64MOVDload, t) v1.Aux = s - v2 := b.NewValue0(v.Pos, OpOffPtr, p.Type) + v2 := b.NewValue0(x4.Pos, OpOffPtr, p.Type) v2.AuxInt = i0 v2.AddArg(p) v1.AddArg(v2) @@ -28466,10 +28466,10 @@ func rewriteValueARM64_OpARM64ORshiftLL_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpARM64REV, t) + v0 := b.NewValue0(x3.Pos, OpARM64REV, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpARM64MOVDloadidx, t) + v1 := b.NewValue0(x3.Pos, OpARM64MOVDloadidx, t) v1.AddArg(ptr0) v1.AddArg(idx0) v1.AddArg(mem) diff --git a/src/cmd/compile/internal/ssa/rewriteMIPS.go b/src/cmd/compile/internal/ssa/rewriteMIPS.go index 951c5a5ef87f6..55bef5a792b2d 100644 --- a/src/cmd/compile/internal/ssa/rewriteMIPS.go +++ b/src/cmd/compile/internal/ssa/rewriteMIPS.go @@ -3502,7 +3502,7 @@ func rewriteValueMIPS_OpMIPSMOVBUreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVBUload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVBUload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -3663,7 +3663,7 @@ func rewriteValueMIPS_OpMIPSMOVBreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVBload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVBload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -4359,7 +4359,7 @@ func rewriteValueMIPS_OpMIPSMOVHUreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVHUload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVHUload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -4570,7 +4570,7 @@ func rewriteValueMIPS_OpMIPSMOVHreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpMIPSMOVHload, t) + v0 := b.NewValue0(x.Pos, OpMIPSMOVHload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off diff --git a/src/cmd/compile/internal/ssa/rewritePPC64.go b/src/cmd/compile/internal/ssa/rewritePPC64.go index 9c89e0e674a4f..d06953bafa9a4 100644 --- a/src/cmd/compile/internal/ssa/rewritePPC64.go +++ b/src/cmd/compile/internal/ssa/rewritePPC64.go @@ -7541,7 +7541,7 @@ func rewriteValuePPC64_OpPPC64MFVSRD_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64) + v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -8477,7 +8477,7 @@ func rewriteValuePPC64_OpPPC64MOVBstore_10(v *Value) bool { v.AuxInt = i0 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt16) + v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16) v0.AuxInt = 16 v0.AddArg(w) v.AddArg(v0) @@ -8530,7 +8530,7 @@ func rewriteValuePPC64_OpPPC64MOVBstore_10(v *Value) bool { v.AuxInt = i0 v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt16) + v0 := b.NewValue0(x0.Pos, OpPPC64SRWconst, typ.UInt16) v0.AuxInt = 16 v0.AddArg(w) v.AddArg(v0) @@ -8703,7 +8703,7 @@ func rewriteValuePPC64_OpPPC64MOVBstore_10(v *Value) bool { break } v.reset(OpPPC64MOVWBRstore) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v0.AuxInt = i0 v0.Aux = s v0.AddArg(p) @@ -8748,7 +8748,7 @@ func rewriteValuePPC64_OpPPC64MOVBstore_10(v *Value) bool { break } v.reset(OpPPC64MOVHBRstore) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v0.AuxInt = i0 v0.Aux = s v0.AddArg(p) @@ -9043,7 +9043,7 @@ func rewriteValuePPC64_OpPPC64MOVBstore_20(v *Value) bool { break } v.reset(OpPPC64MOVDBRstore) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v0.AuxInt = i0 v0.Aux = s v0.AddArg(p) @@ -12470,7 +12470,7 @@ func rewriteValuePPC64_OpPPC64MTVSRD_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpPPC64FMOVDload, typ.Float64) + v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -13048,7 +13048,7 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -13098,7 +13098,7 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVHZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -13148,7 +13148,7 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVHZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -13198,7 +13198,7 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVHZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -13248,10 +13248,10 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -13300,10 +13300,10 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVHBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -13352,10 +13352,10 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -13404,10 +13404,10 @@ func rewriteValuePPC64_OpPPC64OR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVHBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -13468,12 +13468,12 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = n1 - v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) + v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -13526,12 +13526,12 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = n1 - v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVHBRload, t) + v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -13584,12 +13584,12 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = n1 - v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVHBRload, t) + v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -13642,12 +13642,12 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = n1 - v1 := b.NewValue0(v.Pos, OpPPC64MOVHBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVHBRload, t) + v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -13727,7 +13727,7 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -13807,7 +13807,7 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -13887,7 +13887,7 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -13967,7 +13967,7 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14047,7 +14047,7 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14127,7 +14127,7 @@ func rewriteValuePPC64_OpPPC64OR_20(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14216,7 +14216,7 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14296,7 +14296,7 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -14386,10 +14386,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -14478,10 +14478,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -14570,10 +14570,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -14662,10 +14662,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -14754,10 +14754,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -14846,10 +14846,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -14938,10 +14938,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15030,10 +15030,10 @@ func rewriteValuePPC64_OpPPC64OR_30(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15131,10 +15131,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15223,10 +15223,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15315,10 +15315,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15407,10 +15407,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15499,10 +15499,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15591,10 +15591,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15683,10 +15683,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15775,10 +15775,10 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -15874,12 +15874,12 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -15976,12 +15976,12 @@ func rewriteValuePPC64_OpPPC64OR_40(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -16087,12 +16087,12 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x2.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -16189,12 +16189,12 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x2.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -16291,12 +16291,12 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x0.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -16393,12 +16393,12 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x1.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -16495,12 +16495,12 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x2.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -16597,12 +16597,12 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x1, x2) - v0 := b.NewValue0(v.Pos, OpPPC64SLDconst, t) + v0 := b.NewValue0(x2.Pos, OpPPC64SLDconst, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = 32 - v1 := b.NewValue0(v.Pos, OpPPC64MOVWBRload, t) - v2 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVWBRload, t) + v2 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -16742,7 +16742,7 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -16882,7 +16882,7 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x4.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -17022,7 +17022,7 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x5.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -17162,7 +17162,7 @@ func rewriteValuePPC64_OpPPC64OR_50(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x5.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -17309,7 +17309,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -17449,7 +17449,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -17589,7 +17589,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -17729,7 +17729,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -17869,7 +17869,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -18009,7 +18009,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -18149,7 +18149,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -18289,7 +18289,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -18429,7 +18429,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -18569,7 +18569,7 @@ func rewriteValuePPC64_OpPPC64OR_60(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -18718,7 +18718,7 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -18858,7 +18858,7 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -19005,10 +19005,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x4.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x4.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -19154,10 +19154,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -19303,10 +19303,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -19452,10 +19452,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x2.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x2.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -19601,10 +19601,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -19750,10 +19750,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -19899,10 +19899,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -20048,10 +20048,10 @@ func rewriteValuePPC64_OpPPC64OR_70(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x1.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x1.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -20206,10 +20206,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -20355,10 +20355,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -20504,10 +20504,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -20653,10 +20653,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -20802,10 +20802,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -20951,10 +20951,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -21100,10 +21100,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -21249,10 +21249,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x0, x1, x2, x3, x4) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x0.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x0.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -21401,10 +21401,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -21553,10 +21553,10 @@ func rewriteValuePPC64_OpPPC64OR_80(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x4.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x4.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -21714,10 +21714,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x5.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x5.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -21866,10 +21866,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x5.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x5.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -22018,10 +22018,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -22170,10 +22170,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -22322,10 +22322,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -22474,10 +22474,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -22626,10 +22626,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -22778,10 +22778,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -22930,10 +22930,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -23082,10 +23082,10 @@ func rewriteValuePPC64_OpPPC64OR_90(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -23243,10 +23243,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -23395,10 +23395,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -23547,10 +23547,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -23699,10 +23699,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -23851,10 +23851,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x3.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x3.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -24003,10 +24003,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x4.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x4.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -24155,10 +24155,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x5.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x5.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -24307,10 +24307,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x5.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x5.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -24459,10 +24459,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -24611,10 +24611,10 @@ func rewriteValuePPC64_OpPPC64OR_100(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -24772,10 +24772,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -24924,10 +24924,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x6.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x6.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -25076,10 +25076,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -25228,10 +25228,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -25380,10 +25380,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -25532,10 +25532,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -25684,10 +25684,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -25836,10 +25836,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -25988,10 +25988,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -26140,10 +26140,10 @@ func rewriteValuePPC64_OpPPC64OR_110(v *Value) bool { break } b = mergePoint(b, x3, x4, x5, x6, x7) - v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRload, t) + v0 := b.NewValue0(x7.Pos, OpPPC64MOVDBRload, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, typ.Uintptr) + v1 := b.NewValue0(x7.Pos, OpPPC64MOVDaddr, typ.Uintptr) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) diff --git a/src/cmd/compile/internal/ssa/rewriteS390X.go b/src/cmd/compile/internal/ssa/rewriteS390X.go index 1695b08780985..ce501a74efb4c 100644 --- a/src/cmd/compile/internal/ssa/rewriteS390X.go +++ b/src/cmd/compile/internal/ssa/rewriteS390X.go @@ -7837,7 +7837,7 @@ func rewriteValueS390X_OpS390XADDload_0(v *Value) bool { } v.reset(OpS390XADD) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpS390XLGDR, t) + v0 := b.NewValue0(v_2.Pos, OpS390XLGDR, t) v0.AddArg(y) v.AddArg(v0) return true @@ -8756,7 +8756,7 @@ func rewriteValueS390X_OpS390XANDload_0(v *Value) bool { } v.reset(OpS390XAND) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpS390XLGDR, t) + v0 := b.NewValue0(v_2.Pos, OpS390XLGDR, t) v0.AddArg(y) v.AddArg(v0) return true @@ -10884,11 +10884,11 @@ func rewriteValueS390X_OpS390XLDGR_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XLNDFR, t) + v0 := b.NewValue0(x.Pos, OpS390XLNDFR, t) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XLDGR, t) - v2 := b.NewValue0(v.Pos, OpS390XMOVDload, t1) + v1 := b.NewValue0(x.Pos, OpS390XLDGR, t) + v2 := b.NewValue0(x.Pos, OpS390XMOVDload, t1) v2.AuxInt = off v2.Aux = sym v2.AddArg(ptr) @@ -11539,7 +11539,7 @@ func rewriteValueS390X_OpS390XMOVBZreg_10(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBZload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVBZload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -11565,7 +11565,7 @@ func rewriteValueS390X_OpS390XMOVBZreg_10(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBZload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVBZload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -11979,7 +11979,7 @@ func rewriteValueS390X_OpS390XMOVBreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVBload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -12005,7 +12005,7 @@ func rewriteValueS390X_OpS390XMOVBreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVBload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15359,7 +15359,7 @@ func rewriteValueS390X_OpS390XMOVDnop_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBZload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVBZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15386,7 +15386,7 @@ func rewriteValueS390X_OpS390XMOVDnop_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVBload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15413,7 +15413,7 @@ func rewriteValueS390X_OpS390XMOVDnop_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVHZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15440,7 +15440,7 @@ func rewriteValueS390X_OpS390XMOVDnop_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVHload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15467,7 +15467,7 @@ func rewriteValueS390X_OpS390XMOVDnop_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15494,7 +15494,7 @@ func rewriteValueS390X_OpS390XMOVDnop_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVWload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15521,7 +15521,7 @@ func rewriteValueS390X_OpS390XMOVDnop_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVDload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15800,7 +15800,7 @@ func rewriteValueS390X_OpS390XMOVDreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBZload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVBZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15827,7 +15827,7 @@ func rewriteValueS390X_OpS390XMOVDreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVBload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVBload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15854,7 +15854,7 @@ func rewriteValueS390X_OpS390XMOVDreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVHZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15881,7 +15881,7 @@ func rewriteValueS390X_OpS390XMOVDreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVHload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15908,7 +15908,7 @@ func rewriteValueS390X_OpS390XMOVDreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVWZload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15935,7 +15935,7 @@ func rewriteValueS390X_OpS390XMOVDreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVWload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -15962,7 +15962,7 @@ func rewriteValueS390X_OpS390XMOVDreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVDload, t) + v0 := b.NewValue0(x.Pos, OpS390XMOVDload, t) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -17997,7 +17997,7 @@ func rewriteValueS390X_OpS390XMOVHZreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVHZload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -18023,7 +18023,7 @@ func rewriteValueS390X_OpS390XMOVHZreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVHZload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -18493,7 +18493,7 @@ func rewriteValueS390X_OpS390XMOVHreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVHload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -18526,7 +18526,7 @@ func rewriteValueS390X_OpS390XMOVHreg_10(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVHload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVHload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -19071,7 +19071,7 @@ func rewriteValueS390X_OpS390XMOVHstoreconst_0(v *Value) bool { v.AuxInt = ValAndOff(a).Off() v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64) + v0 := b.NewValue0(x.Pos, OpS390XMOVDconst, typ.UInt64) v0.AuxInt = int64(int32(ValAndOff(c).Val()&0xffff | ValAndOff(a).Val()<<16)) v.AddArg(v0) v.AddArg(mem) @@ -20937,7 +20937,7 @@ func rewriteValueS390X_OpS390XMOVWZreg_0(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVWZload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -20968,7 +20968,7 @@ func rewriteValueS390X_OpS390XMOVWZreg_10(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVWZload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -21467,7 +21467,7 @@ func rewriteValueS390X_OpS390XMOVWreg_10(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVWload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -21493,7 +21493,7 @@ func rewriteValueS390X_OpS390XMOVWreg_10(v *Value) bool { break } b = x.Block - v0 := b.NewValue0(v.Pos, OpS390XMOVWload, v.Type) + v0 := b.NewValue0(x.Pos, OpS390XMOVWload, v.Type) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = off @@ -22040,7 +22040,7 @@ func rewriteValueS390X_OpS390XMOVWstoreconst_0(v *Value) bool { v.AuxInt = ValAndOff(a).Off() v.Aux = s v.AddArg(p) - v0 := b.NewValue0(v.Pos, OpS390XMOVDconst, typ.UInt64) + v0 := b.NewValue0(x.Pos, OpS390XMOVDconst, typ.UInt64) v0.AuxInt = ValAndOff(c).Val()&0xffffffff | ValAndOff(a).Val()<<32 v.AddArg(v0) v.AddArg(mem) @@ -22873,7 +22873,7 @@ func rewriteValueS390X_OpS390XMULLDload_0(v *Value) bool { } v.reset(OpS390XMULLD) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpS390XLGDR, t) + v0 := b.NewValue0(v_2.Pos, OpS390XLGDR, t) v0.AddArg(y) v.AddArg(v0) return true @@ -23963,7 +23963,7 @@ func rewriteValueS390X_OpS390XOR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v0 := b.NewValue0(x0.Pos, OpS390XMOVHZload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -24012,7 +24012,7 @@ func rewriteValueS390X_OpS390XOR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v0 := b.NewValue0(x1.Pos, OpS390XMOVHZload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -24061,7 +24061,7 @@ func rewriteValueS390X_OpS390XOR_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v0 := b.NewValue0(x0.Pos, OpS390XMOVWZload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -24117,7 +24117,7 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v0 := b.NewValue0(x1.Pos, OpS390XMOVWZload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -24166,7 +24166,7 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVDload, typ.UInt64) + v0 := b.NewValue0(x0.Pos, OpS390XMOVDload, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -24215,7 +24215,7 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVDload, typ.UInt64) + v0 := b.NewValue0(x1.Pos, OpS390XMOVDload, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -24273,12 +24273,12 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -24337,12 +24337,12 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -24401,12 +24401,12 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -24465,12 +24465,12 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -24529,12 +24529,12 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpS390XMOVWZload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -24593,12 +24593,12 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpS390XMOVWZload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -24657,12 +24657,12 @@ func rewriteValueS390X_OpS390XOR_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpS390XMOVWZload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -24728,12 +24728,12 @@ func rewriteValueS390X_OpS390XOR_30(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpS390XMOVWZload, typ.UInt32) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -28322,10 +28322,10 @@ func rewriteValueS390X_OpS390XOR_80(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) + v0 := b.NewValue0(x1.Pos, OpS390XMOVHZreg, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v1 := b.NewValue0(x1.Pos, OpS390XMOVHBRload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -28373,10 +28373,10 @@ func rewriteValueS390X_OpS390XOR_80(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) + v0 := b.NewValue0(x0.Pos, OpS390XMOVHZreg, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v1 := b.NewValue0(x0.Pos, OpS390XMOVHBRload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -28432,10 +28432,10 @@ func rewriteValueS390X_OpS390XOR_80(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWZreg, typ.UInt64) + v0 := b.NewValue0(x1.Pos, OpS390XMOVWZreg, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v1 := b.NewValue0(x1.Pos, OpS390XMOVWBRload, typ.UInt32) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -28498,10 +28498,10 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWZreg, typ.UInt64) + v0 := b.NewValue0(x0.Pos, OpS390XMOVWZreg, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v1 := b.NewValue0(x0.Pos, OpS390XMOVWBRload, typ.UInt32) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -28557,7 +28557,7 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVDBRload, typ.UInt64) + v0 := b.NewValue0(x1.Pos, OpS390XMOVDBRload, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -28614,7 +28614,7 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVDBRload, typ.UInt64) + v0 := b.NewValue0(x0.Pos, OpS390XMOVDBRload, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -28672,13 +28672,13 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x0.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -28738,13 +28738,13 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x0.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -28804,13 +28804,13 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x1.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -28870,13 +28870,13 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x1.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -28944,13 +28944,13 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpS390XMOVWZreg, typ.UInt64) + v3 := b.NewValue0(x0.Pos, OpS390XMOVWBRload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -29018,13 +29018,13 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v2 := b.NewValue0(x0.Pos, OpS390XMOVWZreg, typ.UInt64) + v3 := b.NewValue0(x0.Pos, OpS390XMOVWBRload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -29092,13 +29092,13 @@ func rewriteValueS390X_OpS390XOR_90(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpS390XMOVWZreg, typ.UInt64) + v3 := b.NewValue0(x1.Pos, OpS390XMOVWBRload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -29173,13 +29173,13 @@ func rewriteValueS390X_OpS390XOR_100(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XOR, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XOR, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLDconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLDconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVWZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v2 := b.NewValue0(x1.Pos, OpS390XMOVWZreg, typ.UInt64) + v3 := b.NewValue0(x1.Pos, OpS390XMOVWBRload, typ.UInt32) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -33455,7 +33455,7 @@ func rewriteValueS390X_OpS390XORW_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v0 := b.NewValue0(x0.Pos, OpS390XMOVHZload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -33504,7 +33504,7 @@ func rewriteValueS390X_OpS390XORW_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v0 := b.NewValue0(x1.Pos, OpS390XMOVHZload, typ.UInt16) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -33553,7 +33553,7 @@ func rewriteValueS390X_OpS390XORW_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v0 := b.NewValue0(x0.Pos, OpS390XMOVWZload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -33602,7 +33602,7 @@ func rewriteValueS390X_OpS390XORW_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWZload, typ.UInt32) + v0 := b.NewValue0(x1.Pos, OpS390XMOVWZload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -33660,12 +33660,12 @@ func rewriteValueS390X_OpS390XORW_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -33724,12 +33724,12 @@ func rewriteValueS390X_OpS390XORW_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -33788,12 +33788,12 @@ func rewriteValueS390X_OpS390XORW_10(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -33859,12 +33859,12 @@ func rewriteValueS390X_OpS390XORW_20(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j1 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZload, typ.UInt16) v2.AuxInt = i0 v2.Aux = s v2.AddArg(p) @@ -35903,10 +35903,10 @@ func rewriteValueS390X_OpS390XORW_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) + v0 := b.NewValue0(x1.Pos, OpS390XMOVHZreg, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v1 := b.NewValue0(x1.Pos, OpS390XMOVHBRload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -35954,10 +35954,10 @@ func rewriteValueS390X_OpS390XORW_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) + v0 := b.NewValue0(x0.Pos, OpS390XMOVHZreg, typ.UInt64) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v1 := b.NewValue0(x0.Pos, OpS390XMOVHBRload, typ.UInt16) v1.AuxInt = i0 v1.Aux = s v1.AddArg(p) @@ -36013,7 +36013,7 @@ func rewriteValueS390X_OpS390XORW_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v0 := b.NewValue0(x1.Pos, OpS390XMOVWBRload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -36070,7 +36070,7 @@ func rewriteValueS390X_OpS390XORW_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XMOVWBRload, typ.UInt32) + v0 := b.NewValue0(x0.Pos, OpS390XMOVWBRload, typ.UInt32) v.reset(OpCopy) v.AddArg(v0) v0.AuxInt = i0 @@ -36128,13 +36128,13 @@ func rewriteValueS390X_OpS390XORW_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x0.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -36194,13 +36194,13 @@ func rewriteValueS390X_OpS390XORW_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x0.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x0.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x0.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x0.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -36260,13 +36260,13 @@ func rewriteValueS390X_OpS390XORW_50(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x1.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -36333,13 +36333,13 @@ func rewriteValueS390X_OpS390XORW_60(v *Value) bool { break } b = mergePoint(b, x0, x1) - v0 := b.NewValue0(v.Pos, OpS390XORW, v.Type) + v0 := b.NewValue0(x1.Pos, OpS390XORW, v.Type) v.reset(OpCopy) v.AddArg(v0) - v1 := b.NewValue0(v.Pos, OpS390XSLWconst, v.Type) + v1 := b.NewValue0(x1.Pos, OpS390XSLWconst, v.Type) v1.AuxInt = j0 - v2 := b.NewValue0(v.Pos, OpS390XMOVHZreg, typ.UInt64) - v3 := b.NewValue0(v.Pos, OpS390XMOVHBRload, typ.UInt16) + v2 := b.NewValue0(x1.Pos, OpS390XMOVHZreg, typ.UInt64) + v3 := b.NewValue0(x1.Pos, OpS390XMOVHBRload, typ.UInt16) v3.AuxInt = i0 v3.Aux = s v3.AddArg(p) @@ -38624,7 +38624,7 @@ func rewriteValueS390X_OpS390XORload_0(v *Value) bool { } v.reset(OpS390XOR) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpS390XLGDR, t) + v0 := b.NewValue0(v_2.Pos, OpS390XLGDR, t) v0.AddArg(y) v.AddArg(v0) return true @@ -40523,7 +40523,7 @@ func rewriteValueS390X_OpS390XSUBload_0(v *Value) bool { } v.reset(OpS390XSUB) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpS390XLGDR, t) + v0 := b.NewValue0(v_2.Pos, OpS390XLGDR, t) v0.AddArg(y) v.AddArg(v0) return true @@ -41382,7 +41382,7 @@ func rewriteValueS390X_OpS390XXORload_0(v *Value) bool { } v.reset(OpS390XXOR) v.AddArg(x) - v0 := b.NewValue0(v.Pos, OpS390XLGDR, t) + v0 := b.NewValue0(v_2.Pos, OpS390XLGDR, t) v0.AddArg(y) v.AddArg(v0) return true diff --git a/test/fixedbugs/issue27201.go b/test/fixedbugs/issue27201.go new file mode 100644 index 0000000000000..0c9611fc73b93 --- /dev/null +++ b/test/fixedbugs/issue27201.go @@ -0,0 +1,37 @@ +// run + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import ( + "runtime" + "strings" +) + +func main() { + f(nil) +} + +func f(p *int32) { + defer checkstack() + v := *p // panic should happen here, line 20 + sink = int64(v) // not here, line 21 +} + +var sink int64 + +func checkstack() { + _ = recover() + var buf [1024]byte + n := runtime.Stack(buf[:], false) + s := string(buf[:n]) + if strings.Contains(s, "issue27201.go:21 ") { + panic("panic at wrong location") + } + if !strings.Contains(s, "issue27201.go:20 ") { + panic("no panic at correct location") + } +} From e1d20ce25acfd8a1c5933453f34db5f589585eaa Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Wed, 9 Jan 2019 21:01:41 -0500 Subject: [PATCH 523/594] misc/sortac: delete sortac command The sortac command is no longer needed as of CL 157238, and can be deleted. Its functionality has been directly integrated into the new x/build/cmd/updatecontrib command. A previous version of updatecontrib was the only user of sortac. Updates #12042 Change-Id: If7442ebee11d05d095ff875a37eed3973c0fd9ca Reviewed-on: https://go-review.googlesource.com/c/157257 Reviewed-by: Brad Fitzpatrick --- misc/sortac/sortac.go | 79 ------------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 misc/sortac/sortac.go diff --git a/misc/sortac/sortac.go b/misc/sortac/sortac.go deleted file mode 100644 index f61aa9617e9f6..0000000000000 --- a/misc/sortac/sortac.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2015 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. - -// Sortac sorts the AUTHORS and CONTRIBUTORS files. -// -// Usage: -// -// sortac [file...] -// -// Sortac sorts the named files in place. -// If given no arguments, it sorts standard input to standard output. -package main - -import ( - "bufio" - "bytes" - "flag" - "fmt" - "io" - "io/ioutil" - "log" - "os" - - "golang.org/x/text/collate" - "golang.org/x/text/language" -) - -func main() { - log.SetFlags(0) - log.SetPrefix("sortac: ") - flag.Parse() - - args := flag.Args() - if len(args) == 0 { - os.Stdout.Write(sortAC(os.Stdin)) - } else { - for _, arg := range args { - f, err := os.Open(arg) - if err != nil { - log.Fatal(err) - } - sorted := sortAC(f) - f.Close() - if err := ioutil.WriteFile(arg, sorted, 0644); err != nil { - log.Fatal(err) - } - } - } -} - -func sortAC(r io.Reader) []byte { - bs := bufio.NewScanner(r) - var header []string - var lines []string - for bs.Scan() { - t := bs.Text() - lines = append(lines, t) - if t == "# Please keep the list sorted." { - header = lines - lines = nil - continue - } - } - if err := bs.Err(); err != nil { - log.Fatal(err) - } - - var out bytes.Buffer - c := collate.New(language.Und, collate.Loose) - c.SortStrings(lines) - for _, l := range header { - fmt.Fprintln(&out, l) - } - for _, l := range lines { - fmt.Fprintln(&out, l) - } - return out.Bytes() -} From 462e90259af39af9e23c9d919e002913042c2faa Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 14 Jan 2019 13:47:14 -0800 Subject: [PATCH 524/594] runtime: keep FuncForPC from crashing for PCs between functions Reuse the strict mechanism from FileLine for FuncForPC, so we don't crash when asking the pcln table about bad pcs. Fixes #29735 Change-Id: Iaffb32498b8586ecf4eae03823e8aecef841aa68 Reviewed-on: https://go-review.googlesource.com/c/157799 Reviewed-by: Josh Bleecher Snyder Run-TryBot: Josh Bleecher Snyder TryBot-Result: Gobot Gobot --- src/runtime/symtab.go | 20 +++++++++++++++++--- test/fixedbugs/issue29735.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 test/fixedbugs/issue29735.go diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go index e7ce3de497473..17e342ef699a0 100644 --- a/src/runtime/symtab.go +++ b/src/runtime/symtab.go @@ -474,7 +474,11 @@ func FuncForPC(pc uintptr) *Func { return nil } if inldata := funcdata(f, _FUNCDATA_InlTree); inldata != nil { - if ix := pcdatavalue(f, _PCDATA_InlTreeIndex, pc, nil); ix >= 0 { + // Note: strict=false so bad PCs (those between functions) don't crash the runtime. + // We just report the preceeding function in that situation. See issue 29735. + // TODO: Perhaps we should report no function at all in that case. + // The runtime currently doesn't have function end info, alas. + if ix := pcdatavalue1(f, _PCDATA_InlTreeIndex, pc, nil, false); ix >= 0 { inltree := (*[1 << 20]inlinedCall)(inldata) name := funcnameFromNameoff(f, inltree[ix].func_) file, line := funcline(f, pc) @@ -756,12 +760,22 @@ func funcspdelta(f funcInfo, targetpc uintptr, cache *pcvalueCache) int32 { return x } +func pcdatastart(f funcInfo, table int32) int32 { + return *(*int32)(add(unsafe.Pointer(&f.nfuncdata), unsafe.Sizeof(f.nfuncdata)+uintptr(table)*4)) +} + func pcdatavalue(f funcInfo, table int32, targetpc uintptr, cache *pcvalueCache) int32 { if table < 0 || table >= f.npcdata { return -1 } - off := *(*int32)(add(unsafe.Pointer(&f.nfuncdata), unsafe.Sizeof(f.nfuncdata)+uintptr(table)*4)) - return pcvalue(f, off, targetpc, cache, true) + return pcvalue(f, pcdatastart(f, table), targetpc, cache, true) +} + +func pcdatavalue1(f funcInfo, table int32, targetpc uintptr, cache *pcvalueCache, strict bool) int32 { + if table < 0 || table >= f.npcdata { + return -1 + } + return pcvalue(f, pcdatastart(f, table), targetpc, cache, strict) } func funcdata(f funcInfo, i uint8) unsafe.Pointer { diff --git a/test/fixedbugs/issue29735.go b/test/fixedbugs/issue29735.go new file mode 100644 index 0000000000000..7a0381d533eff --- /dev/null +++ b/test/fixedbugs/issue29735.go @@ -0,0 +1,33 @@ +// run + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure FuncForPC won't panic when given a pc which +// lies between two functions. + +package main + +import ( + "runtime" +) + +func main() { + var stack [1]uintptr + runtime.Callers(1, stack[:]) + f() // inlined function, to give main some inlining info + for i := uintptr(0); true; i++ { + f := runtime.FuncForPC(stack[0] + i) + if f.Name() != "main.main" && f.Name() != "main.f" { + // Reached next function successfully. + break + } + } +} + +func f() { + sink = 0 // one instruction which can't be removed +} + +var sink int From d82c9a167d9e3a09eb27a00b6125e1a3fea6dc3d Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Tue, 15 Jan 2019 19:37:17 +1100 Subject: [PATCH 525/594] path/filepath: skip part of TestNTNamespaceSymlink Recent CL 156398 extended TestNTNamespaceSymlink. But new code fails, if user running the test does not have sufficient privilege to create file symlink. Skip part of TestNTNamespaceSymlink, if user cannot create symlink. Fixes #29745 Change-Id: Ie4176429ba9dd98553ce9e91fd19851cc7353f42 Reviewed-on: https://go-review.googlesource.com/c/157917 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Tobias Klauser --- src/path/filepath/path_windows_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go index 3fcccfab785c6..d1735d39bd8cc 100644 --- a/src/path/filepath/path_windows_test.go +++ b/src/path/filepath/path_windows_test.go @@ -550,6 +550,9 @@ func TestNTNamespaceSymlink(t *testing.T) { t.Errorf(`EvalSymlinks(%q): got %q, want %q`, dirlink, got, want) } + // Make sure we have sufficient privilege to run mklink command. + testenv.MustHaveSymlink(t) + file := filepath.Join(tmpdir, "file") err = ioutil.WriteFile(file, []byte(""), 0666) if err != nil { From 3e9c3cfd1e163e65eaf60c35739f668b9fda5888 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Wed, 9 Jan 2019 12:54:50 +0000 Subject: [PATCH 526/594] cmd/go: remove init() to fix precedence issue when setting debug mod info Fixes #29628 Change-Id: I95dabed797ef7a1a770b6f4219840f653306af7e GitHub-Last-Rev: 9275dd8f1c6a0cfa16ae882fcfc100991f8338f7 GitHub-Pull-Request: golang/go#29630 Reviewed-on: https://go-review.googlesource.com/c/157097 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/cmd/go/internal/modload/build.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/cmd/go/internal/modload/build.go b/src/cmd/go/internal/modload/build.go index efeb7a5fd5d05..70740aeacd614 100644 --- a/src/cmd/go/internal/modload/build.go +++ b/src/cmd/go/internal/modload/build.go @@ -252,13 +252,10 @@ func findModule(target, path string) module.Version { func ModInfoProg(info string) []byte { // Inject a variable with the debug information as runtime/debug.modinfo, // but compile it in package main so that it is specific to the binary. - // Populate it in an init func so that it will work with go:linkname, - // but use a string constant instead of the name 'string' in case - // package main shadows the built-in 'string' with some local declaration. + // No need to populate in an init func, it will still work with go:linkname, return []byte(fmt.Sprintf(`package main import _ "unsafe" //go:linkname __debug_modinfo__ runtime/debug.modinfo -var __debug_modinfo__ = "" -func init() { __debug_modinfo__ = %q } +var __debug_modinfo__ = %q `, string(infoStart)+info+string(infoEnd))) } From 76e8ca447c6d48cadf4c355112e5c6bd60b9a2e8 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 15 Jan 2019 07:46:39 -0800 Subject: [PATCH 527/594] cmd/cgo: don't replace newlines with semicolons in composite literals Fixes #29748 Change-Id: I2b19165bdb3c99df5b79574390b5d5f6d40462dc Reviewed-on: https://go-review.googlesource.com/c/157961 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/cgo/test/issue29748.go | 22 ++++++++++++++++++++++ src/cmd/cgo/godefs.go | 15 ++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 misc/cgo/test/issue29748.go diff --git a/misc/cgo/test/issue29748.go b/misc/cgo/test/issue29748.go new file mode 100644 index 0000000000000..8229b3bcf08d4 --- /dev/null +++ b/misc/cgo/test/issue29748.go @@ -0,0 +1,22 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Error handling a struct initializer that requires pointer checking. +// Compilation test only, nothing to run. + +package cgotest + +// typedef struct { char **p; } S29748; +// static int f29748(S29748 *p) { return 0; } +import "C" + +var Vissue29748 = C.f29748(&C.S29748{ + nil, +}) + +func Fissue299748() { + C.f29748(&C.S29748{ + nil, + }) +} diff --git a/src/cmd/cgo/godefs.go b/src/cmd/cgo/godefs.go index 9c763a22fb01c..c0cd8e002fea4 100644 --- a/src/cmd/cgo/godefs.go +++ b/src/cmd/cgo/godefs.go @@ -127,8 +127,21 @@ func gofmt(n interface{}) string { return gofmtBuf.String() } +// gofmtLineReplacer is used to put a gofmt-formatted string for an +// AST expression onto a single line. The lexer normally inserts a +// semicolon at each newline, so we can replace newline with semicolon. +// However, we can't do that in cases where the lexer would not insert +// a semicolon. Fortunately we only have to worry about cases that +// can occur in an expression passed through gofmt, which just means +// composite literals. +var gofmtLineReplacer = strings.NewReplacer( + "{\n", "{", + ",\n", ",", + "\n", ";", +) + // gofmtLine returns the gofmt-formatted string for an AST node, // ensuring that it is on a single line. func gofmtLine(n interface{}) string { - return strings.Replace(gofmt(n), "\n", ";", -1) + return gofmtLineReplacer.Replace(gofmt(n)) } From 55715c1738adc0a9b6a7037390a700763365e284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 15 Jan 2019 18:29:15 +0000 Subject: [PATCH 528/594] cmd/go: fix wording issue in comment golang.org/cl/157097 modified this comment, but left a trailing comma. While at it, make the sentence a bit clearer. Change-Id: I376dda4fd18ddbcae4485dd660a79b9f66ad6da4 Reviewed-on: https://go-review.googlesource.com/c/158037 Reviewed-by: Brad Fitzpatrick --- src/cmd/go/internal/modload/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/internal/modload/build.go b/src/cmd/go/internal/modload/build.go index 70740aeacd614..10bea15fa3ef7 100644 --- a/src/cmd/go/internal/modload/build.go +++ b/src/cmd/go/internal/modload/build.go @@ -252,7 +252,7 @@ func findModule(target, path string) module.Version { func ModInfoProg(info string) []byte { // Inject a variable with the debug information as runtime/debug.modinfo, // but compile it in package main so that it is specific to the binary. - // No need to populate in an init func, it will still work with go:linkname, + // No need to populate it in an init func; it will still work with go:linkname. return []byte(fmt.Sprintf(`package main import _ "unsafe" //go:linkname __debug_modinfo__ runtime/debug.modinfo From 5fae09b7386de26db59a1184f62fc7b22ec7667b Mon Sep 17 00:00:00 2001 From: GuilhermeCaruso Date: Tue, 15 Jan 2019 23:24:52 +0000 Subject: [PATCH 529/594] encoding/json: add comment for mashalererror struct Change-Id: Iaabbfe5a4c1bbedd19d4087f1b79e5a38bdd3878 GitHub-Last-Rev: 55c91fc19074dacc66623aa7ff2286b11ccd5340 GitHub-Pull-Request: golang/go#29752 Reviewed-on: https://go-review.googlesource.com/c/157958 Reviewed-by: Ian Lance Taylor --- src/encoding/json/encode.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/encoding/json/encode.go b/src/encoding/json/encode.go index f10124e67d13c..dea63f1850fef 100644 --- a/src/encoding/json/encode.go +++ b/src/encoding/json/encode.go @@ -259,6 +259,7 @@ func (e *InvalidUTF8Error) Error() string { return "json: invalid UTF-8 in string: " + strconv.Quote(e.S) } +// A MarshalerError represents an error from calling a MarshalJSON or MarshalText method. type MarshalerError struct { Type reflect.Type Err error From 34817dd365af2be50605b6c204c7412933a52c9b Mon Sep 17 00:00:00 2001 From: Baokun Lee Date: Wed, 16 Jan 2019 18:53:35 +0800 Subject: [PATCH 530/594] cmd/go/internal/clean: fix clean -testcache does not clean test cache Truncate changes the size of the file. It does not change the I/O offset. Fixes #29757 Change-Id: I1aa9223a86d6a8ce3c0efc3ac1d7d7647b77f589 Reviewed-on: https://go-review.googlesource.com/c/158117 Reviewed-by: Bryan C. Mills --- src/cmd/go/internal/clean/clean.go | 4 +++- src/cmd/go/testdata/script/clean_testcache.txt | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/cmd/go/testdata/script/clean_testcache.txt diff --git a/src/cmd/go/internal/clean/clean.go b/src/cmd/go/internal/clean/clean.go index 32cc80736df4b..27121ed2ae679 100644 --- a/src/cmd/go/internal/clean/clean.go +++ b/src/cmd/go/internal/clean/clean.go @@ -152,7 +152,9 @@ func runClean(cmd *base.Command, args []string) { prev, _ := strconv.ParseInt(strings.TrimSpace(string(buf)), 10, 64) if now > prev { if err = f.Truncate(0); err == nil { - _, err = fmt.Fprintf(f, "%d\n", now) + if _, err = f.Seek(0, 0); err == nil { + _, err = fmt.Fprintf(f, "%d\n", now) + } } } if closeErr := f.Close(); err == nil { diff --git a/src/cmd/go/testdata/script/clean_testcache.txt b/src/cmd/go/testdata/script/clean_testcache.txt new file mode 100644 index 0000000000000..a2d592deffdda --- /dev/null +++ b/src/cmd/go/testdata/script/clean_testcache.txt @@ -0,0 +1,16 @@ +# go clean -testcache +# should work (see golang.org/issue/29757). +cd x +go test x_test.go +go clean -testcache +go test x_test.go +! stdout 'cached' + + +-- x/x_test.go -- +package x_test +import ( + "testing" +) +func TestMain(t *testing.T) { +} \ No newline at end of file From 0456036e28b718d215f49abe83d3c49101f8a4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= Date: Wed, 16 Jan 2019 09:03:57 +0100 Subject: [PATCH 531/594] net: increase TestNotTemporaryRead server sleep On aix/ppc64, if the server closes before the client calls Accept, this test will fail. Increasing the time before the server closes should resolve this timeout. Updates #29685 Change-Id: Iebb849d694fc9c37cf216ce1f0b8741249b98016 Reviewed-on: https://go-review.googlesource.com/c/158038 Reviewed-by: Ian Lance Taylor --- src/net/net_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/net_test.go b/src/net/net_test.go index 692f269e0c29b..2b5845bb1580f 100644 --- a/src/net/net_test.go +++ b/src/net/net_test.go @@ -529,7 +529,7 @@ func TestNotTemporaryRead(t *testing.T) { server := func(cs *TCPConn) error { cs.SetLinger(0) // Give the client time to get stuck in a Read. - time.Sleep(20 * time.Millisecond) + time.Sleep(50 * time.Millisecond) cs.Close() return nil } From 006a5e7d00992cfae6ac406959512d680025f75c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 11 Jan 2019 14:06:45 -0800 Subject: [PATCH 532/594] testing: report the failing test in a late log panic Updates #29388 Change-Id: Icb0e6048d05fde7a5486b923ff62147edb5c8dac Reviewed-on: https://go-review.googlesource.com/c/157617 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Damien Neil --- src/testing/sub_test.go | 49 +++++++++++++++++++++++++++++++++++++++++ src/testing/testing.go | 23 ++++++++++--------- 2 files changed, 62 insertions(+), 10 deletions(-) diff --git a/src/testing/sub_test.go b/src/testing/sub_test.go index 8c989714a1c43..5a6d51be592f9 100644 --- a/src/testing/sub_test.go +++ b/src/testing/sub_test.go @@ -706,6 +706,55 @@ func TestRacyOutput(t *T) { } } +// The late log message did not include the test name. Issue 29388. +func TestLogAfterComplete(t *T) { + ctx := newTestContext(1, newMatcher(regexp.MatchString, "", "")) + var buf bytes.Buffer + t1 := &T{ + common: common{ + // Use a buffered channel so that tRunner can write + // to it although nothing is reading from it. + signal: make(chan bool, 1), + w: &buf, + }, + context: ctx, + } + + c1 := make(chan bool) + c2 := make(chan string) + tRunner(t1, func(t *T) { + t.Run("TestLateLog", func(t *T) { + go func() { + defer close(c2) + defer func() { + p := recover() + if p == nil { + c2 <- "subtest did not panic" + return + } + s, ok := p.(string) + if !ok { + c2 <- fmt.Sprintf("subtest panic with unexpected value %v", p) + return + } + const want = "Log in goroutine after TestLateLog has completed" + if !strings.Contains(s, want) { + c2 <- fmt.Sprintf("subtest panic %q does not contain %q", s, want) + } + }() + + <-c1 + t.Log("log after test") + }() + }) + }) + close(c1) + + if s := <-c2; s != "" { + t.Error(s) + } +} + func TestBenchmark(t *T) { res := Benchmark(func(b *B) { for i := 0; i < 5; i++ { diff --git a/src/testing/testing.go b/src/testing/testing.go index 0ac51b6fe5162..3068630e8a976 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -618,17 +618,20 @@ func (c *common) log(s string) { func (c *common) logDepth(s string, depth int) { c.mu.Lock() defer c.mu.Unlock() - // If this test has already finished try and log this message with our parent - // with this test name tagged so we know where it came from. - // If we don't have a parent panic. - if c.done { - if c.parent != nil { - c.parent.logDepth(s, depth+1) - } else { - panic("Log in goroutine after " + c.name + " has completed") - } - } else { + if !c.done { c.output = append(c.output, c.decorate(s, depth+1)...) + } else { + // This test has already finished. Try and log this message + // with our parent. If we don't have a parent, panic. + for parent := c.parent; parent != nil; parent = parent.parent { + parent.mu.Lock() + defer parent.mu.Unlock() + if !parent.done { + parent.output = append(parent.output, parent.decorate(s, depth+1)...) + return + } + } + panic("Log in goroutine after " + c.name + " has completed") } } From e2ff73286f68543d024f632a1764e93a6b21ccee Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 16 Jan 2019 21:42:00 -0500 Subject: [PATCH 533/594] doc/go1.12: link to ABIInternal design document The ABI changes should be completely transparent to Go code, but could cause linking issues in certain situations involving assembly code reaching across package boundaries. If users encounter linking problems, point them to the "Compatibility" section of the ABI design document, which gives some guidance. Change-Id: I4156d164562e2ec0de7ae8f9a3631a32ec45b317 Reviewed-on: https://go-review.googlesource.com/c/158237 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index e228d98a8cc88..41ebd50cb2e86 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -239,9 +239,9 @@

    Compiler toolchain

    except for calls that simultaneously cross between Go and assembly and cross a package boundary. If linking results in an error like "relocation target not defined for ABIInternal (but - is defined for ABI0)", please refer to help section of the ABI - design document. - + is defined for ABI0)", please refer to the + compatibility section + of the ABI design document.

    From 79ac638e41abed1d8f46762ecd6d63a93d9bb382 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Mon, 14 Jan 2019 21:27:29 +0000 Subject: [PATCH 534/594] runtime: refactor coalescing into its own method The coalescing process is complex and in a follow-up change we'll need to do it in more than one place, so this change factors out the coalescing code in freeSpanLocked into a method on mheap. Change-Id: Ia266b6cb1157c1b8d3d8a4287b42fbcc032bbf3a Reviewed-on: https://go-review.googlesource.com/c/157838 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/mheap.go | 117 ++++++++++++++++++++++--------------------- 1 file changed, 61 insertions(+), 56 deletions(-) diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index f5b5ba99b8418..d409662451460 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -419,6 +419,65 @@ func (s *mspan) physPageBounds() (uintptr, uintptr) { return start, end } +func (h *mheap) coalesce(s *mspan) { + // We scavenge s at the end after coalescing if s or anything + // it merged with is marked scavenged. + needsScavenge := false + prescavenged := s.released() // number of bytes already scavenged. + + // Coalesce with earlier, later spans. + if before := spanOf(s.base() - 1); before != nil && before.state == mSpanFree { + // Now adjust s. + s.startAddr = before.startAddr + s.npages += before.npages + s.needzero |= before.needzero + h.setSpan(before.base(), s) + // If before or s are scavenged, then we need to scavenge the final coalesced span. + needsScavenge = needsScavenge || before.scavenged || s.scavenged + prescavenged += before.released() + // The size is potentially changing so the treap needs to delete adjacent nodes and + // insert back as a combined node. + if before.scavenged { + h.scav.removeSpan(before) + } else { + h.free.removeSpan(before) + } + before.state = mSpanDead + h.spanalloc.free(unsafe.Pointer(before)) + } + + // Now check to see if next (greater addresses) span is free and can be coalesced. + if after := spanOf(s.base() + s.npages*pageSize); after != nil && after.state == mSpanFree { + s.npages += after.npages + s.needzero |= after.needzero + h.setSpan(s.base()+s.npages*pageSize-1, s) + needsScavenge = needsScavenge || after.scavenged || s.scavenged + prescavenged += after.released() + if after.scavenged { + h.scav.removeSpan(after) + } else { + h.free.removeSpan(after) + } + after.state = mSpanDead + h.spanalloc.free(unsafe.Pointer(after)) + } + + if needsScavenge { + // When coalescing spans, some physical pages which + // were not returned to the OS previously because + // they were only partially covered by the span suddenly + // become available for scavenging. We want to make sure + // those holes are filled in, and the span is properly + // scavenged. Rather than trying to detect those holes + // directly, we collect how many bytes were already + // scavenged above and subtract that from heap_released + // before re-scavenging the entire newly-coalesced span, + // which will implicitly bump up heap_released. + memstats.heap_released -= uint64(prescavenged) + s.scavenge() + } +} + func (s *mspan) scavenge() uintptr { // start and end must be rounded in, otherwise madvise // will round them *out* and release more memory @@ -1215,62 +1274,8 @@ func (h *mheap) freeSpanLocked(s *mspan, acctinuse, acctidle bool, unusedsince i s.unusedsince = nanotime() } - // We scavenge s at the end after coalescing if s or anything - // it merged with is marked scavenged. - needsScavenge := false - prescavenged := s.released() // number of bytes already scavenged. - - // Coalesce with earlier, later spans. - if before := spanOf(s.base() - 1); before != nil && before.state == mSpanFree { - // Now adjust s. - s.startAddr = before.startAddr - s.npages += before.npages - s.needzero |= before.needzero - h.setSpan(before.base(), s) - // If before or s are scavenged, then we need to scavenge the final coalesced span. - needsScavenge = needsScavenge || before.scavenged || s.scavenged - prescavenged += before.released() - // The size is potentially changing so the treap needs to delete adjacent nodes and - // insert back as a combined node. - if before.scavenged { - h.scav.removeSpan(before) - } else { - h.free.removeSpan(before) - } - before.state = mSpanDead - h.spanalloc.free(unsafe.Pointer(before)) - } - - // Now check to see if next (greater addresses) span is free and can be coalesced. - if after := spanOf(s.base() + s.npages*pageSize); after != nil && after.state == mSpanFree { - s.npages += after.npages - s.needzero |= after.needzero - h.setSpan(s.base()+s.npages*pageSize-1, s) - needsScavenge = needsScavenge || after.scavenged || s.scavenged - prescavenged += after.released() - if after.scavenged { - h.scav.removeSpan(after) - } else { - h.free.removeSpan(after) - } - after.state = mSpanDead - h.spanalloc.free(unsafe.Pointer(after)) - } - - if needsScavenge { - // When coalescing spans, some physical pages which - // were not returned to the OS previously because - // they were only partially covered by the span suddenly - // become available for scavenging. We want to make sure - // those holes are filled in, and the span is properly - // scavenged. Rather than trying to detect those holes - // directly, we collect how many bytes were already - // scavenged above and subtract that from heap_released - // before re-scavenging the entire newly-coalesced span, - // which will implicitly bump up heap_released. - memstats.heap_released -= uint64(prescavenged) - s.scavenge() - } + // Coalesce span with neighbors. + h.coalesce(s) // Insert s into the appropriate treap. if s.scavenged { From 2f99e889f02df9ef88fb1d26194eb2e8e725fda5 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 15 Jan 2019 23:48:57 +0000 Subject: [PATCH 535/594] runtime: de-duplicate coalescing code Currently the code surrounding coalescing is duplicated between merging with the span before the span considered for coalescing and merging with the span after. This change factors out the shared portions of these codepaths into a local closure which acts as a helper. Change-Id: I7919fbed3f9a833eafb324a21a4beaa81f2eaa91 Reviewed-on: https://go-review.googlesource.com/c/158077 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/mheap.go | 50 ++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index d409662451460..6a7f9bacdbd9d 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -425,41 +425,41 @@ func (h *mheap) coalesce(s *mspan) { needsScavenge := false prescavenged := s.released() // number of bytes already scavenged. - // Coalesce with earlier, later spans. - if before := spanOf(s.base() - 1); before != nil && before.state == mSpanFree { - // Now adjust s. - s.startAddr = before.startAddr - s.npages += before.npages - s.needzero |= before.needzero - h.setSpan(before.base(), s) + // merge is a helper which merges other into s, deletes references to other + // in heap metadata, and then discards it. + merge := func(other *mspan) { + // Adjust s via base and npages. + if other.startAddr < s.startAddr { + s.startAddr = other.startAddr + } + s.npages += other.npages + s.needzero |= other.needzero + // If before or s are scavenged, then we need to scavenge the final coalesced span. - needsScavenge = needsScavenge || before.scavenged || s.scavenged - prescavenged += before.released() + needsScavenge = needsScavenge || other.scavenged || s.scavenged + prescavenged += other.released() + // The size is potentially changing so the treap needs to delete adjacent nodes and // insert back as a combined node. - if before.scavenged { - h.scav.removeSpan(before) + if other.scavenged { + h.scav.removeSpan(other) } else { - h.free.removeSpan(before) + h.free.removeSpan(other) } - before.state = mSpanDead - h.spanalloc.free(unsafe.Pointer(before)) + other.state = mSpanDead + h.spanalloc.free(unsafe.Pointer(other)) + } + + // Coalesce with earlier, later spans. + if before := spanOf(s.base() - 1); before != nil && before.state == mSpanFree { + merge(before) + h.setSpan(s.base(), s) } // Now check to see if next (greater addresses) span is free and can be coalesced. if after := spanOf(s.base() + s.npages*pageSize); after != nil && after.state == mSpanFree { - s.npages += after.npages - s.needzero |= after.needzero + merge(after) h.setSpan(s.base()+s.npages*pageSize-1, s) - needsScavenge = needsScavenge || after.scavenged || s.scavenged - prescavenged += after.released() - if after.scavenged { - h.scav.removeSpan(after) - } else { - h.free.removeSpan(after) - } - after.state = mSpanDead - h.spanalloc.free(unsafe.Pointer(after)) } if needsScavenge { From 6e9f664b9a68f2de84be9697c6ac851c7c7e1c26 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Wed, 16 Jan 2019 00:15:34 +0000 Subject: [PATCH 536/594] runtime: don't coalesce scavenged spans with unscavenged spans As a result of changes earlier in Go 1.12, the scavenger became much more aggressive. In particular, when scavenged and unscavenged spans coalesced, they would always become scavenged. This resulted in most spans becoming scavenged over time. While this is good for keeping the RSS of the program low, it also causes many more undue page faults and many more calls to madvise. For most applications, the impact of this was negligible. But for applications that repeatedly grow and shrink the heap by large amounts, the overhead can be significant. The overhead was especially obvious on older versions of Linux where MADV_FREE isn't available and MADV_DONTNEED must be used. This change makes it so that scavenged spans will never coalesce with unscavenged spans. This results in fewer page faults overall. Aside from this, the expected impact of this change is more heap growths on average, as span allocations will be less likely to be fulfilled. To mitigate this slightly, this change also coalesces spans eagerly after scavenging, to at least ensure that all scavenged spans and all unscavenged spans are coalesced with each other. Also, this change adds additional logic in the case where two adjacent spans cannot coalesce. In this case, on platforms where the physical page size is larger than the runtime's page size, we realign the boundary between the two adjacent spans to a physical page boundary. The advantage of this approach is that "unscavengable" spans, that is, spans which cannot be scavenged because they don't cover at least a single physical page are grown to a size where they have a higher likelihood of being discovered by the runtime's scavenging mechanisms when they border a scavenged span. This helps prevent the runtime from accruing pockets of "unscavengable" memory in between scavenged spans, preventing them from coalescing. We specifically choose to apply this logic to all spans because it simplifies the code, even though it isn't strictly necessary. The expectation is that this change will result in a slight loss in performance on platforms where the physical page size is larger than the runtime page size. Update #14045. Change-Id: I64fd43eac1d6de6f51d7a2ecb72670f10bb12589 Reviewed-on: https://go-review.googlesource.com/c/158078 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/mheap.go | 74 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 6a7f9bacdbd9d..1bf7bbecc0a5f 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -426,14 +426,17 @@ func (h *mheap) coalesce(s *mspan) { prescavenged := s.released() // number of bytes already scavenged. // merge is a helper which merges other into s, deletes references to other - // in heap metadata, and then discards it. + // in heap metadata, and then discards it. other must be adjacent to s. merge := func(other *mspan) { - // Adjust s via base and npages. + // Adjust s via base and npages and also in heap metadata. + s.npages += other.npages + s.needzero |= other.needzero if other.startAddr < s.startAddr { s.startAddr = other.startAddr + h.setSpan(s.base(), s) + } else { + h.setSpan(s.base()+s.npages*pageSize-1, s) } - s.npages += other.npages - s.needzero |= other.needzero // If before or s are scavenged, then we need to scavenge the final coalesced span. needsScavenge = needsScavenge || other.scavenged || s.scavenged @@ -450,16 +453,63 @@ func (h *mheap) coalesce(s *mspan) { h.spanalloc.free(unsafe.Pointer(other)) } + // realign is a helper which shrinks other and grows s such that their + // boundary is on a physical page boundary. + realign := func(a, b, other *mspan) { + // Caller must ensure a.startAddr < b.startAddr and that either a or + // b is s. a and b must be adjacent. other is whichever of the two is + // not s. + + // If pageSize <= physPageSize then spans are always aligned + // to physical page boundaries, so just exit. + if pageSize <= physPageSize { + return + } + // Since we're resizing other, we must remove it from the treap. + if other.scavenged { + h.scav.removeSpan(other) + } else { + h.free.removeSpan(other) + } + // Round boundary to the nearest physical page size, toward the + // scavenged span. + boundary := b.startAddr + if a.scavenged { + boundary &^= (physPageSize - 1) + } else { + boundary = (boundary + physPageSize - 1) &^ (physPageSize - 1) + } + a.npages = (boundary - a.startAddr) / pageSize + b.npages = (b.startAddr + b.npages*pageSize - boundary) / pageSize + b.startAddr = boundary + + h.setSpan(boundary-1, a) + h.setSpan(boundary, b) + + // Re-insert other now that it has a new size. + if other.scavenged { + h.scav.insert(other) + } else { + h.free.insert(other) + } + } + // Coalesce with earlier, later spans. if before := spanOf(s.base() - 1); before != nil && before.state == mSpanFree { - merge(before) - h.setSpan(s.base(), s) + if s.scavenged == before.scavenged { + merge(before) + } else { + realign(before, s, before) + } } // Now check to see if next (greater addresses) span is free and can be coalesced. if after := spanOf(s.base() + s.npages*pageSize); after != nil && after.state == mSpanFree { - merge(after) - h.setSpan(s.base()+s.npages*pageSize-1, s) + if s.scavenged == after.scavenged { + merge(after) + } else { + realign(s, after, after) + } } if needsScavenge { @@ -1309,6 +1359,10 @@ func (h *mheap) scavengeLargest(nbytes uintptr) { } n := t.prev() h.free.erase(t) + // Now that s is scavenged, we must eagerly coalesce it + // with its neighbors to prevent having two spans with + // the same scavenged state adjacent to each other. + h.coalesce(s) t = n h.scav.insert(s) released += r @@ -1328,6 +1382,10 @@ func (h *mheap) scavengeAll(now, limit uint64) uintptr { r := s.scavenge() if r != 0 { h.free.erase(t) + // Now that s is scavenged, we must eagerly coalesce it + // with its neighbors to prevent having two spans with + // the same scavenged state adjacent to each other. + h.coalesce(s) h.scav.insert(s) released += r } From 33caf3be833ba1fe9b74aa4c314f5b82bb696b86 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 17 Jan 2019 14:49:30 -0800 Subject: [PATCH 537/594] math/big: document that Rat.SetString accepts _decimal_ float representations Updates #29799. Change-Id: I267c2c3ba3964e96903954affc248d0c52c4916c Reviewed-on: https://go-review.googlesource.com/c/158397 Reviewed-by: Brad Fitzpatrick --- src/math/big/ratconv.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/math/big/ratconv.go b/src/math/big/ratconv.go index 157d8d006d4f5..5656280e84dab 100644 --- a/src/math/big/ratconv.go +++ b/src/math/big/ratconv.go @@ -38,8 +38,8 @@ func (z *Rat) Scan(s fmt.ScanState, ch rune) error { } // SetString sets z to the value of s and returns z and a boolean indicating -// success. s can be given as a fraction "a/b" or as a floating-point number -// optionally followed by an exponent. The entire string (not just a prefix) +// success. s can be given as a fraction "a/b" or as a decimal floating-point +// number optionally followed by an exponent. The entire string (not just a prefix) // must be valid for success. If the operation failed, the value of z is // undefined but the returned value is nil. func (z *Rat) SetString(s string) (*Rat, bool) { @@ -78,6 +78,7 @@ func (z *Rat) SetString(s string) (*Rat, bool) { } // mantissa + // TODO(gri) allow other bases besides 10 for mantissa and exponent? (issue #29799) var ecorr int z.a.abs, _, ecorr, err = z.a.abs.scan(r, 10, true) if err != nil { From 246e6ceb3bdbcfdb9f562c67622c3d67a45eb70d Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 17 Jan 2019 15:22:47 -0800 Subject: [PATCH 538/594] net/http: clarify Transport connection reuse docs a bit Updates #26095 (or fixes it) Change-Id: I92488dabe823b82e1ba534648fe6d63d25d0ae9f Reviewed-on: https://go-review.googlesource.com/c/158417 Reviewed-by: Ian Lance Taylor --- src/net/http/client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net/http/client.go b/src/net/http/client.go index ea6c0719119b1..921f86bd92dc7 100644 --- a/src/net/http/client.go +++ b/src/net/http/client.go @@ -478,10 +478,10 @@ func urlErrorOp(method string) string { // error. // // If the returned error is nil, the Response will contain a non-nil -// Body which the user is expected to close. If the Body is not -// closed, the Client's underlying RoundTripper (typically Transport) -// may not be able to re-use a persistent TCP connection to the server -// for a subsequent "keep-alive" request. +// Body which the user is expected to close. If the Body is not both +// read to EOF and closed, the Client's underlying RoundTripper +// (typically Transport) may not be able to re-use a persistent TCP +// connection to the server for a subsequent "keep-alive" request. // // The request Body, if non-nil, will be closed by the underlying // Transport, even on errors. From dd1889cb22c1fd37cf444d672274a8460fe6e2bf Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 17 Jan 2019 18:35:43 -0800 Subject: [PATCH 539/594] cmd/cgo: don't replace newlines with semicolons in expressions Fixes #29781 Change-Id: Id032d07a54b8c24f0c6d3f6e512932f76920ee04 Reviewed-on: https://go-review.googlesource.com/c/158457 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/cgo/test/issue29781.go | 17 +++++++++++++++++ src/cmd/cgo/godefs.go | 21 ++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 misc/cgo/test/issue29781.go diff --git a/misc/cgo/test/issue29781.go b/misc/cgo/test/issue29781.go new file mode 100644 index 0000000000000..0fd8c08b8eb0e --- /dev/null +++ b/misc/cgo/test/issue29781.go @@ -0,0 +1,17 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Error with newline inserted into constant expression. +// Compilation test only, nothing to run. + +package cgotest + +// static void issue29781F(char **p, int n) {} +// #define ISSUE29781C 0 +import "C" + +func issue29781G() { + var p *C.char + C.issue29781F(&p, C.ISSUE29781C+1) +} diff --git a/src/cmd/cgo/godefs.go b/src/cmd/cgo/godefs.go index c0cd8e002fea4..7185ea0de7db0 100644 --- a/src/cmd/cgo/godefs.go +++ b/src/cmd/cgo/godefs.go @@ -131,12 +131,27 @@ func gofmt(n interface{}) string { // AST expression onto a single line. The lexer normally inserts a // semicolon at each newline, so we can replace newline with semicolon. // However, we can't do that in cases where the lexer would not insert -// a semicolon. Fortunately we only have to worry about cases that -// can occur in an expression passed through gofmt, which just means -// composite literals. +// a semicolon. We only have to worry about cases that can occur in an +// expression passed through gofmt, which means composite literals and +// (due to the printer possibly inserting newlines because of position +// information) operators. var gofmtLineReplacer = strings.NewReplacer( "{\n", "{", ",\n", ",", + "++\n", "++;", + "--\n", "--;", + "+\n", "+", + "-\n", "-", + "*\n", "*", + "/\n", "/", + "%\n", "%", + "&\n", "&", + "|\n", "|", + "^\n", "^", + "<\n", "<", + ">\n", ">", + "=\n", "=", + ",\n", ",", "\n", ";", ) From c077c74312563aad8117fe9f40fa85e1b5c87ac2 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 16 Dec 2018 16:06:13 -0800 Subject: [PATCH 540/594] cmd/go: don't modify GOROOT in TestNewReleaseRebuildsStalePackagesInGOPATH Fixes #29263 Change-Id: I06ba135dc491fd01fc06ccaad4ef98103d4b86c4 Reviewed-on: https://go-review.googlesource.com/c/154460 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/go/go_test.go | 51 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/src/cmd/go/go_test.go b/src/cmd/go/go_test.go index e2ddc58a5d6a7..c58bc7408d009 100644 --- a/src/cmd/go/go_test.go +++ b/src/cmd/go/go_test.go @@ -866,12 +866,54 @@ func (tg *testgoData) failSSH() { func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) { if testing.Short() { - t.Skip("don't rebuild the standard library in short mode") + t.Skip("skipping lengthy test in short mode") } tg := testgo(t) defer tg.cleanup() + // Copy the runtime packages into a temporary GOROOT + // so that we can change files. + for _, copydir := range []string{ + "src/runtime", + "src/internal/bytealg", + "src/internal/cpu", + "src/unsafe", + filepath.Join("pkg", runtime.GOOS+"_"+runtime.GOARCH), + filepath.Join("pkg/tool", runtime.GOOS+"_"+runtime.GOARCH), + "pkg/include", + } { + srcdir := filepath.Join(testGOROOT, copydir) + tg.tempDir(filepath.Join("goroot", copydir)) + err := filepath.Walk(srcdir, + func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.IsDir() { + return nil + } + srcrel, err := filepath.Rel(srcdir, path) + if err != nil { + return err + } + dest := filepath.Join("goroot", copydir, srcrel) + data, err := ioutil.ReadFile(path) + if err != nil { + return err + } + tg.tempFile(dest, string(data)) + if err := os.Chmod(tg.path(dest), info.Mode()); err != nil { + return err + } + return nil + }) + if err != nil { + t.Fatal(err) + } + } + tg.setenv("GOROOT", tg.path("goroot")) + addVar := func(name string, idx int) (restore func()) { data, err := ioutil.ReadFile(name) if err != nil { @@ -900,7 +942,7 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) { // Changing mtime of runtime/internal/sys/sys.go // should have no effect: only the content matters. // In fact this should be true even outside a release branch. - sys := runtime.GOROOT() + "/src/runtime/internal/sys/sys.go" + sys := tg.path("goroot/src/runtime/internal/sys/sys.go") tg.sleep() restore := addVar(sys, 0) restore() @@ -915,7 +957,7 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) { restore() tg.wantNotStale("p1", "", "./testgo list claims p1 is stale, incorrectly, after changing back to old release") addVar(sys, 2) - tg.wantStale("p1", "stale dependency: runtime/internal/sys", "./testgo list claims p1 is NOT stale, incorrectly, after changing sys.go again") + tg.wantStale("p1", "stale dependency: runtime", "./testgo list claims p1 is NOT stale, incorrectly, after changing sys.go again") tg.run("install", "-i", "p1") tg.wantNotStale("p1", "", "./testgo list claims p1 is stale after building with new release") @@ -924,9 +966,6 @@ func TestNewReleaseRebuildsStalePackagesInGOPATH(t *testing.T) { tg.wantStale("p1", "stale dependency: runtime/internal/sys", "./testgo list claims p1 is NOT stale, incorrectly, after restoring sys.go") tg.run("install", "-i", "p1") tg.wantNotStale("p1", "", "./testgo list claims p1 is stale after building with old release") - - // Everything is out of date. Rebuild to leave things in a better state. - tg.run("install", "std") } func testLocalRun(tg *testgoData, exepath, local, match string) { From dc889025c714313fbe912ad1253f0ec748a6e58c Mon Sep 17 00:00:00 2001 From: Raul Silvera Date: Fri, 18 Jan 2019 00:14:29 +0000 Subject: [PATCH 541/594] runtime: sample large heap allocations correctly Remove an unnecessary check on the heap sampling code that forced sampling of all heap allocations larger than the sampling rate. This need to follow a poisson process so that they can be correctly unsampled. Maintain a check for MemProfileRate==1 to provide a mechanism for full sampling, as documented in https://golang.org/pkg/runtime/#pkg-variables. Additional testing for this change is on cl/129117. Fixes #26618 Change-Id: I7802bde2afc655cf42cffac34af9bafeb3361957 GitHub-Last-Rev: 471f747af845395d458096bea26daa93b91120be GitHub-Pull-Request: golang/go#29791 Reviewed-on: https://go-review.googlesource.com/c/158337 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Hyang-Ah Hana Kim --- src/runtime/malloc.go | 2 +- src/runtime/testdata/testprog/memprof.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index c1a89dc588d7d..8c617bb42b486 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -1012,7 +1012,7 @@ func mallocgc(size uintptr, typ *_type, needzero bool) unsafe.Pointer { } if rate := MemProfileRate; rate > 0 { - if size < uintptr(rate) && int32(size) < c.next_sample { + if rate != 1 && int32(size) < c.next_sample { c.next_sample -= int32(size) } else { mp := acquirem() diff --git a/src/runtime/testdata/testprog/memprof.go b/src/runtime/testdata/testprog/memprof.go index a22fee61d7825..7b134bc078403 100644 --- a/src/runtime/testdata/testprog/memprof.go +++ b/src/runtime/testdata/testprog/memprof.go @@ -21,7 +21,10 @@ var memProfBuf bytes.Buffer var memProfStr string func MemProf() { - for i := 0; i < 1000; i++ { + // Force heap sampling for determinism. + runtime.MemProfileRate = 1 + + for i := 0; i < 10; i++ { fmt.Fprintf(&memProfBuf, "%*d\n", i, i) } memProfStr = memProfBuf.String() From bcd3a58d4694fa0bf8aa079875a5d236c9f20ef6 Mon Sep 17 00:00:00 2001 From: tkivisik Date: Fri, 18 Jan 2019 20:45:41 +0000 Subject: [PATCH 542/594] A+C: add author, rename contributor to a real name Renamed from github user to use my real name in CONTRIBUTORS, added my name to AUTHORS. Change-Id: I671638f1525d44bcc2b0a08d0dcff6adb1717510 GitHub-Last-Rev: b989e185de9ad2d1207085043fcdc821d851c562 GitHub-Pull-Request: golang/go#29823 Reviewed-on: https://go-review.googlesource.com/c/158540 Reviewed-by: Brad Fitzpatrick --- AUTHORS | 1 + CONTRIBUTORS | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 8001484e12398..e754fec012199 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1304,6 +1304,7 @@ Sven Almgren Sylvain Zimmer Syohei YOSHIDA Szabolcs Nagy +Taavi Kivisik Tad Fisher Tad Glines Taj Khattra diff --git a/CONTRIBUTORS b/CONTRIBUTORS index f6a0df11f7184..d1be11e39202d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -715,7 +715,6 @@ GitHub User @OlgaVlPetrova (44112727) GitHub User @pityonline (438222) GitHub User @pytimer (17105586) GitHub User @shogo-ma (9860598) -GitHub User @tkivisik (13732144) GitHub User @uhei (2116845) GitHub User @uropek (39370426) Giulio Iotti @@ -1773,6 +1772,7 @@ Sven Blumenstein Sylvain Zimmer Syohei YOSHIDA Szabolcs Nagy +Taavi Kivisik Tad Fisher Tad Glines Tadas Valiukas From 1e49021f8936d1ed435ae7d314aeaf55dcc55001 Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Fri, 18 Jan 2019 14:45:25 -0500 Subject: [PATCH 543/594] doc/go1.12: mention heap sampling change This is about a minor change but worthy of note because this may affect the profile results users will see. Change-Id: Ie2c4358b248f868662dbc71db587576481aa7238 Reviewed-on: https://go-review.googlesource.com/c/158577 Reviewed-by: Raul Silvera Reviewed-by: Austin Clements --- doc/go1.12.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 41ebd50cb2e86..d3cbeb4525bf1 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -329,6 +329,11 @@

    Runtime

    yet supported on Windows.

    +

    + Go 1.12 improves the accuracy of memory profiles by fixing + overcounting of large heap allocations. +

    +

    Core library

    TLS 1.3

    From 6f93f86498608b2bf003a2bef7152d339fcde384 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 18 Jan 2019 17:31:45 -0500 Subject: [PATCH 544/594] crypto/tls: expand Config.CipherSuites docs Fixes #29349 Change-Id: Iec16eb2b20b43250249ec85c3d78fd64d1b6e3f3 Reviewed-on: https://go-review.googlesource.com/c/158637 Reviewed-by: Brad Fitzpatrick --- src/crypto/tls/common.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go index 0bc40ccf0b506..59d5507e1aa84 100644 --- a/src/crypto/tls/common.go +++ b/src/crypto/tls/common.go @@ -199,7 +199,7 @@ type ConnectionState struct { Version uint16 // TLS version used by the connection (e.g. VersionTLS12) HandshakeComplete bool // TLS handshake is complete DidResume bool // connection resumes a previous TLS connection - CipherSuite uint16 // cipher suite in use (TLS_RSA_WITH_RC4_128_SHA, ...) + CipherSuite uint16 // cipher suite in use (TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, ...) NegotiatedProtocol string // negotiated next protocol (not guaranteed to be from Config.NextProtos) NegotiatedProtocolIsMutual bool // negotiated protocol was advertised by server (client side only) ServerName string // server name requested by client, if any (server side only) @@ -315,7 +315,7 @@ const ( // guide certificate selection in the GetCertificate callback. type ClientHelloInfo struct { // CipherSuites lists the CipherSuites supported by the client (e.g. - // TLS_RSA_WITH_RC4_128_SHA). + // TLS_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256). CipherSuites []uint16 // ServerName indicates the name of the server requested by the client @@ -521,8 +521,11 @@ type Config struct { // This should be used only for testing. InsecureSkipVerify bool - // CipherSuites is a list of supported cipher suites. If CipherSuites - // is nil, TLS uses a list of suites supported by the implementation. + // CipherSuites is a list of supported cipher suites for TLS versions up to + // TLS 1.2. If CipherSuites is nil, a default list of secure cipher suites + // is used, with a preference order based on hardware performance. The + // default cipher suites might change over Go versions. Note that TLS 1.3 + // ciphersuites are not configurable. CipherSuites []uint16 // PreferServerCipherSuites controls whether the server selects the From 5538a9a34fc4e395967c0233aab5bdde0cebbf9b Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 18 Jan 2019 17:32:30 -0500 Subject: [PATCH 545/594] doc/go1.12: mention small RSA keys will cause some TLS handshakes to fail Updates #29779 Change-Id: I9becaba41ab4cd0bac25b4bedf3f8b19761d8158 Reviewed-on: https://go-review.googlesource.com/c/158638 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index d3cbeb4525bf1..0a998c06e01ae 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -443,7 +443,9 @@

    Minor changes to the library

    TLS 1.2 clients and servers will now advertise and accept RSA-PSS - signature algorithms for use with regular RSA public keys. + signature algorithms for use with regular RSA public keys. Certain + insecure certificate keys (including 512-bit RSA keys) will + now cause a handshake failure if RSA-PSS is selected.

    From a15a01377226cfca48fb64f67fb535af1da4bf0e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 20 Jan 2019 07:46:18 -0800 Subject: [PATCH 546/594] cmd/cgo: print the right error if mangling detection gccgo fails Change-Id: I2324f6f51d2bf8a4ae1b139b3933bc78dfa75835 Reviewed-on: https://go-review.googlesource.com/c/158718 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Cherry Zhang --- src/cmd/cgo/out.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 0985a7e72ead9..00e2f9769cd93 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -1255,7 +1255,7 @@ func determineGccgoManglingScheme() bool { cmd := exec.Command(gccgocmd, "-S", "-o", "-", gofilename) buf, cerr := cmd.CombinedOutput() if cerr != nil { - fatalf("%s", err) + fatalf("%s", cerr) } // New mangling: expect go.l..u00e4ufer.Run From 6718bb22fe36db9f58d4b4263ed9ffa182ca0c1b Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Fri, 18 Jan 2019 17:33:49 -0500 Subject: [PATCH 547/594] crypto/tls: send a "handshake failure" alert if the RSA key is too small Fixes #29779 Change-Id: I7eb8b4db187597e07d8ec7d3ff651f008e2ca433 Reviewed-on: https://go-review.googlesource.com/c/158639 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/crypto/tls/handshake_server_test.go | 43 ++++++++++++++++++++++++ src/crypto/tls/handshake_server_tls13.go | 8 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/crypto/tls/handshake_server_test.go b/src/crypto/tls/handshake_server_test.go index a6240f2235fa0..411648ef68be8 100644 --- a/src/crypto/tls/handshake_server_test.go +++ b/src/crypto/tls/handshake_server_test.go @@ -1697,3 +1697,46 @@ func TestCloneHash(t *testing.T) { t.Error("cloned hash generated a different sum") } } + +func TestKeyTooSmallForRSAPSS(t *testing.T) { + clientConn, serverConn := localPipe(t) + client := Client(clientConn, testConfig) + cert, err := X509KeyPair([]byte(`-----BEGIN CERTIFICATE----- +MIIBcTCCARugAwIBAgIQGjQnkCFlUqaFlt6ixyz/tDANBgkqhkiG9w0BAQsFADAS +MRAwDgYDVQQKEwdBY21lIENvMB4XDTE5MDExODIzMjMyOFoXDTIwMDExODIzMjMy +OFowEjEQMA4GA1UEChMHQWNtZSBDbzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDd +ez1rFUDwax2HTxbcnFUP9AhcgEGMHVV2nn4VVEWFJB6I8C/Nkx0XyyQlrmFYBzEQ +nIPhKls4T0hFoLvjJnXpAgMBAAGjTTBLMA4GA1UdDwEB/wQEAwIFoDATBgNVHSUE +DDAKBggrBgEFBQcDATAMBgNVHRMBAf8EAjAAMBYGA1UdEQQPMA2CC2V4YW1wbGUu +Y29tMA0GCSqGSIb3DQEBCwUAA0EAxDuUS+BrrS3c+h+k+fQPOmOScy6yTX9mHw0Q +KbucGamXYEy0URIwOdO0tQ3LHPc1YGvYSPwkDjkjqECs2Vm/AA== +-----END CERTIFICATE-----`), []byte(`-----BEGIN RSA PRIVATE KEY----- +MIIBOgIBAAJBAN17PWsVQPBrHYdPFtycVQ/0CFyAQYwdVXaefhVURYUkHojwL82T +HRfLJCWuYVgHMRCcg+EqWzhPSEWgu+MmdekCAwEAAQJBALjQYNTdXF4CFBbXwUz/ +yt9QFDYT9B5WT/12jeGAe653gtYS6OOi/+eAkGmzg1GlRnw6fOfn+HYNFDORST7z +4j0CIQDn2xz9hVWQEu9ee3vecNT3f60huDGTNoRhtqgweQGX0wIhAPSLj1VcRZEz +nKpbtU22+PbIMSJ+e80fmY9LIPx5N4HTAiAthGSimMR9bloz0EY3GyuUEyqoDgMd +hXxjuno2WesoJQIgemilbcALXpxsLmZLgcQ2KSmaVr7jb5ECx9R+hYKTw1sCIG4s +T+E0J8wlH24pgwQHzy7Ko2qLwn1b5PW8ecrlvP1g +-----END RSA PRIVATE KEY-----`)) + if err != nil { + t.Fatal(err) + } + done := make(chan struct{}) + go func() { + config := testConfig.Clone() + config.Certificates = []Certificate{cert} + config.MinVersion = VersionTLS13 + server := Server(serverConn, config) + err := server.Handshake() + if !strings.Contains(err.Error(), "key size too small for PSS signature") { + t.Errorf(`expected "key size too small for PSS signature", got %q`, err) + } + close(done) + }() + err = client.Handshake() + if !strings.Contains(err.Error(), "handshake failure") { + t.Errorf(`expected "handshake failure", got %q`, err) + } + <-done +} diff --git a/src/crypto/tls/handshake_server_tls13.go b/src/crypto/tls/handshake_server_tls13.go index 5f634b36aaf80..fd65ac1190990 100644 --- a/src/crypto/tls/handshake_server_tls13.go +++ b/src/crypto/tls/handshake_server_tls13.go @@ -635,7 +635,13 @@ func (hs *serverHandshakeStateTLS13) sendServerCertificate() error { } sig, err := hs.cert.PrivateKey.(crypto.Signer).Sign(c.config.rand(), h.Sum(nil), signOpts) if err != nil { - c.sendAlert(alertInternalError) + public := hs.cert.PrivateKey.(crypto.Signer).Public() + if rsaKey, ok := public.(*rsa.PublicKey); ok && sigType == signatureRSAPSS && + rsaKey.N.BitLen()/8 < sigHash.Size()*2+2 { // key too small for RSA-PSS + c.sendAlert(alertHandshakeFailure) + } else { + c.sendAlert(alertInternalError) + } return errors.New("tls: failed to sign handshake: " + err.Error()) } certVerifyMsg.signature = sig From e308807f658c11af52804d55c1b8c4b2cf80d3f3 Mon Sep 17 00:00:00 2001 From: Aaron Cannon Date: Sat, 27 Oct 2018 11:21:00 -0500 Subject: [PATCH 548/594] flag: improve docs for PrintDefaults; clarify how to change output destination The existing docs only mention that it is possible to change the output destination of PrintDefaults from the default of standard error, but fail to mention how to actually do so. This change fixes this lack by directing users to CommandLine.SetOutput. Fixes #15024 Change-Id: Ieaa7edbebd23d4ea6fa7e53d97a87143d590bdb3 Reviewed-on: https://go-review.googlesource.com/c/145203 Reviewed-by: Rob Pike --- src/flag/flag.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flag/flag.go b/src/flag/flag.go index 2eef9d6ab9ae2..c312c62a58215 100644 --- a/src/flag/flag.go +++ b/src/flag/flag.go @@ -548,6 +548,8 @@ func (f *FlagSet) PrintDefaults() { // the output will be // -I directory // search directory for include files. +// +// To change the destination for flag messages, call CommandLine.SetOutput. func PrintDefaults() { CommandLine.PrintDefaults() } From 8e50e48f4ddd434b848240837a02a487d502b3ee Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 20 Jan 2019 19:14:58 +0100 Subject: [PATCH 549/594] cmd/cgo: remove duplicate entry from gofmtLineReplacer CL 158457 added a duplicate entry for the ",\n" -> "," replacement to gofmtLineReplacer. Remove the duplicate. Change-Id: I17684fcd19cbc96fa7a7b53bf7c1a6382bf1114f Reviewed-on: https://go-review.googlesource.com/c/158619 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/cgo/godefs.go | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cmd/cgo/godefs.go b/src/cmd/cgo/godefs.go index 7185ea0de7db0..64384a606b261 100644 --- a/src/cmd/cgo/godefs.go +++ b/src/cmd/cgo/godefs.go @@ -151,7 +151,6 @@ var gofmtLineReplacer = strings.NewReplacer( "<\n", "<", ">\n", ">", "=\n", "=", - ",\n", ",", "\n", ";", ) From cad6d1fef5147d31e94ee83934c8609d3ad150b7 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 21 Jan 2019 16:12:46 +0100 Subject: [PATCH 550/594] doc/go1.12.html: document rejection of mangled C names Change-Id: I27ef49815f55a36379b730b77f7e9a4dd5341507 Reviewed-on: https://go-review.googlesource.com/c/158777 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 0a998c06e01ae..dddf44b520a52 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -139,6 +139,12 @@

    Cgo

    for more information.

    +

    + Mangled C names are no longer accepted in packages that use Cgo. Use the Cgo + names instead. For example, use the documented cgo name C.char + rather than the mangled name _Ctype_char that cgo generates. +

    +

    Modules

    From 8d2e65d22408e9e1c6329485baf432be9300f410 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Mon, 21 Jan 2019 13:50:22 -0500 Subject: [PATCH 551/594] cmd/go: copy missing bit of documentation about code generated comment This CL attempts to restore the clarity of the original specification at https://golang.org/s/generatedcode that the line may appear anywhere. It is preferable (for human readability), and most common for it to be early in the file, but that is merely a convention, not a strict well-specified requirement. Document it as so. Background Issue #13560 was a proposal define a standard for marking files as generated, one that is suitable to be recognized both by humans and machine tools. It was accepted, and the final specification was documented at https://golang.org/s/generatedcode. Its text, copied exactly: Generated files are marked by a line of text that matches the regular expression, in Go syntax: ^// Code generated .* DO NOT EDIT\.$ The .* means the tool can put whatever folderol it wants in there, but the comment must be a single line and must start with Code generated and end with DO NOT EDIT., with a period. The text may appear anywhere in the file. The https://golang.org/s/generatedcode link points to a comment in a very large GitHub issue. That makes it harder to find. Issue #25433 was opened about moving that information somewhere else. It was resolved via CL 118756, which added text to cmd/go documentation at https://golang.org/cmd/go/#hdr-Generate_Go_files_by_processing_source: To convey to humans and machine tools that code is generated, generated source should have a line early in the file that matches the following regular expression (in Go syntax): ^// Code generated .* DO NOT EDIT\.$ The CL description noted that "This change merely moves that information to a more visible place." The intention was to preserve the specification unmodified. The original specification was very clear that "The text may appear anywhere in the file." The new text in cmd/go documentation wasn't very clear. "A line early in the file" is not a precise enough criteria to be recognized by a machine tool, because there isn't a precise definition of what lines are "early in the file". Updates #13560 Updates #25433 Updates #28089 Change-Id: I4e374163b16c3f972f9591ec2647fd3d5a2dd5ae Reviewed-on: https://go-review.googlesource.com/c/158817 Reviewed-by: Rob Pike --- src/cmd/go/alldocs.go | 7 +++++-- src/cmd/go/internal/generate/generate.go | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 5a6a1c82cce01..03a0e4f19de43 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -442,11 +442,14 @@ // command alias, described below. // // To convey to humans and machine tools that code is generated, -// generated source should have a line early in the file that -// matches the following regular expression (in Go syntax): +// generated source should have a line that matches the following +// regular expression (in Go syntax): // // ^// Code generated .* DO NOT EDIT\.$ // +// The line may appear anywhere in the file, but is typically +// placed near the beginning so it is easy to find. +// // Note that go generate does not parse the file, so lines that look // like directives in comments or multiline strings will be treated // as directives. diff --git a/src/cmd/go/internal/generate/generate.go b/src/cmd/go/internal/generate/generate.go index 7cbc448e6dd7c..124dbc05f5d8f 100644 --- a/src/cmd/go/internal/generate/generate.go +++ b/src/cmd/go/internal/generate/generate.go @@ -49,11 +49,14 @@ that can be run locally. It must either be in the shell path command alias, described below. To convey to humans and machine tools that code is generated, -generated source should have a line early in the file that -matches the following regular expression (in Go syntax): +generated source should have a line that matches the following +regular expression (in Go syntax): ^// Code generated .* DO NOT EDIT\.$ +The line may appear anywhere in the file, but is typically +placed near the beginning so it is easy to find. + Note that go generate does not parse the file, so lines that look like directives in comments or multiline strings will be treated as directives. From ef82ecd0f604f6323bcca6fc06ccd3ac94982c60 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Sun, 20 Jan 2019 16:18:04 -0500 Subject: [PATCH 552/594] crypto/subtle: normalize constant time ops docs ConstantTimeCompare is fairly useless if you can't rely on it being zero when the slices are different, but thankfully it has that property thanks to the final ConstantTimeByteEq. Change-Id: Id51100ed7d8237abbbb15778a259065b162a48ad Reviewed-on: https://go-review.googlesource.com/c/158643 Reviewed-by: Brad Fitzpatrick Reviewed-by: Adam Langley --- src/crypto/subtle/constant_time.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crypto/subtle/constant_time.go b/src/crypto/subtle/constant_time.go index 9f5fee87e3fc4..7c3cf05c462c4 100644 --- a/src/crypto/subtle/constant_time.go +++ b/src/crypto/subtle/constant_time.go @@ -6,9 +6,9 @@ // code but require careful thought to use correctly. package subtle -// ConstantTimeCompare returns 1 if and only if the two slices, x -// and y, have equal contents. The time taken is a function of the length of -// the slices and is independent of the contents. +// ConstantTimeCompare returns 1 if the two slices, x and y, have equal contents +// and 0 otherwise. The time taken is a function of the length of the slices and +// is independent of the contents. func ConstantTimeCompare(x, y []byte) int { if len(x) != len(y) { return 0 @@ -23,7 +23,7 @@ func ConstantTimeCompare(x, y []byte) int { return ConstantTimeByteEq(v, 0) } -// ConstantTimeSelect returns x if v is 1 and y if v is 0. +// ConstantTimeSelect returns x if v == 1 and y if v == 0. // Its behavior is undefined if v takes any other value. func ConstantTimeSelect(v, x, y int) int { return ^(v-1)&x | (v-1)&y } From 1fb596143cd47145c8cee0c1c5ed5e871feeb2b1 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 22 Jan 2019 13:49:47 -0800 Subject: [PATCH 553/594] cmd/compile: don't bother compiling functions named "_" They can't be used, so we don't need code generated for them. We just need to report errors in their bodies. This is the minimal CL for 1.12. For 1.13, CL 158845 will remove a bunch of special cases sprinkled about the compiler to handle "_" functions, which should (after this CL) be unnecessary. Update #29870 Change-Id: Iaa1c194bd0017dffdce86589fe2d36726ee83c13 Reviewed-on: https://go-review.googlesource.com/c/158820 Run-TryBot: Keith Randall Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/cmd/compile/internal/gc/pgen.go | 8 ++++++++ test/fixedbugs/issue29870.go | 15 +++++++++++++++ test/fixedbugs/issue29870b.go | 14 ++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 test/fixedbugs/issue29870.go create mode 100644 test/fixedbugs/issue29870b.go diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index 63e586095052f..1dc4b5342716b 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -243,6 +243,14 @@ func compile(fn *Node) { // From this point, there should be no uses of Curfn. Enforce that. Curfn = nil + if fn.funcname() == "_" { + // We don't need to generate code for this function, just report errors in its body. + // At this point we've generated any errors needed. + // (Beyond here we generate only non-spec errors, like "stack frame too large".) + // See issue 29870. + return + } + // Set up the function's LSym early to avoid data races with the assemblers. fn.Func.initLSym(true) diff --git a/test/fixedbugs/issue29870.go b/test/fixedbugs/issue29870.go new file mode 100644 index 0000000000000..b79860ca2bb9e --- /dev/null +++ b/test/fixedbugs/issue29870.go @@ -0,0 +1,15 @@ +// compile + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure we can compile "_" functions without crashing. + +package main + +import "log" + +func _() { + log.Println("%2F") +} diff --git a/test/fixedbugs/issue29870b.go b/test/fixedbugs/issue29870b.go new file mode 100644 index 0000000000000..1bac566bbbfd5 --- /dev/null +++ b/test/fixedbugs/issue29870b.go @@ -0,0 +1,14 @@ +// errorcheck + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure we're compiling "_" functions at least enough +// to get to an error which is generated during walk. + +package main + +func _() { + x := 7 // ERROR "x declared and not used" +} From cd06b2d00de0e62b26811b38530ffa29a0df4b1e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 23 Jan 2019 15:05:16 +0100 Subject: [PATCH 554/594] A+C: change email address for Elias Naur Change-Id: I0eefaed645d5d1f56c408af496c92dbb799977c8 Reviewed-on: https://go-review.googlesource.com/c/159037 Run-TryBot: Elias Naur TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- AUTHORS | 2 +- CONTRIBUTORS | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index e754fec012199..8b8105b1ade37 100644 --- a/AUTHORS +++ b/AUTHORS @@ -418,7 +418,7 @@ Eivind Uggedal Elbert Fliek Eldar Rakhimberdin Elena Grahovac -Elias Naur +Elias Naur Elliot Morrison-Reed Emerson Lin Emil Hessman diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d1be11e39202d..872d11233e55a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -575,7 +575,7 @@ Eivind Uggedal Elbert Fliek Eldar Rakhimberdin Elena Grahovac -Elias Naur +Elias Naur Elliot Morrison-Reed Emerson Lin Emil Hessman From 4edea0f0a77b341ec565d848e453c4a854418e8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Thu, 10 Jan 2019 23:42:53 +0000 Subject: [PATCH 555/594] doc: mention 'go get golang.org/dl/...' in install I needed Go 1.10 to debug and fix a test failure on that Go version in x/tools, but I forgot what the magic 'go get' command for this was. Googling "download specific golang version" and similar keywords showed no results, presumably because the golang.org/dl subrepo isn't prominently recommended nor documented anywhere. The most appropriate documentation page to add this to is doc/install, since it goes into some detail and is well indexed. We only need a short section to introduce the trick. The example does mention a specific version, Go 1.10.7, but I couldn't imagine a way to make it version-agnostic while still being clear on what the commands effectively do. Change-Id: I13158564d76d95caec412cdb35a50a4356df5863 Reviewed-on: https://go-review.googlesource.com/c/157457 Reviewed-by: Brad Fitzpatrick Reviewed-by: Rob Pike --- doc/install.html | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/doc/install.html b/doc/install.html index 2e0c7f859d82c..ab192031c46d4 100644 --- a/doc/install.html +++ b/doc/install.html @@ -271,6 +271,39 @@

    Test your installation

    +

    Installing extra Go versions

    + +

    +It may be useful to have multiple Go versions installed on the same machine, for +example, to ensure that a package's tests pass on multiple Go versions. +Once you have one Go version installed, you can install another (such as 1.10.7) +as follows: +

    + +
    +$ go get golang.org/dl/go1.10.7
    +$ go1.10.7 download
    +
    + +

    +The newly downloaded version can be used like go: +

    + +
    +$ go1.10.7 version
    +go version go1.10.7 linux/amd64
    +
    + +

    +All Go versions available via this method are listed on +the download page. +You can find where each of these extra Go versions is installed by looking +at its GOROOT; for example, go1.10.7 env GOROOT. +To uninstall a downloaded version, just remove its GOROOT directory +and the goX.Y.Z binary. +

    + +

    Uninstalling Go

    From 829c5df58694b3345cb5ea41206783c8ccf5c3ca Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 23 Jan 2019 19:09:07 +0000 Subject: [PATCH 556/594] net/url, net/http: reject control characters in URLs This is a more conservative version of the reverted CL 99135 (which was reverted in CL 137716) The net/url part rejects URLs with ASCII CTLs from being parsed and the net/http part rejects writing them if a bogus url.URL is constructed otherwise. Updates #27302 Updates #22907 Change-Id: I09a2212eb74c63db575223277aec363c55421ed8 Reviewed-on: https://go-review.googlesource.com/c/159157 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Filippo Valsorda --- src/net/http/fs_test.go | 15 +++++++++++---- src/net/http/http.go | 6 ++++++ src/net/http/request.go | 7 ++++++- src/net/http/requestwrite_test.go | 11 +++++++++++ src/net/url/url.go | 10 ++++++++++ src/net/url/url_test.go | 17 ++++++++++++++++- 6 files changed, 60 insertions(+), 6 deletions(-) diff --git a/src/net/http/fs_test.go b/src/net/http/fs_test.go index 255d215f3cfe0..762e88b05ff30 100644 --- a/src/net/http/fs_test.go +++ b/src/net/http/fs_test.go @@ -583,16 +583,23 @@ func TestFileServerZeroByte(t *testing.T) { ts := httptest.NewServer(FileServer(Dir("."))) defer ts.Close() - res, err := Get(ts.URL + "/..\x00") + c, err := net.Dial("tcp", ts.Listener.Addr().String()) if err != nil { t.Fatal(err) } - b, err := ioutil.ReadAll(res.Body) + defer c.Close() + _, err = fmt.Fprintf(c, "GET /..\x00 HTTP/1.0\r\n\r\n") + if err != nil { + t.Fatal(err) + } + var got bytes.Buffer + bufr := bufio.NewReader(io.TeeReader(c, &got)) + res, err := ReadResponse(bufr, nil) if err != nil { - t.Fatal("reading Body:", err) + t.Fatal("ReadResponse: ", err) } if res.StatusCode == 200 { - t.Errorf("got status 200; want an error. Body is:\n%s", string(b)) + t.Errorf("got status 200; want an error. Body is:\n%s", got.Bytes()) } } diff --git a/src/net/http/http.go b/src/net/http/http.go index 624b2cfe69567..5c03c16c873cd 100644 --- a/src/net/http/http.go +++ b/src/net/http/http.go @@ -59,6 +59,12 @@ func isASCII(s string) bool { return true } +// isCTL reports whether r is an ASCII control character, including +// the Extended ASCII control characters included in Unicode. +func isCTL(r rune) bool { + return r < ' ' || 0x7f <= r && r <= 0x9f +} + func hexEscapeNonASCII(s string) string { newLen := 0 for i := 0; i < len(s); i++ { diff --git a/src/net/http/request.go b/src/net/http/request.go index fb058f9fbf38f..01ba1dc1fb1fb 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -550,7 +550,12 @@ func (r *Request) write(w io.Writer, usingProxy bool, extraHeaders Header, waitF ruri = r.URL.Opaque } } - // TODO(bradfitz): escape at least newlines in ruri? + if strings.IndexFunc(ruri, isCTL) != -1 { + return errors.New("net/http: can't write control character in Request.URL") + } + // TODO: validate r.Method too? At least it's less likely to + // come from an attacker (more likely to be a constant in + // code). // Wrap the writer in a bufio Writer if it's not already buffered. // Don't always call NewWriter, as that forces a bytes.Buffer diff --git a/src/net/http/requestwrite_test.go b/src/net/http/requestwrite_test.go index 7dbf0d4e8a175..b110b57b1ab92 100644 --- a/src/net/http/requestwrite_test.go +++ b/src/net/http/requestwrite_test.go @@ -576,6 +576,17 @@ var reqWriteTests = []reqWriteTest{ "User-Agent: Go-http-client/1.1\r\n" + "X-Foo: X-Bar\r\n\r\n", }, + + 25: { + Req: Request{ + Method: "GET", + URL: &url.URL{ + Host: "www.example.com", + RawQuery: "new\nline", // or any CTL + }, + }, + WantError: errors.New("net/http: can't write control character in Request.URL"), + }, } func TestRequestWrite(t *testing.T) { diff --git a/src/net/url/url.go b/src/net/url/url.go index d84c95adb0318..77078ade1bd96 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -513,6 +513,10 @@ func parse(rawurl string, viaRequest bool) (*URL, error) { var rest string var err error + if strings.IndexFunc(rawurl, isCTL) != -1 { + return nil, errors.New("net/url: invalid control character in URL") + } + if rawurl == "" && viaRequest { return nil, errors.New("empty url") } @@ -1134,3 +1138,9 @@ func validUserinfo(s string) bool { } return true } + +// isCTL reports whether r is an ASCII control character, including +// the Extended ASCII control characters included in Unicode. +func isCTL(r rune) bool { + return r < ' ' || 0x7f <= r && r <= 0x9f +} diff --git a/src/net/url/url_test.go b/src/net/url/url_test.go index 7c4ada245a7a3..43d77f090c96a 100644 --- a/src/net/url/url_test.go +++ b/src/net/url/url_test.go @@ -1738,12 +1738,27 @@ func TestNilUser(t *testing.T) { } func TestInvalidUserPassword(t *testing.T) { - _, err := Parse("http://us\ner:pass\nword@foo.com/") + _, err := Parse("http://user^:passwo^rd@foo.com/") if got, wantsub := fmt.Sprint(err), "net/url: invalid userinfo"; !strings.Contains(got, wantsub) { t.Errorf("error = %q; want substring %q", got, wantsub) } } +func TestRejectControlCharacters(t *testing.T) { + tests := []string{ + "http://foo.com/?foo\nbar", + "http\r://foo.com/", + "http://foo\x7f.com/", + } + for _, s := range tests { + _, err := Parse(s) + const wantSub = "net/url: invalid control character in URL" + if got := fmt.Sprint(err); !strings.Contains(got, wantSub) { + t.Errorf("Parse(%q) error = %q; want substring %q", s, got, wantSub) + } + } +} + var escapeBenchmarks = []struct { unescaped string query string From 1e450aa2f208046aab0628e024a70c5193559fe7 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 23 Jan 2019 20:35:37 +0000 Subject: [PATCH 557/594] net/http: update bundled http2 Updates bundled http2 to x/net git rev ed066c81e7 for: http2: Revert a closed stream cannot receive data https://golang.org/cl/153977 Updates golang/go#28204 Change-Id: I0a489e4e8a581a107970199f64f0fa9281982efe Reviewed-on: https://go-review.googlesource.com/c/159179 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Dmitri Shuralyov --- src/net/http/h2_bundle.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/net/http/h2_bundle.go b/src/net/http/h2_bundle.go index 676eebdfdf9e0..f714cbb9a138d 100644 --- a/src/net/http/h2_bundle.go +++ b/src/net/http/h2_bundle.go @@ -4852,7 +4852,7 @@ func (sc *http2serverConn) resetStream(se http2StreamError) { // processFrameFromReader processes the serve loop's read from readFrameCh from the // frame-reading goroutine. -// processFrameFromReader reports whether the connection should be kept open. +// processFrameFromReader returns whether the connection should be kept open. func (sc *http2serverConn) processFrameFromReader(res http2readFrameResult) bool { sc.serveG.check() err := res.err @@ -5157,12 +5157,6 @@ func (sc *http2serverConn) processData(f *http2DataFrame) error { // type PROTOCOL_ERROR." return http2ConnectionError(http2ErrCodeProtocol) } - // RFC 7540, sec 6.1: If a DATA frame is received whose stream is not in - // "open" or "half-closed (local)" state, the recipient MUST respond with a - // stream error (Section 5.4.2) of type STREAM_CLOSED. - if state == http2stateClosed { - return http2streamError(id, http2ErrCodeStreamClosed) - } if st == nil || state != http2stateOpen || st.gotTrailerHeader || st.resetQueued { // This includes sending a RST_STREAM if the stream is // in stateHalfClosedLocal (which currently means that From 193c16a3648b8670a762e925b6ac6e074f468a20 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 22 Jan 2019 16:02:41 -0500 Subject: [PATCH 558/594] crypto/elliptic: reduce subtraction term to prevent long busy loop If beta8 is unusually large, the addition loop might take a very long time to bring x3-beta8 back positive. This would lead to a DoS vulnerability in the implementation of the P-521 and P-384 elliptic curves that may let an attacker craft inputs to ScalarMult that consume excessive amounts of CPU. This fixes CVE-2019-6486. Fixes #29903 Change-Id: Ia969e8b5bf5ac4071a00722de9d5e4d856d8071a Reviewed-on: https://team-review.git.corp.google.com/c/399777 Reviewed-by: Adam Langley Reviewed-by: Julie Qiu Reviewed-on: https://go-review.googlesource.com/c/159218 Reviewed-by: Julie Qiu --- src/crypto/elliptic/elliptic.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/elliptic/elliptic.go b/src/crypto/elliptic/elliptic.go index 4fc2b5e5213af..c84657c5e3677 100644 --- a/src/crypto/elliptic/elliptic.go +++ b/src/crypto/elliptic/elliptic.go @@ -210,8 +210,9 @@ func (curve *CurveParams) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int, x3 := new(big.Int).Mul(alpha, alpha) beta8 := new(big.Int).Lsh(beta, 3) + beta8.Mod(beta8, curve.P) x3.Sub(x3, beta8) - for x3.Sign() == -1 { + if x3.Sign() == -1 { x3.Add(x3, curve.P) } x3.Mod(x3, curve.P) From 9d23975d89e6cc3df4f2156b2ae0df5d2cef16fb Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 17 Jan 2019 14:39:31 -0500 Subject: [PATCH 559/594] cmd/go/internal/modload: ensure that __debug_modinfo__ is not discarded during linking Fixes #28753 Updates #29628 Change-Id: I4a561be7d491a0d088e656b00151ae1bdbd16a84 Reviewed-on: https://go-review.googlesource.com/c/158357 Run-TryBot: Bryan C. Mills Reviewed-by: Brad Fitzpatrick Reviewed-by: Russ Cox --- src/cmd/go/internal/modload/build.go | 11 ++- src/cmd/go/testdata/script/mod_modinfo.txt | 85 +++++++++++++++++----- 2 files changed, 77 insertions(+), 19 deletions(-) diff --git a/src/cmd/go/internal/modload/build.go b/src/cmd/go/internal/modload/build.go index 10bea15fa3ef7..2a8be90b78f54 100644 --- a/src/cmd/go/internal/modload/build.go +++ b/src/cmd/go/internal/modload/build.go @@ -252,10 +252,19 @@ func findModule(target, path string) module.Version { func ModInfoProg(info string) []byte { // Inject a variable with the debug information as runtime/debug.modinfo, // but compile it in package main so that it is specific to the binary. - // No need to populate it in an init func; it will still work with go:linkname. + // + // The variable must be a literal so that it will have the correct value + // before the initializer for package main runs. + // + // We also want the value to be present even if runtime/debug.modinfo is + // otherwise unused in the rest of the program. Reading it in an init function + // suffices for now. + return []byte(fmt.Sprintf(`package main import _ "unsafe" //go:linkname __debug_modinfo__ runtime/debug.modinfo var __debug_modinfo__ = %q +var keepalive_modinfo = __debug_modinfo__ +func init() { keepalive_modinfo = __debug_modinfo__ } `, string(infoStart)+info+string(infoEnd))) } diff --git a/src/cmd/go/testdata/script/mod_modinfo.txt b/src/cmd/go/testdata/script/mod_modinfo.txt index f8ad18f1368a7..fb31f9e43b22d 100644 --- a/src/cmd/go/testdata/script/mod_modinfo.txt +++ b/src/cmd/go/testdata/script/mod_modinfo.txt @@ -7,34 +7,83 @@ cd x go mod edit -require=rsc.io/quote@v1.5.2 go mod edit -replace=rsc.io/quote@v1.5.2=rsc.io/quote@v1.0.0 -go run main.go - -stderr 'Hello, world.' +# Build a binary and ensure that it can output its own debug info. +# The debug info should be accessible before main starts (golang.org/issue/29628). +go build +exec ./x$GOEXE stderr 'mod\s+x\s+\(devel\)' stderr 'dep\s+rsc.io/quote\s+v1.5.2\s+' stderr '=>\s+rsc.io/quote\s+v1.0.0\s+h1:' +stderr 'Hello, world.' + +[short] skip + +# Build a binary that accesses its debug info by reading the binary directly +# (rather than through debug.ReadBuildInfo). +# The debug info should still be present (golang.org/issue/28753). +cd unused +go build +exec ./unused$GOEXE -- x/go.mod -- module x +-- x/lib/lib.go -- +// Package lib accesses runtime/debug.modinfo before package main's init +// functions have run. +package lib + +import "runtime/debug" + +func init() { + m, ok := debug.ReadBuildInfo() + if !ok { + panic("failed debug.ReadBuildInfo") + } + println("mod", m.Main.Path, m.Main.Version) + for _, d := range m.Deps { + println("dep", d.Path, d.Version, d.Sum) + if r := d.Replace; r != nil { + println("=>", r.Path, r.Version, r.Sum) + } + } +} + -- x/main.go -- package main -import "runtime/debug" -import "rsc.io/quote" +import ( + "rsc.io/quote" + _ "x/lib" +) func main() { - println(quote.Hello()) - - m, ok := debug.ReadBuildInfo() - if !ok { - panic("failed debug.ReadBuildInfo") - } - println("mod", m.Main.Path, m.Main.Version) - for _, d := range m.Deps { - println("dep", d.Path, d.Version, d.Sum) - if r := d.Replace; r != nil { - println("=>", r.Path, r.Version, r.Sum) - } - } + println(quote.Hello()) +} + +-- x/unused/main.go -- +// The unused binary does not access runtime/debug.modinfo. +package main + +import ( + "bytes" + "encoding/hex" + "io/ioutil" + "log" + "os" + + _ "rsc.io/quote" +) + +func main() { + b, err := ioutil.ReadFile(os.Args[0]) + if err != nil { + log.Fatal(err) + } + + infoStart, _ := hex.DecodeString("3077af0c9274080241e1c107e6d618e6") + if !bytes.Contains(b, infoStart) { + log.Fatal("infoStart not found in binary") + } + log.Println("ok") } From 8b7cf898af3ab21c9e07e5b24d59c16b9fcf295a Mon Sep 17 00:00:00 2001 From: yo-tak Date: Wed, 23 Jan 2019 00:11:33 +0900 Subject: [PATCH 560/594] cmd/compile, cmd/link: document more flags Fixes #26533 Change-Id: I5a48d667d474f3f222f9055e51131561a0cf45b6 Reviewed-on: https://go-review.googlesource.com/c/138757 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/compile/doc.go | 55 ++++++++++++++++++++++++++++++++++++++++-- src/cmd/link/doc.go | 21 ++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/doc.go b/src/cmd/compile/doc.go index e2a19d98c0be5..5291a8b0ebacf 100644 --- a/src/cmd/compile/doc.go +++ b/src/cmd/compile/doc.go @@ -44,8 +44,12 @@ Flags: Print compiler version and exit. -asmhdr file Write assembly header to file. + -buildid id + Record id as the build id in the export metadata. -blockprofile file Write block profile for the compilation to file. + -c int + Concurrency during compilation. Set 1 for no concurrency (default is 1). -complete Assume package has no non-Go components. -cpuprofile file @@ -54,8 +58,14 @@ Flags: Allow references to Go symbols in shared libraries (experimental). -e Remove the limit on the number of errors reported (default limit is 10). + -goversion string + Specify required go tool version of the runtime. + Exits when the runtime go version does not match goversion. -h Halt with a stack trace at the first error detected. + -importcfg file + Read import configuration from file. + In the file, set importmap, packagefile to specify import resolution. -importmap old=new Interpret import "old" as import "new" during compilation. The option may be repeated to add multiple mappings. @@ -74,6 +84,8 @@ Flags: object to usual output file (as specified by -o). Without this flag, the -o output is a combination of both linker and compiler input. + -m + Print optimization decisions. -memprofile file Write memory profile for the compilation to file. -memprofilerate rate @@ -93,11 +105,50 @@ Flags: Write a package (archive) file rather than an object file -race Compile with race detector enabled. + -s + Warn about composite literals that can be simplified. + -shared + Generate code that can be linked into a shared library. + -traceprofile file + Write an execution trace to file. -trimpath prefix Remove prefix from recorded source file paths. -There are also a number of debugging flags; run the command with no arguments -for a usage message. +Flags related to debugging information: + + -dwarf + Generate DWARF symbols. + -dwarflocationlists + Add location lists to DWARF in optimized mode. + -gendwarfinl int + Generate DWARF inline info records (default 2). + +Flags to debug the compiler itself: + + -E + Debug symbol export. + -K + Debug missing line numbers. + -d list + Print debug information about items in list. Try -d help for further information. + -live + Debug liveness analysis. + -v + Increase debug verbosity. + -% + Debug non-static initializers. + -W + Debug parse tree after type checking. + -f + Debug stack frames. + -i + Debug line number stack. + -j + Debug runtime-initialized variables. + -r + Debug generated wrappers. + -w + Debug type checking. Compiler Directives diff --git a/src/cmd/link/doc.go b/src/cmd/link/doc.go index 963d86a35fa28..219499be0a16a 100644 --- a/src/cmd/link/doc.go +++ b/src/cmd/link/doc.go @@ -43,8 +43,16 @@ Flags: or initialized to a constant string expression. -X will not work if the initializer makes a function call or refers to other variables. Note that before Go 1.5 this option took two separate arguments. + -a + Disassemble output. + -buildid id + Record id as Go toolchain build id. -buildmode mode Set build mode (default exe). + -c + Dump call graphs. + -compressdwarf + Compress DWARF if possible (default true). -cpuprofile file Write CPU profile to file. -d @@ -54,6 +62,10 @@ Flags: The dynamic header is on by default, even without any references to dynamic libraries, because many common system tools now assume the presence of the header. + -debugtramp int + Debug trampolines. + -dumpdep + Dump symbol dependency graph. -extar ar Set the external archive program (default "ar"). Used only for -buildmode=c-archive. @@ -65,9 +77,14 @@ Flags: Ignore version mismatch in the linked archives. -g Disable Go package data checks. + -importcfg file + Read import configuration from file. + In the file, set packagefile, packageshlib to specify import resolution. -installsuffix suffix Look for packages in $GOROOT/pkg/$GOOS_$GOARCH_suffix instead of $GOROOT/pkg/$GOOS_$GOARCH. + -k symbol + Set field tracking symbol. Use this flag when GOEXPERIMENT=fieldtrack is set. -libgcc file Set name of compiler support library. This is only used in internal link mode. @@ -85,6 +102,8 @@ Flags: Set runtime.MemProfileRate to rate. -msan Link with C/C++ memory sanitizer support. + -n + Dump symbol table. -o file Write output to file (default a.out, or a.out.exe on Windows). -pluginpath path @@ -100,6 +119,8 @@ Flags: -tmpdir dir Write temporary files to dir. Temporary files are only used in external linking mode. + -u + Reject unsafe packages. -v Print trace of linker operations. -w From 8c10ce164f5b0244f3e08424c13666801b7c5973 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 24 Jan 2019 18:36:00 -0800 Subject: [PATCH 561/594] cmd/go: mention that binary packages are going away Updates #28152 Fixes #29927 Change-Id: Iea692c90074d057a1733e98bca3928e8f3569585 Reviewed-on: https://go-review.googlesource.com/c/159557 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/cmd/go/alldocs.go | 16 ++++++++-------- src/cmd/go/internal/help/helpdoc.go | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 03a0e4f19de43..d5f63693124a8 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1598,14 +1598,14 @@ // line comment. See the go/build package documentation for // more details. // -// Non-test Go source files can also include a //go:binary-only-package -// comment, indicating that the package sources are included -// for documentation only and must not be used to build the -// package binary. This enables distribution of Go packages in -// their compiled form alone. Even binary-only packages require -// accurate import blocks listing required dependencies, so that -// those dependencies can be supplied when linking the resulting -// command. +// Through the Go 1.12 release, non-test Go source files can also include +// a //go:binary-only-package comment, indicating that the package +// sources are included for documentation only and must not be used to +// build the package binary. This enables distribution of Go packages in +// their compiled form alone. Even binary-only packages require accurate +// import blocks listing required dependencies, so that those +// dependencies can be supplied when linking the resulting command. +// Note that this feature is scheduled to be removed after the Go 1.12 release. // // // The go.mod file diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index 6545a43abe49d..c219a45d74948 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -636,14 +636,14 @@ at the first item in the file that is not a blank line or //-style line comment. See the go/build package documentation for more details. -Non-test Go source files can also include a //go:binary-only-package -comment, indicating that the package sources are included -for documentation only and must not be used to build the -package binary. This enables distribution of Go packages in -their compiled form alone. Even binary-only packages require -accurate import blocks listing required dependencies, so that -those dependencies can be supplied when linking the resulting -command. +Through the Go 1.12 release, non-test Go source files can also include +a //go:binary-only-package comment, indicating that the package +sources are included for documentation only and must not be used to +build the package binary. This enables distribution of Go packages in +their compiled form alone. Even binary-only packages require accurate +import blocks listing required dependencies, so that those +dependencies can be supplied when linking the resulting command. +Note that this feature is scheduled to be removed after the Go 1.12 release. `, } From 4e056ade247bdab4a328776e4516a06fe7f26259 Mon Sep 17 00:00:00 2001 From: GiantsLoveDeathMetal Date: Fri, 25 Jan 2019 02:07:03 +0000 Subject: [PATCH 562/594] sort: change let to let's Trivial typo Change-Id: I3804f365519453bfa19997f55ead34742ac1a9db GitHub-Last-Rev: 0e04e928d05121099b78a2cefc1cb7531f6a7650 GitHub-Pull-Request: golang/go#29930 Reviewed-on: https://go-review.googlesource.com/c/159479 Reviewed-by: Emmanuel Odeke --- src/sort/sort.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sort/sort.go b/src/sort/sort.go index 7282b26ec4b6f..dd5bb3762e364 100644 --- a/src/sort/sort.go +++ b/src/sort/sort.go @@ -131,7 +131,7 @@ func doPivot(data Interface, lo, hi int) (midlo, midhi int) { c-- } // If hi-c<3 then there are duplicates (by property of median of nine). - // Let be a bit more conservative, and set border to 5. + // Let's be a bit more conservative, and set border to 5. protect := hi-c < 5 if !protect && hi-c < (hi-lo)/4 { // Lets test some points for equality to pivot From d585f04fd39f86edaa2aafd776e9ad037d075396 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 26 Jan 2019 11:55:00 -0800 Subject: [PATCH 563/594] cmd/compile: base PPC64 trunc rules on final type, not op type Whether a truncation should become a MOVWreg or a MOVWZreg doesn't depend on the type of the operand, it depends on the type of the final result. If the final result is unsigned, we can use MOVWZreg. If the final result is signed, we can use MOVWreg. Checking the type of the operand does the wrong thing if truncating an unsigned value to a signed value, or vice-versa. Fixes #29943 Change-Id: Ia6fc7d006486fa02cffd0bec4d910bdd5b6365f8 Reviewed-on: https://go-review.googlesource.com/c/159760 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/ssa/gen/PPC64.rules | 6 +-- src/cmd/compile/internal/ssa/rewritePPC64.go | 42 +++++++++++--------- test/fixedbugs/issue29943.go | 28 +++++++++++++ 3 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 test/fixedbugs/issue29943.go diff --git a/src/cmd/compile/internal/ssa/gen/PPC64.rules b/src/cmd/compile/internal/ssa/gen/PPC64.rules index 24cee6f0a3a02..e5d5295908aab 100644 --- a/src/cmd/compile/internal/ssa/gen/PPC64.rules +++ b/src/cmd/compile/internal/ssa/gen/PPC64.rules @@ -930,11 +930,11 @@ (ZeroExt16to(32|64) x) -> (MOVHZreg x) (ZeroExt32to64 x) -> (MOVWZreg x) -(Trunc(16|32|64)to8 x) && isSigned(x.Type) -> (MOVBreg x) +(Trunc(16|32|64)to8 x) && isSigned(t) -> (MOVBreg x) (Trunc(16|32|64)to8 x) -> (MOVBZreg x) -(Trunc(32|64)to16 x) && isSigned(x.Type) -> (MOVHreg x) +(Trunc(32|64)to16 x) && isSigned(t) -> (MOVHreg x) (Trunc(32|64)to16 x) -> (MOVHZreg x) -(Trunc64to32 x) && isSigned(x.Type) -> (MOVWreg x) +(Trunc64to32 x) && isSigned(t) -> (MOVWreg x) (Trunc64to32 x) -> (MOVWZreg x) (Slicemask x) -> (SRADconst (NEG x) [63]) diff --git a/src/cmd/compile/internal/ssa/rewritePPC64.go b/src/cmd/compile/internal/ssa/rewritePPC64.go index d06953bafa9a4..fdb34aec0aab0 100644 --- a/src/cmd/compile/internal/ssa/rewritePPC64.go +++ b/src/cmd/compile/internal/ssa/rewritePPC64.go @@ -30296,12 +30296,13 @@ func rewriteValuePPC64_OpTrunc_0(v *Value) bool { } } func rewriteValuePPC64_OpTrunc16to8_0(v *Value) bool { - // match: (Trunc16to8 x) - // cond: isSigned(x.Type) + // match: (Trunc16to8 x) + // cond: isSigned(t) // result: (MOVBreg x) for { + t := v.Type x := v.Args[0] - if !(isSigned(x.Type)) { + if !(isSigned(t)) { break } v.reset(OpPPC64MOVBreg) @@ -30319,12 +30320,13 @@ func rewriteValuePPC64_OpTrunc16to8_0(v *Value) bool { } } func rewriteValuePPC64_OpTrunc32to16_0(v *Value) bool { - // match: (Trunc32to16 x) - // cond: isSigned(x.Type) + // match: (Trunc32to16 x) + // cond: isSigned(t) // result: (MOVHreg x) for { + t := v.Type x := v.Args[0] - if !(isSigned(x.Type)) { + if !(isSigned(t)) { break } v.reset(OpPPC64MOVHreg) @@ -30342,12 +30344,13 @@ func rewriteValuePPC64_OpTrunc32to16_0(v *Value) bool { } } func rewriteValuePPC64_OpTrunc32to8_0(v *Value) bool { - // match: (Trunc32to8 x) - // cond: isSigned(x.Type) + // match: (Trunc32to8 x) + // cond: isSigned(t) // result: (MOVBreg x) for { + t := v.Type x := v.Args[0] - if !(isSigned(x.Type)) { + if !(isSigned(t)) { break } v.reset(OpPPC64MOVBreg) @@ -30365,12 +30368,13 @@ func rewriteValuePPC64_OpTrunc32to8_0(v *Value) bool { } } func rewriteValuePPC64_OpTrunc64to16_0(v *Value) bool { - // match: (Trunc64to16 x) - // cond: isSigned(x.Type) + // match: (Trunc64to16 x) + // cond: isSigned(t) // result: (MOVHreg x) for { + t := v.Type x := v.Args[0] - if !(isSigned(x.Type)) { + if !(isSigned(t)) { break } v.reset(OpPPC64MOVHreg) @@ -30388,12 +30392,13 @@ func rewriteValuePPC64_OpTrunc64to16_0(v *Value) bool { } } func rewriteValuePPC64_OpTrunc64to32_0(v *Value) bool { - // match: (Trunc64to32 x) - // cond: isSigned(x.Type) + // match: (Trunc64to32 x) + // cond: isSigned(t) // result: (MOVWreg x) for { + t := v.Type x := v.Args[0] - if !(isSigned(x.Type)) { + if !(isSigned(t)) { break } v.reset(OpPPC64MOVWreg) @@ -30411,12 +30416,13 @@ func rewriteValuePPC64_OpTrunc64to32_0(v *Value) bool { } } func rewriteValuePPC64_OpTrunc64to8_0(v *Value) bool { - // match: (Trunc64to8 x) - // cond: isSigned(x.Type) + // match: (Trunc64to8 x) + // cond: isSigned(t) // result: (MOVBreg x) for { + t := v.Type x := v.Args[0] - if !(isSigned(x.Type)) { + if !(isSigned(t)) { break } v.reset(OpPPC64MOVBreg) diff --git a/test/fixedbugs/issue29943.go b/test/fixedbugs/issue29943.go new file mode 100644 index 0000000000000..ff47de55d524e --- /dev/null +++ b/test/fixedbugs/issue29943.go @@ -0,0 +1,28 @@ +// run + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code was miscompiled on ppc64le due to incorrect zero-extension +// that was CSE'd. + +package main + +//go:noinline +func g(i uint64) uint64 { + return uint64(uint32(i)) +} + +var sink uint64 + +func main() { + for i := uint64(0); i < 1; i++ { + i32 := int32(i - 1) + sink = uint64((uint32(i32) << 1) ^ uint32((i32 >> 31))) + x := g(uint64(i32)) + if x != uint64(uint32(i32)) { + panic(x) + } + } +} From eafe9a186c84dcfb7db1038cc43d1f0dfd1ea781 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 25 Jan 2019 10:21:40 -0800 Subject: [PATCH 564/594] cmd/compile: hide init functions in tracebacks Treat compiler-generated init functions as wrappers, so they will not be shown in tracebacks. The exception to this rule is that we'd like to show the line number of initializers for global variables in tracebacks. In order to preserve line numbers for those cases, separate out the code for those initializers into a separate function (which is not marked as autogenerated). This CL makes the go binary 0.2% bigger. Fixes #29919 Change-Id: I0f1fbfc03d10d764ce3a8ddb48fb387ca8453386 Reviewed-on: https://go-review.googlesource.com/c/159717 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/compile/internal/gc/init.go | 32 +++++++++++- src/cmd/internal/objabi/funcid.go | 2 +- test/fixedbugs/issue29919.dir/a.go | 75 +++++++++++++++++++++++++++ test/fixedbugs/issue29919.dir/main.go | 10 ++++ test/fixedbugs/issue29919.go | 9 ++++ 5 files changed, 125 insertions(+), 3 deletions(-) create mode 100644 test/fixedbugs/issue29919.dir/a.go create mode 100644 test/fixedbugs/issue29919.dir/main.go create mode 100644 test/fixedbugs/issue29919.go diff --git a/src/cmd/compile/internal/gc/init.go b/src/cmd/compile/internal/gc/init.go index ae8748807547f..e981f836537fc 100644 --- a/src/cmd/compile/internal/gc/init.go +++ b/src/cmd/compile/internal/gc/init.go @@ -57,6 +57,9 @@ func anyinit(n []*Node) bool { // fninit hand-crafts package initialization code. // +// func init.ializers() { (0) +// +// } // var initdone· uint8 (1) // func init() { (2) // if initdone· > 1 { (3) @@ -68,7 +71,7 @@ func anyinit(n []*Node) bool { // initdone· = 1 (5) // // over all matching imported symbols // .init() (6) -// { } (7) +// init.ializers() (7) // init.() // if any (8) // initdone· = 2 (9) // return (10) @@ -80,6 +83,27 @@ func fninit(n []*Node) { return } + // (0) + // Make a function that contains all the initialization statements. + // This is a separate function because we want it to appear in + // stack traces, where the init function itself does not. + var initializers *types.Sym + if len(nf) > 0 { + lineno = nf[0].Pos // prolog/epilog gets line number of first init stmt + initializers = lookup("init.ializers") + disableExport(initializers) + fn := dclfunc(initializers, nod(OTFUNC, nil, nil)) + fn.Nbody.Set(nf) + funcbody() + + fn = typecheck(fn, ctxStmt) + Curfn = fn + typecheckslice(nf, ctxStmt) + Curfn = nil + funccompile(fn) + lineno = autogeneratedPos + } + var r []*Node // (1) @@ -130,7 +154,11 @@ func fninit(n []*Node) { } // (7) - r = append(r, nf...) + if initializers != nil { + n := newname(initializers) + addvar(n, functype(nil, nil, nil), PFUNC) + r = append(r, nod(OCALL, n, nil)) + } // (8) diff --git a/src/cmd/internal/objabi/funcid.go b/src/cmd/internal/objabi/funcid.go index 1792df7cc1d0f..a30bc3fa05a6c 100644 --- a/src/cmd/internal/objabi/funcid.go +++ b/src/cmd/internal/objabi/funcid.go @@ -83,7 +83,7 @@ func GetFuncID(name, file string) FuncID { case "runtime.panicwrap": return FuncID_panicwrap } - if file == "" && !strings.HasSuffix(name, ".init") { + if file == "" { return FuncID_wrapper } if strings.HasPrefix(name, "runtime.call") { diff --git a/test/fixedbugs/issue29919.dir/a.go b/test/fixedbugs/issue29919.dir/a.go new file mode 100644 index 0000000000000..cfccc4aabb671 --- /dev/null +++ b/test/fixedbugs/issue29919.dir/a.go @@ -0,0 +1,75 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure tracebacks from initialization code are reported correctly. + +package a + +import ( + "fmt" + "runtime" + "strings" +) + +var x = f() // line 15 + +func f() int { + var b [4096]byte + n := runtime.Stack(b[:], false) // line 19 + s := string(b[:n]) + var pcs [10]uintptr + n = runtime.Callers(1, pcs[:]) // line 22 + + // Check the Stack results. + if debug { + println(s) + } + if strings.Contains(s, "autogenerated") { + panic("autogenerated code in traceback") + } + if !strings.Contains(s, "a.go:15") { + panic("missing a.go:15") + } + if !strings.Contains(s, "a.go:19") { + panic("missing a.go:19") + } + if !strings.Contains(s, "a.init.ializers") { + panic("missing a.init.ializers") + } + + // Check the CallersFrames results. + if debug { + iter := runtime.CallersFrames(pcs[:n]) + for { + f, more := iter.Next() + fmt.Printf("%s %s:%d\n", f.Function, f.File, f.Line) + if !more { + break + } + } + } + iter := runtime.CallersFrames(pcs[:n]) + f, more := iter.Next() + if f.Function != "a.f" || !strings.HasSuffix(f.File, "a.go") || f.Line != 22 { + panic(fmt.Sprintf("bad f %v\n", f)) + } + if !more { + panic("traceback truncated after f") + } + f, more = iter.Next() + if f.Function != "a.init.ializers" || !strings.HasSuffix(f.File, "a.go") || f.Line != 15 { + panic(fmt.Sprintf("bad init.ializers %v\n", f)) + } + if !more { + panic("traceback truncated after init.ializers") + } + f, _ = iter.Next() + if f.Function != "runtime.main" { + panic("runtime.main missing") + } + + return 0 +} + +const debug = false diff --git a/test/fixedbugs/issue29919.dir/main.go b/test/fixedbugs/issue29919.dir/main.go new file mode 100644 index 0000000000000..3e99ca891b55d --- /dev/null +++ b/test/fixedbugs/issue29919.dir/main.go @@ -0,0 +1,10 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import _ "./a" + +func main() { +} diff --git a/test/fixedbugs/issue29919.go b/test/fixedbugs/issue29919.go new file mode 100644 index 0000000000000..6d97592c11871 --- /dev/null +++ b/test/fixedbugs/issue29919.go @@ -0,0 +1,9 @@ +// rundir + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure tracebacks from initialization code are reported correctly. + +package ignored From 447965d4e008764a8635df6ca7d5d2e59c6d4229 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Fri, 25 Jan 2019 18:22:27 +1100 Subject: [PATCH 565/594] path/filepath: skip TestIssue29372 on windows, if /tmp has symilinks TestIssue29372 is broken on windows when temporary directory has symlink in its path. Adjust the test to use filepath.EvalSymlinks of temporary directory, instead of temporary directory on windows. This change is not a proper fix, but at least it makes TestIssue29372 pass on windows-arm. See issue for details. Updates #29746 Change-Id: I2af8ebb89da7cb9daf027a5e49e32ee22dbd0e3d Reviewed-on: https://go-review.googlesource.com/c/159578 Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/path/filepath/path_test.go | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/path/filepath/path_test.go b/src/path/filepath/path_test.go index cbddda88b6693..9c4c7ebedc3b4 100644 --- a/src/path/filepath/path_test.go +++ b/src/path/filepath/path_test.go @@ -1374,13 +1374,27 @@ func TestWalkSymlink(t *testing.T) { } func TestIssue29372(t *testing.T) { - f, err := ioutil.TempFile("", "issue29372") + tmpDir, err := ioutil.TempDir("", "TestIssue29372") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(tmpDir) + + if runtime.GOOS == "windows" { + // This test is broken on windows, if temporary directory + // is a symlink. See issue 29746. + // TODO(brainman): Remove this hack once issue #29746 is fixed. + tmpDir, err = filepath.EvalSymlinks(tmpDir) + if err != nil { + t.Fatal(err) + } + } + + path := filepath.Join(tmpDir, "file.txt") + err = ioutil.WriteFile(path, nil, 0644) if err != nil { t.Fatal(err) } - f.Close() - path := f.Name() - defer os.Remove(path) pathSeparator := string(filepath.Separator) tests := []string{ From c53aecaaeaf8992bf8cafa7c8729228d7e4d2fee Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Tue, 22 Jan 2019 13:44:32 -0800 Subject: [PATCH 566/594] doc: describe change to eliminate method expression wrappers from stack traces Change-Id: I824b42a1c1fdcee8712681ffc6316470761be065 Reviewed-on: https://go-review.googlesource.com/c/159858 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index dddf44b520a52..c34b473a39bb9 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -232,6 +232,23 @@

    Compiler toolchain

    +

    + Wrappers generated by the compiler to implement method expressions + are no longer reported + by runtime.CallersFrames + and runtime.Stack. They + are also not printed in panic stack traces. + + This change aligns the gc toolchain to match + the gccgo toolchain, which already elided such wrappers + from stack traces. + + Clients of these APIs might need to adjust for the missing + frames. For code that must interoperate between 1.11 and 1.12 + releases, you can replace the method expression x.M + with the function literal func (...) { x.M(...) } . +

    +

    The compiler now accepts a -lang flag to set the Go language version to use. For example, -lang=go1.8 causes the compiler to From c00595cec55526f30b84903d9472d7f63f9c447d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 28 Jan 2019 10:45:26 -0800 Subject: [PATCH 567/594] doc: mention init traceback change in Go 1.12 release notes Updates #29919 Change-Id: Ibf92c9957f71394f08c1203a29eae35a12021585 Reviewed-on: https://go-review.googlesource.com/c/159877 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick Reviewed-by: Keith Randall --- doc/go1.12.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index c34b473a39bb9..fd1f1a1f4c687 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -357,6 +357,14 @@

    Runtime

    overcounting of large heap allocations.

    +

    + Tracebacks, runtime.Caller, + and runtime.Callers no longer include + compiler-generated initialization functions. Doing a traceback + during the initialization of a global variable will now show a + function named PKG.init.ializers. +

    +

    Core library

    TLS 1.3

    From 66065c3115861c73b8804037a6d9d5986ffa9913 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 27 Jan 2019 21:03:32 -0500 Subject: [PATCH 568/594] cmd/link: fix confusing error on unresolved symbol Currently, if an assembly file includes a static reference to an undefined symbol, and another package also has an undefined reference to that symbol, the linker can report an error like: x: relocation target zero not defined for ABI0 (but is defined for ABI0) Since the symbol is referenced in another package, the code in ErrorUnresolved that looks for alternative ABI symbols finds that symbol in the symbol table, but doesn't check that it's actually defined, which is where the "but is defined for ABI0" comes from. The "not defined for ABI0" is because ErrorUnresolved failed to turn the static symbol's version back into an ABI, and it happened to print the zero value for an ABI. This CL fixes both of these problems. It explicitly maps the relocation version back to an ABI and detects if it can't be mapped back (e.g., because it's a static reference). Then, if it finds a symbol with a different ABI in the symbol table, it checks to make sure it's a definition, and not simply an unresolved reference. Fixes #29852. Change-Id: Ice45cc41c1907919ce5750f74588e8047eaa888c Reviewed-on: https://go-review.googlesource.com/c/159518 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/link/internal/ld/link.go | 19 +++++----- src/cmd/link/internal/sym/symbol.go | 10 ++++++ src/cmd/link/link_test.go | 55 +++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 9 deletions(-) diff --git a/src/cmd/link/internal/ld/link.go b/src/cmd/link/internal/ld/link.go index f3f1bba773a25..8ed5c6e27e900 100644 --- a/src/cmd/link/internal/ld/link.go +++ b/src/cmd/link/internal/ld/link.go @@ -113,15 +113,16 @@ func (ctxt *Link) ErrorUnresolved(s *sym.Symbol, r *sym.Reloc) { // Try to find symbol under another ABI. var reqABI, haveABI obj.ABI haveABI = ^obj.ABI(0) - for abi := obj.ABI(0); abi < obj.ABICount; abi++ { - v := sym.ABIToVersion(abi) - if v == -1 { - continue - } - if v == int(r.Sym.Version) { - reqABI = abi - } else if ctxt.Syms.ROLookup(r.Sym.Name, v) != nil { - haveABI = abi + reqABI, ok := sym.VersionToABI(int(r.Sym.Version)) + if ok { + for abi := obj.ABI(0); abi < obj.ABICount; abi++ { + v := sym.ABIToVersion(abi) + if v == -1 { + continue + } + if rs := ctxt.Syms.ROLookup(r.Sym.Name, v); rs != nil && rs.Type != sym.Sxxx { + haveABI = abi + } } } diff --git a/src/cmd/link/internal/sym/symbol.go b/src/cmd/link/internal/sym/symbol.go index 24b0d682c4b77..8b70d6184628b 100644 --- a/src/cmd/link/internal/sym/symbol.go +++ b/src/cmd/link/internal/sym/symbol.go @@ -68,6 +68,16 @@ func ABIToVersion(abi obj.ABI) int { return -1 } +func VersionToABI(v int) (obj.ABI, bool) { + switch v { + case SymVerABI0: + return obj.ABI0, true + case SymVerABIInternal: + return obj.ABIInternal, true + } + return ^obj.ABI(0), false +} + func (s *Symbol) String() string { if s.Version == 0 { return s.Name diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index 6ed751abb5f79..e0aae0288491c 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -6,6 +6,7 @@ import ( "os" "os/exec" "path/filepath" + "regexp" "strings" "testing" ) @@ -116,3 +117,57 @@ func TestIssue28429(t *testing.T) { // to compile the extra section. runGo("tool", "link", "main.a") } + +func TestUnresolved(t *testing.T) { + testenv.MustHaveGoBuild(t) + + tmpdir, err := ioutil.TempDir("", "unresolved-") + if err != nil { + t.Fatalf("failed to create temp dir: %v", err) + } + defer os.RemoveAll(tmpdir) + + write := func(name, content string) { + err := ioutil.WriteFile(filepath.Join(tmpdir, name), []byte(content), 0666) + if err != nil { + t.Fatal(err) + } + } + + // Test various undefined references. Because of issue #29852, + // this used to give confusing error messages because the + // linker would find an undefined reference to "zero" created + // by the runtime package. + + write("main.go", `package main + +func main() { + x() +} + +func x() +`) + write("main.s", ` +TEXT ·x(SB),0,$0 + MOVD zero<>(SB), AX + MOVD zero(SB), AX + MOVD ·zero(SB), AX + RET +`) + cmd := exec.Command(testenv.GoToolPath(t), "build") + cmd.Dir = tmpdir + cmd.Env = append(os.Environ(), []string{"GOARCH=amd64", "GOOS=linux"}...) + out, err := cmd.CombinedOutput() + if err == nil { + t.Fatalf("expected build to fail, but it succeeded") + } + out = regexp.MustCompile("(?m)^#.*\n").ReplaceAll(out, nil) + got := string(out) + want := `main.x: relocation target zero not defined +main.x: relocation target zero not defined +main.x: relocation target main.zero not defined +` + if want != got { + t.Fatalf("want:\n%sgot:\n%s", want, got) + } +} From df719d9809daa2abcbce6a24ee8183a84cccf094 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 28 Jan 2019 18:42:37 -0800 Subject: [PATCH 569/594] doc: go1.12: mention change in text/template user function panic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates #28242 Change-Id: Ib717b64f1f368cc889895a2437ff2943ed4eab0d Reviewed-on: https://go-review.googlesource.com/c/159998 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Daniel Martí --- doc/go1.12.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index fd1f1a1f4c687..2591218eda82b 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -882,6 +882,12 @@

    Minor changes to the library

    executing "tmpl" at <.very.deep.context.value.notpresent>: map has no entry for key "notpresent"

    +
    +

    + If a user-defined function called by a template panics, the + panic is now caught and returned as an error by + the Execute or ExecuteTemplate method. +

    unsafe
    From d34c0dbc17e61e9e7a15355e75b9578d7d024f52 Mon Sep 17 00:00:00 2001 From: kim yongbin Date: Thu, 27 Dec 2018 11:33:15 +0900 Subject: [PATCH 570/594] doc/go1.12: add notes about 'go doc -src' Change-Id: Iaf67fcbb145277327e24150b29ff38f6c65f6a03 Reviewed-on: https://go-review.googlesource.com/c/155781 Reviewed-by: Ian Lance Taylor --- doc/go1.12.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 2591218eda82b..3eab22a930539 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -299,6 +299,11 @@

    godoc and go doc

    as the godoc command line used to do.

    +

    + go doc also now includes the -src flag, + which will show the target's original source code. +

    +

    Trace

    From f1d662f34788f4a5f087581d0951cdf4e0f6e708 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 29 Jan 2019 17:22:36 +0000 Subject: [PATCH 571/594] net/url, net/http: relax CTL-in-URL validation to only ASCII CTLs CL 159157 was doing UTF-8 decoding of URLs. URLs aren't really UTF-8, even if sometimes they are in some contexts. Instead, only reject ASCII CTLs. Updates #27302 Updates #22907 Change-Id: Ibd64efa5d3a93263d175aadf1c9f87deb4670c62 Reviewed-on: https://go-review.googlesource.com/c/160178 Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/net/http/http.go | 13 +++++++++---- src/net/http/request.go | 2 +- src/net/url/url.go | 15 ++++++++++----- src/net/url/url_test.go | 6 ++++++ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/net/http/http.go b/src/net/http/http.go index 5c03c16c873cd..e5d59e14120ba 100644 --- a/src/net/http/http.go +++ b/src/net/http/http.go @@ -59,10 +59,15 @@ func isASCII(s string) bool { return true } -// isCTL reports whether r is an ASCII control character, including -// the Extended ASCII control characters included in Unicode. -func isCTL(r rune) bool { - return r < ' ' || 0x7f <= r && r <= 0x9f +// stringContainsCTLByte reports whether s contains any ASCII control character. +func stringContainsCTLByte(s string) bool { + for i := 0; i < len(s); i++ { + b := s[i] + if b < ' ' || b == 0x7f { + return true + } + } + return false } func hexEscapeNonASCII(s string) string { diff --git a/src/net/http/request.go b/src/net/http/request.go index 01ba1dc1fb1fb..dcad2b6fab366 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -550,7 +550,7 @@ func (r *Request) write(w io.Writer, usingProxy bool, extraHeaders Header, waitF ruri = r.URL.Opaque } } - if strings.IndexFunc(ruri, isCTL) != -1 { + if stringContainsCTLByte(ruri) { return errors.New("net/http: can't write control character in Request.URL") } // TODO: validate r.Method too? At least it's less likely to diff --git a/src/net/url/url.go b/src/net/url/url.go index 77078ade1bd96..64274a0a364d0 100644 --- a/src/net/url/url.go +++ b/src/net/url/url.go @@ -513,7 +513,7 @@ func parse(rawurl string, viaRequest bool) (*URL, error) { var rest string var err error - if strings.IndexFunc(rawurl, isCTL) != -1 { + if stringContainsCTLByte(rawurl) { return nil, errors.New("net/url: invalid control character in URL") } @@ -1139,8 +1139,13 @@ func validUserinfo(s string) bool { return true } -// isCTL reports whether r is an ASCII control character, including -// the Extended ASCII control characters included in Unicode. -func isCTL(r rune) bool { - return r < ' ' || 0x7f <= r && r <= 0x9f +// stringContainsCTLByte reports whether s contains any ASCII control character. +func stringContainsCTLByte(s string) bool { + for i := 0; i < len(s); i++ { + b := s[i] + if b < ' ' || b == 0x7f { + return true + } + } + return false } diff --git a/src/net/url/url_test.go b/src/net/url/url_test.go index 43d77f090c96a..c5fc90d5156fd 100644 --- a/src/net/url/url_test.go +++ b/src/net/url/url_test.go @@ -1757,6 +1757,12 @@ func TestRejectControlCharacters(t *testing.T) { t.Errorf("Parse(%q) error = %q; want substring %q", s, got, wantSub) } } + + // But don't reject non-ASCII CTLs, at least for now: + if _, err := Parse("http://foo.com/ctl\x80"); err != nil { + t.Errorf("error parsing URL with non-ASCII control byte: %v", err) + } + } var escapeBenchmarks = []struct { From eb72a30f8732037596f0a1ab75c6219a40d4cf7d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 29 Jan 2019 16:34:27 -0800 Subject: [PATCH 572/594] os: make openFdAt act like openFileNolog - add EINTR loop on Darwin - return PathError on error - call newFile rather than NewFile This tries to minimize the possibility of any future changes. It would be nice to put openFdAt in the same file as openFileNolog, but build tags forbid. Updates #29983 Change-Id: I866002416d6473fbfd80ff6ef09b2bc4607f2934 Reviewed-on: https://go-review.googlesource.com/c/160181 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Damien Neil --- src/os/file_unix.go | 1 + src/os/removeall_at.go | 31 ++++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/os/file_unix.go b/src/os/file_unix.go index 7d68a7659f5bc..2615df9d5b7cc 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -186,6 +186,7 @@ func epipecheck(file *File, e error) { const DevNull = "/dev/null" // openFileNolog is the Unix implementation of OpenFile. +// Changes here should be reflected in openFdAt, if relevant. func openFileNolog(name string, flag int, perm FileMode) (*File, error) { setSticky := false if !supportsCreateWithStickyBit && flag&O_CREATE != 0 && perm&ModeSticky != 0 { diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index f0fed6dc33f4c..faee1287f112b 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -9,6 +9,7 @@ package os import ( "internal/syscall/unix" "io" + "runtime" "syscall" ) @@ -128,11 +129,31 @@ func removeAllFrom(parent *File, path string) error { return unlinkError } -func openFdAt(fd int, path string) (*File, error) { - fd, err := unix.Openat(fd, path, O_RDONLY, 0) - if err != nil { - return nil, err +// openFdAt opens path relative to the directory in fd. +// Other than that this should act like openFileNolog. +// This acts like openFileNolog rather than OpenFile because +// we are going to (try to) remove the file. +// The contents of this file are not relevant for test caching. +func openFdAt(dirfd int, name string) (*File, error) { + var r int + for { + var e error + r, e = unix.Openat(dirfd, name, O_RDONLY, 0) + if e == nil { + break + } + + // See comment in openFileNolog. + if runtime.GOOS == "darwin" && e == syscall.EINTR { + continue + } + + return nil, &PathError{"openat", name, e} + } + + if !supportsCloseOnExec { + syscall.CloseOnExec(r) } - return NewFile(uintptr(fd), path), nil + return newFile(uintptr(r), name, kindOpenFile), nil } From da648eac67dded869cfb6af2c0661f21af064f02 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 29 Jan 2019 13:23:07 -0800 Subject: [PATCH 573/594] doc: remove meaningless word from Go 1.12 release notes Change-Id: I744940e2bbde19ccec53af6c5469d46ba9161f01 Reviewed-on: https://go-review.googlesource.com/c/160179 Reviewed-by: Brad Fitzpatrick Reviewed-by: Rob Pike --- doc/go1.12.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 3eab22a930539..20b3e343d1b80 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -301,7 +301,7 @@

    godoc and go doc

    go doc also now includes the -src flag, - which will show the target's original source code. + which will show the target's source code.

    Trace

    From ea27cd35fa07b874b3dff5d2f83dd401a361865e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 29 Jan 2019 16:36:25 -0800 Subject: [PATCH 574/594] os: restore RemoveAll docs by making a single copy Updates #29983 Change-Id: Ifdf8aa9c92e053374e301a4268d85e277c15f0b5 Reviewed-on: https://go-review.googlesource.com/c/160182 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/os/path.go | 8 ++++++++ src/os/removeall_at.go | 2 +- src/os/removeall_noat.go | 6 +----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/os/path.go b/src/os/path.go index 30cc6c8b9841e..104b7ceaf7dad 100644 --- a/src/os/path.go +++ b/src/os/path.go @@ -58,6 +58,14 @@ func MkdirAll(path string, perm FileMode) error { return nil } +// RemoveAll removes path and any children it contains. +// It removes everything it can but returns the first error +// it encounters. If the path does not exist, RemoveAll +// returns nil (no error). +func RemoveAll(path string) error { + return removeAll(path) +} + // endsWithDot reports whether the final component of path is ".". func endsWithDot(path string) bool { if path == "." { diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index faee1287f112b..fe8b1faf2b3f2 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -13,7 +13,7 @@ import ( "syscall" ) -func RemoveAll(path string) error { +func removeAll(path string) error { if path == "" { // fail silently to retain compatibility with previous behavior // of RemoveAll. See issue 28830. diff --git a/src/os/removeall_noat.go b/src/os/removeall_noat.go index 80527e227c996..5a7dc263f08f2 100644 --- a/src/os/removeall_noat.go +++ b/src/os/removeall_noat.go @@ -11,11 +11,7 @@ import ( "syscall" ) -// RemoveAll removes path and any children it contains. -// It removes everything it can but returns the first error -// it encounters. If the path does not exist, RemoveAll -// returns nil (no error). -func RemoveAll(path string) error { +func removeAll(path string) error { if path == "" { // fail silently to retain compatibility with previous behavior // of RemoveAll. See issue 28830. From 56c9f8e8cfecafda3bd9f58c6421cd253a770d54 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 29 Jan 2019 15:57:41 -0800 Subject: [PATCH 575/594] os: treat EACCES as a permission error in RemoveAll Fixes #29983 Change-Id: I24077bde991e621c23d00973b2a77bb3a18e4ae7 Reviewed-on: https://go-review.googlesource.com/c/160180 Run-TryBot: Ian Lance Taylor Reviewed-by: Damien Neil TryBot-Result: Gobot Gobot --- src/os/removeall_at.go | 17 ++++++--- src/os/removeall_test.go | 80 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 6 deletions(-) diff --git a/src/os/removeall_at.go b/src/os/removeall_at.go index fe8b1faf2b3f2..7f2d5922ae03c 100644 --- a/src/os/removeall_at.go +++ b/src/os/removeall_at.go @@ -57,8 +57,13 @@ func removeAllFrom(parent *File, path string) error { return nil } - // If not a "is directory" error, we have a problem - if err != syscall.EISDIR && err != syscall.EPERM { + // EISDIR means that we have a directory, and we need to + // remove its contents. + // EPERM or EACCES means that we don't have write permission on + // the parent directory, but this entry might still be a directory + // whose contents need to be removed. + // Otherwise just return the error. + if err != syscall.EISDIR && err != syscall.EPERM && err != syscall.EACCES { return err } @@ -69,11 +74,11 @@ func removeAllFrom(parent *File, path string) error { return statErr } if statInfo.Mode&syscall.S_IFMT != syscall.S_IFDIR { - // Not a directory; return the error from the Remove + // Not a directory; return the error from the Remove. return err } - // Remove the directory's entries + // Remove the directory's entries. var recurseErr error for { const request = 1024 @@ -88,7 +93,7 @@ func removeAllFrom(parent *File, path string) error { } names, readErr := file.Readdirnames(request) - // Errors other than EOF should stop us from continuing + // Errors other than EOF should stop us from continuing. if readErr != nil && readErr != io.EOF { file.Close() if IsNotExist(readErr) { @@ -117,7 +122,7 @@ func removeAllFrom(parent *File, path string) error { } } - // Remove the directory itself + // Remove the directory itself. unlinkError := unix.Unlinkat(parentFd, path, unix.AT_REMOVEDIR) if unlinkError == nil || IsNotExist(unlinkError) { return nil diff --git a/src/os/removeall_test.go b/src/os/removeall_test.go index 0f7dce078a6b0..9dab0d4bb1079 100644 --- a/src/os/removeall_test.go +++ b/src/os/removeall_test.go @@ -292,3 +292,83 @@ func TestRemoveReadOnlyDir(t *testing.T) { t.Error("subdirectory was not removed") } } + +// Issue #29983. +func TestRemoveAllButReadOnly(t *testing.T) { + switch runtime.GOOS { + case "nacl", "js", "windows": + t.Skipf("skipping test on %s", runtime.GOOS) + } + + if Getuid() == 0 { + t.Skip("skipping test when running as root") + } + + t.Parallel() + + tempDir, err := ioutil.TempDir("", "TestRemoveAllButReadOnly-") + if err != nil { + t.Fatal(err) + } + defer RemoveAll(tempDir) + + dirs := []string{ + "a", + "a/x", + "a/x/1", + "b", + "b/y", + "b/y/2", + "c", + "c/z", + "c/z/3", + } + readonly := []string{ + "b", + } + inReadonly := func(d string) bool { + for _, ro := range readonly { + if d == ro { + return true + } + dd, _ := filepath.Split(d) + if filepath.Clean(dd) == ro { + return true + } + } + return false + } + + for _, dir := range dirs { + if err := Mkdir(filepath.Join(tempDir, dir), 0777); err != nil { + t.Fatal(err) + } + } + for _, dir := range readonly { + d := filepath.Join(tempDir, dir) + if err := Chmod(d, 0555); err != nil { + t.Fatal(err) + } + + // Defer changing the mode back so that the deferred + // RemoveAll(tempDir) can succeed. + defer Chmod(d, 0777) + } + + if err := RemoveAll(tempDir); err == nil { + t.Fatal("RemoveAll succeeded unexpectedly") + } + + for _, dir := range dirs { + _, err := Stat(filepath.Join(tempDir, dir)) + if inReadonly(dir) { + if err != nil { + t.Errorf("file %q was deleted but should still exist", dir) + } + } else { + if err == nil { + t.Errorf("file %q still exists but should have been deleted", dir) + } + } + } +} From 3a91061504818fec41c3896de46ae61ff8709e94 Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Sat, 19 Jan 2019 18:24:32 +0100 Subject: [PATCH 576/594] doc: note go tool tour removal in 1.12 release notes Note the removal of the go tool tour command in the Go 1.12 release notes. Updates #24819 Change-Id: I258ab9401ea2cc06a83328c67299376fcf23c980 Reviewed-on: https://go-review.googlesource.com/c/158618 Reviewed-by: Brad Fitzpatrick Reviewed-by: Emmanuel Odeke Reviewed-by: Andrew Bonventre --- doc/go1.12.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index 20b3e343d1b80..fbe0c6a17cc5d 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -113,6 +113,18 @@

    go tool vet no longer supported

    +

    Tour

    + +

    +The Go tour is no longer included in the main binary distribution. To +run the tour locally, instead of running go tool tour, +manually install it: +

    +go install golang.org/x/tour
    +tour
    +
    +

    +

    Build cache requirement

    From 737695231de878dfdea127de1b995548785e3db0 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Tue, 29 Jan 2019 13:58:21 -0500 Subject: [PATCH 577/594] CONTRIBUTORS: second round of updates for Go 1.12 This update has been automatically generated using the updatecontrib command at CL 160277: cd gotip go run golang.org/x/build/cmd/updatecontrib Actions taken (relative to CONTRIBUTORS at origin/master): Added Aaron Cannon Added Andzej Maciusovic Added Douglas Danger Manley Added Federico Bond Added Frew Schmidt Added GitHub User @saitarunreddy (21041941) Added GitHub User @tell-k (26263) Added Guilherme Caruso Added Jay Taylor Added Juan Pablo Civile Added Julien Kauffmann Added Maya Rashish Added Parminder Singh Added Peter Dotchev Added Quinten Yearsley Added Ross Smith II Added Sean Chen Added Sebastiaan van Stijn Added Sebastian Schmidt Added Sebastien Williams-Wynn Added Viacheslav Poturaev Added Yohei Takeda Used GitHub User @saitarunreddy (21041941) form for saitarunreddy https://github.com/golang/build/commit/269e03a [build] Used GitHub User @tell-k (26263) form for tell-k https://github.com/golang/tools/commit/85a87a81 [tools] Used GitHub name "Akhil Indurti" for smasher164 https://github.com/golang/go/commit/a7af474359 [build go] Used GitHub name "Guilherme Caruso" for GuilhermeCaruso https://github.com/golang/go/commit/5fae09b738 [go] Used GitHub name "Ivan Markin" for nogoegst https://github.com/golang/go/commit/a1addf15df [go] Used GitHub name "Keiji Yoshida" for yosssi https://github.com/golang/lint/commit/ac6833c [lint] Used GitHub name "Marwan Sulaiman" for marwan-at-work https://github.com/golang/go/commit/92caeef892 [go] Used GitHub name "Michalis Kargakis" for kargakis https://github.com/golang/go/commit/e243d242d7 [go] Used GitHub name "Robin Eklind" for mewmew https://github.com/golang/go/commit/b8620afb8d [go proposal.git] Used GitHub name "Sean Chen" for two https://github.com/golang/sys/commit/302c3dd [sys] Used GitHub name "Sebastien Williams-Wynn" for GiantsLoveDeathMetal https://github.com/golang/go/commit/4e056ade24 [go] Used GitHub name "Yohei Takeda" for yo-tak https://github.com/golang/go/commit/8b7cf898af [go] Given that the scope of updatecontrib is only to add contributors to CONTRIBUTORS file, without having to check CLAs or deal with legal matters, we can relax the requirement of having a space in the name before it gets added to the CONTRIBUTORS file. That will be done in a later change. Updates #12042 Change-Id: I70248f3c82a836ee829256898e931e638ee45eb4 Reviewed-on: https://go-review.googlesource.com/c/160261 Reviewed-by: Brad Fitzpatrick --- CONTRIBUTORS | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 872d11233e55a..b201301a850eb 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -25,6 +25,7 @@ # Please keep the list sorted. Aamir Khan +Aaron Cannon Aaron France Aaron Jacobs Aaron Kemp @@ -188,6 +189,7 @@ Andy Finkenstadt Andy Lindeman Andy Maloney Andy Walker +Andzej Maciusovic Anfernee Yongkun Gui Angelo Bulfone Anh Hai Trinh @@ -553,6 +555,7 @@ Dong-hee Na Donovan Hide Doug Anderson Doug Fawley +Douglas Danger Manley Drew Flower Drew Hintz Duncan Holm @@ -633,6 +636,7 @@ Fannie Zhang Fatih Arslan Fazal Majid Fazlul Shahriar +Federico Bond Federico Simoncelli Fedor Indutny Felipe Oliveira @@ -661,6 +665,7 @@ Frederik Ring Fredrik Enestad Fredrik Forsmo Fredrik Wallgren +Frew Schmidt Frithjof Schulze Frits van Bommel Fumitoshi Ukai @@ -714,7 +719,9 @@ GitHub User @mkishere (224617) <224617+mkishere@users.noreply.github.com> GitHub User @OlgaVlPetrova (44112727) GitHub User @pityonline (438222) GitHub User @pytimer (17105586) +GitHub User @saitarunreddy (21041941) GitHub User @shogo-ma (9860598) +GitHub User @tell-k (26263) GitHub User @uhei (2116845) GitHub User @uropek (39370426) Giulio Iotti @@ -732,6 +739,7 @@ Greg Steuck Greg Ward Grégoire Delattre Gregory Man +Guilherme Caruso Guilherme Garnier Guilherme Goncalves Guilherme Rezende @@ -894,6 +902,7 @@ Jason Wangsadinata Javier Kohen Javier Segura Jay Conrod +Jay Taylor Jay Weisskopf Jean de Klerk Jean-André Santoni @@ -1019,6 +1028,7 @@ Jostein Stuhaug JP Sugarbroad JT Olds Juan Carlos +Juan Pablo Civile Jude Pereira Jukka-Pekka Kekkonen Julia Hansbrough @@ -1026,6 +1036,7 @@ Julian Kornberger Julian Pastarmov Julian Phillips Julie Qiu +Julien Kauffmann Julien Salleyron Julien Schmidt Julio Montes @@ -1281,6 +1292,7 @@ Maxim Ushakov Maxime de Roucy Máximo Cuadros Ortiz Maxwell Krohn +Maya Rashish Mayank Kumar Meir Fischer Meng Zhuo @@ -1457,6 +1469,7 @@ Pallat Anchaleechamaikorn Paolo Giarrusso Paolo Martini Parker Moore +Parminder Singh Pascal S. de Kloe Pat Moroney Patrick Crosby @@ -1503,6 +1516,7 @@ Peter Armitage Peter Bourgon Peter Collingbourne Peter Conerly +Peter Dotchev Peter Froehlich Peter Gonda Peter Hoyes @@ -1553,6 +1567,7 @@ Quentin Perez Quentin Renard Quentin Smith Quinn Slack +Quinten Yearsley Quoc-Viet Nguyen Radek Sohlich Radu Berinde @@ -1626,6 +1641,7 @@ Ron Hashimoto Ron Minnich Ross Chater Ross Light +Ross Smith II Rowan Marshall Rowan Worth Rudi Kramer @@ -1680,13 +1696,17 @@ Scott Mansfield Scott Schwartz Scott Van Woudenberg Sean Burford +Sean Chen Sean Chittenden Sean Christopherson Sean Dolphin Sean Harger Sean Rees +Sebastiaan van Stijn +Sebastian Schmidt Sebastien Binet Sébastien Paolacci +Sebastien Williams-Wynn Seiji Takahashi Sergei Skorobogatov Sergey 'SnakE' Gromov @@ -1889,6 +1909,7 @@ Val Polouchkine Vega Garcia Luis Alfonso Venil Noronha Veselkov Konstantin +Viacheslav Poturaev Victor Chudnovsky Victor Vrantchan Vignesh Ramachandra @@ -1962,6 +1983,7 @@ Yestin Sun Yesudeep Mangalapilly Yissakhar Z. Beck Yo-An Lin +Yohei Takeda Yongjian Xu Yorman Arias Yoshiyuki Kanno From f2a416b90ac68596ea05b97cefa8c72e7416e98f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 28 Jan 2019 12:31:55 -0800 Subject: [PATCH 578/594] cmd/cgo: disable GCC 9 warnings triggered by cgo code GCC 9 has started emitting warnings when taking the address of a field in a packed struct may cause a misaligned pointer. We use packed structs in cgo to ensure that our field layout matches the C compiler's layout. Our pointers are always aligned, so disable the warning Fixes #29962 Change-Id: I7e290a7cf694a2c2958529e340ebed9fcd62089c Reviewed-on: https://go-review.googlesource.com/c/159859 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- src/cmd/cgo/out.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 00e2f9769cd93..1a6f17cedd54e 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -776,6 +776,10 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) { fmt.Fprintf(fgcc, "#include \n") fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n\n") + // We use packed structs, but they are always aligned. + fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wpragmas\"\n") + fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Waddress-of-packed-member\"\n") + fmt.Fprintf(fgcc, "extern void crosscall2(void (*fn)(void *, int, __SIZE_TYPE__), void *, int, __SIZE_TYPE__);\n") fmt.Fprintf(fgcc, "extern __SIZE_TYPE__ _cgo_wait_runtime_init_done();\n") fmt.Fprintf(fgcc, "extern void _cgo_release_context(__SIZE_TYPE__);\n\n") @@ -1473,6 +1477,10 @@ __cgo_size_assert(double, 8) extern char* _cgo_topofstack(void); +/* We use packed structs, but they are always aligned. */ +#pragma GCC diagnostic ignored "-Wpragmas" +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" + #include #include ` From 8e093e7a1cd8a092f23717cb8f34bca489a3eee5 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Fri, 25 Jan 2019 17:40:40 +0000 Subject: [PATCH 579/594] runtime: scavenge memory upon allocating from scavenged memory Because scavenged and unscavenged spans no longer coalesce, memory that is freed no longer has a high likelihood of being re-scavenged. As a result, if an application is allocating at a fast rate, it may work fast enough to undo all the scavenging work performed by the runtime's current scavenging mechanisms. This behavior is exacerbated by the global best-fit allocation policy the runtime uses, since scavenged spans are just as likely to be chosen as unscavenged spans on average. To remedy that, we treat each allocation of scavenged space as a heap growth, and scavenge other memory to make up for the allocation. This change makes performance of the runtime slightly worse, as now we're scavenging more often during allocation. The regression is particularly obvious with the garbage benchmark (3%) but most of the Go1 benchmarks are within the margin of noise. A follow-up change should help. Garbage: https://perf.golang.org/search?q=upload:20190131.3 Go1: https://perf.golang.org/search?q=upload:20190131.2 Updates #14045. Change-Id: I44a7e6586eca33b5f97b6d40418db53a8a7ae715 Reviewed-on: https://go-review.googlesource.com/c/159500 Reviewed-by: Austin Clements --- src/runtime/mheap.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 1bf7bbecc0a5f..055dfeed99fc1 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -1190,6 +1190,16 @@ HaveSpan: // heap_released since we already did so earlier. sysUsed(unsafe.Pointer(s.base()), s.npages<<_PageShift) s.scavenged = false + + // Since we allocated out of a scavenged span, we just + // grew the RSS. Mitigate this by scavenging enough free + // space to make up for it. + // + // Also, scavengeLargest may cause coalescing, so prevent + // coalescing with s by temporarily changing its state. + s.state = mSpanManual + h.scavengeLargest(s.npages * pageSize) + s.state = mSpanFree } s.unusedsince = 0 From faf187fb8e2ca074711ed254c72ffbaed4383c64 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 29 Jan 2019 19:58:29 +0000 Subject: [PATCH 580/594] runtime: add credit system for scavenging When scavenging small amounts it's possible we over-scavenge by a significant margin since we choose to scavenge the largest spans first. This over-scavenging is never accounted for. With this change, we add a scavenge credit pool, similar to the reclaim credit pool. Any time scavenging triggered by RSS growth starts up, it checks if it can cash in some credit first. If after using all the credit it still needs to scavenge, then any extra it does it adds back into the credit pool. This change mitigates the performance impact of golang.org/cl/159500 on the Garbage benchmark. On Go1 it suggests some improvements, but most of that is within the realm of noise (Revcomp seems very sensitive to GC-related changes, both postively and negatively). Garbage: https://perf.golang.org/search?q=upload:20190131.5 Go1: https://perf.golang.org/search?q=upload:20190131.4 Performance change with both changes: Garbage: https://perf.golang.org/search?q=upload:20190131.7 Go1: https://perf.golang.org/search?q=upload:20190131.6 Change-Id: I87bd3c183e71656fdafef94714194b9fdbb77aa2 Reviewed-on: https://go-review.googlesource.com/c/160297 Reviewed-by: Austin Clements --- src/runtime/mheap.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/runtime/mheap.go b/src/runtime/mheap.go index 055dfeed99fc1..47e3a33391141 100644 --- a/src/runtime/mheap.go +++ b/src/runtime/mheap.go @@ -107,6 +107,14 @@ type mheap struct { // This is accessed atomically. reclaimCredit uintptr + // scavengeCredit is spare credit for extra bytes scavenged. + // Since the scavenging mechanisms operate on spans, it may + // scavenge more than requested. Any spare pages released + // go to this credit pool. + // + // This is protected by the mheap lock. + scavengeCredit uintptr + // Malloc stats. largealloc uint64 // bytes allocated for large objects nlargealloc uint64 // number of large object allocations @@ -165,7 +173,7 @@ type mheap struct { // simply blocking GC (by disabling preemption). sweepArenas []arenaIdx - _ uint32 // ensure 64-bit alignment of central + // _ uint32 // ensure 64-bit alignment of central // central free lists for small size classes. // the padding makes sure that the mcentrals are @@ -1349,6 +1357,14 @@ func (h *mheap) freeSpanLocked(s *mspan, acctinuse, acctidle bool, unusedsince i // starting from the largest span and working down. It then takes those spans // and places them in scav. h must be locked. func (h *mheap) scavengeLargest(nbytes uintptr) { + // Use up scavenge credit if there's any available. + if nbytes > h.scavengeCredit { + nbytes -= h.scavengeCredit + h.scavengeCredit = 0 + } else { + h.scavengeCredit -= nbytes + return + } // Iterate over the treap backwards (from largest to smallest) scavenging spans // until we've reached our quota of nbytes. released := uintptr(0) @@ -1377,6 +1393,10 @@ func (h *mheap) scavengeLargest(nbytes uintptr) { h.scav.insert(s) released += r } + // If we over-scavenged, turn that extra amount into credit. + if released > nbytes { + h.scavengeCredit += released - nbytes + } } // scavengeAll visits each node in the unscav treap and scavenges the From 6f4dc1ccf9735013fdb7cd044bda29d19bebb906 Mon Sep 17 00:00:00 2001 From: Yuval Pavel Zholkover Date: Fri, 1 Feb 2019 13:51:31 +0200 Subject: [PATCH 581/594] cmd/cgo: ignore unrecognized GCC warning group pragmas CL 159859 causes build failure with old clang versions (3.4.1) on FreeBSD 10.3/10.4. Update #29962 Update #27619 Change-Id: I78264ac5d8d17eeae89a982e89aac988eb22b286 Reviewed-on: https://go-review.googlesource.com/c/160777 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/cgo/out.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go index 1a6f17cedd54e..0cf8b174f8e5c 100644 --- a/src/cmd/cgo/out.go +++ b/src/cmd/cgo/out.go @@ -777,6 +777,9 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) { fmt.Fprintf(fgcc, "#include \"_cgo_export.h\"\n\n") // We use packed structs, but they are always aligned. + // The pragmas and address-of-packed-member are not recognized as warning groups in clang 3.4.1, so ignore unknown pragmas first. + // remove as part of #27619 (all: drop support for FreeBSD 10). + fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n") fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Wpragmas\"\n") fmt.Fprintf(fgcc, "#pragma GCC diagnostic ignored \"-Waddress-of-packed-member\"\n") @@ -1478,6 +1481,10 @@ __cgo_size_assert(double, 8) extern char* _cgo_topofstack(void); /* We use packed structs, but they are always aligned. */ +/* The pragmas and address-of-packed-member are not recognized as warning groups in clang 3.4.1, so ignore unknown pragmas first. */ +/* remove as part of #27619 (all: drop support for FreeBSD 10). */ + +#pragma GCC diagnostic ignored "-Wunknown-pragmas" #pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Waddress-of-packed-member" From 03a9f5a192149dc6f443eb0e1cee48cb4dd7e26f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 1 Feb 2019 06:22:00 -0800 Subject: [PATCH 582/594] doc: go1.12: update notes on go directive Fixes #30043 Change-Id: I4ecfff7d8a9432240c1927f7484786fe1182b773 Reviewed-on: https://go-review.googlesource.com/c/160797 Reviewed-by: Brad Fitzpatrick --- doc/go1.12.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index fbe0c6a17cc5d..e92d36838686d 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -181,10 +181,10 @@

    Modules

    The go directive in a go.mod file now indicates the - version of the language used by the files within that module, and - go mod tidy sets it to the - current release (go 1.12) if no existing - version is present. + version of the language used by the files within that module. + It will be set to the current release + (go 1.12) if no existing version is + present. If the go directive for a module specifies a version newer than the toolchain in use, the go command will attempt to build the packages regardless, and will note the mismatch only if From 7e987b7b332fb21b56418351ce942d892f07481b Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Thu, 31 Jan 2019 20:29:21 -0500 Subject: [PATCH 583/594] reflect: eliminate write barrier for copying result in callReflect We are copying the results to uninitialized stack space. Write barrier is not needed. Fixes #30041. Change-Id: Ia91d74dbafd96dc2bd92de0cb479808991dda03e Reviewed-on: https://go-review.googlesource.com/c/160737 Run-TryBot: Cherry Zhang Reviewed-by: Keith Randall --- src/reflect/value.go | 5 +-- test/fixedbugs/issue30041.go | 63 ++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 test/fixedbugs/issue30041.go diff --git a/src/reflect/value.go b/src/reflect/value.go index 7ae2dd8d10455..372b7a6dc8008 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -561,10 +561,11 @@ func callReflect(ctxt *makeFuncImpl, frame unsafe.Pointer, retValid *bool) { continue } addr := add(ptr, off, "typ.size > 0") + // We are writing to stack. No write barrier. if v.flag&flagIndir != 0 { - typedmemmove(typ, addr, v.ptr) + memmove(addr, v.ptr, typ.size) } else { - *(*unsafe.Pointer)(addr) = v.ptr + *(*uintptr)(addr) = uintptr(v.ptr) } off += typ.size } diff --git a/test/fixedbugs/issue30041.go b/test/fixedbugs/issue30041.go new file mode 100644 index 0000000000000..7d8a1698cbc28 --- /dev/null +++ b/test/fixedbugs/issue30041.go @@ -0,0 +1,63 @@ +// run + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Issue 30041: copying results of a reflect-generated +// call on stack should not have write barrier. + +package main + +import ( + "reflect" + "runtime" + "unsafe" +) + +var badPtr uintptr + +var sink []byte + +func init() { + // Allocate large enough to use largeAlloc. + b := make([]byte, 1<<16-1) + sink = b // force heap allocation + // Any space between the object and the end of page is invalid to point to. + badPtr = uintptr(unsafe.Pointer(&b[len(b)-1])) + 1 +} + +type ft func() *int + +var fn ft + +func rf([]reflect.Value) []reflect.Value { + a := reflect.ValueOf((*int)(nil)) + return []reflect.Value{a} +} + +const N = 1000 + +func main() { + fn = reflect.MakeFunc(reflect.TypeOf(fn), rf).Interface().(ft) + + // Keep running GC so the write barrier is on. + go func() { + for i := 0; i < N; i++ { + runtime.GC() + } + }() + + var x [10]uintptr + for i := range x { + x[i] = badPtr + } + for i := 0; i < N; i++ { + runtime.Gosched() + use(x) // prepare bad pointers on stack + fn() + } +} + +//go:noinline +func use([10]uintptr) {} From 8f854244ad5165c4ef9aa5760316b13233514e06 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 1 Feb 2019 15:27:53 -0800 Subject: [PATCH 584/594] cmd/compile: fix crash when memmove argument is not the right type Make sure the argument to memmove is of pointer type before we try to get the element type. This has been noticed for code that uses unsafe+linkname so it can call runtime.memmove. Probably not the best thing to allow, but the code is out there and we'd rather not break it unnecessarily. Fixes #30061 Change-Id: I334a8453f2e293959fd742044c43fbe93f0b3d31 Reviewed-on: https://go-review.googlesource.com/c/160826 Run-TryBot: Keith Randall Reviewed-by: Ian Lance Taylor TryBot-Result: Gobot Gobot --- .../compile/internal/ssa/gen/generic.rules | 1 + .../compile/internal/ssa/rewritegeneric.go | 8 ++++---- test/fixedbugs/issue30061.go | 20 +++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 test/fixedbugs/issue30061.go diff --git a/src/cmd/compile/internal/ssa/gen/generic.rules b/src/cmd/compile/internal/ssa/gen/generic.rules index 89fbfdc6bd76f..61451891a57e2 100644 --- a/src/cmd/compile/internal/ssa/gen/generic.rules +++ b/src/cmd/compile/internal/ssa/gen/generic.rules @@ -1354,6 +1354,7 @@ // Inline small or disjoint runtime.memmove calls with constant length. (StaticCall {sym} s1:(Store _ (Const(64|32) [sz]) s2:(Store _ src s3:(Store {t} _ dst mem)))) && isSameSym(sym,"runtime.memmove") + && t.(*types.Type).IsPtr() // avoids TUINTPTR, see issue 30061 && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst,src,sz,config) && clobber(s1) && clobber(s2) && clobber(s3) diff --git a/src/cmd/compile/internal/ssa/rewritegeneric.go b/src/cmd/compile/internal/ssa/rewritegeneric.go index 79f0fd434aee2..f2c7529e024f7 100644 --- a/src/cmd/compile/internal/ssa/rewritegeneric.go +++ b/src/cmd/compile/internal/ssa/rewritegeneric.go @@ -27397,7 +27397,7 @@ func rewriteValuegeneric_OpStaticCall_0(v *Value) bool { config := b.Func.Config _ = config // match: (StaticCall {sym} s1:(Store _ (Const64 [sz]) s2:(Store _ src s3:(Store {t} _ dst mem)))) - // cond: isSameSym(sym,"runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst,src,sz,config) && clobber(s1) && clobber(s2) && clobber(s3) + // cond: isSameSym(sym,"runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst,src,sz,config) && clobber(s1) && clobber(s2) && clobber(s3) // result: (Move {t.(*types.Type).Elem()} [sz] dst src mem) for { sym := v.Aux @@ -27425,7 +27425,7 @@ func rewriteValuegeneric_OpStaticCall_0(v *Value) bool { _ = s3.Args[2] dst := s3.Args[1] mem := s3.Args[2] - if !(isSameSym(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1) && clobber(s2) && clobber(s3)) { + if !(isSameSym(sym, "runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1) && clobber(s2) && clobber(s3)) { break } v.reset(OpMove) @@ -27437,7 +27437,7 @@ func rewriteValuegeneric_OpStaticCall_0(v *Value) bool { return true } // match: (StaticCall {sym} s1:(Store _ (Const32 [sz]) s2:(Store _ src s3:(Store {t} _ dst mem)))) - // cond: isSameSym(sym,"runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst,src,sz,config) && clobber(s1) && clobber(s2) && clobber(s3) + // cond: isSameSym(sym,"runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst,src,sz,config) && clobber(s1) && clobber(s2) && clobber(s3) // result: (Move {t.(*types.Type).Elem()} [sz] dst src mem) for { sym := v.Aux @@ -27465,7 +27465,7 @@ func rewriteValuegeneric_OpStaticCall_0(v *Value) bool { _ = s3.Args[2] dst := s3.Args[1] mem := s3.Args[2] - if !(isSameSym(sym, "runtime.memmove") && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1) && clobber(s2) && clobber(s3)) { + if !(isSameSym(sym, "runtime.memmove") && t.(*types.Type).IsPtr() && s1.Uses == 1 && s2.Uses == 1 && s3.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(s1) && clobber(s2) && clobber(s3)) { break } v.reset(OpMove) diff --git a/test/fixedbugs/issue30061.go b/test/fixedbugs/issue30061.go new file mode 100644 index 0000000000000..5092b01799ef0 --- /dev/null +++ b/test/fixedbugs/issue30061.go @@ -0,0 +1,20 @@ +// compile + +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Make sure we can linkname to memmove with an unsafe.Pointer argument. + +package p + +import "unsafe" + +//go:linkname memmove runtime.memmove +func memmove(to, from unsafe.Pointer, n uintptr) + +var V1, V2 int + +func F() { + memmove(unsafe.Pointer(&V1), unsafe.Pointer(&V2), unsafe.Sizeof(int(0))) +} From 3fc276ccf8c95a799c240905d35ad187abd34b20 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 2 Feb 2019 16:03:28 -0800 Subject: [PATCH 585/594] cmd/cgo: don't copy a simple variable x in &x[0] Fixes #30065 Change-Id: I3d0fb03bab397548653d5f3b386cfe2980ac1030 Reviewed-on: https://go-review.googlesource.com/c/160830 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- misc/cgo/test/cgo_test.go | 1 + misc/cgo/test/issue30065.go | 38 +++++++++++++++++++++++++++++++++++++ src/cmd/cgo/gcc.go | 38 +++++++++++++++++++++++++++++++------ 3 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 misc/cgo/test/issue30065.go diff --git a/misc/cgo/test/cgo_test.go b/misc/cgo/test/cgo_test.go index 242ba6c0e5d01..2cb93d9c2eb28 100644 --- a/misc/cgo/test/cgo_test.go +++ b/misc/cgo/test/cgo_test.go @@ -94,6 +94,7 @@ func Test26066(t *testing.T) { test26066(t) } func Test26213(t *testing.T) { test26213(t) } func Test27660(t *testing.T) { test27660(t) } func Test28896(t *testing.T) { test28896(t) } +func Test30065(t *testing.T) { test30065(t) } func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) } func BenchmarkGoString(b *testing.B) { benchGoString(b) } diff --git a/misc/cgo/test/issue30065.go b/misc/cgo/test/issue30065.go new file mode 100644 index 0000000000000..396d437f7ab3e --- /dev/null +++ b/misc/cgo/test/issue30065.go @@ -0,0 +1,38 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Don't make a private copy of an array when taking the address of an +// element. + +package cgotest + +// #include +import "C" + +import ( + "testing" + "unsafe" +) + +func test30065(t *testing.T) { + var a [256]byte + b := []byte("a") + C.memcpy(unsafe.Pointer(&a), unsafe.Pointer(&b[0]), 1) + if a[0] != 'a' { + t.Errorf("&a failed: got %c, want %c", a[0], 'a') + } + + b = []byte("b") + C.memcpy(unsafe.Pointer(&a[0]), unsafe.Pointer(&b[0]), 1) + if a[0] != 'b' { + t.Errorf("&a[0] failed: got %c, want %c", a[0], 'b') + } + + d := make([]byte, 256) + b = []byte("c") + C.memcpy(unsafe.Pointer(&d[0]), unsafe.Pointer(&b[0]), 1) + if d[0] != 'c' { + t.Errorf("&d[0] failed: got %c, want %c", d[0], 'c') + } +} diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 65f9f6e4a1943..b5cf04cf4c7bd 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -1121,14 +1121,19 @@ func (p *Package) mangle(f *File, arg *ast.Expr) (ast.Expr, bool) { } // checkIndex checks whether arg has the form &a[i], possibly inside -// type conversions. If so, it writes +// type conversions. If so, then in the general case it writes // _cgoIndexNN := a // _cgoNN := &cgoIndexNN[i] // with type conversions, if any // to sb, and writes // _cgoCheckPointer(_cgoNN, _cgoIndexNN) -// to sbCheck, and returns true. This tells _cgoCheckPointer to check -// the complete contents of the slice or array being indexed, but no -// other part of the memory allocation. +// to sbCheck, and returns true. If a is a simple variable or field reference, +// it writes +// _cgoIndexNN := &a +// and dereferences the uses of _cgoIndexNN. Taking the address avoids +// making a copy of an array. +// +// This tells _cgoCheckPointer to check the complete contents of the +// slice or array being indexed, but no other part of the memory allocation. func (p *Package) checkIndex(sb, sbCheck *bytes.Buffer, arg ast.Expr, i int) bool { // Strip type conversions. x := arg @@ -1148,13 +1153,23 @@ func (p *Package) checkIndex(sb, sbCheck *bytes.Buffer, arg ast.Expr, i int) boo return false } - fmt.Fprintf(sb, "_cgoIndex%d := %s; ", i, gofmtPos(index.X, index.X.Pos())) + addr := "" + deref := "" + if p.isVariable(index.X) { + addr = "&" + deref = "*" + } + + fmt.Fprintf(sb, "_cgoIndex%d := %s%s; ", i, addr, gofmtPos(index.X, index.X.Pos())) origX := index.X index.X = ast.NewIdent(fmt.Sprintf("_cgoIndex%d", i)) + if deref == "*" { + index.X = &ast.StarExpr{X: index.X} + } fmt.Fprintf(sb, "_cgo%d := %s; ", i, gofmtPos(arg, arg.Pos())) index.X = origX - fmt.Fprintf(sbCheck, "_cgoCheckPointer(_cgo%d, _cgoIndex%d); ", i, i) + fmt.Fprintf(sbCheck, "_cgoCheckPointer(_cgo%d, %s_cgoIndex%d); ", i, deref, i) return true } @@ -1280,6 +1295,17 @@ func (p *Package) isConst(f *File, x ast.Expr) bool { return false } +// isVariable reports whether x is a variable, possibly with field references. +func (p *Package) isVariable(x ast.Expr) bool { + switch x := x.(type) { + case *ast.Ident: + return true + case *ast.SelectorExpr: + return p.isVariable(x.X) + } + return false +} + // rewriteUnsafe returns a version of t with references to unsafe.Pointer // rewritten to use _cgo_unsafe.Pointer instead. func (p *Package) rewriteUnsafe(t ast.Expr) ast.Expr { From 691a2d457ab1bf03bd46d4b69e0f93b8993c0055 Mon Sep 17 00:00:00 2001 From: spring1843 Date: Sat, 2 Feb 2019 21:09:55 -0800 Subject: [PATCH 586/594] crypto/aes: replace broken extenal link to FIPS 197 Change-Id: Ib0a0d04aaaaa3c213fdb8646bd9b7dfdadae40d4 Reviewed-on: https://go-review.googlesource.com/c/160831 Reviewed-by: Filippo Valsorda --- src/crypto/aes/block.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/aes/block.go b/src/crypto/aes/block.go index 40bd0d335d3b2..53308ae92e33f 100644 --- a/src/crypto/aes/block.go +++ b/src/crypto/aes/block.go @@ -31,7 +31,7 @@ // // See FIPS 197 for specification, and see Daemen and Rijmen's Rijndael submission // for implementation details. -// https://www.csrc.nist.gov/publications/fips/fips197/fips-197.pdf +// https://csrc.nist.gov/csrc/media/publications/fips/197/final/documents/fips-197.pdf // https://csrc.nist.gov/archive/aes/rijndael/Rijndael-ammended.pdf package aes From b5be877ba4318422547068b85c673639cd843b7d Mon Sep 17 00:00:00 2001 From: Alberto Donizetti Date: Mon, 4 Feb 2019 20:07:46 +0100 Subject: [PATCH 587/594] cmd/go: clarify @none effect on dependants modules Expand modules documentation to clarify why @none is useful. The wording is the one suggested by rsc on the issue. Fixes #26684 Change-Id: I76dc4ff87e50f1dd8536fd9ac1fd938adb29bee3 Reviewed-on: https://go-review.googlesource.com/c/161037 Reviewed-by: Bryan C. Mills --- src/cmd/go/alldocs.go | 3 ++- src/cmd/go/internal/modget/get.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index d5f63693124a8..186f42156a2ef 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -2496,7 +2496,8 @@ // development module, then get will update the required version. // Specifying a version earlier than the current required version is valid and // downgrades the dependency. The version suffix @none indicates that the -// dependency should be removed entirely. +// dependency should be removed entirely, downgrading or removing modules +// depending on it as needed. // // Although get defaults to using the latest version of the module containing // a named package, it does not use the latest version of that module's diff --git a/src/cmd/go/internal/modget/get.go b/src/cmd/go/internal/modget/get.go index 2bfe6d3bb23fe..17a0ed45e21b4 100644 --- a/src/cmd/go/internal/modget/get.go +++ b/src/cmd/go/internal/modget/get.go @@ -56,7 +56,8 @@ If a module under consideration is already a dependency of the current development module, then get will update the required version. Specifying a version earlier than the current required version is valid and downgrades the dependency. The version suffix @none indicates that the -dependency should be removed entirely. +dependency should be removed entirely, downgrading or removing modules +depending on it as needed. Although get defaults to using the latest version of the module containing a named package, it does not use the latest version of that module's From 20c110eb2aacd9023bf7340252f14c83cba7abba Mon Sep 17 00:00:00 2001 From: Yuval Pavel Zholkover Date: Fri, 1 Feb 2019 17:58:01 +0200 Subject: [PATCH 588/594] doc: go1.12: document FreeBSD 12.0 requires COMPAT_FREEBSD11 Fixes #22447 Fixes #22448 Change-Id: Ia24f42c31e014c79040ff927f1247dfb2318de4f Reviewed-on: https://go-review.googlesource.com/c/160778 Reviewed-by: Brad Fitzpatrick Reviewed-by: Tobias Klauser --- doc/go1.12.html | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/go1.12.html b/doc/go1.12.html index e92d36838686d..5cd35b94c47ca 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -47,6 +47,7 @@

    Ports

    Go 1.12 is the last release that is supported on FreeBSD 10.x, which has already reached end-of-life. Go 1.13 will require FreeBSD 11.2+ or FreeBSD 12.0+. + FreeBSD 12.0+ requires a kernel with the COMPAT_FREEBSD11 option set (this is the default).

    From 10faf001077ea6b3907864f16a9f9099a7ba939b Mon Sep 17 00:00:00 2001 From: alkesh26 Date: Tue, 5 Feb 2019 10:05:10 +0000 Subject: [PATCH 589/594] doc: fix a typo Change-Id: Ia830f59d6f6ca1bc506ec298ccfc154d9f94f01d GitHub-Last-Rev: 3ab18d4fd1a8d4295713cbb7ff74f30b3838b6d3 GitHub-Pull-Request: golang/go#30067 Reviewed-on: https://go-review.googlesource.com/c/160829 Run-TryBot: Ian Lance Taylor Reviewed-by: Ian Lance Taylor --- doc/codewalk/codewalk.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/codewalk/codewalk.js b/doc/codewalk/codewalk.js index abc59373a0a51..4f59a8fc89afd 100644 --- a/doc/codewalk/codewalk.js +++ b/doc/codewalk/codewalk.js @@ -276,7 +276,7 @@ CodewalkViewer.prototype.changeSelectedComment = function(target) { } // Force original file even if user hasn't changed comments since they may - // have nagivated away from it within the iframe without us knowing. + // have navigated away from it within the iframe without us knowing. this.navigateToCode(currentFile); }; From ccd9d9d4cef16618d84bae9cba9f1b264278c8ab Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 5 Feb 2019 16:08:35 -0500 Subject: [PATCH 590/594] crypto/x509: improve CertificateRequest docs Change-Id: If3bab2dd5278ebc621235164e9d6ff710ba326ee Reviewed-on: https://go-review.googlesource.com/c/160898 Reviewed-by: Adam Langley --- src/crypto/x509/x509.go | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go index 08681a6ee2884..58098adc2d5a2 100644 --- a/src/crypto/x509/x509.go +++ b/src/crypto/x509/x509.go @@ -2272,21 +2272,25 @@ type CertificateRequest struct { Subject pkix.Name - // Attributes is the dried husk of a bug and shouldn't be used. + // Attributes contains the CSR attributes that can parse as + // pkix.AttributeTypeAndValueSET. + // + // Deprecated: use Extensions and ExtraExtensions instead for parsing and + // generating the requestedExtensions attribute. Attributes []pkix.AttributeTypeAndValueSET - // Extensions contains raw X.509 extensions. When parsing CSRs, this - // can be used to extract extensions that are not parsed by this + // Extensions contains all requested extensions, in raw form. When parsing + // CSRs, this can be used to extract extensions that are not parsed by this // package. Extensions []pkix.Extension - // ExtraExtensions contains extensions to be copied, raw, into any - // marshaled CSR. Values override any extensions that would otherwise - // be produced based on the other fields but are overridden by any - // extensions specified in Attributes. + // ExtraExtensions contains extensions to be copied, raw, into any CSR + // marshaled by CreateCertificateRequest. Values override any extensions + // that would otherwise be produced based on the other fields but are + // overridden by any extensions specified in Attributes. // - // The ExtraExtensions field is not populated when parsing CSRs, see - // Extensions. + // The ExtraExtensions field is not populated by ParseCertificateRequest, + // see Extensions instead. ExtraExtensions []pkix.Extension // Subject Alternate Name values. @@ -2385,21 +2389,21 @@ func parseCSRExtensions(rawAttributes []asn1.RawValue) ([]pkix.Extension, error) // CreateCertificateRequest creates a new certificate request based on a // template. The following members of template are used: // -// - Attributes +// - SignatureAlgorithm +// - Subject // - DNSNames // - EmailAddresses -// - ExtraExtensions // - IPAddresses // - URIs -// - SignatureAlgorithm -// - Subject +// - ExtraExtensions +// - Attributes (deprecated) // -// The private key is the private key of the signer. +// priv is the private key to sign the CSR with, and the corresponding public +// key will be included in the CSR. It must implement crypto.Signer and its +// Public() method must return a *rsa.PublicKey or a *ecdsa.PublicKey. (A +// *rsa.PrivateKey or *ecdsa.PrivateKey satisfies this.) // // The returned slice is the certificate request in DER encoding. -// -// All keys types that are implemented via crypto.Signer are supported (This -// includes *rsa.PublicKey and *ecdsa.PublicKey.) func CreateCertificateRequest(rand io.Reader, template *CertificateRequest, priv interface{}) (csr []byte, err error) { key, ok := priv.(crypto.Signer) if !ok { From aa161ad17e65df8f615f25c5dca84e505a8c8315 Mon Sep 17 00:00:00 2001 From: Yasser Abdolmaleki Date: Tue, 5 Feb 2019 22:14:44 -0800 Subject: [PATCH 591/594] test/chan: fix broken link to Squinting at Power Series Change-Id: Idee94a1d93555d53442098dd7479982e3f5afbba Reviewed-on: https://go-review.googlesource.com/c/161339 Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot --- test/chan/powser1.go | 2 +- test/chan/powser2.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/chan/powser1.go b/test/chan/powser1.go index 93862003fdbe2..5357eec50fd65 100644 --- a/test/chan/powser1.go +++ b/test/chan/powser1.go @@ -11,7 +11,7 @@ // coefficients. A denominator of zero signifies the end. // Original code in Newsqueak by Doug McIlroy. // See Squinting at Power Series by Doug McIlroy, -// http://www.cs.bell-labs.com/who/rsc/thread/squint.pdf +// https://swtch.com/~rsc/thread/squint.pdf package main diff --git a/test/chan/powser2.go b/test/chan/powser2.go index 8fa3b7e11cdf6..fb1fb8518efc7 100644 --- a/test/chan/powser2.go +++ b/test/chan/powser2.go @@ -15,7 +15,7 @@ // coefficients. A denominator of zero signifies the end. // Original code in Newsqueak by Doug McIlroy. // See Squinting at Power Series by Doug McIlroy, -// http://www.cs.bell-labs.com/who/rsc/thread/squint.pdf +// https://swtch.com/~rsc/thread/squint.pdf package main From 95e5b07cf5fdf3352f04f5557df38f22c55ce8e8 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Mon, 4 Feb 2019 18:08:43 -0500 Subject: [PATCH 592/594] crypto/x509: consider parents by Subject if AKID has no match If a certificate somehow has an AKID, it should still chain successfully to a parent without a SKID, even if the latter is invalid according to RFC 5280, because only the Subject is authoritative. This reverts to the behavior before #29233 was fixed in 770130659. Roots with the right subject will still be shadowed by roots with the right SKID and the wrong subject, but that's been the case for a long time, and is left for a more complete fix in Go 1.13. Updates #30079 Change-Id: If8ab0179aca86cb74caa926d1ef93fb5e416b4bb Reviewed-on: https://go-review.googlesource.com/c/161097 Reviewed-by: Adam Langley --- src/crypto/x509/cert_pool.go | 9 ++- src/crypto/x509/verify_test.go | 116 +++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 2 deletions(-) diff --git a/src/crypto/x509/cert_pool.go b/src/crypto/x509/cert_pool.go index 7c55c3b4a3286..3e1e5fb8cd1c1 100644 --- a/src/crypto/x509/cert_pool.go +++ b/src/crypto/x509/cert_pool.go @@ -71,10 +71,15 @@ func (s *CertPool) findPotentialParents(cert *Certificate) []int { if s == nil { return nil } + + var candidates []int if len(cert.AuthorityKeyId) > 0 { - return s.bySubjectKeyId[string(cert.AuthorityKeyId)] + candidates = s.bySubjectKeyId[string(cert.AuthorityKeyId)] + } + if len(candidates) == 0 { + candidates = s.byName[string(cert.RawIssuer)] } - return s.byName[string(cert.RawIssuer)] + return candidates } func (s *CertPool) contains(cert *Certificate) bool { diff --git a/src/crypto/x509/verify_test.go b/src/crypto/x509/verify_test.go index 85f4703d4c3fd..86fe76a57d7f8 100644 --- a/src/crypto/x509/verify_test.go +++ b/src/crypto/x509/verify_test.go @@ -386,6 +386,19 @@ var verifyTests = []verifyTest{ errorCallback: expectHostnameError("not valid for any names"), }, + { + // A certificate with an AKID should still chain to a parent without SKID. + // See Issue 30079. + leaf: leafWithAKID, + roots: []string{rootWithoutSKID}, + currentTime: 1550000000, + dnsName: "example", + systemSkip: true, + + expectedChains: [][]string{ + {"Acme LLC", "Acme Co"}, + }, + }, } func expectHostnameError(msg string) func(*testing.T, int, error) bool { @@ -1679,6 +1692,109 @@ h7olHCpY9yMRiz0= -----END CERTIFICATE----- ` +const ( + rootWithoutSKID = ` +Certificate: + Data: + Version: 3 (0x2) + Serial Number: + 78:29:2a:dc:2f:12:39:7f:c9:33:93:ea:61:39:7d:70 + Signature Algorithm: ecdsa-with-SHA256 + Issuer: O = Acme Co + Validity + Not Before: Feb 4 22:56:34 2019 GMT + Not After : Feb 1 22:56:34 2029 GMT + Subject: O = Acme Co + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:84:a6:8c:69:53:af:87:4b:39:64:fe:04:24:e6: + d8:fc:d6:46:39:35:0e:92:dc:48:08:7e:02:5f:1e: + 07:53:5c:d9:e0:56:c5:82:07:f6:a3:e2:ad:f6:ad: + be:a0:4e:03:87:39:67:0c:9c:46:91:68:6b:0e:8e: + f8:49:97:9d:5b + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Key Usage: critical + Digital Signature, Key Encipherment, Certificate Sign + X509v3 Extended Key Usage: + TLS Web Server Authentication + X509v3 Basic Constraints: critical + CA:TRUE + X509v3 Subject Alternative Name: + DNS:example + Signature Algorithm: ecdsa-with-SHA256 + 30:46:02:21:00:c6:81:61:61:42:8d:37:e7:d0:c3:72:43:44: + 17:bd:84:ff:88:81:68:9a:99:08:ab:3c:3a:c0:1e:ea:8c:ba: + c0:02:21:00:de:c9:fa:e5:5e:c6:e2:db:23:64:43:a9:37:42: + 72:92:7f:6e:89:38:ea:9e:2a:a7:fd:2f:ea:9a:ff:20:21:e7 +-----BEGIN CERTIFICATE----- +MIIBbzCCARSgAwIBAgIQeCkq3C8SOX/JM5PqYTl9cDAKBggqhkjOPQQDAjASMRAw +DgYDVQQKEwdBY21lIENvMB4XDTE5MDIwNDIyNTYzNFoXDTI5MDIwMTIyNTYzNFow +EjEQMA4GA1UEChMHQWNtZSBDbzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABISm +jGlTr4dLOWT+BCTm2PzWRjk1DpLcSAh+Al8eB1Nc2eBWxYIH9qPirfatvqBOA4c5 +ZwycRpFoaw6O+EmXnVujTDBKMA4GA1UdDwEB/wQEAwICpDATBgNVHSUEDDAKBggr +BgEFBQcDATAPBgNVHRMBAf8EBTADAQH/MBIGA1UdEQQLMAmCB2V4YW1wbGUwCgYI +KoZIzj0EAwIDSQAwRgIhAMaBYWFCjTfn0MNyQ0QXvYT/iIFompkIqzw6wB7qjLrA +AiEA3sn65V7G4tsjZEOpN0Jykn9uiTjqniqn/S/qmv8gIec= +-----END CERTIFICATE----- +` + leafWithAKID = ` + Certificate: + Data: + Version: 3 (0x2) + Serial Number: + f0:8a:62:f0:03:84:a2:cf:69:63:ad:71:3b:b6:5d:8c + Signature Algorithm: ecdsa-with-SHA256 + Issuer: O = Acme Co + Validity + Not Before: Feb 4 23:06:52 2019 GMT + Not After : Feb 1 23:06:52 2029 GMT + Subject: O = Acme LLC + Subject Public Key Info: + Public Key Algorithm: id-ecPublicKey + Public-Key: (256 bit) + pub: + 04:5a:4e:4d:fb:ff:17:f7:b6:13:e8:29:45:34:81: + 39:ff:8c:9c:d9:8c:0a:9f:dd:b5:97:4c:2b:20:91: + 1c:4f:6b:be:53:27:66:ec:4a:ad:08:93:6d:66:36: + 0c:02:70:5d:01:ca:7f:c3:29:e9:4f:00:ba:b4:14: + ec:c5:c3:34:b3 + ASN1 OID: prime256v1 + NIST CURVE: P-256 + X509v3 extensions: + X509v3 Key Usage: critical + Digital Signature, Key Encipherment + X509v3 Extended Key Usage: + TLS Web Server Authentication + X509v3 Basic Constraints: critical + CA:FALSE + X509v3 Authority Key Identifier: + keyid:C2:2B:5F:91:78:34:26:09:42:8D:6F:51:B2:C5:AF:4C:0B:DE:6A:42 + + X509v3 Subject Alternative Name: + DNS:example + Signature Algorithm: ecdsa-with-SHA256 + 30:44:02:20:64:e0:ba:56:89:63:ce:22:5e:4f:22:15:fd:3c: + 35:64:9a:3a:6b:7b:9a:32:a0:7f:f7:69:8c:06:f0:00:58:b8: + 02:20:09:e4:9f:6d:8b:9e:38:e1:b6:01:d5:ee:32:a4:94:65: + 93:2a:78:94:bb:26:57:4b:c7:dd:6c:3d:40:2b:63:90 +-----BEGIN CERTIFICATE----- +MIIBjTCCATSgAwIBAgIRAPCKYvADhKLPaWOtcTu2XYwwCgYIKoZIzj0EAwIwEjEQ +MA4GA1UEChMHQWNtZSBDbzAeFw0xOTAyMDQyMzA2NTJaFw0yOTAyMDEyMzA2NTJa +MBMxETAPBgNVBAoTCEFjbWUgTExDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE +Wk5N+/8X97YT6ClFNIE5/4yc2YwKn921l0wrIJEcT2u+Uydm7EqtCJNtZjYMAnBd +Acp/wynpTwC6tBTsxcM0s6NqMGgwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQMMAoG +CCsGAQUFBwMBMAwGA1UdEwEB/wQCMAAwHwYDVR0jBBgwFoAUwitfkXg0JglCjW9R +ssWvTAveakIwEgYDVR0RBAswCYIHZXhhbXBsZTAKBggqhkjOPQQDAgNHADBEAiBk +4LpWiWPOIl5PIhX9PDVkmjpre5oyoH/3aYwG8ABYuAIgCeSfbYueOOG2AdXuMqSU +ZZMqeJS7JldLx91sPUArY5A= +-----END CERTIFICATE----- +` +) + var unknownAuthorityErrorTests = []struct { cert string expected string From 5d9bc60893d66073ca82eecee7c9800321535f52 Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 5 Feb 2019 15:29:02 -0500 Subject: [PATCH 593/594] crypto/tls: make TLS 1.3 opt-in Updates #30055 Change-Id: If68615c8e9daa4226125dcc6a6866f29f3cfeef1 Reviewed-on: https://go-review.googlesource.com/c/160997 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- doc/go1.12.html | 22 ++++++++++++----- src/crypto/tls/common.go | 43 +++++++++++++++++++++++++++++++++ src/crypto/tls/tls_test.go | 49 +++++++++++++++++++++++++++++++++----- 3 files changed, 102 insertions(+), 12 deletions(-) diff --git a/doc/go1.12.html b/doc/go1.12.html index 5cd35b94c47ca..0f076e379d31e 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -388,15 +388,25 @@

    Core library

    TLS 1.3

    - Go 1.12 adds support in the crypto/tls package for TLS 1.3 as - specified in RFC 8446. + Go 1.12 adds opt-in support for TLS 1.3 in the crypto/tls package as + specified by RFC 8446. It can + be enabled by adding the value tls13=1 to the GODEBUG + environment variable. It will be enabled by default in Go 1.13. +

    - Programs that did not set an explicit MaxVersion in - Config will automatically negotiate - TLS 1.3 if available. All TLS 1.2 features except TLSUnique in +

    + To negotiate TLS 1.3, make sure you do not set an explicit MaxVersion in + Config and run your program with + the environment variable GODEBUG=tls13=1 set. +

    + +

    + All TLS 1.2 features except TLSUnique in ConnectionState and renegotiation are available in TLS 1.3 and provide equivalent or - better security and performance. + better security and performance. Note that even though TLS 1.3 is backwards + compatible with previous versions, certain legacy systems might not work + correctly when attempting to negotiate it.

    diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go index 59d5507e1aa84..0b08700d831a4 100644 --- a/src/crypto/tls/common.go +++ b/src/crypto/tls/common.go @@ -16,6 +16,7 @@ import ( "io" "math/big" "net" + "os" "strings" "sync" "time" @@ -775,11 +776,53 @@ func (c *Config) supportedVersions(isClient bool) []uint16 { if isClient && v < VersionTLS10 { continue } + // TLS 1.3 is opt-in in Go 1.12. + if v == VersionTLS13 && !isTLS13Supported() { + continue + } versions = append(versions, v) } return versions } +// tls13Support caches the result for isTLS13Supported. +var tls13Support struct { + sync.Once + cached bool +} + +// isTLS13Supported returns whether the program opted into TLS 1.3 via +// GODEBUG=tls13=1. It's cached after the first execution. +func isTLS13Supported() bool { + tls13Support.Do(func() { + tls13Support.cached = goDebugString("tls13") == "1" + }) + return tls13Support.cached +} + +// goDebugString returns the value of the named GODEBUG key. +// GODEBUG is of the form "key=val,key2=val2". +func goDebugString(key string) string { + s := os.Getenv("GODEBUG") + for i := 0; i < len(s)-len(key)-1; i++ { + if i > 0 && s[i-1] != ',' { + continue + } + afterKey := s[i+len(key):] + if afterKey[0] != '=' || s[i:i+len(key)] != key { + continue + } + val := afterKey[1:] + for i, b := range val { + if b == ',' { + return val[:i] + } + } + return val + } + return "" +} + func (c *Config) maxSupportedVersion(isClient bool) uint16 { supportedVersions := c.supportedVersions(isClient) if len(supportedVersions) == 0 { diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go index 00bb6e4ef3754..9c26769b09ec2 100644 --- a/src/crypto/tls/tls_test.go +++ b/src/crypto/tls/tls_test.go @@ -18,10 +18,18 @@ import ( "os" "reflect" "strings" + "sync" "testing" "time" ) +func init() { + // TLS 1.3 is opt-in for Go 1.12, but we want to run most tests with it enabled. + // TestTLS13Switch below tests the disabled behavior. See Issue 30055. + tls13Support.Do(func() {}) // defuse the sync.Once + tls13Support.cached = true +} + var rsaCertPEM = `-----BEGIN CERTIFICATE----- MIIB0zCCAX2gAwIBAgIJAI/M7BYjwB+uMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX @@ -1076,18 +1084,47 @@ func TestEscapeRoute(t *testing.T) { VersionSSL30, } - ss, cs, err := testHandshake(t, testConfig, testConfig) + expectVersion(t, testConfig, testConfig, VersionTLS12) +} + +func expectVersion(t *testing.T, clientConfig, serverConfig *Config, v uint16) { + ss, cs, err := testHandshake(t, clientConfig, serverConfig) if err != nil { - t.Fatalf("Handshake failed when support for TLS 1.3 was dropped: %v", err) + t.Fatalf("Handshake failed: %v", err) } - if ss.Version != VersionTLS12 { - t.Errorf("Server negotiated version %x, expected %x", cs.Version, VersionTLS12) + if ss.Version != v { + t.Errorf("Server negotiated version %x, expected %x", cs.Version, v) } - if cs.Version != VersionTLS12 { - t.Errorf("Client negotiated version %x, expected %x", cs.Version, VersionTLS12) + if cs.Version != v { + t.Errorf("Client negotiated version %x, expected %x", cs.Version, v) } } +// TestTLS13Switch checks the behavior of GODEBUG=tls13=[0|1]. See Issue 30055. +func TestTLS13Switch(t *testing.T) { + defer func(savedGODEBUG string) { + os.Setenv("GODEBUG", savedGODEBUG) + }(os.Getenv("GODEBUG")) + + os.Setenv("GODEBUG", "tls13=0") + tls13Support.Once = sync.Once{} // reset the cache + + tls12Config := testConfig.Clone() + tls12Config.MaxVersion = VersionTLS12 + expectVersion(t, testConfig, testConfig, VersionTLS12) + expectVersion(t, tls12Config, testConfig, VersionTLS12) + expectVersion(t, testConfig, tls12Config, VersionTLS12) + expectVersion(t, tls12Config, tls12Config, VersionTLS12) + + os.Setenv("GODEBUG", "tls13=1") + tls13Support.Once = sync.Once{} // reset the cache + + expectVersion(t, testConfig, testConfig, VersionTLS13) + expectVersion(t, tls12Config, testConfig, VersionTLS12) + expectVersion(t, testConfig, tls12Config, VersionTLS12) + expectVersion(t, tls12Config, tls12Config, VersionTLS12) +} + // Issue 28744: Ensure that we don't modify memory // that Config doesn't own such as Certificates. func TestBuildNameToCertificate_doesntModifyCertificates(t *testing.T) { From 7ccd3583eddcd79679fb29cfc83a6e6fb6973f1e Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Tue, 5 Feb 2019 15:27:56 -0500 Subject: [PATCH 594/594] crypto/tls: disable RSA-PSS in TLS 1.2 Most of the issues that led to the decision on #30055 were related to incompatibility with or faulty support for RSA-PSS (#29831, #29779, v1.5 signatures). RSA-PSS is required by TLS 1.3, but is also available to be negotiated in TLS 1.2. Altering TLS 1.2 behavior based on GODEBUG=tls13=1 feels surprising, so just disable RSA-PSS entirely in TLS 1.2 until TLS 1.3 is on by default, so breakage happens all at once. Updates #30055 Change-Id: Iee90454a20ded8895e5302e8bcbcd32e4e3031c2 Reviewed-on: https://go-review.googlesource.com/c/160998 Run-TryBot: Filippo Valsorda TryBot-Result: Gobot Gobot Reviewed-by: Adam Langley --- doc/go1.12.html | 10 +- src/crypto/tls/common.go | 5 +- src/crypto/tls/conn_test.go | 1 + src/crypto/tls/handshake_client_test.go | 24 +++ src/crypto/tls/handshake_server.go | 4 +- src/crypto/tls/handshake_server_test.go | 146 ++++++++++---- src/crypto/tls/key_agreement.go | 2 +- .../Client-TLSv12-ClientCert-RSA-PSS-Disabled | 137 +++++++++++++ .../Client-TLSv13-ClientCert-RSA-PSS-Disabled | 138 +++++++++++++ ...2-ClientAuthRequestedAndGiven-PSS-Disabled | 126 ++++++++++++ ...uthRequestedAndGiven-PSS-Disabled-Required | 74 +++++++ .../testdata/Server-TLSv12-RSA-PSS-Disabled | 84 ++++++++ .../Server-TLSv12-RSA-PSS-Disabled-Required | 54 ++++++ ...3-ClientAuthRequestedAndGiven-PSS-Disabled | 182 ++++++++++++++++++ .../testdata/Server-TLSv13-RSA-PSS-Disabled | 103 ++++++++++ src/crypto/tls/tls_test.go | 8 +- 16 files changed, 1047 insertions(+), 51 deletions(-) create mode 100644 src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-PSS-Disabled create mode 100644 src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-PSS-Disabled create mode 100644 src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled create mode 100644 src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled-Required create mode 100644 src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled create mode 100644 src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled-Required create mode 100644 src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven-PSS-Disabled create mode 100644 src/crypto/tls/testdata/Server-TLSv13-RSA-PSS-Disabled diff --git a/doc/go1.12.html b/doc/go1.12.html index 0f076e379d31e..3b086e700106a 100644 --- a/doc/go1.12.html +++ b/doc/go1.12.html @@ -406,7 +406,8 @@

    TLS 1.3

    and renegotiation are available in TLS 1.3 and provide equivalent or better security and performance. Note that even though TLS 1.3 is backwards compatible with previous versions, certain legacy systems might not work - correctly when attempting to negotiate it. + correctly when attempting to negotiate it. RSA certificate keys too small + to be secure (including 512-bit keys) will not work with TLS 1.3.

    @@ -500,13 +501,6 @@

    Minor changes to the library

    crypto/tls
    -

    - TLS 1.2 clients and servers will now advertise and accept RSA-PSS - signature algorithms for use with regular RSA public keys. Certain - insecure certificate keys (including 512-bit RSA keys) will - now cause a handshake failure if RSA-PSS is selected. -

    -

    If a client sends an initial message that does not look like TLS, the server will no longer reply with an alert, and it will expose the underlying diff --git a/src/crypto/tls/common.go b/src/crypto/tls/common.go index 0b08700d831a4..f695528fe07c1 100644 --- a/src/crypto/tls/common.go +++ b/src/crypto/tls/common.go @@ -161,7 +161,7 @@ const ( ) // supportedSignatureAlgorithms contains the signature and hash algorithms that -// the code advertises as supported in a TLS 1.2 ClientHello and in a TLS 1.2 +// the code advertises as supported in a TLS 1.2+ ClientHello and in a TLS 1.2+ // CertificateRequest. The two fields are merged to match with TLS 1.3. // Note that in TLS 1.2, the ECDSA algorithms are not constrained to P-256, etc. var supportedSignatureAlgorithms = []SignatureScheme{ @@ -178,6 +178,9 @@ var supportedSignatureAlgorithms = []SignatureScheme{ ECDSAWithSHA1, } +// RSA-PSS is disabled in TLS 1.2 for Go 1.12. See Issue 30055. +var supportedSignatureAlgorithmsTLS12 = supportedSignatureAlgorithms[3:] + // helloRetryRequestRandom is set as the Random value of a ServerHello // to signal that the message is actually a HelloRetryRequest. var helloRetryRequestRandom = []byte{ // See RFC 8446, Section 4.1.3. diff --git a/src/crypto/tls/conn_test.go b/src/crypto/tls/conn_test.go index 76cef7174b9c9..57f61050e5ff2 100644 --- a/src/crypto/tls/conn_test.go +++ b/src/crypto/tls/conn_test.go @@ -142,6 +142,7 @@ func runDynamicRecordSizingTest(t *testing.T, config *Config) { handshakeDone := make(chan struct{}) recordSizesChan := make(chan []int, 1) + defer func() { <-recordSizesChan }() // wait for the goroutine to exit go func() { // This goroutine performs a TLS handshake over clientConn and // then reads TLS records until EOF. It writes a slice that diff --git a/src/crypto/tls/handshake_client_test.go b/src/crypto/tls/handshake_client_test.go index ececd7b04d047..7441e5b556233 100644 --- a/src/crypto/tls/handshake_client_test.go +++ b/src/crypto/tls/handshake_client_test.go @@ -855,6 +855,30 @@ func TestHandshakeClientCertRSAPKCS1v15(t *testing.T) { runClientTestTLS12(t, test) } +func TestHandshakeClientCertPSSDisabled(t *testing.T) { + config := testConfig.Clone() + cert, _ := X509KeyPair([]byte(clientCertificatePEM), []byte(clientKeyPEM)) + config.Certificates = []Certificate{cert} + + test := &clientTest{ + name: "ClientCert-RSA-PSS-Disabled", + args: []string{"-cipher", "AES128", "-Verify", "1"}, + config: config, + } + + // Restore the default signature algorithms, disabling RSA-PSS in TLS 1.2, + // and check that handshakes still work. + testSupportedSignatureAlgorithmsTLS12 := supportedSignatureAlgorithmsTLS12 + defer func() { supportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }() + supportedSignatureAlgorithmsTLS12 = savedSupportedSignatureAlgorithmsTLS12 + + // Use t.Run to ensure the defer runs after all parallel tests end. + t.Run("", func(t *testing.T) { + runClientTestTLS12(t, test) + runClientTestTLS13(t, test) + }) +} + func TestClientKeyUpdate(t *testing.T) { test := &clientTest{ name: "KeyUpdate", diff --git a/src/crypto/tls/handshake_server.go b/src/crypto/tls/handshake_server.go index 2745f3313fbe0..4f4b60ae2cea8 100644 --- a/src/crypto/tls/handshake_server.go +++ b/src/crypto/tls/handshake_server.go @@ -463,7 +463,7 @@ func (hs *serverHandshakeState) doFullHandshake() error { } if c.vers >= VersionTLS12 { certReq.hasSignatureAlgorithm = true - certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms + certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithmsTLS12 } // An empty list of certificateAuthorities signals to @@ -559,7 +559,7 @@ func (hs *serverHandshakeState) doFullHandshake() error { } // Determine the signature type. - _, sigType, hashFunc, err := pickSignatureAlgorithm(pub, []SignatureScheme{certVerify.signatureAlgorithm}, supportedSignatureAlgorithms, c.vers) + _, sigType, hashFunc, err := pickSignatureAlgorithm(pub, []SignatureScheme{certVerify.signatureAlgorithm}, supportedSignatureAlgorithmsTLS12, c.vers) if err != nil { c.sendAlert(alertIllegalParameter) return err diff --git a/src/crypto/tls/handshake_server_test.go b/src/crypto/tls/handshake_server_test.go index 411648ef68be8..c23f98f6bc5c1 100644 --- a/src/crypto/tls/handshake_server_test.go +++ b/src/crypto/tls/handshake_server_test.go @@ -1211,6 +1211,33 @@ func TestHandshakeServerRSAPSS(t *testing.T) { runServerTestTLS13(t, test) } +func TestHandshakeServerPSSDisabled(t *testing.T) { + test := &serverTest{ + name: "RSA-PSS-Disabled", + command: []string{"openssl", "s_client", "-no_ticket"}, + wait: true, + } + + // Restore the default signature algorithms, disabling RSA-PSS in TLS 1.2, + // and check that handshakes still work. + testSupportedSignatureAlgorithmsTLS12 := supportedSignatureAlgorithmsTLS12 + defer func() { supportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }() + supportedSignatureAlgorithmsTLS12 = savedSupportedSignatureAlgorithmsTLS12 + + runServerTestTLS12(t, test) + runServerTestTLS13(t, test) + + test = &serverTest{ + name: "RSA-PSS-Disabled-Required", + command: []string{"openssl", "s_client", "-no_ticket", "-sigalgs", "rsa_pss_rsae_sha256"}, + wait: true, + + expectHandshakeErrorIncluding: "peer doesn't support any common signature algorithms", + } + + runServerTestTLS12(t, test) +} + func benchmarkHandshakeServer(b *testing.B, version uint16, cipherSuite uint16, curve CurveID, cert []byte, key crypto.PrivateKey) { config := testConfig.Clone() config.CipherSuites = []uint16{cipherSuite} @@ -1390,49 +1417,82 @@ func TestClientAuth(t *testing.T) { defer os.Remove(ecdsaCertPath) ecdsaKeyPath = tempFile(clientECDSAKeyPEM) defer os.Remove(ecdsaKeyPath) - } else { - t.Parallel() } - config := testConfig.Clone() - config.ClientAuth = RequestClientCert + t.Run("Normal", func(t *testing.T) { + config := testConfig.Clone() + config.ClientAuth = RequestClientCert - test := &serverTest{ - name: "ClientAuthRequestedNotGiven", - command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA"}, - config: config, - } - runServerTestTLS12(t, test) - runServerTestTLS13(t, test) + test := &serverTest{ + name: "ClientAuthRequestedNotGiven", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA"}, + config: config, + } + runServerTestTLS12(t, test) + runServerTestTLS13(t, test) - test = &serverTest{ - name: "ClientAuthRequestedAndGiven", - command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", - "-cert", certPath, "-key", keyPath, "-sigalgs", "rsa_pss_rsae_sha256"}, - config: config, - expectedPeerCerts: []string{clientCertificatePEM}, - } - runServerTestTLS12(t, test) - runServerTestTLS13(t, test) + config.ClientAuth = RequireAnyClientCert - test = &serverTest{ - name: "ClientAuthRequestedAndECDSAGiven", - command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", - "-cert", ecdsaCertPath, "-key", ecdsaKeyPath}, - config: config, - expectedPeerCerts: []string{clientECDSACertificatePEM}, - } - runServerTestTLS12(t, test) - runServerTestTLS13(t, test) + test = &serverTest{ + name: "ClientAuthRequestedAndGiven", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", + "-cert", certPath, "-key", keyPath, "-sigalgs", "rsa_pss_rsae_sha256"}, + config: config, + expectedPeerCerts: []string{clientCertificatePEM}, + } + runServerTestTLS12(t, test) + runServerTestTLS13(t, test) + + test = &serverTest{ + name: "ClientAuthRequestedAndECDSAGiven", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", + "-cert", ecdsaCertPath, "-key", ecdsaKeyPath}, + config: config, + expectedPeerCerts: []string{clientECDSACertificatePEM}, + } + runServerTestTLS12(t, test) + runServerTestTLS13(t, test) + + test = &serverTest{ + name: "ClientAuthRequestedAndPKCS1v15Given", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", + "-cert", certPath, "-key", keyPath, "-sigalgs", "rsa_pkcs1_sha256"}, + config: config, + expectedPeerCerts: []string{clientCertificatePEM}, + } + runServerTestTLS12(t, test) + }) - test = &serverTest{ - name: "ClientAuthRequestedAndPKCS1v15Given", - command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", - "-cert", certPath, "-key", keyPath, "-sigalgs", "rsa_pkcs1_sha256"}, - config: config, - expectedPeerCerts: []string{clientCertificatePEM}, - } - runServerTestTLS12(t, test) + // Restore the default signature algorithms, disabling RSA-PSS in TLS 1.2, + // and check that handshakes still work. + testSupportedSignatureAlgorithmsTLS12 := supportedSignatureAlgorithmsTLS12 + defer func() { supportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }() + supportedSignatureAlgorithmsTLS12 = savedSupportedSignatureAlgorithmsTLS12 + + t.Run("PSSDisabled", func(t *testing.T) { + config := testConfig.Clone() + config.ClientAuth = RequireAnyClientCert + + test := &serverTest{ + name: "ClientAuthRequestedAndGiven-PSS-Disabled", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", + "-cert", certPath, "-key", keyPath}, + config: config, + expectedPeerCerts: []string{clientCertificatePEM}, + } + runServerTestTLS12(t, test) + runServerTestTLS13(t, test) + + test = &serverTest{ + name: "ClientAuthRequestedAndGiven-PSS-Disabled-Required", + command: []string{"openssl", "s_client", "-no_ticket", "-cipher", "AES128-SHA", + "-cert", certPath, "-key", keyPath, "-client_sigalgs", "rsa_pss_rsae_sha256"}, + config: config, + + expectHandshakeErrorIncluding: "client didn't provide a certificate", + } + runServerTestTLS12(t, test) + }) } func TestSNIGivenOnFailure(t *testing.T) { @@ -1722,6 +1782,7 @@ T+E0J8wlH24pgwQHzy7Ko2qLwn1b5PW8ecrlvP1g if err != nil { t.Fatal(err) } + done := make(chan struct{}) go func() { config := testConfig.Clone() @@ -1739,4 +1800,15 @@ T+E0J8wlH24pgwQHzy7Ko2qLwn1b5PW8ecrlvP1g t.Errorf(`expected "handshake failure", got %q`, err) } <-done + + // With RSA-PSS disabled and TLS 1.2, this should work. + + testSupportedSignatureAlgorithmsTLS12 := supportedSignatureAlgorithmsTLS12 + defer func() { supportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }() + supportedSignatureAlgorithmsTLS12 = savedSupportedSignatureAlgorithmsTLS12 + + serverConfig := testConfig.Clone() + serverConfig.Certificates = []Certificate{cert} + serverConfig.MaxVersion = VersionTLS12 + testHandshake(t, testConfig, serverConfig) } diff --git a/src/crypto/tls/key_agreement.go b/src/crypto/tls/key_agreement.go index 628e578e483e3..05fe77b3e205b 100644 --- a/src/crypto/tls/key_agreement.go +++ b/src/crypto/tls/key_agreement.go @@ -177,7 +177,7 @@ NextCandidate: return nil, errors.New("tls: certificate private key does not implement crypto.Signer") } - signatureAlgorithm, sigType, hashFunc, err := pickSignatureAlgorithm(priv.Public(), clientHello.supportedSignatureAlgorithms, supportedSignatureAlgorithms, ka.version) + signatureAlgorithm, sigType, hashFunc, err := pickSignatureAlgorithm(priv.Public(), clientHello.supportedSignatureAlgorithms, supportedSignatureAlgorithmsTLS12, ka.version) if err != nil { return nil, err } diff --git a/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-PSS-Disabled b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-PSS-Disabled new file mode 100644 index 0000000000000..9d59cb125d452 --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-PSS-Disabled @@ -0,0 +1,137 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 f8 01 00 00 f4 03 03 00 00 00 00 00 |................| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....| +00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 32 cc a8 |.............2..| +00000050 cc a9 c0 2f c0 2b c0 30 c0 2c c0 27 c0 13 c0 23 |.../.+.0.,.'...#| +00000060 c0 09 c0 14 c0 0a 00 9c 00 9d 00 3c 00 2f 00 35 |...........<./.5| +00000070 c0 12 00 0a 00 05 c0 11 c0 07 13 01 13 03 13 02 |................| +00000080 01 00 00 79 00 05 00 05 01 00 00 00 00 00 0a 00 |...y............| +00000090 0a 00 08 00 1d 00 17 00 18 00 19 00 0b 00 02 01 |................| +000000a0 00 00 0d 00 18 00 16 08 04 08 05 08 06 04 01 04 |................| +000000b0 03 05 01 05 03 06 01 06 03 02 01 02 03 ff 01 00 |................| +000000c0 01 00 00 12 00 00 00 2b 00 09 08 03 04 03 03 03 |.......+........| +000000d0 02 03 01 00 33 00 26 00 24 00 1d 00 20 2f e5 7d |....3.&.$... /.}| +000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| +000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| +>>> Flow 2 (server to client) +00000000 16 03 03 00 59 02 00 00 55 03 03 33 ad 8d f8 90 |....Y...U..3....| +00000010 d1 72 5d ef e8 94 0f d7 58 15 59 9f 0b f9 ec 73 |.r].....X.Y....s| +00000020 99 53 f7 03 81 53 1a aa 05 f0 17 20 55 a1 9e 4e |.S...S..... U..N| +00000030 98 26 6b b8 d5 bc 2c 3e ca f6 a0 d9 bb f2 3b dd |.&k...,>......;.| +00000040 be 99 f1 35 de 1c f6 51 5b 19 4f 55 c0 2f 00 00 |...5...Q[.OU./..| +00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................| +00000060 03 02 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 |..Y...U..R..O0..| +00000070 4b 30 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d |K0..............| +00000080 3f e2 5b ea a6 30 0d 06 09 2a 86 48 86 f7 0d 01 |?.[..0...*.H....| +00000090 01 0b 05 00 30 1f 31 0b 30 09 06 03 55 04 0a 13 |....0.1.0...U...| +000000a0 02 47 6f 31 10 30 0e 06 03 55 04 03 13 07 47 6f |.Go1.0...U....Go| +000000b0 20 52 6f 6f 74 30 1e 17 0d 31 36 30 31 30 31 30 | Root0...1601010| +000000c0 30 30 30 30 30 5a 17 0d 32 35 30 31 30 31 30 30 |00000Z..25010100| +000000d0 30 30 30 30 5a 30 1a 31 0b 30 09 06 03 55 04 0a |0000Z0.1.0...U..| +000000e0 13 02 47 6f 31 0b 30 09 06 03 55 04 03 13 02 47 |..Go1.0...U....G| +000000f0 6f 30 81 9f 30 0d 06 09 2a 86 48 86 f7 0d 01 01 |o0..0...*.H.....| +00000100 01 05 00 03 81 8d 00 30 81 89 02 81 81 00 db 46 |.......0.......F| +00000110 7d 93 2e 12 27 06 48 bc 06 28 21 ab 7e c4 b6 a2 |}...'.H..(!.~...| +00000120 5d fe 1e 52 45 88 7a 36 47 a5 08 0d 92 42 5b c2 |]..RE.z6G....B[.| +00000130 81 c0 be 97 79 98 40 fb 4f 6d 14 fd 2b 13 8b c2 |....y.@.Om..+...| +00000140 a5 2e 67 d8 d4 09 9e d6 22 38 b7 4a 0b 74 73 2b |..g....."8.J.ts+| +00000150 c2 34 f1 d1 93 e5 96 d9 74 7b f3 58 9f 6c 61 3c |.4......t{.X.la<| +00000160 c0 b0 41 d4 d9 2b 2b 24 23 77 5b 1c 3b bd 75 5d |..A..++$#w[.;.u]| +00000170 ce 20 54 cf a1 63 87 1d 1e 24 c4 f3 1d 1a 50 8b |. T..c...$....P.| +00000180 aa b6 14 43 ed 97 a7 75 62 f4 14 c8 52 d7 02 03 |...C...ub...R...| +00000190 01 00 01 a3 81 93 30 81 90 30 0e 06 03 55 1d 0f |......0..0...U..| +000001a0 01 01 ff 04 04 03 02 05 a0 30 1d 06 03 55 1d 25 |.........0...U.%| +000001b0 04 16 30 14 06 08 2b 06 01 05 05 07 03 01 06 08 |..0...+.........| +000001c0 2b 06 01 05 05 07 03 02 30 0c 06 03 55 1d 13 01 |+.......0...U...| +000001d0 01 ff 04 02 30 00 30 19 06 03 55 1d 0e 04 12 04 |....0.0...U.....| +000001e0 10 9f 91 16 1f 43 43 3e 49 a6 de 6d b6 80 d7 9f |.....CC>I..m....| +000001f0 60 30 1b 06 03 55 1d 23 04 14 30 12 80 10 48 13 |`0...U.#..0...H.| +00000200 49 4d 13 7e 16 31 bb a3 01 d5 ac ab 6e 7b 30 19 |IM.~.1......n{0.| +00000210 06 03 55 1d 11 04 12 30 10 82 0e 65 78 61 6d 70 |..U....0...examp| +00000220 6c 65 2e 67 6f 6c 61 6e 67 30 0d 06 09 2a 86 48 |le.golang0...*.H| +00000230 86 f7 0d 01 01 0b 05 00 03 81 81 00 9d 30 cc 40 |.............0.@| +00000240 2b 5b 50 a0 61 cb ba e5 53 58 e1 ed 83 28 a9 58 |+[P.a...SX...(.X| +00000250 1a a9 38 a4 95 a1 ac 31 5a 1a 84 66 3d 43 d3 2d |..8....1Z..f=C.-| +00000260 d9 0b f2 97 df d3 20 64 38 92 24 3a 00 bc cf 9c |...... d8.$:....| +00000270 7d b7 40 20 01 5f aa d3 16 61 09 a2 76 fd 13 c3 |}.@ ._...a..v...| +00000280 cc e1 0c 5c ee b1 87 82 f1 6c 04 ed 73 bb b3 43 |...\.....l..s..C| +00000290 77 8d 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d |w.......@.a.Lr+.| +000002a0 ae db 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db |..F..M...>...B..| +000002b0 fe 3d 13 60 84 5c 21 d3 3b e9 fa e7 16 03 03 00 |.=.`.\!.;.......| +000002c0 ac 0c 00 00 a8 03 00 1d 20 2d c8 0c d2 27 fc f9 |........ -...'..| +000002d0 79 71 c4 17 ea 45 ec 0b dd 66 ce af ec 49 96 7d |yq...E...f...I.}| +000002e0 43 ff 88 68 b1 a8 bb e1 38 08 04 00 80 5a ab 5b |C..h....8....Z.[| +000002f0 e6 b3 32 e2 98 ae c3 ed 7c f9 90 c4 a4 ea dd 70 |..2.....|......p| +00000300 fc a4 f8 ef d1 15 0d b7 ad b8 e3 1f 3e c0 e4 40 |............>..@| +00000310 0d 7b 50 36 8f 88 cb 88 59 7c 20 63 d1 7f 36 9e |.{P6....Y| c..6.| +00000320 de a7 cb 6a 49 fd 65 32 36 0b 10 6a df 58 ef fd |...jI.e26..j.X..| +00000330 f6 fc e6 65 e7 81 0e 73 25 87 c7 89 dc ec ae 7c |...e...s%......|| +00000340 e4 81 79 79 a2 b9 12 28 ab 3b d0 2e 5e 81 47 2a |..yy...(.;..^.G*| +00000350 79 1e 16 21 fa 64 78 24 33 24 f7 ac f1 11 a7 15 |y..!.dx$3$......| +00000360 98 f6 24 52 14 7c 1f 28 0c 24 b1 a9 8a 16 03 03 |..$R.|.(.$......| +00000370 00 3a 0d 00 00 36 03 01 02 40 00 2e 04 03 05 03 |.:...6...@......| +00000380 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................| +00000390 08 06 04 01 05 01 06 01 03 03 02 03 03 01 02 01 |................| +000003a0 03 02 02 02 04 02 05 02 06 02 00 00 16 03 03 00 |................| +000003b0 04 0e 00 00 00 |.....| +>>> Flow 3 (client to server) +00000000 16 03 03 01 fd 0b 00 01 f9 00 01 f6 00 01 f3 30 |...............0| +00000010 82 01 ef 30 82 01 58 a0 03 02 01 02 02 10 5c 19 |...0..X.......\.| +00000020 c1 89 65 83 55 6f dc 0b c9 b9 93 9f e9 bc 30 0d |..e.Uo........0.| +00000030 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 12 31 |..*.H........0.1| +00000040 10 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 |.0...U....Acme C| +00000050 6f 30 1e 17 0d 31 36 30 38 31 37 32 31 35 32 33 |o0...16081721523| +00000060 31 5a 17 0d 31 37 30 38 31 37 32 31 35 32 33 31 |1Z..170817215231| +00000070 5a 30 12 31 10 30 0e 06 03 55 04 0a 13 07 41 63 |Z0.1.0...U....Ac| +00000080 6d 65 20 43 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |me Co0..0...*.H.| +00000090 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +000000a0 81 00 ba 6f aa 86 bd cf bf 9f f2 ef 5c 94 60 78 |...o........\.`x| +000000b0 6f e8 13 f2 d1 96 6f cd d9 32 6e 22 37 ce 41 f9 |o.....o..2n"7.A.| +000000c0 ca 5d 29 ac e1 27 da 61 a2 ee 81 cb 10 c7 df 34 |.])..'.a.......4| +000000d0 58 95 86 e9 3d 19 e6 5c 27 73 60 c8 8d 78 02 f4 |X...=..\'s`..x..| +000000e0 1d a4 98 09 a3 19 70 69 3c 25 62 66 2a ab 22 23 |......pi<%bf*."#| +000000f0 c5 7b 85 38 4f 2e 09 73 32 a7 bd 3e 9b ad ca 84 |.{.8O..s2..>....| +00000100 07 e6 0f 3a ff 77 c5 9d 41 85 00 8a b6 9b ee b0 |...:.w..A.......| +00000110 a4 3f 2d 4c 4c e6 42 3e bb 51 c8 dd 48 54 f4 0c |.?-LL.B>.Q..HT..| +00000120 8e 47 02 03 01 00 01 a3 46 30 44 30 0e 06 03 55 |.G......F0D0...U| +00000130 1d 0f 01 01 ff 04 04 03 02 05 a0 30 13 06 03 55 |...........0...U| +00000140 1d 25 04 0c 30 0a 06 08 2b 06 01 05 05 07 03 01 |.%..0...+.......| +00000150 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 0f |0...U.......0.0.| +00000160 06 03 55 1d 11 04 08 30 06 87 04 7f 00 00 01 30 |..U....0.......0| +00000170 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 |...*.H..........| +00000180 81 00 46 ab 44 a2 fb 28 54 f8 5a 67 f8 62 94 f1 |..F.D..(T.Zg.b..| +00000190 9a b2 18 9e f2 b1 de 1d 7e 6f 76 95 a9 ba e7 5d |........~ov....]| +000001a0 a8 16 6c 9c f7 09 d3 37 e4 4b 2b 36 7c 01 ad 41 |..l....7.K+6|..A| +000001b0 d2 32 d8 c3 d2 93 f9 10 6b 8e 95 b9 2c 17 8a a3 |.2......k...,...| +000001c0 44 48 bc 59 13 83 16 04 88 a4 81 5c 25 0d 98 0c |DH.Y.......\%...| +000001d0 ac 11 b1 28 56 be 1d cd 61 62 84 09 bf d6 80 c6 |...(V...ab......| +000001e0 45 8d 82 2c b4 d8 83 9b db c9 22 b7 2a 12 11 7b |E..,......".*..{| +000001f0 fa 02 3b c1 c9 ff ea c9 9d a8 49 d3 95 d7 d5 0e |..;.......I.....| +00000200 e5 35 16 03 03 00 25 10 00 00 21 20 2f e5 7d a3 |.5....%...! /.}.| +00000210 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 |G.bC.(.._.).0...| +00000220 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 16 03 03 00 |......._X.;t....| +00000230 88 0f 00 00 84 08 04 00 80 8b ad 4b 9a 7a 53 b8 |...........K.zS.| +00000240 6a 0a e7 71 6a 9b 8b 89 7d 3a 49 c9 af ce 3f e2 |j..qj...}:I...?.| +00000250 3e cc 0b da 57 9b 8c 2f 58 0f a9 05 4d e9 de 83 |>...W../X...M...| +00000260 60 e8 1c 77 ef 23 e4 aa 6b c3 15 64 98 f8 b1 72 |`..w.#..k..d...r| +00000270 b2 8a 9e a3 19 3d 73 84 05 53 59 e1 bb e1 db 51 |.....=s..SY....Q| +00000280 49 38 cf 8b ee 3c b6 05 0d ba 62 02 b3 36 dc c1 |I8...<....b..6..| +00000290 e1 52 4d bd 6a c1 3e 55 ff 82 5f e3 7c 84 1c 65 |.RM.j.>U.._.|..e| +000002a0 45 53 b9 c0 56 99 ac 56 d7 4a fa 72 3e 63 36 06 |ES..V..V.J.r>c6.| +000002b0 d3 60 ef 34 05 3f 57 20 79 14 03 03 00 01 01 16 |.`.4.?W y.......| +000002c0 03 03 00 28 00 00 00 00 00 00 00 00 00 26 b7 73 |...(.........&.s| +000002d0 b5 e9 b3 8a 63 00 9b 36 a0 cf 2a 60 0f 8a 59 75 |....c..6..*`..Yu| +000002e0 08 71 97 dc 66 73 15 04 08 b4 d3 91 |.q..fs......| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 d2 b2 3f a8 43 |..........(..?.C| +00000010 41 1a 85 20 9f ee 21 6a c5 96 cf 7c 01 8e f6 3a |A.. ..!j...|...:| +00000020 e3 29 14 68 ea 74 a3 ef 85 04 78 33 db c7 d4 c9 |.).h.t....x3....| +00000030 a2 fd 6a |..j| +>>> Flow 5 (client to server) +00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 c3 3b 68 |..............;h| +00000010 b5 e9 4d 75 22 92 fb 19 85 88 38 97 12 3f ce ca |..Mu".....8..?..| +00000020 36 c0 d6 15 03 03 00 1a 00 00 00 00 00 00 00 02 |6...............| +00000030 c1 a9 03 81 61 04 7c 86 24 e9 90 22 59 6f c7 bc |....a.|.$.."Yo..| +00000040 c2 a1 |..| diff --git a/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-PSS-Disabled b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-PSS-Disabled new file mode 100644 index 0000000000000..98d718bab2b7f --- /dev/null +++ b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-PSS-Disabled @@ -0,0 +1,138 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 f8 01 00 00 f4 03 03 00 00 00 00 00 |................| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 00 |........... ....| +00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 32 cc a8 |.............2..| +00000050 cc a9 c0 2f c0 2b c0 30 c0 2c c0 27 c0 13 c0 23 |.../.+.0.,.'...#| +00000060 c0 09 c0 14 c0 0a 00 9c 00 9d 00 3c 00 2f 00 35 |...........<./.5| +00000070 c0 12 00 0a 00 05 c0 11 c0 07 13 01 13 03 13 02 |................| +00000080 01 00 00 79 00 05 00 05 01 00 00 00 00 00 0a 00 |...y............| +00000090 0a 00 08 00 1d 00 17 00 18 00 19 00 0b 00 02 01 |................| +000000a0 00 00 0d 00 18 00 16 08 04 08 05 08 06 04 01 04 |................| +000000b0 03 05 01 05 03 06 01 06 03 02 01 02 03 ff 01 00 |................| +000000c0 01 00 00 12 00 00 00 2b 00 09 08 03 04 03 03 03 |.......+........| +000000d0 02 03 01 00 33 00 26 00 24 00 1d 00 20 2f e5 7d |....3.&.$... /.}| +000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..| +000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t| +>>> Flow 2 (server to client) +00000000 16 03 03 00 7a 02 00 00 76 03 03 e5 55 1c 7e bc |....z...v...U.~.| +00000010 05 a3 af 8b 02 03 6a 08 34 35 43 9f 35 c1 39 36 |......j.45C.5.96| +00000020 97 ab d9 4f 77 26 88 31 f8 1c a4 20 00 00 00 00 |...Ow&.1... ....| +00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 01 00 00 |................| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 63 |..+.....3.$... c| +00000060 74 2f 45 26 f4 7c cd d6 cb 8d 9f b5 6b 88 41 ef |t/E&.|......k.A.| +00000070 f4 cd 00 54 91 29 98 e4 a0 6b 6d b5 2f 39 01 14 |...T.)...km./9..| +00000080 03 03 00 01 01 17 03 03 00 17 e6 81 13 75 85 fe |.............u..| +00000090 7d c6 09 24 01 bf 44 78 65 4e 5f d0 37 b9 89 15 |}..$..DxeN_.7...| +000000a0 98 17 03 03 00 42 88 5c b3 19 ee 62 c0 2d 95 51 |.....B.\...b.-.Q| +000000b0 fd 88 e0 13 aa 53 e5 5a 45 be 0f 07 6f 46 c8 1b |.....S.ZE...oF..| +000000c0 a2 b5 2a 7c 46 5f b5 90 46 95 b9 a4 ce 44 a8 a7 |..*|F_..F....D..| +000000d0 3d 8e ce d2 76 57 44 e0 0e 83 af f3 2f 00 55 cb |=...vWD...../.U.| +000000e0 1f e7 d2 42 22 6f 78 0c 17 03 03 02 6d 45 f7 95 |...B"ox.....mE..| +000000f0 68 b9 ad 32 13 34 84 c2 dd 62 a7 f5 18 0f 0b a6 |h..2.4...b......| +00000100 b8 5c dd 06 69 0d 07 ea 6b ec ad ad a7 13 ea f3 |.\..i...k.......| +00000110 87 9b 74 a9 53 49 b3 a9 ff f3 eb 71 1b 25 63 8b |..t.SI.....q.%c.| +00000120 c6 0f 6a 21 bc f1 fb 4b 8e d4 07 6e c6 8e 9f bf |..j!...K...n....| +00000130 73 eb 1e a5 d7 e4 a1 cd 6e 7e de 45 a2 b4 6f 25 |s.......n~.E..o%| +00000140 fe c2 a1 84 b8 09 d1 65 90 6d ef 07 ea d0 25 01 |.......e.m....%.| +00000150 54 f2 8e f8 53 38 1e 35 a9 af be 2a 8d 81 9b 77 |T...S8.5...*...w| +00000160 38 22 42 b8 56 ea 72 ab c3 ac 9b 17 1a 0b 65 94 |8"B.V.r.......e.| +00000170 8a 81 6d 83 c6 f4 76 32 ed f7 84 4d ec 17 0e 45 |..m...v2...M...E| +00000180 74 e8 ba b0 46 92 62 8c 73 07 a8 1f d5 d3 44 d1 |t...F.b.s.....D.| +00000190 53 21 62 8b 02 c6 20 40 1d f1 75 2b 8a 6a 60 2a |S!b... @..u+.j`*| +000001a0 ee 04 5f c0 46 6d 74 7a 18 4a e0 ca d4 a6 6a a2 |.._.Fmtz.J....j.| +000001b0 11 21 20 4a 3e 57 3c 67 ff 61 3d 15 32 14 f2 01 |.! J>W.$..@.| +00000250 10 59 17 11 6f 3c 11 8b eb b2 42 e7 d5 b7 ee d2 |.Y..o<....B.....| +00000260 ae 95 9c 21 48 34 d9 5a 20 95 7c 72 35 05 5e 6c |...!H4.Z .|r5.^l| +00000270 a2 05 46 30 e6 33 d3 91 ac c8 17 4b b1 15 cc f0 |..F0.3.....K....| +00000280 af bb 7c 56 e0 5b 25 8e 35 e0 2e 35 91 0d e0 bc |..|V.[%.5..5....| +00000290 f6 9c 3b 15 f8 96 dc 4e 6c aa 57 c9 f0 1f 55 e2 |..;....Nl.W...U.| +000002a0 d9 5d 09 71 f9 af 17 69 29 d5 94 8a 5f fa b2 ad |.].q...i)..._...| +000002b0 1b b9 ce 90 e7 bd 02 1b ad 9d 91 19 7e f3 8f 2d |............~..-| +000002c0 70 d5 af 2c e7 29 b1 f9 3c 5a 7f 04 6f 73 88 da |p..,.)...'B.| +00000320 6f 13 da a1 b2 b1 43 76 69 eb f1 c6 e2 b5 6c 57 |o.....Cvi.....lW| +00000330 e0 88 c9 0d 7d 37 1b 0b a0 b7 cd 6b ba 3a 52 55 |....}7.....k.:RU| +00000340 61 c6 5c 71 ce 1e 69 b9 ea b4 c6 a5 78 c5 b8 b6 |a.\q..i.....x...| +00000350 4e b1 94 84 a3 d4 31 d9 3b 15 17 03 03 00 99 6c |N.....1.;......l| +00000360 5d dd 43 24 9d 6e 5d 64 d3 54 30 aa 98 c3 7e 21 |].C$.n]d.T0...~!| +00000370 05 06 fc 3b eb 52 12 36 6b 2e e1 32 5a 59 30 a7 |...;.R.6k..2ZY0.| +00000380 b0 bb 52 1a 36 e6 78 20 84 8c cf 0d 90 da c7 88 |..R.6.x ........| +00000390 c4 2f bc b4 b6 03 1b 34 9b c8 12 db bc 87 95 d3 |./.....4........| +000003a0 84 4e 41 c1 de 2f 4c 66 d9 13 fc 78 31 05 6c 67 |.NA../Lf...x1.lg| +000003b0 e3 3d 28 36 0f fe 5f 45 29 d2 1b 4d a5 60 dc f7 |.=(6.._E)..M.`..| +000003c0 20 74 cf f5 7b 3f f7 58 53 0c 64 7d 3f c6 f1 ac | t..{?.XS.d}?...| +000003d0 a9 1b 60 d8 ea a5 32 11 23 6d 66 19 70 2b fa ce |..`...2.#mf.p+..| +000003e0 c8 f6 9d cc 12 83 a1 e1 4b be 98 d3 c2 56 65 34 |........K....Ve4| +000003f0 73 3a b3 6e d8 2c db 3b 17 03 03 00 35 e6 ce 17 |s:.n.,.;....5...| +00000400 e5 92 38 9e 00 2d 66 bf a9 e2 13 66 01 af 64 15 |..8..-f....f..d.| +00000410 8d da 6b f3 a7 f6 5c 76 e1 f4 c4 2f dc 93 c4 3c |..k...\v.../...<| +00000420 69 5a 30 e5 db 5a b5 0b 98 4e 43 a3 51 ba 41 9d |iZ0..Z...NC.Q.A.| +00000430 18 c0 |..| +>>> Flow 3 (client to server) +00000000 14 03 03 00 01 01 17 03 03 02 11 24 0f 0c cc 6a |...........$...j| +00000010 8e 07 9c d7 f9 84 55 cc 79 a7 c1 c5 fb 6e 29 5e |......U.y....n)^| +00000020 31 e1 b1 00 c0 c9 a8 94 59 75 f4 b5 86 7c a4 8c |1.......Yu...|..| +00000030 8d 79 dd 42 45 67 69 f5 fb f0 02 54 f5 8f 1a 86 |.y.BEgi....T....| +00000040 2f a0 4e 9b 68 e2 69 36 48 cb 8e cc 26 fa 1b 60 |/.N.h.i6H...&..`| +00000050 c8 f3 b7 7c 36 dd 59 71 a3 f8 9a 7a bc 8a e1 10 |...|6.Yq...z....| +00000060 8f 6d 69 60 07 b6 62 6d d3 2b fa a4 81 eb ae 3f |.mi`..bm.+.....?| +00000070 9d 7e 1d d7 d1 89 24 4e 7e 65 4b d2 37 58 b2 56 |.~....$N~eK.7X.V| +00000080 a1 8e 10 73 44 9c f1 c7 60 97 49 99 e2 82 74 58 |...sD...`.I...tX| +00000090 e3 1f 41 ec 1d 13 85 f1 95 98 39 cb d1 51 f7 0e |..A.......9..Q..| +000000a0 fe e4 fa 04 20 1a f2 c5 ae 64 9d eb f8 ff 03 ce |.... ....d......| +000000b0 ca 12 7c dd a6 b4 2c a3 eb 8e 83 2c cf 77 6b 82 |..|...,....,.wk.| +000000c0 68 77 58 5d 3e ef 01 0b 78 e9 37 b0 36 9c 62 44 |hwX]>...x.7.6.bD| +000000d0 88 ae f1 5a d7 93 81 0a 84 cf 4f 3b db 05 41 92 |...Z......O;..A.| +000000e0 4d 31 3d 06 9e 73 11 43 de 3e ec b8 b0 48 99 84 |M1=..s.C.>...H..| +000000f0 bc 0c 7c 86 93 03 d5 5f c5 21 34 a5 cc c7 d5 42 |..|...._.!4....B| +00000100 1d 69 94 53 39 d9 56 07 40 46 44 89 e6 95 8d e9 |.i.S9.V.@FD.....| +00000110 ca 6d f0 e0 2a 22 70 bc e7 7f 8e 15 0c 56 51 e3 |.m..*"p......VQ.| +00000120 46 5c b9 66 c5 8b 07 d3 f0 bb 84 fe 71 d6 a2 90 |F\.f........q...| +00000130 d9 ec 46 00 82 10 38 9c 8f 35 e5 48 d8 82 7f 65 |..F...8..5.H...e| +00000140 68 f5 42 48 74 6b 29 79 f3 32 b6 a1 aa 42 73 e3 |h.BHtk)y.2...Bs.| +00000150 c3 f6 fc 76 9e 32 59 26 a6 75 4a dc 65 23 73 10 |...v.2Y&.uJ.e#s.| +00000160 35 79 a5 41 7b 72 d5 cd 33 1f 7d 98 b3 39 4b f6 |5y.A{r..3.}..9K.| +00000170 e8 09 ed d6 62 a0 48 b5 76 47 2e 7e 1a 5d 75 6d |....b.H.vG.~.]um| +00000180 c2 98 22 17 b1 8f 2e a5 a2 b3 b3 5e d9 89 c5 a0 |.."........^....| +00000190 46 2a ac af 20 66 e9 f3 02 84 26 51 c0 0a 2e 0c |F*.. f....&Q....| +000001a0 d3 90 3c 9f 19 3f 25 3e 7d 3a 38 6f f3 ce 2f c4 |..<..?%>}:8o../.| +000001b0 7b 84 e4 d5 c2 c8 90 54 6d 2c 59 70 34 44 53 25 |{......Tm,Yp4DS%| +000001c0 ee ee d6 7e 13 30 1e 09 ff f2 79 bd 7c a1 af a9 |...~.0....y.|...| +000001d0 a9 7b 51 6a d8 17 41 22 f5 d0 5d 84 00 a7 5f 1a |.{Qj..A"..]..._.| +000001e0 b6 15 98 de f4 bd cd fe 70 38 5c 0f 44 60 5a 7d |........p8\.D`Z}| +000001f0 be df 6e 56 bb 83 0b 10 fa 5d 3a 2c 9e 4a 00 7f |..nV.....]:,.J..| +00000200 ec f4 42 52 52 95 5e e1 bd cc cf a0 45 c2 79 2c |..BRR.^.....E.y,| +00000210 10 4d 14 35 ad bd 18 d4 b1 aa 09 65 17 03 03 00 |.M.5.......e....| +00000220 99 a4 2c 7a c2 25 ba 3b a2 84 1f e8 a0 d1 5c c4 |..,z.%.;......\.| +00000230 bb c6 f8 fc eb 19 3e f5 e6 53 9f c3 35 d3 7a 00 |......>..S..5.z.| +00000240 68 e1 e0 2f 73 75 d7 2d df 44 aa 34 43 bf 66 c1 |h../su.-.D.4C.f.| +00000250 31 0d e6 86 f8 71 6b 71 ac 89 c5 26 cf d9 1e 43 |1....qkq...&...C| +00000260 33 c3 48 68 e0 4d f5 d5 69 ff fc 02 47 cc 91 41 |3.Hh.M..i...G..A| +00000270 83 41 58 04 2a 02 53 3c 3b 0a 4c 18 16 00 fd e8 |.AX.*.S<;.L.....| +00000280 64 54 0d 34 a1 3d a5 4b bd c2 54 17 c3 5a 82 7a |dT.4.=.K..T..Z.z| +00000290 55 5d a9 57 63 62 ef 8b 3a 75 f2 cd 34 ef d6 30 |U].Wcb..:u..4..0| +000002a0 08 7f 03 0b c3 eb 29 94 88 11 38 42 40 6f bf cc |......)...8B@o..| +000002b0 d4 01 3f 8a 90 11 f9 da fd 9e 17 03 03 00 35 7d |..?...........5}| +000002c0 2d 12 d7 58 d0 76 43 25 d1 8d 5c 5c b1 7f fa 48 |-..X.vC%..\\...H| +000002d0 a9 21 48 02 64 76 91 6c 79 7e b9 22 33 f7 32 cb |.!H.dv.ly~."3.2.| +000002e0 50 22 78 02 96 4e 2d f6 09 68 06 8e 44 e6 fd 7f |P"x..N-..h..D...| +000002f0 cf 0a 7e a3 17 03 03 00 17 84 cd d8 f2 e2 38 2e |..~...........8.| +00000300 57 e5 47 76 48 50 34 9e 65 d4 c6 1d 7d b3 4e 91 |W.GvHP4.e...}.N.| +00000310 17 03 03 00 13 e5 05 98 5b 87 5d db ae 89 38 2c |........[.]...8,| +00000320 35 89 31 14 73 cd 16 54 |5.1.s..T| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled new file mode 100644 index 0000000000000..cb626a1104266 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled @@ -0,0 +1,126 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 97 01 00 00 93 03 03 9e b1 2a 26 04 |.............*&.| +00000010 8d 66 df 43 cb 0a 85 80 4f f2 99 7d 80 20 64 7e |.f.C....O..}. d~| +00000020 30 a0 bb 60 ac 0e d4 ce f0 ae 98 00 00 04 00 2f |0..`.........../| +00000030 00 ff 01 00 00 66 00 00 00 0e 00 0c 00 00 09 31 |.....f.........1| +00000040 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........| +00000050 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................| +00000060 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e 04 03 |...........0....| +00000070 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 |................| +00000080 08 05 08 06 04 01 05 01 06 01 03 03 02 03 03 01 |................| +00000090 02 01 03 02 02 02 04 02 05 02 06 02 |............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..| +00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.| +00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......| +00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.| +00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..| +00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..| +00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..| +000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1| +000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.| +000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...| +000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0| +000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.| +000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6| +00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.| +00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....| +00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......| +00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$| +00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..| +00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u| +00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.| +00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........| +00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.| +00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......| +000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.| +000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>| +000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#| +000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..| +000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0| +000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan| +00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........| +00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...| +00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1| +00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d| +00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..| +00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....| +00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......| +00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..| +00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.| +00000290 3b e9 fa e7 16 03 03 00 1b 0d 00 00 17 02 01 40 |;..............@| +000002a0 00 10 04 01 04 03 05 01 05 03 06 01 06 03 02 01 |................| +000002b0 02 03 00 00 16 03 03 00 04 0e 00 00 00 |.............| +>>> Flow 3 (client to server) +00000000 16 03 03 01 fd 0b 00 01 f9 00 01 f6 00 01 f3 30 |...............0| +00000010 82 01 ef 30 82 01 58 a0 03 02 01 02 02 10 5c 19 |...0..X.......\.| +00000020 c1 89 65 83 55 6f dc 0b c9 b9 93 9f e9 bc 30 0d |..e.Uo........0.| +00000030 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 12 31 |..*.H........0.1| +00000040 10 30 0e 06 03 55 04 0a 13 07 41 63 6d 65 20 43 |.0...U....Acme C| +00000050 6f 30 1e 17 0d 31 36 30 38 31 37 32 31 35 32 33 |o0...16081721523| +00000060 31 5a 17 0d 31 37 30 38 31 37 32 31 35 32 33 31 |1Z..170817215231| +00000070 5a 30 12 31 10 30 0e 06 03 55 04 0a 13 07 41 63 |Z0.1.0...U....Ac| +00000080 6d 65 20 43 6f 30 81 9f 30 0d 06 09 2a 86 48 86 |me Co0..0...*.H.| +00000090 f7 0d 01 01 01 05 00 03 81 8d 00 30 81 89 02 81 |...........0....| +000000a0 81 00 ba 6f aa 86 bd cf bf 9f f2 ef 5c 94 60 78 |...o........\.`x| +000000b0 6f e8 13 f2 d1 96 6f cd d9 32 6e 22 37 ce 41 f9 |o.....o..2n"7.A.| +000000c0 ca 5d 29 ac e1 27 da 61 a2 ee 81 cb 10 c7 df 34 |.])..'.a.......4| +000000d0 58 95 86 e9 3d 19 e6 5c 27 73 60 c8 8d 78 02 f4 |X...=..\'s`..x..| +000000e0 1d a4 98 09 a3 19 70 69 3c 25 62 66 2a ab 22 23 |......pi<%bf*."#| +000000f0 c5 7b 85 38 4f 2e 09 73 32 a7 bd 3e 9b ad ca 84 |.{.8O..s2..>....| +00000100 07 e6 0f 3a ff 77 c5 9d 41 85 00 8a b6 9b ee b0 |...:.w..A.......| +00000110 a4 3f 2d 4c 4c e6 42 3e bb 51 c8 dd 48 54 f4 0c |.?-LL.B>.Q..HT..| +00000120 8e 47 02 03 01 00 01 a3 46 30 44 30 0e 06 03 55 |.G......F0D0...U| +00000130 1d 0f 01 01 ff 04 04 03 02 05 a0 30 13 06 03 55 |...........0...U| +00000140 1d 25 04 0c 30 0a 06 08 2b 06 01 05 05 07 03 01 |.%..0...+.......| +00000150 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 0f |0...U.......0.0.| +00000160 06 03 55 1d 11 04 08 30 06 87 04 7f 00 00 01 30 |..U....0.......0| +00000170 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 03 81 |...*.H..........| +00000180 81 00 46 ab 44 a2 fb 28 54 f8 5a 67 f8 62 94 f1 |..F.D..(T.Zg.b..| +00000190 9a b2 18 9e f2 b1 de 1d 7e 6f 76 95 a9 ba e7 5d |........~ov....]| +000001a0 a8 16 6c 9c f7 09 d3 37 e4 4b 2b 36 7c 01 ad 41 |..l....7.K+6|..A| +000001b0 d2 32 d8 c3 d2 93 f9 10 6b 8e 95 b9 2c 17 8a a3 |.2......k...,...| +000001c0 44 48 bc 59 13 83 16 04 88 a4 81 5c 25 0d 98 0c |DH.Y.......\%...| +000001d0 ac 11 b1 28 56 be 1d cd 61 62 84 09 bf d6 80 c6 |...(V...ab......| +000001e0 45 8d 82 2c b4 d8 83 9b db c9 22 b7 2a 12 11 7b |E..,......".*..{| +000001f0 fa 02 3b c1 c9 ff ea c9 9d a8 49 d3 95 d7 d5 0e |..;.......I.....| +00000200 e5 35 16 03 03 00 86 10 00 00 82 00 80 3f 1b ee |.5...........?..| +00000210 02 ec a5 9f 6e 38 69 2c b7 03 89 65 b4 92 79 a0 |....n8i,...e..y.| +00000220 b2 0b ab 9b 44 9c 68 d1 8e 5c 40 9c b5 1c a5 70 |....D.h..\@....p| +00000230 00 a2 2e fb 98 b7 45 7b 9c 63 46 68 1d 55 9e 01 |......E{.cFh.U..| +00000240 7f 84 31 62 07 c4 2f 20 5f 1a 94 8c 1f f4 3a 6d |..1b../ _.....:m| +00000250 a8 2b b8 08 5b ec 27 e3 49 9e 51 b3 66 98 09 ba |.+..[.'.I.Q.f...| +00000260 64 65 c8 3c 11 fb 14 4a c9 ea 3c 5e 52 10 a0 0b |de.<...J..<^R...| +00000270 a9 fc 10 13 c9 99 0c a0 8b b4 40 66 0e 11 5e 1d |..........@f..^.| +00000280 8b 45 5c 4d 0d 39 39 f6 0c 59 8f 06 99 16 03 03 |.E\M.99..Y......| +00000290 00 88 0f 00 00 84 04 01 00 80 71 1c 9c fd b2 c9 |..........q.....| +000002a0 b9 7f f3 51 e2 63 96 08 56 d2 bd 19 61 9f 3f be |...Q.c..V...a.?.| +000002b0 e5 4c 22 a8 3f 81 98 2d 67 56 4e 2d 61 6e 51 e5 |.L".?..-gVN-anQ.| +000002c0 11 24 bd 1b 38 ba dc 8c 76 51 1d 3c 6e 81 50 9a |.$..8...vQ.| +00000330 8d 82 6c f3 04 55 2c 13 d9 5b 0a 73 88 4f 8b 3c |..l..U,..[.s.O.<| +00000340 cd ef 1a a7 15 7c 33 bb ff fa 01 c4 87 d7 df 47 |.....|3........G| +00000350 37 b6 fe 1d e6 82 c2 8a 33 b1 c9 ae 85 45 c8 0d |7.......3....E..| +00000360 38 47 69 2d 54 |8Gi-T| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....| +00000010 00 00 00 00 00 00 00 00 00 00 00 20 98 12 44 63 |........... ..Dc| +00000020 e7 77 e6 e8 c0 c7 d7 b6 f7 c4 4e 13 e3 79 af 33 |.w........N..y.3| +00000030 3b 6c 86 22 c5 9e dd 25 74 e5 7b 37 fb 24 c6 48 |;l."...%t.{7.$.H| +00000040 c9 74 a7 9b 9b 32 a7 c1 b9 bb e0 17 03 03 00 40 |.t...2.........@| +00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000060 80 d7 ec 51 cf ae d4 1a af 11 59 d1 0c 62 a6 67 |...Q......Y..b.g| +00000070 2e 6f 18 23 29 75 92 07 b1 16 09 8f 2d f8 04 fe |.o.#)u......-...| +00000080 ce 71 2c b6 00 fd 7b 53 cb 6d 97 06 06 e6 af f4 |.q,...{S.m......| +00000090 15 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........| +000000a0 00 00 00 00 00 73 14 3a 87 3b ca 3a 2b b2 52 30 |.....s.:.;.:+.R0| +000000b0 98 62 88 1b a7 58 66 47 66 72 fd bb b6 b7 6b 99 |.b...XfGfr....k.| +000000c0 20 ab e9 22 62 | .."b| diff --git a/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled-Required b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled-Required new file mode 100644 index 0000000000000..86d5415cc8fc3 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled-Required @@ -0,0 +1,74 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 97 01 00 00 93 03 03 d7 9c de f8 62 |...............b| +00000010 7e 32 5b bc d5 12 35 89 42 37 be ca 55 74 24 61 |~2[...5.B7..Ut$a| +00000020 c0 50 91 0f 1b 42 29 9f c1 6a cb 00 00 04 00 2f |.P...B)..j...../| +00000030 00 ff 01 00 00 66 00 00 00 0e 00 0c 00 00 09 31 |.....f.........1| +00000040 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........| +00000050 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................| +00000060 00 16 00 00 00 17 00 00 00 0d 00 30 00 2e 04 03 |...........0....| +00000070 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 |................| +00000080 08 05 08 06 04 01 05 01 06 01 03 03 02 03 03 01 |................| +00000090 02 01 03 02 02 02 04 02 05 02 06 02 |............| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 00 2f 00 00 |...DOWNGRD.../..| +00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.| +00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......| +00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.| +00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..| +00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..| +00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..| +000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1| +000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.| +000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...| +000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0| +000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.| +000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6| +00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.| +00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....| +00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......| +00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$| +00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..| +00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u| +00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.| +00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........| +00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.| +00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......| +000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.| +000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>| +000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#| +000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..| +000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0| +000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan| +00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........| +00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...| +00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1| +00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d| +00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..| +00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....| +00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......| +00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..| +00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.| +00000290 3b e9 fa e7 16 03 03 00 1b 0d 00 00 17 02 01 40 |;..............@| +000002a0 00 10 04 01 04 03 05 01 05 03 06 01 06 03 02 01 |................| +000002b0 02 03 00 00 16 03 03 00 04 0e 00 00 00 |.............| +>>> Flow 3 (client to server) +00000000 16 03 03 00 07 0b 00 00 03 00 00 00 16 03 03 00 |................| +00000010 86 10 00 00 82 00 80 1d c6 6c b0 b9 b3 41 06 80 |.........l...A..| +00000020 e0 f5 df 06 ae 0f 2f 5f 72 14 44 47 16 c4 f0 a6 |....../_r.DG....| +00000030 68 be fa ee ec 9b 38 b0 e4 bd a3 e9 ca 18 5b 25 |h.....8.......[%| +00000040 33 31 57 86 63 59 0e ce 10 77 f8 42 a6 5c ad 3f |31W.cY...w.B.\.?| +00000050 80 85 a5 c1 06 4c 36 aa f3 ee 62 39 66 69 76 51 |.....L6...b9fivQ| +00000060 57 cc a0 b1 35 81 d5 38 01 2d 83 0e 2e 6b a9 84 |W...5..8.-...k..| +00000070 0d 8b 29 93 90 78 2d 0d 33 5f 85 0d 00 0c e2 5f |..)..x-.3_....._| +00000080 83 21 28 27 83 ad 9d 19 2d 01 35 6d 85 2e 8d 6b |.!('....-.5m...k| +00000090 eb 7a cd 8a 3f 42 e2 14 03 03 00 01 01 16 03 03 |.z..?B..........| +000000a0 00 40 5e 19 0f d0 4c 17 e0 25 e6 6b a1 d9 ea 59 |.@^...L..%.k...Y| +000000b0 f4 3a 55 84 2c 50 1e 53 47 78 45 b8 97 f7 7f 3d |.:U.,P.SGxE....=| +000000c0 af d9 7a ad 30 30 77 1a 93 05 19 5b 9b 13 70 e0 |..z.00w....[..p.| +000000d0 e0 f8 ba 6a bd 74 c5 71 0d 5a 2c 3f 2d 98 1a 3c |...j.t.q.Z,?-..<| +000000e0 5a 7d |Z}| +>>> Flow 4 (server to client) +00000000 15 03 03 00 02 02 2a |......*| diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled b/src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled new file mode 100644 index 0000000000000..302e64e60f36d --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled @@ -0,0 +1,84 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 cb 01 00 00 c7 03 03 ed 3d 3e 10 95 |............=>..| +00000010 8b 6f 6c be 5c b7 77 c0 79 91 f8 b3 6f 52 27 18 |.ol.\.w.y...oR'.| +00000020 0a b7 88 52 df 3c 6c 87 b4 5a 4c 00 00 38 c0 2c |...R.>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..| +00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.| +00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......| +00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.| +00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..| +00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..| +00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..| +000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1| +000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.| +000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...| +000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0| +000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.| +000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6| +00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.| +00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....| +00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......| +00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$| +00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..| +00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u| +00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.| +00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........| +00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.| +00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......| +000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.| +000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>| +000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#| +000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..| +000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0| +000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan| +00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........| +00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...| +00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1| +00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d| +00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..| +00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....| +00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......| +00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..| +00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.| +00000290 3b e9 fa e7 16 03 03 00 ac 0c 00 00 a8 03 00 1d |;...............| +000002a0 20 2f e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 | /.}.G.bC.(.._.)| +000002b0 07 30 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b |.0.........._X.;| +000002c0 74 04 01 00 80 a5 a9 75 be 51 ff dc b3 bb 77 79 |t......u.Q....wy| +000002d0 ef 5b 9f d9 27 6c 76 ea ce 5c 66 20 03 2e 94 fd |.[..'lv..\f ....| +000002e0 28 94 69 ff 06 ab bd 34 43 51 72 fb 15 42 e6 38 |(.i....4CQr..B.8| +000002f0 c5 7a 5d 7f 35 a7 3c 85 ec df 95 23 0f 28 c7 dc |.z].5.<....#.(..| +00000300 0e a6 ec fe 5e 77 3f 95 1d a7 73 1d d8 7b 68 92 |....^w?...s..{h.| +00000310 5b a5 b8 ba f5 7c a5 60 2e 43 d6 60 64 3e 33 c7 |[....|.`.C.`d>3.| +00000320 8b c2 56 68 e3 28 2b 2e 8b 9a 85 29 77 73 24 3e |..Vh.(+....)ws$>| +00000330 2b 95 b8 40 a7 f1 60 b5 9e 85 3e 1d ae ab 7f 85 |+..@..`...>.....| +00000340 63 63 d1 cf 62 16 03 03 00 04 0e 00 00 00 |cc..b.........| +>>> Flow 3 (client to server) +00000000 16 03 03 00 25 10 00 00 21 20 43 dd 3e 28 34 9f |....%...! C.>(4.| +00000010 a9 0c 8e 14 66 01 a1 dd 15 8e 71 b4 05 83 d9 a3 |....f.....q.....| +00000020 5f 5c a3 31 ad 5c d5 5a ad 56 14 03 03 00 01 01 |_\.1.\.Z.V......| +00000030 16 03 03 00 28 f3 ad d2 ec 9e 1e 85 2d 96 5f bc |....(.......-._.| +00000040 70 cc 0a c2 22 ef 0a fe fb b0 77 f1 59 59 08 a6 |p...".....w.YY..| +00000050 57 39 16 00 82 0b 60 1e 9a 74 75 3a 8a |W9....`..tu:.| +>>> Flow 4 (server to client) +00000000 14 03 03 00 01 01 16 03 03 00 28 00 00 00 00 00 |..........(.....| +00000010 00 00 00 cf 63 14 29 73 c7 7b 6c 98 50 db 5f 8e |....c.)s.{l.P._.| +00000020 f4 de 68 bc c0 60 2c db 9e 1f d9 48 55 51 05 47 |..h..`,....HUQ.G| +00000030 7e 43 37 17 03 03 00 25 00 00 00 00 00 00 00 01 |~C7....%........| +00000040 67 0a e7 77 dd 1a 30 87 27 90 b0 42 31 42 09 53 |g..w..0.'..B1B.S| +00000050 03 bf 0c 10 3a c3 a7 95 e9 6e 63 57 ad 15 03 03 |....:....ncW....| +00000060 00 1a 00 00 00 00 00 00 00 02 d5 1a ac 66 50 93 |.............fP.| +00000070 46 0a da 98 1f cc 30 40 c1 47 c7 88 |F.....0@.G..| diff --git a/src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled-Required b/src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled-Required new file mode 100644 index 0000000000000..9e9570fed0c22 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled-Required @@ -0,0 +1,54 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 91 01 00 00 8d 03 03 5a 8a 66 22 31 |...........Z.f"1| +00000010 69 92 30 d5 7b 7c 17 a7 7c 14 d6 3c a9 9e ba dd |i.0.{|..|..<....| +00000020 7c 73 fe b4 b4 dd d8 28 39 32 0d 00 00 2a c0 30 ||s.....(92...*.0| +00000030 00 9f cc a8 cc aa c0 2f 00 9e c0 28 00 6b c0 27 |......./...(.k.'| +00000040 00 67 c0 14 00 39 c0 13 00 33 00 9d 00 9c 00 3d |.g...9...3.....=| +00000050 00 3c 00 35 00 2f 00 ff 01 00 00 3a 00 00 00 0e |.<.5./.....:....| +00000060 00 0c 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b |.....127.0.0.1..| +00000070 00 04 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 |................| +00000080 00 1e 00 19 00 18 00 16 00 00 00 17 00 00 00 0d |................| +00000090 00 04 00 02 08 04 |......| +>>> Flow 2 (server to client) +00000000 16 03 03 00 31 02 00 00 2d 03 03 00 00 00 00 00 |....1...-.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 44 4f 57 4e 47 52 44 01 00 c0 30 00 00 |...DOWNGRD...0..| +00000030 05 ff 01 00 01 00 16 03 03 02 59 0b 00 02 55 00 |..........Y...U.| +00000040 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......| +00000050 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..| +00000060 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.| +00000070 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..| +00000080 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..| +00000090 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..| +000000a0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1| +000000b0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.| +000000c0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...| +000000d0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0| +000000e0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.| +000000f0 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6| +00000100 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.| +00000110 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....| +00000120 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......| +00000130 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$| +00000140 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..| +00000150 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u| +00000160 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.| +00000170 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........| +00000180 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.| +00000190 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......| +000001a0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.| +000001b0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>| +000001c0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#| +000001d0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..| +000001e0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0| +000001f0 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan| +00000200 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........| +00000210 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...| +00000220 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1| +00000230 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d| +00000240 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..| +00000250 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....| +00000260 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......| +00000270 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..| +00000280 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.| +00000290 3b e9 fa e7 15 03 03 00 02 02 28 |;.........(| diff --git a/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven-PSS-Disabled b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven-PSS-Disabled new file mode 100644 index 0000000000000..89361f155772b --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven-PSS-Disabled @@ -0,0 +1,182 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 e0 01 00 00 dc 03 03 32 03 2a b3 ed |...........2.*..| +00000010 c2 1a 71 f2 ff ea 0b 1c fa f9 c6 88 03 7c 84 89 |..q..........|..| +00000020 4e 45 60 81 d9 58 dc 9f 0a 60 d1 20 ce 4d 59 a5 |NE`..X...`. .MY.| +00000030 10 b1 76 53 f5 77 26 fd 17 08 f9 e5 14 03 c4 0a |..vS.w&.........| +00000040 65 fd 83 bb a9 3b 24 05 24 1b ef 00 00 08 13 02 |e....;$.$.......| +00000050 13 03 13 01 00 ff 01 00 00 8b 00 00 00 0e 00 0c |................| +00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....| +00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................| +00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 1e |................| +00000090 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................| +000000a0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 00 2b |...............+| +000000b0 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 |......-.....3.&.| +000000c0 24 00 1d 00 20 06 b0 03 80 81 d6 e7 f4 31 85 4c |$... ........1.L| +000000d0 e3 50 35 c1 df 6e 28 9f 38 ce c0 7b fc 71 00 8c |.P5..n(.8..{.q..| +000000e0 9a 25 07 95 57 |.%..W| +>>> Flow 2 (server to client) +00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 20 ce 4d 59 a5 |........... .MY.| +00000030 10 b1 76 53 f5 77 26 fd 17 08 f9 e5 14 03 c4 0a |..vS.w&.........| +00000040 65 fd 83 bb a9 3b 24 05 24 1b ef 00 13 02 00 00 |e....;$.$.......| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /| +00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0| +00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.| +00000080 03 03 00 01 01 17 03 03 00 17 ad ce ff 21 b8 39 |.............!.9| +00000090 16 f6 10 6e 8d 6c 0f 46 2f 58 55 b3 e4 4f 2d 5c |...n.l.F/XU..O-\| +000000a0 26 17 03 03 00 3c fd 24 07 75 28 2b f2 ec d9 74 |&....<.$.u(+...t| +000000b0 f0 76 e4 02 e6 02 bd 47 58 0f 68 60 ac 6c 59 a8 |.v.....GX.h`.lY.| +000000c0 87 94 b9 cb c3 fa 41 15 4c 95 b8 58 da 8c d9 ea |......A.L..X....| +000000d0 3a ab 0c 06 83 a5 2b d1 39 6f 32 92 bf e1 c0 f4 |:.....+.9o2.....| +000000e0 49 51 17 03 03 02 6d 22 dc 8c fc ae 21 96 41 17 |IQ....m"....!.A.| +000000f0 45 93 6e 08 61 6b 46 b9 9a cf 2e 79 a8 1a 46 30 |E.n.akF....y..F0| +00000100 a4 de 3d 53 87 bf 57 3a 44 4f 5b 3f c9 b2 f0 0e |..=S..W:DO[?....| +00000110 56 5f 5a ee 5a 1f df cc fe f3 54 ab 87 d7 bb 00 |V_Z.Z.....T.....| +00000120 2c 61 de ad 31 9c d4 cf 43 bf e7 84 d1 1d 3c cb |,a..1...C.....<.| +00000130 82 d1 81 9d 13 90 6b c8 fd 01 53 4f 13 a5 91 a4 |......k...SO....| +00000140 fe 20 ce 2c 34 96 62 b7 6f f0 f0 65 f0 01 18 99 |. .,4.b.o..e....| +00000150 31 3d cb c6 72 6f 54 d6 ec fa a3 dd 94 67 6b b9 |1=..roT......gk.| +00000160 ff 2c 41 ba 00 d5 25 ba b1 7a e5 d2 1c 0b 37 ad |.,A...%..z....7.| +00000170 df 0b 62 be b3 69 5b 84 39 2d 72 c2 b9 ec 68 87 |..b..i[.9-r...h.| +00000180 32 23 92 4b a8 f0 17 25 0f d7 86 97 45 65 73 e1 |2#.K...%....Ees.| +00000190 49 c4 3c 8d 26 43 34 06 4c be 50 76 ae 63 6f 1d |I.<.&C4.L.Pv.co.| +000001a0 ed 57 93 5a 7f 98 e2 1e 5f 94 74 a2 54 59 63 12 |.W.Z...._.t.TYc.| +000001b0 bb 8b df 77 20 3a 9c ea c7 40 b0 cf 8e 7f f8 98 |...w :...@......| +000001c0 06 92 38 be 77 11 17 03 c2 ac af fc 8d 7d d5 6b |..8.w........}.k| +000001d0 f7 2b 7a f3 b8 dc b0 cf 3e f7 c5 f4 b3 34 4b 06 |.+z.....>....4K.| +000001e0 c6 ed b5 dc 0c 2d 4e bc 03 94 cc 03 f2 9f 5d c6 |.....-N.......].| +000001f0 57 36 5a 01 81 65 27 75 1d 4f 22 9f b5 da 7f e2 |W6Z..e'u.O".....| +00000200 7d 36 f3 4b 05 3f 40 47 c6 1b af e6 99 c0 ca 35 |}6.K.?@G.......5| +00000210 98 c8 30 60 7b 42 4e e7 5c 90 28 d7 4e db f3 78 |..0`{BN.\.(.N..x| +00000220 22 e2 a3 86 0c 9e 19 43 0e 89 d4 f6 78 38 21 16 |"......C....x8!.| +00000230 84 38 36 6a 2d a5 94 2c 52 2b 00 de 67 16 e8 89 |.86j-..,R+..g...| +00000240 32 21 0e fd b0 23 91 06 8b fa 82 70 21 bc 1f 29 |2!...#.....p!..)| +00000250 32 af f4 b9 15 7f aa 22 c1 e8 e3 2c 92 b4 d8 2a |2......"...,...*| +00000260 64 58 f4 f1 85 85 14 92 f3 16 8e 2d 5b a6 7e ef |dX.........-[.~.| +00000270 22 5a 58 bb 4c f1 36 70 2f ca 03 df fb 0a d0 03 |"ZX.L.6p/.......| +00000280 55 5d d9 6b 63 48 d2 75 82 d4 56 af 17 5a 60 4f |U].kcH.u..V..Z`O| +00000290 af 8b 17 d6 fd 96 be 3d 82 25 0e 73 2e 58 0e 0a |.......=.%.s.X..| +000002a0 5c 2d c8 f5 17 b0 ae 7d 39 90 cb 75 bb 4b 33 22 |\-.....}9..u.K3"| +000002b0 bd a2 02 00 70 43 a8 54 ee 7c 25 d5 d7 88 08 f6 |....pC.T.|%.....| +000002c0 3f 34 61 55 f5 d3 53 0c 8c b1 9b fd 4e d9 65 7a |?4aU..S.....N.ez| +000002d0 2b 6e b4 d5 37 34 18 f3 14 00 9f 56 40 d9 15 ea |+n..74.....V@...| +000002e0 59 5a 4b 4a bb f7 19 72 60 4a 08 8f 75 d6 7b a4 |YZKJ...r`J..u.{.| +000002f0 de 79 c5 21 1a cb 82 97 b3 88 d8 ae 65 30 cc 56 |.y.!........e0.V| +00000300 da a3 04 5c 63 f4 44 a5 eb 05 55 ad 78 46 44 ac |...\c.D...U.xFD.| +00000310 56 2e f6 f7 eb 47 f6 f1 62 8d df 27 7d 86 5e 58 |V....G..b..'}.^X| +00000320 5f 4c 34 6e f6 c0 fd 56 7d 46 82 5d 53 db 2a 84 |_L4n...V}F.]S.*.| +00000330 45 db e7 9c b9 23 32 59 cf 85 f7 12 c5 e8 9e 3c |E....#2Y.......<| +00000340 2d 3f 81 a5 24 cf 36 ad d6 65 02 35 84 de 43 f8 |-?..$.6..e.5..C.| +00000350 04 e2 8b ae 17 03 03 00 99 ce e8 48 a3 34 5e fb |...........H.4^.| +00000360 76 f1 e4 3b da 94 0a 25 ee 78 f6 31 24 10 05 25 |v..;...%.x.1$..%| +00000370 9c e5 ca fc ef c5 66 86 08 15 d8 69 75 d8 49 e9 |......f....iu.I.| +00000380 9b 86 71 3f 1f 41 ee f0 bc 8d 4e aa bc 30 f0 8f |..q?.A....N..0..| +00000390 7b b1 94 7e aa 74 3f eb 23 c5 c9 aa 9a c3 f7 12 |{..~.t?.#.......| +000003a0 23 30 95 2e e1 1b 9c fe 8b 50 b1 d9 17 cf af a1 |#0.......P......| +000003b0 ff ce 8d fa 7e bd 23 59 d0 7a fb 30 12 f4 8d 86 |....~.#Y.z.0....| +000003c0 0c 3c fd 03 50 d4 7f bb f6 fa ba 1d fc 32 cc 7e |.<..P........2.~| +000003d0 12 3a 33 90 c6 82 5d 6a 90 23 6d b8 e6 60 7d d3 |.:3...]j.#m..`}.| +000003e0 a8 f0 0c 75 bc b5 67 68 ed 58 ef 4d ac 91 47 c9 |...u..gh.X.M..G.| +000003f0 c4 bc 17 03 03 00 45 ae 0d 8d 76 8d 28 34 1b 09 |......E...v.(4..| +00000400 4d d5 df 2e aa f8 ff 71 b2 0e 60 a1 ce 8a 58 9c |M......q..`...X.| +00000410 45 64 31 6c 9b 46 66 64 27 98 e6 f3 93 e8 92 81 |Ed1l.Ffd'.......| +00000420 3d 4f db da 98 72 0d b7 71 27 ac 2b 61 81 97 0b |=O...r..q'.+a...| +00000430 e7 ae 32 d7 e2 66 4d 5d f7 01 d0 77 |..2..fM]...w| +>>> Flow 3 (client to server) +00000000 14 03 03 00 01 01 17 03 03 02 11 f6 03 90 9e bc |................| +00000010 dc 00 9b f9 dd 7b 65 dd b0 69 b4 b5 42 fc 25 f2 |.....{e..i..B.%.| +00000020 2b 7e be 52 1a 4b f1 e4 21 94 0d 88 4a 58 07 37 |+~.R.K..!...JX.7| +00000030 67 c7 e3 c4 62 eb 17 57 5d 52 d4 a9 03 39 0e 7d |g...b..W]R...9.}| +00000040 d0 c3 1a 8d ef ec b7 a8 9b 93 50 0d 7f fd a1 10 |..........P.....| +00000050 b6 82 99 21 3f e3 3d 3d 47 04 c3 cd a7 b3 ab e0 |...!?.==G.......| +00000060 f6 33 47 0e 1c 30 36 45 21 32 34 c2 2c 72 20 72 |.3G..06E!24.,r r| +00000070 b6 c7 5b 95 8a 97 84 54 2e d0 5f d5 80 e7 8f 7a |..[....T.._....z| +00000080 6f 50 96 8a 33 13 c6 97 85 25 47 6b 8a b2 a0 29 |oP..3....%Gk...)| +00000090 cd 7f 0e 38 94 53 08 8b c3 2f 89 a2 10 c2 22 5a |...8.S.../...."Z| +000000a0 95 42 a3 45 73 a8 d0 ac 6d ba 95 a4 51 63 b9 b4 |.B.Es...m...Qc..| +000000b0 79 61 be dd c6 ab 97 72 38 30 63 55 a7 7d 9a eb |ya.....r80cU.}..| +000000c0 bb 5a f6 d0 3d 05 81 5d 0e e5 7a 8b ae fe d2 3b |.Z..=..]..z....;| +000000d0 db 85 3a 13 81 ee 36 b3 ff 41 47 d1 67 bf 17 5e |..:...6..AG.g..^| +000000e0 9d a3 4c 92 51 a9 1b 4b ca 13 f6 ee 8a e5 b3 01 |..L.Q..K........| +000000f0 e7 87 ee 1e 2a 9e 56 3d 01 7e 0f cb e5 d6 ea 13 |....*.V=.~......| +00000100 05 3e 8c 5a 24 d0 36 6b 54 9f 8e 3f 07 73 a0 bf |.>.Z$.6kT..?.s..| +00000110 84 c2 90 72 ce 48 50 49 47 27 b3 14 56 5c c7 63 |...r.HPIG'..V\.c| +00000120 7e 7e b5 8f 9d 6d 70 32 6f 3f 4d 53 80 ae f6 2b |~~...mp2o?MS...+| +00000130 fb c9 7a de 76 aa 68 a3 9b a9 a7 47 55 d0 cb f8 |..z.v.h....GU...| +00000140 e8 c4 1c f5 0f 54 82 5b c5 45 18 41 05 da 72 ce |.....T.[.E.A..r.| +00000150 84 d1 8b 00 40 e9 f9 cf b5 d5 3e 71 ee 25 dc 7d |....@.....>q.%.}| +00000160 3b 00 67 68 9d 78 d2 c0 7b cb 5d 9e 79 2c b5 f4 |;.gh.x..{.].y,..| +00000170 1b ea b8 d8 de bd 36 71 2a 26 49 44 1b 5b 92 ad |......6q*&ID.[..| +00000180 1c 2d 2f ab 8e 15 d7 b3 96 89 da 58 77 75 42 32 |.-/........XwuB2| +00000190 c3 6b f1 5e 0b da 91 71 1e d5 f1 dd 32 d8 b6 a5 |.k.^...q....2...| +000001a0 21 a1 1d 5e b1 df 01 37 33 ac 93 11 94 6d b8 e6 |!..^...73....m..| +000001b0 3b be 86 31 da cf b6 ab cd f5 12 4f 85 45 24 06 |;..1.......O.E$.| +000001c0 34 40 7b c5 f8 5f c3 f9 3b cf 9d 2a b3 2e 65 e4 |4@{.._..;..*..e.| +000001d0 0e ed fc 7c b4 2b 32 bf 0e 8f b3 85 93 74 8b e8 |...|.+2......t..| +000001e0 25 e0 47 c0 d8 52 8e c9 ed 7f 16 41 3f b3 79 d8 |%.G..R.....A?.y.| +000001f0 d1 47 19 ae fb ab 97 a5 b2 42 7c a0 73 ad 4f 62 |.G.......B|.s.Ob| +00000200 cf 35 52 7c d6 47 b8 1f e9 65 b0 99 f7 67 e7 64 |.5R|.G...e...g.d| +00000210 14 83 46 c7 90 6e 4d 01 3a c2 e6 19 17 03 03 00 |..F..nM.:.......| +00000220 99 a5 e0 38 3a 91 4a 1d 87 9a eb a6 95 87 35 fc |...8:.J.......5.| +00000230 ae 42 8d 3a fe f6 39 f3 c2 c2 f0 9a f5 8f b5 75 |.B.:..9........u| +00000240 18 6b 84 c0 5b 96 6a 9c 0c aa 81 fc 9a 2e 01 f7 |.k..[.j.........| +00000250 d8 b1 5d 4a 54 cf 79 90 fb 79 57 ff d9 d1 46 59 |..]JT.y..yW...FY| +00000260 02 84 3d ee cc 68 ea 05 1d a2 79 fb 1d 1e d6 ad |..=..h....y.....| +00000270 5b 95 3b 6b 9a c9 07 e5 e4 20 07 6a a0 74 c8 1a |[.;k..... .j.t..| +00000280 31 53 a4 e6 bb bb 28 61 47 41 d5 f3 45 38 71 86 |1S....(aGA..E8q.| +00000290 35 12 f4 8a f2 e4 e9 ae 96 a9 14 ce 8a 1c 5d 59 |5.............]Y| +000002a0 3c d7 3a e7 93 35 c2 53 9f d8 4d cb 98 bd e1 72 |<.:..5.S..M....r| +000002b0 a8 80 55 a6 cd 9c 50 41 ec 50 17 03 03 00 45 2d |..U...PA.P....E-| +000002c0 90 3b 73 cc 24 52 ad 22 90 0e 7d bf 2a a2 44 09 |.;s.$R."..}.*.D.| +000002d0 e2 43 61 f2 48 9b 73 85 00 05 8b 0a 51 ad a0 c0 |.Ca.H.s.....Q...| +000002e0 64 ef 5e 11 86 37 b0 32 af 11 f7 98 7b 74 39 90 |d.^..7.2....{t9.| +000002f0 fa d0 32 f3 fe 4d 01 6b 78 75 31 7e 67 4f 61 0f |..2..M.kxu1~gOa.| +00000300 bb c6 3e c0 |..>.| +>>> Flow 4 (server to client) +00000000 17 03 03 02 9b f5 b2 d6 62 fe e0 c8 8d cc 7a cd |........b.....z.| +00000010 29 51 b2 77 0d 9a 54 fb 43 6d f6 9c e1 ff 28 be |)Q.w..T.Cm....(.| +00000020 fc 50 68 80 2f 1c 4f 50 44 95 64 49 0a 66 fe 79 |.Ph./.OPD.dI.f.y| +00000030 46 ba 88 e9 03 be 5c 91 60 84 78 03 a8 c6 21 90 |F.....\.`.x...!.| +00000040 cd 79 de 2d 2f 81 dd 08 1f 52 1a 0e d8 69 16 22 |.y.-/....R...i."| +00000050 a6 59 5b 2b 85 08 00 16 e7 85 bd 43 9a cc ce e6 |.Y[+.......C....| +00000060 3a ee 70 25 0b 95 90 4b c0 42 4a 48 25 d3 50 92 |:.p%...K.BJH%.P.| +00000070 19 e1 3e b8 72 c5 a1 e8 dd 9f a4 57 2d b0 a6 24 |..>.r......W-..$| +00000080 8b 8c 55 41 f3 26 45 dd dd 2b d3 15 8d d9 ca e4 |..UA.&E..+......| +00000090 15 6e b5 6d 99 79 ba 46 00 e6 5e 75 52 fd f9 26 |.n.m.y.F..^uR..&| +000000a0 cf cd 69 cf be 29 a7 b9 7d 1b 1d 6b ab 17 ee 4e |..i..)..}..k...N| +000000b0 f5 24 b0 89 0f b5 c7 41 4e ea cd 32 98 47 23 bc |.$.....AN..2.G#.| +000000c0 91 03 b1 23 e0 5c 5e 37 40 95 da 90 ef eb 95 81 |...#.\^7@.......| +000000d0 7b 2d c7 15 8f f8 2d ba 69 41 0e a9 eb 19 6c 6c |{-....-.iA....ll| +000000e0 73 b0 05 fc b9 f4 76 91 2b 6a 72 fa d6 e5 87 a9 |s.....v.+jr.....| +000000f0 90 49 81 8c d5 fa 78 a2 a1 8f 77 c7 35 78 1b ba |.I....x...w.5x..| +00000100 ac 3c 41 51 ce 4e 99 c9 74 a0 bc 51 12 b5 15 2c |..G| +00000280 71 63 2f 0c 94 c9 42 ac bc 4c 0a 16 fe 9a 90 eb |qc/...B..L......| +00000290 02 75 16 1a 10 23 b2 75 67 c7 c5 17 55 9b cf 69 |.u...#.ug...U..i| +000002a0 17 03 03 00 1e 45 8c ed 99 0f 8a 83 d8 89 70 49 |.....E........pI| +000002b0 17 a8 fd 2b 6e ef ff 53 fa 99 52 89 ee 8b 19 f1 |...+n..S..R.....| +000002c0 41 09 30 17 03 03 00 13 14 f0 f6 ef c5 f9 52 15 |A.0...........R.| +000002d0 77 de 5e 46 63 8d 3b 2f 07 84 aa |w.^Fc.;/...| diff --git a/src/crypto/tls/testdata/Server-TLSv13-RSA-PSS-Disabled b/src/crypto/tls/testdata/Server-TLSv13-RSA-PSS-Disabled new file mode 100644 index 0000000000000..c13db8d68a662 --- /dev/null +++ b/src/crypto/tls/testdata/Server-TLSv13-RSA-PSS-Disabled @@ -0,0 +1,103 @@ +>>> Flow 1 (client to server) +00000000 16 03 01 00 e0 01 00 00 dc 03 03 1e 9f 50 05 56 |.............P.V| +00000010 a7 21 c8 df 56 a8 f3 bb e4 15 3b b0 04 e5 f5 10 |.!..V.....;.....| +00000020 d8 5b 0e 68 d3 b4 39 64 b5 89 9c 20 5a 6b 29 6d |.[.h..9d... Zk)m| +00000030 22 a0 e0 fb 7f 2d 87 48 e7 b4 c9 b3 5a d0 2b c7 |"....-.H....Z.+.| +00000040 ad d8 e4 ad d5 eb 81 b3 1f 61 0e 65 00 08 13 02 |.........a.e....| +00000050 13 03 13 01 00 ff 01 00 00 8b 00 00 00 0e 00 0c |................| +00000060 00 00 09 31 32 37 2e 30 2e 30 2e 31 00 0b 00 04 |...127.0.0.1....| +00000070 03 00 01 02 00 0a 00 0c 00 0a 00 1d 00 17 00 1e |................| +00000080 00 19 00 18 00 16 00 00 00 17 00 00 00 0d 00 1e |................| +00000090 00 1c 04 03 05 03 06 03 08 07 08 08 08 09 08 0a |................| +000000a0 08 0b 08 04 08 05 08 06 04 01 05 01 06 01 00 2b |...............+| +000000b0 00 03 02 03 04 00 2d 00 02 01 01 00 33 00 26 00 |......-.....3.&.| +000000c0 24 00 1d 00 20 ba 67 99 b3 60 71 ed 6c bb 8d 7e |$... .g..`q.l..~| +000000d0 4c c3 ea 37 6d 90 b6 f8 91 67 71 2c 84 a7 32 3a |L..7m....gq,..2:| +000000e0 23 2a 90 13 35 |#*..5| +>>> Flow 2 (server to client) +00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......| +00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| +00000020 00 00 00 00 00 00 00 00 00 00 00 20 5a 6b 29 6d |........... Zk)m| +00000030 22 a0 e0 fb 7f 2d 87 48 e7 b4 c9 b3 5a d0 2b c7 |"....-.H....Z.+.| +00000040 ad d8 e4 ad d5 eb 81 b3 1f 61 0e 65 13 02 00 00 |.........a.e....| +00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /| +00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0| +00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.| +00000080 03 03 00 01 01 17 03 03 00 17 d9 74 68 ee e6 54 |...........th..T| +00000090 e3 7a 0e ee 86 c7 a8 bb c7 65 fc e4 c4 6c 58 7a |.z.......e...lXz| +000000a0 1e 17 03 03 02 6d 98 c3 0c cc 80 fe ea 70 13 4e |.....m.......p.N| +000000b0 2f f6 49 99 5f 27 0a f9 4d cf e5 1a 9a 37 fb e7 |/.I._'..M....7..| +000000c0 3b a4 60 82 43 df fb fa 47 15 6f d8 db d2 3e c3 |;.`.C...G.o...>.| +000000d0 dd a0 37 ca b2 b4 c9 1b 5c 86 4a e0 7e 06 1e 27 |..7.....\.J.~..'| +000000e0 73 c6 cd 54 37 df 95 b1 c6 d5 44 85 2c 67 7d a7 |s..T7.....D.,g}.| +000000f0 2a 7d 87 86 5e f3 e5 60 f8 7c de bf 78 89 35 9b |*}..^..`.|..x.5.| +00000100 d1 0b 8a dd 6f 40 d8 5a 55 10 e2 71 b0 7a 5e 4b |....o@.ZU..q.z^K| +00000110 86 18 be 18 a7 f8 8e c6 ae 8c 1e df bf 84 77 c5 |..............w.| +00000120 dc b1 17 26 72 ea bb 9b 28 6c bf 19 8d 1a 22 90 |...&r...(l....".| +00000130 0f 19 92 5b ff db 07 84 48 61 68 f0 50 20 76 a3 |...[....Hah.P v.| +00000140 d3 f2 4a 3b 60 f5 73 cb 61 f7 11 63 f2 a7 0e 18 |..J;`.s.a..c....| +00000150 30 96 d0 17 f1 2f 58 09 49 33 15 3e 31 e4 17 e8 |0..../X.I3.>1...| +00000160 07 48 b5 43 06 40 60 4f a0 78 0d 51 0c 3f 0f 1a |.H.C.@`O.x.Q.?..| +00000170 8c 95 7a 3e 36 66 36 22 dc 58 4e b7 3e 19 ad de |..z>6f6".XN.>...| +00000180 c9 f9 b0 76 e4 e2 8c 04 27 6f 67 8f fe 86 b9 41 |...v....'og....A| +00000190 53 7d 9f d1 e0 a6 0b ec fc c0 82 bf 00 36 28 4d |S}...........6(M| +000001a0 20 3a e3 42 67 87 16 64 6c 4f e2 54 23 d1 0f 32 | :.Bg..dlO.T#..2| +000001b0 e9 16 9a da 46 a6 39 18 d5 6e a6 93 25 de a1 77 |....F.9..n..%..w| +000001c0 d9 26 b5 7c b4 85 8a 69 48 90 11 a9 8c 42 ca b8 |.&.|...iH....B..| +000001d0 88 63 df ec 6c e3 9f 2c 29 75 9b 57 79 8b 69 66 |.c..l..,)u.Wy.if| +000001e0 16 9e 93 48 04 8a 41 e0 8b 0e fb a5 9c fd 68 f6 |...H..A.......h.| +000001f0 5f ab 89 11 e4 aa 4c 6c 92 df b3 a3 39 f0 38 d9 |_.....Ll....9.8.| +00000200 7d 1b 42 13 ee d1 83 e2 20 3f 60 81 96 d9 63 2c |}.B..... ?`...c,| +00000210 e8 54 a5 08 41 9b 1d 02 41 37 a2 ce 0c 9b 34 bf |.T..A...A7....4.| +00000220 43 c5 ac 90 67 cd 6b b6 55 31 36 b1 2b 0e ed 8c |C...g.k.U16.+...| +00000230 23 ae 71 b2 ab f3 94 68 f2 f6 87 d3 87 61 ca aa |#.q....h.....a..| +00000240 0b 65 63 a1 11 dc 6d 74 33 c8 24 a6 ae 40 27 c7 |.ec...mt3.$..@'.| +00000250 d4 06 51 89 15 35 66 21 b0 82 15 87 70 c5 b8 8d |..Q..5f!....p...| +00000260 34 48 ff 41 e0 1a b0 46 f7 38 47 53 64 f7 a3 a2 |4H.A...F.8GSd...| +00000270 61 96 72 ea 90 de 86 18 64 49 91 ed 97 05 e3 27 |a.r.....dI.....'| +00000280 47 df ea 06 c6 28 f9 79 51 5e 64 b6 de 52 75 8a |G....(.yQ^d..Ru.| +00000290 79 8d 8e a6 d5 b0 f1 a6 ab 76 44 25 4b 80 5e e4 |y........vD%K.^.| +000002a0 d4 aa c6 2d 77 1a 49 52 16 d6 73 6b 18 2d d1 a6 |...-w.IR..sk.-..| +000002b0 4c e1 be 4d f8 79 34 a1 4c 81 88 9c 4b 85 f3 28 |L..M.y4.L...K..(| +000002c0 97 fc 3a 7e cf d4 81 2c d3 57 df 09 f5 49 f5 cf |..:~...,.W...I..| +000002d0 c7 7c 22 b3 8e 95 0f 97 6d d1 56 e3 43 7e 52 0f |.|".....m.V.C~R.| +000002e0 d4 da 3f e0 4e 06 b9 84 18 7d 7c 56 49 e0 d7 4a |..?.N....}|VI..J| +000002f0 d6 df c4 70 0c 74 5b 1f 4d 76 28 cd 3b b0 9e 27 |...p.t[.Mv(.;..'| +00000300 cc 6b 1a 13 41 1a 6b bf 0d 2d 93 b2 d5 7e 7e 25 |.k..A.k..-...~~%| +00000310 0e 8a 9c 17 03 03 00 99 df 4b 8e 3e d0 14 be 76 |.........K.>...v| +00000320 f1 d3 ca b1 39 c0 7e 6c 4f 8c d9 0d b8 83 07 39 |....9.~lO......9| +00000330 08 55 13 1e 3d 68 0f 99 9f 9a 68 1f 57 6a aa 41 |.U..=h....h.Wj.A| +00000340 a4 40 2b 12 f2 4b 6c db 3c 59 fa 99 5c e2 c7 2d |.@+..Kl.>> Flow 3 (client to server) +00000000 14 03 03 00 01 01 17 03 03 00 45 4b 7c c5 9e c6 |..........EK|...| +00000010 47 4a 90 d8 c2 c0 49 f7 3b c4 26 eb 15 18 9c bc |GJ....I.;.&.....| +00000020 c8 44 f0 53 94 2f 0f c8 d7 c1 86 42 ed b7 8f 63 |.D.S./.....B...c| +00000030 a0 97 5d 5b 15 01 3a 3d ca a6 d0 1a a4 77 cc 7e |..][..:=.....w.~| +00000040 88 fd 0b c9 a0 46 b7 40 25 8a 03 6e 99 66 bb 84 |.....F.@%..n.f..| +>>> Flow 4 (server to client) +00000000 17 03 03 00 1e 6a 41 80 ca 72 5f c3 ee e1 88 49 |.....jA..r_....I| +00000010 6d be a4 d9 26 07 5c 2b 2c a7 83 b5 c4 eb 4e 4b |m...&.\+,.....NK| +00000020 a1 29 98 17 03 03 00 13 2a f9 33 6c 46 f7 9a 51 |.)......*.3lF..Q| +00000030 1b 36 cd bc d8 5d 94 0d 9e 4b 72 |.6...]...Kr| diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go index 9c26769b09ec2..208c13c195314 100644 --- a/src/crypto/tls/tls_test.go +++ b/src/crypto/tls/tls_test.go @@ -23,11 +23,15 @@ import ( "time" ) +var savedSupportedSignatureAlgorithmsTLS12 = supportedSignatureAlgorithmsTLS12 + func init() { - // TLS 1.3 is opt-in for Go 1.12, but we want to run most tests with it enabled. - // TestTLS13Switch below tests the disabled behavior. See Issue 30055. + // TLS 1.3 is opt-in for Go 1.12, and RSA-PSS is disabled in TLS 1.2, but we + // want to run most tests with both enabled. TestTLS13Switch below and the + // "PSS-Disabled" recordings test the disabled behavior. See Issue 30055. tls13Support.Do(func() {}) // defuse the sync.Once tls13Support.cached = true + supportedSignatureAlgorithmsTLS12 = supportedSignatureAlgorithms } var rsaCertPEM = `-----BEGIN CERTIFICATE-----