]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.boringcrypto] all: merge master into dev.boringcrypto
authorFilippo Valsorda <filippo@golang.org>
Fri, 8 Feb 2019 20:36:33 +0000 (15:36 -0500)
committerFilippo Valsorda <filippo@golang.org>
Fri, 8 Feb 2019 22:54:25 +0000 (17:54 -0500)
Change-Id: I9246c8228d38559c40e69fa403fa946ac1b31dbe

1404 files changed:
AUTHORS
CONTRIBUTORS
api/except.txt
api/go1.12.txt [new file with mode: 0644]
doc/codewalk/codewalk.js
doc/contribute.html
doc/devel/release.html
doc/diagnostics.html
doc/effective_go.html
doc/go1.11.html
doc/go1.12.html
doc/go_faq.html
doc/go_mem.html
doc/go_spec.html
doc/install.html
doc/progs/eff_sequence.go
doc/security.html
lib/time/update.bash
lib/time/zoneinfo.zip
misc/cgo/errors/errors_test.go
misc/cgo/errors/ptr_test.go
misc/cgo/errors/src/issue26745.go [new file with mode: 0644]
misc/cgo/errors/src/issue28069.go [new file with mode: 0644]
misc/cgo/errors/src/issue28721.go [new file with mode: 0644]
misc/cgo/test/callback.go
misc/cgo/test/cgo_test.go
misc/cgo/test/issue27054/egl.h [new file with mode: 0644]
misc/cgo/test/issue27054/test27054.go [new file with mode: 0644]
misc/cgo/test/issue27340.go [new file with mode: 0644]
misc/cgo/test/issue27340/a.go [new file with mode: 0644]
misc/cgo/test/issue28545.go
misc/cgo/test/issue28772.go [new file with mode: 0644]
misc/cgo/test/issue28896.go [new file with mode: 0644]
misc/cgo/test/issue29383.go [new file with mode: 0644]
misc/cgo/test/issue29748.go [new file with mode: 0644]
misc/cgo/test/issue29781.go [new file with mode: 0644]
misc/cgo/test/issue30065.go [new file with mode: 0644]
misc/cgo/test/issue4339.go
misc/cgo/test/issue9026/issue9026.go
misc/cgo/testcshared/cshared_test.go
misc/cgo/testcshared/src/go2c2go/go/shlib.go [new file with mode: 0644]
misc/cgo/testcshared/src/go2c2go/m1/c.c [new file with mode: 0644]
misc/cgo/testcshared/src/go2c2go/m1/main.go [new file with mode: 0644]
misc/cgo/testcshared/src/go2c2go/m2/main.go [new file with mode: 0644]
misc/cgo/testsanitizers/tsan_test.go
misc/cgo/testshared/shared_test.go
misc/cgo/testshared/src/issue25065/a.go [new file with mode: 0644]
misc/nacl/testzip.proto
misc/sortac/sortac.go [deleted file]
misc/wasm/wasm_exec.js
src/archive/tar/stat_actime1.go
src/archive/tar/stat_actime2.go
src/archive/zip/zip_test.go
src/bufio/bufio.go
src/bufio/bufio_test.go
src/bytes/buffer.go
src/bytes/example_test.go
src/cmd/api/goapi.go
src/cmd/asm/doc.go
src/cmd/asm/internal/asm/line_test.go
src/cmd/asm/internal/asm/operand_test.go
src/cmd/asm/internal/asm/parse.go
src/cmd/asm/internal/asm/testdata/ppc64.s
src/cmd/asm/internal/flags/flags.go
src/cmd/asm/main.go
src/cmd/cgo/ast.go
src/cmd/cgo/doc.go
src/cmd/cgo/gcc.go
src/cmd/cgo/godefs.go
src/cmd/cgo/main.go
src/cmd/cgo/out.go
src/cmd/compile/doc.go
src/cmd/compile/fmt_test.go
src/cmd/compile/fmtmap_test.go [new file with mode: 0644]
src/cmd/compile/internal/amd64/ggen.go
src/cmd/compile/internal/arm/ggen.go
src/cmd/compile/internal/arm64/ggen.go
src/cmd/compile/internal/gc/alg.go
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/closure.go
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/dcl.go
src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/gc/export.go
src/cmd/compile/internal/gc/fmt.go
src/cmd/compile/internal/gc/gen.go
src/cmd/compile/internal/gc/global_test.go
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/iexport.go
src/cmd/compile/internal/gc/iimport.go
src/cmd/compile/internal/gc/init.go
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/inl_test.go
src/cmd/compile/internal/gc/lang_test.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/noder.go
src/cmd/compile/internal/gc/op_string.go
src/cmd/compile/internal/gc/order.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/racewalk.go
src/cmd/compile/internal/gc/range.go
src/cmd/compile/internal/gc/reflect.go
src/cmd/compile/internal/gc/select.go
src/cmd/compile/internal/gc/sinit.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/swt.go
src/cmd/compile/internal/gc/syntax.go
src/cmd/compile/internal/gc/typecheck.go
src/cmd/compile/internal/gc/universe.go
src/cmd/compile/internal/gc/unsafe.go
src/cmd/compile/internal/gc/walk.go
src/cmd/compile/internal/mips/ggen.go
src/cmd/compile/internal/mips/ssa.go
src/cmd/compile/internal/mips64/ggen.go
src/cmd/compile/internal/mips64/ssa.go
src/cmd/compile/internal/ppc64/galign.go
src/cmd/compile/internal/ppc64/ggen.go
src/cmd/compile/internal/ppc64/ssa.go
src/cmd/compile/internal/s390x/ggen.go
src/cmd/compile/internal/ssa/biasedsparsemap.go
src/cmd/compile/internal/ssa/branchelim.go
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/deadcode.go
src/cmd/compile/internal/ssa/debug.go
src/cmd/compile/internal/ssa/decompose.go
src/cmd/compile/internal/ssa/func.go
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/MIPS.rules
src/cmd/compile/internal/ssa/gen/MIPS64.rules
src/cmd/compile/internal/ssa/gen/PPC64.rules
src/cmd/compile/internal/ssa/gen/S390X.rules
src/cmd/compile/internal/ssa/gen/WasmOps.go
src/cmd/compile/internal/ssa/gen/decArgs.rules [new file with mode: 0644]
src/cmd/compile/internal/ssa/gen/decArgsOps.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/gen/generic.rules
src/cmd/compile/internal/ssa/gen/genericOps.go
src/cmd/compile/internal/ssa/gen/rulegen.go
src/cmd/compile/internal/ssa/html.go
src/cmd/compile/internal/ssa/layout.go
src/cmd/compile/internal/ssa/lower.go
src/cmd/compile/internal/ssa/magic.go
src/cmd/compile/internal/ssa/nilcheck.go
src/cmd/compile/internal/ssa/numberlines.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/prove.go
src/cmd/compile/internal/ssa/rewrite.go
src/cmd/compile/internal/ssa/rewrite386.go
src/cmd/compile/internal/ssa/rewriteAMD64.go
src/cmd/compile/internal/ssa/rewriteARM64.go
src/cmd/compile/internal/ssa/rewriteMIPS.go
src/cmd/compile/internal/ssa/rewriteMIPS64.go
src/cmd/compile/internal/ssa/rewritePPC64.go
src/cmd/compile/internal/ssa/rewriteS390X.go
src/cmd/compile/internal/ssa/rewritedecArgs.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/rewritegeneric.go
src/cmd/compile/internal/ssa/schedule.go
src/cmd/compile/internal/ssa/softfloat.go
src/cmd/compile/internal/ssa/stmtlines_test.go
src/cmd/compile/internal/ssa/testdata/hist.dlv-opt.nexts
src/cmd/compile/internal/ssa/testdata/hist.gdb-opt.nexts
src/cmd/compile/internal/ssa/testdata/scopes.dlv-opt.nexts
src/cmd/compile/internal/ssa/testdata/scopes.gdb-opt.nexts
src/cmd/compile/internal/ssa/tighten.go
src/cmd/compile/internal/ssa/value.go
src/cmd/compile/internal/ssa/writebarrier.go
src/cmd/compile/internal/syntax/source.go
src/cmd/compile/internal/types/identity.go
src/cmd/compile/internal/types/sym.go
src/cmd/compile/internal/types/type.go
src/cmd/compile/internal/wasm/ssa.go
src/cmd/compile/internal/x86/ggen.go
src/cmd/cover/cover.go
src/cmd/cover/cover_test.go
src/cmd/cover/testdata/toolexec.go [new file with mode: 0644]
src/cmd/dist/build.go
src/cmd/dist/buildruntime.go
src/cmd/dist/buildtool.go
src/cmd/dist/main.go
src/cmd/dist/test.go
src/cmd/dist/util.go
src/cmd/doc/dirs.go
src/cmd/fix/egltype.go [new file with mode: 0644]
src/cmd/fix/egltype_test.go [new file with mode: 0644]
src/cmd/go/alldocs.go
src/cmd/go/go_test.go
src/cmd/go/internal/cache/cache.go
src/cmd/go/internal/cache/default.go
src/cmd/go/internal/cache/default_unix_test.go [deleted file]
src/cmd/go/internal/clean/clean.go
src/cmd/go/internal/envcmd/env.go
src/cmd/go/internal/fix/fix.go
src/cmd/go/internal/generate/generate.go
src/cmd/go/internal/get/get.go
src/cmd/go/internal/get/path.go [new file with mode: 0644]
src/cmd/go/internal/get/vcs.go
src/cmd/go/internal/help/helpdoc.go
src/cmd/go/internal/imports/scan.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/load/test.go
src/cmd/go/internal/lockedfile/internal/filelock/filelock.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/internal/filelock/filelock_plan9.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/internal/filelock/filelock_unix.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/internal/filelock/filelock_windows.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/lockedfile.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/lockedfile_filelock.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/lockedfile_plan9.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/lockedfile_test.go [new file with mode: 0644]
src/cmd/go/internal/lockedfile/mutex.go [new file with mode: 0644]
src/cmd/go/internal/modcmd/download.go
src/cmd/go/internal/modcmd/edit.go
src/cmd/go/internal/modcmd/init.go
src/cmd/go/internal/modcmd/tidy.go
src/cmd/go/internal/modcmd/vendor.go
src/cmd/go/internal/modfetch/cache.go
src/cmd/go/internal/modfetch/codehost/codehost.go
src/cmd/go/internal/modfetch/codehost/git.go
src/cmd/go/internal/modfetch/codehost/vcs.go
src/cmd/go/internal/modfetch/coderepo.go
src/cmd/go/internal/modfetch/coderepo_test.go
src/cmd/go/internal/modfetch/fetch.go
src/cmd/go/internal/modfetch/proxy.go
src/cmd/go/internal/modfetch/repo.go
src/cmd/go/internal/modfetch/unzip.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/build.go
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/modload/init_test.go [moved from src/cmd/go/internal/modload/init_plan9_test.go with 100% similarity]
src/cmd/go/internal/modload/list.go
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/modload/query.go
src/cmd/go/internal/modload/search.go
src/cmd/go/internal/modload/testgo.go [new file with mode: 0644]
src/cmd/go/internal/module/module.go
src/cmd/go/internal/module/module_test.go
src/cmd/go/internal/renameio/renameio.go [new file with mode: 0644]
src/cmd/go/internal/run/run.go
src/cmd/go/internal/semver/semver.go
src/cmd/go/internal/semver/semver_test.go
src/cmd/go/internal/test/test.go
src/cmd/go/internal/vet/vet.go
src/cmd/go/internal/vet/vetflag.go
src/cmd/go/internal/web2/web.go
src/cmd/go/internal/work/build_test.go
src/cmd/go/internal/work/buildid.go
src/cmd/go/internal/work/exec.go
src/cmd/go/internal/work/gc.go
src/cmd/go/internal/work/gccgo.go
src/cmd/go/internal/work/init.go
src/cmd/go/main.go
src/cmd/go/proxy_test.go
src/cmd/go/script_test.go
src/cmd/go/testdata/mod/example.com_invalidpath_v1_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_printversion_v0.1.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_printversion_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_version_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_version_v1.0.1.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/example.com_version_v1.1.0.txt [new file with mode: 0644]
src/cmd/go/testdata/mod/research.swtch.com_vgo-tour_v1.0.0.txt [deleted file]
src/cmd/go/testdata/mod/rsc.io_badzip_v1.0.0.txt [new file with mode: 0644]
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/build_GOTMPDIR.txt
src/cmd/go/testdata/script/build_nocache.txt [new file with mode: 0644]
src/cmd/go/testdata/script/build_relative_pkgdir.txt [new file with mode: 0644]
src/cmd/go/testdata/script/build_relative_tmpdir.txt [new file with mode: 0644]
src/cmd/go/testdata/script/build_runtime_gcflags.txt [new file with mode: 0644]
src/cmd/go/testdata/script/cache_unix.txt [new file with mode: 0644]
src/cmd/go/testdata/script/cgo_syso_issue29253.txt [new file with mode: 0644]
src/cmd/go/testdata/script/clean_testcache.txt [new file with mode: 0644]
src/cmd/go/testdata/script/gcflags_patterns.txt
src/cmd/go/testdata/script/get_brace.txt [new file with mode: 0644]
src/cmd/go/testdata/script/get_dotfiles.txt [new file with mode: 0644]
src/cmd/go/testdata/script/get_tilde.txt [new file with mode: 0644]
src/cmd/go/testdata/script/get_unicode.txt [new file with mode: 0644]
src/cmd/go/testdata/script/help.txt
src/cmd/go/testdata/script/list_find.txt
src/cmd/go/testdata/script/list_importmap.txt [new file with mode: 0644]
src/cmd/go/testdata/script/list_std.txt
src/cmd/go/testdata/script/mod_clean_cache.txt
src/cmd/go/testdata/script/mod_concurrent.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_download.txt
src/cmd/go/testdata/script/mod_download_hash.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_edit.txt
src/cmd/go/testdata/script/mod_enabled.txt
src/cmd/go/testdata/script/mod_fs_patterns.txt
src/cmd/go/testdata/script/mod_get_private_vcs.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_get_svn.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_import_v1suffix.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_internal.txt
src/cmd/go/testdata/script/mod_list_dir.txt
src/cmd/go/testdata/script/mod_load_badzip.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_modinfo.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_nomod.txt
src/cmd/go/testdata/script/mod_outside.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_patterns.txt
src/cmd/go/testdata/script/mod_replace.txt
src/cmd/go/testdata/script/mod_replace_import.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_std_vendor.txt
src/cmd/go/testdata/script/mod_sum_replaced.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_symlink.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_test_files.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_vcs_missing.txt
src/cmd/go/testdata/script/run_wildcard.txt [new file with mode: 0644]
src/cmd/go/testdata/script/vet_asm.txt [new file with mode: 0644]
src/cmd/internal/buildid/buildid.go
src/cmd/internal/goobj/read.go
src/cmd/internal/obj/abi_string.go [new file with mode: 0644]
src/cmd/internal/obj/arm/asm5.go
src/cmd/internal/obj/arm/obj5.go
src/cmd/internal/obj/arm64/asm7.go
src/cmd/internal/obj/arm64/doc.go
src/cmd/internal/obj/arm64/obj7.go
src/cmd/internal/obj/inl.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/mips/obj0.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/pcln.go
src/cmd/internal/obj/plist.go
src/cmd/internal/obj/ppc64/a.out.go
src/cmd/internal/obj/ppc64/anames.go
src/cmd/internal/obj/ppc64/anames9.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/ppc64/obj9.go
src/cmd/internal/obj/s390x/asmz.go
src/cmd/internal/obj/s390x/objz.go
src/cmd/internal/obj/sym.go
src/cmd/internal/obj/util.go
src/cmd/internal/obj/wasm/wasmobj.go
src/cmd/internal/obj/x86/asm6.go
src/cmd/internal/obj/x86/obj6.go
src/cmd/internal/objabi/doc.go
src/cmd/internal/objabi/flag.go
src/cmd/internal/objabi/funcid.go
src/cmd/internal/objabi/reloctype.go
src/cmd/internal/objabi/stack.go
src/cmd/internal/objabi/symkind.go
src/cmd/internal/objabi/symkind_string.go
src/cmd/internal/objabi/util.go
src/cmd/internal/objfile/disasm.go
src/cmd/internal/objfile/xcoff.go
src/cmd/internal/sys/supported.go
src/cmd/link/doc.go
src/cmd/link/internal/ld/config.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/deadcode.go
src/cmd/link/internal/ld/dwarf.go
src/cmd/link/internal/ld/dwarf_test.go
src/cmd/link/internal/ld/go.go
src/cmd/link/internal/ld/ld.go
src/cmd/link/internal/ld/ld_test.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/nooptcgolink_test.go
src/cmd/link/internal/ld/pcln.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/ld/xcoff.go
src/cmd/link/internal/loadxcoff/ldxcoff.go
src/cmd/link/internal/objfile/objfile.go
src/cmd/link/internal/ppc64/asm.go
src/cmd/link/internal/ppc64/obj.go
src/cmd/link/internal/sym/symbol.go
src/cmd/link/internal/sym/symbols.go
src/cmd/link/internal/sym/symkind.go
src/cmd/link/internal/sym/symkind_string.go
src/cmd/link/link_test.go
src/cmd/nm/nm_test.go
src/cmd/pprof/readlineui.go
src/cmd/trace/annotations.go
src/cmd/trace/annotations_test.go
src/cmd/trace/goroutines.go
src/cmd/trace/main.go
src/cmd/trace/mmu.go
src/cmd/trace/pprof.go
src/cmd/trace/trace.go
src/cmd/trace/trace_test.go
src/cmd/trace/trace_unix_test.go
src/cmd/vendor/README
src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode.go
src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/decode_test.go
src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/gnu.go
src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/objdump_test.go
src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/plan9.go
src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/tables.go
src/cmd/vendor/golang.org/x/arch/ppc64/ppc64asm/testdata/decode.txt
src/cmd/vendor/golang.org/x/sys/unix/README.md
src/cmd/vendor/golang.org/x/sys/unix/aliases.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
src/cmd/vendor/golang.org/x/sys/unix/constants.go
src/cmd/vendor/golang.org/x/sys/unix/darwin_test.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/dirent.go
src/cmd/vendor/golang.org/x/sys/unix/env_unix.go
src/cmd/vendor/golang.org/x/sys/unix/example_exec_test.go [moved from src/cmd/vendor/golang.org/x/sys/unix/example_test.go with 83% similarity]
src/cmd/vendor/golang.org/x/sys/unix/example_flock_test.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/export_test.go
src/cmd/vendor/golang.org/x/sys/unix/fcntl.go
src/cmd/vendor/golang.org/x/sys/unix/fcntl_darwin.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/gccgo.go
src/cmd/vendor/golang.org/x/sys/unix/gccgo_c.c
src/cmd/vendor/golang.org/x/sys/unix/ioctl.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/mkall.sh
src/cmd/vendor/golang.org/x/sys/unix/mkerrors.sh
src/cmd/vendor/golang.org/x/sys/unix/mksyscall.pl [deleted file]
src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.pl [new file with mode: 0755]
src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.pl [new file with mode: 0755]
src/cmd/vendor/golang.org/x/sys/unix/mksyscall_solaris.pl
src/cmd/vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl
src/cmd/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl [deleted file]
src/cmd/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl [deleted file]
src/cmd/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl [deleted file]
src/cmd/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl [deleted file]
src/cmd/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl [deleted file]
src/cmd/vendor/golang.org/x/sys/unix/mmap_unix_test.go
src/cmd/vendor/golang.org/x/sys/unix/openbsd_pledge.go
src/cmd/vendor/golang.org/x/sys/unix/openbsd_test.go
src/cmd/vendor/golang.org/x/sys/unix/openbsd_unveil.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/pagesize_unix.go
src/cmd/vendor/golang.org/x/sys/unix/race0.go
src/cmd/vendor/golang.org/x/sys/unix/sendfile_test.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
src/cmd/vendor/golang.org/x/sys/unix/str.go
src/cmd/vendor/golang.org/x/sys/unix/syscall.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_aix.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_aix_test.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_bsd_test.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_386.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_darwin_test.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux_test.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_netbsd_test.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_openbsd_test.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_test.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_unix.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/syscall_unix_test.go
src/cmd/vendor/golang.org/x/sys/unix/timestruct.go
src/cmd/vendor/golang.org/x/sys/unix/timestruct_test.go
src/cmd/vendor/golang.org/x/sys/unix/xattr_bsd.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/xattr_test.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go
src/cmd/vendor/golang.org/x/sys/windows/svc/svc_test.go
src/cmd/vendor/golang.org/x/sys/windows/syscall_windows_test.go
src/cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite/main.go [deleted file]
src/cmd/vendor/golang.org/x/tools/go/analysis/doc.go
src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/flags.go
src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/patch.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/bools/bools.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/types.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go
src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go [moved from src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go with 71% similarity]
src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker112.go [new file with mode: 0644]
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go
src/cmd/vendor/update-xtools.sh [new file with mode: 0755]
src/cmd/vendor/vendor.json
src/cmd/vet/all/main.go
src/cmd/vet/all/whitelist/386.txt
src/cmd/vet/all/whitelist/all.txt
src/cmd/vet/all/whitelist/amd64.txt
src/cmd/vet/all/whitelist/arm.txt
src/cmd/vet/all/whitelist/arm64.txt
src/cmd/vet/all/whitelist/mipsx.txt
src/cmd/vet/all/whitelist/nacl_386.txt
src/cmd/vet/all/whitelist/nacl_amd64p32.txt
src/cmd/vet/all/whitelist/nacl_arm.txt
src/cmd/vet/all/whitelist/ppc64x.txt
src/cmd/vet/all/whitelist/s390x.txt
src/cmd/vet/all/whitelist/wasm.txt
src/cmd/vet/all/whitelist/windows_386.txt
src/cmd/vet/all/whitelist/windows_amd64.txt
src/cmd/vet/asmdecl.go [deleted file]
src/cmd/vet/assign.go [deleted file]
src/cmd/vet/atomic.go [deleted file]
src/cmd/vet/bool.go [deleted file]
src/cmd/vet/buildtag.go [deleted file]
src/cmd/vet/cgo.go [deleted file]
src/cmd/vet/composite.go [deleted file]
src/cmd/vet/copylock.go [deleted file]
src/cmd/vet/dead.go [deleted file]
src/cmd/vet/deadcode.go [deleted file]
src/cmd/vet/doc.go
src/cmd/vet/httpresponse.go [deleted file]
src/cmd/vet/internal/cfg/builder.go [deleted file]
src/cmd/vet/internal/cfg/cfg.go [deleted file]
src/cmd/vet/internal/cfg/cfg_test.go [deleted file]
src/cmd/vet/internal/whitelist/whitelist.go [deleted file]
src/cmd/vet/lostcancel.go [deleted file]
src/cmd/vet/main.go
src/cmd/vet/method.go [deleted file]
src/cmd/vet/nilfunc.go [deleted file]
src/cmd/vet/print.go [deleted file]
src/cmd/vet/rangeloop.go [deleted file]
src/cmd/vet/shadow.go [deleted file]
src/cmd/vet/shift.go [deleted file]
src/cmd/vet/structtag.go [deleted file]
src/cmd/vet/testdata/asm/asm.go [deleted file]
src/cmd/vet/testdata/asm/asm1.s [deleted file]
src/cmd/vet/testdata/asm/asm2.s [deleted file]
src/cmd/vet/testdata/asm/asm3.s [deleted file]
src/cmd/vet/testdata/asm/asm4.s [deleted file]
src/cmd/vet/testdata/asm/asm5.s [deleted file]
src/cmd/vet/testdata/asm/asm6.s [deleted file]
src/cmd/vet/testdata/asm/asm7.s [deleted file]
src/cmd/vet/testdata/asm8.s [deleted file]
src/cmd/vet/testdata/atomic.go [deleted file]
src/cmd/vet/testdata/bool.go [deleted file]
src/cmd/vet/testdata/buildtag/buildtag_bad.go [deleted file]
src/cmd/vet/testdata/cgo/cgo.go [deleted file]
src/cmd/vet/testdata/cgo/cgo2.go [deleted file]
src/cmd/vet/testdata/cgo/cgo4.go [deleted file]
src/cmd/vet/testdata/composite.go [deleted file]
src/cmd/vet/testdata/copylock.go [deleted file]
src/cmd/vet/testdata/copylock_func.go [deleted file]
src/cmd/vet/testdata/copylock_range.go [deleted file]
src/cmd/vet/testdata/deadcode.go [deleted file]
src/cmd/vet/testdata/divergent/buf.go [deleted file]
src/cmd/vet/testdata/divergent/buf_test.go [deleted file]
src/cmd/vet/testdata/httpresponse.go [deleted file]
src/cmd/vet/testdata/incomplete/examples_test.go [deleted file]
src/cmd/vet/testdata/lostcancel.go [deleted file]
src/cmd/vet/testdata/nilfunc.go [deleted file]
src/cmd/vet/testdata/rangeloop.go [deleted file]
src/cmd/vet/testdata/shadow.go [deleted file]
src/cmd/vet/testdata/shift.go [deleted file]
src/cmd/vet/testdata/src/asm/asm.go [new file with mode: 0644]
src/cmd/vet/testdata/src/asm/asm1.s [new file with mode: 0644]
src/cmd/vet/testdata/src/assign/assign.go [moved from src/cmd/vet/testdata/assign.go with 97% similarity]
src/cmd/vet/testdata/src/atomic/atomic.go [new file with mode: 0644]
src/cmd/vet/testdata/src/bool/bool.go [new file with mode: 0644]
src/cmd/vet/testdata/src/buildtag/buildtag.go [moved from src/cmd/vet/testdata/buildtag/buildtag.go with 100% similarity]
src/cmd/vet/testdata/src/cgo/cgo.go [new file with mode: 0644]
src/cmd/vet/testdata/src/composite/composite.go [new file with mode: 0644]
src/cmd/vet/testdata/src/copylock/copylock.go [new file with mode: 0644]
src/cmd/vet/testdata/src/deadcode/deadcode.go [new file with mode: 0644]
src/cmd/vet/testdata/src/httpresponse/httpresponse.go [new file with mode: 0644]
src/cmd/vet/testdata/src/lostcancel/lostcancel.go [new file with mode: 0644]
src/cmd/vet/testdata/src/method/method.go [moved from src/cmd/vet/testdata/method.go with 57% similarity]
src/cmd/vet/testdata/src/nilfunc/nilfunc.go [new file with mode: 0644]
src/cmd/vet/testdata/src/print/print.go [moved from src/cmd/vet/testdata/print.go with 94% similarity]
src/cmd/vet/testdata/src/rangeloop/rangeloop.go [new file with mode: 0644]
src/cmd/vet/testdata/src/shift/shift.go [new file with mode: 0644]
src/cmd/vet/testdata/src/structtag/structtag.go [new file with mode: 0644]
src/cmd/vet/testdata/src/tagtest/file1.go [moved from src/cmd/vet/testdata/tagtest/file1.go with 85% similarity]
src/cmd/vet/testdata/src/tagtest/file2.go [moved from src/cmd/vet/testdata/tagtest/file2.go with 80% similarity]
src/cmd/vet/testdata/src/testingpkg/tests.go [moved from src/cmd/vet/testdata/testingpkg/tests.go with 100% similarity]
src/cmd/vet/testdata/src/testingpkg/tests_test.go [new file with mode: 0644]
src/cmd/vet/testdata/src/unmarshal/unmarshal.go [new file with mode: 0644]
src/cmd/vet/testdata/src/unsafeptr/unsafeptr.go [new file with mode: 0644]
src/cmd/vet/testdata/src/unused/unused.go [new file with mode: 0644]
src/cmd/vet/testdata/structtag.go [deleted file]
src/cmd/vet/testdata/testingpkg/tests_test.go [deleted file]
src/cmd/vet/testdata/unmarshal.go [deleted file]
src/cmd/vet/testdata/unsafeptr.go [deleted file]
src/cmd/vet/testdata/unused.go [deleted file]
src/cmd/vet/tests.go [deleted file]
src/cmd/vet/types.go [deleted file]
src/cmd/vet/unmarshal.go [deleted file]
src/cmd/vet/unsafeptr.go [deleted file]
src/cmd/vet/unused.go [deleted file]
src/cmd/vet/vet_test.go
src/compress/flate/inflate.go
src/container/heap/heap.go
src/crypto/aes/block.go
src/crypto/ecdsa/ecdsa.go
src/crypto/elliptic/elliptic.go
src/crypto/elliptic/p256_asm_s390x.s
src/crypto/elliptic/p256_s390x.go
src/crypto/hmac/hmac.go
src/crypto/md5/md5.go
src/crypto/md5/md5_test.go
src/crypto/sha1/sha1.go
src/crypto/sha1/sha1_test.go
src/crypto/sha256/sha256.go
src/crypto/sha256/sha256_test.go
src/crypto/sha512/sha512.go
src/crypto/sha512/sha512_test.go
src/crypto/subtle/constant_time.go
src/crypto/tls/auth.go
src/crypto/tls/boring.go
src/crypto/tls/cipher_suites.go
src/crypto/tls/common.go
src/crypto/tls/conn_test.go
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/handshake_client_tls13.go
src/crypto/tls/handshake_messages.go
src/crypto/tls/handshake_messages_test.go
src/crypto/tls/handshake_server.go
src/crypto/tls/handshake_server_test.go
src/crypto/tls/handshake_server_tls13.go
src/crypto/tls/key_agreement.go
src/crypto/tls/key_schedule.go
src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA
src/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-PSS-Disabled [new file with mode: 0644]
src/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSAPKCS1v15
src/crypto/tls/testdata/Client-TLSv13-AES128-SHA256
src/crypto/tls/testdata/Client-TLSv13-AES256-SHA384
src/crypto/tls/testdata/Client-TLSv13-ALPN
src/crypto/tls/testdata/Client-TLSv13-CHACHA20-SHA256
src/crypto/tls/testdata/Client-TLSv13-ClientCert-ECDSA-RSA
src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-ECDSA
src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-PSS-Disabled [new file with mode: 0644]
src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-RSAPSS
src/crypto/tls/testdata/Client-TLSv13-ECDSA
src/crypto/tls/testdata/Client-TLSv13-ExportKeyingMaterial
src/crypto/tls/testdata/Client-TLSv13-HelloRetryRequest
src/crypto/tls/testdata/Client-TLSv13-KeyUpdate
src/crypto/tls/testdata/Client-TLSv13-P256-ECDHE
src/crypto/tls/testdata/Client-TLSv13-X25519-ECDHE
src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven-PSS-Disabled-Required [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv12-RSA-PSS-Disabled-Required [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-ClientAuthRequestedAndGiven-PSS-Disabled [new file with mode: 0644]
src/crypto/tls/testdata/Server-TLSv13-RSA-PSS-Disabled [new file with mode: 0644]
src/crypto/tls/ticket.go
src/crypto/tls/tls_test.go
src/crypto/x509/cert_pool.go
src/crypto/x509/pkix/pkix.go
src/crypto/x509/root_cgo_darwin.go
src/crypto/x509/root_darwin.go
src/crypto/x509/root_darwin_test.go
src/crypto/x509/verify.go
src/crypto/x509/verify_test.go
src/crypto/x509/x509.go
src/database/sql/example_cli_test.go [new file with mode: 0644]
src/database/sql/example_service_test.go [new file with mode: 0644]
src/database/sql/example_test.go
src/database/sql/sql.go
src/debug/dwarf/line.go
src/debug/gosym/symtab.go
src/debug/pe/file_test.go
src/encoding/gob/decoder.go
src/encoding/gob/encoder.go
src/encoding/json/encode.go
src/encoding/json/example_text_marshaling_test.go [new file with mode: 0644]
src/encoding/pem/pem_test.go
src/encoding/xml/example_marshaling_test.go [new file with mode: 0644]
src/encoding/xml/example_text_marshaling_test.go [new file with mode: 0644]
src/encoding/xml/marshal.go
src/encoding/xml/read.go
src/flag/flag.go
src/fmt/example_test.go
src/fmt/fmt_test.go
src/fmt/format.go
src/fmt/print.go
src/go/build/build.go
src/go/build/build_test.go
src/go/build/deps_test.go
src/go/build/doc.go
src/go/build/testdata/withvendor/src/a/b/b.go [new file with mode: 0644]
src/go/build/testdata/withvendor/src/a/vendor/c/d/d.go [new file with mode: 0644]
src/go/doc/comment.go
src/go/doc/comment_test.go
src/go/doc/example.go
src/go/doc/example_test.go
src/go/doc/reader.go
src/go/doc/synopsis.go
src/go/doc/synopsis_test.go
src/go/doc/testdata/issue12839.0.golden
src/go/doc/testdata/issue12839.1.golden
src/go/doc/testdata/issue12839.2.golden
src/go/doc/testdata/issue12839.go
src/go/format/benchmark_test.go [new file with mode: 0644]
src/go/importer/importer.go
src/go/importer/importer_test.go
src/go/internal/gccgoimporter/ar.go
src/go/internal/gccgoimporter/gccgoinstallation_test.go
src/go/internal/gccgoimporter/importer.go
src/go/internal/gccgoimporter/importer_test.go
src/go/internal/gccgoimporter/parser.go
src/go/internal/gccgoimporter/parser_test.go
src/go/internal/gccgoimporter/testdata/issue29198.go [new file with mode: 0644]
src/go/internal/gccgoimporter/testdata/issue29198.gox [new file with mode: 0644]
src/go/internal/gccgoimporter/testdata/nointerface.go [new file with mode: 0644]
src/go/internal/gccgoimporter/testdata/nointerface.gox [new file with mode: 0644]
src/go/internal/gccgoimporter/testdata/v1reflect.gox [new file with mode: 0644]
src/go/internal/gcimporter/gcimporter.go
src/go/internal/gcimporter/gcimporter_test.go
src/go/internal/srcimporter/srcimporter_test.go
src/go/printer/nodes.go
src/go/printer/printer_test.go
src/go/types/call.go
src/go/types/check.go
src/go/types/errors.go
src/go/types/gotype.go
src/go/types/interfaces.go
src/go/types/issues_test.go
src/go/types/testdata/issues.src
src/hash/fnv/fnv.go
src/html/template/js.go
src/html/template/js_test.go
src/internal/cpu/cpu.go
src/internal/cpu/cpu_s390x.go
src/internal/cpu/cpu_test.go
src/internal/cpu/cpu_x86_test.go
src/internal/goroot/gc.go
src/internal/goroot/gccgo.go
src/internal/poll/fd_opendir_ios.go [new file with mode: 0644]
src/internal/trace/gc.go [moved from src/internal/traceparser/gc.go with 99% similarity]
src/internal/trace/gc_test.go [moved from src/internal/traceparser/gc_test.go with 89% similarity]
src/internal/trace/mud.go [moved from src/internal/traceparser/mud.go with 99% similarity]
src/internal/trace/mud_test.go [moved from src/internal/traceparser/mud_test.go with 99% similarity]
src/internal/traceparser/consistent.go [deleted file]
src/internal/traceparser/events.go [deleted file]
src/internal/traceparser/file.go [deleted file]
src/internal/traceparser/filebuf/filebuf.go [deleted file]
src/internal/traceparser/filebuf/filebuf_test.go [deleted file]
src/internal/traceparser/filebuf/fromreader.go [deleted file]
src/internal/traceparser/fuzz.go [deleted file]
src/internal/traceparser/goroutines.go [deleted file]
src/internal/traceparser/parser_test.go [deleted file]
src/internal/traceparser/raw.go [deleted file]
src/internal/traceparser/robust.go [deleted file]
src/internal/traceparser/testdata/06dfecf6e5dfb78e954e7892120b56bfca50af65-6.bad [deleted file]
src/internal/traceparser/testdata/0e6dd1787a6339366dac733a2f957a05d7aa3ac7-3.bad [deleted file]
src/internal/traceparser/testdata/16970d24ef6753d71953e20d10638705bdccc3ba-2.weird [deleted file]
src/internal/traceparser/testdata/26492441b33e1bb93669f79cf3584755cc3ef7e8-2.weird [deleted file]
src/internal/traceparser/testdata/2ccf452e473ded814ea880c602488637fc27e549.good [deleted file]
src/internal/traceparser/testdata/34f92cd2ae08f558c494b2ef79e80b574c9f096c-8.weird [deleted file]
src/internal/traceparser/testdata/4557f81f6aae617eeec8dd920997ea27b3dda12b.weird [deleted file]
src/internal/traceparser/testdata/495712b6e35ad7566869c887aa823fcbf69c0b80-1.weird [deleted file]
src/internal/traceparser/testdata/63cd688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad [deleted file]
src/internal/traceparser/testdata/63df44bfc9d27851fb054ce03002e7e25f307e2f-5.weird [deleted file]
src/internal/traceparser/testdata/6aa1a69b265c3092972a2a81e77fbcaa87061735-4.bad [deleted file]
src/internal/traceparser/testdata/7b82e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad [deleted file]
src/internal/traceparser/testdata/94347dc6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird [deleted file]
src/internal/traceparser/testdata/9fa93c88557e64b0714b8849aacf713d17ff928e-2.weird [deleted file]
src/internal/traceparser/testdata/abf7185aaf1cb69fb5fae50ba8546a7cdefade57-2.weird [deleted file]
src/internal/traceparser/testdata/d28fcef078c7dc722867d781b1fd7f37ca965372-7.weird [deleted file]
src/internal/traceparser/testdata/d70f178a3813df03f2aed0d47f6d9bc844b8cb57-4.weird [deleted file]
src/internal/traceparser/testdata/e68c3126700dda2c2ac3b8743e9f319cb313042a-1.weird [deleted file]
src/internal/traceparser/tr.go [deleted file]
src/internal/traceparser/writer.go [deleted file]
src/internal/x/crypto/chacha20poly1305/chacha20poly1305.go [moved from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305.go with 97% similarity]
src/internal/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go [moved from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.go with 100% similarity]
src/internal/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s [moved from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_amd64.s with 100% similarity]
src/internal/x/crypto/chacha20poly1305/chacha20poly1305_generic.go [moved from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_generic.go with 96% similarity]
src/internal/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go [moved from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go with 100% similarity]
src/internal/x/crypto/chacha20poly1305/chacha20poly1305_test.go [moved from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_test.go with 100% similarity]
src/internal/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go [moved from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305_vectors_test.go with 100% similarity]
src/internal/x/crypto/cryptobyte/asn1.go [moved from src/vendor/golang_org/x/crypto/cryptobyte/asn1.go with 99% similarity]
src/internal/x/crypto/cryptobyte/asn1/asn1.go [moved from src/vendor/golang_org/x/crypto/cryptobyte/asn1/asn1.go with 96% similarity]
src/internal/x/crypto/cryptobyte/asn1_test.go [moved from src/vendor/golang_org/x/crypto/cryptobyte/asn1_test.go with 99% similarity]
src/internal/x/crypto/cryptobyte/builder.go [moved from src/vendor/golang_org/x/crypto/cryptobyte/builder.go with 100% similarity]
src/internal/x/crypto/cryptobyte/cryptobyte_test.go [moved from src/vendor/golang_org/x/crypto/cryptobyte/cryptobyte_test.go with 100% similarity]
src/internal/x/crypto/cryptobyte/example_test.go [moved from src/vendor/golang_org/x/crypto/cryptobyte/example_test.go with 98% similarity]
src/internal/x/crypto/cryptobyte/string.go [moved from src/vendor/golang_org/x/crypto/cryptobyte/string.go with 98% similarity]
src/internal/x/crypto/curve25519/const_amd64.h [moved from src/vendor/golang_org/x/crypto/curve25519/const_amd64.h with 100% similarity]
src/internal/x/crypto/curve25519/const_amd64.s [moved from src/vendor/golang_org/x/crypto/curve25519/const_amd64.s with 100% similarity]
src/internal/x/crypto/curve25519/cswap_amd64.s [moved from src/vendor/golang_org/x/crypto/curve25519/cswap_amd64.s with 100% similarity]
src/internal/x/crypto/curve25519/curve25519.go [moved from src/vendor/golang_org/x/crypto/curve25519/curve25519.go with 100% similarity]
src/internal/x/crypto/curve25519/curve25519_test.go [moved from src/vendor/golang_org/x/crypto/curve25519/curve25519_test.go with 100% similarity]
src/internal/x/crypto/curve25519/doc.go [moved from src/vendor/golang_org/x/crypto/curve25519/doc.go with 94% similarity]
src/internal/x/crypto/curve25519/freeze_amd64.s [moved from src/vendor/golang_org/x/crypto/curve25519/freeze_amd64.s with 100% similarity]
src/internal/x/crypto/curve25519/ladderstep_amd64.s [moved from src/vendor/golang_org/x/crypto/curve25519/ladderstep_amd64.s with 100% similarity]
src/internal/x/crypto/curve25519/mont25519_amd64.go [moved from src/vendor/golang_org/x/crypto/curve25519/mont25519_amd64.go with 100% similarity]
src/internal/x/crypto/curve25519/mul_amd64.s [moved from src/vendor/golang_org/x/crypto/curve25519/mul_amd64.s with 100% similarity]
src/internal/x/crypto/curve25519/square_amd64.s [moved from src/vendor/golang_org/x/crypto/curve25519/square_amd64.s with 100% similarity]
src/internal/x/crypto/hkdf/example_test.go [moved from src/vendor/golang_org/x/crypto/hkdf/example_test.go with 97% similarity]
src/internal/x/crypto/hkdf/hkdf.go [moved from src/vendor/golang_org/x/crypto/hkdf/hkdf.go with 98% similarity]
src/internal/x/crypto/hkdf/hkdf_test.go [moved from src/vendor/golang_org/x/crypto/hkdf/hkdf_test.go with 100% similarity]
src/internal/x/crypto/internal/chacha20/asm_s390x.s [moved from src/vendor/golang_org/x/crypto/internal/chacha20/asm_s390x.s with 100% similarity]
src/internal/x/crypto/internal/chacha20/chacha_generic.go [moved from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_generic.go with 100% similarity]
src/internal/x/crypto/internal/chacha20/chacha_noasm.go [moved from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_noasm.go with 100% similarity]
src/internal/x/crypto/internal/chacha20/chacha_s390x.go [moved from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_s390x.go with 100% similarity]
src/internal/x/crypto/internal/chacha20/chacha_test.go [moved from src/vendor/golang_org/x/crypto/internal/chacha20/chacha_test.go with 100% similarity]
src/internal/x/crypto/internal/chacha20/vectors_test.go [moved from src/vendor/golang_org/x/crypto/internal/chacha20/vectors_test.go with 100% similarity]
src/internal/x/crypto/internal/chacha20/xor.go [moved from src/vendor/golang_org/x/crypto/internal/chacha20/xor.go with 100% similarity]
src/internal/x/crypto/poly1305/poly1305.go [moved from src/vendor/golang_org/x/crypto/poly1305/poly1305.go with 95% similarity]
src/internal/x/crypto/poly1305/poly1305_test.go [moved from src/vendor/golang_org/x/crypto/poly1305/poly1305_test.go with 100% similarity]
src/internal/x/crypto/poly1305/sum_amd64.go [moved from src/vendor/golang_org/x/crypto/poly1305/sum_amd64.go with 100% similarity]
src/internal/x/crypto/poly1305/sum_amd64.s [moved from src/vendor/golang_org/x/crypto/poly1305/sum_amd64.s with 100% similarity]
src/internal/x/crypto/poly1305/sum_arm.go [moved from src/vendor/golang_org/x/crypto/poly1305/sum_arm.go with 100% similarity]
src/internal/x/crypto/poly1305/sum_arm.s [moved from src/vendor/golang_org/x/crypto/poly1305/sum_arm.s with 100% similarity]
src/internal/x/crypto/poly1305/sum_noasm.go [moved from src/vendor/golang_org/x/crypto/poly1305/sum_noasm.go with 100% similarity]
src/internal/x/crypto/poly1305/sum_ref.go [moved from src/vendor/golang_org/x/crypto/poly1305/sum_ref.go with 100% similarity]
src/internal/x/crypto/poly1305/sum_s390x.go [moved from src/vendor/golang_org/x/crypto/poly1305/sum_s390x.go with 100% similarity]
src/internal/x/crypto/poly1305/sum_s390x.s [moved from src/vendor/golang_org/x/crypto/poly1305/sum_s390x.s with 100% similarity]
src/internal/x/crypto/poly1305/sum_vmsl_s390x.s [moved from src/vendor/golang_org/x/crypto/poly1305/sum_vmsl_s390x.s with 100% similarity]
src/internal/x/crypto/poly1305/vectors_test.go [moved from src/vendor/golang_org/x/crypto/poly1305/vectors_test.go with 100% similarity]
src/internal/x/fiximports.bash [new file with mode: 0755]
src/internal/x/net/dns/dnsmessage/example_test.go [moved from src/vendor/golang_org/x/net/dns/dnsmessage/example_test.go with 98% similarity]
src/internal/x/net/dns/dnsmessage/message.go [moved from src/vendor/golang_org/x/net/dns/dnsmessage/message.go with 100% similarity]
src/internal/x/net/dns/dnsmessage/message_test.go [moved from src/vendor/golang_org/x/net/dns/dnsmessage/message_test.go with 100% similarity]
src/internal/x/net/http/httpguts/guts.go [moved from src/vendor/golang_org/x/net/http/httpguts/guts.go with 100% similarity]
src/internal/x/net/http/httpguts/httplex.go [moved from src/vendor/golang_org/x/net/http/httpguts/httplex.go with 99% similarity]
src/internal/x/net/http/httpguts/httplex_test.go [moved from src/vendor/golang_org/x/net/http/httpguts/httplex_test.go with 100% similarity]
src/internal/x/net/http/httpproxy/export_test.go [moved from src/vendor/golang_org/x/net/http/httpproxy/export_test.go with 100% similarity]
src/internal/x/net/http/httpproxy/proxy.go [moved from src/vendor/golang_org/x/net/http/httpproxy/proxy.go with 99% similarity]
src/internal/x/net/http/httpproxy/proxy_test.go [moved from src/vendor/golang_org/x/net/http/httpproxy/proxy_test.go with 99% similarity]
src/internal/x/net/http2/hpack/encode.go [moved from src/vendor/golang_org/x/net/http2/hpack/encode.go with 100% similarity]
src/internal/x/net/http2/hpack/encode_test.go [moved from src/vendor/golang_org/x/net/http2/hpack/encode_test.go with 100% similarity]
src/internal/x/net/http2/hpack/hpack.go [moved from src/vendor/golang_org/x/net/http2/hpack/hpack.go with 97% similarity]
src/internal/x/net/http2/hpack/hpack_test.go [moved from src/vendor/golang_org/x/net/http2/hpack/hpack_test.go with 98% similarity]
src/internal/x/net/http2/hpack/huffman.go [moved from src/vendor/golang_org/x/net/http2/hpack/huffman.go with 100% similarity]
src/internal/x/net/http2/hpack/tables.go [moved from src/vendor/golang_org/x/net/http2/hpack/tables.go with 100% similarity]
src/internal/x/net/http2/hpack/tables_test.go [moved from src/vendor/golang_org/x/net/http2/hpack/tables_test.go with 100% similarity]
src/internal/x/net/idna/idna.go [moved from src/vendor/golang_org/x/net/idna/idna.go with 99% similarity]
src/internal/x/net/idna/punycode.go [moved from src/vendor/golang_org/x/net/idna/punycode.go with 100% similarity]
src/internal/x/net/idna/punycode_test.go [moved from src/vendor/golang_org/x/net/idna/punycode_test.go with 100% similarity]
src/internal/x/net/idna/tables.go [moved from src/vendor/golang_org/x/net/idna/tables.go with 99% similarity]
src/internal/x/net/idna/trie.go [moved from src/vendor/golang_org/x/net/idna/trie.go with 100% similarity]
src/internal/x/net/idna/trieval.go [moved from src/vendor/golang_org/x/net/idna/trieval.go with 97% similarity]
src/internal/x/net/internal/nettest/helper_bsd.go [moved from src/vendor/golang_org/x/net/internal/nettest/helper_bsd.go with 100% similarity]
src/internal/x/net/internal/nettest/helper_nobsd.go [moved from src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go with 91% similarity]
src/internal/x/net/internal/nettest/helper_posix.go [moved from src/vendor/golang_org/x/net/internal/nettest/helper_posix.go with 88% similarity]
src/internal/x/net/internal/nettest/helper_stub.go [moved from src/vendor/golang_org/x/net/internal/nettest/helper_stub.go with 95% similarity]
src/internal/x/net/internal/nettest/helper_unix.go [moved from src/vendor/golang_org/x/net/internal/nettest/helper_unix.go with 89% similarity]
src/internal/x/net/internal/nettest/helper_windows.go [moved from src/vendor/golang_org/x/net/internal/nettest/helper_windows.go with 100% similarity]
src/internal/x/net/internal/nettest/interface.go [moved from src/vendor/golang_org/x/net/internal/nettest/interface.go with 100% similarity]
src/internal/x/net/internal/nettest/rlimit.go [moved from src/vendor/golang_org/x/net/internal/nettest/rlimit.go with 100% similarity]
src/internal/x/net/internal/nettest/stack.go [moved from src/vendor/golang_org/x/net/internal/nettest/stack.go with 96% similarity]
src/internal/x/net/lif/address.go [moved from src/vendor/golang_org/x/net/lif/address.go with 100% similarity]
src/internal/x/net/lif/address_test.go [moved from src/vendor/golang_org/x/net/lif/address_test.go with 100% similarity]
src/internal/x/net/lif/binary.go [moved from src/vendor/golang_org/x/net/lif/binary.go with 100% similarity]
src/internal/x/net/lif/defs_solaris.go [moved from src/vendor/golang_org/x/net/lif/defs_solaris.go with 100% similarity]
src/internal/x/net/lif/lif.go [moved from src/vendor/golang_org/x/net/lif/lif.go with 100% similarity]
src/internal/x/net/lif/link.go [moved from src/vendor/golang_org/x/net/lif/link.go with 100% similarity]
src/internal/x/net/lif/link_test.go [moved from src/vendor/golang_org/x/net/lif/link_test.go with 100% similarity]
src/internal/x/net/lif/sys.go [moved from src/vendor/golang_org/x/net/lif/sys.go with 100% similarity]
src/internal/x/net/lif/sys_solaris_amd64.s [moved from src/vendor/golang_org/x/net/lif/sys_solaris_amd64.s with 100% similarity]
src/internal/x/net/lif/syscall.go [moved from src/vendor/golang_org/x/net/lif/syscall.go with 100% similarity]
src/internal/x/net/lif/zsys_solaris_amd64.go [moved from src/vendor/golang_org/x/net/lif/zsys_solaris_amd64.go with 100% similarity]
src/internal/x/net/nettest/conntest.go [moved from src/vendor/golang_org/x/net/nettest/conntest.go with 100% similarity]
src/internal/x/net/nettest/conntest_go16.go [moved from src/vendor/golang_org/x/net/nettest/conntest_go16.go with 100% similarity]
src/internal/x/net/nettest/conntest_go17.go [moved from src/vendor/golang_org/x/net/nettest/conntest_go17.go with 100% similarity]
src/internal/x/net/nettest/conntest_test.go [moved from src/vendor/golang_org/x/net/nettest/conntest_test.go with 97% similarity]
src/internal/x/net/route/address.go [moved from src/vendor/golang_org/x/net/route/address.go with 100% similarity]
src/internal/x/net/route/address_darwin_test.go [moved from src/vendor/golang_org/x/net/route/address_darwin_test.go with 100% similarity]
src/internal/x/net/route/address_test.go [moved from src/vendor/golang_org/x/net/route/address_test.go with 100% similarity]
src/internal/x/net/route/binary.go [moved from src/vendor/golang_org/x/net/route/binary.go with 100% similarity]
src/internal/x/net/route/defs_darwin.go [moved from src/vendor/golang_org/x/net/route/defs_darwin.go with 100% similarity]
src/internal/x/net/route/defs_dragonfly.go [moved from src/vendor/golang_org/x/net/route/defs_dragonfly.go with 100% similarity]
src/internal/x/net/route/defs_freebsd.go [moved from src/vendor/golang_org/x/net/route/defs_freebsd.go with 100% similarity]
src/internal/x/net/route/defs_netbsd.go [moved from src/vendor/golang_org/x/net/route/defs_netbsd.go with 100% similarity]
src/internal/x/net/route/defs_openbsd.go [moved from src/vendor/golang_org/x/net/route/defs_openbsd.go with 100% similarity]
src/internal/x/net/route/empty.s [moved from src/internal/syscall/unix/empty.s with 90% similarity]
src/internal/x/net/route/interface.go [moved from src/vendor/golang_org/x/net/route/interface.go with 100% similarity]
src/internal/x/net/route/interface_announce.go [moved from src/vendor/golang_org/x/net/route/interface_announce.go with 100% similarity]
src/internal/x/net/route/interface_classic.go [moved from src/vendor/golang_org/x/net/route/interface_classic.go with 100% similarity]
src/internal/x/net/route/interface_freebsd.go [moved from src/vendor/golang_org/x/net/route/interface_freebsd.go with 100% similarity]
src/internal/x/net/route/interface_multicast.go [moved from src/vendor/golang_org/x/net/route/interface_multicast.go with 100% similarity]
src/internal/x/net/route/interface_openbsd.go [moved from src/vendor/golang_org/x/net/route/interface_openbsd.go with 100% similarity]
src/internal/x/net/route/message.go [moved from src/vendor/golang_org/x/net/route/message.go with 100% similarity]
src/internal/x/net/route/message_darwin_test.go [moved from src/vendor/golang_org/x/net/route/message_darwin_test.go with 100% similarity]
src/internal/x/net/route/message_freebsd_test.go [moved from src/vendor/golang_org/x/net/route/message_freebsd_test.go with 100% similarity]
src/internal/x/net/route/message_test.go [moved from src/vendor/golang_org/x/net/route/message_test.go with 100% similarity]
src/internal/x/net/route/route.go [moved from src/vendor/golang_org/x/net/route/route.go with 100% similarity]
src/internal/x/net/route/route_classic.go [moved from src/vendor/golang_org/x/net/route/route_classic.go with 100% similarity]
src/internal/x/net/route/route_openbsd.go [moved from src/vendor/golang_org/x/net/route/route_openbsd.go with 100% similarity]
src/internal/x/net/route/route_test.go [moved from src/vendor/golang_org/x/net/route/route_test.go with 100% similarity]
src/internal/x/net/route/sys.go [moved from src/vendor/golang_org/x/net/route/sys.go with 100% similarity]
src/internal/x/net/route/sys_darwin.go [moved from src/vendor/golang_org/x/net/route/sys_darwin.go with 100% similarity]
src/internal/x/net/route/sys_dragonfly.go [moved from src/vendor/golang_org/x/net/route/sys_dragonfly.go with 100% similarity]
src/internal/x/net/route/sys_freebsd.go [moved from src/vendor/golang_org/x/net/route/sys_freebsd.go with 100% similarity]
src/internal/x/net/route/sys_netbsd.go [moved from src/vendor/golang_org/x/net/route/sys_netbsd.go with 100% similarity]
src/internal/x/net/route/sys_openbsd.go [moved from src/vendor/golang_org/x/net/route/sys_openbsd.go with 100% similarity]
src/internal/x/net/route/syscall.go [moved from src/vendor/golang_org/x/net/route/syscall.go with 93% similarity]
src/internal/x/net/route/syscall_go1_11_darwin.go [new file with mode: 0644]
src/internal/x/net/route/syscall_go1_12_darwin.go [new file with mode: 0644]
src/internal/x/net/route/zsys_darwin.go [moved from src/vendor/golang_org/x/net/route/zsys_darwin.go with 100% similarity]
src/internal/x/net/route/zsys_dragonfly.go [moved from src/vendor/golang_org/x/net/route/zsys_dragonfly.go with 100% similarity]
src/internal/x/net/route/zsys_freebsd_386.go [moved from src/vendor/golang_org/x/net/route/zsys_freebsd_386.go with 100% similarity]
src/internal/x/net/route/zsys_freebsd_amd64.go [moved from src/vendor/golang_org/x/net/route/zsys_freebsd_amd64.go with 100% similarity]
src/internal/x/net/route/zsys_freebsd_arm.go [moved from src/vendor/golang_org/x/net/route/zsys_freebsd_arm.go with 100% similarity]
src/internal/x/net/route/zsys_netbsd.go [moved from src/vendor/golang_org/x/net/route/zsys_netbsd.go with 100% similarity]
src/internal/x/net/route/zsys_openbsd.go [moved from src/vendor/golang_org/x/net/route/zsys_openbsd.go with 100% similarity]
src/internal/x/text/secure/bidirule/bidirule.go [moved from src/vendor/golang_org/x/text/secure/bidirule/bidirule.go with 99% similarity]
src/internal/x/text/secure/doc.go [moved from src/vendor/golang_org/x/text/secure/doc.go with 85% similarity]
src/internal/x/text/transform/examples_test.go [moved from src/vendor/golang_org/x/text/transform/examples_test.go with 92% similarity]
src/internal/x/text/transform/transform.go [moved from src/vendor/golang_org/x/text/transform/transform.go with 99% similarity]
src/internal/x/text/unicode/bidi/bidi.go [moved from src/vendor/golang_org/x/text/unicode/bidi/bidi.go with 99% similarity]
src/internal/x/text/unicode/bidi/bracket.go [moved from src/vendor/golang_org/x/text/unicode/bidi/bracket.go with 100% similarity]
src/internal/x/text/unicode/bidi/core.go [moved from src/vendor/golang_org/x/text/unicode/bidi/core.go with 100% similarity]
src/internal/x/text/unicode/bidi/example_test.go [moved from src/vendor/golang_org/x/text/unicode/bidi/example_test.go with 99% similarity]
src/internal/x/text/unicode/bidi/prop.go [moved from src/vendor/golang_org/x/text/unicode/bidi/prop.go with 100% similarity]
src/internal/x/text/unicode/bidi/tables.go [moved from src/vendor/golang_org/x/text/unicode/bidi/tables.go with 99% similarity]
src/internal/x/text/unicode/bidi/trieval.go [moved from src/vendor/golang_org/x/text/unicode/bidi/trieval.go with 95% similarity]
src/internal/x/text/unicode/doc.go [moved from src/vendor/golang_org/x/text/unicode/doc.go with 84% similarity]
src/internal/x/text/unicode/norm/composition.go [moved from src/vendor/golang_org/x/text/unicode/norm/composition.go with 100% similarity]
src/internal/x/text/unicode/norm/example_iter_test.go [moved from src/vendor/golang_org/x/text/unicode/norm/example_iter_test.go with 98% similarity]
src/internal/x/text/unicode/norm/example_test.go [moved from src/vendor/golang_org/x/text/unicode/norm/example_test.go with 94% similarity]
src/internal/x/text/unicode/norm/forminfo.go [moved from src/vendor/golang_org/x/text/unicode/norm/forminfo.go with 100% similarity]
src/internal/x/text/unicode/norm/input.go [moved from src/vendor/golang_org/x/text/unicode/norm/input.go with 100% similarity]
src/internal/x/text/unicode/norm/iter.go [moved from src/vendor/golang_org/x/text/unicode/norm/iter.go with 100% similarity]
src/internal/x/text/unicode/norm/normalize.go [moved from src/vendor/golang_org/x/text/unicode/norm/normalize.go with 99% similarity]
src/internal/x/text/unicode/norm/readwriter.go [moved from src/vendor/golang_org/x/text/unicode/norm/readwriter.go with 100% similarity]
src/internal/x/text/unicode/norm/tables.go [moved from src/vendor/golang_org/x/text/unicode/norm/tables.go with 99% similarity]
src/internal/x/text/unicode/norm/transform.go [moved from src/vendor/golang_org/x/text/unicode/norm/transform.go with 98% similarity]
src/internal/x/text/unicode/norm/trie.go [moved from src/vendor/golang_org/x/text/unicode/norm/trie.go with 100% similarity]
src/internal/x/text/unicode/norm/triegen.go [moved from src/vendor/golang_org/x/text/unicode/norm/triegen.go with 100% similarity]
src/internal/xcoff/ar.go [new file with mode: 0644]
src/internal/xcoff/ar_test.go [new file with mode: 0644]
src/internal/xcoff/file.go [moved from src/cmd/internal/xcoff/file.go with 100% similarity]
src/internal/xcoff/file_test.go [moved from src/cmd/internal/xcoff/file_test.go with 100% similarity]
src/internal/xcoff/testdata/bigar-empty [new file with mode: 0644]
src/internal/xcoff/testdata/bigar-ppc64 [new file with mode: 0644]
src/internal/xcoff/testdata/gcc-ppc32-aix-dwarf2-exec [moved from src/cmd/internal/xcoff/testdata/gcc-ppc32-aix-dwarf2-exec with 100% similarity]
src/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec [moved from src/cmd/internal/xcoff/testdata/gcc-ppc64-aix-dwarf2-exec with 100% similarity]
src/internal/xcoff/testdata/hello.c [moved from src/cmd/internal/xcoff/testdata/hello.c with 100% similarity]
src/internal/xcoff/testdata/printbye.c [new file with mode: 0644]
src/internal/xcoff/testdata/printhello.c [new file with mode: 0644]
src/internal/xcoff/xcoff.go [moved from src/cmd/internal/xcoff/xcoff.go with 100% similarity]
src/make.bash
src/make.bat
src/make.rc
src/math/all_test.go
src/math/big/nat.go
src/math/big/prime.go
src/math/big/ratconv.go
src/math/bits/bits.go
src/math/bits/bits_test.go
src/math/export_test.go
src/math/huge_test.go [new file with mode: 0644]
src/math/log1p.go
src/math/sin.go
src/math/sin_386.s
src/math/sincos.go
src/math/sincos_386.go [deleted file]
src/math/sincos_386.s [deleted file]
src/math/tan.go
src/math/tan_386.s
src/math/trig_reduce.go [new file with mode: 0644]
src/math/unsafe.go
src/mime/mediatype.go
src/mime/mediatype_test.go
src/mime/multipart/writer.go
src/mime/multipart/writer_test.go
src/net/dial.go
src/net/dial_test.go
src/net/dnsclient.go
src/net/dnsclient_unix.go
src/net/dnsclient_unix_test.go
src/net/hook.go
src/net/http/client.go
src/net/http/cookie.go
src/net/http/export_test.go
src/net/http/fs_test.go
src/net/http/h2_bundle.go
src/net/http/header.go
src/net/http/http.go
src/net/http/httptest/recorder.go
src/net/http/httptest/server.go
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go
src/net/http/request.go
src/net/http/requestwrite_test.go
src/net/http/response.go
src/net/http/roundtrip_js.go
src/net/http/server.go
src/net/http/status.go
src/net/http/transfer.go
src/net/http/transport.go
src/net/http/transport_test.go
src/net/interface.go
src/net/interface_bsd.go
src/net/interface_bsdvar.go
src/net/interface_darwin.go
src/net/interface_freebsd.go
src/net/interface_solaris.go
src/net/lookup.go
src/net/lookup_test.go
src/net/lookup_unix.go
src/net/net_test.go
src/net/pipe_test.go
src/net/sendfile_linux.go
src/net/sendfile_test.go
src/net/sendfile_unix_alt.go
src/net/sockopt_aix.go
src/net/timeout_test.go
src/net/udpsock_test.go
src/net/unixsock.go
src/net/url/url.go
src/net/url/url_test.go
src/os/dir_ios.go [new file with mode: 0644]
src/os/dir_unix.go
src/os/example_test.go
src/os/exec_posix.go
src/os/file.go
src/os/file_plan9.go
src/os/file_unix.go
src/os/file_windows.go
src/os/os_test.go
src/os/os_unix_test.go
src/os/os_windows_test.go
src/os/path.go
src/os/pipe_test.go
src/os/rawconn.go [new file with mode: 0644]
src/os/rawconn_test.go [new file with mode: 0644]
src/os/removeall_at.go
src/os/removeall_noat.go
src/os/removeall_test.go
src/os/signal/signal_test.go
src/os/stat_freebsd.go
src/os/types_windows.go
src/os/wait_unimp.go
src/os/wait_wait6.go
src/os/wait_waitid.go
src/path/filepath/path_test.go
src/path/filepath/path_windows_test.go
src/path/filepath/symlink.go
src/path/filepath/symlink_unix.go
src/path/filepath/symlink_windows.go
src/plugin/plugin_test.go [new file with mode: 0644]
src/race.bash
src/reflect/all_test.go
src/reflect/type.go
src/reflect/value.go
src/regexp/example_test.go
src/run.bash
src/run.bat
src/run.rc
src/runtime/HACKING.md
src/runtime/alg.go
src/runtime/asm_arm64.s
src/runtime/asm_ppc64x.s
src/runtime/cgo/gcc_libinit_windows.c
src/runtime/cgo/gcc_openbsd_arm.c [new file with mode: 0644]
src/runtime/cgo/gcc_windows_386.c
src/runtime/cgo/gcc_windows_amd64.c
src/runtime/cgocall.go
src/runtime/cgocheck.go
src/runtime/cpuflags.go
src/runtime/crash_cgo_test.go
src/runtime/debug/mod.go [new file with mode: 0644]
src/runtime/debug_test.go
src/runtime/defs_openbsd_arm.go
src/runtime/defs_windows_386.go
src/runtime/defs_windows_amd64.go
src/runtime/defs_windows_arm.go
src/runtime/export_debug_test.go
src/runtime/export_test.go
src/runtime/extern.go
src/runtime/fastlog2table.go
src/runtime/hash_test.go
src/runtime/internal/sys/stubs.go
src/runtime/lfstack_64bit.go
src/runtime/lock_js.go
src/runtime/malloc.go
src/runtime/malloc_test.go
src/runtime/map.go
src/runtime/map_fast32.go
src/runtime/map_fast64.go
src/runtime/map_faststr.go
src/runtime/map_test.go
src/runtime/mbitmap.go
src/runtime/mem_bsd.go
src/runtime/mem_linux.go
src/runtime/mem_windows.go
src/runtime/mgc.go
src/runtime/mgclarge.go
src/runtime/mgcmark.go
src/runtime/mgcsweep.go
src/runtime/mgcwork.go
src/runtime/mheap.go
src/runtime/mkfastlog2table.go
src/runtime/mwbbuf.go
src/runtime/os2_aix.go
src/runtime/os_windows.go
src/runtime/os_windows_arm.go
src/runtime/panic.go
src/runtime/pprof/internal/profile/filter.go
src/runtime/pprof/pprof_test.go
src/runtime/pprof/proto.go
src/runtime/print.go
src/runtime/proc.go
src/runtime/proc_test.go
src/runtime/race.go
src/runtime/race/README
src/runtime/race/race.go
src/runtime/race/race_linux_arm64.syso [new file with mode: 0644]
src/runtime/race_arm64.s [new file with mode: 0644]
src/runtime/rt0_js_wasm.s
src/runtime/rt0_linux_ppc64.s
src/runtime/runtime-gdb.py
src/runtime/runtime-gdb_test.go
src/runtime/runtime1.go
src/runtime/runtime2.go
src/runtime/select.go
src/runtime/signal_openbsd_arm.go
src/runtime/signal_unix.go
src/runtime/signal_windows.go
src/runtime/stack.go
src/runtime/stubs.go
src/runtime/symtab.go
src/runtime/sys_darwin_32.go
src/runtime/sys_darwin_386.s
src/runtime/sys_darwin_64.go
src/runtime/sys_darwin_amd64.s
src/runtime/sys_darwin_arm.s
src/runtime/sys_darwin_arm64.s
src/runtime/sys_linux_ppc64x.s
src/runtime/sys_openbsd_arm.s
src/runtime/sys_wasm.s
src/runtime/sys_windows_arm.s
src/runtime/syscall_aix.go
src/runtime/syscall_windows_test.go
src/runtime/testdata/testprog/gettid.go [deleted file]
src/runtime/testdata/testprog/lockosthread.go
src/runtime/testdata/testprog/memprof.go
src/runtime/testdata/testprog/syscalls.go [moved from src/cmd/vet/testdata/cgo/cgo3.go with 55% similarity]
src/runtime/testdata/testprog/syscalls_linux.go [new file with mode: 0644]
src/runtime/testdata/testprog/syscalls_none.go [moved from src/runtime/testdata/testprog/gettid_none.go with 68% similarity]
src/runtime/testdata/testprogcgo/pprof.go
src/runtime/testdata/testprogcgo/threadpprof.go
src/runtime/textflag.h
src/runtime/tls_arm.s
src/runtime/trace/annotation.go
src/runtime/traceback.go
src/runtime/type.go
src/runtime/vdso_linux.go
src/sort/sort.go
src/strconv/atoi.go
src/strconv/doc.go
src/strconv/itoa.go
src/strings/example_test.go
src/syscall/asm_aix_ppc64.s [new file with mode: 0644]
src/syscall/dirent_bsd_test.go
src/syscall/dll_windows.go
src/syscall/exec_linux.go
src/syscall/flock_aix.go
src/syscall/fs_js.go
src/syscall/js/callback.go [deleted file]
src/syscall/js/func.go [new file with mode: 0644]
src/syscall/js/js.go
src/syscall/js/js_test.go
src/syscall/mkall.sh
src/syscall/mkpost.go
src/syscall/net.go
src/syscall/sockcmsg_unix.go
src/syscall/syscall_darwin.go
src/syscall/syscall_darwin_386.go
src/syscall/syscall_darwin_amd64.go
src/syscall/syscall_darwin_arm.go
src/syscall/syscall_darwin_arm64.go
src/syscall/syscall_freebsd.go
src/syscall/syscall_js.go
src/syscall/zsyscall_darwin_386.go
src/syscall/zsyscall_darwin_386.s
src/syscall/zsyscall_darwin_amd64.go
src/syscall/zsyscall_darwin_amd64.s
src/syscall/zsyscall_darwin_arm.go
src/syscall/zsyscall_darwin_arm.s
src/syscall/zsyscall_darwin_arm64.go
src/syscall/zsyscall_darwin_arm64.s
src/syscall/ztypes_freebsd_386.go
src/syscall/ztypes_freebsd_amd64.go
src/syscall/ztypes_freebsd_arm.go
src/syscall/ztypes_openbsd_arm.go
src/testing/benchmark.go
src/testing/sub_test.go
src/testing/testing.go
src/time/zoneinfo.go
src/time/zoneinfo_read.go
src/unicode/maketables.go
src/unicode/tables.go
src/unsafe/unsafe.go
test/chan/powser1.go
test/chan/powser2.go
test/chancap.go
test/codegen/arithmetic.go
test/codegen/condmove.go
test/codegen/mathbits.go
test/codegen/zerosize.go [new file with mode: 0644]
test/escape5.go
test/fixedbugs/bug273.go
test/fixedbugs/issue17038.go
test/fixedbugs/issue19507.dir/div_arm.s
test/fixedbugs/issue23311.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue23311.go [moved from src/runtime/testdata/testprog/empty.s with 70% similarity]
test/fixedbugs/issue23734.go [new file with mode: 0644]
test/fixedbugs/issue23780.go [new file with mode: 0644]
test/fixedbugs/issue23781.go [new file with mode: 0644]
test/fixedbugs/issue24488.go [new file with mode: 0644]
test/fixedbugs/issue24760.go [new file with mode: 0644]
test/fixedbugs/issue27201.go [new file with mode: 0644]
test/fixedbugs/issue27695c.go [new file with mode: 0644]
test/fixedbugs/issue28078.go [new file with mode: 0644]
test/fixedbugs/issue28079a.go [new file with mode: 0644]
test/fixedbugs/issue28079b.go [new file with mode: 0644]
test/fixedbugs/issue28079c.go [new file with mode: 0644]
test/fixedbugs/issue28445.go [new file with mode: 0644]
test/fixedbugs/issue28450.go [new file with mode: 0644]
test/fixedbugs/issue28688.go [new file with mode: 0644]
test/fixedbugs/issue28797.go [new file with mode: 0644]
test/fixedbugs/issue29013a.go [new file with mode: 0644]
test/fixedbugs/issue29013b.go [new file with mode: 0644]
test/fixedbugs/issue29190.go [new file with mode: 0644]
test/fixedbugs/issue29215.go [new file with mode: 0644]
test/fixedbugs/issue29220.go [new file with mode: 0644]
test/fixedbugs/issue29264.go [new file with mode: 0644]
test/fixedbugs/issue29304.go [new file with mode: 0644]
test/fixedbugs/issue29329.go [new file with mode: 0644]
test/fixedbugs/issue29350.go [new file with mode: 0644]
test/fixedbugs/issue29362.go [new file with mode: 0644]
test/fixedbugs/issue29362b.go [new file with mode: 0644]
test/fixedbugs/issue29389.go [new file with mode: 0644]
test/fixedbugs/issue29402.go [new file with mode: 0644]
test/fixedbugs/issue29562.go [new file with mode: 0644]
test/fixedbugs/issue29610.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue29610.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue29610.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue29610.go [new file with mode: 0644]
test/fixedbugs/issue29735.go [new file with mode: 0644]
test/fixedbugs/issue29870.go [new file with mode: 0644]
test/fixedbugs/issue29870b.go [new file with mode: 0644]
test/fixedbugs/issue29919.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue29919.dir/main.go [new file with mode: 0644]
test/fixedbugs/issue29919.go [new file with mode: 0644]
test/fixedbugs/issue29943.go [new file with mode: 0644]
test/fixedbugs/issue30041.go [new file with mode: 0644]
test/fixedbugs/issue30061.go [new file with mode: 0644]
test/fixedbugs/issue4085b.go
test/fixedbugs/issue5856.go
test/fixedbugs/issue7921.go
test/inline_caller.go
test/inline_callers.go
test/loopbce.go
test/nilptr.go
test/nilptr3.go
test/nilptr3_wasm.go [deleted file]
test/nilptr5.go [new file with mode: 0644]
test/nilptr5_aix.go [new file with mode: 0644]
test/nilptr5_wasm.go [new file with mode: 0644]
test/nilptr_aix.go [new file with mode: 0644]
test/notinheap3.go
test/prove.go
test/run.go
test/sinit.go
test/writebarrier.go

diff --git a/AUTHORS b/AUTHORS
index 8001484e1239867cc810cccd8e230e8c3cb18921..8b8105b1ade37a9593436ae44fb2301293e8fd05 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -418,7 +418,7 @@ Eivind Uggedal <eivind@uggedal.com>
 Elbert Fliek <efliek@gmail.com>
 Eldar Rakhimberdin <ibeono@gmail.com>
 Elena Grahovac <elena@grahovac.me>
-Elias Naur <elias.naur@gmail.com>
+Elias Naur <mail@eliasnaur.com> <elias.naur@gmail.com>
 Elliot Morrison-Reed <elliotmr@gmail.com>
 Emerson Lin <linyintor@gmail.com>
 Emil Hessman <emil@hessman.se>
@@ -1304,6 +1304,7 @@ Sven Almgren <sven@tras.se>
 Sylvain Zimmer <sylvain@sylvainzimmer.com>
 Syohei YOSHIDA <syohex@gmail.com>
 Szabolcs Nagy <nsz@port70.net>
+Taavi Kivisik <taavi.kivisik@gmail.com>
 Tad Fisher <tadfisher@gmail.com>
 Tad Glines <tad.glines@gmail.com>
 Taj Khattra <taj.khattra@gmail.com>
index 305f6d8d801ce258e843ec2a2a69c9c5939e269d..b201301a850eb929e165479e5bca3553361db59a 100644 (file)
@@ -25,6 +25,7 @@
 # Please keep the list sorted.
 
 Aamir Khan <syst3m.w0rm@gmail.com>
+Aaron Cannon <cannona@fireantproductions.com>
 Aaron France <aaron.l.france@gmail.com>
 Aaron Jacobs <jacobsa@google.com>
 Aaron Kemp <kemp.aaron@gmail.com>
@@ -32,6 +33,7 @@ Aaron Stein <aaronstein12@gmail.com>
 Aaron Torres <tcboox@gmail.com>
 Aaron Zinman <aaron@azinman.com>
 Aarti Parikh <aarti.parikh@gmail.com>
+Abdullah Al Maruf <mymail.maruf@gmail.com>
 Abe Haskins <abeisgreat@abeisgreat.com>
 Abhinav Gupta <abhinav.g90@gmail.com>
 Adam Azarchs <adam.azarchs@10xgenomics.com>
@@ -66,6 +68,7 @@ Aishraj Dahal <aishraj@users.noreply.github.com>
 Akhil Indurti <contact@akhilindurti.com>
 Akihiro Suda <suda.kyoto@gmail.com>
 Akshat Kumar <seed@mail.nanosouffle.net>
+Alan Braithwaite <alan@ipaddr.org>
 Alan Donovan <adonovan@google.com>
 Alan Shreve <alan@inconshreveable.com>
 Albert Nigmatzianov <albertnigma@gmail.com>
@@ -74,8 +77,10 @@ Albert Yu <yukinying@gmail.com>
 Alberto Bertogli <albertito@blitiri.com.ar>
 Alberto Donizetti <alb.donizetti@gmail.com>
 Alberto García Hierro <alberto@garciahierro.com> <alberto.garcia.hierro@gmail.com>
+Aleksa Sarai <cyphar@cyphar.com>
 Aleksandar Dezelin <dezelin@gmail.com>
 Aleksandr Lukinykh <a.lukinykh@xsolla.com>
+Aleksandr Razumov <ar@cydev.ru>
 Alekseev Artem <a.artem060@gmail.com>
 Alessandro Arzilli <alessandro.arzilli@gmail.com>
 Alessandro Baffa <alessandro.baffa@gmail.com>
@@ -85,6 +90,7 @@ Alex Bramley <abramley@google.com>
 Alex Browne <stephenalexbrowne@gmail.com>
 Alex Carol <alex.carol.c@gmail.com>
 Alex Jin <toalexjin@gmail.com>
+Alex Kohler <alexjohnkohler@gmail.com>
 Alex Myasoedov <msoedov@gmail.com>
 Alex Plugaru <alex@plugaru.org> <alexandru.plugaru@gmail.com>
 Alex Schroeder <alex@gnu.org>
@@ -106,15 +112,19 @@ Alexander Polcyn <apolcyn@google.com>
 Alexander Reece <awreece@gmail.com>
 Alexander Surma <surma@surmair.de>
 Alexander Zhavnerchik <alex.vizor@gmail.com>
+Alexander Zillion <alex@alexzillion.com>
 Alexander Zolotov <goldifit@gmail.com>
 Alexandre Cesaro <alexandre.cesaro@gmail.com>
 Alexandre Fiori <fiorix@gmail.com>
+Alexandre Maari <draeron@gmail.com>
 Alexandre Normand <alexandre.normand@gmail.com>
 Alexandre Parentea <aubonbeurre@gmail.com>
 Alexandre Viau <alexandre@alexandreviau.net>
 Alexandru Moșoi <brtzsnr@gmail.com>
 Alexei Sholik <alcosholik@gmail.com>
+Alexey Alexandrov <aalexand@google.com>
 Alexey Borzenkov <snaury@gmail.com>
+Alexey Naidonov <alexey.naidyonov@gmail.com>
 Alexey Neganov <neganovalexey@gmail.com>
 Alexey Palazhchenko <alexey.palazhchenko@gmail.com>
 Alexis Hildebrandt <surryhill@gmail.com>
@@ -133,14 +143,17 @@ Anand K. Mistry <anand@mistry.ninja>
 Anders Pearson <anders@columbia.edu>
 André Carvalho <asantostc@gmail.com>
 Andre Nathan <andrenth@gmail.com>
+Andrea Nodari <andrea.nodari91@gmail.com>
 Andrea Spadaccini <spadaccio@google.com>
 Andreas Auernhammer <aead@mail.de>
 Andreas Jellinghaus <andreas@ionisiert.de> <anj@google.com>
 Andreas Litt <andreas.litt@gmail.com>
+Andrei Gherzan <andrei@resin.io>
 Andrei Korzhevskii <a.korzhevskiy@gmail.com>
 Andrei Tudor Călin <mail@acln.ro>
 Andrei Vieru <euvieru@gmail.com>
 Andres Erbsen <andreser@google.com>
+Andres Lowrie <andres.lowrie@gmail.com>
 Andrew Austin <andrewaclt@gmail.com>
 Andrew Balholm <andybalholm@gmail.com>
 Andrew Benton <andrewmbenton@gmail.com>
@@ -155,9 +168,11 @@ Andrew Jackura <ajackura@google.com>
 Andrew Lutomirski <andy@luto.us>
 Andrew Pilloud <andrewpilloud@igneoussystems.com>
 Andrew Pogrebnoy <absourd.noise@gmail.com>
+Andrew Poydence <apoydence@pivotal.io>
 Andrew Pritchard <awpritchard@gmail.com>
 Andrew Radev <andrey.radev@gmail.com>
 Andrew Skiba <skibaa@gmail.com>
+Andrew Stribblehill <ads@wompom.org>
 Andrew Szeto <andrew@jabagawee.com>
 Andrew Werner <andrew@upthere.com> <awerner32@gmail.com>
 Andrew Wilkins <axwalk@gmail.com>
@@ -174,21 +189,26 @@ Andy Finkenstadt <afinkenstadt@zynga.com>
 Andy Lindeman <andy@lindeman.io>
 Andy Maloney <asmaloney@gmail.com>
 Andy Walker <walkeraj@gmail.com>
+Andzej Maciusovic <andzej.maciusovic@gmail.com>
 Anfernee Yongkun Gui <anfernee.gui@gmail.com>
 Angelo Bulfone <mbulfone@gmail.com>
 Anh Hai Trinh <anh.hai.trinh@gmail.com>
 Anit Gandhi <anitgandhi@gmail.com>
+Ankit Goyal <ankit3goyal@gmail.com>
 Anmol Sethi <anmol@aubble.com>
 Anschel Schaffer-Cohen <anschelsc@gmail.com>
 Anthony Alves <cvballa3g0@gmail.com>
 Anthony Canino <anthony.canino1@gmail.com>
 Anthony Eufemio <anthony.eufemio@gmail.com>
+Anthony Fok <foka@debian.org>
 Anthony Martin <ality@pbrane.org>
 Anthony Sottile <asottile@umich.edu>
 Anthony Starks <ajstarks@gmail.com>
 Anthony Voutas <voutasaurus@gmail.com>
 Anthony Woods <awoods@raintank.io>
+Antoine GIRARD <sapk@sapk.fr>
 Antoine Martin <antoine97.martin@gmail.com>
+Anton Gyllenberg <anton@iki.fi>
 Antonin Amand <antonin.amand@gmail.com>
 Antonio Antelo <aantelov87@gmail.com>
 Antonio Bibiano <antbbn@gmail.com>
@@ -204,6 +224,7 @@ Arnaud Ysmal <arnaud.ysmal@gmail.com>
 Arne Hormann <arnehormann@gmail.com>
 Arnout Engelen <arnout@bzzt.net>
 Aron Nopanen <aron.nopanen@gmail.com>
+Arthur Fabre <arthur@arthurfabre.com>
 Arthur Khashaev <arthur@khashaev.ru>
 Artyom Pervukhin <artyom.pervukhin@gmail.com>
 Arvindh Rajesh Tamilmani <art@a-30.net>
@@ -217,6 +238,7 @@ Augusto Roman <aroman@gmail.com>
 Aulus Egnatius Varialus <varialus@gmail.com>
 Aurélien Rainone <aurelien.rainone@gmail.com>
 Austin Clements <austin@google.com> <aclements@csail.mit.edu>
+Avi Flax <avi@timehop.com>
 awaw fumin <awawfumin@gmail.com>
 Awn Umar <awn@cryptolosophy.io>
 Axel Wagner <axel.wagner.hh@googlemail.com>
@@ -224,6 +246,7 @@ Ayanamist Yang <ayanamist@gmail.com>
 Aymerick Jéhanne <aymerick@jehanne.org>
 Azat Kaumov <kaumov.a.r@gmail.com>
 Baiju Muthukadan <baiju.m.mail@gmail.com>
+Balaram Makam <bmakam.qdt@qualcommdatacenter.com>
 Balazs Lecz <leczb@google.com>
 Baokun Lee <nototon@gmail.com>
 Bartosz Grzybowski <melkorm@gmail.com>
@@ -233,6 +256,7 @@ Ben Burkert <ben@benburkert.com>
 Ben Eitzen <eitzenb@golang.org>
 Ben Fried <ben.fried@gmail.com>
 Ben Haines <bhainesva@gmail.com>
+Ben Hoyt <benhoyt@gmail.com>
 Ben Laurie <ben@links.org> <benl@google.com>
 Ben Lubar <ben.lubar@gmail.com>
 Ben Lynn <benlynn@gmail.com>
@@ -263,6 +287,7 @@ Blake Mizerany <blake.mizerany@gmail.com>
 Blixt <me@blixt.nyc>
 Bob Briski <rbriski@gmail.com>
 Bob Potter <bobby.potter@gmail.com>
+Bobby DeSimone <bobbydesimone@gmail.com>
 Bobby Powers <bobbypowers@gmail.com>
 Boris Nagaev <nagaev@google.com>
 Borja Clemente <borja.clemente@gmail.com>
@@ -313,6 +338,7 @@ Carlo Alberto Ferraris <cafxx@strayorange.com>
 Carlos Castillo <cookieo9@gmail.com>
 Carlos Cirello <uldericofilho@gmail.com>
 Carlos Eduardo Seo <cseo@linux.vnet.ibm.com>
+Carlos Souza <carloshrsouza@gmail.com>
 Carolyn Van Slyck <me@carolynvanslyck.com>
 Cary Hull <chull@google.com>
 Case Nelson <case.nelson@gmail.com>
@@ -324,7 +350,9 @@ Cedric Staub <cs@squareup.com>
 Cezar Sá Espinola <cezarsa@gmail.com>
 Chad Rosier <mrosier.qdt@qualcommdatacenter.com>
 ChaiShushan <chaishushan@gmail.com>
+Channing Kimble-Brown <channing@golang.org>
 Charles Fenwick Elliott <Charles@FenwickElliott.io>
+Charles Kenney <charlesc.kenney@gmail.com>
 Charles L. Dorian <cldorian@gmail.com>
 Charles Lee <zombie.fml@gmail.com>
 Charles Weill <weill@google.com>
@@ -355,6 +383,7 @@ Christian Alexander <christian@linux.com>
 Christian Couder <chriscool@tuxfamily.org>
 Christian Himpel <chressie@googlemail.com> <chressie@gmail.com>
 Christian Pellegrin <chri@evolware.org>
+Christian R. Petrin <christianpetrin@gmail.com>
 Christine Hansmann <chhansmann@gmail.com>
 Christoffer Buchholz <christoffer.buchholz@gmail.com>
 Christoph Blecker <admin@toph.ca>
@@ -371,12 +400,14 @@ Christopher Wedgwood <cw@f00f.org>
 Christos Zoulas <christos@zoulas.com> <zoulasc@gmail.com>
 Christy Perez <christy@linux.vnet.ibm.com>
 CL Sung <clsung@gmail.com> <cl_sung@htc.com>
+Clément Chigot <clement.chigot@atos.net>
 Clement Skau <clementskau@gmail.com>
 Cody Oss <the.cody.oss@gmail.com>
 Colby Ranger <cranger@google.com>
 Colin Cross <ccross@android.com>
 Colin Edwards <colin@recursivepenguin.com>
 Colin Kennedy <moshen.colin@gmail.com>
+Colin Nelson <colnnelson@google.com>
 Colin Rice <clr@google.com>
 Conrad Irwin <conrad.irwin@gmail.com>
 Conrad Meyer <cemeyer@cs.washington.edu>
@@ -401,10 +432,13 @@ Dan Caddigan <goldcaddy77@gmail.com>
 Dan Callahan <dan.callahan@gmail.com>
 Dan Harrington <harringtond@google.com>
 Dan Jacques <dnj@google.com>
+Dan Johnson <computerdruid@google.com>
 Dan Peterson <dpiddy@gmail.com>
 Dan Pupius <dan@medium.com>
 Dan Sinclair <dan.sinclair@gmail.com>
+Daniël de Kok <me@danieldk.eu>
 Daniel Fleischman <danielfleischman@gmail.com>
+Daniel Ingram <ingramds@appstate.edu>
 Daniel Johansson <dajo2002@gmail.com>
 Daniel Kerwin <d.kerwin@gini.net>
 Daniel Krech <eikeon@eikeon.com>
@@ -421,6 +455,7 @@ Daniel Upton <daniel@floppy.co>
 Daniela Petruzalek <daniela.petruzalek@gmail.com>
 Danny Rosseau <daniel.rosseau@gmail.com>
 Daria Kolistratova <daria.kolistratova@intel.com>
+Darien Raymond <admin@v2ray.com>
 Darren Elwood <darren@textnode.com>
 Darshan Parajuli <parajulidarshan@gmail.com>
 Datong Sun <dndx@idndx.com>
@@ -445,12 +480,15 @@ David du Colombier <0intro@gmail.com>
 David Forsythe <dforsythe@gmail.com>
 David G. Andersen <dave.andersen@gmail.com>
 David Glasser <glasser@meteor.com>
+David Heuschmann <heuschmann.d@gmail.com>
 David Howden <dhowden@gmail.com>
 David Hubbard <dsp@google.com>
 David Jakob Fritz <david.jakob.fritz@gmail.com>
+David Jones <dxjones@gmail.com>
 David Lazar <lazard@golang.org>
 David Leon Gil <coruus@gmail.com>
 David McLeish <davemc@google.com>
+David Ndungu <dnjuguna@gmail.com>
 David NewHamlet <david@newhamlet.com>
 David Presotto <presotto@gmail.com>
 David R. Jenni <david.r.jenni@gmail.com>
@@ -458,7 +496,9 @@ David Sansome <me@davidsansome.com>
 David Stainton <dstainton415@gmail.com>
 David Symonds <dsymonds@golang.org>
 David Thomas <davidthomas426@gmail.com>
+David Timm <dtimm@pivotal.io>
 David Titarenco <david.titarenco@gmail.com>
+David Tolpin <david.tolpin@gmail.com>
 David Url <david@urld.io>
 David Volquartz Lebech <david@lebech.info>
 David Wimmer <davidlwimmer@gmail.com>
@@ -471,6 +511,7 @@ Denis Brandolini <denis.brandolini@gmail.com>
 Denis Nagorny <denis.nagorny@intel.com>
 Dennis Kuhnert <mail.kuhnert@gmail.com>
 Denys Honsiorovskyi <honsiorovskyi@gmail.com>
+Denys Smirnov <denis.smirnov.91@gmail.com>
 Derek Buitenhuis <derek.buitenhuis@gmail.com>
 Derek Che <drc@yahoo-inc.com>
 Derek McGowan <derek@mcgstyle.net>
@@ -485,9 +526,11 @@ Dhiru Kholia <dhiru.kholia@gmail.com>
 Dhruvdutt Jadhav <dhruvdutt.jadhav@gmail.com>
 Di Xiao <dixiao@google.com>
 Didier Spezia <didier.06@gmail.com>
+Diego Siqueira <diego9889@gmail.com>
 Dieter Plaetinck <dieter@raintank.io>
 Dimitri Sokolyuk <sokolyuk@gmail.com>
 Dimitri Tcaciuc <dtcaciuc@gmail.com>
+Dina Garmash <dgrmsh@gmail.com>
 Diogo Pinela <diogoid7400@gmail.com>
 Dirk Gadsden <dirk@esherido.com>
 Diwaker Gupta <diwakergupta@gmail.com>
@@ -499,16 +542,21 @@ Dmitriy Shelenin <deemok@googlemail.com> <deemok@gmail.com>
 Dmitriy Vyukov <dvyukov@google.com>
 Dmitry Chestnykh <dchest@gmail.com>
 Dmitry Doroginin <doroginin@gmail.com>
+Dmitry Neverov <dmitry.neverov@gmail.com>
 Dmitry Savintsev <dsavints@gmail.com>
 Dmitry Yakunin <nonamezeil@gmail.com>
+Domen Ipavec <domen@ipavec.net>
 Dominic Green <dominicgreen1@gmail.com>
 Dominik Honnef <dominik.honnef@gmail.com>
 Dominik Vogt <vogt@linux.vnet.ibm.com>
+Don Byington <don@dbyington.com>
 Donald Huang <don.hcd@gmail.com>
 Dong-hee Na <donghee.na92@gmail.com>
 Donovan Hide <donovanhide@gmail.com>
 Doug Anderson <douga@google.com>
 Doug Fawley <dfawley@google.com>
+Douglas Danger Manley <doug.manley@gmail.com>
+Drew Flower <drewvanstone@gmail.com>
 Drew Hintz <adhintz@google.com>
 Duncan Holm <mail@frou.org>
 Dustin Carlino <dcarlino@google.com>
@@ -520,6 +568,7 @@ Dvir Volk <dvir@everything.me> <dvirsky@gmail.com>
 Dylan Waits <dylan@waits.io>
 Edan Bedrik <3d4nb3@gmail.com>
 Eden Li <eden.li@gmail.com>
+Eduard Urbach <e.urbach@gmail.com>
 Eduardo Ramalho <eduardo.ramalho@gmail.com>
 Edward Muller <edwardam@interlix.com>
 Egon Elbre <egonelbre@gmail.com>
@@ -529,7 +578,7 @@ Eivind Uggedal <eivind@uggedal.com>
 Elbert Fliek <efliek@gmail.com>
 Eldar Rakhimberdin <ibeono@gmail.com>
 Elena Grahovac <elena@grahovac.me>
-Elias Naur <elias.naur@gmail.com>
+Elias Naur <mail@eliasnaur.com> <elias.naur@gmail.com>
 Elliot Morrison-Reed <elliotmr@gmail.com>
 Emerson Lin <linyintor@gmail.com>
 Emil Hessman <emil@hessman.se>
@@ -547,6 +596,7 @@ Eric Koleda <ekoleda+devrel@google.com>
 Eric Lagergren <ericscottlagergren@gmail.com>
 Eric Milliken <emilliken@gmail.com>
 Eric Pauley <eric@pauley.me>
+Eric Ponce <tricokun@gmail.com>
 Eric Rescorla <ekr@rtfm.com>
 Eric Roshan-Eisner <eric.d.eisner@gmail.com>
 Eric Rykwalder <e.rykwalder@gmail.com>
@@ -555,6 +605,7 @@ Erik Dubbelboer <erik@dubbelboer.com>
 Erik St. Martin <alakriti@gmail.com>
 Erik Staab <estaab@google.com>
 Erik Westrup <erik.westrup@gmail.com>
+Erin Masatsugu <erin.masatsugu@gmail.com>
 Ernest Chiang <ernest_chiang@htc.com>
 Erwin Oegema <blablaechthema@hotmail.com>
 Esko Luontola <esko.luontola@gmail.com>
@@ -566,6 +617,7 @@ Evan Broder <evan@stripe.com>
 Evan Brown <evanbrown@google.com>
 Evan Hicks <evan.hicks2@gmail.com>
 Evan Jones <ej@evanjones.ca>
+Evan Klitzke <evan@eklitzke.org>
 Evan Kroske <evankroske@google.com>
 Evan Martin <evan.martin@gmail.com>
 Evan Phoenix <evan@phx.io>
@@ -584,6 +636,7 @@ Fannie Zhang <fannie.zhang@arm.com>
 Fatih Arslan <fatih@arslan.io>
 Fazal Majid <majid@apsalar.com>
 Fazlul Shahriar <fshahriar@gmail.com>
+Federico Bond <federicobond@gmail.com>
 Federico Simoncelli <fsimonce@redhat.com>
 Fedor Indutny <fedor@indutny.com>
 Felipe Oliveira <felipeweb.programador@gmail.com>
@@ -591,8 +644,10 @@ Felix Geisendörfer <haimuiba@gmail.com>
 Felix Kollmann <fk@konsorten.de>
 Filip Gruszczyński <gruszczy@gmail.com>
 Filip Haglund <drathier@users.noreply.github.com>
+Filip Stanis <fstanis@google.com>
 Filippo Valsorda <filippo@golang.org> <filippo@cloudflare.com> <hi@filippo.io>
 Firmansyah Adiputra <frm.adiputra@gmail.com>
+Florian Forster <octo@google.com>
 Florian Uekermann <florian@uekermann-online.de> <f1@uekermann-online.de>
 Florian Weimer <fw@deneb.enyo.de>
 Florin Patan <florinpatan@gmail.com>
@@ -610,9 +665,11 @@ Frederik Ring <frederik.ring@gmail.com>
 Fredrik Enestad <fredrik.enestad@soundtrackyourbrand.com>
 Fredrik Forsmo <fredrik.forsmo@gmail.com>
 Fredrik Wallgren <fredrik.wallgren@gmail.com>
+Frew Schmidt <github@frew.co>
 Frithjof Schulze <schulze@math.uni-hannover.de> <sfrithjof@gmail.com>
 Frits van Bommel <fvbommel@gmail.com>
 Fumitoshi Ukai <ukai@google.com>
+G. Hussain Chinoy <ghchinoy@gmail.com>
 Gaal Yahas <gaal@google.com>
 Gabríel Arthúr Pétursson <gabriel@system.is>
 Gabriel Aszalos <gabriel.aszalos@gmail.com>
@@ -627,6 +684,7 @@ Gaurish Sharma <contact@gaurishsharma.com>
 Gautham Thambidorai <gautham.dorai@gmail.com>
 Gauthier Jolly <gauthier.jolly@gmail.com>
 Geert-Johan Riemer <gjr19912@gmail.com>
+Genevieve Luyt <genevieve.luyt@gmail.com>
 Gengliang Wang <ltnwgl@gmail.com>
 Geoff Berry <gberry.qdt@qualcommdatacenter.com>
 Geoffroy Lorieux <lorieux.g@gmail.com>
@@ -634,24 +692,41 @@ Geon Kim <geon0250@gmail.com>
 Georg Reinke <guelfey@gmail.com>
 George Gkirtsou <ggirtsou@gmail.com>
 George Shammas <george@shamm.as> <georgyo@gmail.com>
+Gerasimos (Makis) Maropoulos <kataras2006@hotmail.com>
 Gerasimos Dimitriadis <gedimitr@gmail.com>
+Gergely Brautigam <skarlso777@gmail.com>
 Getulio Sánchez <valentin2507@gmail.com>
+Gianguido Sora` <g.sora4@gmail.com>
 Gideon Jan-Wessel Redelinghuys <gjredelinghuys@gmail.com>
 Giles Lean <giles.lean@pobox.com>
 Giovanni Bajo <rasky@develer.com>
 GitHub User @ajnirp (1688456) <ajnirp@users.noreply.github.com>
+GitHub User @andrius4669 (4699695) <andrius4669@gmail.com>
 GitHub User @as (8127015) <as.utf8@gmail.com>
 GitHub User @bgadrian (830001) <aditza8@gmail.com>
 GitHub User @bontequero (2674999) <bontequero@gmail.com>
 GitHub User @cch123 (384546) <buaa.cch@gmail.com>
 GitHub User @chanxuehong (3416908) <chanxuehong@gmail.com>
+GitHub User @dupoxy (1143957) <dupoxy@users.noreply.github.com>
 GitHub User @erifan (31343225) <eric.fang@arm.com>
+GitHub User @esell (9735165) <eujon.sellers@gmail.com>
+GitHub User @itchyny (375258) <itchyny@hatena.ne.jp>
+GitHub User @kc1212 (1093806) <kc1212@users.noreply.github.com>
 GitHub User @Kropekk (13366453) <kamilkropiewnicki@gmail.com>
+GitHub User @LotusFenn (13775899) <fenn.lotus@gmail.com>
 GitHub User @madiganz (18340029) <zacharywmadigan@gmail.com>
+GitHub User @mkishere (224617) <224617+mkishere@users.noreply.github.com>
+GitHub User @OlgaVlPetrova (44112727) <OVPpetrova@gmail.com>
 GitHub User @pityonline (438222) <pityonline@gmail.com>
 GitHub User @pytimer (17105586) <lixin20101023@gmail.com>
+GitHub User @saitarunreddy (21041941) <saitarunreddypalla@gmail.com>
 GitHub User @shogo-ma (9860598) <Choroma194@gmail.com>
+GitHub User @tell-k (26263) <ffk2005@gmail.com>
+GitHub User @uhei (2116845) <uhei@users.noreply.github.com>
+GitHub User @uropek (39370426) <uropek@gmail.com>
 Giulio Iotti <dullgiulio@gmail.com>
+Giulio Micheloni <giulio.micheloni@gmail.com>
+Giuseppe Valente <gvalente@arista.com>
 Gleb Stepanov <glebstepanov1992@gmail.com>
 Glenn Brown <glennb@google.com>
 Glenn Lewis <gmlewis@google.com>
@@ -660,14 +735,17 @@ Graham King <graham4king@gmail.com>
 Graham Miller <graham.miller@gmail.com>
 Grant Griffiths <ggp493@gmail.com>
 Greg Poirier <greg.istehbest@gmail.com>
+Greg Steuck <gnezdo+github@google.com>
 Greg Ward <greg@gerg.ca>
 Grégoire Delattre <gregoire.delattre@gmail.com>
 Gregory Man <man.gregory@gmail.com>
+Guilherme Caruso <gui.martinscaruso@gmail.com>
 Guilherme Garnier <guilherme.garnier@gmail.com>
 Guilherme Goncalves <guilhermeaugustosg@gmail.com>
 Guilherme Rezende <guilhermebr@gmail.com>
 Guillaume J. Charmes <guillaume@charmes.net>
 Guobiao Mei <meiguobiao@gmail.com>
+Guoliang Wang <iamwgliang@gmail.com>
 Gustav Paul <gustav.paul@gmail.com>
 Gustav Westling <gustav@westling.xyz>
 Gustavo Franco <gustavorfranco@gmail.com>
@@ -702,6 +780,7 @@ Henry Clifford <h.a.clifford@gmail.com>
 Herbert Georg Fischer <herbert.fischer@gmail.com>
 Herbie Ong <herbie@google.com>
 Heschi Kreinick <heschi@google.com>
+Hidetatsu Yaginuma <ygnmhdtt@gmail.com>
 Hilko Bengen <bengen@hilluzination.de>
 Hiroaki Nakamura <hnakamur@gmail.com>
 Hironao OTSUBO <motemen@gmail.com>
@@ -715,11 +794,16 @@ Hsin Tsao <tsao@google.com>
 Hsin-Ho Yeh <yhh92u@gmail.com>
 Hu Keping <hukeping@huawei.com>
 Hugues Bruant <hugues.bruant@gmail.com>
+Huy Le <huy.dinh.le.89@gmail.com>
 Hyang-Ah Hana Kim <hakim@google.com> <hyangah@gmail.com>
 Ian Cottrell <iancottrell@google.com>
+Ian Davis <nospam@iandavis.com>
 Ian Gudger <ian@loosescre.ws>
+Ian Haken <ihaken@netflix.com>
 Ian Kent <iankent85@gmail.com>
 Ian Lance Taylor <iant@golang.org>
+Ian Leue <ian@appboy.com>
+Ian Zapolsky <ianzapolsky@gmail.com>
 Ibrahim AshShohail <ibra.sho@gmail.com>
 Icarus Sparry <golang@icarus.freeuk.com>
 Iccha Sethi <icchasethi@gmail.com>
@@ -727,6 +811,7 @@ Idora Shinatose <idora.shinatose@gmail.com>
 Igor Bernstein <igorbernstein@google.com>
 Igor Dolzhikov <bluesriverz@gmail.com>
 Igor Vashyst <ivashyst@gmail.com>
+Igor Zhilianin <igor.zhilianin@gmail.com>
 Ilya Tocar <ilya.tocar@intel.com>
 INADA Naoki <songofacandy@gmail.com>
 Inanc Gumus <m@inanc.io>
@@ -743,9 +828,12 @@ Issac Trotts <issactrotts@google.com>
 Ivan Babrou <ivan@cloudflare.com>
 Ivan Bertona <ivan.bertona@gmail.com>
 Ivan Krasin <krasin@golang.org>
+Ivan Kutuzov <arbrix@gmail.com>
 Ivan Markin <sw@nogoegst.net>
 Ivan Moscoso <moscoso@gmail.com>
+Ivan Sharavuev <shpiwan@gmail.com>
 Ivan Ukhov <ivan.ukhov@gmail.com>
+Ivy Evans <ivy@ivyevans.net>
 Jaana Burcu Dogan <jbd@google.com> <jbd@golang.org> <burcujdogan@gmail.com>
 Jack Britton <jackxbritton@gmail.com>
 Jack Lindamood <jlindamo@justin.tv>
@@ -753,6 +841,7 @@ Jacob Baskin <jbaskin@google.com>
 Jacob H. Haven <jacob@cloudflare.com>
 Jacob Hoffman-Andrews <github@hoffman-andrews.com>
 Jae Kwon <jae@tendermint.com>
+Jake B <doogie1012@gmail.com>
 Jakob Borg <jakob@nym.se>
 Jakob Weisblat <jakobw@mit.edu>
 Jakub Čajka <jcajka@redhat.com>
@@ -762,6 +851,7 @@ James Bardin <j.bardin@gmail.com>
 James Chacon <jchacon@google.com>
 James Clarke <jrtc27@jrtc27.com>
 James Cowgill <James.Cowgill@imgtec.com>
+James Craig Burley <james-github@burleyarch.com>
 James David Chalfant <james.chalfant@gmail.com>
 James Fysh <james.fysh@gmail.com>
 James Gray <james@james4k.com>
@@ -804,12 +894,15 @@ Jason Buberel <jbuberel@google.com>
 Jason Chu <jasonchujc@gmail.com>
 Jason Del Ponte <delpontej@gmail.com>
 Jason Hall <jasonhall@google.com>
+Jason Keene <jasonkeene@gmail.com>
+Jason LeBrun <jblebrun@gmail.com>
 Jason Smale <jsmale@zendesk.com>
 Jason Travis <infomaniac7@gmail.com>
 Jason Wangsadinata <jwangsadinata@gmail.com>
 Javier Kohen <jkohen@google.com>
 Javier Segura <javism@gmail.com>
 Jay Conrod <jayconrod@google.com>
+Jay Taylor <outtatime@gmail.com>
 Jay Weisskopf <jay@jayschwa.net>
 Jean de Klerk <deklerk@google.com>
 Jean-André Santoni <jean.andre.santoni@gmail.com>
@@ -831,6 +924,8 @@ Jeffrey H <jeffreyh192@gmail.com>
 Jelte Fennema <github-tech@jeltef.nl>
 Jens Frederich <jfrederich@gmail.com>
 Jeremiah Harmsen <jeremiah@google.com>
+Jeremy Banks <_@jeremy.ca>
+Jeremy Canady <jcanady@gmail.com>
 Jeremy Jackins <jeremyjackins@gmail.com>
 Jeremy Schlatter <jeremy.schlatter@gmail.com>
 Jeroen Bobbeldijk <jerbob92@gmail.com>
@@ -854,6 +949,7 @@ Jiong Du <londevil@gmail.com>
 Jirka Daněk <dnk@mail.muni.cz>
 Jiulong Wang <jiulongw@gmail.com>
 Joakim Sernbrant <serbaut@gmail.com>
+Joe Bowbeer <joe.bowbeer@gmail.com>
 Joe Cortopassi <joe@joecortopassi.com>
 Joe Farrell <joe2farrell@gmail.com>
 Joe Harrison <joehazzers@gmail.com>
@@ -877,6 +973,7 @@ John C Barstow <jbowtie@amathaine.com>
 John DeNero <denero@google.com>
 John Dethridge <jcd@golang.org>
 John Gibb <johngibb@gmail.com>
+John Gilik <john@jgilik.com>
 John Graham-Cumming <jgc@jgc.org> <jgrahamc@gmail.com>
 John Howard Palevich <jack.palevich@gmail.com>
 John Jeffery <jjeffery@sp.com.au>
@@ -910,6 +1007,7 @@ Joonas Kuorilehto <joneskoo@derbian.fi>
 Joop Kiefte <ikojba@gmail.com> <joop@kiefte.net>
 Jordan Krage <jmank88@gmail.com>
 Jordan Lewis <jordanthelewis@gmail.com>
+Jordan Rhee <jordanrh@microsoft.com>
 Jos Visser <josv@google.com>
 Jose Luis Vázquez González <josvazg@gmail.com>
 Joseph Bonneau <jcb@google.com>
@@ -930,12 +1028,15 @@ Jostein Stuhaug <js@solidsystem.no>
 JP Sugarbroad <jpsugar@google.com>
 JT Olds <jtolds@xnet5.com>
 Juan Carlos <juanjcsr@gmail.com>
+Juan Pablo Civile <elementohb@gmail.com>
 Jude Pereira <judebpereira@gmail.com>
 Jukka-Pekka Kekkonen <karatepekka@gmail.com>
 Julia Hansbrough <flowerhack@google.com>
 Julian Kornberger <jk+github@digineo.de>
 Julian Pastarmov <pastarmovj@google.com>
 Julian Phillips <julian@quantumfyre.co.uk>
+Julie Qiu <julie@golang.org>
+Julien Kauffmann <julien.kauffmann@freelan.org>
 Julien Salleyron <julien.salleyron@gmail.com>
 Julien Schmidt <google@julienschmidt.com>
 Julio Montes <julio.montes@intel.com>
@@ -961,10 +1062,12 @@ Karoly Negyesi <chx1975@gmail.com>
 Karsten Köhler <karsten.koehler95@gmail.com>
 Kashav Madan <kshvmdn@gmail.com>
 Kate Manson <kate.manson@izettle.com>
+Katie Hockman <katie@golang.org>
 Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
 Katrina Owen <katrina.owen@gmail.com>
 Kaviraj Kanagaraj <kavirajkanagaraj@gmail.com>
 Kay Zhu <kayzhu@google.com>
+Kazuhiro Sera <seratch@gmail.com>
 KB Sriram <kbsriram@google.com>
 Keegan Carruthers-Smith <keegan.csmith@gmail.com>
 Kei Son <hey.calmdown@gmail.com>
@@ -989,6 +1092,7 @@ Kevin Klues <klueska@gmail.com> <klueska@google.com>
 Kevin Malachowski <chowski@google.com>
 Kevin Ruffin <kruffin@gmail.com>
 Kevin Vu <kevin.m.vu@gmail.com>
+Kevin Zita <bleedgreenandgold@gmail.com>
 Kieran Colford <kieran@kcolford.com>
 Kim Shrier <kshrier@racktopsystems.com>
 Kim Yongbin <kybinz@gmail.com>
@@ -1000,6 +1104,7 @@ Klaus Post <klauspost@gmail.com>
 Kodie Goodwin <kodiegoodwin@gmail.com>
 Koichi Shiraishi <zchee.io@gmail.com>
 Koki Ide <niconegoto@yahoo.co.jp>
+Komu Wairagu <komuw05@gmail.com>
 Konstantin <konstantin8105@gmail.com>
 Konstantin Shaposhnikov <k.shaposhnikov@gmail.com>
 Kris Kwiatkowski <kris@cloudflare.com>
@@ -1015,13 +1120,16 @@ Kyle Jones <kyle@kyledj.com>
 Kyle Lemons <kyle@kylelemons.net> <kevlar@google.com>
 Kyle Shannon <kyle@pobox.com>
 Kyle Spiers <eiais@google.com>
+Kyle Wood <kyle@kylewood.cc>
 Kyohei Kadota <lufia@lufia.org>
 Kyrylo Silin <silin@kyrylo.org>
 L Campbell <unpantsu@gmail.com>
 Lai Jiangshan <eag0628@gmail.com>
+Lajos Papp <lalyos@yahoo.com>
 Lakshay Garg <lakshay.garg.1996@gmail.com>
 Lann Martin <lannm@google.com>
 Lanre Adelowo <yo@lanre.wtf>
+Larry Clapp <larry@theclapp.org>
 Larry Hosken <lahosken@golang.org>
 Lars Jeppesen <jeppesen.lars@gmail.com>
 Lars Lehtonen <lars.lehtonen@gmail.com>
@@ -1066,9 +1174,11 @@ Luuk van Dijk <lvd@golang.org> <lvd@google.com>
 Lyle Franklin <lylejfranklin@gmail.com>
 Lynn Boger <laboger@linux.vnet.ibm.com>
 Ma Peiqi <mapeiqi2017@gmail.com>
+Maarten Bezemer <maarten.bezemer@gmail.com>
 Maciej Dębski <maciejd@google.com>
 Magnus Hiie <magnus.hiie@gmail.com>
 Maicon Costa <maiconscosta@gmail.com>
+Mak Kolybabi <mak@kolybabi.com>
 Maksym Trykur <maksym.trykur@gmail.com>
 Mal Curtis <mal@mal.co.nz>
 Manfred Touron <m@42.am>
@@ -1086,6 +1196,7 @@ Marcel van Lohuizen <mpvl@golang.org>
 Marcelo Cantos <marcelo.cantos@gmail.com>
 Marcelo E. Magallon <marcelo.magallon@gmail.com>
 Marco Hennings <marco.hennings@freiheit.com>
+Marcus Willock <crazcalm@gmail.com>
 Marga Manterola <marga@google.com>
 Marin Bašić <marin.basic02@gmail.com>
 Mario Arranz <marioarranzr@gmail.com>
@@ -1102,12 +1213,14 @@ Mark Theunissen <mark.theunissen@gmail.com>
 Mark Wolfe <mark@wolfe.id.au>
 Mark Zavislak <zavislak@google.com>
 Marko Juhani Silokunnas <marko.silokunnas@gmail.com>
+Marko Kevac <marko@kevac.org>
 Marko Mikulicic <mkm@google.com>
 Marko Mudrinic <mudrinic.mare@gmail.com>
 Marko Tiikkaja <marko@joh.to>
 Markus Duft <markus.duft@salomon.at>
 Markus Sonderegger <marraison@gmail.com>
 Markus Zimmermann <zimmski@gmail.com>
+Marten Seemann <martenseemann@gmail.com>
 Martin Bertschler <mbertschler@gmail.com>
 Martin Garton <garton@gmail.com>
 Martin Habbecke <marhab@google.com>
@@ -1122,6 +1235,7 @@ Martin Olsen <github.com@martinolsen.net>
 Martin Olsson <martin@minimum.se>
 Martin Probst <martin@probst.io>
 Martin Sucha <anty.sk+git@gmail.com>
+Martin Tournoij <martin@arp242.net>
 Martins Sipenko <martins.sipenko@gmail.com>
 Martynas Budriūnas <mabu@google.com>
 Marvin Stenger <marvin.stenger94@gmail.com>
@@ -1165,31 +1279,37 @@ Matthew Dempsky <mdempsky@google.com>
 Matthew Denton <mdenton@skyportsystems.com>
 Matthew Holt <Matthew.Holt+git@gmail.com>
 Matthew Horsnell <matthew.horsnell@gmail.com>
+Matthew Waters <mwwaters@gmail.com>
 Matthieu Hauglustaine <matt.hauglustaine@gmail.com>
 Matthieu Olivier <olivier.matthieu@gmail.com>
 Matthijs Kooijman <matthijs@stdin.nl>
 Max Riveiro <kavu13@gmail.com>
 Max Schmitt <max@schmitt.mx>
+Max Ushakov <ushmax@gmail.com>
 Maxim Khitrov <max@mxcrypt.com>
 Maxim Pimenov <mpimenov@google.com>
 Maxim Ushakov <ushakov@google.com>
 Maxime de Roucy <maxime.deroucy@gmail.com>
 Máximo Cuadros Ortiz <mcuadros@gmail.com>
 Maxwell Krohn <themax@gmail.com>
+Maya Rashish <maya@NetBSD.org>
 Mayank Kumar <krmayankk@gmail.com>
 Meir Fischer <meirfischer@gmail.com>
 Meng Zhuo <mengzhuo1203@gmail.com>
 Mhd Sulhan <m.shulhan@gmail.com>
 Micah Stetson <micah.stetson@gmail.com>
+Michael Anthony Knyszek <mknyszek@google.com>
 Michael Brandenburg <mbrandenburg@bolste.com>
 Michael Chaten <mchaten@gmail.com>
 Michael Darakananda <pongad@google.com>
 Michael Dorner <mail@michaeldorner.de>
 Michael Edwards <medwards@walledcity.ca>
 Michael Elkins <michael.elkins@gmail.com>
+Michael Ellis <micellis@justin.tv>
 Michael Fraenkel <michael.fraenkel@gmail.com>
 Michael Fromberger <michael.j.fromberger@gmail.com>
 Michael Gehring <mg@ebfe.org> <gnirheg.leahcim@gmail.com>
+Michael Henderson <mdhender@users.noreply.github.com>
 Michael Hendricks <michael@ndrix.org>
 Michael Hoisie <hoisie@gmail.com>
 Michael Hudson-Doyle <michael.hudson@linaro.org>
@@ -1214,18 +1334,21 @@ Michael Stapelberg <michael@stapelberg.de> <mstplbrg@googlemail.com>
 Michael Steinert <mike.steinert@gmail.com>
 Michael T. Jones <mtj@google.com> <michael.jones@gmail.com>
 Michael Teichgräber <mteichgraeber@gmx.de> <mt4swm@googlemail.com>
+Michael Traver <mtraver@google.com>
 Michael Vetter <g.bluehut@gmail.com>
 Michal Bohuslávek <mbohuslavek@gmail.com>
 Michal Cierniak <cierniak@google.com>
 Michał Derkacz <ziutek@lnet.pl>
 Michal Franc <lam.michal.franc@gmail.com>
 Michal Pristas <michal.pristas@gmail.com>
+Michal Rostecki <mrostecki@suse.de>
 Michalis Kargakis <michaliskargakis@gmail.com>
 Michel Lespinasse <walken@google.com>
 Miek Gieben <miek@miek.nl> <remigius.gieben@gmail.com>
 Miguel Mendez <stxmendez@gmail.com>
 Miguel Molina <hi@mvader.me>
 Mihai Borobocea <MihaiBorobocea@gmail.com>
+Mihai Todor <todormihai@gmail.com>
 Mihail Minaev <minaev.mike@gmail.com>
 Mikael Tillenius <mikti42@gmail.com>
 Mike Andrews <mra@xoba.com>
@@ -1244,6 +1367,7 @@ Mikhail Panchenko <m@mihasya.com>
 Miki Tebeka <miki.tebeka@gmail.com>
 Mikio Hara <mikioh.mikioh@gmail.com>
 Mikkel Krautz <mikkel@krautz.dk> <krautz@gmail.com>
+Mikołaj Baranowski <mikolajb@gmail.com>
 Milan Knezevic <milan.knezevic@mips.com>
 Milutin Jovanović <jovanovic.milutin@gmail.com>
 MinJae Kwon <mingrammer@gmail.com>
@@ -1286,6 +1410,7 @@ Niall Sheridan <nsheridan@gmail.com>
 Nic Day <nic.day@me.com>
 Nicholas Katsaros <nick@nickkatsaros.com>
 Nicholas Maniscalco <nicholas@maniscalco.com>
+Nicholas Ng <nickng@nickng.io>
 Nicholas Presta <nick@nickpresta.ca> <nick1presta@gmail.com>
 Nicholas Sullivan <nicholas.sullivan@gmail.com>
 Nicholas Waples <nwaples@gmail.com>
@@ -1326,12 +1451,15 @@ Oleg Vakheta <helginet@gmail.com>
 Oleku Konko <oleku.konko@gmail.com>
 Oling Cat <olingcat@gmail.com>
 Oliver Hookins <ohookins@gmail.com>
+Oliver Stenbom <ostenbom@pivotal.io>
 Oliver Tonnhofer <olt@bogosoft.com>
 Olivier Antoine <olivier.antoine@gmail.com>
 Olivier Duperray <duperray.olivier@gmail.com>
 Olivier Poitrey <rs@dailymotion.com>
 Olivier Saingre <osaingre@gmail.com>
 Omar Jarjur <ojarjur@google.com>
+Oryan Moshe <iamoryanmoshe@gmail.com>
+Osamu TONOMORI <osamingo@gmail.com>
 Özgür Kesim <oec-go@kesim.org>
 Pablo Lalloni <plalloni@gmail.com>
 Pablo Rozas Larraondo <pablo.larraondo@anu.edu.au>
@@ -1341,6 +1469,7 @@ Pallat Anchaleechamaikorn <yod.pallat@gmail.com>
 Paolo Giarrusso <p.giarrusso@gmail.com>
 Paolo Martini <mrtnpaolo@gmail.com>
 Parker Moore <parkrmoore@gmail.com>
+Parminder Singh <parmsingh101@gmail.com>
 Pascal S. de Kloe <pascal@quies.net>
 Pat Moroney <pat@pat.email>
 Patrick Crosby <patrick@stathat.com>
@@ -1360,6 +1489,7 @@ Paul Hammond <paul@paulhammond.org>
 Paul Hankin <paulhankin@google.com>
 Paul Jolly <paul@myitcv.org.uk>
 Paul Lalonde <paul.a.lalonde@gmail.com>
+Paul M Furley <paul@paulfurley.com>
 Paul Marks <pmarks@google.com>
 Paul Meyer <paul.meyer@microsoft.com>
 Paul Nasrat <pnasrat@google.com>
@@ -1386,8 +1516,10 @@ Peter Armitage <peter.armitage@gmail.com>
 Peter Bourgon <peter@bourgon.org>
 Peter Collingbourne <pcc@google.com>
 Peter Conerly <pconerly@gmail.com>
+Peter Dotchev <dotchev@gmail.com>
 Peter Froehlich <peter.hans.froehlich@gmail.com>
 Peter Gonda <pgonda@google.com>
+Peter Hoyes <pahoyes@gmail.com>
 Peter Kleiweg <pkleiweg@xs4all.nl>
 Peter McKenzie <petermck@google.com>
 Peter Moody <pmoody@uber.com>
@@ -1421,11 +1553,13 @@ Piers <google@hellopiers.pro>
 Pieter Droogendijk <pieter@binky.org.uk>
 Pietro Gagliardi <pietro10@mac.com>
 Piyush Mishra <piyush@codeitout.com>
+Plekhanov Maxim <kishtatix@gmail.com>
 Pontus Leitzler <leitzler@gmail.com>
 Prasanna Swaminathan <prasanna@mediamath.com>
 Prashant Varanasi <prashant@prashantv.com>
 Pravendra Singh <hackpravj@gmail.com>
 Preetam Jinka <pj@preet.am>
+Qais Patankar <qaisjp@gmail.com>
 Qiuxuan Zhu <ilsh1022@gmail.com>
 Quan Tran <qeed.quan@gmail.com>
 Quan Yong Zhai <qyzhai@gmail.com>
@@ -1433,10 +1567,12 @@ Quentin Perez <qperez@ocs.online.net>
 Quentin Renard <contact@asticode.com>
 Quentin Smith <quentin@golang.org>
 Quinn Slack <sqs@sourcegraph.com>
+Quinten Yearsley <qyearsley@chromium.org>
 Quoc-Viet Nguyen <afelion@gmail.com>
 Radek Sohlich <sohlich@gmail.com>
 Radu Berinde <radu@cockroachlabs.com>
 Rafal Jeczalik <rjeczalik@gmail.com>
+Raghavendra Nagaraj <jamdagni86@gmail.com>
 Rahul Chaudhry <rahulchaudhry@chromium.org>
 Raif S. Naffah <go@naffah-raif.name>
 Rajat Goel <rajat.goel2010@gmail.com>
@@ -1470,6 +1606,7 @@ Richard Musiol <mail@richard-musiol.de> <neelance@gmail.com>
 Rick Arnold <rickarnoldjr@gmail.com>
 Rick Hudson <rlh@golang.org>
 Rick Sayre <whorfin@gmail.com>
+Rijnard van Tonder <rvantonder@gmail.com>
 Riku Voipio <riku.voipio@linaro.org>
 Risto Jaakko Saarelma <rsaarelm@gmail.com>
 Rob Earhart <earhart@google.com>
@@ -1488,22 +1625,28 @@ Robert Snedegar <roberts@google.com>
 Robert Stepanek <robert.stepanek@gmail.com>
 Robert-André Mauchin <zebob.m@gmail.com>
 Roberto Clapis <robclap8@gmail.com>
+Roberto Selbach <roberto@selbach.ca>
 Robin Eklind <r.eklind.87@gmail.com>
 Rodolfo Carvalho <rhcarvalho@gmail.com>
+Rodolfo Rodriguez <rodolfobgibson@gmail.com>
 Rodrigo Moraes de Oliveira <rodrigo.moraes@gmail.com>
 Rodrigo Rafael Monti Kochenburger <divoxx@gmail.com>
 Roger Pau Monné <royger@gmail.com>
 Roger Peppe <rogpeppe@gmail.com>
+Roland Illig <roland.illig@gmx.de>
 Roland Shoemaker <rolandshoemaker@gmail.com>
 Roman Budnikov <romanyx90@yandex.ru>
+Roman Shchekin <mrqtros@gmail.com>
 Ron Hashimoto <mail@h2so5.net>
 Ron Minnich <rminnich@gmail.com>
 Ross Chater <rdchater@gmail.com>
 Ross Light <light@google.com> <rlight2@gmail.com>
+Ross Smith II <ross@smithii.com>
 Rowan Marshall <rowanajmarshall@gmail.com>
 Rowan Worth <sqweek@gmail.com>
 Rudi Kramer <rudi.kramer@gmail.com>
 Rui Ueyama <ruiu@google.com>
+Ruslan Nigmatullin <elessar@dropbox.com>
 Russ Cox <rsc@golang.org>
 Russell Haering <russellhaering@gmail.com>
 Ryan Bagwell <ryanbagwell@outlook.com>
@@ -1511,6 +1654,7 @@ Ryan Barrett <ryanb@google.com>
 Ryan Boehning <ryan.boehning@apcera.com>
 Ryan Brown <ribrdb@google.com>
 Ryan Canty <jrcanty@gmail.com>
+Ryan Dahl <ry@tinyclouds.org>
 Ryan Hitchman <hitchmanr@gmail.com>
 Ryan Lower <rpjlower@gmail.com>
 Ryan Roden-Corrent <ryan@rcorre.net>
@@ -1534,9 +1678,11 @@ Sam Whited <sam@samwhited.com>
 Sameer Ajmani <sameer@golang.org> <ajmani@gmail.com>
 Sami Commerot <samic@google.com>
 Sami Pönkänen <sami.ponkanen@gmail.com>
+Samuel Kelemen <SCKelemen@users.noreply.github.com>
 Samuel Tan <samueltan@google.com>
 Samuele Pedroni <pedronis@lucediurna.net>
 Sanjay Menakuru <balasanjay@gmail.com>
+Santhosh Kumar Tekuri <santhosh.tekuri@gmail.com>
 Sarah Adams <shadams@google.com>
 Sascha Brawer <sascha@brawer.ch>
 Sasha Lionheart <lionhearts@google.com>
@@ -1550,13 +1696,17 @@ Scott Mansfield <smansfield@netflix.com>
 Scott Schwartz <scotts@golang.org>
 Scott Van Woudenberg <scottvw@google.com>
 Sean Burford <sburford@google.com>
+Sean Chen <oohcode@gmail.com>
 Sean Chittenden <seanc@joyent.com>
 Sean Christopherson <sean.j.christopherson@intel.com>
 Sean Dolphin <Sean.Dolphin@kpcompass.com>
 Sean Harger <sharger@google.com>
 Sean Rees <sean@erifax.org>
+Sebastiaan van Stijn <github@gone.nl>
+Sebastian Schmidt <yath@google.com>
 Sebastien Binet <seb.binet@gmail.com>
 Sébastien Paolacci <sebastien.paolacci@gmail.com>
+Sebastien Williams-Wynn <sebastien@cytora.com>
 Seiji Takahashi <timaki.st@gmail.com>
 Sergei Skorobogatov <skorobo@rambler.ru>
 Sergey 'SnakE' Gromov <snake.scaly@gmail.com>
@@ -1568,6 +1718,7 @@ Sergey Mudrik <sergey.mudrik@gmail.com>
 Sergey Semin <gray12511@gmail.com>
 Sergio Luis O. B. Correia <sergio@correia.cc>
 Sergiusz Bazanski <bazanski@gmail.com>
+Serhii Aheienko <serhii.aheienko@gmail.com>
 Seth Hoenig <seth.a.hoenig@gmail.com>
 Seth Vargo <sethvargo@gmail.com>
 Shahar Kohanim <skohanim@gmail.com>
@@ -1581,9 +1732,11 @@ Shawn Walker-Salas <shawn.walker@oracle.com>
 Shenghou Ma <minux@golang.org> <minux.ma@gmail.com>
 Shengyu Zhang <shengyu.zhang@chaitin.com>
 Shi Han Ng <shihanng@gmail.com>
+Shijie Hao <haormj@gmail.com>
 Shinji Tanaka <shinji.tanaka@gmail.com>
 Shintaro Kaneko <kaneshin0120@gmail.com>
 Shivakumar GN <shivakumar.gn@gmail.com>
+Shivansh Rai <shivansh@freebsd.org>
 Shun Fan <sfan@google.com>
 Silvan Jegen <s.jegen@gmail.com>
 Simon Jefford <simon.jefford@gmail.com>
@@ -1603,6 +1756,7 @@ Stan Schwertly <stan@schwertly.com>
 Stanislav Afanasev <php.progger@gmail.com>
 Steeve Morin <steeve.morin@gmail.com>
 Stefan Nilsson <snilsson@nada.kth.se> <trolleriprofessorn@gmail.com>
+Stepan Shabalin <neverliberty@gmail.com>
 Stephan Renatus <srenatus@chef.io>
 Stéphane Travostino <stephane.travostino@gmail.com>
 Stephen Lewis <stephen@sock.org.uk>
@@ -1613,6 +1767,7 @@ Stephen Searles <stephens2424@gmail.com>
 Stephen Weinberg <stephen@q5comm.com>
 Steve Francia <spf@golang.org>
 Steve Gilbert <stevegilbert23@gmail.com>
+Steve LoFurno <slofurno@gmail.com>
 Steve McCoy <mccoyst@gmail.com>
 Steve Newman <snewman@google.com>
 Steve Phillips <elimisteve@gmail.com>
@@ -1621,7 +1776,10 @@ Steven Buss <sbuss@google.com>
 Steven Elliot Harris <seharris@gmail.com>
 Steven Erenst <stevenerenst@gmail.com>
 Steven Hartland <steven.hartland@multiplay.co.uk>
+Steven Littiebrant <imgroxx@gmail.com>
 Steven Wilkin <stevenwilkin@gmail.com>
+Stuart Jansen <sjansen@buscaluz.org>
+Sue Spence <virtuallysue@gmail.com>
 Sugu Sougoumarane <ssougou@gmail.com>
 Suharsh Sivakumar <suharshs@google.com>
 Sukrit Handa <sukrit.handa@utoronto.ca>
@@ -1634,8 +1792,11 @@ Sven Blumenstein <svbl@google.com>
 Sylvain Zimmer <sylvain@sylvainzimmer.com>
 Syohei YOSHIDA <syohex@gmail.com>
 Szabolcs Nagy <nsz@port70.net>
+Taavi Kivisik <taavi.kivisik@gmail.com>
 Tad Fisher <tadfisher@gmail.com>
 Tad Glines <tad.glines@gmail.com>
+Tadas Valiukas <tadovas@gmail.com>
+Taesu Pyo <pyotaesu@gmail.com>
 Taj Khattra <taj.khattra@gmail.com>
 Takashi Matsuo <tmatsuo@google.com>
 Takayoshi Nishida <takayoshi.nishida@gmail.com>
@@ -1644,11 +1805,14 @@ Takuto Ikuta <tikuta@google.com>
 Takuya Ueda <uedatakuya@gmail.com>
 Tal Shprecher <tshprecher@gmail.com>
 Tamir Duberstein <tamird@gmail.com>
+Tao Shen <shentaoskyking@gmail.com>
 Tao Wang <twang2218@gmail.com>
 Tarmigan Casebolt <tarmigan@gmail.com>
 Taro Aoki <aizu.s1230022@gmail.com>
 Taru Karttunen <taruti@taruti.net>
 Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>
+Tatsuya Kaneko <m.ddotx.f@gmail.com>
+Taufiq Rahman <taufiqrx8@gmail.com>
 Teague Cole <tnc1443@gmail.com>
 Ted Kornish <golang@tedkornish.com>
 Tejasvi Nareddy <tejunareddy@gmail.com>
@@ -1664,6 +1828,7 @@ Thomas Alan Copeland <talan.copeland@gmail.com>
 Thomas Bonfort <thomas.bonfort@gmail.com>
 Thomas Bouldin <inlined@google.com>
 Thomas Bruyelle <thomas.bruyelle@gmail.com>
+Thomas Bushnell, BSG <tbushnell@google.com>
 Thomas de Zeeuw <thomasdezeeuw@gmail.com>
 Thomas Desrosiers <thomasdesr@gmail.com>
 Thomas Habets <habets@google.com>
@@ -1682,6 +1847,7 @@ Tim Henderson <tim.tadh@gmail.com>
 Tim Hockin <thockin@google.com>
 Tim Swast <swast@google.com>
 Tim Wright <tenortim@gmail.com>
+Tim Xu <xiaoxubeii@gmail.com>
 Timo Savola <timo.savola@gmail.com>
 Timo Truyts <alkaloid.btx@gmail.com>
 Timothy Studd <tim@timstudd.com>
@@ -1705,6 +1871,7 @@ Tom Wilkie <tom@weave.works>
 Tommy Schaefer <tommy.schaefer@teecom.com>
 Tomoya Ishizaki <zaq1tomo@gmail.com>
 Tonis Tiigi <tonistiigi@gmail.com>
+Tony Reix <tony.reix@bull.net>
 Tony Walker <walkert.uk@gmail.com>
 Tor Andersson <tor.andersson@gmail.com>
 Tormod Erevik Lea <tormodlea@gmail.com>
@@ -1732,7 +1899,9 @@ Tzu-Jung Lee <roylee17@currant.com>
 Ugorji Nwoke <ugorji@gmail.com>
 Ulf Holm Nielsen <doktor@dyregod.dk>
 Ulrich Kunitz <uli.kunitz@gmail.com>
+Umang Parmar <umangjparmar@gmail.com>
 Uriel Mangado <uriel@berlinblue.org>
+Urvil Patel <patelurvil38@gmail.com>
 Uttam C Pawar <uttam.c.pawar@intel.com>
 Vadim Grek <vadimprog@gmail.com>
 Vadim Vygonets <unixdj@gmail.com>
@@ -1740,6 +1909,7 @@ Val Polouchkine <vpolouch@justin.tv>
 Vega Garcia Luis Alfonso <vegacom@gmail.com>
 Venil Noronha <veniln@vmware.com>
 Veselkov Konstantin <kostozyb@gmail.com>
+Viacheslav Poturaev <vearutop@gmail.com>
 Victor Chudnovsky <vchudnov@google.com>
 Victor Vrantchan <vrancean+github@gmail.com>
 Vignesh Ramachandra <vickyramachandra@gmail.com>
@@ -1750,8 +1920,10 @@ Vincent Vanackere <vincent.vanackere@gmail.com>
 Vinu Rajashekhar <vinutheraj@gmail.com>
 Vish Subramanian <vish@google.com>
 Vishvananda Ishaya <vishvananda@gmail.com>
+Visweswara R <r.visweswara@gmail.com>
 Vitor De Mario <vitordemario@gmail.com>
 Vlad Krasnov <vlad@cloudflare.com>
+Vladimir Kovpak <cn007b@gmail.com>
 Vladimir Kuzmin <vkuzmin@uber.com>
 Vladimir Mihailenco <vladimir.webdev@gmail.com>
 Vladimir Nikishenko <vova616@gmail.com>
@@ -1763,17 +1935,22 @@ W. Trevor King <wking@tremily.us>
 Wade Simmons <wade@wades.im>
 Walter Poupore <wpoupore@google.com>
 Wander Lairson Costa <wcosta@mozilla.com>
+Warren Fernandes <warren.f.fernandes@gmail.com>
 Wayne Ashley Berry <wayneashleyberry@gmail.com>
 Wedson Almeida Filho <wedsonaf@google.com>
+Weerasak Chongnguluam <singpor@gmail.com>
 Wèi Cōngruì <crvv.mail@gmail.com>
 Wei Fu <fhfuwei@163.com>
 Wei Guangjing <vcc.163@gmail.com>
 Wei Xiao <wei.xiao@arm.com>
 Weichao Tang <tevic.tt@gmail.com>
 Wembley G. Leach, Jr <wembley.gl@gmail.com>
+Wil Selwood <wselwood@gmail.com>
 Wilfried Teiken <wteiken@google.com>
+Will Beason <willbeason@gmail.com>
 Will Chan <willchan@google.com>
 Will Faught <will.faught@gmail.com>
+Will Morrow <wmorrow.qdt@qualcommdatacenter.com>
 Will Norris <willnorris@google.com>
 Will Storey <will@summercat.com>
 Willem van der Schyff <willemvds@gmail.com>
@@ -1806,6 +1983,7 @@ Yestin Sun <ylh@pdx.edu>
 Yesudeep Mangalapilly <yesudeep@google.com>
 Yissakhar Z. Beck <yissakhar.beck@gmail.com>
 Yo-An Lin <yoanlin93@gmail.com>
+Yohei Takeda <yo.tak0812@gmail.com>
 Yongjian Xu <i3dmaster@gmail.com>
 Yorman Arias <cixtords@gmail.com>
 Yoshiyuki Kanno <nekotaroh@gmail.com> <yoshiyuki.kanno@stoic.co.jp>
@@ -1814,6 +1992,7 @@ Yosuke Akatsuka <yosuke.akatsuka@gmail.com>
 Yu Heng Zhang <annita.zhang@cn.ibm.com>
 Yu Xuan Zhang <zyxsh@cn.ibm.com>
 Yuji Yaginuma <yuuji.yaginuma@gmail.com>
+Yuki OKUSHI <huyuumi.dev@gmail.com>
 Yuki Yugui Sonoda <yugui@google.com>
 Yukihiro Nishinaka <6elpinal@gmail.com>
 Yury Smolsky <yury@smolsky.by>
@@ -1824,12 +2003,14 @@ Yves Junqueira <yvesj@google.com> <yves.junqueira@gmail.com>
 Zac Bergquist <zbergquist99@gmail.com>
 Zach Bintliff <zbintliff@gmail.com>
 Zach Gershman <zachgersh@gmail.com>
+Zachary Amsden <zach@thundertoken.com>
 Zachary Gershman <zgershman@pivotal.io>
 Zak <zrjknill@gmail.com>
 Zakatell Kanda <hi@zkanda.io>
 Zellyn Hunter <zellyn@squareup.com> <zellyn@gmail.com>
 Zev Goldstein <zev.goldstein@gmail.com>
 Zheng Dayu <davidzheng23@gmail.com>
+Zheng Xu <zheng.xu@arm.com>
 Zhengyu He <hzy@google.com>
 Zhongpeng Lin <zplin@uber.com>
 Zhongtao Chen <chenzhongtao@126.com>
index a911783c6bab0586784c3ebfb4e674cc1873b403..637be18135917cd65d85ea2082032027f44f650e 100644 (file)
@@ -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
new file mode 100644 (file)
index 0000000..7d525cb
--- /dev/null
@@ -0,0 +1,228 @@
+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 (*File) SyscallConn() (syscall.RawConn, 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_ext int32
+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_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_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_ext int32
+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_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_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, Blksize int32
+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, 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, Blksize int32
+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, 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, Blksize int32
+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, 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, Blksize int32
+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, 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
index abc59373a0a51a1dbace18975b0dcd8f601cc0b0..4f59a8fc89afd4af4ae91997113dd5de3fbe4fac 100644 (file)
@@ -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);
 };
 
index 53088c99c63a3f21421e78a69fe21e10d4f748ca..68b2387d35f8686b974ea00ecb4eab83a31ec874 100644 (file)
@@ -922,13 +922,13 @@ New files that you contribute should use the standard copyright header:
 </p>
 
 <pre>
-// 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.
 </pre>
 
 <p>
-(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.
 </p>
index b02efed5010ec2ed98069b7ffc25a2d210e1c9b8..73f7a0e30471024ef32c15a30320189dbde5fb16 100644 (file)
@@ -49,6 +49,23 @@ See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.2">Go
 1.11.2 milestone</a> on our issue tracker for details.
 </p>
 
+<p>
+go1.11.3 (released 2018/12/12) includes three security fixes to "go get" and
+the <code>crypto/x509</code> package.
+See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.3">Go
+1.11.3 milestone</a> on our issue tracker for details.
+</p>
+
+<p>
+go1.11.4 (released 2018/12/14) includes fixes to cgo, the compiler, linker,
+runtime, documentation, go command, and the <code>net/http</code> and
+<code>go/types</code> packages.
+It includes a fix to a bug introduced in Go 1.11.3 that broke <code>go</code>
+<code>get</code> for import path patterns containing "<code>...</code>".
+See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.11.4+label%3ACherryPickApproved">Go
+1.11.4 milestone</a> on our issue tracker for details.
+</p>
+
 <h2 id="go1.10">go1.10 (released 2018/02/16)</h2>
 
 <p>
@@ -98,6 +115,22 @@ See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.5">Go
 1.10.5 milestone</a> on our issue tracker for details.
 </p>
 
+<p>
+go1.10.6 (released 2018/12/12) includes three security fixes to "go get" and
+the <code>crypto/x509</code> package.
+It contains the same fixes as Go 1.11.3 and was released at the same time.
+See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.6">Go
+1.10.6 milestone</a> on our issue tracker for details.
+</p>
+
+<p>
+go1.10.7 (released 2018/12/14) includes a fix to a bug introduced in Go 1.10.6
+that broke <code>go</code> <code>get</code> for import path patterns containing
+"<code>...</code>".
+See the <a href="https://github.com/golang/go/issues?q=milestone%3AGo1.10.7+label%3ACherryPickApproved">
+Go 1.10.7 milestone</a> on our issue tracker for details.
+</p>
+
 <h2 id="go1.9">go1.9 (released 2017/08/24)</h2>
 
 <p>
index 0a7847744b6e5801464040e9b24fa1a726dda711..478611c15c0f6f1a1f8d1e25e6a98869a785fd09 100644 (file)
@@ -456,3 +456,15 @@ each collection, summarizing the amount of memory collected
 and the length of the pause.</li>
 <li>GODEBUG=schedtrace=X prints scheduling events every X milliseconds.</li>
 </ul>
+
+<p>The GODEBUG environmental variable can be used to disable use of
+instruction set extensions in the standard library and runtime.</p>
+
+<ul>
+<li>GODEBUG=cpu.all=off disables the use of all optional
+instruction set extensions.</li>
+<li>GODEBUG=cpu.<em>extension</em>=off disables use of instructions from the
+specified instruction set extension.<br>
+<em>extension</em> is the lower case name for the instruction set extension
+such as <em>sse41</em> or <em>avx</em>.</li>
+</ul>
index 1743d0fa112820ebbf22cb2b0f75649667222e50..34131868a4c751a70f6add6353c6753889b016b1 100644 (file)
@@ -1710,7 +1710,7 @@ prints
 &amp;{7 -2.35 abc   def}
 &amp;{a:7 b:-2.35 c:abc     def}
 &amp;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}
 </pre>
 <p>
 (Note the ampersands.)
@@ -1733,7 +1733,7 @@ fmt.Printf(&quot;%T\n&quot;, timeZone)
 prints
 </p>
 <pre>
-map[string] int
+map[string]int
 </pre>
 <p>
 If you want to control the default format for a custom type, all that's required is to define
@@ -2106,12 +2106,14 @@ In this contrived example <code>Sequence</code> satisfies both.
 
 <p>
 The <code>String</code> method of <code>Sequence</code> is recreating the
-work that <code>Sprint</code> already does for slices.  We can share the
-effort if we convert the <code>Sequence</code> to a plain
+work that <code>Sprint</code> 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 <code>Sequence</code> to a plain
 <code>[]int</code> before calling <code>Sprint</code>.
 </p>
 <pre>
 func (s Sequence) String() string {
+    s = s.Copy()
     sort.Sort(s)
     return fmt.Sprint([]int(s))
 }
@@ -2138,6 +2140,7 @@ type Sequence []int
 
 // 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))
 }
index 16b4c904cb332ca13656d9d1da243bb360ef7e85..1d85be9fe4e53edaadb0cf7b4d8011d1cdcebf33 100644 (file)
@@ -400,6 +400,16 @@ details. <!-- CL 126275, CL 127156, CL 122217, CL 122575, CL 123177 -->
   information.
 </p>
 
+<h3 id="run">Run</h3>
+
+<p>
+  <!-- CL 109341 -->
+  The <a href="/cmd/go/"><code>go</code>&nbsp;<code>run</code></a>
+  command now allows a single import path, a directory name or a
+  pattern matching a single package.
+  This allows <code>go</code>&nbsp;<code>run</code>&nbsp;<code>pkg</code> or <code>go</code>&nbsp;<code>run</code>&nbsp;<code>dir</code>, most importantly <code>go</code>&nbsp;<code>run</code>&nbsp;<code>.</code>
+</p>
+
 <h2 id="runtime">Runtime</h2>
 
 <p><!-- CL 85887 -->
index f4920f467039260123f2d003f8e49ab0f5d82e08..3b086e700106ab2b91fc0549f6a628d81e56c88a 100644 (file)
@@ -26,8 +26,8 @@ Do not send CLs removing the interior tags from such phrases.
 
 <p>
   The latest Go release, version 1.12, arrives six months after <a href="go1.11">Go 1.11</a>.
-  Most of its changes are in TODO.
-  As always, the release maintains the Go 1 <a href="/doc/go1compat.html">promise of compatibility</a>.
+  Most of its changes are in the implementation of the toolchain, runtime, and libraries.
+  As always, the release maintains the Go 1 <a href="/doc/go1compat">promise of compatibility</a>.
   We expect almost all Go programs to continue to compile and run as before.
 </p>
 
@@ -37,19 +37,268 @@ Do not send CLs removing the interior tags from such phrases.
   There are no changes to the language specification.
 </p>
 
+<h2 id="ports">Ports</h2>
+
+<p><!-- CL 138675 -->
+  The race detector is now supported on <code>linux/arm64</code>.
+</p>
+
+<p id="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+.
+  FreeBSD 12.0+ requires a kernel with the COMPAT_FREEBSD11 option set (this is the default).
+</p>
+
+<p><!-- CL 146898 -->
+  cgo is now supported on <code>linux/ppc64</code>.
+</p>
+
+<p id="hurd"><!-- CL 146023 -->
+  <code>hurd</code> is now a recognized value for <code>GOOS</code>, reserved
+  for the GNU/Hurd system for use with <code>gccgo</code>.
+</p>
+
+<h3 id="windows">Windows</h3>
+
+<p>
+  Go's new <code>windows/arm</code> port supports running Go on Windows 10
+  IoT Core on 32-bit ARM chips such as the Raspberry Pi 3.
+</p>
+
+<h3 id="aix">AIX</h3>
+
+<p>
+  Go now supports AIX 7.2 and later on POWER8 architectures (<code>aix/ppc64</code>). External linking, cgo, pprof and the race detector aren't yet supported.
+</p>
+
+<h3 id="darwin">Darwin</h3>
+
+<p>
+  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.
+</p>
+
+<p><!-- CL 141639 -->
+  <code>libSystem</code> is now used when making syscalls on Darwin,
+  ensuring forward-compatibility with future versions of macOS and iOS.
+  <!-- CL 153338 -->
+  The switch to <code>libSystem</code> triggered additional App Store
+  checks for private API usage. Since it is considered private,
+  <code>syscall.Getdirentries</code> now always fails with
+  <code>ENOSYS</code> on iOS.
+</p>
+
 <h2 id="tools">Tools</h2>
 
+<h3 id="vet"><code>go tool vet</code> no longer supported</h3>
+
+<p>
+  The <code>go vet</code> command has been rewritten to serve as the
+  base for a range of different source code analysis tools. See
+  the <a href="https://godoc.org/golang.org/x/tools/go/analysis">golang.org/x/tools/go/analysis</a>
+  package for details. A side-effect is that <code>go tool vet</code>
+  is no longer supported. External tools that use <code>go tool
+  vet</code> must be changed to use <code>go
+  vet</code>. Using <code>go vet</code> instead of <code>go tool
+  vet</code> should work with all supported versions of Go.
+</p>
+
+<p>
+  As part of this change, the experimental <code>-shadow</code> option
+  is no longer available with <code>go vet</code>. Checking for
+  variable shadowing may now be done using
+<pre>
+go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
+go vet -vettool=$(which shadow)
+</pre>
+</p>
+
+<h3 id="tour">Tour</h3>
+
+<p> <!-- CL 152657 -->
+The Go tour is no longer included in the main binary distribution. To
+run the tour locally, instead of running <code>go</code> <code>tool</code> <code>tour</code>,
+manually install it:
+<pre>
+go install golang.org/x/tour
+tour
+</pre>
+</p>
+
 <h3 id="gocache">Build cache requirement</h3>
 
 <p>
-  The build cache is now required as a step toward eliminating
+  The <a href="/cmd/go/#hdr-Build_and_test_caching">build cache</a> is now
+  required as a step toward eliminating
   <code>$GOPATH/pkg</code>. Setting the environment variable
-  <code>GOCACHE=off</code> to disable the
-  <a href="/cmd/go/#hdr-Build_and_test_caching">build cache</a>
-  has no effect in Go 1.12.
+  <code>GOCACHE=off</code> will cause <code>go</code> commands that write to the
+  cache to fail.
+</p>
+
+<h3 id="binary-only">Binary-only packages</h3>
+
+<p>
+  Go 1.12 is the last release that will support binary-only packages.
 </p>
 
-<h3 id="godoc">Godoc</h3>
+<h3 id="cgo">Cgo</h3>
+
+<p>
+       Go 1.12 will translate the C type <code>EGLDisplay</code> to the Go type <code>uintptr</code>.
+       This change is similar to how Go 1.10 and newer treats Darwin's CoreFoundation
+       and Java's JNI types. See the
+       <a href="/cmd/cgo/#hdr-Special_cases">cgo documentation</a>
+       for more information.
+</p>
+
+<p><!-- CL 152657 -->
+  Mangled C names are no longer accepted in packages that use Cgo. Use the Cgo
+  names instead. For example, use the documented cgo name <code>C.char</code>
+  rather than the mangled name <code>_Ctype_char</code> that cgo generates.
+</p>
+
+<h3 id="modules">Modules</h3>
+
+<p><!-- CL 148517 -->
+  When <code>GO111MODULE</code> is set to <code>on</code>, the <code>go</code>
+  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 <code>go.mod</code> file.
+  Commands such as <code>go</code> <code>get</code>,
+  <code>go</code> <code>list</code>, and
+  <code>go</code> <code>mod</code> <code>download</code> behave as if in a
+  module with initially-empty requirements.
+  In this mode, <code>go</code> <code>env</code> <code>GOMOD</code> reports
+  the system's null device (<code>/dev/null</code> or <code>NUL</code>).
+</p>
+
+<p><!-- CL 146382 -->
+  <code>go</code> commands that download and extract modules are now safe to
+  invoke concurrently.
+  The module cache (<code>GOPATH/pkg/mod</code>) must reside in a filesystem that
+  supports file locking.
+</p>
+
+<p><!-- CL 147282, 147281 -->
+  The <code>go</code> directive in a <code>go.mod</code> file now indicates the
+  version of the language used by the files within that module.
+  It will be set to the current release
+  (<code>go</code> <code>1.12</code>) if no existing version is
+  present.
+  If the <code>go</code> directive for a module specifies a
+  version <em>newer</em> than the toolchain in use, the <code>go</code> command
+  will attempt to build the packages regardless, and will note the mismatch only if
+  that build fails.
+</p>
+
+<p><!-- CL 152739 -->
+  When an import cannot be resolved using the active modules,
+  the <code>go</code> command will now try to use the modules mentioned in the
+  main module's <code>replace</code> directives before consulting the module
+  cache and the usual network sources.
+  If a matching replacement is found but the <code>replace</code> directive does
+  not specify a version, the <code>go</code> command uses a pseudo-version
+  derived from the zero <code>time.Time</code> (such
+  as <code>v0.0.0-00010101000000-000000000000</code>).
+</p>
+
+<h3 id="compiler">Compiler toolchain</h3>
+
+<p><!-- CL 134155, 134156 -->
+  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
+  <a href="/pkg/runtime/#KeepAlive"><code>runtime.KeepAlive</code></a> call.
+</p>
+
+<p><!-- CL 147361 -->
+  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
+  <a href="/pkg/runtime/#CallersFrames"><code>runtime.CallersFrames</code></a>
+  instead of iterating over the result of
+  <a href="/pkg/runtime/#Callers"><code>runtime.Callers</code></a> directly.
+<pre>
+// 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())
+       }
+}
+</pre>
+<pre>
+// 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
+       }
+}
+</pre>
+</p>
+
+<p><!-- CL 153477 -->
+  Wrappers generated by the compiler to implement method expressions
+  are no longer reported
+  by <a href="/pkg/runtime/#CallersFrames"><code>runtime.CallersFrames</code></a>
+  and <a href="/pkg/runtime/#Stack"><code>runtime.Stack</code></a>. They
+  are also not printed in panic stack traces.
+
+  This change aligns the <code>gc</code> toolchain to match
+  the <code>gccgo</code> 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 <code>x.M</code>
+  with the function literal <code>func (...) { x.M(...) } </code>.
+</p>
+
+<p><!-- CL 144340 -->
+  The compiler now accepts a <code>-lang</code> flag to set the Go language
+  version to use. For example, <code>-lang=go1.8</code> 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.
+</p>
+
+<p><!-- CL 147160 -->
+  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 <em>and</em> 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 the
+  <a href="https://github.com/golang/proposal/blob/master/design/27539-internal-abi.md#compatibility">compatibility section</a>
+  of the ABI design document.
+</p>
+
+<p><!-- CL 145179 -->
+  There have been many improvements to the DWARF debug information
+  produced by the compiler, including improvements to argument
+  printing and variable location information.
+</p>
+
+<p><!-- CL 61511 -->
+  Go programs now also maintain stack frame pointers on <code>linux/arm64</code>
+  for the benefit of profiling tools like <code>perf</code>. 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
+  <code>GOEXPERIMENT=noframepointer</code> when running <code>make.bash</code>.
+</p>
+
+<p><!-- CL 142717 -->
+  The obsolete "safe" compiler mode (enabled by the <code>-u</code> gcflag) has been removed.
+</p>
+
+<h3 id="godoc"><code>godoc</code> and <code>go</code> <code>doc</code></h3>
 
 <p>
   In Go 1.12, <code>godoc</code> no longer has a command-line interface and
@@ -57,10 +306,138 @@ Do not send CLs removing the interior tags from such phrases.
   for command-line help output instead.
 </p>
 
+<p><!-- CL 141977 -->
+  <code>go</code> <code>doc</code> now supports the <code>-all</code> flag,
+  which will cause it to print all exported APIs and their documentation,
+  as the <code>godoc</code> command line used to do.
+</p>
+
+<p><!-- CL 140959 -->
+  <code>go</code> <code>doc</code> also now includes the <code>-src</code> flag,
+  which will show the target's source code.
+</p>
+
+<h3 id="trace">Trace</h3>
+
+<p><!-- CL 60790 -->
+  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.
+</p>
+
+<h3 id="assembler">Assembler</h3>
+
+<p><!-- CL 147218 -->
+  On <code>arm64</code>, the platform register was renamed from
+  <code>R18</code> to <code>R18_PLATFORM</code> to prevent accidental
+  use, as the OS could choose to reserve this register.
+</p>
+
+<h2 id="runtime">Runtime</h2>
+
+<p><!-- CL 138959 -->
+  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.
+</p>
+
+<p><!-- CL 139719 -->
+  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.
+</p>
+
+<p><!-- CL 146342, CL 146340, CL 146345, CL 146339, CL 146343, CL 146337, CL 146341, CL 146338 -->
+  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.
+</p>
+
+<p><!-- CL 135395 -->
+  On Linux, the runtime now uses <code>MADV_FREE</code> 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 (<code>MADV_DONTNEED</code>), set the
+  environment variable <code>GODEBUG=madvdontneed=1</code>.
+</p>
+
+<p><!-- CL 149578 -->
+  Adding cpu.<em>extension</em>=off to the
+  <a href="/doc/diagnostics.html#godebug">GODEBUG</a> 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.
+</p>
+
+<p><!-- CL 158337 -->
+  Go 1.12 improves the accuracy of memory profiles by fixing
+  overcounting of large heap allocations.
+</p>
+
+<p><!-- CL 159717 -->
+  Tracebacks, <code>runtime.Caller</code>,
+  and <code>runtime.Callers</code> no longer include
+  compiler-generated initialization functions.  Doing a traceback
+  during the initialization of a global variable will now show a
+  function named <code>PKG.init.ializers</code>.
+</p>
+
 <h2 id="library">Core library</h2>
 
+<h3 id="tls_1_3">TLS 1.3</h3>
+
+<p>
+  Go 1.12 adds opt-in support for TLS 1.3 in the <code>crypto/tls</code> package as
+  specified by <a href="https://www.rfc-editor.org/info/rfc8446">RFC 8446</a>. It can
+  be enabled by adding the value <code>tls13=1</code> to the <code>GODEBUG</code>
+  environment variable. It will be enabled by default in Go 1.13.
+</p>
+
 <p>
-  All of the changes to the standard library are minor.
+  To negotiate TLS 1.3, make sure you do not set an explicit <code>MaxVersion</code> in
+  <a href="/pkg/crypto/tls/#Config"><code>Config</code></a> and run your program with
+  the environment variable <code>GODEBUG=tls13=1</code> set.
+</p>
+
+<p>
+  All TLS 1.2 features except <code>TLSUnique</code> in
+  <a href="/pkg/crypto/tls/#ConnectionState"><code>ConnectionState</code></a>
+  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. RSA certificate keys too small
+  to be secure (including 512-bit keys) will not work with TLS 1.3.
+</p>
+
+<p>
+  TLS 1.3 cipher suites are not configurable. All supported cipher suites are
+  safe, and if <code>PreferServerCipherSuites</code> is set in
+  <a href="/pkg/crypto/tls/#Config"><code>Config</code></a> the preference order
+  is based on the available hardware.
+</p>
+
+<p>
+  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.
+</p>
+
+<p>
+  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
+  <a href="/pkg/crypto/tls/#Conn.Read"><code>Read</code></a>, not by
+  <a href="/pkg/crypto/tls/#Conn.Handshake"><code>Handshake</code></a>. 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
+  <a href="/pkg/crypto/tls/#Conn.Read"><code>Read</code></a>.
 </p>
 
 <h3 id="minor_library_changes">Minor changes to the library</h3>
@@ -71,43 +448,83 @@ Do not send CLs removing the interior tags from such phrases.
   in mind.
 </p>
 
-<!-- CL 142717: https://golang.org/cl/142717: cmd/compile: remove obsolete "safe" mode -->
-<!-- CL 144340: https://golang.org/cl/144340: cmd/compile: add -lang flag to specify language version -->
-<!-- CL 141977: https://golang.org/cl/141977: cmd/doc: add -all flag to print all documentation for package -->
-<!-- CL 126656: https://golang.org/cl/126656: cmd/go: add $GOFLAGS environment variable -->
-<!-- CL 115677: https://golang.org/cl/115677: cmd/vet: check embedded field tags too -->
-<dl id="build"><dt><a href="/pkg/build/">build</a></dt>
+<!-- TODO: CL 115677: https://golang.org/cl/115677: cmd/vet: check embedded field tags too -->
+
+<dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
   <dd>
-    <p><!-- CL 61511 -->
-      TODO: <a href="https://golang.org/cl/61511">https://golang.org/cl/61511</a>: support frame-pointer for arm64
+    <p><!-- CL 149297 -->
+      <code>Reader</code>'s <a href="/pkg/bufio/#Reader.UnreadRune"><code>UnreadRune</code></a> and
+      <a href="/pkg/bufio/#Reader.UnreadByte"><code>UnreadByte</code></a> methods will now return an error
+      if they are called after <a href="/pkg/bufio/#Reader.Peek"><code>Peek</code></a>.
     </p>
 
-</dl><!-- build -->
+</dl><!-- bufio -->
 
-<dl id="bytes, strings"><dt><a href="/pkg/bytes, strings/">bytes, strings</a></dt>
+<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
   <dd>
     <p><!-- CL 137855 -->
-      TODO: <a href="https://golang.org/cl/137855">https://golang.org/cl/137855</a>: add ReplaceAll
+      The new function <a href="/pkg/bytes/#ReplaceAll"><code>ReplaceAll</code></a> returns a copy of
+      a byte slice with all non-overlapping instances of a value replaced by another.
     </p>
 
     <p><!-- CL 145098 -->
-      TODO: <a href="https://golang.org/cl/145098">https://golang.org/cl/145098</a>: fix Reader.UnreadRune returning without error on a zero Reader
+      A pointer to a zero-value <a href="/pkg/bytes/#Reader"><code>Reader</code></a> is now
+      functionally equivalent to <a href="/pkg/bytes/#NewReader"><code>NewReader</code></a><code>(nil)</code>.
+      Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
+    </p>
+
+</dl><!-- bytes -->
+
+<dl id="crypto/rand"><dt><a href="/pkg/crypto/rand/">crypto/rand</a></dt>
+  <dd>
+    <p><!-- CL 139419 -->
+      A warning will now be printed to standard error the first time
+      <code>Reader.Read</code> is blocked for more than 60 seconds waiting
+      to read entropy from the kernel.
+    </p>
+
+    <p><!-- CL 120055 -->
+      On FreeBSD, <code>Reader</code> now uses the <code>getrandom</code>
+      system call if available, <code>/dev/urandom</code> otherwise.
+    </p>
+
+</dl><!-- crypto/rand -->
+
+<dl id="crypto/rc4"><dt><a href="/pkg/crypto/rc4/">crypto/rc4</a></dt>
+  <dd>
+    <p><!-- CL 130397 -->
+      This release removes the optimized assembly implementations. RC4 is insecure
+      and should only be used for compatibility with legacy systems.
     </p>
 
-</dl><!-- bytes, strings -->
+</dl><!-- crypto/rc4 -->
 
-<dl id="crypto/tls, net/http"><dt><a href="/pkg/crypto/tls, net/http/">crypto/tls, net/http</a></dt>
+<dl id="crypto/tls"><dt><a href="/pkg/crypto/tls/">crypto/tls</a></dt>
   <dd>
     <p><!-- CL 143177 -->
-      TODO: <a href="https://golang.org/cl/143177">https://golang.org/cl/143177</a>: reject HTTP requests to HTTPS server
+      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
+      <code>net.Conn</code> in the new field <code>Conn</code> of
+      <a href="/pkg/crypto/tls/#RecordHeaderError"><code>RecordHeaderError</code></a>.
+    </p>
+
+</dl><!-- crypto/tls -->
+
+<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
+  <dd>
+    <p><!-- CL 145738 -->
+      A query cursor can now be obtained by passing a
+      <a href="/pkg/database/sql/#Rows"><code>*Rows</code></a>
+      value to the <a href="/pkg/database/sql/#Row.Scan"><code>Row.Scan</code></a> method.
     </p>
 
-</dl><!-- crypto/tls, net/http -->
+</dl><!-- database/sql -->
 
 <dl id="expvar"><dt><a href="/pkg/expvar/">expvar</a></dt>
   <dd>
     <p><!-- CL 139537 -->
-      TODO: <a href="https://golang.org/cl/139537">https://golang.org/cl/139537</a>: add Map.Delete
+      The new <a href="/pkg/expvar/#Map.Delete"><code>Delete</code></a> method allows
+      for deletion of key/value pairs from a <a href="/pkg/expvar/#Map"><code>Map</code></a>.
     </p>
 
 </dl><!-- expvar -->
@@ -115,39 +532,55 @@ Do not send CLs removing the interior tags from such phrases.
 <dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
   <dd>
     <p><!-- CL 142737 -->
-      TODO: <a href="https://golang.org/cl/142737">https://golang.org/cl/142737</a>: print maps in key-sorted order
+      Maps are now printed in key-sorted order to ease testing. The ordering rules are:
+      <ul>
+        <li>When applicable, nil compares low
+        <li>ints, floats, and strings order by <
+        <li>NaN compares less than non-NaN floats
+        <li>bool compares false before true
+        <li>Complex compares real, then imaginary
+        <li>Pointers compare by machine address
+        <li>Channel values compare by machine address
+        <li>Structs compare each field in turn
+        <li>Arrays compare each element in turn
+        <li>Interface values compare first by <code>reflect.Type</code> describing the concrete type
+            and then by concrete value as described in the previous rules.
+      </ul>
     </p>
 
-</dl><!-- fmt -->
-
-<dl id="go/build, cmd/go"><dt><a href="/pkg/go/build, cmd/go/">go/build, cmd/go</a></dt>
-  <dd>
-    <p><!-- CL 146023 -->
-      TODO: <a href="https://golang.org/cl/146023">https://golang.org/cl/146023</a>: add &#34;hurd&#34; as a GOOS value
+    <p><!-- CL 129777 -->
+      When printing maps, non-reflexive key values like <code>NaN</code> were previously
+      displayed as <code>&lt;nil&gt;</code>. As of this release, the correct values are printed.
     </p>
 
-</dl><!-- go/build, cmd/go -->
+</dl><!-- fmt -->
 
 <dl id="go/doc"><dt><a href="/pkg/go/doc/">go/doc</a></dt>
   <dd>
     <p><!-- CL 140958 -->
-      TODO: <a href="https://golang.org/cl/140958">https://golang.org/cl/140958</a>: add new mode bit PreserveAST to control clearing of data in AST
+      To address some outstanding issues in <a href="/cmd/doc/"><code>cmd/doc</code></a>,
+      this package has a new <a href="/pkg/go/doc/#Mode"><code>Mode</code></a> bit,
+      <code>PreserveAST</code>, which controls whether AST data is cleared.
     </p>
 
 </dl><!-- go/doc -->
 
-<dl id="godoc, cmd/godoc"><dt><a href="/pkg/godoc, cmd/godoc/">godoc, cmd/godoc</a></dt>
+<dl id="go/token"><dt><a href="/pkg/go/token/">go/token</a></dt>
   <dd>
-    <p><!-- CL 141397 -->
-      TODO: <a href="https://golang.org/cl/141397">https://golang.org/cl/141397</a>: remove CLI support
+    <p><!-- CL 134075 -->
+      The <a href="/pkg/go/token#File"><code>File</code></a> type has a new
+      <a href="/pkg/go/token#File.LineStart"><code>LineStart</code></a> field,
+      which returns the position of the start of a given line. This is especially useful
+      in programs that occasionally handle non-Go files, such as assembly, but wish to use
+      the <code>token.Pos</code> mechanism to identify file positions.
     </p>
 
-</dl><!-- godoc, cmd/godoc -->
+</dl><!-- go/token -->
 
 <dl id="image"><dt><a href="/pkg/image/">image</a></dt>
   <dd>
     <p><!-- CL 118755 -->
-      TODO: <a href="https://golang.org/cl/118755">https://golang.org/cl/118755</a>: make RegisterFormat safe for concurrent use
+      The <a href="/pkg/image/#RegisterFormat"><code>RegisterFormat</code></a> function is now safe for concurrent use.
     </p>
 
 </dl><!-- image -->
@@ -155,119 +588,295 @@ Do not send CLs removing the interior tags from such phrases.
 <dl id="image/png"><dt><a href="/pkg/image/png/">image/png</a></dt>
   <dd>
     <p><!-- CL 134235 -->
-      TODO: <a href="https://golang.org/cl/134235">https://golang.org/cl/134235</a>: pack image data for small bitdepth paletted images
+      Paletted images with fewer than 16 colors now encode to smaller outputs.
     </p>
 
 </dl><!-- image/png -->
 
-<dl id="internal/poll"><dt><a href="/pkg/internal/poll/">internal/poll</a></dt>
+<dl id="io"><dt><a href="/pkg/io/">io</a></dt>
   <dd>
-    <p><!-- CL 130676 -->
-      TODO: <a href="https://golang.org/cl/130676">https://golang.org/cl/130676</a>: use F_FULLFSYNC fcntl for FD.Fsync on OS X
+    <p><!-- CL 139457 -->
+      The new <a href="/pkg/io#StringWriter"><code>StringWriter</code></a> interface wraps the
+      <a href="/pkg/io/#WriteString"><code>WriteString</code></a> function.
     </p>
 
-</dl><!-- internal/poll -->
+</dl><!-- io -->
 
-<dl id="io"><dt><a href="/pkg/io/">io</a></dt>
+<dl id="lib/time"><dt><a href="/pkg/lib/time/">lib/time</a></dt>
   <dd>
-    <p><!-- CL 139457 -->
-      TODO: <a href="https://golang.org/cl/139457">https://golang.org/cl/139457</a>: export StringWriter
+    <p><!-- CL 151299 -->
+      The time zone database in <code>$GOROOT/lib/time/zoneinfo.zip</code>
+      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.
     </p>
 
-</dl><!-- io -->
+</dl><!-- lib/time -->
+
+<dl id="math"><dt><a href="/pkg/math/">math</a></dt>
+  <dd>
+    <p><!-- CL 153059 -->
+      The functions
+      <a href="/pkg/math/#Sin"><code>Sin</code></a>,
+      <a href="/pkg/math/#Cos"><code>Cos</code></a>,
+      <a href="/pkg/math/#Tan"><code>Tan</code></a>,
+      and <a href="/pkg/math/#Sincos"><code>Sincos</code></a> 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.
+    </p>
+</dl><!-- math -->
 
 <dl id="math/bits"><dt><a href="/pkg/math/bits/">math/bits</a></dt>
   <dd>
     <p><!-- CL 123157 -->
-      TODO: <a href="https://golang.org/cl/123157">https://golang.org/cl/123157</a>: add extended precision Add, Sub, Mul, Div
+    New extended precision operations <a href="/pkg/math/bits/#Add"><code>Add</code></a>, <a href="/pkg/math/bits/#Sub"><code>Sub</code></a>, <a href="/pkg/math/bits/#Mul"><code>Mul</code></a>, and <a href="/pkg/math/bits/#Div"><code>Div</code></a> are available in <code>uint</code>, <code>uint32</code>, and <code>uint64</code> versions.
     </p>
 
 </dl><!-- math/bits -->
 
 <dl id="net"><dt><a href="/pkg/net/">net</a></dt>
   <dd>
-    <p><!-- CL 113997 -->
-      TODO: <a href="https://golang.org/cl/113997">https://golang.org/cl/113997</a>: use splice(2) on Linux when reading from UnixConn, rework splice tests
+    <p><!-- CL 146659 -->
+      The
+      <a href="/pkg/net/#Dialer.DualStack"><code>Dialer.DualStack</code></a> setting is now ignored and deprecated;
+      RFC 6555 Fast Fallback ("Happy Eyeballs") is now enabled by default. To disable, set
+      <a href="/pkg/net/#Dialer.FallbackDelay"><code>Dialer.FallbackDelay</code></a> to a negative value.
     </p>
 
+    <p><!-- CL 107196 -->
+      Similarly, TCP keep-alives are now enabled by default if
+      <a href="/pkg/net/#Dialer.KeepAlive"><code>Dialer.KeepAlive</code></a> is zero.
+      To disable, set it to a negative value.
+    </p>
+
+    <p><!-- CL 113997 -->
+      On Linux, the <a href="http://man7.org/linux/man-pages/man2/splice.2.html"><code>splice</code> system call</a> is now used when copying from a
+      <a href="/pkg/net/#UnixConn"><code>UnixConn</code></a> to a
+      <a href="/pkg/net/#TCPConn"><code>TCPConn</code></a>.
+    </p>
 </dl><!-- net -->
 
 <dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
   <dd>
+    <p><!-- CL 143177 -->
+      The HTTP server now rejects misdirected HTTP requests to HTTPS servers with a plaintext "400 Bad Request" response.
+    </p>
+
     <p><!-- CL 130115 -->
-      TODO: <a href="https://golang.org/cl/130115">https://golang.org/cl/130115</a>: add Client.CloseIdleConnections
+      The new <a href="/pkg/net/http/#Client.CloseIdleConnections"><code>Client.CloseIdleConnections</code></a>
+      method calls the <code>Client</code>'s underlying <code>Transport</code>'s <code>CloseIdleConnections</code>
+      if it has one.
     </p>
 
     <p><!-- CL 145398 -->
-      TODO: <a href="https://golang.org/cl/145398">https://golang.org/cl/145398</a>: in Transport, don&#39;t error on non-chunked response with Trailer header
+      The <a href="/pkg/net/http/#Transport"><code>Transport</code></a> no longer rejects HTTP responses which declare
+      HTTP Trailers but don't use chunked encoding. Instead, the declared trailers are now just ignored.
+    </p>
+
+    <p><!-- CL 152080 --> <!-- CL 151857 -->
+      The <a href="/pkg/net/http/#Transport"><code>Transport</code></a> no longer handles <code>MAX_CONCURRENT_STREAMS</code> 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 <code>MAX_CONCURRENT_STREAMS</code> requests
+      active and then new TCP connections are created as needed. In Go 1.10 and Go 1.11 the <code>http2</code> package
+      would block and wait for requests to finish instead of creating new connections.
+      To get the stricter behavior back, import the
+      <a href="https://godoc.org/golang.org/x/net/http2"><code>golang.org/x/net/http2</code></a> package
+      directly and set
+      <a href="https://godoc.org/golang.org/x/net/http2#Transport.StrictMaxConcurrentStreams"><code>Transport.StrictMaxConcurrentStreams</code></a> to
+      <code>true</code>.
     </p>
 
 </dl><!-- net/http -->
 
+<dl id="net/http/httputil"><dt><a href="/pkg/net/http/httputil/">net/http/httputil</a></dt>
+  <dd>
+    <p><!-- CL 146437 -->
+      The <a href="/pkg/net/http/httputil/#ReverseProxy"><code>ReverseProxy</code></a> now automatically
+      proxies WebSocket requests.
+    </p>
+
+</dl><!-- net/http/httputil -->
+
 <dl id="os"><dt><a href="/pkg/os/">os</a></dt>
   <dd>
     <p><!-- CL 125443 -->
-      TODO: <a href="https://golang.org/cl/125443">https://golang.org/cl/125443</a>: add ExitCode method to ProcessState
+      The new <a href="/pkg/os/#ProcessState.ExitCode"><code>ProcessState.ExitCode</code></a> method
+      returns the process's exit code.
     </p>
 
     <p><!-- CL 135075 -->
-      TODO: <a href="https://golang.org/cl/135075">https://golang.org/cl/135075</a>: add ModeCharDevice to ModeType
+      <code>ModeCharDevice</code> has been added to the <code>ModeType</code> bitmask, allowing for
+      <code>ModeDevice | ModeCharDevice</code> to be recovered when masking a
+      <a href="/pkg/os/#FileMode"><code>FileMode</code></a> with <code>ModeType</code>.
     </p>
 
     <p><!-- CL 139418 -->
-      TODO: <a href="https://golang.org/cl/139418">https://golang.org/cl/139418</a>: add UserHomeDir
+      The new function <a href="/pkg/os/#UserHomeDir"><code>UserHomeDir</code></a> returns the
+      current user's home directory.
+    </p>
+
+    <p><!-- CL 146020 -->
+      <a href="/pkg/os/#RemoveAll"><code>RemoveAll</code></a> now supports paths longer than 4096 characters
+      on most Unix systems.
+    </p>
+
+    <p><!-- CL 130676 -->
+      <a href="/pkg/os/#File.Sync"><code>File.Sync</code></a> now uses <code>F_FULLFSYNC</code> on macOS
+      to correctly flush the file contents to permanent storage.
+      This may cause the method to run more slowly than in previous releases.
+    </p>
+
+    <p><!--CL 155517 -->
+      <a href="/pkg/os/#File"><code>File</code></a> now supports
+      a <a href="/pkg/os/#File.SyscallConn"><code>SyscallConn</code></a>
+      method returning
+      a <a href="/pkg/syscall/#RawConn"><code>syscall.RawConn</code></a>
+      interface value. This may be used to invoke system-specific
+      operations on the underlying file descriptor.
     </p>
 
 </dl><!-- os -->
 
+<dl id="path/filepath"><dt><a href="/pkg/path/filepath/">path/filepath</a></dt>
+  <dd>
+    <p><!-- CL 145220 -->
+      The <a href="/pkg/path/filepath/#IsAbs"><code>IsAbs</code></a> function now returns true when passed
+      a reserved filename on Windows such as <code>NUL</code>.
+      <a href="https://docs.microsoft.com/en-us/windows/desktop/fileio/naming-a-file#naming-conventions">List of reserved names.</a>
+    </p>
+
+</dl><!-- path/filepath -->
+
 <dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
   <dd>
     <p><!-- CL 33572 -->
-      TODO: <a href="https://golang.org/cl/33572">https://golang.org/cl/33572</a>: add Value.MapRange method and MapIter type
+      A new <a href="/pkg/reflect#MapIter"><code>MapIter</code></a> type is
+      an iterator for ranging over a map. This type is exposed through the
+      <a href="/pkg/reflect#Value"><code>Value</code></a> type's new
+      <a href="/pkg/reflect#Value.MapRange"><code>MapRange</code></a> method.
+      This follows the same iteration semantics as a range statement, with <code>Next</code>
+      to advance the iterator, and <code>Key</code>/<code>Value</code> to access each entry.
     </p>
 
 </dl><!-- reflect -->
 
-<dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
+<dl id="regexp"><dt><a href="/pkg/regexp/">regexp</a></dt>
   <dd>
-    <p><!-- CL 135395 -->
-      TODO: <a href="https://golang.org/cl/135395">https://golang.org/cl/135395</a>: use MADV_FREE on Linux if available
+    <p><!-- CL 139784 -->
+      <a href="/pkg/regexp/#Regexp.Copy"><code>Copy</code></a> is no longer necessary
+      to avoid lock contention, so it has been given a partial deprecation comment.
+      <a href="/pkg/regexp/#Regexp.Copy"><code>Copy</code></a>
+      may still be appropriate if the reason for its use is to make two copies with
+      different <a href="/pkg/regexp/#Regexp.Longest"><code>Longest</code></a> settings.
     </p>
 
-</dl><!-- runtime -->
+</dl><!-- regexp -->
+
+<dl id="runtime/debug"><dt><a href="/pkg/runtime/debug/">runtime/debug</a></dt>
+  <dd>
+    <p><!-- CL 144220 -->
+      A new <a href="/pkg/runtime/debug/#BuildInfo"><code>BuildInfo</code></a> 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
+      <a href="/pkg/runtime/debug/#ReadBuildInfo"><code>ReadBuildInfo</code></a> function
+      on <a href="/pkg/runtime/debug/#BuildInfo"><code>BuildInfo</code></a>.
+    </p>
+
+</dl><!-- runtime/debug -->
 
 <dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
   <dd>
+    <p><!-- CL 137855 -->
+      The new function <a href="/pkg/strings/#ReplaceAll"><code>ReplaceAll</code></a> returns a copy of
+      a string with all non-overlapping instances of a value replaced by another.
+    </p>
+
+    <p><!-- CL 145098 -->
+      A pointer to a zero-value <a href="/pkg/strings/#Reader"><code>Reader</code></a> is now
+      functionally equivalent to <a href="/pkg/strings/#NewReader"><code>NewReader</code></a><code>(nil)</code>.
+      Prior to Go 1.12, the former could not be used as a substitute for the latter in all cases.
+    </p>
+
     <p><!-- CL 122835 -->
-      TODO: <a href="https://golang.org/cl/122835">https://golang.org/cl/122835</a>: add Builder.Cap
+      The new <a href="/pkg/strings/#Builder.Cap"><code>Builder.Cap</code></a> method returns the capacity of the builder's underlying byte slice.
+    </p>
+
+    <p><!-- CL 131495 -->
+      The character mapping functions <a href="/pkg/strings/#Map"><code>Map</code></a>,
+      <a href="/pkg/strings/#Title"><code>Title</code></a>,
+      <a href="/pkg/strings/#ToLower"><code>ToLower</code></a>,
+      <a href="/pkg/strings/#ToLowerSpecial"><code>ToLowerSpecial</code></a>,
+      <a href="/pkg/strings/#ToTitle"><code>ToTitle</code></a>,
+      <a href="/pkg/strings/#ToTitleSpecial"><code>ToTitleSpecial</code></a>,
+      <a href="/pkg/strings/#ToUpper"><code>ToUpper</code></a>, and
+      <a href="/pkg/strings/#ToUpperSpecial"><code>ToUpperSpecial</code></a>
+      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.
     </p>
 
 </dl><!-- strings -->
 
 <dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
   <dd>
+    <p><!-- CL 138595 -->
+      64-bit inodes are now supported on FreeBSD 12. Some types have been adjusted accordingly.
+    </p>
+
     <p><!-- CL 125456 -->
-      TODO: <a href="https://golang.org/cl/125456">https://golang.org/cl/125456</a>: implement Unix Socket for Windows
+      The Unix socket
+      (<a href="https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/"><code>AF_UNIX</code></a>)
+      address family is now supported for compatible versions of Windows.
     </p>
 
-    <p><!-- CL 138595 -->
-      TODO: <a href="https://golang.org/cl/138595">https://golang.org/cl/138595</a>: FreeBSD 12 ino64 support
+    <p><!-- CL 147117 -->
+      The new function  <a href="/pkg/syscall/?GOOS=windows&GOARCH=amd64#Syscall18"><code>Syscall18</code></a>
+      has been introduced for Windows, allowing for calls with up to 18 arguments.
     </p>
 
 </dl><!-- syscall -->
 
 <dl id="syscall/js"><dt><a href="/pkg/syscall/js/">syscall/js</a></dt>
   <dd>
+    <p><!-- CL 153559 -->
+    <p>
+      The <code>Callback</code> type and <code>NewCallback</code> function have been renamed;
+      they are now called
+      <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Func"><code>Func</code></a> and
+      <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#FuncOf"><code>FuncOf</code></a>, respectively.
+      This is a breaking change, but WebAssembly support is still experimental
+      and not yet subject to the
+      <a href="/doc/go1compat">Go 1 compatibility promise</a>. Any code using the
+      old names will need to be updated.
+    </p>
+
     <p><!-- CL 141644 -->
-      TODO: <a href="https://golang.org/cl/141644">https://golang.org/cl/141644</a>: add Wrapper interface to support external Value wrapper types
+      If a type implements the new
+      <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Wrapper"><code>Wrapper</code></a>
+      interface,
+      <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#ValueOf"><code>ValueOf</code></a>
+      will use it to return the JavaScript value for that type.
     </p>
 
     <p><!-- CL 143137 -->
-      TODO: <a href="https://golang.org/cl/143137">https://golang.org/cl/143137</a>: make zero js.Value represent &#34;undefined&#34;
+      The meaning of the zero
+      <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value"><code>Value</code></a>
+      has changed. It now represents the JavaScript <code>undefined</code> value
+      instead of the number zero.
+      This is a breaking change, but WebAssembly support is still experimental
+      and not yet subject to the
+      <a href="/doc/go1compat">Go 1 compatibility promise</a>. Any code relying on
+      the zero <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value"><code>Value</code></a>
+      to mean the number zero will need to be updated.
     </p>
 
     <p><!-- CL 144384 -->
-      TODO: <a href="https://golang.org/cl/144384">https://golang.org/cl/144384</a>: add the Value.Truthy method
+      The new
+      <a href="/pkg/syscall/js/?GOOS=js&GOARCH=wasm#Value.Truthy"><code>Value.Truthy</code></a>
+      method reports the
+      <a href="https://developer.mozilla.org/en-US/docs/Glossary/Truthy">JavaScript "truthiness"</a>
+      of a given value.
     </p>
 
 </dl><!-- syscall/js -->
@@ -275,8 +884,39 @@ Do not send CLs removing the interior tags from such phrases.
 <dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
   <dd>
     <p><!-- CL 139258 -->
-      TODO: <a href="https://golang.org/cl/139258">https://golang.org/cl/139258</a>: implement -benchtime=100x
+    The <a href="/cmd/go/#hdr-Testing_flags"><code>-benchtime</code></a> flag now supports setting an explicit iteration count instead of a time when the value ends with an "<code>x</code>". For example, <code>-benchtime=100x</code> runs the benchmark 100 times.
     </p>
 
 </dl><!-- testing -->
 
+<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
+  <dd>
+    <p><!-- CL 142217 -->
+      When executing a template, long context values are no longer truncated in errors.
+    </p>
+    <p>
+      <code>executing "tmpl" at <.very.deep.context.v...>: map has no entry for key "notpresent"</code>
+    </p>
+    <p>
+      is now
+    </p>
+    <p>
+      <code>executing "tmpl" at <.very.deep.context.value.notpresent>: map has no entry for key "notpresent"</code>
+    </p>
+
+  <dd>
+    <p><!-- CL 143097 -->
+      If a user-defined function called by a template panics, the
+      panic is now caught and returned as an error by
+      the <code>Execute</code> or <code>ExecuteTemplate</code> method.
+    </p>
+</dl><!-- text/template -->
+
+<dl id="unsafe"><dt><a href="/pkg/unsafe/">unsafe</a></dt>
+  <dd>
+    <p><!-- CL 146058 -->
+      It is invalid to convert a nil <code>unsafe.Pointer</code> to <code>uintptr</code> and back with arithmetic.
+      (This was already invalid, but will now cause the compiler to misbehave.)
+    </p>
+
+</dl><!-- unsafe -->
index c61dd0fc5f48167834835cad7fc19bc58164f15a..305878f2378f16f3fb59e72bca657b9928474a35 100644 (file)
@@ -1769,7 +1769,7 @@ while that of the corresponding pointer
 type <code>*T</code> consists of all methods with receiver <code>*T</code> or
 <code>T</code>.
 That means the method set of <code>*T</code>
-includes that of <code>T</code>),
+includes that of <code>T</code>,
 but not the reverse.
 </p>
 
index 143f3b2ff22e9d52047b05954f8e37aa1ff19b50..d355bebaed8815733cb234347aef37b11476764b 100644 (file)
@@ -418,8 +418,12 @@ func twoprint() {
 </pre>
 
 <p>
-calling <code>twoprint</code> causes <code>"hello, world"</code> to be printed twice.
-The first call to <code>doprint</code> runs <code>setup</code> once.
+calling <code>twoprint</code> will call <code>setup</code> exactly
+once.
+The <code>setup</code> function will complete before either call
+of <code>print</code>.
+The result will be that <code>"hello, world"</code> will be printed
+twice.
 </p>
 
 <h2>Incorrect synchronization</h2>
index cc2bada913901c84bfb16e2a37f43249f058df86..dcc81ed628717f58c481f7e998dd93bad5ccbb02 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of October 23, 2018",
+       "Subtitle": "Version of November 16, 2018",
        "Path": "/ref/spec"
 }-->
 
@@ -823,6 +823,7 @@ particular architecture.
 <p>
 A <i>string type</i> 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 <code>string</code>;
@@ -830,7 +831,7 @@ it is a <a href="#Type_definitions">defined type</a>.
 </p>
 
 <p>
-The length of a string <code>s</code> (its size in bytes) can be discovered using
+The length of a string <code>s</code> can be discovered using
 the built-in function <a href="#Length_and_capacity"><code>len</code></a>.
 The length is a compile-time constant if the string is a constant.
 A string's bytes can be accessed by integer <a href="#Index_expressions">indices</a>
@@ -846,8 +847,7 @@ string, <code>&amp;s[i]</code> is invalid.
 <p>
 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.
 </p>
 
 <pre class="ebnf">
@@ -883,6 +883,7 @@ multi-dimensional types.
 A slice is a descriptor for a contiguous segment of an <i>underlying array</i> 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 <code>nil</code>.
 </p>
 
@@ -891,8 +892,7 @@ SliceType = "[" "]" ElementType .
 </pre>
 
 <p>
-Like arrays, slices are indexable and have a length.  The length of a
-slice <code>s</code> can be discovered by the built-in function
+The length of a slice <code>s</code> can be discovered by the built-in function
 <a href="#Length_and_capacity"><code>len</code></a>; unlike with arrays it may change during
 execution.  The elements can be addressed by integer <a href="#Index_expressions">indices</a>
 0 through <code>len(s)-1</code>.  The slice index of a
@@ -1348,8 +1348,9 @@ ChannelType = ( "chan" | "chan" "&lt;-" | "&lt;-" "chan" ) ElementType .
 The optional <code>&lt;-</code> operator specifies the channel <i>direction</i>,
 <i>send</i> or <i>receive</i>. If no direction is given, the channel is
 <i>bidirectional</i>.
-A channel may be constrained only to send or only to receive by explicit
-<a href="#Conversions">conversion</a> or <a href="#Assignments">assignment</a>.
+A channel may be constrained only to send or only to receive by
+<a href="#Assignments">assignment</a> or
+explicit <a href="#Conversions">conversion</a>.
 </p>
 
 <pre>
@@ -3624,7 +3625,7 @@ For signed integers, the operations <code>+</code>,
 <code>-</code>, <code>*</code>, <code>/</code>, and <code>&lt;&lt;</code> 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 <a href="#Run_time_panics">run-time panic</a>. 
+Overflow does not cause a <a href="#Run_time_panics">run-time panic</a>.
 A compiler may not optimize code under the assumption that overflow does
 not occur. For instance, it may not assume that <code>x &lt; x + 1</code> is always true.
 </p>
index 2e0c7f859d82cc10e13e91ef0b5d506bb7f11ebc..ab192031c46d46a27e257a7c04a3baf876fe25b7 100644 (file)
@@ -271,6 +271,39 @@ which describes some essential concepts about using the Go tools.
 </p>
 
 
+<h2 id="extra_versions">Installing extra Go versions</h2>
+
+<p>
+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:
+</p>
+
+<pre>
+$ go get golang.org/dl/go1.10.7
+$ go1.10.7 download
+</pre>
+
+<p>
+The newly downloaded version can be used like <code>go</code>:
+</p>
+
+<pre>
+$ go1.10.7 version
+go version go1.10.7 linux/amd64
+</pre>
+
+<p>
+All Go versions available via this method are listed on
+<a href="https://godoc.org/golang.org/dl#pkg-subdirectories">the download page</a>.
+You can find where each of these extra Go versions is installed by looking
+at its <code>GOROOT</code>; for example, <code>go1.10.7 env GOROOT</code>.
+To uninstall a downloaded version, just remove its <code>GOROOT</code> directory
+and the <code>goX.Y.Z</code> binary.
+</p>
+
+
 <h2 id="uninstall">Uninstalling Go</h2>
 
 <p>
index 11c885abf82a34013248c5246167434f4f8776da..ab1826b6ee3b9355817687fd03d58ac90d37b252 100644 (file)
@@ -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 += " "
                }
index c305ae03c1a0f74a0a43adb15c4a30d942a6c719..b334963222ac05e57a83729fa0f08a0c4b4c0d81 100644 (file)
@@ -70,7 +70,7 @@ This person coordinates the fix and release process.</li>
 <li>Code is audited to find any potential similar problems.</li>
 <li>If it is determined, in consultation with the submitter, that a CVE-ID is
 required, the primary handler obtains one via email to
-<a href="http://oss-security.openwall.org/wiki/mailing-lists/distros">oss-distros</a>.</li>
+<a href="https://oss-security.openwall.org/wiki/mailing-lists/distros">oss-distros</a>.</li>
 <li>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.</li>
 <li>A notification is sent to the
index 629e74fce84f8cfe6af1b8694537385485e659e2..8d6785b9af6d24903f84f34e61c111528808c3a2 100755 (executable)
@@ -8,8 +8,8 @@
 # Consult https://www.iana.org/time-zones for the latest versions.
 
 # Versions to use.
-CODE=2018e
-DATA=2018e
+CODE=2018i
+DATA=2018i
 
 set -e
 rm -rf work
index 08dca214181a8488412a66176752d9acd78a367e..bacb724322bcdea720f864b69e6edf13b6de7502 100644 (file)
Binary files a/lib/time/zoneinfo.zip and b/lib/time/zoneinfo.zip differ
index 118187f23b8e7a8bf95b958f40828cbd998706d9..59054f4703a492fab0f6ed6339152c3757e50867 100644 (file)
@@ -121,12 +121,19 @@ func TestReportsTypeErrors(t *testing.T) {
                "issue16591.go",
                "issue18452.go",
                "issue18889.go",
+               "issue26745.go",
+               "issue28721.go",
        } {
                check(t, file)
        }
 
        if sizeofLongDouble(t) > 8 {
-               check(t, "err4.go")
+               for _, file := range []string{
+                       "err4.go",
+                       "issue28069.go",
+               } {
+                       check(t, file)
+               }
        }
 }
 
index 165c2d407c6b20e4764949640bce28c25e75fda9..254671f179eb7a690263fac51ffaa395b586c5f7 100644 (file)
@@ -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/misc/cgo/errors/src/issue26745.go b/misc/cgo/errors/src/issue26745.go
new file mode 100644 (file)
index 0000000..0e22453
--- /dev/null
@@ -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/misc/cgo/errors/src/issue28069.go b/misc/cgo/errors/src/issue28069.go
new file mode 100644 (file)
index 0000000..e19a3b4
--- /dev/null
@@ -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/misc/cgo/errors/src/issue28721.go b/misc/cgo/errors/src/issue28721.go
new file mode 100644 (file)
index 0000000..0eb2a92
--- /dev/null
@@ -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
+}
index 58e126b41b6ff205bc52029adfae827fe55acb20..4fc6b39ffa6272fc1ed1e3a78b2a983c1ed18e6d 100644 (file)
@@ -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)
        })
index ae856a37d690f6fd2ac5e763426788c35e143967..2cb93d9c2eb283555bbe486a65d177e021e9e0c0 100644 (file)
@@ -93,6 +93,8 @@ 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 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/issue27054/egl.h b/misc/cgo/test/issue27054/egl.h
new file mode 100644 (file)
index 0000000..33a759e
--- /dev/null
@@ -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 (file)
index 0000000..186f5bd
--- /dev/null
@@ -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/misc/cgo/test/issue27340.go b/misc/cgo/test/issue27340.go
new file mode 100644 (file)
index 0000000..f8c8a87
--- /dev/null
@@ -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 (file)
index 0000000..f5b120c
--- /dev/null
@@ -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))
+}
index 802a20b779e6ebc38dcff50a95d1c360caad5707..8419b89c0afbed1c726628af5d24815d92adafb5 100644 (file)
@@ -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 <complex.h>
 
+#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, issue28772Constant2)
 }
diff --git a/misc/cgo/test/issue28772.go b/misc/cgo/test/issue28772.go
new file mode 100644 (file)
index 0000000..bed786b
--- /dev/null
@@ -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/misc/cgo/test/issue28896.go b/misc/cgo/test/issue28896.go
new file mode 100644 (file)
index 0000000..8796040
--- /dev/null
@@ -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 <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+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/misc/cgo/test/issue29383.go b/misc/cgo/test/issue29383.go
new file mode 100644 (file)
index 0000000..462c9a3
--- /dev/null
@@ -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 <stddef.h>
+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/misc/cgo/test/issue29748.go b/misc/cgo/test/issue29748.go
new file mode 100644 (file)
index 0000000..8229b3b
--- /dev/null
@@ -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/misc/cgo/test/issue29781.go b/misc/cgo/test/issue29781.go
new file mode 100644 (file)
index 0000000..0fd8c08
--- /dev/null
@@ -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/misc/cgo/test/issue30065.go b/misc/cgo/test/issue30065.go
new file mode 100644 (file)
index 0000000..396d437
--- /dev/null
@@ -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 <string.h>
+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')
+       }
+}
index 4fa4b2bbd7e3c6bb2d357d89b97e923d9d311902..3715fde57573a1bfd065ded8f83c3d26283eb768 100644 (file)
@@ -5,7 +5,8 @@
 package cgotest
 
 /*
-#include "issue4339.h"
+// We've historically permitted #include <>, so test it here.  Issue 29333.
+#include <issue4339.h>
 */
 import "C"
 
index 0af86e64da487a44bc342f8c3bfd1aeea8d465fb..149c26562ad4d4fc56caede646d2ad8e2b9e83d6 100644 (file)
@@ -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)
        }
index 89b19d653a3d859a11ce65a02af24633d53e2abe..e5b90ff194ce147ef27fc72b5854c630c149cd73 100644 (file)
@@ -602,3 +602,55 @@ func copyFile(t *testing.T, dst, src string) {
                t.Fatal(err)
        }
 }
+
+func TestGo2C2Go(t *testing.T) {
+       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()
+
+       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 (file)
index 0000000..76a5323
--- /dev/null
@@ -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 (file)
index 0000000..0e8fac4
--- /dev/null
@@ -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 (file)
index 0000000..17ba1eb
--- /dev/null
@@ -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 (file)
index 0000000..91bf308
--- /dev/null
@@ -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)
+       }
+}
index 314b5072f360ee1f3860f559e7d44776f40b2517..1d769a98b6e26c7c50473ad8373da45db92d22b5 100644 (file)
@@ -5,9 +5,9 @@
 package sanitizers_test
 
 import (
+       "runtime"
        "strings"
        "testing"
-       "runtime"
 )
 
 func TestTSAN(t *testing.T) {
index c3c7a6aab6af47127d0ce604b311e12e5bfc119c..41a24efe22c0ed97cdb9f13cb99ad79dce9dc9a2 100644 (file)
@@ -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 (file)
index 0000000..979350f
--- /dev/null
@@ -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
+}
index c2afa1020aae1aced945f82afa1ec835d70118dc..d05219364dcb7da2b35497b3628dd16782100c6e 100644 (file)
@@ -37,9 +37,6 @@ go    src=..
                                buildid
                                        testdata
                                                +
-                               xcoff
-                                       testdata
-                                               +
                        gofmt
                                gofmt.go
                                gofmt_test.go
@@ -157,7 +154,7 @@ go  src=..
                        trace
                                testdata
                                        +
-                       traceparser
+                       xcoff
                                testdata
                                        +
                io
diff --git a/misc/sortac/sortac.go b/misc/sortac/sortac.go
deleted file mode 100644 (file)
index f61aa96..0000000
+++ /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()
-}
index 440bba104c01df4ac29b84a869c044a0eaee1d68..165d567750506b58450e4b90735b71925c949355 100644 (file)
                                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);
                        },
@@ -82,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 = () => {
                        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.
 
                                                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)
 
                _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) {
                        }
                }
 
-               _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;
                        };
                }
        }
 
                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
+                       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();
                                }
                        });
index eb82edb6d97b98229aafdafb2e7574664ceda6a2..cf9cc79c5915bace0af0e81fa4df961f3a68553c 100644 (file)
@@ -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
 
index f7070127145d13d215a442eca5019e684bde34eb..6f17dbe30725c120218885cc662587b8c7dcb4d2 100644 (file)
@@ -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
 
index 50218a2bbd72b807511dba594e880b9dc741e8b2..3d5c759851a3a4fe0bbfe5e67c057215778ae85f 100644 (file)
@@ -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) {
index e498dfea1ed161dc3613260d1ae11e9a5bb32c27..0125d729d1b31e679ab390d122e1c927c8d5a313 100644 (file)
@@ -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,11 +123,17 @@ 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
        }
 
+       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
        }
@@ -186,9 +192,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 {
@@ -250,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
@@ -288,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 {
index 34d70312f7bc0e6cb76a281efab2f3fb5fa6e912..f7a0682e7033dd2f4c6b6664b98fd7d1df9fea06 100644 (file)
@@ -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})
index 087cc0e427561d2714f3b84e9e3f3633e510b406..aff2db5084f11e20657f9e61897f278b26e626fc 100644 (file)
@@ -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;
index 4d5cdfa28095ef953067ee12b64e260038a2913a..6d328378fabdc48a99aff201905487aa12131521 100644 (file)
@@ -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 {
index 9698f25b512b7444784739e1c6f8c9c41262ebda..02dfa7c84128212dd38816cc6ff104bfcf4a2b4e 100644 (file)
@@ -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)
        }
index c39cab3c1958534e92737c4860178d31de77a51a..8bf0acac25f79774f65e45bdb116e395b81ae513 100644 (file)
@@ -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,
index b77337bcf2314a08b4d2c30fa5a3384badd59ec6..7462f24a1c6d834bda244e0e63eeca4a2fac757c 100644 (file)
@@ -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 {
index 69393b6b2052a6fbf74fd40230b7c4e4c6880ac8..2ba3fd73df83c9db0e57b94750c9f7a06d56d51b 100644 (file)
@@ -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
 }
index e77db9fba14193ba6c82712f447579b9461be1a4..346976ef48b67b1d55d605e79f774c0b3ddd4fe7 100644 (file)
@@ -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,33 @@ func (p *Parser) Parse() (*obj.Prog, bool) {
        return p.firstProg, true
 }
 
-// WORD [ arg {, arg} ] (';' | '\n')
-func (p *Parser) line() bool {
+// 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')
+//
+// 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 +155,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 +194,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 +208,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 +234,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) {
@@ -237,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
@@ -725,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).
index 9e8929dac4c6962cdd736d855f27066969147429..366c80c0905ae26c376f100ee65de0b69807ac57 100644 (file)
@@ -948,6 +948,7 @@ label1:
 //     <MNEMONIC> VRA,VRB,VRC,VRT produces
 //     <mnemonic> VRT,VRA,VRB,VRC
        VPERM V3, V2, V1, V0
+       VPERMXOR V3, V2, V1, V0
 
 //     Vector bit permute, VX-form
 //     <MNEMONIC> VRA,VRB,VRT produces
index 6acde29432675f6f635641d9ef9c7c3d6cf60e27..5fe3fd9d53c6f04afb8bce2d7750a99a423751fd 100644 (file)
@@ -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("gensymabis", false, "write symbol ABI information to output file, don't assemble")
 )
 
 var (
index 04f56f96467f8ba5fa2e96f888997fad6fcd81e7..447d1afde3a08507a3ba13d6b97244cfd16e30fa 100644 (file)
@@ -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
@@ -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 {
index 4462136bf4bc5720ee21bc55ff52cbf76ad71408..83d727a8a5da6846865076daff262df8ef7b01f9 100644 (file)
@@ -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) {
@@ -191,6 +200,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 {
+                                               consts[name.Name] = true
+                                       }
+                               }
+                       }
+               }
+
        }
 }
 
index 08d64130df4368f7031b6689e9661c34ab4034ea..cceb33edbdb738e39bf8ff0ee1e4af9797f26562 100644 (file)
@@ -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 <pkg>
+
 Using cgo directly
 
 Usage:
index 9b615db5db6dd0f8cf02560ea7a3e08a13ec866a..b5cf04cf4c7bd3e50daae03ea0ea451b143be955 100644 (file)
@@ -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"
@@ -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)
+                       }
+               }
        }
 }
 
@@ -164,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
@@ -171,15 +181,17 @@ 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 {
-                       p.loadDWARF(f, needType)
+                       p.loadDWARF(f, &conv, needType)
                }
 
                // In godefs mode we're OK with the typedefs, which
@@ -474,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
@@ -573,7 +585,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()
@@ -581,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
@@ -641,10 +651,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 +671,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)
                }
        }
 }
@@ -716,9 +727,22 @@ 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 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.
@@ -867,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
@@ -886,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
                }
 
@@ -900,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)
        }
 
@@ -941,7 +966,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 +983,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) {
@@ -1095,15 +1120,20 @@ 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, 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
@@ -1123,19 +1153,29 @@ 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))
+       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))
-       fmt.Fprintf(sb, "_cgo%d := %s; ", i, gofmtLine(arg))
+       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
 }
 
 // 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
@@ -1158,11 +1198,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
@@ -1172,7 +1212,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 +1254,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:
@@ -1232,7 +1272,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_") ||
+                       consts[x.Name]
        case *ast.UnaryExpr:
                return p.isConst(f, x.X)
        case *ast.BinaryExpr:
@@ -1254,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 {
@@ -1363,7 +1415,20 @@ func (p *Package) rewriteRef(f *File) {
 
                // Record source-level edit for cgo output.
                if !r.Done {
-                       repl := gofmt(expr)
+                       // 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
+                       // 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 + ")"
                        }
@@ -1481,6 +1546,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.
@@ -1944,8 +2020,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 <<EOF\n", strings.Join(nargs, " "))
@@ -1988,10 +2066,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
@@ -2026,8 +2104,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")
@@ -2135,11 +2213,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
@@ -2151,18 +2230,29 @@ 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 {
-               if t.Go == nil {
-                       fatalf("%s: type conversion loop at %s", lineno(pos), dtype)
+       // 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 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)
        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:
@@ -2325,10 +2415,11 @@ func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type {
                // Placeholder initialization; completed in FinishType.
                t.Go = &ast.StarExpr{}
                t.C.Set("<incomplete>*")
-               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)
@@ -2716,11 +2807,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
 
@@ -2769,6 +2855,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 == "" {
@@ -2818,7 +2917,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:
@@ -2935,6 +3034,9 @@ func (c *typeConv) badPointerTypedef(dt *dwarf.TypedefType) bool {
        if c.badJNI(dt) {
                return true
        }
+       if c.badEGLDisplay(dt) {
+               return true
+       }
        return false
 }
 
@@ -3071,6 +3173,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{
index 9c763a22fb01c23318b479f0f48330aa539cba3f..64384a606b261f03874bb6e48b1bd5fe898c9690 100644 (file)
@@ -127,8 +127,35 @@ 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. 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", ";",
+)
+
 // 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))
 }
index 3098a4a63d3dcc86ebb0b86d410a02948735fcb3..80435b0634d901e98f104ec7a65975b450008011 100644 (file)
@@ -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.
@@ -64,6 +71,9 @@ type File struct {
        Edit     *edit.Buffer
 }
 
+// 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
 }
@@ -96,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
index c203873b130841da420dd750142dd1e93574c43a..0cf8b174f8e5c9dc6220eb72ceac5fa8ad228ff8 100644 (file)
@@ -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"
@@ -776,6 +776,13 @@ func (p *Package) writeExports(fgo2, fm, fgcc, fgcch io.Writer) {
        fmt.Fprintf(fgcc, "#include <stdlib.h>\n")
        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")
+
        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")
@@ -1203,7 +1210,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 {
@@ -1255,7 +1262,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
@@ -1271,7 +1278,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
@@ -1473,6 +1480,14 @@ __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"
+
 #include <errno.h>
 #include <string.h>
 `
@@ -1555,6 +1570,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 +1822,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 <stddef.h> /* 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 +1844,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 +1886,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;
index e2a19d98c0be5151986291c277c507423f252106..5291a8b0ebacf1d8961e19212cd1fc394937dce4 100644 (file)
@@ -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
 
index 05d13b58a565c413a4f85efc6b406b5a0cd01693..51079e3dcf21c3e77bfc146197709504c7b483da 100644 (file)
@@ -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,188 +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":             "",
-       "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 (file)
index 0000000..81ba20f
--- /dev/null
@@ -0,0 +1,204 @@
+// 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/ssa.relation %s":            "",
+       "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":                                                           "",
+}
index df0a69a4417627247258e4c0677cb3fa04816df6..ee4f872bd87e7532f531147e2a7355e598afebc9 100644 (file)
@@ -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
 }
index b2fc272ec65cc56a5cd824d6dc212ecb36cdb6a8..f525517c49af49e02817318d764e7468d424771c 100644 (file)
@@ -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
 }
index 204391fef1c778bde09fd6598404afd08515e4c9..9d8fe53cfdc87eddbf4430517456ac2fb64b29fc 100644 (file)
@@ -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
 }
index b112ff679723c2a1e05f8351b616910828a7e424..2710e04f40f255f509dea6beea4e986fa889b1b1 100644 (file)
@@ -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 {
@@ -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]),
@@ -374,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]
@@ -464,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 {
@@ -496,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)
index 4e9f11c8b320567ff6c87e223177275e55c0633b..04f4cbfd5852d2df95e6bb04b8aad72f4cf2e586 100644 (file)
@@ -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 {
index 1eaf332e5020f03de569ff6812b44bed3a7201c5..fc879badb2b7eb36e95d359c136f2016392fe7ca 100644 (file)
@@ -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
index 5123df8e9d15f0dfe6a043bac4d19a429b3f31b1..284ecdf457ce34499b3439dcb4889f34248ecf8f 100644 (file)
@@ -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()...))
@@ -434,8 +434,20 @@ 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 && 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))
        tfn.Rlist.Set(structargs(t0.Results(), false))
@@ -467,7 +479,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,10 +490,11 @@ 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
+       lineno = saveLineNo
 
        return xfunc
 }
@@ -516,7 +529,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)
index a77759832a32a28264eef95b3bf0d41cdf1f044b..3a9080e67d874d45ee21c5d0c94ccc4325d6583c 100644 (file)
@@ -584,11 +584,19 @@ 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.
        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 +631,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 +881,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 +908,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 +1032,9 @@ func idealkind(n *Node) Ctype {
        case OADD,
                OAND,
                OANDNOT,
-               OCOM,
+               OBITNOT,
                ODIV,
-               OMINUS,
+               ONEG,
                OMOD,
                OMUL,
                OSUB,
@@ -1221,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] {
@@ -1235,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
                        }
                }
@@ -1244,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()
 }
@@ -1268,7 +1280,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,11 +1289,10 @@ func (n *Node) isGoConst() bool {
 
        switch n.Op {
        case OADD,
-               OADDSTR,
                OAND,
                OANDAND,
                OANDNOT,
-               OCOM,
+               OBITNOT,
                ODIV,
                OEQ,
                OGE,
@@ -1289,7 +1300,7 @@ func (n *Node) isGoConst() bool {
                OLE,
                OLSH,
                OLT,
-               OMINUS,
+               ONEG,
                OMOD,
                OMUL,
                ONE,
@@ -1301,14 +1312,26 @@ func (n *Node) isGoConst() bool {
                OSUB,
                OXOR,
                OIOTA,
-               OCOMPLEX,
                OREAL,
                OIMAG:
                if n.Left.isGoConst() && (n.Right == nil || n.Right.isGoConst()) {
                        return true
                }
 
-       case OCONV:
+       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, OCONVNOP:
                if okforconst[n.Type.Etype] && n.Left.isGoConst() {
                        return true
                }
index 645ba7558c1cda91866560d6c8d8f84d7589633c..9f25e5e15ba26f5afaea4b743dd5c67ca2d8ed12 100644 (file)
@@ -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)
 }
@@ -280,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)
 
@@ -452,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++
@@ -485,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)
 }
 
@@ -625,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)
@@ -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
index 2310b1e5fd2e917a179ae554f377235cc7b8c851..322b2dcd0bca2658846914f18b551bcb897f424d 100644 (file)
@@ -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()
@@ -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
        }
 
@@ -1722,7 +1752,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 +1784,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 +2087,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 +2130,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 +2172,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 +2377,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))
index 85916509cb9f202acfa3618f9457d0a937c600b6..791fc063b7fce523dae828768f90166417f5f399 100644 (file)
@@ -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
@@ -140,6 +133,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
 }
index 16b81e6a88df62994036febdf7df3c29e3f51120..fc1af603a2b2b060fa5dfeabbd157fcfe3055fd6 100644 (file)
@@ -159,7 +159,7 @@ var goopnames = []string{
        OCASE:     "case",
        OCLOSE:    "close",
        OCOMPLEX:  "complex",
-       OCOM:      "^",
+       OBITNOT:   "^",
        OCONTINUE: "continue",
        OCOPY:     "copy",
        ODELETE:   "delete",
@@ -174,13 +174,14 @@ var goopnames = []string{
        OGT:       ">",
        OIF:       "if",
        OIMAG:     "imag",
-       OIND:      "*",
+       OINLMARK:  "inlmark",
+       ODEREF:    "*",
        OLEN:      "len",
        OLE:       "<=",
        OLSH:      "<<",
        OLT:       "<",
        OMAKE:     "make",
-       OMINUS:    "-",
+       ONEG:      "-",
        OMOD:      "%",
        OMUL:      "*",
        ONEW:      "new",
@@ -464,8 +465,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 +943,10 @@ func (n *Node) stmtfmt(s fmt.State, mode fmtMode) {
        case ORETJMP:
                mode.Fprintf(s, "retjmp %v", n.Sym)
 
-       case OPROC:
+       case OINLMARK:
+               mode.Fprintf(s, "inlmark %d", n.Xoffset)
+
+       case OGO:
                mode.Fprintf(s, "go %v", n.Left)
 
        case ODEFER:
@@ -1064,92 +1068,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 +1176,7 @@ var opprec = []int{
        OGOTO:       -1,
        OIF:         -1,
        OLABEL:      -1,
-       OPROC:       -1,
+       OGO:         -1,
        ORANGE:      -1,
        ORETURN:     -1,
        OSELECT:     -1,
@@ -1183,7 +1187,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
        }
 
@@ -1400,16 +1404,23 @@ 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,
-               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 +1453,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 +1461,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 +1482,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 +1705,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()
@@ -1742,7 +1753,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 "<...>"
        }
 
index f9b4584cf6bcd1e13169d590128ab88933393306..43d12925eb3b9c7c16220939b40b0b1ec4e3ca31 100644 (file)
@@ -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()
 }
 
index 857cf967502cf2addf0aaf5607c14c6b2f291939..56855d797a194d506b57e40c2836ad050efbcf9f 100644 (file)
@@ -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{
index 471746ed7dde218c962da841acd393ae060444fd..376637ba9adcabeb21e0528e14f32a09f1587908 100644 (file)
@@ -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)
@@ -300,14 +300,15 @@ var (
        panicdottypeI,
        panicindex,
        panicnildottype,
+       panicoverflow,
        panicslice,
        raceread,
        racereadrange,
        racewrite,
        racewriterange,
-       supportPopcnt,
-       supportSSE41,
-       arm64SupportAtomics,
+       x86HasPOPCNT,
+       x86HasSSE41,
+       arm64HasATOMICS,
        typedmemclr,
        typedmemmove,
        Udiv,
index 16602b998823366f58163c305fff646016a44de6..5ad7b9a1b6fc5ec82911f76330ad5a7515ccb69f 100644 (file)
@@ -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.Name, 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
index e77ca9a6c1794b23b762f417685c6773611828b5..2a34e2ea778f735ed307557ab9a56d4196c93b7d 100644 (file)
@@ -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)
@@ -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))
        }
 }
 
index 8614c7a14f3835c54df0af6d7c148870cb94c876..addf829b04a969bb466579fd904d606af11180c1 100644 (file)
@@ -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
@@ -607,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)
@@ -819,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)
@@ -886,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:
@@ -898,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
 
@@ -908,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:
@@ -918,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
@@ -981,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:
@@ -1052,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
        }
 }
index bb2bc4b844e65e10f40c2cff70284c5c35e393e2..e981f836537fc8f06b13b813cc69d019f313aada 100644 (file)
@@ -57,6 +57,9 @@ func anyinit(n []*Node) bool {
 
 // fninit hand-crafts package initialization code.
 //
+//      func init.ializers() {                          (0)
+//              <init stmts>
+//      }
 //      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
 //                      <pkg>.init()                    (6)
-//              { <init stmts> }                        (7)
+//              init.ializers()                         (7)
 //              init.<n>() // 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)
 
@@ -166,7 +194,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 +215,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 +234,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)
 }
index b26758a77ead89a258e6bdc89f9bf5f66657a112..81cad31a13a12277a388ea7a61083e7973a8bfd8 100644 (file)
@@ -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.
 
@@ -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)
        }
 
@@ -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)
@@ -1083,7 +1092,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 +1248,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
index 5a8c19e2cb447a67ca3a2f0e9f1ea097088288a3..58d13f2dcf5f52be43fd7e62136cc37f9e63eeac 100644 (file)
@@ -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",
@@ -104,6 +104,7 @@ func TestIntendedInlining(t *testing.T) {
                        "(*Buffer).Bytes",
                        "(*Buffer).Cap",
                        "(*Buffer).Len",
+                       "(*Buffer).Grow",
                        "(*Buffer).Next",
                        "(*Buffer).Read",
                        "(*Buffer).ReadByte",
index b225f03a1de1f233d222fb5acc375977057d5d82..72e7f07a21c0028ce8a6352cc63ae2a2584d08a5 100644 (file)
@@ -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")
        }
index cdc461aac13c58f0c3bd255270ee5f2f257d69a5..98ff2a3d27a1c3c81f710f8bec0c80f03459b098 100644 (file)
@@ -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`")
@@ -247,6 +246,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`")
@@ -262,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
@@ -285,6 +287,10 @@ func Main(archInit func(*Arch)) {
 
        checkLang()
 
+       if symabisPath != "" {
+               readSymABIs(symabisPath, myimportpath)
+       }
+
        thearch.LinkArch.Init(Ctxt)
 
        if outfile == "" {
@@ -431,9 +437,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
@@ -502,7 +515,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)
                }
        }
 
@@ -514,7 +527,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()
@@ -529,7 +542,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
@@ -681,7 +694,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
@@ -810,6 +823,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
@@ -1236,6 +1324,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 {
@@ -1244,15 +1333,15 @@ 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
        }
-       // 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
@@ -1366,7 +1455,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)
                }
        }
index f13d2cdbb559442e66e13bce537abaac0326226c..3aa303c0c1c404b90224d7b97fa210b8b5cb6b8a 100644 (file)
@@ -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()
@@ -484,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")
+                       }
                }
        }
 
@@ -522,16 +546,22 @@ 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 {
-                       yyerror("can only use ... with final parameter in list")
+                       if param.Name == nil {
+                               yyerror("syntax error: cannot use ... with non-final parameter")
+                       } else {
+                               p.yyerrorpos(param.Name.Pos(), "syntax error: cannot use ... with non-final parameter %s", param.Name.Value)
+                       }
                }
                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)
                }
        }
 
@@ -619,7 +649,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
                                }
@@ -630,7 +660,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:
@@ -857,7 +887,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
 }
@@ -956,7 +986,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")
                }
@@ -1232,13 +1262,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 {
index 34c3249d903825fe8cc2e994b5fb9450758ae34b..fe80e39064d781a09a13b95dda85f91bacc71e40 100644 (file)
@@ -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) {
index da2b3343a131f5f07ff8756edf00d8538b39c16d..4848a02bb6a8c4af01444f3db95ebb23da48c669 100644 (file)
@@ -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)
                        }
                }
@@ -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:
@@ -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)
        }
index 01dacb783bf8639554ae156a8d10b49bf1a25e6d..1dc4b5342716b501eb63051aa8f33c9bfb4ef123 100644 (file)
@@ -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))
@@ -198,6 +209,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
        }
@@ -230,8 +243,16 @@ 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()
+       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
@@ -439,55 +460,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,
@@ -539,12 +565,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
@@ -553,6 +582,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
index 2c31d5feb91eaae54d8bb85988bbe3f0fe7d82e0..b48a9ea87e799fae6c66b7bf6e279e5b3a6cb50f 100644 (file)
@@ -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"
 )
 
@@ -309,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
        }
@@ -632,7 +631,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 +790,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 +1050,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 +1397,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 {
index 8a8b436a23ab2dad0403ecdacc00002f7fc92535..6f251377c94ea7f215464afcf5ea75de5280d676 100644 (file)
@@ -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()
index ac03cc5ea7dac2133d8c14e84017b452f8501c2b..5c19d54e78d997bbd3a1e92aa72d75612b9d6fc2 100644 (file)
@@ -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
@@ -586,8 +586,9 @@ 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)
        } else {
                // memclrNoHeapPointers(hp, hn)
@@ -601,9 +602,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
 }
index 605401f09008d4402e17d1efb7f3d9d6b63336de..d492f17f89ba91ac5e87f2e97b802bff18c448fb 100644 (file)
@@ -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)
        }
 
@@ -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)
@@ -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)
@@ -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.
@@ -1180,7 +1202,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() {
@@ -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:
@@ -1645,7 +1675,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
index c7f39088880f908479e7204b61bba74e681ef4ad..a09d779af678216c28acb1076a2a17c158beabd5 100644 (file)
@@ -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)
                }
 
index ac8dbf60173f5045f7e4b54a516a4b4327dc5678..de0298b746fe46709f17b028a7709367e9c8e51b 100644 (file)
@@ -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
@@ -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)
 }
@@ -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:
        }
@@ -702,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))
@@ -746,7 +758,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 +786,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 +851,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 +864,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 +878,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)
        }
@@ -884,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))
@@ -902,7 +917,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
                }
 
@@ -910,7 +925,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 +934,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 +1008,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 +1038,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 +1060,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 +1083,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 +1094,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 +1120,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 +1138,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)
                }
@@ -1241,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)
@@ -1251,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)
                }
index b0ccd01752470f1c65e106e756685b636aed0825..e20137669aaac831cc8b9e8eba1781e985dbb68e 100644 (file)
@@ -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.
@@ -68,9 +69,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")
@@ -81,29 +82,30 @@ func initssaconfig() {
        panicdottypeI = sysfunc("panicdottypeI")
        panicindex = sysfunc("panicindex")
        panicnildottype = sysfunc("panicnildottype")
+       panicoverflow = sysfunc("panicoverflow")
        panicslice = sysfunc("panicslice")
        raceread = sysfunc("raceread")
        racereadrange = sysfunc("racereadrange")
        racewrite = sysfunc("racewrite")
        racewriterange = sysfunc("racewriterange")
-       supportPopcnt = sysfunc("support_popcnt")
-       supportSSE41 = sysfunc("support_sse41")
-       arm64SupportAtomics = sysfunc("arm64_support_atomics")
+       x86HasPOPCNT = sysvar("x86HasPOPCNT")       // bool
+       x86HasSSE41 = sysvar("x86HasSSE41")         // bool
+       arm64HasATOMICS = sysvar("arm64HasATOMICS") // 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")
+       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 = sysfunc("sigpanic")
 }
 
@@ -155,7 +157,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)
@@ -803,7 +805,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:
@@ -1202,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)
        }
@@ -1268,25 +1273,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 +1660,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 +2179,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 +2189,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 +2205,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)
 
@@ -2414,7 +2419,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
@@ -2452,7 +2457,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 {
@@ -2838,7 +2843,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 +2920,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]
@@ -3068,7 +3073,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 +3213,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 +3421,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
@@ -3486,20 +3491,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 ********/
 
@@ -3650,7 +3664,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)
                }
@@ -3670,6 +3685,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 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)
@@ -3860,7 +3876,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)
@@ -4009,6 +4025,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.
@@ -4016,6 +4044,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)
@@ -5129,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.
@@ -5177,6 +5222,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
@@ -5186,7 +5235,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 {
@@ -5505,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
index 97f7e4880d9c7cc6c8c5645274ba6993b8dc5947..2a976dc4f03a91a26e190f07e1aed4db0df93144 100644 (file)
@@ -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:
+       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)
        }
 
@@ -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
        }
 
@@ -1571,7 +1572,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 +1590,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.
@@ -1619,6 +1620,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]),
@@ -1851,7 +1853,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)
@@ -1909,7 +1911,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
index f1c153937fba591a90217a80b04bd9cb38f74763..cc9a8f8b2cd735519cdeb8a5585c7d89e819cc10 100644 (file)
@@ -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)
        }
 
@@ -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)
@@ -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
                }
        }
 
@@ -302,8 +302,8 @@ func (s *exprSwitch) walk(sw *Node) {
                s.exprname = cond
        } else {
                s.exprname = temp(cond.Type)
-               cas = []*Node{nod(OAS, s.exprname, cond)}
-               typecheckslice(cas, Etop)
+               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)
        }
 
        // 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()...)
@@ -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{
@@ -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:]))
index e29a3d7657d9b07e11fba669f7079fb3df6fb57e..5f07c6c52ad25e8b60591d7b8ee8758bd32d34e2 100644 (file)
@@ -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
 
@@ -144,7 +145,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 +173,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 +200,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 +478,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 +582,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.
@@ -622,7 +623,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)
@@ -650,7 +651,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 +670,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)
@@ -692,7 +693,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)
@@ -720,7 +721,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)
@@ -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
index e6a8ed4bda149ae951ad8c61cf12c22a413e666e..4fc1c5c73c582f3c361518d36b85b281ebc471d8 100644 (file)
@@ -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 {
@@ -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:
@@ -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
 }
 
@@ -2513,6 +2513,13 @@ 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.
+
+       // 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
 }
 
@@ -2575,9 +2582,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
@@ -2599,11 +2606,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() {
@@ -2611,9 +2618,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 {
@@ -2623,7 +2630,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
                }
@@ -2656,7 +2663,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
                }
        }
@@ -2697,7 +2704,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 {
@@ -2757,7 +2764,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
@@ -3018,7 +3025,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 {
@@ -3030,7 +3037,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
@@ -3070,12 +3077,18 @@ 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() {
-                                       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
@@ -3091,7 +3104,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")
 
@@ -3122,14 +3135,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 {
@@ -3138,7 +3151,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")
                }
@@ -3156,7 +3169,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 {
@@ -3201,7 +3214,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
                                        }
 
@@ -3223,7 +3236,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
                                }
 
@@ -3255,7 +3268,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")
                        }
                }
@@ -3297,7 +3310,7 @@ func islvalue(n *Node) bool {
                        return false
                }
                fallthrough
-       case OIND, ODOTPTR, OCLOSUREVAR:
+       case ODEREF, ODOTPTR, OCLOSUREVAR:
                return true
 
        case ODOT:
@@ -3391,8 +3404,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:
@@ -3429,12 +3442,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() {
@@ -3458,7 +3471,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
@@ -3486,16 +3499,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)
 
@@ -3600,7 +3613,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)
                }
        }
 }
@@ -3617,7 +3630,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
@@ -3657,7 +3670,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
 }
 
@@ -3809,7 +3822,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
@@ -3871,12 +3884,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 {
index 760a8e40b0f5b36376ef63b6e2243efa622b018c..104c6bab23d328cc13ac7299ca0bfd012c725be4 100644 (file)
@@ -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[:]
 
@@ -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 {
index 14ab33b0b6c9b4253280a3bb9f9f7ce032b224b7..2233961561230abe5b59188df68ab6267f3ed28e 100644 (file)
@@ -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
                }
index 37d995b1bdf8cab872e172210eb97af0a041434b..509579d21fe9cd170e8746981f796719a4dcd6c7 100644 (file)
@@ -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)
                                }
@@ -322,6 +322,9 @@ func walkstmt(n *Node) *Node {
        case ORETJMP:
                break
 
+       case OINLMARK:
+               break
+
        case OSELECT:
                walkselect(n)
 
@@ -461,8 +464,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 +485,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:
@@ -563,7 +566,6 @@ opswitch:
                n = walkinrange(n, init)
 
        case OPRINT, OPRINTN:
-               walkexprlist(n.List.Slice(), init)
                n = walkprint(n, init)
 
        case OPANIC:
@@ -623,7 +625,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 +669,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 +733,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 +789,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 +866,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 +892,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 +919,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 +958,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 +973,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 +1109,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 +1153,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 +1209,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 +1225,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 +1234,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 +1254,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)
@@ -1305,15 +1307,19 @@ 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, 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 +1353,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 +1369,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 +1382,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 +1394,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 +1406,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 +1420,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 +1450,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 +1461,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 +1481,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 +1513,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 +1674,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 +1739,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 +1760,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 +1936,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 +2060,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 +2085,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 +2216,8 @@ func varexpr(n *Node) bool {
                OAND,
                OANDNOT,
                OPLUS,
-               OMINUS,
-               OCOM,
+               ONEG,
+               OBITNOT,
                OPAREN,
                OANDAND,
                OOROR,
@@ -2315,7 +2321,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 +2369,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 +2404,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 +2427,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 +2597,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 +2721,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 +2738,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 +2791,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)
@@ -2856,6 +2862,7 @@ func extendslice(n *Node, init *Nodes) *Node {
        hasPointers := types.Haspointers(elemtype)
        if hasPointers {
                clrname = "memclrHasPointers"
+               Curfn.Func.setWBPos(n.Pos)
        }
 
        var clr Nodes
@@ -2871,7 +2878,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 +2977,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 +3050,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
@@ -3063,6 +3070,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)),
@@ -3188,12 +3196,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)
@@ -3300,9 +3308,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)
@@ -3489,7 +3497,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
@@ -3625,7 +3633,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)
@@ -3815,10 +3823,10 @@ func candiscard(n *Node) bool {
                OADDSTR,
                OADDR,
                OANDAND,
-               OARRAYBYTESTR,
-               OARRAYRUNESTR,
-               OSTRARRAYBYTE,
-               OSTRARRAYRUNE,
+               OBYTES2STR,
+               ORUNES2STR,
+               OSTR2BYTES,
+               OSTR2RUNES,
                OCAP,
                OCOMPLIT,
                OMAPLIT,
@@ -3846,9 +3854,9 @@ func candiscard(n *Node) bool {
                OANDNOT,
                ONEW,
                ONOT,
-               OCOM,
+               OBITNOT,
                OPLUS,
-               OMINUS,
+               ONEG,
                OOROR,
                OPAREN,
                ORUNESTR,
@@ -3916,19 +3924,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
 }
@@ -3969,5 +3977,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
 }
index acbe4a91de7273df88a246be5b42a5ed70bf78a4..eab60756ba77daaef9885e8f042f9a018468fb4e 100644 (file)
@@ -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
 }
index 2bf17dc4151d1fc59095f350165c63b1d969850d..97a9b20537de33cb262301879ed5347d4fdd2bc0 100644 (file)
@@ -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
 }
index a7e07d3740837a9aef395602e83e31f640842a82..80c1f0296c0bf09a1064772b06c3c4136cfe9781 100644 (file)
@@ -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
 }
index bf2076f5fb380d475e0bca93a0df9fc66e6a5318..8a2d2b0f7a4518e4bccf6555b5af1b50543d6e49 100644 (file)
@@ -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
 }
index ce805f4e0cf838ab5c99b0d416539b580c8ee3d2..da971d864dbe794307f92a69c69fd43ad21848ec 100644 (file)
@@ -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
index 5dda2d6e80ccc346bbe85de6e44d22fe7b8f6e82..ea66baa007da1802a344dc730d75870f3ca559bf 100644 (file)
@@ -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)
 }
index a6dd8cab5f50229507cb223c1ef85f95741a8d9b..3b37c797a99d55737ac599bb067e0de103994cad 100644 (file)
@@ -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")
                }
index 636ab16dd4ab4915333547d472a2750a15496fc4..6a72b27ac56826205107290c30b6d722c7943809 100644 (file)
@@ -104,10 +104,9 @@ func zeroAuto(pp *gc.Progs, n *gc.Node) {
        }
 }
 
-func ginsnop(pp *gc.Progs) {
-       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)
+func ginsnop(pp *gc.Progs) *obj.Prog {
+       p := pp.Prog(s390x.AWORD)
+       p.From.Type = obj.TYPE_CONST
+       p.From.Offset = 0x47000000 // nop 0
+       return p
 }
index e1901f2135c2867d92ef113459e24652a82bf37d..f9d3afa7457485184d5b9cbe41d910ba706f96f7 100644 (file)
@@ -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
index d9dcaf844430de9bfcc40c3e76f8880511e63df1..55430e8afc5631782940e69cba9bc4a73e2ce126 100644 (file)
@@ -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
                        }
                }
index 7f933cb66e0ea7be45670d1283329a2a58850b36..29618e29c37fc442efd22ffbd779e81b26400a61 100644 (file)
@@ -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()
@@ -365,6 +383,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
index 558c4b7db8fff9ea449d47872cb4f5d44b94ca97..5d7504392c05b3df363877572e060de33c553e5a 100644 (file)
@@ -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
index 13b7d7e1e84a6cff70a086ce83d2426b8aee8585..72cce448ce6cb894d7fb2a54f219bdce9003a389 100644 (file)
@@ -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 {
index 3d0be0fe1c8992d84a91676ffe12764fbdc5432f..c2736d837c931f5ee8acc8502aa348e644e6c045 100644 (file)
@@ -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
 }
 
@@ -826,21 +876,38 @@ 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.
+
+       var prevBlock *Block
        for _, b := range state.f.Blocks {
+               state.mergePredecessors(b, blockLocs, prevBlock)
+
                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
                }
 
-               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,13 +916,28 @@ 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)
+                       }
+               }
+
+               prevBlock = b
        }
 
        if state.loggingEnabled {
@@ -877,8 +959,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 +973,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 +992,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]
@@ -934,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)
index 4dc2eabb0cd83f0dacad0e1c51c16097fdfb7f1a..c59ec4c77d764db4189b227e2e033ff8c8131481 100644 (file)
@@ -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 {
index d73d39ce288f51d1c697704b4b1f79aa4415e9f8..7e7e2042d9da54ecccc14f9a6e390e22fc75821f 100644 (file)
@@ -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
index bd1339b43ab66376b12909566794dd031cc3d0e3..c2ed0ea1d95117560e69d33ebdf8566cba1ddc46 100644 (file)
@@ -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.
index 098e19c8a82642d2fab9dae369949c96d49d4553..db9c5bc63878b1e786854fd3161496cceb951910 100644 (file)
 (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)
index 70f4f0d616f75ae701bb18a9afe41e64bfc5bdf5..9c16c3543847feed48a33aa8e008137595bc5234 100644 (file)
 (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<<uint64(64-d) <= c -> (MOVVconst [1])
-(SGTUconst [c] (SRLVconst _ [d])) && 0 < d && d <= 63 && 1<<uint64(64-d) <= uint64(c) -> (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)
index 24cee6f0a3a02107316602b805661dffb6e37019..e5d5295908aabe7e2d69bfed2f2ef427655e49dd 100644 (file)
 (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 <t> 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 <t> x) && isSigned(t) -> (MOVHreg x)
 (Trunc(32|64)to16 x) -> (MOVHZreg x)
-(Trunc64to32 x) && isSigned(x.Type) -> (MOVWreg x)
+(Trunc64to32 <t> x) && isSigned(t) -> (MOVWreg x)
 (Trunc64to32 x) -> (MOVWZreg x)
 
 (Slicemask <t> x) -> (SRADconst (NEG <t> x) [63])
index de2c09c2d1de280edb90280d58adb96ef3db2212..0aeea535616833db1c7cafece7e221ef35823a0d 100644 (file)
 
 // Move more than 1024 bytes using a loop.
 (Move [s] dst src mem) && s > 1024 ->
-       (LoweredMove [s%256] dst src (ADDconst <src.Type> src [(s/256)*256]) mem)
+       (LoweredMove [s%256] dst src (ADD <src.Type> src (MOVDconst [(s/256)*256])) mem)
 
 // Lowering Zero instructions
 (Zero [0] _ mem) -> mem
index 9b4f66d3f172a24ffcc13c8b7c99a0f253ec2968..e0f2f92a3f70bcd342e3a92cd61b4e160083a7b7 100644 (file)
@@ -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,
diff --git a/src/cmd/compile/internal/ssa/gen/decArgs.rules b/src/cmd/compile/internal/ssa/gen/decArgs.rules
new file mode 100644 (file)
index 0000000..e9322b0
--- /dev/null
@@ -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 <typ.BytePtr> {n} [off])
+    (Arg <typ.Int> {n} [off+config.PtrSize]))
+
+(Arg {n} [off]) && v.Type.IsSlice() ->
+  (SliceMake
+    (Arg <v.Type.Elem().PtrTo()> {n} [off])
+    (Arg <typ.Int> {n} [off+config.PtrSize])
+    (Arg <typ.Int> {n} [off+2*config.PtrSize]))
+
+(Arg {n} [off]) && v.Type.IsInterface() ->
+  (IMake
+    (Arg <typ.Uintptr> {n} [off])
+    (Arg <typ.BytePtr> {n} [off+config.PtrSize]))
+
+(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 16 ->
+  (ComplexMake
+    (Arg <typ.Float64> {n} [off])
+    (Arg <typ.Float64> {n} [off+8]))
+
+(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 8 ->
+  (ComplexMake
+    (Arg <typ.Float32> {n} [off])
+    (Arg <typ.Float32> {n} [off+4]))
+
+(Arg <t>) && t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t) ->
+  (StructMake0)
+(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t) ->
+  (StructMake1
+    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]))
+(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t) ->
+  (StructMake2
+    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)])
+    (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)]))
+(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t) ->
+  (StructMake3
+    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)])
+    (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)])
+    (Arg <t.FieldType(2)> {n} [off+t.FieldOff(2)]))
+(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t) ->
+  (StructMake4
+    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)])
+    (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)])
+    (Arg <t.FieldType(2)> {n} [off+t.FieldOff(2)])
+    (Arg <t.FieldType(3)> {n} [off+t.FieldOff(3)]))
+
+(Arg <t>) && t.IsArray() && t.NumElem() == 0 ->
+  (ArrayMake0)
+(Arg <t> {n} [off]) && t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t) ->
+  (ArrayMake1 (Arg <t.Elem()> {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 (file)
index 0000000..b73d9d3
--- /dev/null
@@ -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,
+       })
+}
index 5a1bee0fa2469cf3282cefe4e15a019434301400..61451891a57e22edc44377beab8cf415d40267c4 100644 (file)
 (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 <typ.BytePtr> {n} [off])
-    (Arg <typ.Int> {n} [off+config.PtrSize]))
-
-(Arg {n} [off]) && v.Type.IsSlice() ->
-  (SliceMake
-    (Arg <v.Type.Elem().PtrTo()> {n} [off])
-    (Arg <typ.Int> {n} [off+config.PtrSize])
-    (Arg <typ.Int> {n} [off+2*config.PtrSize]))
-
-(Arg {n} [off]) && v.Type.IsInterface() ->
-  (IMake
-    (Arg <typ.Uintptr> {n} [off])
-    (Arg <typ.BytePtr> {n} [off+config.PtrSize]))
-
-(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 16 ->
-  (ComplexMake
-    (Arg <typ.Float64> {n} [off])
-    (Arg <typ.Float64> {n} [off+8]))
-
-(Arg {n} [off]) && v.Type.IsComplex() && v.Type.Size() == 8 ->
-  (ComplexMake
-    (Arg <typ.Float32> {n} [off])
-    (Arg <typ.Float32> {n} [off+4]))
-
-(Arg <t>) && t.IsStruct() && t.NumFields() == 0 && fe.CanSSA(t) ->
-  (StructMake0)
-(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t) ->
-  (StructMake1
-    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]))
-(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t) ->
-  (StructMake2
-    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)])
-    (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)]))
-(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t) ->
-  (StructMake3
-    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)])
-    (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)])
-    (Arg <t.FieldType(2)> {n} [off+t.FieldOff(2)]))
-(Arg <t> {n} [off]) && t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t) ->
-  (StructMake4
-    (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)])
-    (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)])
-    (Arg <t.FieldType(2)> {n} [off+t.FieldOff(2)])
-    (Arg <t.FieldType(3)> {n} [off+t.FieldOff(3)]))
-
-(Arg <t>) && t.IsArray() && t.NumElem() == 0 ->
-  (ArrayMake0)
-(Arg <t> {n} [off]) && t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t) ->
-  (ArrayMake1 (Arg <t.Elem()> {n} [off]))
-
 // strength reduction of divide by a constant.
 // See ../magic.go for a detailed description of these algorithms.
 
 // 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)
index ba8d93cf2cc6952f7b2f2ffd1ddaf04be3f5b010..89e6961bd79a556a3045683ced9c35c3e23bca80 100644 (file)
@@ -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
index 34517b4cb9aa81d9ea0a63a415f5fa0962dc4983..730e768ed64dc2bc92d97fe632ff59780907d7ed 100644 (file)
@@ -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)
        }
 
index d76d7c7b334650a80d2bc603746339d787ffc77d..1202987acc4a5e8874d4fc8210cb59d347a15357 100644 (file)
@@ -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
 }
@@ -173,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;
 }
@@ -211,6 +228,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 +272,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; }
+
 </style>
 
 <script type="text/javascript">
@@ -413,6 +461,38 @@ window.onload = function() {
         }
         td[i].style.display = 'table-cell';
     }
+
+    // find all svg block nodes, add their block classes
+    var nodes = document.querySelectorAll('*[id^="graph_node_"]');
+    for (var i = 0; i < nodes.length; i++) {
+       var node = nodes[i];
+       var name = node.id.toString();
+       var block = name.substring(name.lastIndexOf("_")+1);
+       node.classList.remove("node");
+       node.classList.add(block);
+        node.addEventListener('click', ssaBlockClicked);
+        var ellipse = node.getElementsByTagName('ellipse')[0];
+        ellipse.classList.add(block);
+        ellipse.addEventListener('click', ssaBlockClicked);
+    }
+
+    // make big graphs smaller
+    var targetScale = 0.5;
+    var nodes = document.querySelectorAll('*[id^="svg_graph_"]');
+    // TODO: Implement smarter auto-zoom using the viewBox attribute
+    // and in case of big graphs set the width and height of the svg graph to
+    // maximum allowed.
+    for (var i = 0; i < nodes.length; i++) {
+       var node = nodes[i];
+       var name = node.id.toString();
+       var phase = name.substring(name.lastIndexOf("_")+1);
+       var gNode = document.getElementById("g_graph_"+phase);
+       var scale = gNode.transform.baseVal.getItem(0).matrix.a;
+       if (scale > targetScale) {
+               node.width.baseVal.value *= targetScale / scale;
+               node.height.baseVal.value *= targetScale / scale;
+       }
+    }
 };
 
 function toggle_visibility(id) {
@@ -423,7 +503,88 @@ function toggle_visibility(id) {
         e.style.display = 'block';
     }
 }
-</script>
+
+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);
+    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;
+    }
+}</script>
 
 </head>`)
        w.WriteString("<body>")
@@ -431,7 +592,7 @@ function toggle_visibility(id) {
        w.WriteString(html.EscapeString(name))
        w.WriteString("</h1>")
        w.WriteString(`
-<a href="#" onclick="toggle_visibility('help');" id="helplink">help</a>
+<a href="#" onclick="toggle_visibility('help');return false;" id="helplink">help</a>
 <div id="help">
 
 <p>
@@ -449,6 +610,11 @@ Faded out values and blocks are dead code that has not been eliminated.
 Values printed in italics have a dependency cycle.
 </p>
 
+<p>
+<b>CFG</b>: 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.
+</p>
+
 </div>
 `)
        w.WriteString("<table>")
@@ -473,8 +639,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 +870,142 @@ func (b *Block) LongHTML() string {
        return s
 }
 
-func (f *Func) HTML() string {
-       var buf bytes.Buffer
-       fmt.Fprint(&buf, "<code>")
-       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, "<code>")
+       p := htmlFuncPrinter{w: buf}
        fprintFunc(p, f)
 
        // fprintFunc(&buf, f) // TODO: HTML, not text, <br /> for line breaks, etc.
-       fmt.Fprint(&buf, "</code>")
+       fmt.Fprint(buf, "</code>")
        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.String(), 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: %v\n%v\n", err, bufErr.String())
+               return
+       }
+
+       svgID := "svg_graph_" + id
+       fmt.Fprintf(w, `<div class="zoom"><button onclick="return graphReduce('%s');">-</button> <button onclick="return graphEnlarge('%s');">+</button></div>`, svgID, svgID)
+       // For now, an awful hack: edit the html as it passes through
+       // our fingers, finding '<svg ' and injecting needed attributes after it.
+       err = d.copyUntil(w, buf, `<svg `)
+       if err != nil {
+               fmt.Printf("injecting attributes: %v\n", err)
+               return
+       }
+       fmt.Fprintf(w, ` id="%s" onload="makeDraggable(evt)" `, svgID)
+       io.Copy(w, buf)
+}
+
+func (b *Block) unlikelyIndex() int {
+       switch b.Likely {
+       case BranchLikely:
+               return 1
+       case BranchUnlikely:
+               return 0
+       }
+       return -1
+}
+
+func (d *dotWriter) copyUntil(w io.Writer, buf *bytes.Buffer, sep string) error {
+       i := bytes.Index(buf.Bytes(), []byte(sep))
+       if i == -1 {
+               return fmt.Errorf("couldn't find dot sep %q", sep)
+       }
+       _, err := io.CopyN(w, buf, int64(i+len(sep)))
+       return err
+}
+
 type htmlFuncPrinter struct {
        w io.Writer
 }
@@ -722,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"
@@ -736,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, `<button onclick="hideBlock(this)">-</button>`)
+       }
        io.WriteString(p.w, "</li>")
        if len(b.Values) > 0 { // start list of values
                io.WriteString(p.w, "<li class=\"ssa-value-list\">")
@@ -752,7 +1045,6 @@ func (p htmlFuncPrinter) endBlock(b *Block) {
        fmt.Fprint(p.w, b.LongHTML())
        io.WriteString(p.w, "</li>")
        io.WriteString(p.w, "</ul>")
-       // io.WriteString(p.w, "</span>")
 }
 
 func (p htmlFuncPrinter) value(v *Value, live bool) {
@@ -780,3 +1072,63 @@ func (p htmlFuncPrinter) named(n LocalSlot, vals []*Value) {
        }
        fmt.Fprintf(p.w, "</li>")
 }
+
+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
+}
index 78d5dc77fed23e1e4540310552c94f8f95ef5731..338cd91c47feba7a81004aab8d989157a3e3b6d3 100644 (file)
@@ -143,5 +143,7 @@ blockloop:
                        }
                }
        }
+       f.laidout = true
        return order
+       //f.Blocks = order
 }
index 24f927f144edb386eb18f408be7078087fb29e82..ab0fa803bfdeab72c955c2db7ab97905c8144563 100644 (file)
@@ -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 {
index 0457e90b53c935b085f67ee3854b16d4a98167c7..12044111ea8b3cf7cbd86e5af9b17e095b20c881 100644 (file)
@@ -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)
index f2e17c606b50e718a8e30fd83f76836ff88997e2..5f58e2d7ec1efa3d58c227daccf05a7bded5499a 100644 (file)
@@ -5,6 +5,7 @@
 package ssa
 
 import (
+       "cmd/internal/objabi"
        "cmd/internal/src"
 )
 
@@ -47,7 +48,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
                        }
                }
@@ -182,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) {
@@ -224,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 {
@@ -281,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.
        }
 }
index 662f58e4b576690b24218bdab12ff09cfaba476f..3e14b9e3df38ac86e2fd116135cbac1fd6f8a6fa 100644 (file)
@@ -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.
index f6568be660f4e043087196fed2c6fed01fd7a424..2278407a260e7bb5a9008acdf5add81e4e401aac 100644 (file)
@@ -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,
index 0656bb45c59d848c7ce3686a591023b46a056c4d..1e5f4e9c6cce28530a14717913e20956a3df7ee9 100644 (file)
@@ -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)
index 7ddf215478707947c5553c6e7f8a26c89e3bd08b..a154249371a29117e4f429645895e07d9aa0fc65 100644 (file)
@@ -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
@@ -320,7 +334,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
@@ -1097,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":
@@ -1108,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
                        }
                }
        }
@@ -1123,12 +1141,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 {
@@ -1139,6 +1167,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 {
@@ -1149,6 +1180,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 {
index b6fb6c8b97fec0076746b034a828d998515fb03c..75b6de8055f3c35dd80edbc46576d091e232149a 100644 (file)
@@ -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
index 43d77c97a430897d22d21a93021abf2c21a5c0b9..b52e53f9d23405966db17d2409200c9a2b275696 100644 (file)
@@ -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
index 1e4b1ef0cf341b1596ba92fffd863d95e5153034..2afd0f335ea6455c8961a2e95bf681aa01ccb5cd 100644 (file)
@@ -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)
index e51398185259875ae12293690aba4ac5d25cb920..55bef5a792b2d7c7d3bd85d24e4ea17ca9b7efd0 100644 (file)
@@ -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
@@ -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)
index 04df5b8603d6b7c4e029343067119d694184794a..9e12780664d60a624e183687ba0e13753b6ef01c 100644 (file)
@@ -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(64-d) <= uint64(c)
+       // cond: 0 < d && d <= 63 && 0xffffffffffffffff>>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(64-d) <= uint64(c)) {
+               if !(0 < d && d <= 63 && 0xffffffffffffffff>>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(64-d) <= c
+       // cond: 0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>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(64-d) <= c) {
+               if !(0 <= c && 0 < d && d <= 63 && 0xffffffffffffffff>>uint64(d) < uint64(c)) {
                        break
                }
                v.reset(OpMIPS64MOVVconst)
index 9c89e0e674a4f12416decc19a18d3994d4884f2d..fdb34aec0aab082b7c66cb5a5bbad7e2d6712961 100644 (file)
@@ -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)
@@ -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 <t> 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 <t> 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 <t> 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 <t> 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 <t> 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 <t> 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)
index dce7a52529041e5200a14407093d5af8ff5d71b0..ce501a74efb4c7ebbaa5f91b04ff8d3afef93150 100644 (file)
@@ -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.Type> src [(s/256)*256]) mem)
+       // result: (LoweredMove [s%256] dst src (ADD <src.Type> 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
@@ -7835,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
@@ -8754,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
@@ -10882,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)
@@ -11537,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
@@ -11563,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
@@ -11977,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
@@ -12003,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
@@ -15357,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
@@ -15384,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
@@ -15411,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
@@ -15438,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
@@ -15465,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
@@ -15492,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
@@ -15519,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
@@ -15798,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
@@ -15825,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
@@ -15852,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
@@ -15879,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
@@ -15906,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
@@ -15933,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
@@ -15960,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
@@ -17995,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
@@ -18021,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
@@ -18491,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
@@ -18524,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
@@ -19069,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)
@@ -20935,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
@@ -20966,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
@@ -21465,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
@@ -21491,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
@@ -22038,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)
@@ -22871,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
@@ -23961,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
@@ -24010,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
@@ -24059,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
@@ -24115,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
@@ -24164,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
@@ -24213,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
@@ -24271,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)
@@ -24335,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)
@@ -24399,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)
@@ -24463,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)
@@ -24527,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)
@@ -24591,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)
@@ -24655,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)
@@ -24726,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)
@@ -28320,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)
@@ -28371,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)
@@ -28430,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)
@@ -28496,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)
@@ -28555,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
@@ -28612,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
@@ -28670,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)
@@ -28736,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)
@@ -28802,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)
@@ -28868,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)
@@ -28942,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)
@@ -29016,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)
@@ -29090,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)
@@ -29171,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)
@@ -33453,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
@@ -33502,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
@@ -33551,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
@@ -33600,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
@@ -33658,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)
@@ -33722,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)
@@ -33786,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)
@@ -33857,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)
@@ -35901,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)
@@ -35952,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)
@@ -36011,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
@@ -36068,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
@@ -36126,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)
@@ -36192,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)
@@ -36258,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)
@@ -36331,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)
@@ -38622,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
@@ -40521,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
@@ -41380,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/src/cmd/compile/internal/ssa/rewritedecArgs.go b/src/cmd/compile/internal/ssa/rewritedecArgs.go
new file mode 100644 (file)
index 0000000..6b82325
--- /dev/null
@@ -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 <typ.BytePtr> {n} [off]) (Arg <typ.Int> {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 <v.Type.Elem().PtrTo()> {n} [off]) (Arg <typ.Int> {n} [off+config.PtrSize]) (Arg <typ.Int> {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 <typ.Uintptr> {n} [off]) (Arg <typ.BytePtr> {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 <typ.Float64> {n} [off]) (Arg <typ.Float64> {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 <typ.Float32> {n} [off]) (Arg <typ.Float32> {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 <t>)
+       // 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 <t> {n} [off])
+       // cond: t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t)
+       // result: (StructMake1 (Arg <t.FieldType(0)> {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 <t> {n} [off])
+       // cond: t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t)
+       // result: (StructMake2 (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]) (Arg <t.FieldType(1)> {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 <t> {n} [off])
+       // cond: t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t)
+       // result: (StructMake3 (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]) (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)]) (Arg <t.FieldType(2)> {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 <t> {n} [off])
+       // cond: t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t)
+       // result: (StructMake4 (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]) (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)]) (Arg <t.FieldType(2)> {n} [off+t.FieldOff(2)]) (Arg <t.FieldType(3)> {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 <t>)
+       // 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 <t> {n} [off])
+       // cond: t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t)
+       // result: (ArrayMake1 (Arg <t.Elem()> {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
+}
index f16b571b2a0a40c63ef3b14d4f479369040b7347..f2c7529e024f7dd226f4f825805d982063012d09 100644 (file)
@@ -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 <typ.BytePtr> {n} [off]) (Arg <typ.Int> {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 <v.Type.Elem().PtrTo()> {n} [off]) (Arg <typ.Int> {n} [off+config.PtrSize]) (Arg <typ.Int> {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 <typ.Uintptr> {n} [off]) (Arg <typ.BytePtr> {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 <typ.Float64> {n} [off]) (Arg <typ.Float64> {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 <typ.Float32> {n} [off]) (Arg <typ.Float32> {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 <t>)
-       // 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 <t> {n} [off])
-       // cond: t.IsStruct() && t.NumFields() == 1 && fe.CanSSA(t)
-       // result: (StructMake1 (Arg <t.FieldType(0)> {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 <t> {n} [off])
-       // cond: t.IsStruct() && t.NumFields() == 2 && fe.CanSSA(t)
-       // result: (StructMake2 (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]) (Arg <t.FieldType(1)> {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 <t> {n} [off])
-       // cond: t.IsStruct() && t.NumFields() == 3 && fe.CanSSA(t)
-       // result: (StructMake3 (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]) (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)]) (Arg <t.FieldType(2)> {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 <t> {n} [off])
-       // cond: t.IsStruct() && t.NumFields() == 4 && fe.CanSSA(t)
-       // result: (StructMake4 (Arg <t.FieldType(0)> {n} [off+t.FieldOff(0)]) (Arg <t.FieldType(1)> {n} [off+t.FieldOff(1)]) (Arg <t.FieldType(2)> {n} [off+t.FieldOff(2)]) (Arg <t.FieldType(3)> {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 <t>)
-       // 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 <t> {n} [off])
-       // cond: t.IsArray() && t.NumElem() == 1 && fe.CanSSA(t)
-       // result: (ArrayMake1 (Arg <t.Elem()> {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:
@@ -27652,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
@@ -27680,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)
@@ -27692,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
@@ -27720,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)
index e7ad5ac900e2c2a405914b5b5c67e31ba31b3ca5..c5b4c538434f97a1eb6666bd1aab12637c86ef1c 100644 (file)
@@ -4,7 +4,10 @@
 
 package ssa
 
-import "container/heap"
+import (
+       "container/heap"
+       "sort"
+)
 
 const (
        ScorePhi = iota // towards top of block
@@ -59,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
@@ -89,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
@@ -186,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.
@@ -447,5 +458,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) }
index b41819c6ad50a0f961cdb41d180b7b3bbbd322c5..4b578b133b567334341a73bd62854eaef5cfd9fa 100644 (file)
@@ -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)
+                               }
                        }
                }
        }
index 6fc0239ffe4d756363e6488984d716e06d999c4a..c71f8befd9d295df3e0c20a780166595ac3e9d69 100644 (file)
@@ -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"
index 89d0b1b6373fc64032088049aaa2636284be147d..1e4d35051b6b3e912969509399a82c723d832b6a 100644 (file)
@@ -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)
 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 {
 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 {
index b2f32167078a69128bbc1d49b6da962bac52507d..65c5d0a2cee417096ca1944e1bd3be610865c33d 100644 (file)
@@ -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 {
index 3cc2ec5121d49d44a10c27e7dd786b4e66ee6c72..b5e41aa906e8c131ee887a5351cbd14152a41ab6 100644 (file)
@@ -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:    }
index a66eab83cd38837c960d128d50f8808da4847baa..5a186b5440b512fd4d7137b38e570917ff88a045 100644 (file)
@@ -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)
index 3713269376977942b1c683ec7a08bf1fbea9993a..580a06dfde588062e479e15c4ababd0fe4462545 100644 (file)
@@ -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
                        }
index 7e869f29c9211298b0b50aca653640c8c347e8bf..6e35a3c7773d649c2927d6768140d42837dbee2a 100644 (file)
@@ -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)
 }
index 2366e0bfbf358c2757891bb64abfa9925cdf39cd..1024ab25abf8a8d480ed6c31aee5af1e0ca56a74 100644 (file)
@@ -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)
@@ -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 {
index 62eb0fdc30140988ca4333183b75c775cbd94f3d..c6168b8594f744571e6ef2a2dac9934f7f0b0c61 100644 (file)
@@ -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
 }
 
index 21524852579833046a80a528b391b5c88339027f..7c14a03ba16dd6914372574d34240923d6ede179 100644 (file)
@@ -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
                                }
                        }
index b7fd7ae9fbbbe3f84fe148d1017ce333bcef41d8..13761c7615b401764b79f4ea0ff060b8f632961e 100644 (file)
@@ -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 == "_"
@@ -74,6 +77,10 @@ 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.LookupABI(sym.LinksymName(), obj.ABIInternal)
+       }
        return Ctxt.Lookup(sym.LinksymName())
 }
 
index 45355e5798ce35a2eb57f19b8a134b03b0f5aae2..3e5f5cbf4949f3ce943cd45c056403f06fe6515f 100644 (file)
@@ -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
@@ -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 {
index d82b1f7953ddeab8b901e473428351cdbc8436c7..6e6dc557b4937a17356b8a195141ff739128fa50 100644 (file)
@@ -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:
index ef380bd74067b501d4bc82052626b87ca47a4b54..1851af57c4bd7b8647f6db790b12b75e59522db2 100644 (file)
@@ -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
 }
index 54cf4be25ec7ffdb92e35172431dbec56c4bb03b..0348849578bb1ad0f436186b72d36964c11bbd6d 100644 (file)
@@ -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("-var: %q is not a valid identifier", *varVar)
+       }
+
        if *mode != "" {
                switch *mode {
                case "set":
@@ -641,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)
        }
 
@@ -676,3 +693,27 @@ func (f *File) addVariables(w io.Writer) {
                fmt.Fprintf(w, "var _ = %s.LoadUint32\n", atomicPackageName)
        }
 }
+
+func isValidIdentifier(ident string) bool {
+       if len(ident) == 0 {
+               return false
+       }
+       for i, c := range ident {
+               if i > 0 && unicode.IsDigit(c) {
+                       continue
+               }
+               if c == '_' || unicode.IsLetter(c) {
+                       continue
+               }
+               return false
+       }
+       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
+}
index 8eb7124aad85b69c33195315e897567cb1f94899..3de9b0c12d7ea64dd18440b879a6106ff7da5cb8 100644 (file)
@@ -19,43 +19,149 @@ 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.
-       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")
+       // Input files.
+       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.
-       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
+       htmlUDir     string
+       htmlU        string
+       htmlUTest    string
+       htmlUProfile string
+       htmlUHTML    string
+)
+
+var (
+       // testTempDir is a temporary directory created in TestMain.
+       testTempDir string
+
+       // testcover is a newly built version of the cover program.
+       testcover string
+
+       // 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")
 
+// 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")
+       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()
+
+       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() {
+               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 or toolexec 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 +187,28 @@ 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)
+       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")
+       }
 
-       // 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 +236,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 +248,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 +355,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 +376,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", toolexecArg, "-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 +408,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)
@@ -329,11 +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()
-       c.Stdout = os.Stdout
-       c.Stderr = os.Stderr
-       err := c.Run()
+       t.Log("running", c.Args)
+       out, err := c.CombinedOutput()
+       if len(out) > 0 {
+               t.Logf("%s", out)
+       }
        if err != nil {
                t.Fatal(err)
        }
diff --git a/src/cmd/cover/testdata/toolexec.go b/src/cmd/cover/testdata/toolexec.go
new file mode 100644 (file)
index 0000000..1769efe
--- /dev/null
@@ -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)
+       }
+}
index 49f4a5e6a7d6a8d31dc4bb9cf2dfc6c96c98f78c..ad2c96436a069d3510ba0cc191b44994891ca5b5 100644 (file)
@@ -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)], "-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)
+               }
+               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,29 @@ 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 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 len(sfiles) > 0 {
+               compile = append(compile, "-asmhdr", goasmh)
        }
+       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
        // We use bgrun and immediately wait for it instead of calling run() synchronously.
@@ -815,31 +861,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))
@@ -1424,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,
@@ -1434,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":
@@ -1552,6 +1583,9 @@ func cmdlist() {
 
        var plats []string
        for p := range cgoEnabled {
+               if incomplete[p] {
+                       continue
+               }
                plats = append(plats, p)
        }
        sort.Strings(plats)
index 10d1552c944d27bdf53473e2925c6f9574b74b95..5aadc8da674ff93c70467518e486c05332ea1132 100644 (file)
@@ -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 = <goextlinkenabled>
 //     const version = <version>
-//     const stackGuardMultiplier = <multiplier value>
+//     const stackGuardMultiplierDefault = <multiplier value>
 //     const goexperiment = <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
index 2db115e20ede7d318a21e452d108b527ca37c91a..71ed4ba8bc7c10e296046901f1e10adac638f90a 100644 (file)
@@ -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",
index bf08869afb7f2565bfa0c72f08ba2d10f3e49f79..bab8ab781ab677e5b0a1ed3f3fade778ff614d0f 100644 (file)
@@ -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")
index 2d7f7bd2f9abf319c971c00104890a849866de20..74cee8f42169bcbbf8326b3e081d86039bf7c737 100644 (file)
@@ -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 {
@@ -519,7 +522,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 +531,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 {
@@ -1038,7 +1039,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")
 
@@ -1470,7 +1474,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:
index 808a60a28e2c1dba7e533f8ff2e7a212cdec754f..996e058b31822db93ec0de982946216fbd6d0605 100644 (file)
@@ -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"
        }
 
index 24bd797eb51f9f9f0d71450514179c64ed2b91ae..c6f5cd9af8516289f336e25dec18128351398869 100644 (file)
@@ -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 {
diff --git a/src/cmd/fix/egltype.go b/src/cmd/fix/egltype.go
new file mode 100644 (file)
index 0000000..c8c4f03
--- /dev/null
@@ -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 (file)
index 0000000..35ffe92
--- /dev/null
@@ -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}
+`,
+       },
+}
index f8c4d2ffa912f43652333433b49f39b1c952fdce..186f42156a2efd2ed2273ab49f718153bcbcf09b 100644 (file)
 // 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.
 //
 // 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'.
 // 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.
 //
 // 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:
 //
 //             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:
 //
 // 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
 // (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.
 // 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
index faf6b392fe3e147fc651ce2306a4b7ebd4536c60..5e186298590964005c15bc84600834f015276819 100644 (file)
@@ -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) {
@@ -1207,22 +1246,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)
@@ -1787,11 +1810,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)
@@ -5035,7 +5058,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")
@@ -5566,30 +5590,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)
@@ -5739,17 +5739,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.
@@ -6131,28 +6120,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")
index 0cf01550ff90d0d2967a6f481982868bc20eebd5..ab84cf6302c0d1ec952db6dc0a53bfb7a84aad8e 100644 (file)
@@ -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
        }
index 4a69bf2a443c989bdbcfb81e0f62ef9080094206..f545c147009f247e3dbc25c76efe68940391bc11 100644 (file)
@@ -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,15 @@ 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()
-       if dir == "off" {
-               return
+       dir := DefaultDir()
+       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 {
-               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,45 +53,40 @@ 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
 }
 
+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, _ := defaultDir()
-       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.
 
-// 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
-       }
+       defaultDirOnce.Do(func() {
+               defaultDir = os.Getenv("GOCACHE")
+               if defaultDir != "" {
+                       return
+               }
 
-       // Compute default location.
-       dir, err := os.UserCacheDir()
-       if err != nil {
-               return "off", true
-       }
-       dir = filepath.Join(dir, "go-build")
+               // 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")
+       })
 
-       // 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
-       }
-       return dir, showWarnings
+       return 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 (file)
index 1458201..0000000
+++ /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 /")
-       }
-}
index b12bd981a70a038e62299549580147e731dbdcd5..27121ed2ae679b1cfc155852065aca41622bfd3c 100644 (file)
@@ -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"
@@ -103,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)
                }
@@ -146,7 +145,22 @@ 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 {
+                                               if _, err = f.Seek(0, 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)
                        }
@@ -161,27 +175,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.
index 85a42e0519ad6917ce7827e32916ef5c116a5c22..ae98d3999a1fa429c8105aa0968b00d3a2812545 100644 (file)
@@ -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},
index aab164148ff88a62424db7818d0584fb675c2daf..4d741df2b4f1a6a83c0a16705f69ef28f81163f2 100644 (file)
@@ -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
index 9482be98aefb5c716e0ef995829e69e206a1cfa6..124dbc05f5d8f3fa6eee4ce6e7ee0b40ce9fce8f 100644 (file)
@@ -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.
@@ -161,7 +164,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
index e4148bceb048472d743cdd17d1e88e8aba10ef65..a314c57160b396203d8db3638c150d31ea908392 100644 (file)
@@ -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,6 +402,23 @@ func downloadPackage(p *load.Package) error {
                security = web.Insecure
        }
 
+       // 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)
+       }
+
        if p.Internal.Build.SrcRoot != "" {
                // Directory exists. Look for checkout along path to src.
                vcs, rootPath, err = vcsFromDir(p.Dir, p.Internal.Build.SrcRoot)
@@ -421,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)
@@ -438,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/path.go b/src/cmd/go/internal/get/path.go
new file mode 100644 (file)
index 0000000..d443bd2
--- /dev/null
@@ -0,0 +1,192 @@
+// 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,
+// 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 {
+       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)
+               }
+       }
+
+       // 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
+}
+
+// pathOK reports whether r can appear in an import path element.
+//
+// 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 == '~' ||
+                       '0' <= r && r <= '9' ||
+                       'A' <= r && r <= 'Z' ||
+                       'a' <= r && r <= 'z'
+       }
+       return unicode.IsLetter(r)
+}
+
+// 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",
+}
index 173934b84ec96d4f435953f9d0fa88d9e3ab74cf..a7a2ba32cc33cbe0baebb7152cbe78a646abf8ae 100644 (file)
@@ -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
@@ -963,10 +957,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
index e2c4e61615bcc7c63539101ba68ec2d2ee44df52..c219a45d74948004b1c9f1febc591ce13cb0d1b4 100644 (file)
@@ -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.
@@ -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:
 
@@ -546,6 +544,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:
 
@@ -634,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.
        `,
 }
 
@@ -703,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.
index d944e95724e54244e28f9694e8dbb6780db18f3d..966a38cfef3adf2ad353ba0c6eab85b9493f46a2 100644 (file)
@@ -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))
                }
index afb70a540cb5857f8bca49937aa07aeddccac1da..49bd98216c6dbfbe2df8e42e1711326f6fc63b69 100644 (file)
@@ -1003,10 +1003,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]
@@ -1057,20 +1059,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
        }
@@ -1349,6 +1337,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)
                }
@@ -1534,9 +1523,13 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
        }
 
        if cfg.ModulesEnabled {
-               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)
                }
        }
 }
@@ -1786,9 +1779,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)
@@ -2006,11 +1996,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
index bb9568d07e32d3f8a6d23f72e078e9e0bab6bc25..bd6f00bb669fb3ca9bd89267f2ac8a2943788c3e 100644 (file)
@@ -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/internal/lockedfile/internal/filelock/filelock.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock.go
new file mode 100644 (file)
index 0000000..aba3eed
--- /dev/null
@@ -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_fcntl.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_fcntl.go
new file mode 100644 (file)
index 0000000..2831975
--- /dev/null
@@ -0,0 +1,159 @@
+// 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 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,
+// 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 for AIX
+// or 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_other.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_other.go
new file mode 100644 (file)
index 0000000..107611e
--- /dev/null
@@ -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 !aix,!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 (file)
index 0000000..afdffe3
--- /dev/null
@@ -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_test.go b/src/cmd/go/internal/lockedfile/internal/filelock/filelock_test.go
new file mode 100644 (file)
index 0000000..aa67093
--- /dev/null
@@ -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 !js,!nacl,!plan9
+
+package filelock_test
+
+import (
+       "fmt"
+       "internal/testenv"
+       "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" || 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
+               // 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" && runtime.GOOS != "aix" {
+               unlock(t, f)
+       }
+       lockOther(t)
+       unlock(t, other)
+}
+
+func TestLockNotDroppedByExecCommand(t *testing.T) {
+       testenv.MustHaveExec(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 (file)
index 0000000..00c4262
--- /dev/null
@@ -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 (file)
index 0000000..43e85e4
--- /dev/null
@@ -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 (file)
index 0000000..bb184b1
--- /dev/null
@@ -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 (file)
index 0000000..f63dd86
--- /dev/null
@@ -0,0 +1,64 @@
+// 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 {
+               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() {
+                               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 (file)
index 0000000..4a52c94
--- /dev/null
@@ -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 (file)
index 0000000..6d5819e
--- /dev/null
@@ -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) = <nil>", 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) = <nil>", 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 (file)
index 0000000..17f3751
--- /dev/null
@@ -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
+}
index 8678caea516735c46df3372bf380d3a1a0095207..bbaba444f507f64c5ca647f559894a08b10eae5d 100644 (file)
@@ -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()
        }
 }
index c589c6d4edff7d6b1d2250c1097db1ee21cdaa36..5066e4ddf75f97394c44549dda8113f72f7ca32e 100644 (file)
@@ -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"
@@ -155,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 != "" {
@@ -182,7 +183,7 @@ func runEdit(cmd *base.Command, args []string) {
        }
 
        if *editModule != "" {
-               modFile.AddModuleStmt(modload.CmdModModule)
+               modFile.AddModuleStmt(*editModule)
        }
 
        if *editGo != "" {
@@ -204,17 +205,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)
        }
 }
index f510a46262b4eb95c619c94043bed5ee7a5ef0a3..0f7421e5849f2f934c94ece4e58ff1793e1161f1 100644 (file)
@@ -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
 }
index f2063a9ea601c976d596c9581aed7144db2f605d..839c92a0a02b4433aa44a2c847b0b5ed9df48957 100644 (file)
@@ -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] {
index 7bd1d0b5718b82aef68d8b526a4b30b9c39d6a22..b70f25cec3952f6a515d82d08f45a8e3e58cb4a0 100644 (file)
@@ -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)
        }
index 1f9cc96c3ec80858ff299b959e9b715438333596..1ccd43dc2ae845d859f2c2d9447c00ed8003ca1a 100644 (file)
@@ -8,15 +8,18 @@ import (
        "bytes"
        "encoding/json"
        "fmt"
+       "io"
        "io/ioutil"
        "os"
        "path/filepath"
        "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"
 )
 
@@ -53,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")
@@ -74,6 +79,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
@@ -129,16 +165,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)
@@ -213,8 +251,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
@@ -383,7 +421,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.
@@ -449,22 +487,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
        }
 
@@ -481,8 +505,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 {
@@ -511,12 +545,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)
+       }
 }
index 4205cd26bda11d4e4ae8e9bc209c0b016bacc00e..6c17f7886f19e5aea14f17675eb6772dd28156ae 100644 (file)
@@ -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,19 +186,20 @@ 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 {
-       Cmd    string
-       Err    error
-       Stderr []byte
+       Cmd      string
+       Err      error
+       Stderr   []byte
+       HelpText string
 }
 
 func (e *RunError) Error() string {
@@ -187,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
 }
 
index bcf86098262513a40022338829bf13a083fce7de..588e7496cc50362ddbce4304d84fc36a8311d970 100644 (file)
@@ -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
@@ -154,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
        }
@@ -304,11 +319,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 +510,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 +676,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 +699,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 +715,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
        }
index 9e862a0ef8c0d2059d7bce82d02a49a2ee70d26d..59c2b15d19a06c4fb6b525f45ca3cf7db68be201 100644 (file)
@@ -18,6 +18,7 @@ import (
        "sync"
        "time"
 
+       "cmd/go/internal/lockedfile"
        "cmd/go/internal/par"
        "cmd/go/internal/str"
 )
@@ -27,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
@@ -56,6 +64,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 +91,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 +289,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 +308,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
        }
@@ -315,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))
 }
@@ -332,6 +363,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 +379,42 @@ 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) {
-       return nil, fmt.Errorf("ReadFileRevs not implemented")
+       // 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, vcsErrorf("ReadFileRevs not implemented")
 }
 
 func (r *vcsRepo) RecentTag(rev, prefix string) (tag string, err error) {
-       return "", fmt.Errorf("RecentTags not implemented")
+       // 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 "", 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
+       }
+       defer unlock()
+
        if rev == "latest" {
                rev = r.cmd.latest
        }
@@ -392,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
@@ -401,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
@@ -430,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{
@@ -471,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{
@@ -504,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
@@ -524,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)
 }
index 9cf0e911508c01eb076a8e881919f55dd8a00a38..5018b6d8af7c7f7f7d4690277ac572f4649d3965 100644 (file)
@@ -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,17 @@ func (r *codeRepo) Zip(version string, tmpdir string) (tmpfile string, err error
                        name = dir[:len(dir)-1]
                }
        }
+
        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 {
-                               return "", fmt.Errorf("missing top-level directory prefix")
+                               return fmt.Errorf("missing top-level directory prefix")
                        }
                        topPrefix = zf.Name[:i+1]
                }
@@ -509,7 +505,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 +525,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 +555,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
index 73c4bd2ccab9d0602d827881586fffc22e495303..c93d8dbe44284f84eef58d0a7dc35f00179c8189 100644 (file)
@@ -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",
        },
        {
@@ -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 {
index 8485932b42fca538fbfbf00c4fffc904d96bbbc8..81a6c843abccf5c3fb211b934fb00ad56506c39d 100644 (file)
@@ -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,88 @@ 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
+       }
+
+       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
 
 // 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,83 +145,134 @@ 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)
+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
+                       }
+               }
+       }
+
+       // 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
        }
-       tmpfile, err := repo.Zip(mod.Version, os.TempDir())
+       defer func() {
+               if err != nil {
+                       f.Close()
+                       os.Remove(f.Name())
+               }
+       }()
+
+       repo, err := Lookup(mod.Path)
        if err != nil {
                return err
        }
-       defer os.Remove(tmpfile)
+       if err := repo.Zip(f, mod.Version); err != nil {
+               return err
+       }
 
-       // Double-check zip file looks OK.
-       z, err := zip.OpenReader(tmpfile)
+       // 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
        }
-       prefix := mod.Path + "@" + mod.Version
+       z, err := zip.NewReader(f, 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, f.Name)
+                       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)
-       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
-       r, err := os.Open(tmpfile)
-       if err != nil {
+       if err := f.Close(); err != nil {
                return err
        }
-       defer r.Close()
-       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, r); 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
 }
@@ -173,18 +289,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
@@ -197,7 +320,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
@@ -221,7 +344,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])
        }
 }
 
@@ -235,7 +358,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 {
@@ -243,11 +366,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)
@@ -265,7 +388,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)
@@ -275,22 +398,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,
@@ -316,10 +444,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)
@@ -334,15 +507,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
        }
 }
 
@@ -360,6 +534,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
                }
        }
 }
index 7c78502f318d7d490e78f79a2dc0db174a342932..60ed2a37966067dc9f9647facbe9c6aed9749a00 100644 (file)
@@ -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.
index 0ea8c1f0e35e8d00da36ca56c7beb7fd25ebb846..c63f6b04221dd570a7e4e8d34a79a83b27995e18 100644 (file)
@@ -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)
 }
index a50431fd8629de18f4cd9b2f1f5ee1b790852bf9..ac13ede257b61dde833b4e636355978031af1089 100644 (file)
@@ -12,7 +12,6 @@ import (
        "os"
        "path"
        "path/filepath"
-       "sort"
        "strings"
 
        "cmd/go/internal/modfetch/codehost"
@@ -21,12 +20,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)
@@ -98,22 +97,16 @@ 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
                }
-               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)
                }
@@ -137,17 +130,44 @@ 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-- {
-               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
+// 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)
 }
index ffc9a12f9536438576bc7e4c2f00008bd0bf5d37..17a0ed45e21b4ed780d763bf03a639e0b0674bd6 100644 (file)
@@ -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
@@ -281,8 +282,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.
@@ -534,9 +535,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
index 76068069087f784dd287a978973c71a4128d7726..2a8be90b78f542de486af40749d0e6b8dd2e5059 100644 (file)
@@ -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
        }
@@ -117,7 +120,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 +174,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)
@@ -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")
@@ -244,13 +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.
-       // 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.
+       //
+       // 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__ = ""
-func init() { __debug_modinfo__ = %q }
+var __debug_modinfo__ = %q
+var keepalive_modinfo = __debug_modinfo__
+func init() { keepalive_modinfo = __debug_modinfo__ }
        `, string(infoStart)+info+string(infoEnd)))
 }
index 44c2a2372670b5c50eb008db4a8b6769d0ec0481..3210e16c25b084be98d6066a0dbc2c0a18e5dc35 100644 (file)
@@ -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 {
@@ -58,9 +62,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
@@ -70,8 +71,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)
                }
@@ -125,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 {
index da778b4fad413b5eef565b2132dc32a8295aceb1..22d14ccce78b241d780ee526754bd3ca8510144a 100644 (file)
@@ -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"
@@ -25,20 +26,21 @@ import (
        "path"
        "path/filepath"
        "regexp"
-       "runtime"
+       "runtime/debug"
        "strconv"
        "strings"
 )
 
 var (
-       cwd            string
+       cwd            string // TODO(bcmills): Is this redundant with base.Cwd?
        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
 
@@ -55,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")
 }
 
@@ -75,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
@@ -140,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")
@@ -149,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
@@ -179,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() {
@@ -192,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'")
        }
@@ -233,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: "command-line-arguments"}
+               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()
@@ -268,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) {
@@ -286,10 +345,11 @@ 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.
-               path, err := FindModulePath(ModRoot)
+               path, err := FindModulePath(modRoot)
                if err != nil {
                        base.Fatalf("go: %v", err)
                }
@@ -327,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)
                }
@@ -339,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]
@@ -402,7 +462,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 +480,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
                                }
                        }
@@ -564,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)
@@ -580,22 +645,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) {
index 69a832de1df52670af413d8ee7c9c526f472f7c4..2f1a3c24d223cf007299bf5a049b139e9ba97b04 100644 (file)
@@ -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{
index 3b8c0b6435f56ebf7189905dd753b2bac7740632..5bb943dd6decb88f5f24c6c8d59c3614055c9a25 100644 (file)
@@ -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)
@@ -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,24 +118,21 @@ func ImportPaths(patterns []string) []*search.Match {
                                        } else {
                                                pkg = ""
                                                if !iterating {
+                                                       ModRoot()
                                                        base.Errorf("go: directory %s outside available modules", base.ShortPath(dir))
                                                }
                                        }
                                        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, "..."):
@@ -251,17 +248,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 +811,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 +888,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 +918,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 +938,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 +1053,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
                }
index 40713413131ae550837112774fe19c3831ed341b..0856486c212c237e81be477c660e5f1ee8c28b24 100644 (file)
@@ -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
index 24825cc35d8a373582a28d1c9c8895cc2c54464f..7d8852d01d7f7e172d3800b643ebfbf637c103e1 100644 (file)
@@ -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 (file)
index 0000000..663b24a
--- /dev/null
@@ -0,0 +1,11 @@
+// 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 testgo
+
+package modload
+
+func init() {
+       printStackInDie = true
+}
index 1dbb0f5cb7996ccf530332d6f20fdc26509f9690..481a90b1c46d3548545f0be070fe7cca22160ccf 100644 (file)
@@ -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
@@ -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:]
index f21d620d328f8bf4425542a672494f2eb32ec301..b40bd03dfa65bc679c3f9044b4ca723a57da98d2 100644 (file)
@@ -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"},
diff --git a/src/cmd/go/internal/renameio/renameio.go b/src/cmd/go/internal/renameio/renameio.go
new file mode 100644 (file)
index 0000000..8f59e1a
--- /dev/null
@@ -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)
+}
index 303e6842e7be3eb90b8268dae5c155b40e188886..feccf23b2782a868fbf822be029935a959d765ff 100644 (file)
@@ -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 {
index d61c6b476a6781ba5644df8e1f446c401892b121..122e612dd4b8f0b62445a2430f73a04d0c229086 100644 (file)
@@ -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] == '.' {
@@ -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) {
index 96b64a58075498a0f9d68d810414addd3f67587e..77025a44abd60a36f8e21eeb000b71f5e8d62409 100644 (file)
@@ -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) {
index b38eb4c41dafa3127c5e31d05e4bc456ea6b052b..8dfb3df22d3b9ed4ba93d0b22d16b1550dbdac1a 100644 (file)
@@ -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)
                        }
index 616f774bf64592205c6d25c2949ee7361230d58e..327b761c3cd6bf68858804b3c17a409acf24c95b 100644 (file)
@@ -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
index 9b5184a4d4ef89a0bbfac15bc4285dedc541ea3b..37342f41633420dd90d530f006021b24519ed029 100644 (file)
@@ -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)
+}
index f3900379e1784fd8774d0902872864e513b2f874..64934f1d506dbfa4142550a57656a8816dec75c4 100644 (file)
@@ -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()))
                }
        }
 
index 010e17ee480578be4f6be3371fa9042ad5ee355e..ef95a408ca31bbc7fddbcef31aac019853bc41fe 100644 (file)
@@ -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", "js":
+               t.Skip("chown/chmod setgid are not supported on Windows, Plan 9, or JS")
        }
 
        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.
index c5aa1db50b8d6077c7d31158f4c8551681f291f1..750bc3c6cdbe450e5c6e87bd953bd174a61ee974 100644 (file)
@@ -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()
index 92e814ee6f26593b63f9b5b3c3ada16b8f3a1938..baa587268744f6913b854dc2000f47b6a8e4fa4d 100644 (file)
@@ -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).
@@ -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
                }
@@ -575,7 +582,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 +600,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
@@ -601,6 +614,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 +651,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) {
@@ -788,13 +807,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("./")
@@ -809,7 +828,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 {
@@ -817,34 +836,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
        }
@@ -869,10 +888,12 @@ func (b *Builder) loadCachedGoFiles(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")
        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
@@ -884,15 +905,28 @@ 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
        // 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),
+               NonGoFiles:  mkAbsFiles(a.Package.Dir, nongofiles),
                ImportPath:  a.Package.ImportPath,
                ImportMap:   make(map[string]string),
                PackageFile: make(map[string]string),
@@ -989,6 +1023,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"
@@ -1612,6 +1648,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"
@@ -1967,13 +2022,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 +2064,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 +2072,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 +2759,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
index 5a0bd1c2cf1089b8acd64fbf0f814a5da62f67ca..3d09f69fcc3e43698dbb8182695bb4f4746247f9 100644 (file)
@@ -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 {
@@ -171,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
        }
 
@@ -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,88 @@ 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) {
+       mkSymabis := func(p *load.Package, sfiles []string, path string) error {
+               args := asmArgs(a, p)
+               args = append(args, "-gensymabis", "-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.
+               // -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
+               }
+
+               return b.run(a, p.Dir, p.ImportPath, nil, args...)
+       }
+
+       var symabis string // Only set if we actually create the file
+       p := a.Package
+       if len(sfiles) != 0 {
+               symabis = a.Objdir + "symabis"
+               if err := mkSymabis(p, sfiles, symabis); err != nil {
+                       return "", err
+               }
+       }
+
+       // Gather known cross-package references from assembly code.
+       var otherPkgs []string
+       if p.ImportPath == "runtime" {
+               // Assembly in the following packages references
+               // symbols in runtime.
+               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.
+               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
+               }
+
+               // 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
+               }
+               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
+}
+
 // 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.
index b89d07ead0a3890dc34ecae5d1db7df48e223f0a..69a25bea62ff449894c996bd985bdc0735f094b6 100644 (file)
@@ -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
@@ -51,7 +59,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 +180,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)
@@ -179,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
@@ -194,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 {
@@ -253,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
                }
@@ -469,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
                }
        }
index 3f6252ed84b7f32ba5bab76cc42b5a6a6f457811..693a53e9ab78d012f493bb619f5471f6c2d1f9ed 100644 (file)
@@ -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)
                }
        }
@@ -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",
index 6a188262cce6752ccaca53044c8a9ef678036082..4f8ab7f55a9ebce3e3048e8a83c94bbb4a6a9385 100644 (file)
@@ -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":
index 97fc4b0e80735c2b45f78fd505d1db929eb66bd3..830cea029b7ac2ef4787fa8b22f91170296aacfa 100644 (file)
@@ -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}
                                }
index 31ddf02fb0a00b93138b51fdacf886be6d5a8b43..c56c1fd3e42a13db956a458ade78f9e53118deea 100644 (file)
@@ -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.
@@ -274,12 +275,19 @@ Script:
                                ok = testenv.HasExternalNetwork()
                        case "link":
                                ok = testenv.HasLink()
+                       case "root":
+                               ok = os.Geteuid() == 0
                        case "symlink":
                                ok = testenv.HasSymlink()
                        default:
                                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)
@@ -341,7 +349,9 @@ Script:
 //
 var scriptCmds = map[string]func(*testScript, bool, []string){
        "addcrlf": (*testScript).cmdAddcrlf,
+       "cc":      (*testScript).cmdCc,
        "cd":      (*testScript).cmdCd,
+       "chmod":   (*testScript).cmdChmod,
        "cmp":     (*testScript).cmdCmp,
        "cmpenv":  (*testScript).cmdCmpenv,
        "cp":      (*testScript).cmdCp,
@@ -375,6 +385,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 {
@@ -400,6 +421,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/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 (file)
index 0000000..7d9d130
--- /dev/null
@@ -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/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 (file)
index 0000000..bae8b13
--- /dev/null
@@ -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 (file)
index 0000000..2467418
--- /dev/null
@@ -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 (file)
index 0000000..d8c45b5
--- /dev/null
@@ -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 (file)
index 0000000..3bfdb0e
--- /dev/null
@@ -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 (file)
index 0000000..8109a9a
--- /dev/null
@@ -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/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 (file)
index 0f060dc..0000000
+++ /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())
-}
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 (file)
index 0000000..07a38fa
--- /dev/null
@@ -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.
index 22124b9fb89c663d569b85043b8510cb409f409d..a7b50fff1645456710fa262e580d3d5b3f102781 100644 (file)
@@ -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)
 
@@ -83,9 +84,17 @@ 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.
 
+- 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.
index 4c387afbbabd7d9205181bb6295fbed34e7158a0..ea06dcc472def69ec7a68dd8bf569c827beb5f2e 100644 (file)
@@ -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 (file)
index 0000000..5aa46e0
--- /dev/null
@@ -0,0 +1,33 @@
+# 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
+chmod 0555 $WORK/unwritable/home
+[!plan9] env HOME=$WORK/unwritable/home
+[plan9] env home=$WORK/unwritable/home
+
+env GOCACHE=$WORK/unwritable/home
+! 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 (file)
index 0000000..76098a0
--- /dev/null
@@ -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 (file)
index 0000000..9490a28
--- /dev/null
@@ -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/build_runtime_gcflags.txt b/src/cmd/go/testdata/script/build_runtime_gcflags.txt
new file mode 100644 (file)
index 0000000..767b768
--- /dev/null
@@ -0,0 +1,8 @@
+# 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'
diff --git a/src/cmd/go/testdata/script/cache_unix.txt b/src/cmd/go/testdata/script/cache_unix.txt
new file mode 100644 (file)
index 0000000..f700ebe
--- /dev/null
@@ -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'
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 (file)
index 0000000..0d18fa9
--- /dev/null
@@ -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/go/testdata/script/clean_testcache.txt b/src/cmd/go/testdata/script/clean_testcache.txt
new file mode 100644 (file)
index 0000000..a2d592d
--- /dev/null
@@ -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
index fe2cf6f0fb6d4c32c4f6983955050cf92321d433..40f80b7d6e971eea78426389c4d2899ed4763e0e 100644 (file)
@@ -2,24 +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=-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
@@ -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
 
diff --git a/src/cmd/go/testdata/script/get_brace.txt b/src/cmd/go/testdata/script/get_brace.txt
new file mode 100644 (file)
index 0000000..be81d8f
--- /dev/null
@@ -0,0 +1,49 @@
+[!exec:git] skip
+
+# 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.
+# 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 (file)
index 0000000..1876114
--- /dev/null
@@ -0,0 +1,61 @@
+[!exec:git] skip
+
+# 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.
+# 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
diff --git a/src/cmd/go/testdata/script/get_tilde.txt b/src/cmd/go/testdata/script/get_tilde.txt
new file mode 100644 (file)
index 0000000..08289ca
--- /dev/null
@@ -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'
diff --git a/src/cmd/go/testdata/script/get_unicode.txt b/src/cmd/go/testdata/script/get_unicode.txt
new file mode 100644 (file)
index 0000000..31edcdb
--- /dev/null
@@ -0,0 +1,37 @@
+[!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
+
+-- $WORK/_origin/example.com/unicode/unicode.go --
+package unicode
+import _ "example.com/испытание"
+-- $WORK/_origin/example.com/испытание/испытание.go --
+package испытание
index 3d0650880e603df2cfa535958501527274252dd6..9f455256f72d880d558fd0c4572e6189bc06353d 100644 (file)
@@ -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.
index dbe8fb0ac98cea704f5eb2f3b5f655451aefe4e8..63c6896e507dbbaceaf02a0e71c6a2025320bf19 100644 (file)
@@ -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"
diff --git a/src/cmd/go/testdata/script/list_importmap.txt b/src/cmd/go/testdata/script/list_importmap.txt
new file mode 100644 (file)
index 0000000..a42dc47
--- /dev/null
@@ -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
index a63d74db1205a4a905e319eb59b195ce0625163e..046bec6ac54b054e817539e6efa8d137276c937b 100644 (file)
@@ -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
index 66a0e9ea7e7815332bf7fb60af48abd8c9650834..a9519f9d9086c656219b8357a21dc53f2e96ee90 100644 (file)
@@ -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
diff --git a/src/cmd/go/testdata/script/mod_concurrent.txt b/src/cmd/go/testdata/script/mod_concurrent.txt
new file mode 100644 (file)
index 0000000..e03e5e5
--- /dev/null
@@ -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=
index 6be6acb360c9f37a9ced0493f8e8b3d92ec19aaf..22f07c33c7565adf68afc02434b83fa801ecbe3c 100644 (file)
@@ -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"'
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 (file)
index 0000000..1662043
--- /dev/null
@@ -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
index 61801d5021bf2a8334b5c633ebf6855bef71fc76..aa714e8b3cd7baeb6cc6a9e7862d05a92dad2ec2 100644 (file)
@@ -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
index 8eef870b02b35362134bb92da551fceef3120802..ab5ee3d6dfa656cb36e7a311d8699fd5d85788a5 100644 (file)
@@ -38,9 +38,9 @@ stdout z[/\\]go.mod
 
 cd $GOPATH/src/x/y
 go env GOMOD
-! stdout .
-go list -m
-stderr 'cannot find main module'
+stdout 'NUL|/dev/null'
+go list -m
+stdout '^command-line-arguments$'
 
 cd $GOPATH/foo
 go env GOMOD
index d7d3e0321b53d499fa770a018fc2da67e8b49673..9341a1d08305f83d95a6a89064f5106a59f559b0 100644 (file)
@@ -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_get_private_vcs.txt b/src/cmd/go/testdata/script/mod_get_private_vcs.txt
new file mode 100644 (file)
index 0000000..86d78e8
--- /dev/null
@@ -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 .
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 (file)
index 0000000..b343628
--- /dev/null
@@ -0,0 +1,20 @@
+[!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 .
+stderr 'ReadZip not implemented for svn'
+
+-- go.mod --
+module golang/go/issues/28943/main
+-- main.go --
+package main
+import _ "llvm.org/llvm/bindings/go/llvm"
+func main() {}
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 (file)
index 0000000..82bb5e2
--- /dev/null
@@ -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() {}
index e5f5a1205ee76dff03028ab3f43ec7ae811f66e9..5a47c3fa44ae6c78e9840b1bd61c76722af37c3d 100644 (file)
@@ -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
 
index 800f2775591a895e2a20aa2fb76381ba1e52e613..903651c9d58fd5b4dfb870826cb71753f2c47082 100644 (file)
@@ -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$'
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 (file)
index 0000000..95513de
--- /dev/null
@@ -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
diff --git a/src/cmd/go/testdata/script/mod_modinfo.txt b/src/cmd/go/testdata/script/mod_modinfo.txt
new file mode 100644 (file)
index 0000000..fb31f9e
--- /dev/null
@@ -0,0 +1,89 @@
+# 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
+
+# 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 (
+       "rsc.io/quote"
+       _ "x/lib"
+)
+
+func main() {
+       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")
+}
index 640d5a363120b200de0c9c4305da7c69a43eec32..7e0f55a602fd66fddd7430c00adfc7ec188c59fe 100644 (file)
@@ -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 (file)
index 0000000..db994a1
--- /dev/null
@@ -0,0 +1,249 @@
+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
+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
+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' 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
+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 <mods> all' does not include the dependencies of <mods> 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'
+
+
+# '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
+
+# '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 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.
+[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 (
+       "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)
+       }
+}
+
+-- foo/foo_test.go --
+package main
+
+import (
+       "fmt"
+       "testing"
+)
+
+func TestFoo(t *testing.T) {
+       fmt.Println("foo was tested")
+}
index 4fa436ba2d076536ee8ecdefd3629540c3b76430..5f9ab627047456575adb87fca9d1b603e812eba8 100644 (file)
@@ -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
index b9cf00c36cb5b56b0da948420c95a912170b095a..78d6729fce322adb56306d30af1b6dd343caf430 100644 (file)
@@ -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 (file)
index 0000000..0da753a
--- /dev/null
@@ -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
index 36d4ffca9eca52919ac73bffc4385c254bc34ae8..7aa1bc353be857f6dbeea4df2840d9e914493377 100644 (file)
@@ -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/cmd/go/testdata/script/mod_sum_replaced.txt b/src/cmd/go/testdata/script/mod_sum_replaced.txt
new file mode 100644 (file)
index 0000000..b03982d
--- /dev/null
@@ -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() {}
diff --git a/src/cmd/go/testdata/script/mod_symlink.txt b/src/cmd/go/testdata/script/mod_symlink.txt
new file mode 100644 (file)
index 0000000..61da3cc
--- /dev/null
@@ -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"
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 (file)
index 0000000..87aecb4
--- /dev/null
@@ -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
index fb146b44155ebc660d4531c4090b622b4e54da76..009bb91c3c79b70146863c7e22f6056a4dd0589c 100644 (file)
@@ -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() {}
diff --git a/src/cmd/go/testdata/script/run_wildcard.txt b/src/cmd/go/testdata/script/run_wildcard.txt
new file mode 100644 (file)
index 0000000..cd401e0
--- /dev/null
@@ -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/...$'
diff --git a/src/cmd/go/testdata/script/vet_asm.txt b/src/cmd/go/testdata/script/vet_asm.txt
new file mode 100644 (file)
index 0000000..807e2b7
--- /dev/null
@@ -0,0 +1,31 @@
+# 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'
+
+# -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
+
+func f(x int8)
+
+-- a/asm.s --
+TEXT ·f(SB),0,$0-1
+       MOVW    x+0(FP), AX
+       RET
index 8205f696eb15df5b12131890bff84ac5c503d6a9..ac238d70ea0cd92e825e06492522775a9643a344 100644 (file)
@@ -6,9 +6,9 @@ package buildid
 
 import (
        "bytes"
-       "cmd/internal/xcoff"
        "debug/elf"
        "fmt"
+       "internal/xcoff"
        "io"
        "os"
        "strconv"
index 2d618eefa557a1c9951b559ce3cd0edc00d5cbab..84aed6eeea4963985407fee5b627058c677daf72 100644 (file)
@@ -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.
@@ -288,18 +289,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 +501,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)
        }
 
@@ -597,12 +611,13 @@ 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()
                        }
                }
        }
 
        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/abi_string.go b/src/cmd/internal/obj/abi_string.go
new file mode 100644 (file)
index 0000000..a439da3
--- /dev/null
@@ -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]]
+}
index dd6d9265c4bf017020d3dfa8f6d64a920454aef8..b1fb1d394411a20d2edb981bdd3bf3186d67d0d0 100644 (file)
@@ -1529,7 +1529,7 @@ func buildop(ctxt *obj.Link) {
                return
        }
 
-       deferreturn = ctxt.Lookup("runtime.deferreturn")
+       deferreturn = ctxt.LookupABI("runtime.deferreturn", obj.ABIInternal)
 
        symdiv = ctxt.Lookup("runtime._div")
        symdivu = ctxt.Lookup("runtime._divu")
index c17bf2a8ac1db9dce38da4a9732a2fc344d3dce8..34bd5d6baf1a4306c9bba581e17a266aa4d8a751 100644 (file)
@@ -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
index 9746426d909d2a1e4b49507de9f141999cae751f..093b2228983d6bd12ac92aa903809969293d841a 100644 (file)
@@ -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.
index 7fb129989b1100a1371d673fc822758e7e5c0fbf..73d8bb76ddd0af31a0b3fab1576d274fac7b0add 100644 (file)
@@ -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 <cond>, <Fn>, <Fm>, <Fd>
 
 #<immediate> is written as $<immediate>.
 
-Optionally-shifted immedate.
+Optionally-shifted immediate.
 
   Examples:
     ADD $(3151<<12), R14, R20     <=>    add x20, x14, #0xc4f, lsl #12
index d0e354eabd19ed4e28797a6678130a512006243d..e47857ab5fede2c08c22c92fb7f176cc5f95e173 100644 (file)
@@ -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
 
index 671239444c7b981e090be3887885381e3293d65b..8860069e4771bef5c926563ab2f38080d3d212fb 100644 (file)
@@ -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)
        }
 }
index d924cbc21424b98fd3eeda8488d93ce58d100356..f506f60d065d4fe019610646ffe0f22213718ba0 100644 (file)
@@ -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
@@ -391,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
@@ -409,8 +412,47 @@ 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.
+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
+type Attribute uint16
 
 const (
        AttrDuplicateOK Attribute = 1 << iota
@@ -446,6 +488,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 }
@@ -471,6 +520,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
@@ -502,6 +557,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)
        }
@@ -556,7 +617,7 @@ type Pcdata struct {
 type Link struct {
        Headtype           objabi.HeadType
        Arch               *LinkArch
-       Debugasm           bool
+       Debugasm           int
        Debugvlog          bool
        Debugpcln          string
        Flag_shared        bool
@@ -565,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
@@ -584,6 +646,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{}) {
index 5a2546af9ed428f94c5d49e98274142e5e1bbe1b..f096c7ff149400106f9476b66a79d5f2096671fd 100644 (file)
@@ -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
 
index 3c72f543ccb3707e18e86192c11599917e625dd6..c6d2de4273e2df985a7f333c6747f5a2197826d4 100644 (file)
@@ -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)
@@ -98,10 +98,25 @@ 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)
        }
+       for _, s := range ctxt.ABIAliases {
+               w.writeRefs(s)
+               w.addLengths(s)
+       }
        // End symbol references
        w.wr.WriteByte(0xff)
 
@@ -137,9 +152,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 +173,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
 }
@@ -218,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 {
@@ -261,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)
        }
 
@@ -360,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))
        }
 }
 
index d72d797ee5a47ae468fa71a8f1a1cf3a608bbfb6..84dd494930ee3355f3c9f1fe59dc09e3baaa9a2b 100644 (file)
@@ -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)
index 6710b375f16119a8f4672a19af14bfee1ae9d3ee..9d376f739ffcb707b41ae6ac48fe4353487fd8db 100644 (file)
@@ -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
index 3c374579ec6a946ba0cb444bc2472b1c38475fc1..6b248d5c366c26058aaa50b2896ef7f9d14008ac 100644 (file)
@@ -391,6 +391,7 @@ const (
        C_GOK
        C_ADDR
        C_GOTADDR
+       C_TOCADDR
        C_TLS_LE
        C_TLS_IE
        C_TEXTSIZE
@@ -902,6 +903,7 @@ const (
        AVCMPNEZB
        AVCMPNEZBCC
        AVPERM
+       AVPERMXOR
        AVBPERMQ
        AVBPERMD
        AVSEL
index c04ce27e463138a6f51b3b62dc6090383f1942dc..fb934e96f953bb13e0cc2ad079d989ada93b1332 100644 (file)
@@ -493,6 +493,7 @@ var Anames = []string{
        "VCMPNEZB",
        "VCMPNEZBCC",
        "VPERM",
+       "VPERMXOR",
        "VBPERMQ",
        "VBPERMD",
        "VSEL",
index 6ec7b7b5183265887497d598893f8ae3f9da3e3b..4699a15d3bec9963077365265cf1212daddfc24a 100644 (file)
@@ -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",
index a36565c9fd463b7b7cf455c0804f6776e32e1325..a2ea492710b59314aa96d0af2ba4bccec5184915 100644 (file)
@@ -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]
@@ -1494,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)
@@ -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 access 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,26 @@ 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 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)
+               }
+
+               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(inst, 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
@@ -4477,6 +4505,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 */
index 7a07b5058c3c11bb570be1aa4c0043d82ba2b8fe..30a8414d4ad401c60a8f686e7bb6931b99d4ee59 100644 (file)
@@ -108,9 +108,123 @@ 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.
+// 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
+       }
+
+       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+<off>, Rx becomes MOVD symtoc, Rx; ADD <off>, 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 {
@@ -927,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
@@ -942,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
 
index 4e43d2779005570c9d655af5232a862af34beba6..7d49103be6fb602ccfbfa88c7f93accecc9c50e2 100644 (file)
@@ -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_)
index b7b8a2c7a6373b4627fe000e8a186be69ac976e0..b7a2873106f6e66c9b46315989cc7c75048a5d0c 100644 (file)
@@ -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
 
index 3fc17fa850711be0218cc24f845f22337f0819d8..15a501c3aa514ae12035643c9cdb97a8c7466fff 100644 (file)
@@ -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 {
index da938c998a2dd263685cc7d56d6d7dfc667a4b8c..f1517d3d5d1dfd16eaabe968c53d26f066d688ab 100644 (file)
@@ -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 "<nil Prog>"
+       }
+       if p.Ctxt == nil {
+               return "<Prog without ctxt>"
+       }
+       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 {
@@ -372,6 +385,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
 }
index f271101f4bbe96a2e5e3140ca745778ac558ba86..fbea103dcb08030f19bb1eb74292761c66544e34 100644 (file)
@@ -125,9 +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")
-       deferreturn = ctxt.Lookup("runtime.deferreturn")
-       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) {
@@ -241,7 +245,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++
@@ -277,8 +280,15 @@ 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++
+                       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))
index a4507352f77e4fdcb22d8af454d69620cb382d3b..c3da29ce2cbd4e78d766bafca4861ea503cf0466 100644 (file)
@@ -2064,7 +2064,7 @@ func instinit(ctxt *obj.Link) {
        case objabi.Hplan9:
                plan9privates = ctxt.Lookup("_privates")
        case objabi.Hnacl:
-               deferreturn = ctxt.Lookup("runtime.deferreturn")
+               deferreturn = ctxt.LookupABI("runtime.deferreturn", obj.ABIInternal)
        }
 
        for i := range avxOptab {
index 139f293b136f0427a0ebd3a2306664e95b6e3af3..babfd38ad235148522e5031b7cfed3203c03d779 100644 (file)
@@ -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
index 7bd5ff63e562c7a47ab73e18f3ab7c8bde2db242..03dc9fb88bc769157b2cd4414e843f0a607052b9 100644 (file)
@@ -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
index 30cd7dccac20fbee7cbc73850b7c55a8852559ac..90e944656bb8a2ebeca5dd2d593ac0a124a222f6 100644 (file)
@@ -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
index 92799107da04c67facdf57bfa8e3b7ff1d9be688..a30bc3fa05a6c9fda464d44f8a0c0fc1ae3dee5a 100644 (file)
@@ -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,65 @@ 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 == "<autogenerated>" {
+               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
+               }
+       }
+       if strings.HasSuffix(name, "-fm") {
+               return FuncID_wrapper
+       }
+       return FuncID_normal
+}
index a3e2868a1bc9403161af4fdb1f519fea0ad103ba..355882c63880af3d0e60f7cd3a56d4f1a3ce2c9d 100644 (file)
@@ -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.
index 11433932e2dcfbdc8eeb4b26cc85bddaf7e237d2..62ab0398a6653407859428a2d750214dac6d127c 100644 (file)
@@ -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
+}
index b95a0d3c701fdf69562224aeda27a1bcbb454e31..16b4c535ed85b2fcb56286dcc6cc649bc5212183 100644 (file)
@@ -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.
 
 )
index 7152d6c006901ff729fb14108322658c70371397..2b9a9080e8c0fb6e49af9e1159da1946dbfba2bf 100644 (file)
@@ -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) {
index d1017322f0086b7d4b66857d4b63f0c48d1bb4ed..da49f706f603384a976395e93e0ee0bfaad09d75 100644 (file)
@@ -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()
index fce63bfeeae0b931207ffce90b09b16c594a9010..50fc51be8772665f0a8918b178374c585df528ea 100644 (file)
@@ -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 {
index c36b4362ba834f0c24a11d3e01c17727f2c9e4ec..d438c802264f693ff311c8079d723d985d04c543 100644 (file)
@@ -7,9 +7,9 @@
 package objfile
 
 import (
-       "cmd/internal/xcoff"
        "debug/dwarf"
        "fmt"
+       "internal/xcoff"
        "io"
        "unicode"
 )
@@ -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:
index 22dec702a576defd0d444ff3b4cd5342600930d9..a53da6ed2cbebc993fc0704b9811fd82e59eedee 100644 (file)
@@ -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:
index 963d86a35fa2876f4449480d00dcd326d27a6fa8..219499be0a16a2136219588e5be291f87eb8f7a2 100644 (file)
@@ -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
index 77b03b67f9b82becdb58609024bd72b4a74564dd..60b6491859574ed07993e6025283591a5db7e509 100644 (file)
@@ -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).
@@ -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)
                }
        }
 }
index f424f1d17b279a5a601dad2cd9a08b4eaa3b1d23..e0fad1acfdc90b4faef823afe42a9726e7e1297e 100644 (file)
@@ -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",
@@ -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))
                        }
@@ -314,16 +314,19 @@ 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.
-                       // 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" {
-                               // It's not possible to make a loader relocation to a DWARF section.
-                               // FIXME
-                               if s.Sect.Seg != &Segdwarf {
-                                       xcoffaddloaderreloc(ctxt, s, r)
+                       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)
                                }
                        }
 
@@ -1310,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))
@@ -1709,10 +1712,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 {
@@ -2037,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
index df989cc94486a77cabfc77d73331cb22dd648fc7..8f582174c549cf899fb81471d5b309c3c950d797 100644 (file)
@@ -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
index d10f4ab3c3ca14a66d5acdaa09a49825f234e11b..a150306df9174dc8dd9f9ddf18cb62254d673baf 100644 (file)
@@ -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
                }
 
index 42b598efefa14d2bb40dc324bcfb65e14040216d..7bbe2b710cca21db4c2bb590c0946c63f0b7946e 100644 (file)
@@ -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<T> 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 {
@@ -861,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")
 }
 
@@ -881,6 +894,8 @@ func TestRuntimeTypeAttrExternal(t *testing.T) {
 }
 
 func testRuntimeTypeAttr(t *testing.T, flags string) {
+       t.Parallel()
+
        const prog = `
 package main
 
@@ -939,7 +954,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 +974,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 +1092,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)
index d6c6b53a44c524cc9f45ee2510eac7c4233790e5..80d7ac32f524b9cc090ae84d9c00fc34f9aa1c83 100644 (file)
@@ -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
@@ -163,9 +174,6 @@ func loadcgo(ctxt *Link, file string, pkg string, p string) {
                                }
                                havedynamic = 1
                        }
-                       if ctxt.HeadType == objabi.Haix {
-                               xcoffadddynimpsym(ctxt, s)
-                       }
 
                        continue
 
@@ -191,6 +199,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 {
index 896e1c87d242f271c8af99a0acf55016a5e6d15c..9e5e2f98726efe820408094fff7bc9bc1cfd2a32 100644 (file)
@@ -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
                                }
index 4884a07d05a931b1a903644da5d09d3b9accf7b7..081642931652bafe9a34750acfd8677cd2108445 100644 (file)
@@ -14,6 +14,7 @@ import (
 )
 
 func TestUndefinedRelocErrors(t *testing.T) {
+       t.Parallel()
        testenv.MustHaveGoBuild(t)
        dir, err := ioutil.TempDir("", "go-build")
        if err != nil {
index 2af9c76a8bb4decfe0496d0e94f523b029278ff0..91673a8d4d670691166ff8b80609f904e9dd3b28 100644 (file)
@@ -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", 0) != nil
+       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 {
@@ -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)
                        }
@@ -588,8 +594,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
@@ -635,6 +641,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 +670,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
        }
 
@@ -859,8 +878,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)
@@ -1005,6 +1026,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)
                        }
@@ -1110,7 +1132,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) {
@@ -1802,6 +1824,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 {
@@ -1971,7 +2008,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.
index 48b92724b6fe075ede810f95b31f3049579d1f62..8ed5c6e27e9000d9cc24087e6015282e30865fe6 100644 (file)
@@ -32,6 +32,7 @@ package ld
 
 import (
        "bufio"
+       "cmd/internal/obj"
        "cmd/internal/objabi"
        "cmd/internal/sys"
        "cmd/link/internal/sym"
@@ -108,9 +109,28 @@ 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)
+               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
+                               }
+                       }
+               }
+
                // 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)
                }
index e019a39bf7348c796d8a4c03b14e96918e9231d3..4d2ff1acf223f51fab9326124833d91591bbcc40 100644 (file)
@@ -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")
index 3eb3d058824f79400acb09d2ea2533e68896c883..e4db834622dd47dd6308b5ee60d48f21a96002c5 100644 (file)
@@ -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
@@ -520,10 +492,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.
index 276a3a1cbbb875438a17f343fabc8291d5b3c442..7c296d766c44f0ade9efc589759bfdbe80e151bf 100644 (file)
@@ -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
index f06b498594493c1a1136858d1f5b2c96746c34e8..1561ce8cd0d17eb75e6552f0b31873e1e42a53bf 100644 (file)
@@ -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
@@ -316,6 +319,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
@@ -329,6 +338,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,32 +357,22 @@ 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)
+       loaderSymbols   []*xcoffLoaderSymbol // symbols inside .loader symbol table
+       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
-       loaderOff  uint64
-       loaderSize uint64
+       xfile xcoffFile
 )
 
 // xcoffStringTable is a XCOFF string table.
@@ -404,29 +411,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 +429,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,19 +460,37 @@ 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) {
        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")
@@ -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,
                }
 
@@ -791,16 +796,41 @@ 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)
        }
 }
 
 // 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
@@ -810,18 +840,32 @@ func 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.
@@ -830,47 +874,96 @@ 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) {
-       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)
+// 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 {
+               Errorf(s, "cannot have a relocation to %s in a text section symbol", r.Sym.Name)
+               return false
        }
 
-       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
        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 {
+                       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
+               }
+
+               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)
 
@@ -878,6 +971,57 @@ 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
+               }
+       }
+
+       // 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)
+
+       for _, s := range ctxt.Syms.Allsym {
+               if strings.HasPrefix(s.Name, "TOC.") {
+                       s.Type = sym.SXCOFFTOC
+               }
+       }
 }
 
 // Loader section
@@ -885,9 +1029,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) {
@@ -908,56 +1051,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:  ep.Sect.Extnum,
-               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: s.Sect.Extnum,
-                       Lsymndx: int32(nbldsym),
-               }
-               dynimpreloc = append(dynimpreloc, ldr)
-               nbldsym++
-
        }
 
        hdr.Lnsyms = int32(len(symtab))
@@ -965,17 +1081,30 @@ 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,
-               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...)
@@ -1051,8 +1180,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 */
@@ -1116,8 +1244,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
@@ -1143,90 +1275,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)
 }
index 7204d343888757999d704ddf292639ce93ac1c76..7c863d79c5832928f02d955a3ffe0e07f5734175 100644 (file)
@@ -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.
index 3a8923b07333f4d7004e9cf11ffd342f39db0212..b39e0521066bdcfac5445462c7caa600ed0dfeab 100644 (file)
@@ -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(`"".`)
@@ -317,10 +318,9 @@ 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()
                }
 
-               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)
@@ -382,17 +382,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 {
index c4a49c6a1e5952d8e19165f727442bb646115769..6e31668e28e2b15af3434f92510aef11383ac120 100644 (file)
@@ -39,6 +39,7 @@ import (
        "encoding/binary"
        "fmt"
        "log"
+       "strings"
 )
 
 func genplt(ctxt *ld.Link) {
@@ -133,7 +134,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
        }
@@ -262,6 +263,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 {
@@ -374,6 +383,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()
@@ -474,7 +490,72 @@ func symtoc(ctxt *ld.Link, s *sym.Symbol) int64 {
        return toc.Value
 }
 
+// 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 {
+               ld.Errorf(s, "archrelocaddr called for %s relocation\n", r.Sym.Name)
+       }
+       var o1, o2 uint32
+
+       o1 = uint32(val >> 32)
+       o2 = uint32(val)
+
+       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)
+       }
+
+       if t&0x8000 != 0 {
+               t += 0x10000
+       }
+
+       o1 |= uint32((t >> 16) & 0xFFFF)
+
+       switch r.Type {
+       case objabi.R_ADDRPOWER_TOCREL_DS:
+               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
+               }
+       default:
+               return -1
+       }
+
+       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)
+       }
        var o1, o2 uint32
        if ctxt.Arch.ByteOrder == binary.BigEndian {
                o1 = uint32(val >> 32)
@@ -493,7 +574,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
@@ -667,6 +748,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:
@@ -946,13 +1029,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
 
@@ -974,14 +1050,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))
@@ -1012,7 +1081,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()
                }
        }
@@ -1041,7 +1110,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()
index e630f8c062b6bed0562937310ce14117ca8d8060..fbedc728d9baeadbd4c50e2235be12675f747eea 100644 (file)
@@ -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 {
index 4faa991463b080c2d103cbbeb84dec52c27196de..8b70d6184628be7d68b303d6cf7f5ee2ba1e76a3 100644 (file)
@@ -5,6 +5,7 @@
 package sym
 
 import (
+       "cmd/internal/obj"
        "cmd/internal/objabi"
        "cmd/internal/sys"
        "debug/elf"
@@ -27,7 +28,7 @@ type Symbol struct {
        Sub         *Symbol
        Outer       *Symbol
        Gotype      *Symbol
-       File        string
+       File        string // actually package!
        auxinfo     *AuxSymbol
        Sect        *Section
        FuncInfo    *FuncInfo
@@ -52,9 +53,31 @@ 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 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
@@ -137,6 +160,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)
 }
@@ -486,7 +513,6 @@ type FuncInfo struct {
        Pcline      Pcdata
        Pcinline    Pcdata
        Pcdata      []Pcdata
-       IsStmtSym   *Symbol
        Funcdata    []*Symbol
        Funcdataoff []int64
        File        []*Symbol
@@ -495,10 +521,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 {
index d7266c840b74c8a404bfe2dc4a9ecc500781aa96..f0fcf2361b178efeebacc0be200573c57f8f3554 100644 (file)
@@ -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),
index b1756d6145e9e1af88084d9c85de1ef8ca814230..82e4b9eda48c443a9894bf7bef527bda734f9c26 100644 (file)
@@ -89,10 +89,10 @@ const (
        SNOPTRDATA
        SINITARR
        SDATA
+       SXCOFFTOC
        SBSS
        SNOPTRBSS
        STLSBSS
-       SXCOFFTOC
        SXREF
        SMACHOSYMSTR
        SMACHOSYMTAB
@@ -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
index 7428503b1c8a36e7fdb6ffd02ff6d7ceb3ee755e..9c8e1569f6bd1fff5837aa2cb5adc079ce519ebd 100644 (file)
@@ -4,9 +4,9 @@ package sym
 
 import "strconv"
 
-const _SymKind_name = "SxxxSTEXTSELFRXSECTSTYPESSTRINGSGOSTRINGSGOFUNCSGCBITSSRODATASFUNCTABSELFROSECTSMACHOPLTSTYPERELROSSTRINGRELROSGOSTRINGRELROSGOFUNCRELROSGCBITSRELROSRODATARELROSFUNCTABRELROSTYPELINKSITABLINKSSYMTABSPCLNTABSELFSECTSMACHOSMACHOGOTSWINDOWSSELFGOTSNOPTRDATASINITARRSDATASBSSSNOPTRBSSSTLSBSSSXCOFFTOCSXREFSMACHOSYMSTRSMACHOSYMTABSMACHOINDIRECTPLTSMACHOINDIRECTGOTSFILEPATHSCONSTSDYNIMPORTSHOSTOBJSDWARFSECTSDWARFINFOSDWARFRANGESDWARFLOCSDWARFMISC"
+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}
+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) {
index 6ed751abb5f792ddc36a75cf572839e8446fe3cb..e0aae0288491c5a3a87eb3bf8f6d2ee17b2dd15e 100644 (file)
@@ -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)
+       }
+}
index 87baa09d38ef3209e7052d42cefb58c04129ef47..1b5bd21ad5dc0a8a1fe17e00f4d34ebc168e873a 100644 (file)
@@ -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",
@@ -64,7 +63,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)
@@ -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)
@@ -151,13 +151,15 @@ func testGoExec(t *testing.T, iscgo, isexternallinker bool) {
                                return true
                        }
                }
+               if runtime.GOOS == "windows" && runtime.GOARCH == "arm" {
+                       return true
+               }
                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 +186,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 +199,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 +268,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 +297,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)
index bf2f32118445729784e2120e171c43edd8f135c4..5b9701a0e22f519593ce8426f520a9007fbe84fb 100644 (file)
@@ -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
index a4933b51bf00d6708519f0fbf7be30122107a34c..24984156811c4c6e41fe7f7a43137f75ebbb7b54 100644 (file)
@@ -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})
@@ -539,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.
index 8b9daabcdb268c5d421cc205d669a5ffc9b26e19..a9068d53c1ba29b628cc9c408a674b33162b8bc7 100644 (file)
@@ -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)
 
 }
 
index c954704a47170fc26ed38f17cd6100bb7694ddfd..548871a82c20ad8c8df9f5eb4a7c8129ab863658 100644 (file)
@@ -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: <br>
 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
index 2f71a3d4bd4cfc0109e6c56a24d99c18a8008bcf..f94586abf3da6cdcb40928d2ea09ccfc01fd5cae 100644 (file)
@@ -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
 }
index 6a7d28e61de645f5a4cc8c087d57472ded1152d8..b92fac652cce82f07577dcf4133dc094194c8de2 100644 (file)
@@ -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)
                }
        })
index cf74fe56ae3fab1b43353da3fa70397612cf5a68..3389d2799bee200d92c3fe31da88afb1765c8e48 100644 (file)
@@ -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,
index d467f371fa604b27bfb3ede1cf630bf5dfa52148..f39a397d0d650dca2225793557a2d94dedc2b1ab 100644 (file)
@@ -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() {
index abeb330924d3533eea3740616c96eb97ab644e05..9e90f50d4ba912c3e9cc6be41ca31b8a13bfb05d 100644 (file)
@@ -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 {
index 144642ad9e926b8c4cf663ecf0bb7fc86e47c4d9..fec060e121aef8f936299a1ac025ecd047f48db5 100644 (file)
@@ -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)
        }
 }
index 740905c652fdb0581a5b8619c70fc583d10608a6..7eb97a1b9b16f612a3686b31ffb7cf13c5039a98 100644 (file)
@@ -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
index e1518d52e5c112440f99ee6fe2b90a8247d2db23..5f04ff40e450a5b9d4e58cd9f344086b4e1e7cd1 100644 (file)
@@ -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
index 71f64d64dcc63fb6caa8dc8b1c043580665a0118..039b3edfa0ad075aa173a1ea550bf3dee7b4434f 100644 (file)
@@ -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
index 63be379a0454bc6dd114078b48647458c6b7af79..70872bbd743359d9f322b43807213d4abd92983e 100644 (file)
@@ -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 := " "
index ae825fd23c961f4f6e672d1cf21a4ad13a6575fc..b886f7bad1a5014c993c90f2c7f73d84943eb259 100644 (file)
@@ -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
index 57a761e36faa0ef9c01e76f64e7565fbdcf0d488..d039d9d500f787f5307fda7471075b1456f1bda3 100644 (file)
@@ -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",
 }
index 24c745c8485693bf288ba90470f9f2789ac7d4c9..f536926dbc11aa8b8b72d991e6028cb896901caf 100644 (file)
@@ -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}},
 }
index b4e5db2cb2c3f3121387876bfacea630c152c94f..2a89de04c913260b515b469e9a8644a2f53f7fcd 100644 (file)
@@ -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
index bc6f6031f1b794034fb6bafb87853fa68c121561..2bf415fb1cff3b2446f0ede07147f0439b8e8f5c 100644 (file)
@@ -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/aliases.go b/src/cmd/vendor/golang.org/x/sys/unix/aliases.go
new file mode 100644 (file)
index 0000000..951fce4
--- /dev/null
@@ -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 (file)
index 0000000..06f84b8
--- /dev/null
@@ -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_freebsd_arm64.s b/src/cmd/vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s
new file mode 100644 (file)
index 0000000..d9318cb
--- /dev/null
@@ -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)
index 649e58714d9cb3314a948ee58c21da903f25b218..88f712557810a1a5e07ab1b847216ba24cd8d528 100644 (file)
 // 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
index a96f0ebc26446cc91688e8608663d40077efee82..3a6ac648dd5965584abf4afcc97c417b4bc8792f 100644 (file)
@@ -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/darwin_test.go b/src/cmd/vendor/golang.org/x/sys/unix/darwin_test.go
new file mode 100644 (file)
index 0000000..29af36f
--- /dev/null
@@ -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/dev_aix_ppc.go b/src/cmd/vendor/golang.org/x/sys/unix/dev_aix_ppc.go
new file mode 100644 (file)
index 0000000..5e5fb45
--- /dev/null
@@ -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 (file)
index 0000000..8b40124
--- /dev/null
@@ -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)
+}
index 95fd353171fa8cae3f7cdedd13715f9020281b8f..4407c505a369c83e8ef95c21b2607dd32badfa6a 100644 (file)
@@ -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
 
index 706b3cd1dd30a26f5681e684853a02efe6b105f4..84178b0a134a9d425f7aa7c0c55c9fada0b86614 100644 (file)
@@ -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.
 
similarity index 83%
rename from src/cmd/vendor/golang.org/x/sys/unix/example_test.go
rename to src/cmd/vendor/golang.org/x/sys/unix/example_exec_test.go
index 10619afddec5d0cdffa72a0bf13e36e7c6acc91d..bb4d3bf5da9ad588c55442719d46c3ae2181626d 100644 (file)
@@ -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/example_flock_test.go b/src/cmd/vendor/golang.org/x/sys/unix/example_flock_test.go
new file mode 100644 (file)
index 0000000..6c91748
--- /dev/null
@@ -0,0 +1,25 @@
+// 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 solaris
+
+package unix_test
+
+import (
+       "log"
+       "os"
+
+       "golang.org/x/sys/unix"
+)
+
+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)
+       }
+}
index e8024690dfde5240493ce2896bcb6495f4832af8..f8ae0e0e37172027c9685cb1acf4d51fb2c4b350 100644 (file)
@@ -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
 
index 9379ba9cef77ce1025794f75903f09c32ae6cad1..39c03f1ef135bb93ce282209be0b0ace0beb15bc 100644 (file)
@@ -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 (file)
index 0000000..5868a4a
--- /dev/null
@@ -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
+}
index 50062e3c7430e85740bfedd3473a135385b52f3f..cd6f5a6133fe86c796b7458953ebe868edf3070c 100644 (file)
@@ -3,6 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // +build gccgo
+// +build !aix
 
 package unix
 
index 46523ced65d59e69212ca337ba840f8f924b66d5..c44730c5e99ff103d47bc8fa186fca401c560fda 100644 (file)
@@ -3,6 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // +build gccgo
+// +build !aix
 
 #include <errno.h>
 #include <stdint.h>
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 (file)
index 0000000..f121a8d
--- /dev/null
@@ -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
+}
index 1715122bd4b1679c11d94f11a7d8e1201609ba04..b9804c0ca6b4264270d101da00799d342d5c0d61 100755 (executable)
 GOOSARCH="${GOOS}_${GOARCH}"
 
 # defaults
-mksyscall="./mksyscall.pl"
+mksyscall="go run mksyscall.go"
 mkerrors="./mkerrors.sh"
 zerrors="zerrors_$GOOSARCH.go"
 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
@@ -59,98 +60,111 @@ _* | *_ | _)
        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"
-       mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h"
+       mksyscall="go run mksyscall.go -l32"
+       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"
-       mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h"
+       mksyscall="go run mksyscall.go -l32"
+       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="./mksyscall.pl -dragonfly"
-       mksysnum="curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl"
+       mksyscall="go run mksyscall.go -dragonfly"
+       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="./mksyscall.pl -l32"
-       mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
+       mksyscall="go run mksyscall.go -l32"
+       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="./mksyscall.pl -l32 -arm"
-       mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
+       mksyscall="go run mksyscall.go -l32 -arm"
+       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"
        ;;
-linux_sparc64)
-       GOOSARCH_in=syscall_linux_sparc64.go
-       unistd_h=/usr/include/sparc64-linux-gnu/asm/unistd.h
+freebsd_arm64)
        mkerrors="$mkerrors -m64"
-       mksysnum="./mksysnum_linux.pl $unistd_h"
+       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="./mksyscall.pl -l32 -netbsd"
-       mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
+       mksyscall="go run mksyscall.go -l32 -netbsd"
+       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="./mksyscall.pl -netbsd"
-       mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
+       mksyscall="go run mksyscall.go -netbsd"
+       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="./mksyscall.pl -l32 -netbsd -arm"
-       mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
+       mksyscall="go run mksyscall.go -l32 -netbsd -arm"
+       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"
        ;;
 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"
+       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="./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"
+       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="./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"
+       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"
@@ -177,12 +191,24 @@ 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 " ;
+                       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
+               fi
        esac
        if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi
        if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi
        if [ -n "$mktypes" ]; then
                echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go";
+       if [ -n "$mkasm" ]; then echo "$mkasm $GOARCH"; fi
        fi
 ) | $run
index 4a2c5dc9b0968483fbbeb7887f871bec76e44e4c..178077f47b46ff78622ab8210b5c49515a818305 100755 (executable)
@@ -17,15 +17,17 @@ 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
 
-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 +36,21 @@ fi
 
 uname=$(uname)
 
+includes_AIX='
+#include <net/if.h>
+#include <net/netopt.h>
+#include <netinet/ip_mroute.h>
+#include <sys/protosw.h>
+#include <sys/stropts.h>
+#include <sys/mman.h>
+#include <sys/poll.h>
+#include <sys/termio.h>
+#include <termios.h>
+#include <fcntl.h>
+
+#define AF_LOCAL AF_UNIX
+'
+
 includes_Darwin='
 #define _DARWIN_C_SOURCE
 #define KERNEL
@@ -65,8 +82,10 @@ includes_DragonFly='
 #include <sys/event.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
+#include <sys/stat.h>
 #include <sys/sysctl.h>
 #include <sys/mman.h>
+#include <sys/mount.h>
 #include <sys/wait.h>
 #include <sys/ioctl.h>
 #include <net/bpf.h>
@@ -80,12 +99,13 @@ includes_DragonFly='
 '
 
 includes_FreeBSD='
-#include <sys/capability.h>
+#include <sys/capsicum.h>
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/event.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
+#include <sys/stat.h>
 #include <sys/sysctl.h>
 #include <sys/mman.h>
 #include <sys/mount.h>
@@ -165,16 +185,21 @@ struct ltchars {
 #include <linux/if_alg.h>
 #include <linux/if_arp.h>
 #include <linux/if_ether.h>
+#include <linux/if_ppp.h>
 #include <linux/if_tun.h>
 #include <linux/if_packet.h>
 #include <linux/if_addr.h>
 #include <linux/falloc.h>
 #include <linux/filter.h>
 #include <linux/fs.h>
+#include <linux/kexec.h>
 #include <linux/keyctl.h>
 #include <linux/magic.h>
+#include <linux/memfd.h>
+#include <linux/module.h>
 #include <linux/netfilter/nfnetlink.h>
 #include <linux/netlink.h>
+#include <linux/net_namespace.h>
 #include <linux/perf_event.h>
 #include <linux/random.h>
 #include <linux/reboot.h>
@@ -190,12 +215,21 @@ struct ltchars {
 #include <linux/vm_sockets.h>
 #include <linux/taskstats.h>
 #include <linux/genetlink.h>
-#include <linux/stat.h>
 #include <linux/watchdog.h>
 #include <linux/hdreg.h>
 #include <linux/rtc.h>
+#include <linux/if_xdp.h>
+#include <mtd/ubi-user.h>
 #include <net/route.h>
+
+#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 <asm-generic/termbits.h>
+#else
 #include <asm/termbits.h>
+#endif
 
 #ifndef MSG_FASTOPEN
 #define MSG_FASTOPEN    0x20000000
@@ -223,13 +257,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 <sys/types.h>
 #include <sys/param.h>
 #include <sys/event.h>
+#include <sys/extattr.h>
 #include <sys/mman.h>
+#include <sys/mount.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
 #include <sys/sysctl.h>
@@ -255,11 +301,14 @@ includes_OpenBSD='
 #include <sys/param.h>
 #include <sys/event.h>
 #include <sys/mman.h>
+#include <sys/mount.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
+#include <sys/stat.h>
 #include <sys/sysctl.h>
 #include <sys/termios.h>
 #include <sys/ttycom.h>
+#include <sys/unistd.h>
 #include <sys/wait.h>
 #include <net/bpf.h>
 #include <net/if.h>
@@ -291,6 +340,7 @@ includes_SunOS='
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
+#include <sys/stat.h>
 #include <sys/mman.h>
 #include <sys/wait.h>
 #include <sys/ioctl.h>
@@ -353,6 +403,7 @@ ccflags="$@"
                $2 ~ /^EXTATTR_NAMESPACE_NAMES/ ||
                $2 ~ /^EXTATTR_NAMESPACE_[A-Z]+_STRING/ {next}
 
+               $2 !~ /^ECCAPBITS/ &&
                $2 !~ /^ETH_/ &&
                $2 !~ /^EPROC_/ &&
                $2 !~ /^EQUIV_/ &&
@@ -388,7 +439,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 +450,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 +485,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 +529,7 @@ errors=$(
 signals=$(
        echo '#include <signal.h>' | $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 +539,7 @@ echo '#include <errno.h>' | $CC -x c - -E -dM $ccflags |
        sort >_error.grep
 echo '#include <signal.h>' | $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.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksyscall.pl
deleted file mode 100755 (executable)
index 1f6b926..0000000
+++ /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 <<EOF;
-// $cmdline
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build $tags
-
-package unix
-
-import (
-       "syscall"
-       "unsafe"
-)
-
-var _ syscall.Errno
-
-$text
-EOF
-exit 0;
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 (executable)
index 0000000..c44de8d
--- /dev/null
@@ -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 <stdint.h>\n#include <stddef.h>\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 <<EOF;
+// $cmdline
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build $tags
+
+package $package
+
+
+$c_extern
+*/
+import "C"
+import (
+       "unsafe"
+)
+
+
+EOF
+
+print "import \"golang.org/x/sys/unix\"\n" if $package ne "unix";
+
+chomp($_=<<EOF);
+
+$text
+EOF
+print $_;
+exit 0;
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.pl
new file mode 100755 (executable)
index 0000000..53df26b
--- /dev/null
@@ -0,0 +1,579 @@
+#!/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
+
+# This program will generate three files and handle both gc and gccgo implementation:
+#   - zsyscall_aix_ppc64.go: the common part of each implementation (error handler, pointer creation)
+#   - zsyscall_aix_ppc64_gc.go: gc part with //go_cgo_import_dynamic and a call to syscall6
+#   - zsyscall_aix_ppc64_gccgo.go: gccgo part with C function and conversion to C type.
+
+# The generated code looks like this
+#
+# zsyscall_aix_ppc64.go
+# func asyscall(...) (n int, err error) {
+#        // Pointer Creation
+#        r1, e1 := callasyscall(...)
+#        // Type Conversion
+#        // Error Handler
+#        return
+# }
+#
+# zsyscall_aix_ppc64_gc.go
+# //go:cgo_import_dynamic libc_asyscall asyscall "libc.a/shr_64.o"
+# //go:linkname libc_asyscall libc_asyscall
+# var asyscall syscallFunc
+#
+# func callasyscall(...) (r1 uintptr, e1 Errno) {
+#        r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_asyscall)), "nb_args", ... )
+#        return
+# }
+#
+# zsyscall_aix_ppc64_ggcgo.go
+# /*
+#  int asyscall(...)
+#
+# */
+# import "C"
+#
+# func callasyscall(...) (r1 uintptr, e1 Errno) {
+#        r1 = uintptr(C.asyscall(...))
+#        e1 = syscall.GetErrno()
+#        return
+# }
+
+
+
+use strict;
+
+my $cmdline = "mksyscall_aix_ppc64.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 = "";
+# GCCGO
+my $textgccgo = "";
+my $c_extern = "/*\n#include <stdint.h>\n";
+# GC
+my $textgc = "";
+my $dynimports = "";
+my $linknames = "";
+my @vars = ();
+# COMMUN
+my $textcommon = "";
+
+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);
+
+       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 = <<EOF;
+// $cmdline
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build $tags
+
+package $package
+
+import (
+       "unsafe"
+)
+
+EOF
+
+$tofcommun .= "import \"golang.org/x/sys/unix\"\n" if $package ne "unix";
+
+$tofcommun .=<<EOF;
+
+$textcommon
+EOF
+print $fcommun $tofcommun;
+
+
+# Print zsyscall_aix_ppc64_gc.go
+open(my $fgc, '>', 'zsyscall_aix_ppc64_gc.go');
+my $tofgc = <<EOF;
+// $cmdline
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build $tags
+// +build !gccgo
+
+package $package
+
+import (
+       "unsafe"
+)
+
+
+EOF
+
+$tofgc .= "import \"golang.org/x/sys/unix\"\n" if $package ne "unix";
+
+my $vardecls = "\t" . join(",\n\t", @vars);
+$vardecls .= " syscallFunc";
+
+$tofgc .=<<EOF;
+$dynimports
+$linknames
+type syscallFunc uintptr
+
+var (
+$vardecls
+)
+
+// 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)
+
+$textgc
+EOF
+print $fgc $tofgc;
+
+# Print zsyscall_aix_ppc64_gc.go
+open(my $fgccgo, '>', 'zsyscall_aix_ppc64_gccgo.go');
+my $tofgccgo = <<EOF;
+// $cmdline
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build $tags
+// +build gccgo
+
+package $package
+
+
+$c_extern
+*/
+import "C"
+import (
+       "syscall"
+)
+
+
+EOF
+
+$tofgccgo .= "import \"golang.org/x/sys/unix\"\n" if $package ne "unix";
+
+$tofgccgo .=<<EOF;
+
+$textgccgo
+EOF
+print $fgccgo $tofgccgo;
+exit 0;
index 3e6ed9df8e08d8b343216fca2873ec8e8dd78d1b..a354df5a6bfd678cb722ccd7ed0795f7c94ac4c2 100755 (executable)
@@ -92,6 +92,11 @@ while(<>) {
        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";
+
        # So file name.
        if($modname eq "") {
                $modname = "libc";
index 49f186f8321b32bbd55df7105bf7289a7fcf46fa..20632e14608e37ba2ff7c5b3f467009cf315b51a 100755 (executable)
@@ -32,6 +32,7 @@ my @headers = qw (
        sys/sem.h
        sys/shm.h
        sys/vmmeter.h
+       uvm/uvmexp.h
        uvm/uvm_param.h
        uvm/uvm_swap_encrypt.h
        ddb/db_var.h
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 (executable)
index 5453c53..0000000
+++ /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 <<EOF;
-// $command
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build $ENV{'GOARCH'},$ENV{'GOOS'}
-
-package unix
-
-const (
-EOF
-
-while(<>){
-       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 <<EOF;
-)
-EOF
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl
deleted file mode 100755 (executable)
index 6804f41..0000000
+++ /dev/null
@@ -1,50 +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 DragonFly from master list
-# (for example, /usr/src/sys/kern/syscalls.master).
-
-use strict;
-
-if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
-       print STDERR "GOARCH or GOOS not defined in environment\n";
-       exit 1;
-}
-
-my $command = "mksysnum_dragonfly.pl " . join(' ', @ARGV);
-
-print <<EOF;
-// $command
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build $ENV{'GOARCH'},$ENV{'GOOS'}
-
-package unix
-
-const (
-EOF
-
-while(<>){
-       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 <<EOF;
-)
-EOF
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl
deleted file mode 100755 (executable)
index a0a22bf..0000000
+++ /dev/null
@@ -1,50 +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 FreeBSD from master list
-# (for example, /usr/src/sys/kern/syscalls.master).
-
-use strict;
-
-if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
-       print STDERR "GOARCH or GOOS not defined in environment\n";
-       exit 1;
-}
-
-my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV);
-
-print <<EOF;
-// $command
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build $ENV{'GOARCH'},$ENV{'GOOS'}
-
-package unix
-
-const (
-EOF
-
-while(<>){
-       if(/^([0-9]+)\s+\S+\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 <<EOF;
-)
-EOF
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl
deleted file mode 100755 (executable)
index 85988b1..0000000
+++ /dev/null
@@ -1,58 +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 OpenBSD from master list
-# (for example, /usr/src/sys/kern/syscalls.master).
-
-use strict;
-
-if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
-       print STDERR "GOARCH or GOOS not defined in environment\n";
-       exit 1;
-}
-
-my $command = "mksysnum_netbsd.pl " . join(' ', @ARGV);
-
-print <<EOF;
-// $command
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build $ENV{'GOARCH'},$ENV{'GOOS'}
-
-package unix
-
-const (
-EOF
-
-my $line = '';
-while(<>){
-       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 <<EOF;
-)
-EOF
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl b/src/cmd/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl
deleted file mode 100755 (executable)
index 84edf60..0000000
+++ /dev/null
@@ -1,50 +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 OpenBSD from master list
-# (for example, /usr/src/sys/kern/syscalls.master).
-
-use strict;
-
-if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") {
-       print STDERR "GOARCH or GOOS not defined in environment\n";
-       exit 1;
-}
-
-my $command = "mksysnum_openbsd.pl " . join(' ', @ARGV);
-
-print <<EOF;
-// $command
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-// +build $ENV{'GOARCH'},$ENV{'GOOS'}
-
-package unix
-
-const (
-EOF
-
-while(<>){
-       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 <<EOF;
-)
-EOF
index 3258ca328489d2bbc55387653bbe2c215ca07cb0..d4c4ef9264daa5a8d9243e37e2e01b903d8397d3 100644 (file)
@@ -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)
        }
index 9b1e86a12bae62f5e4c6a5c23a21c7de2180e14f..230a36d2490a3c02cb287b1905cd86f3589df8fc 100644 (file)
 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
 }
index 734d76585753f1d6a07ce33a2762728244fff4d4..3ded960712a214b48daea26305d5b533e7292184 100644 (file)
@@ -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 (file)
index 0000000..aebc2dc
--- /dev/null
@@ -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
+}
index 83c85e0196fafdbb4aa18a137c4f035f929583e2..bc2f3629a7a95c223ac63e8df1f611660d8327e8 100644 (file)
@@ -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.
 
index dd0820431e9a534cfef0f7d5036064759085f183..ad026678c7ca9d13c30922211d9ac1c1c5394d5f 100644 (file)
@@ -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/sendfile_test.go b/src/cmd/vendor/golang.org/x/sys/unix/sendfile_test.go
new file mode 100644 (file)
index 0000000..d41fb93
--- /dev/null
@@ -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
+}
index bb756ece15853a62fc554d862f722a7578ee75a0..5f9ae233a7a62af88a77d9d0142aa78f546394e2 100644 (file)
@@ -2,23 +2,36 @@
 // 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"
+)
 
 // 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
+       salign := SizeofPtr
+
+       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)
 }
 
index 35ed6643536f4db3c9ac52e66d4bacce25b1cde7..17fb698683132287d9f81b1d81462dc61df6be73 100644 (file)
@@ -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
 
index ef35fce8041a1b1eb3681b5831dee3ea2d6e6740..0d4b1d7a20e6ade73e85a11088cf63e37ea8391a 100644 (file)
@@ -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 (file)
index 0000000..1351a22
--- /dev/null
@@ -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 "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
+}
+
+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
+}
+
+//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)
+
+/*
+ * 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 (file)
index 0000000..c28af1f
--- /dev/null
@@ -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 (file)
index 0000000..881cacc
--- /dev/null
@@ -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 (file)
index 0000000..6f55c07
--- /dev/null
@@ -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
+}
index 53fb8518237d9d985d730f55c7292f57d9c1f03c..33c8b5f0db728bc684b99f5bdb765b58a5f2b087 100644 (file)
@@ -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
 }
index 6c4e2aca04b0fd59267c516ad448bd6bbae00c5a..12924cb83dfa3f5dc89e9136fdbd322d6d6aac48 100644 (file)
@@ -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)
        }
index 79e94767deb22a12e13529cf453d40f5b85ac83b..04042e44b4a3bef28499b47661b45f684feb8431 100644 (file)
@@ -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 {
@@ -199,7 +187,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 +229,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 +248,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 +264,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 {
@@ -274,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
@@ -313,11 +320,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)))
 }
 
@@ -387,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
  */
@@ -411,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)
@@ -436,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)
@@ -468,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)
@@ -529,10 +541,6 @@ func Uname(uname *Utsname) error {
 // Watchevent
 // Waitevent
 // Modwatch
-// Fgetxattr
-// Fsetxattr
-// Fremovexattr
-// Flistxattr
 // Fsctl
 // Initgroups
 // Posix_spawn
index b3ac109a2f42dc4947ad70ece77f606acd5dbdc5..489726fa9bdbce0e3cc76580735ae1d06b861c47 100644 (file)
@@ -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
index 75219444a8d26903c2f9e2cc7035018c33347b8c..914b89bde5aae69bd8fdf9cad72e2361b08b949e 100644 (file)
@@ -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
index faae207a4780394aeba0bad61cdc9f153bbfb9b9..4a284cf5025f28c8f8a8841c5ae9a161149b28c0 100644 (file)
@@ -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
+}
index d6d962801426b4933668aea10c2af2166a34b33c..52dcd88f6bf98c8906502a3152af66eb42bb2966 100644 (file)
@@ -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 (file)
index 0000000..4b4ae46
--- /dev/null
@@ -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))
+}
index 65691d5c1b2f2a2e65d00d9ea3839807f917585b..7faa295fcefd16db523e2d6aecbabd4a2ef735e5 100644 (file)
@@ -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)
+       }
+}
index b5072de28535390886951b0f0ad7451a3d278d76..891c94d7e26b661fd7e9cc10dd18c75e58388e9b 100644 (file)
@@ -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)))
 }
 
@@ -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
  */
@@ -248,11 +255,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 +289,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 +325,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)
index ba9df4ac1264958bafc6286e33523f6208c39a40..a7ca1ebea315ee091b3a6b9924bb02cd7c5ec1db 100644 (file)
 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,241 @@ 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
+}
+
+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
  */
@@ -477,13 +546,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 +577,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 +613,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 +670,7 @@ func Uname(uname *Utsname) error {
 // Kqueue_portset
 // Getattrlist
 // Setattrlist
+// Getdents
 // Getdirentriesattr
 // Searchfs
 // Delete
@@ -602,14 +678,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_freebsd_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
new file mode 100644 (file)
index 0000000..a318054
--- /dev/null
@@ -0,0 +1,52 @@
+// 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 arm64,freebsd
+
+package unix
+
+import (
+       "syscall"
+       "unsafe"
+)
+
+func setTimespec(sec, nsec int64) Timespec {
+       return Timespec{Sec: sec, Nsec: nsec}
+}
+
+func setTimeval(sec, usec int64) Timeval {
+       return Timeval{Sec: sec, Usec: usec}
+}
+
+func SetKevent(k *Kevent_t, fd, mode, flags int) {
+       k.Ident = uint64(fd)
+       k.Filter = int16(mode)
+       k.Flags = uint16(flags)
+}
+
+func (iov *Iovec) SetLen(length int) {
+       iov.Len = uint64(length)
+}
+
+func (msghdr *Msghdr) SetControllen(length int) {
+       msghdr.Controllen = uint32(length)
+}
+
+func (cmsg *Cmsghdr) SetLen(length int) {
+       cmsg.Len = uint32(length)
+}
+
+func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+       var writtenOut uint64 = 0
+       _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
+
+       written = int(writtenOut)
+
+       if e1 != 0 {
+               err = e1
+       }
+       return
+}
+
+func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
index 9908030cbe3209ac1a005c559c16b4ada932e55d..77604023335b637f475e3f4bf485ccb225897d54 100644 (file)
@@ -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
@@ -1196,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
@@ -1208,9 +1379,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 +1396,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 +1419,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 +1430,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 +1442,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 +1510,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 +1528,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 +1603,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 +1649,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
 // Pselect6
 // Ptrace
 // Putpmsg
-// QueryModule
 // Quotactl
 // Readahead
 // Readv
index 5f9b2454add9b8831dcbdbf7e8da928872ff0ae4..615f2918adac3d2684a5af3ca1fe78df32cb9ac1 100644 (file)
@@ -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)
+}
index 3ec7a9329d2984d5d19f56d3c093351b08f64620..ad2bd2582f3bbe1365ad1406f70320161392cbe7 100644 (file)
@@ -257,3 +257,11 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
        }
        return poll(&fds[0], len(fds), timeout)
 }
+
+//sys  armSyncFileRange(fd int, flags int, off int64, n int64) (err error) = SYS_ARM_SYNC_FILE_RANGE
+
+func SyncFileRange(fd int, off int64, n int64, flags int) error {
+       // The sync_file_range and arm_sync_file_range syscalls differ only in the
+       // order of their arguments.
+       return armSyncFileRange(fd, flags, off, n)
+}
index 646f295ade0cc100bec7cf754419a90c5af6bd84..fa5a9a6f64987d8c50d49c6a73afc57edaf1f128 100644 (file)
@@ -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) {
index ad991031c7e0738403614624895ce6cb6d81d605..18541dc5730bc797f8838e1e76d9a9c5e46479d7 100644 (file)
@@ -12,7 +12,6 @@ package unix
 //sys  EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
 //sys  Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
 //sys  Fchown(fd int, uid int, gid int) (err error)
-//sys  Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
 //sys  Fstatfs(fd int, buf *Statfs_t) (err error)
 //sys  Ftruncate(fd int, length int64) (err error)
 //sysnb        Getegid() (egid int)
@@ -148,6 +147,7 @@ type stat_t struct {
 }
 
 //sys  fstat(fd int, st *stat_t) (err error)
+//sys  fstatat(dirfd int, path string, st *stat_t, flags int) (err error) = SYS_NEWFSTATAT
 //sys  lstat(path string, st *stat_t) (err error)
 //sys  stat(path string, st *stat_t) (err error)
 
@@ -158,6 +158,13 @@ func Fstat(fd int, s *Stat_t) (err error) {
        return
 }
 
+func Fstatat(dirfd int, path string, s *Stat_t, flags int) (err error) {
+       st := &stat_t{}
+       err = fstatat(dirfd, path, st, flags)
+       fillStat_t(s, st)
+       return
+}
+
 func Lstat(path string, s *Stat_t) (err error) {
        st := &stat_t{}
        err = lstat(path, st)
index 0e059248209caf89772df888fe1f5b6da6be14a9..99e0e999a1af5c63ddb8154e1e97fca82a352732 100644 (file)
@@ -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
 }
 
index 8c6720f7f48521a61283b44be709ecbc781019a0..41451854bc01ebbdd8a05c8bdff5d6836400ee4f 100644 (file)
@@ -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 (file)
index 0000000..44aa122
--- /dev/null
@@ -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)
+}
index 6e4ee0cf2a175239e00d40cea3e2105d26b0a853..f52f148f9ff3594a4cfe1c721f4d8bbdb96723c1 100644 (file)
@@ -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)
+}
index eed17268b08a12494a0608cc4f3f003eaf177a12..758efa66e57952948d80e08fc0a4336f932c8612 100644 (file)
@@ -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)
        }
 }
index 369a2be2dcbdeec89df14b85c8b3768ac889fb3e..5240e16e4b34f1117723b833c330d4227d2fbdfb 100644 (file)
@@ -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)
@@ -219,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
  */
@@ -233,6 +265,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 +284,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 +309,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 +346,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 (file)
index 0000000..41141f9
--- /dev/null
@@ -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)]))
+}
index 9fc9c06a08b096ffdf61edc1050eaa9f108d39ab..687999549c80048ce621bf1043a92cef8cdeac5d 100644 (file)
@@ -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 {
@@ -77,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
@@ -113,11 +137,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 +165,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 +240,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 +267,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 +309,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 +337,11 @@ func Uname(uname *Utsname) error {
 // clock_settime
 // closefrom
 // execve
-// faccessat
-// fchmodat
-// fchownat
 // fcntl
 // fhopen
 // fhstat
 // fhstatfs
 // fork
-// fstatat
 // futimens
 // getfh
 // getgid
@@ -316,12 +355,8 @@ func Uname(uname *Utsname) error {
 // lfs_markv
 // lfs_segclean
 // lfs_segwait
-// linkat
 // mincore
 // minherit
-// mkdirat
-// mkfifoat
-// mknodat
 // mount
 // mquery
 // msgctl
@@ -330,12 +365,10 @@ func Uname(uname *Utsname) error {
 // msgsnd
 // nfssvc
 // nnpfspioctl
-// openat
 // preadv
 // profil
 // pwritev
 // quotactl
-// readlinkat
 // readv
 // reboot
 // renameat
@@ -356,13 +389,11 @@ func Uname(uname *Utsname) error {
 // sigprocmask
 // sigreturn
 // sigsuspend
-// symlinkat
 // sysarch
 // syscall
 // threxit
 // thrsigdivert
 // thrsleep
 // thrwakeup
-// unlinkat
 // vfork
 // writev
index 994964a9164d8affeabe3aba168a313d3ffe32bc..d62da60d1ff52320c4761bab9a4441fcecb09fe9 100644 (file)
@@ -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
index 59844f50411048e3ded33b4c96849c46995a679a..5d812aaea53e3d66842ff5acb0b5a9f475c566cd 100644 (file)
@@ -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 (file)
index 0000000..b95f334
--- /dev/null
@@ -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)
+}
index 820ef77af279cf50ce083b115aa280b2de1ac7d9..e4780127537d829dca99e4cbc4dda939fc701a4e 100644 (file)
@@ -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)))
 }
 
@@ -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
  */
index a8eef7cf8301b0106fe6818ebee6e8b38e337e2b..dc857840a436cc5f85cac375c775162dbd05ddd8 100644 (file)
@@ -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
 
index b835bad0fe47357da17e1cbe4a8e2563b15e84f7..33583a22b67c42b478ed31295c8715285dfbf44e 100644 (file)
@@ -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
 }
@@ -359,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) }
index 4cb8e8edf1a19aead18a77f37572adacbcb0d6d5..1c70d1b6902b1f6b6a778cff3e14288c58ee0b3d 100644 (file)
@@ -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 (file)
index 0000000..86dc765
--- /dev/null
@@ -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)
+}
index d694990dbe0171b20878691ff9a0c47530d5d329..c1b1ea59a0adc53c47a1f4289697019d1a767246 100644 (file)
@@ -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()
@@ -334,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)
@@ -450,9 +459,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 +481,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)
index 47b9011ee9636fd7672764c0442cf463dc7b78f6..4a672f56942abd067302123f5da066b038d79807 100644 (file)
@@ -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
 
index 4215f46d197c303e454f4cc9192e2751cc9bb746..1a72fdb362af91143e94489c7daf7f3149c45104 100644 (file)
@@ -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 (file)
index 0000000..30c1d71
--- /dev/null
@@ -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
+}
index b8b28d0c119e941a573c7691e6a37e029c922a84..57fc84fb0f870a67099aac917b4d0f227d192dff 100644 (file)
@@ -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 (file)
index 0000000..4b7b965
--- /dev/null
@@ -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 (file)
index 0000000..ed04fd1
--- /dev/null
@@ -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"},
+}
index 46a082b6d59f267833c29fce68ea2c5ea7994849..bbe6089bb7ecb74ec01a825d7573a069ff8ae059 100644 (file)
@@ -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
index 2947dc0382e4db808b45aefcbd277a9e7b5a9a2a..d2bbaabc87faa2cbac459e605204bb63a575bbcc 100644 (file)
@@ -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
index c600d012d069deafa330d72a5669ab2744f3b774..4f8db783d3cc0f892d2d3104fd6e533bbd535438 100644 (file)
@@ -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
index e8240d2397b2e21f11382a6edfe14d98f4685e9d..53e5de605184ab6636eebf3b32aa9a222307fd64 100644 (file)
@@ -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_freebsd_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go
new file mode 100644 (file)
index 0000000..d4a192f
--- /dev/null
@@ -0,0 +1,1794 @@
+// mkerrors.sh -m64
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build arm64,freebsd
+
+// Created by cgo -godefs - DO NOT EDIT
+// cgo -godefs -- -m64 _const.go
+
+package unix
+
+import "syscall"
+
+const (
+       AF_APPLETALK                   = 0x10
+       AF_ARP                         = 0x23
+       AF_ATM                         = 0x1e
+       AF_BLUETOOTH                   = 0x24
+       AF_CCITT                       = 0xa
+       AF_CHAOS                       = 0x5
+       AF_CNT                         = 0x15
+       AF_COIP                        = 0x14
+       AF_DATAKIT                     = 0x9
+       AF_DECnet                      = 0xc
+       AF_DLI                         = 0xd
+       AF_E164                        = 0x1a
+       AF_ECMA                        = 0x8
+       AF_HYLINK                      = 0xf
+       AF_IEEE80211                   = 0x25
+       AF_IMPLINK                     = 0x3
+       AF_INET                        = 0x2
+       AF_INET6                       = 0x1c
+       AF_INET6_SDP                   = 0x2a
+       AF_INET_SDP                    = 0x28
+       AF_IPX                         = 0x17
+       AF_ISDN                        = 0x1a
+       AF_ISO                         = 0x7
+       AF_LAT                         = 0xe
+       AF_LINK                        = 0x12
+       AF_LOCAL                       = 0x1
+       AF_MAX                         = 0x2a
+       AF_NATM                        = 0x1d
+       AF_NETBIOS                     = 0x6
+       AF_NETGRAPH                    = 0x20
+       AF_OSI                         = 0x7
+       AF_PUP                         = 0x4
+       AF_ROUTE                       = 0x11
+       AF_SCLUSTER                    = 0x22
+       AF_SIP                         = 0x18
+       AF_SLOW                        = 0x21
+       AF_SNA                         = 0xb
+       AF_UNIX                        = 0x1
+       AF_UNSPEC                      = 0x0
+       AF_VENDOR00                    = 0x27
+       AF_VENDOR01                    = 0x29
+       AF_VENDOR02                    = 0x2b
+       AF_VENDOR03                    = 0x2d
+       AF_VENDOR04                    = 0x2f
+       AF_VENDOR05                    = 0x31
+       AF_VENDOR06                    = 0x33
+       AF_VENDOR07                    = 0x35
+       AF_VENDOR08                    = 0x37
+       AF_VENDOR09                    = 0x39
+       AF_VENDOR10                    = 0x3b
+       AF_VENDOR11                    = 0x3d
+       AF_VENDOR12                    = 0x3f
+       AF_VENDOR13                    = 0x41
+       AF_VENDOR14                    = 0x43
+       AF_VENDOR15                    = 0x45
+       AF_VENDOR16                    = 0x47
+       AF_VENDOR17                    = 0x49
+       AF_VENDOR18                    = 0x4b
+       AF_VENDOR19                    = 0x4d
+       AF_VENDOR20                    = 0x4f
+       AF_VENDOR21                    = 0x51
+       AF_VENDOR22                    = 0x53
+       AF_VENDOR23                    = 0x55
+       AF_VENDOR24                    = 0x57
+       AF_VENDOR25                    = 0x59
+       AF_VENDOR26                    = 0x5b
+       AF_VENDOR27                    = 0x5d
+       AF_VENDOR28                    = 0x5f
+       AF_VENDOR29                    = 0x61
+       AF_VENDOR30                    = 0x63
+       AF_VENDOR31                    = 0x65
+       AF_VENDOR32                    = 0x67
+       AF_VENDOR33                    = 0x69
+       AF_VENDOR34                    = 0x6b
+       AF_VENDOR35                    = 0x6d
+       AF_VENDOR36                    = 0x6f
+       AF_VENDOR37                    = 0x71
+       AF_VENDOR38                    = 0x73
+       AF_VENDOR39                    = 0x75
+       AF_VENDOR40                    = 0x77
+       AF_VENDOR41                    = 0x79
+       AF_VENDOR42                    = 0x7b
+       AF_VENDOR43                    = 0x7d
+       AF_VENDOR44                    = 0x7f
+       AF_VENDOR45                    = 0x81
+       AF_VENDOR46                    = 0x83
+       AF_VENDOR47                    = 0x85
+       ALTWERASE                      = 0x200
+       B0                             = 0x0
+       B110                           = 0x6e
+       B115200                        = 0x1c200
+       B1200                          = 0x4b0
+       B134                           = 0x86
+       B14400                         = 0x3840
+       B150                           = 0x96
+       B1800                          = 0x708
+       B19200                         = 0x4b00
+       B200                           = 0xc8
+       B230400                        = 0x38400
+       B2400                          = 0x960
+       B28800                         = 0x7080
+       B300                           = 0x12c
+       B38400                         = 0x9600
+       B460800                        = 0x70800
+       B4800                          = 0x12c0
+       B50                            = 0x32
+       B57600                         = 0xe100
+       B600                           = 0x258
+       B7200                          = 0x1c20
+       B75                            = 0x4b
+       B76800                         = 0x12c00
+       B921600                        = 0xe1000
+       B9600                          = 0x2580
+       BIOCFEEDBACK                   = 0x8004427c
+       BIOCFLUSH                      = 0x20004268
+       BIOCGBLEN                      = 0x40044266
+       BIOCGDIRECTION                 = 0x40044276
+       BIOCGDLT                       = 0x4004426a
+       BIOCGDLTLIST                   = 0xc0104279
+       BIOCGETBUFMODE                 = 0x4004427d
+       BIOCGETIF                      = 0x4020426b
+       BIOCGETZMAX                    = 0x4008427f
+       BIOCGHDRCMPLT                  = 0x40044274
+       BIOCGRSIG                      = 0x40044272
+       BIOCGRTIMEOUT                  = 0x4010426e
+       BIOCGSEESENT                   = 0x40044276
+       BIOCGSTATS                     = 0x4008426f
+       BIOCGTSTAMP                    = 0x40044283
+       BIOCIMMEDIATE                  = 0x80044270
+       BIOCLOCK                       = 0x2000427a
+       BIOCPROMISC                    = 0x20004269
+       BIOCROTZBUF                    = 0x40184280
+       BIOCSBLEN                      = 0xc0044266
+       BIOCSDIRECTION                 = 0x80044277
+       BIOCSDLT                       = 0x80044278
+       BIOCSETBUFMODE                 = 0x8004427e
+       BIOCSETF                       = 0x80104267
+       BIOCSETFNR                     = 0x80104282
+       BIOCSETIF                      = 0x8020426c
+       BIOCSETWF                      = 0x8010427b
+       BIOCSETZBUF                    = 0x80184281
+       BIOCSHDRCMPLT                  = 0x80044275
+       BIOCSRSIG                      = 0x80044273
+       BIOCSRTIMEOUT                  = 0x8010426d
+       BIOCSSEESENT                   = 0x80044277
+       BIOCSTSTAMP                    = 0x80044284
+       BIOCVERSION                    = 0x40044271
+       BPF_A                          = 0x10
+       BPF_ABS                        = 0x20
+       BPF_ADD                        = 0x0
+       BPF_ALIGNMENT                  = 0x8
+       BPF_ALU                        = 0x4
+       BPF_AND                        = 0x50
+       BPF_B                          = 0x10
+       BPF_BUFMODE_BUFFER             = 0x1
+       BPF_BUFMODE_ZBUF               = 0x2
+       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_LSH                        = 0x60
+       BPF_MAJOR_VERSION              = 0x1
+       BPF_MAXBUFSIZE                 = 0x80000
+       BPF_MAXINSNS                   = 0x200
+       BPF_MEM                        = 0x60
+       BPF_MEMWORDS                   = 0x10
+       BPF_MINBUFSIZE                 = 0x20
+       BPF_MINOR_VERSION              = 0x1
+       BPF_MISC                       = 0x7
+       BPF_MOD                        = 0x90
+       BPF_MSH                        = 0xa0
+       BPF_MUL                        = 0x20
+       BPF_NEG                        = 0x80
+       BPF_OR                         = 0x40
+       BPF_RELEASE                    = 0x30bb6
+       BPF_RET                        = 0x6
+       BPF_RSH                        = 0x70
+       BPF_ST                         = 0x2
+       BPF_STX                        = 0x3
+       BPF_SUB                        = 0x10
+       BPF_TAX                        = 0x0
+       BPF_TXA                        = 0x80
+       BPF_T_BINTIME                  = 0x2
+       BPF_T_BINTIME_FAST             = 0x102
+       BPF_T_BINTIME_MONOTONIC        = 0x202
+       BPF_T_BINTIME_MONOTONIC_FAST   = 0x302
+       BPF_T_FAST                     = 0x100
+       BPF_T_FLAG_MASK                = 0x300
+       BPF_T_FORMAT_MASK              = 0x3
+       BPF_T_MICROTIME                = 0x0
+       BPF_T_MICROTIME_FAST           = 0x100
+       BPF_T_MICROTIME_MONOTONIC      = 0x200
+       BPF_T_MICROTIME_MONOTONIC_FAST = 0x300
+       BPF_T_MONOTONIC                = 0x200
+       BPF_T_MONOTONIC_FAST           = 0x300
+       BPF_T_NANOTIME                 = 0x1
+       BPF_T_NANOTIME_FAST            = 0x101
+       BPF_T_NANOTIME_MONOTONIC       = 0x201
+       BPF_T_NANOTIME_MONOTONIC_FAST  = 0x301
+       BPF_T_NONE                     = 0x3
+       BPF_T_NORMAL                   = 0x0
+       BPF_W                          = 0x0
+       BPF_X                          = 0x8
+       BPF_XOR                        = 0xa0
+       BRKINT                         = 0x2
+       CAP_ACCEPT                     = 0x200000020000000
+       CAP_ACL_CHECK                  = 0x400000000010000
+       CAP_ACL_DELETE                 = 0x400000000020000
+       CAP_ACL_GET                    = 0x400000000040000
+       CAP_ACL_SET                    = 0x400000000080000
+       CAP_ALL0                       = 0x20007ffffffffff
+       CAP_ALL1                       = 0x4000000001fffff
+       CAP_BIND                       = 0x200000040000000
+       CAP_BINDAT                     = 0x200008000000400
+       CAP_CHFLAGSAT                  = 0x200000000001400
+       CAP_CONNECT                    = 0x200000080000000
+       CAP_CONNECTAT                  = 0x200010000000400
+       CAP_CREATE                     = 0x200000000000040
+       CAP_EVENT                      = 0x400000000000020
+       CAP_EXTATTR_DELETE             = 0x400000000001000
+       CAP_EXTATTR_GET                = 0x400000000002000
+       CAP_EXTATTR_LIST               = 0x400000000004000
+       CAP_EXTATTR_SET                = 0x400000000008000
+       CAP_FCHDIR                     = 0x200000000000800
+       CAP_FCHFLAGS                   = 0x200000000001000
+       CAP_FCHMOD                     = 0x200000000002000
+       CAP_FCHMODAT                   = 0x200000000002400
+       CAP_FCHOWN                     = 0x200000000004000
+       CAP_FCHOWNAT                   = 0x200000000004400
+       CAP_FCNTL                      = 0x200000000008000
+       CAP_FCNTL_ALL                  = 0x78
+       CAP_FCNTL_GETFL                = 0x8
+       CAP_FCNTL_GETOWN               = 0x20
+       CAP_FCNTL_SETFL                = 0x10
+       CAP_FCNTL_SETOWN               = 0x40
+       CAP_FEXECVE                    = 0x200000000000080
+       CAP_FLOCK                      = 0x200000000010000
+       CAP_FPATHCONF                  = 0x200000000020000
+       CAP_FSCK                       = 0x200000000040000
+       CAP_FSTAT                      = 0x200000000080000
+       CAP_FSTATAT                    = 0x200000000080400
+       CAP_FSTATFS                    = 0x200000000100000
+       CAP_FSYNC                      = 0x200000000000100
+       CAP_FTRUNCATE                  = 0x200000000000200
+       CAP_FUTIMES                    = 0x200000000200000
+       CAP_FUTIMESAT                  = 0x200000000200400
+       CAP_GETPEERNAME                = 0x200000100000000
+       CAP_GETSOCKNAME                = 0x200000200000000
+       CAP_GETSOCKOPT                 = 0x200000400000000
+       CAP_IOCTL                      = 0x400000000000080
+       CAP_IOCTLS_ALL                 = 0x7fffffffffffffff
+       CAP_KQUEUE                     = 0x400000000100040
+       CAP_KQUEUE_CHANGE              = 0x400000000100000
+       CAP_KQUEUE_EVENT               = 0x400000000000040
+       CAP_LINKAT_SOURCE              = 0x200020000000400
+       CAP_LINKAT_TARGET              = 0x200000000400400
+       CAP_LISTEN                     = 0x200000800000000
+       CAP_LOOKUP                     = 0x200000000000400
+       CAP_MAC_GET                    = 0x400000000000001
+       CAP_MAC_SET                    = 0x400000000000002
+       CAP_MKDIRAT                    = 0x200000000800400
+       CAP_MKFIFOAT                   = 0x200000001000400
+       CAP_MKNODAT                    = 0x200000002000400
+       CAP_MMAP                       = 0x200000000000010
+       CAP_MMAP_R                     = 0x20000000000001d
+       CAP_MMAP_RW                    = 0x20000000000001f
+       CAP_MMAP_RWX                   = 0x20000000000003f
+       CAP_MMAP_RX                    = 0x20000000000003d
+       CAP_MMAP_W                     = 0x20000000000001e
+       CAP_MMAP_WX                    = 0x20000000000003e
+       CAP_MMAP_X                     = 0x20000000000003c
+       CAP_PDGETPID                   = 0x400000000000200
+       CAP_PDKILL                     = 0x400000000000800
+       CAP_PDWAIT                     = 0x400000000000400
+       CAP_PEELOFF                    = 0x200001000000000
+       CAP_POLL_EVENT                 = 0x400000000000020
+       CAP_PREAD                      = 0x20000000000000d
+       CAP_PWRITE                     = 0x20000000000000e
+       CAP_READ                       = 0x200000000000001
+       CAP_RECV                       = 0x200000000000001
+       CAP_RENAMEAT_SOURCE            = 0x200000004000400
+       CAP_RENAMEAT_TARGET            = 0x200040000000400
+       CAP_RIGHTS_VERSION             = 0x0
+       CAP_RIGHTS_VERSION_00          = 0x0
+       CAP_SEEK                       = 0x20000000000000c
+       CAP_SEEK_TELL                  = 0x200000000000004
+       CAP_SEM_GETVALUE               = 0x400000000000004
+       CAP_SEM_POST                   = 0x400000000000008
+       CAP_SEM_WAIT                   = 0x400000000000010
+       CAP_SEND                       = 0x200000000000002
+       CAP_SETSOCKOPT                 = 0x200002000000000
+       CAP_SHUTDOWN                   = 0x200004000000000
+       CAP_SOCK_CLIENT                = 0x200007780000003
+       CAP_SOCK_SERVER                = 0x200007f60000003
+       CAP_SYMLINKAT                  = 0x200000008000400
+       CAP_TTYHOOK                    = 0x400000000000100
+       CAP_UNLINKAT                   = 0x200000010000400
+       CAP_UNUSED0_44                 = 0x200080000000000
+       CAP_UNUSED0_57                 = 0x300000000000000
+       CAP_UNUSED1_22                 = 0x400000000200000
+       CAP_UNUSED1_57                 = 0x500000000000000
+       CAP_WRITE                      = 0x200000000000002
+       CFLUSH                         = 0xf
+       CLOCAL                         = 0x8000
+       CLOCK_MONOTONIC                = 0x4
+       CLOCK_MONOTONIC_FAST           = 0xc
+       CLOCK_MONOTONIC_PRECISE        = 0xb
+       CLOCK_PROCESS_CPUTIME_ID       = 0xf
+       CLOCK_PROF                     = 0x2
+       CLOCK_REALTIME                 = 0x0
+       CLOCK_REALTIME_FAST            = 0xa
+       CLOCK_REALTIME_PRECISE         = 0x9
+       CLOCK_SECOND                   = 0xd
+       CLOCK_THREAD_CPUTIME_ID        = 0xe
+       CLOCK_UPTIME                   = 0x5
+       CLOCK_UPTIME_FAST              = 0x8
+       CLOCK_UPTIME_PRECISE           = 0x7
+       CLOCK_VIRTUAL                  = 0x1
+       CREAD                          = 0x800
+       CRTSCTS                        = 0x30000
+       CS5                            = 0x0
+       CS6                            = 0x100
+       CS7                            = 0x200
+       CS8                            = 0x300
+       CSIZE                          = 0x300
+       CSTART                         = 0x11
+       CSTATUS                        = 0x14
+       CSTOP                          = 0x13
+       CSTOPB                         = 0x400
+       CSUSP                          = 0x1a
+       CTL_HW                         = 0x6
+       CTL_KERN                       = 0x1
+       CTL_MAXNAME                    = 0x18
+       CTL_NET                        = 0x4
+       DLT_A429                       = 0xb8
+       DLT_A653_ICM                   = 0xb9
+       DLT_AIRONET_HEADER             = 0x78
+       DLT_AOS                        = 0xde
+       DLT_APPLE_IP_OVER_IEEE1394     = 0x8a
+       DLT_ARCNET                     = 0x7
+       DLT_ARCNET_LINUX               = 0x81
+       DLT_ATM_CLIP                   = 0x13
+       DLT_ATM_RFC1483                = 0xb
+       DLT_AURORA                     = 0x7e
+       DLT_AX25                       = 0x3
+       DLT_AX25_KISS                  = 0xca
+       DLT_BACNET_MS_TP               = 0xa5
+       DLT_BLUETOOTH_BREDR_BB         = 0xff
+       DLT_BLUETOOTH_HCI_H4           = 0xbb
+       DLT_BLUETOOTH_HCI_H4_WITH_PHDR = 0xc9
+       DLT_BLUETOOTH_LE_LL            = 0xfb
+       DLT_BLUETOOTH_LE_LL_WITH_PHDR  = 0x100
+       DLT_BLUETOOTH_LINUX_MONITOR    = 0xfe
+       DLT_CAN20B                     = 0xbe
+       DLT_CAN_SOCKETCAN              = 0xe3
+       DLT_CHAOS                      = 0x5
+       DLT_CHDLC                      = 0x68
+       DLT_CISCO_IOS                  = 0x76
+       DLT_C_HDLC                     = 0x68
+       DLT_C_HDLC_WITH_DIR            = 0xcd
+       DLT_DBUS                       = 0xe7
+       DLT_DECT                       = 0xdd
+       DLT_DOCSIS                     = 0x8f
+       DLT_DVB_CI                     = 0xeb
+       DLT_ECONET                     = 0x73
+       DLT_EN10MB                     = 0x1
+       DLT_EN3MB                      = 0x2
+       DLT_ENC                        = 0x6d
+       DLT_EPON                       = 0x103
+       DLT_ERF                        = 0xc5
+       DLT_ERF_ETH                    = 0xaf
+       DLT_ERF_POS                    = 0xb0
+       DLT_FC_2                       = 0xe0
+       DLT_FC_2_WITH_FRAME_DELIMS     = 0xe1
+       DLT_FDDI                       = 0xa
+       DLT_FLEXRAY                    = 0xd2
+       DLT_FRELAY                     = 0x6b
+       DLT_FRELAY_WITH_DIR            = 0xce
+       DLT_GCOM_SERIAL                = 0xad
+       DLT_GCOM_T1E1                  = 0xac
+       DLT_GPF_F                      = 0xab
+       DLT_GPF_T                      = 0xaa
+       DLT_GPRS_LLC                   = 0xa9
+       DLT_GSMTAP_ABIS                = 0xda
+       DLT_GSMTAP_UM                  = 0xd9
+       DLT_HHDLC                      = 0x79
+       DLT_IBM_SN                     = 0x92
+       DLT_IBM_SP                     = 0x91
+       DLT_IEEE802                    = 0x6
+       DLT_IEEE802_11                 = 0x69
+       DLT_IEEE802_11_RADIO           = 0x7f
+       DLT_IEEE802_11_RADIO_AVS       = 0xa3
+       DLT_IEEE802_15_4               = 0xc3
+       DLT_IEEE802_15_4_LINUX         = 0xbf
+       DLT_IEEE802_15_4_NOFCS         = 0xe6
+       DLT_IEEE802_15_4_NONASK_PHY    = 0xd7
+       DLT_IEEE802_16_MAC_CPS         = 0xbc
+       DLT_IEEE802_16_MAC_CPS_RADIO   = 0xc1
+       DLT_INFINIBAND                 = 0xf7
+       DLT_IPFILTER                   = 0x74
+       DLT_IPMB                       = 0xc7
+       DLT_IPMB_LINUX                 = 0xd1
+       DLT_IPMI_HPM_2                 = 0x104
+       DLT_IPNET                      = 0xe2
+       DLT_IPOIB                      = 0xf2
+       DLT_IPV4                       = 0xe4
+       DLT_IPV6                       = 0xe5
+       DLT_IP_OVER_FC                 = 0x7a
+       DLT_JUNIPER_ATM1               = 0x89
+       DLT_JUNIPER_ATM2               = 0x87
+       DLT_JUNIPER_ATM_CEMIC          = 0xee
+       DLT_JUNIPER_CHDLC              = 0xb5
+       DLT_JUNIPER_ES                 = 0x84
+       DLT_JUNIPER_ETHER              = 0xb2
+       DLT_JUNIPER_FIBRECHANNEL       = 0xea
+       DLT_JUNIPER_FRELAY             = 0xb4
+       DLT_JUNIPER_GGSN               = 0x85
+       DLT_JUNIPER_ISM                = 0xc2
+       DLT_JUNIPER_MFR                = 0x86
+       DLT_JUNIPER_MLFR               = 0x83
+       DLT_JUNIPER_MLPPP              = 0x82
+       DLT_JUNIPER_MONITOR            = 0xa4
+       DLT_JUNIPER_PIC_PEER           = 0xae
+       DLT_JUNIPER_PPP                = 0xb3
+       DLT_JUNIPER_PPPOE              = 0xa7
+       DLT_JUNIPER_PPPOE_ATM          = 0xa8
+       DLT_JUNIPER_SERVICES           = 0x88
+       DLT_JUNIPER_SRX_E2E            = 0xe9
+       DLT_JUNIPER_ST                 = 0xc8
+       DLT_JUNIPER_VP                 = 0xb7
+       DLT_JUNIPER_VS                 = 0xe8
+       DLT_LAPB_WITH_DIR              = 0xcf
+       DLT_LAPD                       = 0xcb
+       DLT_LIN                        = 0xd4
+       DLT_LINUX_EVDEV                = 0xd8
+       DLT_LINUX_IRDA                 = 0x90
+       DLT_LINUX_LAPD                 = 0xb1
+       DLT_LINUX_PPP_WITHDIRECTION    = 0xa6
+       DLT_LINUX_SLL                  = 0x71
+       DLT_LOOP                       = 0x6c
+       DLT_LTALK                      = 0x72
+       DLT_MATCHING_MAX               = 0x104
+       DLT_MATCHING_MIN               = 0x68
+       DLT_MFR                        = 0xb6
+       DLT_MOST                       = 0xd3
+       DLT_MPEG_2_TS                  = 0xf3
+       DLT_MPLS                       = 0xdb
+       DLT_MTP2                       = 0x8c
+       DLT_MTP2_WITH_PHDR             = 0x8b
+       DLT_MTP3                       = 0x8d
+       DLT_MUX27010                   = 0xec
+       DLT_NETANALYZER                = 0xf0
+       DLT_NETANALYZER_TRANSPARENT    = 0xf1
+       DLT_NETLINK                    = 0xfd
+       DLT_NFC_LLCP                   = 0xf5
+       DLT_NFLOG                      = 0xef
+       DLT_NG40                       = 0xf4
+       DLT_NULL                       = 0x0
+       DLT_PCI_EXP                    = 0x7d
+       DLT_PFLOG                      = 0x75
+       DLT_PFSYNC                     = 0x79
+       DLT_PKTAP                      = 0x102
+       DLT_PPI                        = 0xc0
+       DLT_PPP                        = 0x9
+       DLT_PPP_BSDOS                  = 0x10
+       DLT_PPP_ETHER                  = 0x33
+       DLT_PPP_PPPD                   = 0xa6
+       DLT_PPP_SERIAL                 = 0x32
+       DLT_PPP_WITH_DIR               = 0xcc
+       DLT_PPP_WITH_DIRECTION         = 0xa6
+       DLT_PRISM_HEADER               = 0x77
+       DLT_PROFIBUS_DL                = 0x101
+       DLT_PRONET                     = 0x4
+       DLT_RAIF1                      = 0xc6
+       DLT_RAW                        = 0xc
+       DLT_RIO                        = 0x7c
+       DLT_RTAC_SERIAL                = 0xfa
+       DLT_SCCP                       = 0x8e
+       DLT_SCTP                       = 0xf8
+       DLT_SITA                       = 0xc4
+       DLT_SLIP                       = 0x8
+       DLT_SLIP_BSDOS                 = 0xf
+       DLT_STANAG_5066_D_PDU          = 0xed
+       DLT_SUNATM                     = 0x7b
+       DLT_SYMANTEC_FIREWALL          = 0x63
+       DLT_TZSP                       = 0x80
+       DLT_USB                        = 0xba
+       DLT_USBPCAP                    = 0xf9
+       DLT_USB_LINUX                  = 0xbd
+       DLT_USB_LINUX_MMAPPED          = 0xdc
+       DLT_USER0                      = 0x93
+       DLT_USER1                      = 0x94
+       DLT_USER10                     = 0x9d
+       DLT_USER11                     = 0x9e
+       DLT_USER12                     = 0x9f
+       DLT_USER13                     = 0xa0
+       DLT_USER14                     = 0xa1
+       DLT_USER15                     = 0xa2
+       DLT_USER2                      = 0x95
+       DLT_USER3                      = 0x96
+       DLT_USER4                      = 0x97
+       DLT_USER5                      = 0x98
+       DLT_USER6                      = 0x99
+       DLT_USER7                      = 0x9a
+       DLT_USER8                      = 0x9b
+       DLT_USER9                      = 0x9c
+       DLT_WIHART                     = 0xdf
+       DLT_WIRESHARK_UPPER_PDU        = 0xfc
+       DLT_X2E_SERIAL                 = 0xd5
+       DLT_X2E_XORAYA                 = 0xd6
+       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                        = 0x40
+       ECHOE                          = 0x2
+       ECHOK                          = 0x4
+       ECHOKE                         = 0x1
+       ECHONL                         = 0x10
+       ECHOPRT                        = 0x20
+       EVFILT_AIO                     = -0x3
+       EVFILT_FS                      = -0x9
+       EVFILT_LIO                     = -0xa
+       EVFILT_PROC                    = -0x5
+       EVFILT_PROCDESC                = -0x8
+       EVFILT_READ                    = -0x1
+       EVFILT_SENDFILE                = -0xc
+       EVFILT_SIGNAL                  = -0x6
+       EVFILT_SYSCOUNT                = 0xc
+       EVFILT_TIMER                   = -0x7
+       EVFILT_USER                    = -0xb
+       EVFILT_VNODE                   = -0x4
+       EVFILT_WRITE                   = -0x2
+       EV_ADD                         = 0x1
+       EV_CLEAR                       = 0x20
+       EV_DELETE                      = 0x2
+       EV_DISABLE                     = 0x8
+       EV_DISPATCH                    = 0x80
+       EV_DROP                        = 0x1000
+       EV_ENABLE                      = 0x4
+       EV_EOF                         = 0x8000
+       EV_ERROR                       = 0x4000
+       EV_FLAG1                       = 0x2000
+       EV_FLAG2                       = 0x4000
+       EV_FORCEONESHOT                = 0x100
+       EV_ONESHOT                     = 0x10
+       EV_RECEIPT                     = 0x40
+       EV_SYSFLAGS                    = 0xf000
+       EXTA                           = 0x4b00
+       EXTATTR_NAMESPACE_EMPTY        = 0x0
+       EXTATTR_NAMESPACE_SYSTEM       = 0x2
+       EXTATTR_NAMESPACE_USER         = 0x1
+       EXTB                           = 0x9600
+       EXTPROC                        = 0x800
+       FD_CLOEXEC                     = 0x1
+       FD_SETSIZE                     = 0x400
+       FLUSHO                         = 0x800000
+       F_CANCEL                       = 0x5
+       F_DUP2FD                       = 0xa
+       F_DUP2FD_CLOEXEC               = 0x12
+       F_DUPFD                        = 0x0
+       F_DUPFD_CLOEXEC                = 0x11
+       F_GETFD                        = 0x1
+       F_GETFL                        = 0x3
+       F_GETLK                        = 0xb
+       F_GETOWN                       = 0x5
+       F_OGETLK                       = 0x7
+       F_OK                           = 0x0
+       F_OSETLK                       = 0x8
+       F_OSETLKW                      = 0x9
+       F_RDAHEAD                      = 0x10
+       F_RDLCK                        = 0x1
+       F_READAHEAD                    = 0xf
+       F_SETFD                        = 0x2
+       F_SETFL                        = 0x4
+       F_SETLK                        = 0xc
+       F_SETLKW                       = 0xd
+       F_SETLK_REMOTE                 = 0xe
+       F_SETOWN                       = 0x6
+       F_UNLCK                        = 0x2
+       F_UNLCKSYS                     = 0x4
+       F_WRLCK                        = 0x3
+       HUPCL                          = 0x4000
+       HW_MACHINE                     = 0x1
+       ICANON                         = 0x100
+       ICMP6_FILTER                   = 0x12
+       ICRNL                          = 0x100
+       IEXTEN                         = 0x400
+       IFAN_ARRIVAL                   = 0x0
+       IFAN_DEPARTURE                 = 0x1
+       IFF_ALLMULTI                   = 0x200
+       IFF_ALTPHYS                    = 0x4000
+       IFF_BROADCAST                  = 0x2
+       IFF_CANTCHANGE                 = 0x218f52
+       IFF_CANTCONFIG                 = 0x10000
+       IFF_DEBUG                      = 0x4
+       IFF_DRV_OACTIVE                = 0x400
+       IFF_DRV_RUNNING                = 0x40
+       IFF_DYING                      = 0x200000
+       IFF_LINK0                      = 0x1000
+       IFF_LINK1                      = 0x2000
+       IFF_LINK2                      = 0x4000
+       IFF_LOOPBACK                   = 0x8
+       IFF_MONITOR                    = 0x40000
+       IFF_MULTICAST                  = 0x8000
+       IFF_NOARP                      = 0x80
+       IFF_OACTIVE                    = 0x400
+       IFF_POINTOPOINT                = 0x10
+       IFF_PPROMISC                   = 0x20000
+       IFF_PROMISC                    = 0x100
+       IFF_RENAMING                   = 0x400000
+       IFF_RUNNING                    = 0x40
+       IFF_SIMPLEX                    = 0x800
+       IFF_STATICARP                  = 0x80000
+       IFF_UP                         = 0x1
+       IFNAMSIZ                       = 0x10
+       IFT_BRIDGE                     = 0xd1
+       IFT_CARP                       = 0xf8
+       IFT_IEEE1394                   = 0x90
+       IFT_INFINIBAND                 = 0xc7
+       IFT_L2VLAN                     = 0x87
+       IFT_L3IPVLAN                   = 0x88
+       IFT_PPP                        = 0x17
+       IFT_PROPVIRTUAL                = 0x35
+       IGNBRK                         = 0x1
+       IGNCR                          = 0x80
+       IGNPAR                         = 0x4
+       IMAXBEL                        = 0x2000
+       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_RFC3021_MASK                = 0xfffffffe
+       IPPROTO_3PC                    = 0x22
+       IPPROTO_ADFS                   = 0x44
+       IPPROTO_AH                     = 0x33
+       IPPROTO_AHIP                   = 0x3d
+       IPPROTO_APES                   = 0x63
+       IPPROTO_ARGUS                  = 0xd
+       IPPROTO_AX25                   = 0x5d
+       IPPROTO_BHA                    = 0x31
+       IPPROTO_BLT                    = 0x1e
+       IPPROTO_BRSATMON               = 0x4c
+       IPPROTO_CARP                   = 0x70
+       IPPROTO_CFTP                   = 0x3e
+       IPPROTO_CHAOS                  = 0x10
+       IPPROTO_CMTP                   = 0x26
+       IPPROTO_CPHB                   = 0x49
+       IPPROTO_CPNX                   = 0x48
+       IPPROTO_DDP                    = 0x25
+       IPPROTO_DGP                    = 0x56
+       IPPROTO_DIVERT                 = 0x102
+       IPPROTO_DONE                   = 0x101
+       IPPROTO_DSTOPTS                = 0x3c
+       IPPROTO_EGP                    = 0x8
+       IPPROTO_EMCON                  = 0xe
+       IPPROTO_ENCAP                  = 0x62
+       IPPROTO_EON                    = 0x50
+       IPPROTO_ESP                    = 0x32
+       IPPROTO_ETHERIP                = 0x61
+       IPPROTO_FRAGMENT               = 0x2c
+       IPPROTO_GGP                    = 0x3
+       IPPROTO_GMTP                   = 0x64
+       IPPROTO_GRE                    = 0x2f
+       IPPROTO_HELLO                  = 0x3f
+       IPPROTO_HIP                    = 0x8b
+       IPPROTO_HMP                    = 0x14
+       IPPROTO_HOPOPTS                = 0x0
+       IPPROTO_ICMP                   = 0x1
+       IPPROTO_ICMPV6                 = 0x3a
+       IPPROTO_IDP                    = 0x16
+       IPPROTO_IDPR                   = 0x23
+       IPPROTO_IDRP                   = 0x2d
+       IPPROTO_IGMP                   = 0x2
+       IPPROTO_IGP                    = 0x55
+       IPPROTO_IGRP                   = 0x58
+       IPPROTO_IL                     = 0x28
+       IPPROTO_INLSP                  = 0x34
+       IPPROTO_INP                    = 0x20
+       IPPROTO_IP                     = 0x0
+       IPPROTO_IPCOMP                 = 0x6c
+       IPPROTO_IPCV                   = 0x47
+       IPPROTO_IPEIP                  = 0x5e
+       IPPROTO_IPIP                   = 0x4
+       IPPROTO_IPPC                   = 0x43
+       IPPROTO_IPV4                   = 0x4
+       IPPROTO_IPV6                   = 0x29
+       IPPROTO_IRTP                   = 0x1c
+       IPPROTO_KRYPTOLAN              = 0x41
+       IPPROTO_LARP                   = 0x5b
+       IPPROTO_LEAF1                  = 0x19
+       IPPROTO_LEAF2                  = 0x1a
+       IPPROTO_MAX                    = 0x100
+       IPPROTO_MEAS                   = 0x13
+       IPPROTO_MH                     = 0x87
+       IPPROTO_MHRP                   = 0x30
+       IPPROTO_MICP                   = 0x5f
+       IPPROTO_MOBILE                 = 0x37
+       IPPROTO_MPLS                   = 0x89
+       IPPROTO_MTP                    = 0x5c
+       IPPROTO_MUX                    = 0x12
+       IPPROTO_ND                     = 0x4d
+       IPPROTO_NHRP                   = 0x36
+       IPPROTO_NONE                   = 0x3b
+       IPPROTO_NSP                    = 0x1f
+       IPPROTO_NVPII                  = 0xb
+       IPPROTO_OLD_DIVERT             = 0xfe
+       IPPROTO_OSPFIGP                = 0x59
+       IPPROTO_PFSYNC                 = 0xf0
+       IPPROTO_PGM                    = 0x71
+       IPPROTO_PIGP                   = 0x9
+       IPPROTO_PIM                    = 0x67
+       IPPROTO_PRM                    = 0x15
+       IPPROTO_PUP                    = 0xc
+       IPPROTO_PVP                    = 0x4b
+       IPPROTO_RAW                    = 0xff
+       IPPROTO_RCCMON                 = 0xa
+       IPPROTO_RDP                    = 0x1b
+       IPPROTO_RESERVED_253           = 0xfd
+       IPPROTO_RESERVED_254           = 0xfe
+       IPPROTO_ROUTING                = 0x2b
+       IPPROTO_RSVP                   = 0x2e
+       IPPROTO_RVD                    = 0x42
+       IPPROTO_SATEXPAK               = 0x40
+       IPPROTO_SATMON                 = 0x45
+       IPPROTO_SCCSP                  = 0x60
+       IPPROTO_SCTP                   = 0x84
+       IPPROTO_SDRP                   = 0x2a
+       IPPROTO_SEND                   = 0x103
+       IPPROTO_SEP                    = 0x21
+       IPPROTO_SHIM6                  = 0x8c
+       IPPROTO_SKIP                   = 0x39
+       IPPROTO_SPACER                 = 0x7fff
+       IPPROTO_SRPC                   = 0x5a
+       IPPROTO_ST                     = 0x7
+       IPPROTO_SVMTP                  = 0x52
+       IPPROTO_SWIPE                  = 0x35
+       IPPROTO_TCF                    = 0x57
+       IPPROTO_TCP                    = 0x6
+       IPPROTO_TLSP                   = 0x38
+       IPPROTO_TP                     = 0x1d
+       IPPROTO_TPXX                   = 0x27
+       IPPROTO_TRUNK1                 = 0x17
+       IPPROTO_TRUNK2                 = 0x18
+       IPPROTO_TTP                    = 0x54
+       IPPROTO_UDP                    = 0x11
+       IPPROTO_UDPLITE                = 0x88
+       IPPROTO_VINES                  = 0x53
+       IPPROTO_VISA                   = 0x46
+       IPPROTO_VMTP                   = 0x51
+       IPPROTO_WBEXPAK                = 0x4f
+       IPPROTO_WBMON                  = 0x4e
+       IPPROTO_WSN                    = 0x4a
+       IPPROTO_XNET                   = 0xf
+       IPPROTO_XTP                    = 0x24
+       IPV6_AUTOFLOWLABEL             = 0x3b
+       IPV6_BINDANY                   = 0x40
+       IPV6_BINDMULTI                 = 0x41
+       IPV6_BINDV6ONLY                = 0x1b
+       IPV6_CHECKSUM                  = 0x1a
+       IPV6_DEFAULT_MULTICAST_HOPS    = 0x1
+       IPV6_DEFAULT_MULTICAST_LOOP    = 0x1
+       IPV6_DEFHLIM                   = 0x40
+       IPV6_DONTFRAG                  = 0x3e
+       IPV6_DSTOPTS                   = 0x32
+       IPV6_FLOWID                    = 0x43
+       IPV6_FLOWINFO_MASK             = 0xffffff0f
+       IPV6_FLOWLABEL_MASK            = 0xffff0f00
+       IPV6_FLOWTYPE                  = 0x44
+       IPV6_FRAGTTL                   = 0x78
+       IPV6_FW_ADD                    = 0x1e
+       IPV6_FW_DEL                    = 0x1f
+       IPV6_FW_FLUSH                  = 0x20
+       IPV6_FW_GET                    = 0x22
+       IPV6_FW_ZERO                   = 0x21
+       IPV6_HLIMDEC                   = 0x1
+       IPV6_HOPLIMIT                  = 0x2f
+       IPV6_HOPOPTS                   = 0x31
+       IPV6_IPSEC_POLICY              = 0x1c
+       IPV6_JOIN_GROUP                = 0xc
+       IPV6_LEAVE_GROUP               = 0xd
+       IPV6_MAXHLIM                   = 0xff
+       IPV6_MAXOPTHDR                 = 0x800
+       IPV6_MAXPACKET                 = 0xffff
+       IPV6_MAX_GROUP_SRC_FILTER      = 0x200
+       IPV6_MAX_MEMBERSHIPS           = 0xfff
+       IPV6_MAX_SOCK_SRC_FILTER       = 0x80
+       IPV6_MIN_MEMBERSHIPS           = 0x1f
+       IPV6_MMTU                      = 0x500
+       IPV6_MSFILTER                  = 0x4a
+       IPV6_MULTICAST_HOPS            = 0xa
+       IPV6_MULTICAST_IF              = 0x9
+       IPV6_MULTICAST_LOOP            = 0xb
+       IPV6_NEXTHOP                   = 0x30
+       IPV6_PATHMTU                   = 0x2c
+       IPV6_PKTINFO                   = 0x2e
+       IPV6_PORTRANGE                 = 0xe
+       IPV6_PORTRANGE_DEFAULT         = 0x0
+       IPV6_PORTRANGE_HIGH            = 0x1
+       IPV6_PORTRANGE_LOW             = 0x2
+       IPV6_PREFER_TEMPADDR           = 0x3f
+       IPV6_RECVDSTOPTS               = 0x28
+       IPV6_RECVFLOWID                = 0x46
+       IPV6_RECVHOPLIMIT              = 0x25
+       IPV6_RECVHOPOPTS               = 0x27
+       IPV6_RECVPATHMTU               = 0x2b
+       IPV6_RECVPKTINFO               = 0x24
+       IPV6_RECVRSSBUCKETID           = 0x47
+       IPV6_RECVRTHDR                 = 0x26
+       IPV6_RECVTCLASS                = 0x39
+       IPV6_RSSBUCKETID               = 0x45
+       IPV6_RSS_LISTEN_BUCKET         = 0x42
+       IPV6_RTHDR                     = 0x33
+       IPV6_RTHDRDSTOPTS              = 0x23
+       IPV6_RTHDR_LOOSE               = 0x0
+       IPV6_RTHDR_STRICT              = 0x1
+       IPV6_RTHDR_TYPE_0              = 0x0
+       IPV6_SOCKOPT_RESERVED1         = 0x3
+       IPV6_TCLASS                    = 0x3d
+       IPV6_UNICAST_HOPS              = 0x4
+       IPV6_USE_MIN_MTU               = 0x2a
+       IPV6_V6ONLY                    = 0x1b
+       IPV6_VERSION                   = 0x60
+       IPV6_VERSION_MASK              = 0xf0
+       IP_ADD_MEMBERSHIP              = 0xc
+       IP_ADD_SOURCE_MEMBERSHIP       = 0x46
+       IP_BINDANY                     = 0x18
+       IP_BINDMULTI                   = 0x19
+       IP_BLOCK_SOURCE                = 0x48
+       IP_DEFAULT_MULTICAST_LOOP      = 0x1
+       IP_DEFAULT_MULTICAST_TTL       = 0x1
+       IP_DF                          = 0x4000
+       IP_DONTFRAG                    = 0x43
+       IP_DROP_MEMBERSHIP             = 0xd
+       IP_DROP_SOURCE_MEMBERSHIP      = 0x47
+       IP_DUMMYNET3                   = 0x31
+       IP_DUMMYNET_CONFIGURE          = 0x3c
+       IP_DUMMYNET_DEL                = 0x3d
+       IP_DUMMYNET_FLUSH              = 0x3e
+       IP_DUMMYNET_GET                = 0x40
+       IP_FLOWID                      = 0x5a
+       IP_FLOWTYPE                    = 0x5b
+       IP_FW3                         = 0x30
+       IP_FW_ADD                      = 0x32
+       IP_FW_DEL                      = 0x33
+       IP_FW_FLUSH                    = 0x34
+       IP_FW_GET                      = 0x36
+       IP_FW_NAT_CFG                  = 0x38
+       IP_FW_NAT_DEL                  = 0x39
+       IP_FW_NAT_GET_CONFIG           = 0x3a
+       IP_FW_NAT_GET_LOG              = 0x3b
+       IP_FW_RESETLOG                 = 0x37
+       IP_FW_TABLE_ADD                = 0x28
+       IP_FW_TABLE_DEL                = 0x29
+       IP_FW_TABLE_FLUSH              = 0x2a
+       IP_FW_TABLE_GETSIZE            = 0x2b
+       IP_FW_TABLE_LIST               = 0x2c
+       IP_FW_ZERO                     = 0x35
+       IP_HDRINCL                     = 0x2
+       IP_IPSEC_POLICY                = 0x15
+       IP_MAXPACKET                   = 0xffff
+       IP_MAX_GROUP_SRC_FILTER        = 0x200
+       IP_MAX_MEMBERSHIPS             = 0xfff
+       IP_MAX_SOCK_MUTE_FILTER        = 0x80
+       IP_MAX_SOCK_SRC_FILTER         = 0x80
+       IP_MAX_SOURCE_FILTER           = 0x400
+       IP_MF                          = 0x2000
+       IP_MINTTL                      = 0x42
+       IP_MIN_MEMBERSHIPS             = 0x1f
+       IP_MSFILTER                    = 0x4a
+       IP_MSS                         = 0x240
+       IP_MULTICAST_IF                = 0x9
+       IP_MULTICAST_LOOP              = 0xb
+       IP_MULTICAST_TTL               = 0xa
+       IP_MULTICAST_VIF               = 0xe
+       IP_OFFMASK                     = 0x1fff
+       IP_ONESBCAST                   = 0x17
+       IP_OPTIONS                     = 0x1
+       IP_PORTRANGE                   = 0x13
+       IP_PORTRANGE_DEFAULT           = 0x0
+       IP_PORTRANGE_HIGH              = 0x1
+       IP_PORTRANGE_LOW               = 0x2
+       IP_RECVDSTADDR                 = 0x7
+       IP_RECVFLOWID                  = 0x5d
+       IP_RECVIF                      = 0x14
+       IP_RECVOPTS                    = 0x5
+       IP_RECVRETOPTS                 = 0x6
+       IP_RECVRSSBUCKETID             = 0x5e
+       IP_RECVTOS                     = 0x44
+       IP_RECVTTL                     = 0x41
+       IP_RETOPTS                     = 0x8
+       IP_RF                          = 0x8000
+       IP_RSSBUCKETID                 = 0x5c
+       IP_RSS_LISTEN_BUCKET           = 0x1a
+       IP_RSVP_OFF                    = 0x10
+       IP_RSVP_ON                     = 0xf
+       IP_RSVP_VIF_OFF                = 0x12
+       IP_RSVP_VIF_ON                 = 0x11
+       IP_SENDSRCADDR                 = 0x7
+       IP_TOS                         = 0x3
+       IP_TTL                         = 0x4
+       IP_UNBLOCK_SOURCE              = 0x49
+       ISIG                           = 0x80
+       ISTRIP                         = 0x20
+       IXANY                          = 0x800
+       IXOFF                          = 0x400
+       IXON                           = 0x200
+       KERN_HOSTNAME                  = 0xa
+       KERN_OSRELEASE                 = 0x2
+       KERN_OSTYPE                    = 0x1
+       KERN_VERSION                   = 0x4
+       LOCK_EX                        = 0x2
+       LOCK_NB                        = 0x4
+       LOCK_SH                        = 0x1
+       LOCK_UN                        = 0x8
+       MADV_AUTOSYNC                  = 0x7
+       MADV_CORE                      = 0x9
+       MADV_DONTNEED                  = 0x4
+       MADV_FREE                      = 0x5
+       MADV_NOCORE                    = 0x8
+       MADV_NORMAL                    = 0x0
+       MADV_NOSYNC                    = 0x6
+       MADV_PROTECT                   = 0xa
+       MADV_RANDOM                    = 0x1
+       MADV_SEQUENTIAL                = 0x2
+       MADV_WILLNEED                  = 0x3
+       MAP_32BIT                      = 0x80000
+       MAP_ALIGNED_SUPER              = 0x1000000
+       MAP_ALIGNMENT_MASK             = -0x1000000
+       MAP_ALIGNMENT_SHIFT            = 0x18
+       MAP_ANON                       = 0x1000
+       MAP_ANONYMOUS                  = 0x1000
+       MAP_COPY                       = 0x2
+       MAP_EXCL                       = 0x4000
+       MAP_FILE                       = 0x0
+       MAP_FIXED                      = 0x10
+       MAP_HASSEMAPHORE               = 0x200
+       MAP_NOCORE                     = 0x20000
+       MAP_NOSYNC                     = 0x800
+       MAP_PREFAULT_READ              = 0x40000
+       MAP_PRIVATE                    = 0x2
+       MAP_RESERVED0020               = 0x20
+       MAP_RESERVED0040               = 0x40
+       MAP_RESERVED0080               = 0x80
+       MAP_RESERVED0100               = 0x100
+       MAP_SHARED                     = 0x1
+       MAP_STACK                      = 0x400
+       MCL_CURRENT                    = 0x1
+       MCL_FUTURE                     = 0x2
+       MNT_ACLS                       = 0x8000000
+       MNT_ASYNC                      = 0x40
+       MNT_AUTOMOUNTED                = 0x200000000
+       MNT_BYFSID                     = 0x8000000
+       MNT_CMDFLAGS                   = 0xd0f0000
+       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_GJOURNAL                   = 0x2000000
+       MNT_IGNORE                     = 0x800000
+       MNT_LAZY                       = 0x3
+       MNT_LOCAL                      = 0x1000
+       MNT_MULTILABEL                 = 0x4000000
+       MNT_NFS4ACLS                   = 0x10
+       MNT_NOATIME                    = 0x10000000
+       MNT_NOCLUSTERR                 = 0x40000000
+       MNT_NOCLUSTERW                 = 0x80000000
+       MNT_NOEXEC                     = 0x4
+       MNT_NONBUSY                    = 0x4000000
+       MNT_NOSUID                     = 0x8
+       MNT_NOSYMFOLLOW                = 0x400000
+       MNT_NOWAIT                     = 0x2
+       MNT_QUOTA                      = 0x2000
+       MNT_RDONLY                     = 0x1
+       MNT_RELOAD                     = 0x40000
+       MNT_ROOTFS                     = 0x4000
+       MNT_SNAPSHOT                   = 0x1000000
+       MNT_SOFTDEP                    = 0x200000
+       MNT_SUIDDIR                    = 0x100000
+       MNT_SUJ                        = 0x100000000
+       MNT_SUSPEND                    = 0x4
+       MNT_SYNCHRONOUS                = 0x2
+       MNT_UNION                      = 0x20
+       MNT_UPDATE                     = 0x10000
+       MNT_UPDATEMASK                 = 0x2d8d0807e
+       MNT_USER                       = 0x8000
+       MNT_VISFLAGMASK                = 0x3fef0ffff
+       MNT_WAIT                       = 0x1
+       MSG_CMSG_CLOEXEC               = 0x40000
+       MSG_COMPAT                     = 0x8000
+       MSG_CTRUNC                     = 0x20
+       MSG_DONTROUTE                  = 0x4
+       MSG_DONTWAIT                   = 0x80
+       MSG_EOF                        = 0x100
+       MSG_EOR                        = 0x8
+       MSG_NBIO                       = 0x4000
+       MSG_NOSIGNAL                   = 0x20000
+       MSG_NOTIFICATION               = 0x2000
+       MSG_OOB                        = 0x1
+       MSG_PEEK                       = 0x2
+       MSG_TRUNC                      = 0x10
+       MSG_WAITALL                    = 0x40
+       MSG_WAITFORONE                 = 0x80000
+       MS_ASYNC                       = 0x1
+       MS_INVALIDATE                  = 0x2
+       MS_SYNC                        = 0x0
+       NAME_MAX                       = 0xff
+       NET_RT_DUMP                    = 0x1
+       NET_RT_FLAGS                   = 0x2
+       NET_RT_IFLIST                  = 0x3
+       NET_RT_IFLISTL                 = 0x5
+       NET_RT_IFMALIST                = 0x4
+       NOFLSH                         = 0x80000000
+       NOKERNINFO                     = 0x2000000
+       NOTE_ATTRIB                    = 0x8
+       NOTE_CHILD                     = 0x4
+       NOTE_CLOSE                     = 0x100
+       NOTE_CLOSE_WRITE               = 0x200
+       NOTE_DELETE                    = 0x1
+       NOTE_EXEC                      = 0x20000000
+       NOTE_EXIT                      = 0x80000000
+       NOTE_EXTEND                    = 0x4
+       NOTE_FFAND                     = 0x40000000
+       NOTE_FFCOPY                    = 0xc0000000
+       NOTE_FFCTRLMASK                = 0xc0000000
+       NOTE_FFLAGSMASK                = 0xffffff
+       NOTE_FFNOP                     = 0x0
+       NOTE_FFOR                      = 0x80000000
+       NOTE_FILE_POLL                 = 0x2
+       NOTE_FORK                      = 0x40000000
+       NOTE_LINK                      = 0x10
+       NOTE_LOWAT                     = 0x1
+       NOTE_MSECONDS                  = 0x2
+       NOTE_NSECONDS                  = 0x8
+       NOTE_OPEN                      = 0x80
+       NOTE_PCTRLMASK                 = 0xf0000000
+       NOTE_PDATAMASK                 = 0xfffff
+       NOTE_READ                      = 0x400
+       NOTE_RENAME                    = 0x20
+       NOTE_REVOKE                    = 0x40
+       NOTE_SECONDS                   = 0x1
+       NOTE_TRACK                     = 0x1
+       NOTE_TRACKERR                  = 0x2
+       NOTE_TRIGGER                   = 0x1000000
+       NOTE_USECONDS                  = 0x4
+       NOTE_WRITE                     = 0x2
+       OCRNL                          = 0x10
+       ONLCR                          = 0x2
+       ONLRET                         = 0x40
+       ONOCR                          = 0x20
+       ONOEOT                         = 0x8
+       OPOST                          = 0x1
+       OXTABS                         = 0x4
+       O_ACCMODE                      = 0x3
+       O_APPEND                       = 0x8
+       O_ASYNC                        = 0x40
+       O_CLOEXEC                      = 0x100000
+       O_CREAT                        = 0x200
+       O_DIRECT                       = 0x10000
+       O_DIRECTORY                    = 0x20000
+       O_EXCL                         = 0x800
+       O_EXEC                         = 0x40000
+       O_EXLOCK                       = 0x20
+       O_FSYNC                        = 0x80
+       O_NDELAY                       = 0x4
+       O_NOCTTY                       = 0x8000
+       O_NOFOLLOW                     = 0x100
+       O_NONBLOCK                     = 0x4
+       O_RDONLY                       = 0x0
+       O_RDWR                         = 0x2
+       O_SHLOCK                       = 0x10
+       O_SYNC                         = 0x80
+       O_TRUNC                        = 0x400
+       O_TTY_INIT                     = 0x80000
+       O_VERIFY                       = 0x200000
+       O_WRONLY                       = 0x1
+       PARENB                         = 0x1000
+       PARMRK                         = 0x8
+       PARODD                         = 0x2000
+       PENDIN                         = 0x20000000
+       PRIO_PGRP                      = 0x1
+       PRIO_PROCESS                   = 0x0
+       PRIO_USER                      = 0x2
+       PROT_EXEC                      = 0x4
+       PROT_NONE                      = 0x0
+       PROT_READ                      = 0x1
+       PROT_WRITE                     = 0x2
+       RLIMIT_AS                      = 0xa
+       RLIMIT_CORE                    = 0x4
+       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
+       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_DST                        = 0x1
+       RTA_GATEWAY                    = 0x2
+       RTA_GENMASK                    = 0x8
+       RTA_IFA                        = 0x20
+       RTA_IFP                        = 0x10
+       RTA_NETMASK                    = 0x4
+       RTF_BLACKHOLE                  = 0x1000
+       RTF_BROADCAST                  = 0x400000
+       RTF_DONE                       = 0x40
+       RTF_DYNAMIC                    = 0x10
+       RTF_FIXEDMTU                   = 0x80000
+       RTF_FMASK                      = 0x1004d808
+       RTF_GATEWAY                    = 0x2
+       RTF_GWFLAG_COMPAT              = 0x80000000
+       RTF_HOST                       = 0x4
+       RTF_LLDATA                     = 0x400
+       RTF_LLINFO                     = 0x400
+       RTF_LOCAL                      = 0x200000
+       RTF_MODIFIED                   = 0x20
+       RTF_MULTICAST                  = 0x800000
+       RTF_PINNED                     = 0x100000
+       RTF_PROTO1                     = 0x8000
+       RTF_PROTO2                     = 0x4000
+       RTF_PROTO3                     = 0x40000
+       RTF_REJECT                     = 0x8
+       RTF_RNH_LOCKED                 = 0x40000000
+       RTF_STATIC                     = 0x800
+       RTF_STICKY                     = 0x10000000
+       RTF_UP                         = 0x1
+       RTF_XRESOLVE                   = 0x200
+       RTM_ADD                        = 0x1
+       RTM_CHANGE                     = 0x3
+       RTM_DELADDR                    = 0xd
+       RTM_DELETE                     = 0x2
+       RTM_DELMADDR                   = 0x10
+       RTM_GET                        = 0x4
+       RTM_IEEE80211                  = 0x12
+       RTM_IFANNOUNCE                 = 0x11
+       RTM_IFINFO                     = 0xe
+       RTM_LOCK                       = 0x8
+       RTM_LOSING                     = 0x5
+       RTM_MISS                       = 0x7
+       RTM_NEWADDR                    = 0xc
+       RTM_NEWMADDR                   = 0xf
+       RTM_REDIRECT                   = 0x6
+       RTM_RESOLVE                    = 0xb
+       RTM_RTTUNIT                    = 0xf4240
+       RTM_VERSION                    = 0x5
+       RTV_EXPIRE                     = 0x4
+       RTV_HOPCOUNT                   = 0x2
+       RTV_MTU                        = 0x1
+       RTV_RPIPE                      = 0x8
+       RTV_RTT                        = 0x40
+       RTV_RTTVAR                     = 0x80
+       RTV_SPIPE                      = 0x10
+       RTV_SSTHRESH                   = 0x20
+       RTV_WEIGHT                     = 0x100
+       RT_ALL_FIBS                    = -0x1
+       RT_BLACKHOLE                   = 0x40
+       RT_CACHING_CONTEXT             = 0x1
+       RT_DEFAULT_FIB                 = 0x0
+       RT_HAS_GW                      = 0x80
+       RT_HAS_HEADER                  = 0x10
+       RT_HAS_HEADER_BIT              = 0x4
+       RT_L2_ME                       = 0x4
+       RT_L2_ME_BIT                   = 0x2
+       RT_LLE_CACHE                   = 0x100
+       RT_MAY_LOOP                    = 0x8
+       RT_MAY_LOOP_BIT                = 0x3
+       RT_NORTREF                     = 0x2
+       RT_REJECT                      = 0x20
+       RUSAGE_CHILDREN                = -0x1
+       RUSAGE_SELF                    = 0x0
+       RUSAGE_THREAD                  = 0x1
+       SCM_BINTIME                    = 0x4
+       SCM_CREDS                      = 0x3
+       SCM_RIGHTS                     = 0x1
+       SCM_TIMESTAMP                  = 0x2
+       SHUT_RD                        = 0x0
+       SHUT_RDWR                      = 0x2
+       SHUT_WR                        = 0x1
+       SIOCADDMULTI                   = 0x80206931
+       SIOCAIFADDR                    = 0x8040691a
+       SIOCAIFGROUP                   = 0x80286987
+       SIOCATMARK                     = 0x40047307
+       SIOCDELMULTI                   = 0x80206932
+       SIOCDIFADDR                    = 0x80206919
+       SIOCDIFGROUP                   = 0x80286989
+       SIOCDIFPHYADDR                 = 0x80206949
+       SIOCGDRVSPEC                   = 0xc028697b
+       SIOCGETSGCNT                   = 0xc0207210
+       SIOCGETVIFCNT                  = 0xc028720f
+       SIOCGHIWAT                     = 0x40047301
+       SIOCGI2C                       = 0xc020693d
+       SIOCGIFADDR                    = 0xc0206921
+       SIOCGIFBRDADDR                 = 0xc0206923
+       SIOCGIFCAP                     = 0xc020691f
+       SIOCGIFCONF                    = 0xc0106924
+       SIOCGIFDESCR                   = 0xc020692a
+       SIOCGIFDSTADDR                 = 0xc0206922
+       SIOCGIFFIB                     = 0xc020695c
+       SIOCGIFFLAGS                   = 0xc0206911
+       SIOCGIFGENERIC                 = 0xc020693a
+       SIOCGIFGMEMB                   = 0xc028698a
+       SIOCGIFGROUP                   = 0xc0286988
+       SIOCGIFINDEX                   = 0xc0206920
+       SIOCGIFMAC                     = 0xc0206926
+       SIOCGIFMEDIA                   = 0xc0306938
+       SIOCGIFMETRIC                  = 0xc0206917
+       SIOCGIFMTU                     = 0xc0206933
+       SIOCGIFNETMASK                 = 0xc0206925
+       SIOCGIFPDSTADDR                = 0xc0206948
+       SIOCGIFPHYS                    = 0xc0206935
+       SIOCGIFPSRCADDR                = 0xc0206947
+       SIOCGIFSTATUS                  = 0xc331693b
+       SIOCGIFXMEDIA                  = 0xc030698b
+       SIOCGLOWAT                     = 0x40047303
+       SIOCGPGRP                      = 0x40047309
+       SIOCGPRIVATE_0                 = 0xc0206950
+       SIOCGPRIVATE_1                 = 0xc0206951
+       SIOCGTUNFIB                    = 0xc020695e
+       SIOCIFCREATE                   = 0xc020697a
+       SIOCIFCREATE2                  = 0xc020697c
+       SIOCIFDESTROY                  = 0x80206979
+       SIOCIFGCLONERS                 = 0xc0106978
+       SIOCSDRVSPEC                   = 0x8028697b
+       SIOCSHIWAT                     = 0x80047300
+       SIOCSIFADDR                    = 0x8020690c
+       SIOCSIFBRDADDR                 = 0x80206913
+       SIOCSIFCAP                     = 0x8020691e
+       SIOCSIFDESCR                   = 0x80206929
+       SIOCSIFDSTADDR                 = 0x8020690e
+       SIOCSIFFIB                     = 0x8020695d
+       SIOCSIFFLAGS                   = 0x80206910
+       SIOCSIFGENERIC                 = 0x80206939
+       SIOCSIFLLADDR                  = 0x8020693c
+       SIOCSIFMAC                     = 0x80206927
+       SIOCSIFMEDIA                   = 0xc0206937
+       SIOCSIFMETRIC                  = 0x80206918
+       SIOCSIFMTU                     = 0x80206934
+       SIOCSIFNAME                    = 0x80206928
+       SIOCSIFNETMASK                 = 0x80206916
+       SIOCSIFPHYADDR                 = 0x80406946
+       SIOCSIFPHYS                    = 0x80206936
+       SIOCSIFRVNET                   = 0xc020695b
+       SIOCSIFVNET                    = 0xc020695a
+       SIOCSLOWAT                     = 0x80047302
+       SIOCSPGRP                      = 0x80047308
+       SIOCSTUNFIB                    = 0x8020695f
+       SOCK_CLOEXEC                   = 0x10000000
+       SOCK_DGRAM                     = 0x2
+       SOCK_MAXADDRLEN                = 0xff
+       SOCK_NONBLOCK                  = 0x20000000
+       SOCK_RAW                       = 0x3
+       SOCK_RDM                       = 0x4
+       SOCK_SEQPACKET                 = 0x5
+       SOCK_STREAM                    = 0x1
+       SOL_SOCKET                     = 0xffff
+       SOMAXCONN                      = 0x80
+       SO_ACCEPTCONN                  = 0x2
+       SO_ACCEPTFILTER                = 0x1000
+       SO_BINTIME                     = 0x2000
+       SO_BROADCAST                   = 0x20
+       SO_DEBUG                       = 0x1
+       SO_DONTROUTE                   = 0x10
+       SO_ERROR                       = 0x1007
+       SO_KEEPALIVE                   = 0x8
+       SO_LABEL                       = 0x1009
+       SO_LINGER                      = 0x80
+       SO_LISTENINCQLEN               = 0x1013
+       SO_LISTENQLEN                  = 0x1012
+       SO_LISTENQLIMIT                = 0x1011
+       SO_NOSIGPIPE                   = 0x800
+       SO_NO_DDP                      = 0x8000
+       SO_NO_OFFLOAD                  = 0x4000
+       SO_OOBINLINE                   = 0x100
+       SO_PEERLABEL                   = 0x1010
+       SO_PROTOCOL                    = 0x1016
+       SO_PROTOTYPE                   = 0x1016
+       SO_RCVBUF                      = 0x1002
+       SO_RCVLOWAT                    = 0x1004
+       SO_RCVTIMEO                    = 0x1006
+       SO_REUSEADDR                   = 0x4
+       SO_REUSEPORT                   = 0x200
+       SO_SETFIB                      = 0x1014
+       SO_SNDBUF                      = 0x1001
+       SO_SNDLOWAT                    = 0x1003
+       SO_SNDTIMEO                    = 0x1005
+       SO_TIMESTAMP                   = 0x400
+       SO_TYPE                        = 0x1008
+       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
+       TCIFLUSH                       = 0x1
+       TCIOFF                         = 0x3
+       TCIOFLUSH                      = 0x3
+       TCION                          = 0x4
+       TCOFLUSH                       = 0x2
+       TCOOFF                         = 0x1
+       TCOON                          = 0x2
+       TCP_CA_NAME_MAX                = 0x10
+       TCP_CCALGOOPT                  = 0x41
+       TCP_CONGESTION                 = 0x40
+       TCP_FASTOPEN                   = 0x401
+       TCP_FUNCTION_BLK               = 0x2000
+       TCP_FUNCTION_NAME_LEN_MAX      = 0x20
+       TCP_INFO                       = 0x20
+       TCP_KEEPCNT                    = 0x400
+       TCP_KEEPIDLE                   = 0x100
+       TCP_KEEPINIT                   = 0x80
+       TCP_KEEPINTVL                  = 0x200
+       TCP_MAXBURST                   = 0x4
+       TCP_MAXHLEN                    = 0x3c
+       TCP_MAXOLEN                    = 0x28
+       TCP_MAXSEG                     = 0x2
+       TCP_MAXWIN                     = 0xffff
+       TCP_MAX_SACK                   = 0x4
+       TCP_MAX_WINSHIFT               = 0xe
+       TCP_MD5SIG                     = 0x10
+       TCP_MINMSS                     = 0xd8
+       TCP_MSS                        = 0x218
+       TCP_NODELAY                    = 0x1
+       TCP_NOOPT                      = 0x8
+       TCP_NOPUSH                     = 0x4
+       TCP_PCAP_IN                    = 0x1000
+       TCP_PCAP_OUT                   = 0x800
+       TCP_VENDOR                     = 0x80000000
+       TCSAFLUSH                      = 0x2
+       TIOCCBRK                       = 0x2000747a
+       TIOCCDTR                       = 0x20007478
+       TIOCCONS                       = 0x80047462
+       TIOCDRAIN                      = 0x2000745e
+       TIOCEXCL                       = 0x2000740d
+       TIOCEXT                        = 0x80047460
+       TIOCFLUSH                      = 0x80047410
+       TIOCGDRAINWAIT                 = 0x40047456
+       TIOCGETA                       = 0x402c7413
+       TIOCGETD                       = 0x4004741a
+       TIOCGPGRP                      = 0x40047477
+       TIOCGPTN                       = 0x4004740f
+       TIOCGSID                       = 0x40047463
+       TIOCGWINSZ                     = 0x40087468
+       TIOCMBIC                       = 0x8004746b
+       TIOCMBIS                       = 0x8004746c
+       TIOCMGDTRWAIT                  = 0x4004745a
+       TIOCMGET                       = 0x4004746a
+       TIOCMSDTRWAIT                  = 0x8004745b
+       TIOCMSET                       = 0x8004746d
+       TIOCM_CAR                      = 0x40
+       TIOCM_CD                       = 0x40
+       TIOCM_CTS                      = 0x20
+       TIOCM_DCD                      = 0x40
+       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
+       TIOCPTMASTER                   = 0x2000741c
+       TIOCSBRK                       = 0x2000747b
+       TIOCSCTTY                      = 0x20007461
+       TIOCSDRAINWAIT                 = 0x80047457
+       TIOCSDTR                       = 0x20007479
+       TIOCSETA                       = 0x802c7414
+       TIOCSETAF                      = 0x802c7416
+       TIOCSETAW                      = 0x802c7415
+       TIOCSETD                       = 0x8004741b
+       TIOCSIG                        = 0x2004745f
+       TIOCSPGRP                      = 0x80047476
+       TIOCSTART                      = 0x2000746e
+       TIOCSTAT                       = 0x20007465
+       TIOCSTI                        = 0x80017472
+       TIOCSTOP                       = 0x2000746f
+       TIOCSWINSZ                     = 0x80087467
+       TIOCTIMESTAMP                  = 0x40107459
+       TIOCUCNTL                      = 0x80047466
+       TOSTOP                         = 0x400000
+       VDISCARD                       = 0xf
+       VDSUSP                         = 0xb
+       VEOF                           = 0x0
+       VEOL                           = 0x1
+       VEOL2                          = 0x2
+       VERASE                         = 0x3
+       VERASE2                        = 0x7
+       VINTR                          = 0x8
+       VKILL                          = 0x5
+       VLNEXT                         = 0xe
+       VMIN                           = 0x10
+       VQUIT                          = 0x9
+       VREPRINT                       = 0x6
+       VSTART                         = 0xc
+       VSTATUS                        = 0x12
+       VSTOP                          = 0xd
+       VSUSP                          = 0xa
+       VTIME                          = 0x11
+       VWERASE                        = 0x4
+       WCONTINUED                     = 0x4
+       WCOREFLAG                      = 0x80
+       WEXITED                        = 0x10
+       WLINUXCLONE                    = 0x80000000
+       WNOHANG                        = 0x1
+       WNOWAIT                        = 0x8
+       WSTOPPED                       = 0x2
+       WTRAPPED                       = 0x20
+       WUNTRACED                      = 0x2
+)
+
+// Errors
+const (
+       E2BIG           = syscall.Errno(0x7)
+       EACCES          = syscall.Errno(0xd)
+       EADDRINUSE      = syscall.Errno(0x30)
+       EADDRNOTAVAIL   = syscall.Errno(0x31)
+       EAFNOSUPPORT    = syscall.Errno(0x2f)
+       EAGAIN          = syscall.Errno(0x23)
+       EALREADY        = syscall.Errno(0x25)
+       EAUTH           = syscall.Errno(0x50)
+       EBADF           = syscall.Errno(0x9)
+       EBADMSG         = syscall.Errno(0x59)
+       EBADRPC         = syscall.Errno(0x48)
+       EBUSY           = syscall.Errno(0x10)
+       ECANCELED       = syscall.Errno(0x55)
+       ECAPMODE        = syscall.Errno(0x5e)
+       ECHILD          = syscall.Errno(0xa)
+       ECONNABORTED    = syscall.Errno(0x35)
+       ECONNREFUSED    = syscall.Errno(0x3d)
+       ECONNRESET      = syscall.Errno(0x36)
+       EDEADLK         = syscall.Errno(0xb)
+       EDESTADDRREQ    = syscall.Errno(0x27)
+       EDOM            = syscall.Errno(0x21)
+       EDOOFUS         = syscall.Errno(0x58)
+       EDQUOT          = syscall.Errno(0x45)
+       EEXIST          = syscall.Errno(0x11)
+       EFAULT          = syscall.Errno(0xe)
+       EFBIG           = syscall.Errno(0x1b)
+       EFTYPE          = syscall.Errno(0x4f)
+       EHOSTDOWN       = syscall.Errno(0x40)
+       EHOSTUNREACH    = syscall.Errno(0x41)
+       EIDRM           = syscall.Errno(0x52)
+       EILSEQ          = syscall.Errno(0x56)
+       EINPROGRESS     = syscall.Errno(0x24)
+       EINTR           = syscall.Errno(0x4)
+       EINVAL          = syscall.Errno(0x16)
+       EIO             = syscall.Errno(0x5)
+       EISCONN         = syscall.Errno(0x38)
+       EISDIR          = syscall.Errno(0x15)
+       ELAST           = syscall.Errno(0x60)
+       ELOOP           = syscall.Errno(0x3e)
+       EMFILE          = syscall.Errno(0x18)
+       EMLINK          = syscall.Errno(0x1f)
+       EMSGSIZE        = syscall.Errno(0x28)
+       EMULTIHOP       = syscall.Errno(0x5a)
+       ENAMETOOLONG    = syscall.Errno(0x3f)
+       ENEEDAUTH       = syscall.Errno(0x51)
+       ENETDOWN        = syscall.Errno(0x32)
+       ENETRESET       = syscall.Errno(0x34)
+       ENETUNREACH     = syscall.Errno(0x33)
+       ENFILE          = syscall.Errno(0x17)
+       ENOATTR         = syscall.Errno(0x57)
+       ENOBUFS         = syscall.Errno(0x37)
+       ENODEV          = syscall.Errno(0x13)
+       ENOENT          = syscall.Errno(0x2)
+       ENOEXEC         = syscall.Errno(0x8)
+       ENOLCK          = syscall.Errno(0x4d)
+       ENOLINK         = syscall.Errno(0x5b)
+       ENOMEM          = syscall.Errno(0xc)
+       ENOMSG          = syscall.Errno(0x53)
+       ENOPROTOOPT     = syscall.Errno(0x2a)
+       ENOSPC          = syscall.Errno(0x1c)
+       ENOSYS          = syscall.Errno(0x4e)
+       ENOTBLK         = syscall.Errno(0xf)
+       ENOTCAPABLE     = syscall.Errno(0x5d)
+       ENOTCONN        = syscall.Errno(0x39)
+       ENOTDIR         = syscall.Errno(0x14)
+       ENOTEMPTY       = syscall.Errno(0x42)
+       ENOTRECOVERABLE = syscall.Errno(0x5f)
+       ENOTSOCK        = syscall.Errno(0x26)
+       ENOTSUP         = syscall.Errno(0x2d)
+       ENOTTY          = syscall.Errno(0x19)
+       ENXIO           = syscall.Errno(0x6)
+       EOPNOTSUPP      = syscall.Errno(0x2d)
+       EOVERFLOW       = syscall.Errno(0x54)
+       EOWNERDEAD      = syscall.Errno(0x60)
+       EPERM           = syscall.Errno(0x1)
+       EPFNOSUPPORT    = syscall.Errno(0x2e)
+       EPIPE           = syscall.Errno(0x20)
+       EPROCLIM        = syscall.Errno(0x43)
+       EPROCUNAVAIL    = syscall.Errno(0x4c)
+       EPROGMISMATCH   = syscall.Errno(0x4b)
+       EPROGUNAVAIL    = syscall.Errno(0x4a)
+       EPROTO          = syscall.Errno(0x5c)
+       EPROTONOSUPPORT = syscall.Errno(0x2b)
+       EPROTOTYPE      = syscall.Errno(0x29)
+       ERANGE          = syscall.Errno(0x22)
+       EREMOTE         = syscall.Errno(0x47)
+       EROFS           = syscall.Errno(0x1e)
+       ERPCMISMATCH    = syscall.Errno(0x49)
+       ESHUTDOWN       = syscall.Errno(0x3a)
+       ESOCKTNOSUPPORT = syscall.Errno(0x2c)
+       ESPIPE          = syscall.Errno(0x1d)
+       ESRCH           = syscall.Errno(0x3)
+       ESTALE          = syscall.Errno(0x46)
+       ETIMEDOUT       = syscall.Errno(0x3c)
+       ETOOMANYREFS    = syscall.Errno(0x3b)
+       ETXTBSY         = syscall.Errno(0x1a)
+       EUSERS          = syscall.Errno(0x44)
+       EWOULDBLOCK     = syscall.Errno(0x23)
+       EXDEV           = syscall.Errno(0x12)
+)
+
+// Signals
+const (
+       SIGABRT   = syscall.Signal(0x6)
+       SIGALRM   = syscall.Signal(0xe)
+       SIGBUS    = syscall.Signal(0xa)
+       SIGCHLD   = syscall.Signal(0x14)
+       SIGCONT   = syscall.Signal(0x13)
+       SIGEMT    = syscall.Signal(0x7)
+       SIGFPE    = syscall.Signal(0x8)
+       SIGHUP    = syscall.Signal(0x1)
+       SIGILL    = syscall.Signal(0x4)
+       SIGINFO   = syscall.Signal(0x1d)
+       SIGINT    = syscall.Signal(0x2)
+       SIGIO     = syscall.Signal(0x17)
+       SIGIOT    = syscall.Signal(0x6)
+       SIGKILL   = syscall.Signal(0x9)
+       SIGLIBRT  = syscall.Signal(0x21)
+       SIGLWP    = syscall.Signal(0x20)
+       SIGPIPE   = syscall.Signal(0xd)
+       SIGPROF   = syscall.Signal(0x1b)
+       SIGQUIT   = syscall.Signal(0x3)
+       SIGSEGV   = syscall.Signal(0xb)
+       SIGSTOP   = syscall.Signal(0x11)
+       SIGSYS    = syscall.Signal(0xc)
+       SIGTERM   = syscall.Signal(0xf)
+       SIGTHR    = syscall.Signal(0x20)
+       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)
+       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", "device not configured"},
+       {7, "E2BIG", "argument list too long"},
+       {8, "ENOEXEC", "exec format error"},
+       {9, "EBADF", "bad file descriptor"},
+       {10, "ECHILD", "no child processes"},
+       {11, "EDEADLK", "resource deadlock avoided"},
+       {12, "ENOMEM", "cannot allocate memory"},
+       {13, "EACCES", "permission denied"},
+       {14, "EFAULT", "bad address"},
+       {15, "ENOTBLK", "block device required"},
+       {16, "EBUSY", "device busy"},
+       {17, "EEXIST", "file exists"},
+       {18, "EXDEV", "cross-device link"},
+       {19, "ENODEV", "operation not supported by device"},
+       {20, "ENOTDIR", "not a directory"},
+       {21, "EISDIR", "is a directory"},
+       {22, "EINVAL", "invalid argument"},
+       {23, "ENFILE", "too many open files in system"},
+       {24, "EMFILE", "too many open files"},
+       {25, "ENOTTY", "inappropriate ioctl for device"},
+       {26, "ETXTBSY", "text file busy"},
+       {27, "EFBIG", "file too large"},
+       {28, "ENOSPC", "no space left on device"},
+       {29, "ESPIPE", "illegal seek"},
+       {30, "EROFS", "read-only file system"},
+       {31, "EMLINK", "too many links"},
+       {32, "EPIPE", "broken pipe"},
+       {33, "EDOM", "numerical argument out of domain"},
+       {34, "ERANGE", "result too large"},
+       {35, "EAGAIN", "resource temporarily unavailable"},
+       {36, "EINPROGRESS", "operation now in progress"},
+       {37, "EALREADY", "operation already in progress"},
+       {38, "ENOTSOCK", "socket operation on non-socket"},
+       {39, "EDESTADDRREQ", "destination address required"},
+       {40, "EMSGSIZE", "message too long"},
+       {41, "EPROTOTYPE", "protocol wrong type for socket"},
+       {42, "ENOPROTOOPT", "protocol not available"},
+       {43, "EPROTONOSUPPORT", "protocol not supported"},
+       {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+       {45, "EOPNOTSUPP", "operation not supported"},
+       {46, "EPFNOSUPPORT", "protocol family not supported"},
+       {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+       {48, "EADDRINUSE", "address already in use"},
+       {49, "EADDRNOTAVAIL", "can't assign requested address"},
+       {50, "ENETDOWN", "network is down"},
+       {51, "ENETUNREACH", "network is unreachable"},
+       {52, "ENETRESET", "network dropped connection on reset"},
+       {53, "ECONNABORTED", "software caused connection abort"},
+       {54, "ECONNRESET", "connection reset by peer"},
+       {55, "ENOBUFS", "no buffer space available"},
+       {56, "EISCONN", "socket is already connected"},
+       {57, "ENOTCONN", "socket is not connected"},
+       {58, "ESHUTDOWN", "can't send after socket shutdown"},
+       {59, "ETOOMANYREFS", "too many references: can't splice"},
+       {60, "ETIMEDOUT", "operation timed out"},
+       {61, "ECONNREFUSED", "connection refused"},
+       {62, "ELOOP", "too many levels of symbolic links"},
+       {63, "ENAMETOOLONG", "file name too long"},
+       {64, "EHOSTDOWN", "host is down"},
+       {65, "EHOSTUNREACH", "no route to host"},
+       {66, "ENOTEMPTY", "directory not empty"},
+       {67, "EPROCLIM", "too many processes"},
+       {68, "EUSERS", "too many users"},
+       {69, "EDQUOT", "disc quota exceeded"},
+       {70, "ESTALE", "stale NFS file handle"},
+       {71, "EREMOTE", "too many levels of remote in path"},
+       {72, "EBADRPC", "RPC struct is bad"},
+       {73, "ERPCMISMATCH", "RPC version wrong"},
+       {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+       {75, "EPROGMISMATCH", "program version wrong"},
+       {76, "EPROCUNAVAIL", "bad procedure for program"},
+       {77, "ENOLCK", "no locks available"},
+       {78, "ENOSYS", "function not implemented"},
+       {79, "EFTYPE", "inappropriate file type or format"},
+       {80, "EAUTH", "authentication error"},
+       {81, "ENEEDAUTH", "need authenticator"},
+       {82, "EIDRM", "identifier removed"},
+       {83, "ENOMSG", "no message of desired type"},
+       {84, "EOVERFLOW", "value too large to be stored in data type"},
+       {85, "ECANCELED", "operation canceled"},
+       {86, "EILSEQ", "illegal byte sequence"},
+       {87, "ENOATTR", "attribute not found"},
+       {88, "EDOOFUS", "programming error"},
+       {89, "EBADMSG", "bad message"},
+       {90, "EMULTIHOP", "multihop attempted"},
+       {91, "ENOLINK", "link has been severed"},
+       {92, "EPROTO", "protocol error"},
+       {93, "ENOTCAPABLE", "capabilities insufficient"},
+       {94, "ECAPMODE", "not permitted in capability mode"},
+       {95, "ENOTRECOVERABLE", "state not recoverable"},
+       {96, "EOWNERDEAD", "previous owner died"},
+}
+
+// Signal table
+var signalList = [...]struct {
+       num  syscall.Signal
+       name string
+       desc string
+}{
+       {1, "SIGHUP", "hangup"},
+       {2, "SIGINT", "interrupt"},
+       {3, "SIGQUIT", "quit"},
+       {4, "SIGILL", "illegal instruction"},
+       {5, "SIGTRAP", "trace/BPT trap"},
+       {6, "SIGIOT", "abort trap"},
+       {7, "SIGEMT", "EMT trap"},
+       {8, "SIGFPE", "floating point exception"},
+       {9, "SIGKILL", "killed"},
+       {10, "SIGBUS", "bus error"},
+       {11, "SIGSEGV", "segmentation fault"},
+       {12, "SIGSYS", "bad system call"},
+       {13, "SIGPIPE", "broken pipe"},
+       {14, "SIGALRM", "alarm clock"},
+       {15, "SIGTERM", "terminated"},
+       {16, "SIGURG", "urgent I/O condition"},
+       {17, "SIGSTOP", "suspended (signal)"},
+       {18, "SIGTSTP", "suspended"},
+       {19, "SIGCONT", "continued"},
+       {20, "SIGCHLD", "child exited"},
+       {21, "SIGTTIN", "stopped (tty input)"},
+       {22, "SIGTTOU", "stopped (tty output)"},
+       {23, "SIGIO", "I/O possible"},
+       {24, "SIGXCPU", "cputime limit exceeded"},
+       {25, "SIGXFSZ", "filesize limit exceeded"},
+       {26, "SIGVTALRM", "virtual timer expired"},
+       {27, "SIGPROF", "profiling timer expired"},
+       {28, "SIGWINCH", "window size changes"},
+       {29, "SIGINFO", "information request"},
+       {30, "SIGUSR1", "user defined signal 1"},
+       {31, "SIGUSR2", "user defined signal 2"},
+       {32, "SIGTHR", "unknown signal"},
+       {33, "SIGLIBRT", "unknown signal"},
+}
index 2f0091bbc9204de1e8df5876df458d587d19abf1..c62bb94902863217483e3e06c4ef757e541ef040 100644 (file)
@@ -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                              = 0xa
        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
@@ -889,6 +913,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -898,6 +927,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -956,6 +989,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 +1000,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 +1032,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
@@ -1055,6 +1110,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1076,6 +1132,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
@@ -1196,6 +1254,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1245,6 +1304,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
@@ -1346,6 +1435,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1427,6 +1517,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 +1562,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 +1630,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 +1651,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 +1666,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 +1686,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 +1701,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 +1736,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 +1794,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x8904
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1780,6 +1886,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 +1945,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 +1983,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
@@ -1913,7 +2024,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x540b
        TCGETA                               = 0x5405
        TCGETS                               = 0x5401
@@ -1938,6 +2049,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
@@ -1995,6 +2108,7 @@ const (
        TIOCGETD                             = 0x5424
        TIOCGEXCL                            = 0x80045440
        TIOCGICOUNT                          = 0x545d
+       TIOCGISO7816                         = 0x80285442
        TIOCGLCKTRMIOS                       = 0x5456
        TIOCGPGRP                            = 0x540f
        TIOCGPKT                             = 0x80045438
@@ -2048,6 +2162,7 @@ const (
        TIOCSER_TEMT                         = 0x1
        TIOCSETD                             = 0x5423
        TIOCSIG                              = 0x40045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x5457
        TIOCSPGRP                            = 0x5410
        TIOCSPTLCK                           = 0x40045431
@@ -2105,6 +2220,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,7 +2372,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index a80c7ae5fb433fa7a727d59ad32e95a63cc1a270..93f65d7d1a762e2af367174909d9bd161ef0da9d 100644 (file)
@@ -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                              = 0xa
        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
@@ -889,6 +913,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -898,6 +927,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -956,6 +989,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 +1000,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 +1032,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
@@ -1055,6 +1110,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1076,6 +1132,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
@@ -1196,6 +1254,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1245,6 +1304,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
@@ -1346,6 +1435,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1428,6 +1518,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 +1563,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 +1631,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 +1652,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 +1667,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 +1687,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 +1702,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 +1737,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 +1795,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x8904
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1781,6 +1887,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 +1946,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 +1984,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
@@ -1914,7 +2025,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x540b
        TCGETA                               = 0x5405
        TCGETS                               = 0x5401
@@ -1939,6 +2050,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
@@ -1996,6 +2109,7 @@ const (
        TIOCGETD                             = 0x5424
        TIOCGEXCL                            = 0x80045440
        TIOCGICOUNT                          = 0x545d
+       TIOCGISO7816                         = 0x80285442
        TIOCGLCKTRMIOS                       = 0x5456
        TIOCGPGRP                            = 0x540f
        TIOCGPKT                             = 0x80045438
@@ -2049,6 +2163,7 @@ const (
        TIOCSER_TEMT                         = 0x1
        TIOCSETD                             = 0x5423
        TIOCSIG                              = 0x40045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x5457
        TIOCSPGRP                            = 0x5410
        TIOCSPTLCK                           = 0x40045431
@@ -2106,6 +2221,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,7 +2372,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index 49a9b0133bb31702a8683fc0981863baf86218ee..ccc57676fdd7c4fee49341db61478fbb53031e17 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +998,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 +1030,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
@@ -1053,6 +1108,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1074,6 +1130,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
@@ -1194,6 +1252,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1243,6 +1302,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
@@ -1344,6 +1433,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1434,6 +1524,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 +1569,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 +1637,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 +1658,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 +1673,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 +1693,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 +1708,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 +1743,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 +1801,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x8904
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1787,6 +1893,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 +1952,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 +1990,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
@@ -1920,7 +2031,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x540b
        TCGETA                               = 0x5405
        TCGETS                               = 0x5401
@@ -1945,6 +2056,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
@@ -2002,6 +2115,7 @@ const (
        TIOCGETD                             = 0x5424
        TIOCGEXCL                            = 0x80045440
        TIOCGICOUNT                          = 0x545d
+       TIOCGISO7816                         = 0x80285442
        TIOCGLCKTRMIOS                       = 0x5456
        TIOCGPGRP                            = 0x540f
        TIOCGPKT                             = 0x80045438
@@ -2055,6 +2169,7 @@ const (
        TIOCSER_TEMT                         = 0x1
        TIOCSETD                             = 0x5423
        TIOCSIG                              = 0x40045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x5457
        TIOCSPGRP                            = 0x5410
        TIOCSPTLCK                           = 0x40045431
@@ -2112,6 +2227,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,7 +2378,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index 8d70233b260b511fab475b62caf56a46856d2c13..9c57337c62597eef12b1d354c6d79fa4aecc987b 100644 (file)
@@ -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                              = 0xa
        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
@@ -891,6 +915,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -900,6 +929,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -957,6 +990,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 +1001,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 +1033,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
@@ -1056,6 +1111,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1077,6 +1133,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
@@ -1197,6 +1255,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1246,6 +1305,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
@@ -1347,6 +1436,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1418,6 +1508,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 +1553,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 +1621,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 +1642,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 +1657,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 +1677,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 +1692,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 +1727,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 +1785,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x8904
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1771,6 +1877,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 +1936,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 +1975,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
@@ -1905,7 +2016,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x540b
        TCGETA                               = 0x5405
        TCGETS                               = 0x5401
@@ -1930,6 +2041,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
@@ -1987,6 +2100,7 @@ const (
        TIOCGETD                             = 0x5424
        TIOCGEXCL                            = 0x80045440
        TIOCGICOUNT                          = 0x545d
+       TIOCGISO7816                         = 0x80285442
        TIOCGLCKTRMIOS                       = 0x5456
        TIOCGPGRP                            = 0x540f
        TIOCGPKT                             = 0x80045438
@@ -2040,6 +2154,7 @@ const (
        TIOCSER_TEMT                         = 0x1
        TIOCSETD                             = 0x5423
        TIOCSIG                              = 0x40045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x5457
        TIOCSPGRP                            = 0x5410
        TIOCSPTLCK                           = 0x40045431
@@ -2097,6 +2212,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,7 +2363,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index 410ab56b095b67bd28cf06c5eee13f6b31fb7f23..66cdbfd58680821a4aa471f159bc20f7f278bbce 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +999,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 +1030,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
@@ -1054,6 +1108,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1075,6 +1130,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
@@ -1195,6 +1252,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1244,6 +1302,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
@@ -1345,6 +1433,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1428,6 +1517,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 +1562,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 +1630,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 +1651,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 +1666,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 +1686,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 +1701,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 +1736,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 +1794,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x40047309
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1781,6 +1886,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 +1946,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 +1984,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
@@ -1915,7 +2025,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x5407
        TCGETA                               = 0x5401
        TCGETS                               = 0x540d
@@ -1939,6 +2049,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
@@ -1994,6 +2106,7 @@ const (
        TIOCGETP                             = 0x7408
        TIOCGEXCL                            = 0x40045440
        TIOCGICOUNT                          = 0x5492
+       TIOCGISO7816                         = 0x40285442
        TIOCGLCKTRMIOS                       = 0x548b
        TIOCGLTC                             = 0x7474
        TIOCGPGRP                            = 0x40047477
@@ -2050,6 +2163,7 @@ const (
        TIOCSETN                             = 0x740a
        TIOCSETP                             = 0x7409
        TIOCSIG                              = 0x80045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x548c
        TIOCSLTC                             = 0x7475
        TIOCSPGRP                            = 0x80047476
@@ -2108,6 +2222,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,7 +2374,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index dac4d90fada6d48cd4477ce636a2a0f8482a290d..038cfeb7db6b5140cd300a5f24f5dacdd47bef4d 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +999,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 +1030,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
@@ -1054,6 +1108,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1075,6 +1130,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
@@ -1195,6 +1252,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1244,6 +1302,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
@@ -1345,6 +1433,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1428,6 +1517,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 +1562,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 +1630,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 +1651,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 +1666,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 +1686,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 +1701,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 +1736,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 +1794,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x40047309
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1781,6 +1886,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 +1946,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 +1984,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
@@ -1915,7 +2025,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x5407
        TCGETA                               = 0x5401
        TCGETS                               = 0x540d
@@ -1939,6 +2049,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
@@ -1994,6 +2106,7 @@ const (
        TIOCGETP                             = 0x7408
        TIOCGEXCL                            = 0x40045440
        TIOCGICOUNT                          = 0x5492
+       TIOCGISO7816                         = 0x40285442
        TIOCGLCKTRMIOS                       = 0x548b
        TIOCGLTC                             = 0x7474
        TIOCGPGRP                            = 0x40047477
@@ -2050,6 +2163,7 @@ const (
        TIOCSETN                             = 0x740a
        TIOCSETP                             = 0x7409
        TIOCSIG                              = 0x80045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x548c
        TIOCSLTC                             = 0x7475
        TIOCSPGRP                            = 0x80047476
@@ -2108,6 +2222,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,7 +2374,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index 1d2f0e6382b78a0f7a56cc30f2e79106ffe45eb5..2b9af2f5ef321663f8e4ed0a7240976b16c06d46 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +999,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 +1030,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
@@ -1054,6 +1108,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1075,6 +1130,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
@@ -1195,6 +1252,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1244,6 +1302,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
@@ -1345,6 +1433,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1428,6 +1517,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 +1562,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 +1630,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 +1651,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 +1666,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 +1686,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 +1701,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 +1736,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 +1794,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x40047309
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1781,6 +1886,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 +1946,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 +1984,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
@@ -1915,7 +2025,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x5407
        TCGETA                               = 0x5401
        TCGETS                               = 0x540d
@@ -1939,6 +2049,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
@@ -1994,6 +2106,7 @@ const (
        TIOCGETP                             = 0x7408
        TIOCGEXCL                            = 0x40045440
        TIOCGICOUNT                          = 0x5492
+       TIOCGISO7816                         = 0x40285442
        TIOCGLCKTRMIOS                       = 0x548b
        TIOCGLTC                             = 0x7474
        TIOCGPGRP                            = 0x40047477
@@ -2050,6 +2163,7 @@ const (
        TIOCSETN                             = 0x740a
        TIOCSETP                             = 0x7409
        TIOCSIG                              = 0x80045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x548c
        TIOCSLTC                             = 0x7475
        TIOCSPGRP                            = 0x80047476
@@ -2108,6 +2222,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,7 +2374,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index 33b9940234979867e815296cc1f35b60a4f2d128..d117b636726276cdf3acd5800ffbbbb51932f564 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +999,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 +1030,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
@@ -1054,6 +1108,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1075,6 +1130,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
@@ -1195,6 +1252,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1244,6 +1302,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
@@ -1345,6 +1433,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1428,6 +1517,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 +1562,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 +1630,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 +1651,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 +1666,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 +1686,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 +1701,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 +1736,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 +1794,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x40047309
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1781,6 +1886,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 +1946,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 +1984,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
@@ -1915,7 +2025,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x5407
        TCGETA                               = 0x5401
        TCGETS                               = 0x540d
@@ -1939,6 +2049,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
@@ -1994,6 +2106,7 @@ const (
        TIOCGETP                             = 0x7408
        TIOCGEXCL                            = 0x40045440
        TIOCGICOUNT                          = 0x5492
+       TIOCGISO7816                         = 0x40285442
        TIOCGLCKTRMIOS                       = 0x548b
        TIOCGLTC                             = 0x7474
        TIOCGPGRP                            = 0x40047477
@@ -2050,6 +2163,7 @@ const (
        TIOCSETN                             = 0x740a
        TIOCSETP                             = 0x7409
        TIOCSIG                              = 0x80045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x548c
        TIOCSLTC                             = 0x7475
        TIOCSPGRP                            = 0x80047476
@@ -2108,6 +2222,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,7 +2374,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index c78d669761b390803026a65a3158d3c35b0e3f21..ed12556bf46a09f6dab5698e8ae17c65ce00b40d 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +998,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 +1029,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
@@ -1053,6 +1107,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1074,6 +1129,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
@@ -1196,6 +1253,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1245,6 +1303,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
@@ -1347,6 +1435,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1425,6 +1514,8 @@ const (
        PTRACE_SINGLEBLOCK                   = 0x100
        PTRACE_SINGLESTEP                    = 0x9
        PTRACE_SYSCALL                       = 0x18
+       PTRACE_SYSEMU                        = 0x1d
+       PTRACE_SYSEMU_SINGLESTEP             = 0x1e
        PTRACE_TRACEME                       = 0x0
        PT_CCR                               = 0x26
        PT_CTR                               = 0x23
@@ -1484,6 +1575,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 +1620,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 +1688,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 +1709,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 +1724,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 +1744,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 +1759,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 +1794,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 +1852,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x8904
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1837,6 +1944,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 +2003,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 +2041,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
@@ -1970,7 +2082,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x2000741f
        TCGETA                               = 0x40147417
        TCGETS                               = 0x402c7413
@@ -1993,6 +2105,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
@@ -2046,6 +2160,7 @@ const (
        TIOCGETP                             = 0x40067408
        TIOCGEXCL                            = 0x40045440
        TIOCGICOUNT                          = 0x545d
+       TIOCGISO7816                         = 0x40285442
        TIOCGLCKTRMIOS                       = 0x5456
        TIOCGLTC                             = 0x40067474
        TIOCGPGRP                            = 0x40047477
@@ -2106,6 +2221,7 @@ const (
        TIOCSETN                             = 0x8006740a
        TIOCSETP                             = 0x80067409
        TIOCSIG                              = 0x80045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x5457
        TIOCSLTC                             = 0x80067475
        TIOCSPGRP                            = 0x80047476
@@ -2166,6 +2282,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,7 +2433,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0xc00
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index 63493756d89b6070ff3a3eb5ec9f965021c4ac53..4aa4fa9c993b475601b10fece1af18ee5a3d5926 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +998,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 +1029,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
@@ -1053,6 +1107,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1074,6 +1129,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
@@ -1196,6 +1253,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1245,6 +1303,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
@@ -1347,6 +1435,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1425,6 +1514,8 @@ const (
        PTRACE_SINGLEBLOCK                   = 0x100
        PTRACE_SINGLESTEP                    = 0x9
        PTRACE_SYSCALL                       = 0x18
+       PTRACE_SYSEMU                        = 0x1d
+       PTRACE_SYSEMU_SINGLESTEP             = 0x1e
        PTRACE_TRACEME                       = 0x0
        PT_CCR                               = 0x26
        PT_CTR                               = 0x23
@@ -1484,6 +1575,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 +1620,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 +1688,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 +1709,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 +1724,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 +1744,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 +1759,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 +1794,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 +1852,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x8904
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1837,6 +1944,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 +2003,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 +2041,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
@@ -1970,7 +2082,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x2000741f
        TCGETA                               = 0x40147417
        TCGETS                               = 0x402c7413
@@ -1993,6 +2105,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
@@ -2046,6 +2160,7 @@ const (
        TIOCGETP                             = 0x40067408
        TIOCGEXCL                            = 0x40045440
        TIOCGICOUNT                          = 0x545d
+       TIOCGISO7816                         = 0x40285442
        TIOCGLCKTRMIOS                       = 0x5456
        TIOCGLTC                             = 0x40067474
        TIOCGPGRP                            = 0x40047477
@@ -2106,6 +2221,7 @@ const (
        TIOCSETN                             = 0x8006740a
        TIOCSETP                             = 0x80067409
        TIOCSIG                              = 0x80045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x5457
        TIOCSLTC                             = 0x80067475
        TIOCSPGRP                            = 0x80047476
@@ -2166,6 +2282,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,7 +2433,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        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 (file)
index 0000000..cfe9ef8
--- /dev/null
@@ -0,0 +1,2740 @@
+// 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                              = 0xa
+       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_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
+       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_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
+       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_GET_STRICT_CHK               = 0xc
+       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_IGNORE_OUTGOING               = 0x17
+       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_INDIRECT_BRANCH              = 0x1
+       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                    = 0x9
+       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
+       TIOCGISO7816                         = 0x80285442
+       TIOCGLCKTRMIOS                       = 0x5456
+       TIOCGPGRP                            = 0x540f
+       TIOCGPKT                             = 0x80045438
+       TIOCGPTLCK                           = 0x80045439
+       TIOCGPTN                             = 0x80045430
+       TIOCGPTPEER                          = 0x5441
+       TIOCGRS485                           = 0x542e
+       TIOCGSERIAL                          = 0x541e
+       TIOCGSID                             = 0x5429
+       TIOCGSOFTCAR                         = 0x5419
+       TIOCGWINSZ                           = 0x5413
+       TIOCINQ                              = 0x541b
+       TIOCLINUX                            = 0x541c
+       TIOCMBIC                             = 0x5417
+       TIOCMBIS                             = 0x5416
+       TIOCMGET                             = 0x5415
+       TIOCMIWAIT                           = 0x545c
+       TIOCMSET                             = 0x5418
+       TIOCM_CAR                            = 0x40
+       TIOCM_CD                             = 0x40
+       TIOCM_CTS                            = 0x20
+       TIOCM_DSR                            = 0x100
+       TIOCM_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
+       TIOCSISO7816                         = 0xc0285443
+       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
+       XFS_SUPER_MAGIC                      = 0x58465342
+       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"},
+}
index 3814df854935edac0ea92c715b67ef6c4876684f..11496611094b00a1fb5718fe266a042dbc663d11 100644 (file)
@@ -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                              = 0xa
        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
@@ -888,6 +912,11 @@ const (
        KEYCTL_JOIN_SESSION_KEYRING          = 0x1
        KEYCTL_LINK                          = 0x8
        KEYCTL_NEGATE                        = 0xd
+       KEYCTL_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
        KEYCTL_READ                          = 0xb
        KEYCTL_REJECT                        = 0x13
        KEYCTL_RESTRICT_KEYRING              = 0x1d
@@ -897,6 +926,10 @@ const (
        KEYCTL_SETPERM                       = 0x5
        KEYCTL_SET_REQKEY_KEYRING            = 0xe
        KEYCTL_SET_TIMEOUT                   = 0xf
+       KEYCTL_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
        KEYCTL_UNLINK                        = 0x9
        KEYCTL_UPDATE                        = 0x2
        KEY_REQKEY_DEFL_DEFAULT              = 0x0
@@ -954,6 +987,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 +998,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 +1030,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
@@ -1053,6 +1108,7 @@ const (
        NETLINK_FIB_LOOKUP                   = 0xa
        NETLINK_FIREWALL                     = 0x3
        NETLINK_GENERIC                      = 0x10
+       NETLINK_GET_STRICT_CHK               = 0xc
        NETLINK_INET_DIAG                    = 0x4
        NETLINK_IP6_FW                       = 0xd
        NETLINK_ISCSI                        = 0x8
@@ -1074,6 +1130,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
@@ -1194,6 +1252,7 @@ const (
        PACKET_FASTROUTE                     = 0x6
        PACKET_HDRLEN                        = 0xb
        PACKET_HOST                          = 0x0
+       PACKET_IGNORE_OUTGOING               = 0x17
        PACKET_KERNEL                        = 0x7
        PACKET_LOOPBACK                      = 0x5
        PACKET_LOSS                          = 0xe
@@ -1243,6 +1302,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
@@ -1344,6 +1433,7 @@ const (
        PR_SPEC_DISABLE                      = 0x4
        PR_SPEC_ENABLE                       = 0x2
        PR_SPEC_FORCE_DISABLE                = 0x8
+       PR_SPEC_INDIRECT_BRANCH              = 0x1
        PR_SPEC_NOT_AFFECTED                 = 0x0
        PR_SPEC_PRCTL                        = 0x1
        PR_SPEC_STORE_BYPASS                 = 0x0
@@ -1488,6 +1578,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 +1623,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 +1691,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 +1712,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 +1727,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 +1747,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 +1762,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 +1797,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 +1855,9 @@ const (
        SIOCGMIIPHY                          = 0x8947
        SIOCGMIIREG                          = 0x8948
        SIOCGPGRP                            = 0x8904
+       SIOCGPPPCSTATS                       = 0x89f2
+       SIOCGPPPSTATS                        = 0x89f0
+       SIOCGPPPVER                          = 0x89f1
        SIOCGRARP                            = 0x8961
        SIOCGSKNS                            = 0x894c
        SIOCGSTAMP                           = 0x8906
@@ -1841,6 +1947,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 +2006,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 +2044,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
@@ -1974,7 +2085,7 @@ const (
        TASKSTATS_GENL_NAME                  = "TASKSTATS"
        TASKSTATS_GENL_VERSION               = 0x1
        TASKSTATS_TYPE_MAX                   = 0x6
-       TASKSTATS_VERSION                    = 0x8
+       TASKSTATS_VERSION                    = 0x9
        TCFLSH                               = 0x540b
        TCGETA                               = 0x5405
        TCGETS                               = 0x5401
@@ -1999,6 +2110,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
@@ -2056,6 +2169,7 @@ const (
        TIOCGETD                             = 0x5424
        TIOCGEXCL                            = 0x80045440
        TIOCGICOUNT                          = 0x545d
+       TIOCGISO7816                         = 0x80285442
        TIOCGLCKTRMIOS                       = 0x5456
        TIOCGPGRP                            = 0x540f
        TIOCGPKT                             = 0x80045438
@@ -2109,6 +2223,7 @@ const (
        TIOCSER_TEMT                         = 0x1
        TIOCSETD                             = 0x5423
        TIOCSIG                              = 0x40045436
+       TIOCSISO7816                         = 0xc0285443
        TIOCSLCKTRMIOS                       = 0x5457
        TIOCSPGRP                            = 0x5410
        TIOCSPTLCK                           = 0x40045431
@@ -2166,6 +2281,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,7 +2432,28 @@ 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
+       XFS_SUPER_MAGIC                      = 0x58465342
        XTABS                                = 0x1800
        ZSMALLOC_MAGIC                       = 0x58295829
 )
index 7fdc85b172609535ec17724ce039ddffaec7425a..036f3247c71d116392d3d073761d3c5a8991c187 100644 (file)
-// 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
 
 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                              = 0xa
+       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_PKEY_DECRYPT                  = 0x1a
+       KEYCTL_PKEY_ENCRYPT                  = 0x19
+       KEYCTL_PKEY_QUERY                    = 0x18
+       KEYCTL_PKEY_SIGN                     = 0x1b
+       KEYCTL_PKEY_VERIFY                   = 0x1c
+       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_SUPPORTS_DECRYPT              = 0x2
+       KEYCTL_SUPPORTS_ENCRYPT              = 0x1
+       KEYCTL_SUPPORTS_SIGN                 = 0x4
+       KEYCTL_SUPPORTS_VERIFY               = 0x8
+       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_GET_STRICT_CHK               = 0xc
+       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_IGNORE_OUTGOING               = 0x17
+       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_INDIRECT_BRANCH              = 0x1
+       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                    = 0x9
+       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
+       TIOCGISO7816                         = 0x40285443
+       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
+       TIOCSISO7816                         = 0xc0285444
+       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
+       XFS_SUPER_MAGIC                      = 0x58465342
+       XTABS                                = 0x1800
+       ZSMALLOC_MAGIC                       = 0x58295829
+       __TIOCFLUSH                          = 0x80047410
 )
 
 // Errors
@@ -1969,174 +2628,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"},
 }
index cd93ce0d85e53032d72b2e7748067599a9fb5688..78cc04ea6df16d26064c318dfdc81490e50bf4c1 100644 (file)
@@ -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
index 071701c41181c10c9e6d1d24242ddcae2028503f..92185e693ff01e4bce473605976d4b904043d242 100644 (file)
@@ -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
index 5fe56ae8c72415d904676f969c67a3659227082b..373ad4543d831fc7582499f57acdc5032bc5cda5 100644 (file)
@@ -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
index 0a1c3e7e8c3b6a323491c31eb0efe1b4203e464a..d8be045189b3457ab01793c60838c5879ec5274e 100644 (file)
@@ -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
index acfc6646919427e0a8b6d1d6630a2e2ea064236a..1f9e8a29ea9e9f887f6e1c6cfdb4434b702cf9d8 100644 (file)
@@ -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
index 93e37c4b289ed8b0a7772e29a0abb621a170bfdb..79d5695c376fb73c60a81d1633d6b804ee006881 100644 (file)
@@ -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
index be42830cf3d382bb7a55deed8a552be087bdd351..22569db31d3cee8118632273ca349620d3271126 100644 (file)
@@ -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 (file)
index 0000000..6bae21e
--- /dev/null
@@ -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 <stdint.h>
+#include <stddef.h>
+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 (file)
index 0000000..3e929e5
--- /dev/null
@@ -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 (file)
index 0000000..a185ee8
--- /dev/null
@@ -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 (file)
index 0000000..aef7c0e
--- /dev/null
@@ -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 <stdint.h>
+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.1_11.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go
new file mode 100644 (file)
index 0000000..c4ec7ff
--- /dev/null
@@ -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
+}
index ac02d4d8419e6eec1ad6b9d5e3903b3ca2857731..23346dc68ff39efabe0fc85f408aebf1a90c74b2 100644 (file)
@@ -1,7 +1,7 @@
-// mksyscall.pl -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,28 @@ 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)
+       }
+       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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       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)
@@ -418,6 +614,11 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o
        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) {
@@ -431,13 +632,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -451,13 +677,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -466,7 +717,23 @@ 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)
+       }
+       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 := 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)
@@ -474,26 +741,71 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro
        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) {
@@ -502,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) {
@@ -527,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) {
@@ -542,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) {
@@ -557,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) {
@@ -572,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) {
@@ -587,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)
@@ -615,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) {
@@ -638,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) {
@@ -660,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) {
@@ -705,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) {
@@ -730,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)
@@ -873,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)
@@ -908,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)
@@ -939,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)
@@ -966,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) {
@@ -974,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) {
@@ -994,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) {
@@ -1014,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
 
@@ -1054,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) {
@@ -1069,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) {
@@ -1084,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) {
@@ -1099,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) {
@@ -1114,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)
@@ -1122,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) {
@@ -1130,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)
@@ -1138,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) {
@@ -1146,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)
@@ -1154,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) {
@@ -1163,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)
@@ -1171,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) {
@@ -1180,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)
@@ -1188,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) {
@@ -1197,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)
@@ -1205,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) {
@@ -1219,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)
@@ -1227,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) {
@@ -1241,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)
@@ -1249,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) {
@@ -1262,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) {
@@ -1282,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) {
@@ -1297,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) {
@@ -1312,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)
@@ -1330,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) {
@@ -1378,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)
@@ -1456,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
 
@@ -1519,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) {
@@ -1539,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) {
@@ -1564,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) {
@@ -1587,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) {
@@ -1602,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) {
@@ -1617,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) {
@@ -1632,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) {
@@ -1648,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)
@@ -1656,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)
@@ -1667,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)
@@ -1691,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)
@@ -1702,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 {
@@ -1710,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 (file)
index 0000000..37b85b4
--- /dev/null
@@ -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 (file)
index 0000000..2581e89
--- /dev/null
@@ -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
+}
index 1dd3cfa0e17ab2736a6f995acadfcd5c0ea391a9..b50178d67922468b1cae984a8f854823611d40ef 100644 (file)
@@ -1,7 +1,7 @@
-// mksyscall.pl -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,28 @@ 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)
+       }
+       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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       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)
@@ -418,6 +614,11 @@ func getxattr(path string, attr string, dest *byte, size int, position uint32, o
        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) {
@@ -431,13 +632,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -451,13 +677,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -466,7 +717,23 @@ 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)
+       }
+       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 := 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)
@@ -474,26 +741,71 @@ func listxattr(path string, dest *byte, size int, options int) (sz int, err erro
        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) {
@@ -502,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) {
@@ -527,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) {
@@ -542,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) {
@@ -557,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) {
@@ -572,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) {
@@ -587,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)
@@ -615,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) {
@@ -638,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) {
@@ -660,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) {
@@ -705,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) {
@@ -730,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)
@@ -873,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)
@@ -908,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)
@@ -939,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)
@@ -966,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) {
@@ -974,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) {
@@ -994,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) {
@@ -1014,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
 
@@ -1054,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) {
@@ -1069,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) {
@@ -1084,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) {
@@ -1099,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) {
@@ -1114,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)
@@ -1122,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) {
@@ -1130,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)
@@ -1138,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) {
@@ -1146,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)
@@ -1154,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) {
@@ -1163,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)
@@ -1171,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) {
@@ -1180,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)
@@ -1188,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) {
@@ -1197,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)
@@ -1205,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) {
@@ -1219,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)
@@ -1227,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) {
@@ -1241,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)
@@ -1249,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) {
@@ -1262,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) {
@@ -1282,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) {
@@ -1297,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) {
@@ -1312,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)
@@ -1330,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) {
@@ -1378,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)
@@ -1456,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
 
@@ -1519,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) {
@@ -1539,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) {
@@ -1564,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) {
@@ -1587,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) {
@@ -1602,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) {
@@ -1617,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) {
@@ -1632,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) {
@@ -1648,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)
@@ -1656,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)
@@ -1667,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)
@@ -1691,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)
@@ -1702,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 {
@@ -1710,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 (file)
index 0000000..da9b900
--- /dev/null
@@ -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 (file)
index 0000000..f8caece
--- /dev/null
@@ -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
+}
index cab46e74ba447c370a966427cc9f3f93a0253bef..01cffbf46ccf9ae6582047df1bb36bf65020514d 100644 (file)
@@ -1,7 +1,7 @@
-// mksyscall.pl -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,32 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       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)
+       }
+       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) {
@@ -431,13 +632,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -451,13 +677,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -466,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)
@@ -474,26 +725,87 @@ 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 := 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)
+       }
+       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) {
@@ -502,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) {
@@ -527,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) {
@@ -542,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) {
@@ -557,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) {
@@ -572,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) {
@@ -587,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)
@@ -615,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) {
@@ -638,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) {
@@ -660,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) {
@@ -705,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) {
@@ -730,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)
@@ -873,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)
@@ -908,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)
@@ -939,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)
@@ -966,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) {
@@ -974,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) {
@@ -994,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) {
@@ -1014,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
 
@@ -1054,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) {
@@ -1069,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) {
@@ -1084,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) {
@@ -1099,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) {
@@ -1114,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)
@@ -1122,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) {
@@ -1130,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)
@@ -1138,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) {
@@ -1146,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)
@@ -1154,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) {
@@ -1163,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)
@@ -1171,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) {
@@ -1180,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)
@@ -1188,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) {
@@ -1197,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)
@@ -1205,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) {
@@ -1219,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)
@@ -1227,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) {
@@ -1241,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)
@@ -1249,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) {
@@ -1262,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) {
@@ -1282,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) {
@@ -1297,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) {
@@ -1312,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)
@@ -1330,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) {
@@ -1378,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)
@@ -1456,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
 
@@ -1519,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) {
@@ -1539,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) {
@@ -1564,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) {
@@ -1587,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) {
@@ -1602,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) {
@@ -1617,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) {
@@ -1632,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) {
@@ -1648,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)
@@ -1656,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)
@@ -1667,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)
@@ -1691,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)
@@ -1702,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 {
@@ -1710,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 (file)
index 0000000..994056f
--- /dev/null
@@ -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 (file)
index 0000000..3fd0f3c
--- /dev/null
@@ -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
+}
index 13478dd0bcf3d9f3ee84e6e7a34fbb5f1708110d..8f2691deea9305e936f3eab309960a1018e9ea7c 100644 (file)
@@ -1,7 +1,7 @@
-// mksyscall.pl -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,32 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       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)
+       }
+       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) {
@@ -431,13 +632,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -451,13 +677,38 @@ 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) {
+       var _p0 *byte
+       _p0, err = BytePtrFromString(attr)
+       if err != nil {
+               return
+       }
+       _, _, 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) {
@@ -466,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)
@@ -474,26 +725,87 @@ 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 := 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)
+       }
+       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) {
@@ -502,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) {
@@ -527,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) {
@@ -542,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) {
@@ -557,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) {
@@ -572,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) {
@@ -587,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)
@@ -615,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) {
@@ -638,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) {
@@ -660,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) {
@@ -705,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) {
@@ -730,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)
@@ -873,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)
@@ -908,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)
@@ -939,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)
@@ -966,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) {
@@ -974,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) {
@@ -994,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) {
@@ -1014,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
 
@@ -1054,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) {
@@ -1069,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) {
@@ -1084,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) {
@@ -1099,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) {
@@ -1114,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)
@@ -1122,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) {
@@ -1130,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)
@@ -1138,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) {
@@ -1146,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)
@@ -1154,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) {
@@ -1163,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)
@@ -1171,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) {
@@ -1180,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)
@@ -1188,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) {
@@ -1197,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)
@@ -1205,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) {
@@ -1219,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)
@@ -1227,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) {
@@ -1241,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)
@@ -1249,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) {
@@ -1262,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) {
@@ -1282,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) {
@@ -1297,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) {
@@ -1312,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)
@@ -1330,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) {
@@ -1378,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)
@@ -1456,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
 
@@ -1519,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) {
@@ -1539,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) {
@@ -1564,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) {
@@ -1587,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) {
@@ -1602,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) {
@@ -1617,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) {
@@ -1632,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) {
@@ -1648,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)
@@ -1656,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)
@@ -1667,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)
@@ -1691,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)
@@ -1702,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 {
@@ -1710,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 (file)
index 0000000..61dc0d4
--- /dev/null
@@ -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)
index 91f36e9ec30f22d1c25cc68dd0f2c9eb3191fa93..da9986dd213c410a3ca49b142c6209c7e5395e0d 100644 (file)
@@ -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)
index a86434a7ba8f2282e43d0277a82f5febb93289d2..80903e47b65c2fcfaaf41deacb397d1c6bce1d12 100644 (file)
@@ -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)
index 040e2f760cd414b270057300f51f14db8eccb8e4..cd250ff0e240e8e8a83c1b0eec76e688dc674d3d 100644 (file)
@@ -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)
index cddc5e86b1976673f2fd8a8033b0fee2ba16964e..290a9c2cb06c31d189441c9740c8be592bef6503 100644 (file)
@@ -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_freebsd_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go
new file mode 100644 (file)
index 0000000..c6df9d2
--- /dev/null
@@ -0,0 +1,2015 @@
+// go run mksyscall.go -tags freebsd,arm64 -- syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go
+// Code generated by the command above; see README.md. DO NOT EDIT.
+
+// +build freebsd,arm64
+
+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 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
+}
index 237e960959e97db67be62f1e8882d6174fa42f86..5356a517594d22c79a30a18c765c85908913d012 100644 (file)
@@ -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)
index 9b40f580b083fdf59745ac74c4f8fae742f4ff26..0f6d265d8b070ca1ca9359e6e24f1a0852ad96fe 100644 (file)
@@ -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
+}
index d93cc2f3b172df67fb182b1cda1b2c04a17e79a9..012261ad549f5fe31d3dbb2c1d4fe059864e4eca 100644 (file)
@@ -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)
@@ -2110,3 +2282,13 @@ 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 armSyncFileRange(fd int, flags int, off int64, n int64) (err error) {
+       _, _, e1 := Syscall6(SYS_ARM_SYNC_FILE_RANGE, uintptr(fd), uintptr(flags), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32))
+       if e1 != 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
index 5f7d0213b275a92aa5a7827862a59b95ce015bb9..b890cb03c6e15eb7a1066ca83d8d95efb80fd828 100644 (file)
@@ -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)
index e761705282551eb8db8ff321a06be752e50d2f87..cc17b43d35564b9b273d558124b888aaf4196101 100644 (file)
@@ -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)
index 382e072f5e552ffb46cbd9b5596bdd1836d83aca..25026415ddc11b025fe2db4eb114fff2ab4a2ec6 100644 (file)
@@ -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)
@@ -1547,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 {
@@ -2121,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)
index da33eb12b072b6b1f5e1dd8f3bf84ae1c7796437..83d8bb8af8c1fbb77d7b5c7872865dacb3e2971e 100644 (file)
@@ -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)
@@ -1547,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 {
@@ -2121,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)
index f6e45189ae5303dc644cc1de37545638b413d849..b16b3e102989fc57aeaf99597e560698ae7e79af 100644 (file)
@@ -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)
index 0ae2aa842254a224da1bdbeedfe3e2dec75d7156..27b6a6bf0e39564d194a8fafa00d83f2d60d0148 100644 (file)
@@ -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
+}
index fa16c165e1179915e75410d1ad0e06ce24d60674..f7ecc9afda5714156c2306d92c20034adaa02cd9 100644 (file)
@@ -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 (file)
index 0000000..e3cd4e5
--- /dev/null
@@ -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
+}
index 38f903cd3e1f69c4e06bd8d9348bd42b72f3e75f..3001d3798198ad22c33678fbef5a240b8a4e30af 100644 (file)
@@ -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
+}
index b26aee9579a63b33e024119c56b13478d1e762a8..aafe3660fa28e23fef2bd34fa97acce39163a8e6 100644 (file)
@@ -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 {
index b3298930e7422c9d607d0f07a257f05026d290fe..642db7670a20977a4499f655febb4daa889b0c7b 100644 (file)
@@ -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)
index 5096ef07e4902fb5c0d2a93fea54f38dc896db1e..59585fee3541f704409c0b210cdbd76567f0cf3d 100644 (file)
@@ -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)
index b7141c63f9f4b45a9e70e26a0ae4d1fb601a25e5..6ec31434b214b1f65fbe421391ce02e8d730d4b8 100644 (file)
@@ -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)
index 1942049b0f8934dd866a96f9d6d05f0241b233bc..6a489fac0a69e7f6cd1f2f7c8cfff6ebe1411248 100644 (file)
@@ -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)
index d351c72cb716fe31a5baafcd255513d3fece8b65..30cba4347c12167f53b886f5076a8a23bdcef23b 100644 (file)
@@ -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)
index 617d47f0f311ba1d80165622e5d66b1181da29f0..fa1beda33e38d18310bb4475c0f3d8d38b27b1f6 100644 (file)
@@ -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)
index e2e5fc5e0a6b1117b54179b00b4c45179765af6e..97b22a499ed3be305c1d5250f3439bfa90fc369c 100644 (file)
@@ -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 {
index 90c95c2c75cd4988f371db2d55422e22fba4f492..d014451c9d8e9ccc431190bc80d2d8ee2fb5ad5c 100644 (file)
@@ -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}},
 }
index d1d36da3f5127f59c77cc2625006cd78d7755278..f33614532f999d2ea26f0aea0a98c8c4aecb36c2 100644 (file)
@@ -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
index e35de4145ed90ff8a1bc934727a88a5c0bdf0f64..9e2837e0e326fc56ff252dd5407bca326c745202 100644 (file)
@@ -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
index f2df27db2c237561a69b36f80cba9e0c997a5c11..103a72ed1c0ebea77cfc1f12390a961df4bbd9cc 100644 (file)
@@ -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
index 9694630232f5a30cbbf5d6ae1830f12f784fc810..7ab2130b967b1d046ba5be7d649e25345ff3b4cd 100644 (file)
@@ -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
index b2c9ef81b819618f33eb37fb711b7b9f02022002..ff3976edbbb14194d8b9be9931e80b50f67785c5 100644 (file)
@@ -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); }
index b64a8122ce4c32dff06f9af0b171a2a3af14287a..b1e81b71722084c78ab7e94aacf6c807967fe5f1 100644 (file)
@@ -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,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_exit_args void
+       SYS_FORK                     = 2   // { int fork(void); }
+       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, 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); }
+       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 obreak_args int
+       SYS_GETPID                   = 20  // { pid_t getpid(void); }
+       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, 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); }
+       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, 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); }
+       SYS_ACCT                     = 51  // { int acct(char *path); }
+       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, 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, 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 ovadvise_args int
+       SYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }
+       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 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(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, 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, caddr_t val, int valsize); }
+       SYS_LISTEN                   = 106 // { int listen(int s, int backlog); }
+       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); }
+       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, 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, 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, struct timeval *olddelta); }
+       SYS_SETSID                   = 147 // { int setsid(void); }
+       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, 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, 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); }
+       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, 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, 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, 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, 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, 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, struct timespec *rmtp); }
+       SYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }
+       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, int inherit); }
+       SYS_RFORK                    = 251 // { int rfork(int flags); }
+       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, 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, 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, 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, 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 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, 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( 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, 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, 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, struct timespec *interval); }
+       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, 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, 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, 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, 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, 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, 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, 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, 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( 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, 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, 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, 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( 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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); }
 )
index 81722ac9f3bdd1d17ad8091d320c9b789af49126..73e277fe7a0944b255cd1bf602b29354dcda8942 100644 (file)
@@ -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,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_exit_args void
+       SYS_FORK                     = 2   // { int fork(void); }
+       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, 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); }
+       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 obreak_args int
+       SYS_GETPID                   = 20  // { pid_t getpid(void); }
+       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, 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); }
+       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, 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); }
+       SYS_ACCT                     = 51  // { int acct(char *path); }
+       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, 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, 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 ovadvise_args int
+       SYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }
+       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 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(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, 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, caddr_t val, int valsize); }
+       SYS_LISTEN                   = 106 // { int listen(int s, int backlog); }
+       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); }
+       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, 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, 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, struct timeval *olddelta); }
+       SYS_SETSID                   = 147 // { int setsid(void); }
+       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, 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, 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); }
+       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, 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, 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, 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, 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, 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, struct timespec *rmtp); }
+       SYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }
+       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, int inherit); }
+       SYS_RFORK                    = 251 // { int rfork(int flags); }
+       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, 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, 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, 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, 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 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, 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( 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, 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, 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, struct timespec *interval); }
+       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, 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, 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, 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, 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, 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, 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, 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, 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( 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, 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, 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, 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( 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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); }
 )
index 448831418165bd250c91a15d159ae163ecd1b2f1..e12b4691969d28fde0100a0e0fa2c1ad0615fe9a 100644 (file)
@@ -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,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_exit_args void
+       SYS_FORK                     = 2   // { int fork(void); }
+       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, 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); }
+       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 obreak_args int
+       SYS_GETPID                   = 20  // { pid_t getpid(void); }
+       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, 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); }
+       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, 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); }
+       SYS_ACCT                     = 51  // { int acct(char *path); }
+       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, 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, 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 ovadvise_args int
+       SYS_MUNMAP                   = 73  // { int munmap(void *addr, size_t len); }
+       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 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(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, 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, caddr_t val, int valsize); }
+       SYS_LISTEN                   = 106 // { int listen(int s, int backlog); }
+       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); }
+       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, 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, 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, struct timeval *olddelta); }
+       SYS_SETSID                   = 147 // { int setsid(void); }
+       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, 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, 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); }
+       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, 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, 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, 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, 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, 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, struct timespec *rmtp); }
+       SYS_FFCLOCK_GETCOUNTER       = 241 // { int ffclock_getcounter(ffcounter *ffcount); }
+       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, int inherit); }
+       SYS_RFORK                    = 251 // { int rfork(int flags); }
+       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, 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, 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, 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, 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 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, 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( 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, 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, 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, struct timespec *interval); }
+       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, 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, 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, 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, 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, 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, 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, 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, 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( 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, 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, 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, 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( 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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 (file)
index 0000000..8c1e16c
--- /dev/null
@@ -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); }
+)
index 95ab12903ec5da108bc1b668e4a2e44533415f7a..8d17873de0fe06120d14fbf2d5962f0c05552deb 100644 (file)
@@ -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
 )
index c5dabf2e4518594eeb52eb2be71854c253877325..b3d8ad79d425bb1fab13173cac0abee80f0c2dda 100644 (file)
@@ -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
 )
index ab7fa5fd3939dbfa28562eaa1016b9b266546baf..e092822fbadd111dd9d510acf6cc33c46be77756 100644 (file)
@@ -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
 )
index b1c6b4bd3b39dbf8620c47060e65f0c71093a610..3206967896afd8c389adba90acb09d3f243fbc6d 100644 (file)
@@ -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
 )
index 2e9aa7a3e7ece3bb2f8704314e6b4f155f4d2171..6893a5bd055b135f0feb33f6c2d39d1cc482414b 100644 (file)
@@ -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
 )
index 92827635aae49e4fbb12414f7b37e54c1998dd6b..40164cacdf5c309782d558e9b5a7d15786b86f37 100644 (file)
@@ -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
 )
index 45bd3fd6c84be01cb84059e22b77e0446e9cdf6c..8a909738bc0ef206ee6c0e75eeb15848931be73c 100644 (file)
@@ -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
 )
index 62ccac4b742122e94255cabeadea2af8e97e0a6f..8d78184224586f88449d637ab3f1a83e7e2d9a2a 100644 (file)
@@ -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
 )
index 384d49bfa5a5cf1fa915d776a094a7197835fd94..ec5bde3d5634539ff0f2418a6f0e702cfd5c8f59 100644 (file)
@@ -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
 )
index 9623248a5ef14edfe457c7fb190657dcd28b735b..bdbabdbcdb1791c61fd4827d90aa7c72a90477e5 100644 (file)
@@ -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 (file)
index 0000000..473c746
--- /dev/null
@@ -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
+)
index c061d6f1d3bb392dd076789453f4929a0ce43e3c..6eb7c257f8cafd49c3a19c7f3c1bd3506fa388db 100644 (file)
@@ -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
 )
index 2d099367215c85438f859977ed6b3075b98e9157..93480fcb168386765fc0d60e4331912d76f244be 100644 (file)
@@ -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
 )
index f0daa05a9cbf729062571cfde0a0f9030e9639df..e66a8c9d39eae528646aa6d252ae4cc73137f20c 100644 (file)
@@ -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
 
index ddb25b94f36d8dfb83a807e18b8ea1ee914872d2..42c788f2490c255ed602affa083fe7ad8c4638aa 100644 (file)
@@ -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
 
index 315bd63f890417471de067642ac81ab773da6ba7..0a0757179ba418a9596a5cab2f56f92e1d5443b6 100644 (file)
@@ -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
 
index 07787301f01022da5ca7e65b5caf6ed2406d2587..d5bf3c449930ae9234dc9b1ddca7c8f85f137765 100644 (file)
@@ -1,5 +1,5 @@
-// mksysnum_openbsd.pl
-// Code generated by the command above; DO NOT EDIT.
+// 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,109 +9,119 @@ 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___TFORK        = 8   // { int sys___tfork(const struct __tfork *param, \
+       SYS_GETENTROPY     = 7   // { int sys_getentropy(void *buf, size_t nbyte); }
+       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_ACCESS         = 33  // { int sys_access(const char *path, int flags); }
+       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); }
        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); }
        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_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); }
        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  // { int sys_readlink(const char *path, char *buf, \
-       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, int pgid); }
-       SYS_UTIMENSAT      = 84  // { int sys_utimensat(int fd, const char *path, \
-       SYS_FUTIMENS       = 85  // { int sys_futimens(int fd, \
-       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_SETPGID        = 82  // { int sys_setpgid(pid_t pid, pid_t pgid); }
+       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___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_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_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \
-       SYS_READV          = 120 // { ssize_t sys_readv(int fd, \
-       SYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \
+       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, 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); }
        SYS_SETREUID       = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
@@ -119,89 +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); }
 )
index 10edff07d5754f6e7b8244009bc07e3640959c97..cbcfdfb3367a910a4cbca470c03006c2883cdb2d 100644 (file)
@@ -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,80 +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_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); }
@@ -128,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); }
 )
index 7a1693acbc197afd9289cdde4396fbf93cd3ef6e..a84cead963dc68d896328409ef8ea9f55add8cc8 100644 (file)
@@ -1,5 +1,5 @@
-// mksysnum_openbsd.pl
-// Code generated by the command above; DO NOT EDIT.
+// 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,77 +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_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); }
        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_SENDSYSLOG     = 83  // { int sys_sendsyslog(const void *buf, size_t nbyte); }
-       SYS_UTIMENSAT      = 84  // { int sys_utimensat(int fd, const char *path, \
-       SYS_FUTIMENS       = 85  // { int sys_futimens(int fd, \
-       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_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_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \
-       SYS_READV          = 120 // { ssize_t sys_readv(int fd, \
-       SYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \
+       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, 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); }
@@ -125,89 +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_aix_ppc.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go
new file mode 100644 (file)
index 0000000..cedc9b0
--- /dev/null
@@ -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 (file)
index 0000000..f46482d
--- /dev/null
@@ -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
index 327af5fba16c0e7f10ec4b9d3cee4edf2e0a4fac..2aeb52a886decc2988fe602f599012cdd689b6f1 100644 (file)
@@ -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 (
index 116e6e0757854587623cba209ca084b14a79fc54..0d0d9f2ccb7abd5e6f15af9bd3a205629a5a7733 100644 (file)
@@ -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 (
index 2750ad76070d1f3800a6b8f4ab371e93fba62c39..04e344b78d88329dcbf0f15b0c2dd3050549bde7 100644 (file)
@@ -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 (
index 8cead0996c849b06a2cad1405691a1dfdfd709ad..9fec185c180f0b51b0b59f26ea00084412f3e16b 100644 (file)
@@ -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 (
index 315a553bd5bb07c86da6cd3a8ad3283ed6432cd3..7b34e2e2c686813c6ef44b4afa9c3a9a98e74406 100644 (file)
@@ -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
index 878a21ad6d74a21d56046de0bb493f5d5d9f7407..c146c1ad35441365ac62067789fa9b6ce8212f0c 100644 (file)
@@ -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 {
index 8408af1250cbb5cc6bb611c17c16f5a2666b4bc5..ac33a8dd4a6c206c5b91e6fb74e86e3a984646c3 100644 (file)
@@ -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 {
index 4b2d9a4839974eed04b361594c52d66f3929ec66..e27511a642f116368b393c13bf48398930442a44 100644 (file)
@@ -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_freebsd_arm64.go b/src/cmd/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go
new file mode 100644 (file)
index 0000000..2aadc1a
--- /dev/null
@@ -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
+}
index e89bc6b3664cede7872b813e2d4deed84803f36a..ebf10d48d364c824f4f3886a60ceee9506ea7158 100644 (file)
@@ -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
 )
 
@@ -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
@@ -248,9 +246,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -271,6 +275,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
@@ -365,7 +379,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -401,9 +414,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 +449,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 +493,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 +518,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
@@ -617,7 +648,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [2]byte
        Filter *SockFilter
 }
 
@@ -753,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
@@ -799,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 (
@@ -1831,7 +1862,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1844,3 +1874,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
+)
index d95372baecf91d1aebd836108711ea8687a9fcb7..99a6900d21156570b5ff56258ee56e35189d1882 100644 (file)
@@ -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
 )
 
@@ -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
@@ -250,9 +246,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -273,6 +275,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
@@ -321,7 +333,6 @@ type PacketMreq struct {
 type Msghdr struct {
        Name       *byte
        Namelen    uint32
-       _          [4]byte
        Iov        *Iovec
        Iovlen     uint64
        Control    *byte
@@ -369,7 +380,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -405,9 +415,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 +450,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 +494,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 +519,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
@@ -621,7 +649,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [6]byte
        Filter *SockFilter
 }
 
@@ -679,7 +706,6 @@ type Sysinfo_t struct {
        Freeswap  uint64
        Procs     uint16
        Pad       uint16
-       _         [4]byte
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
@@ -698,7 +724,6 @@ type Utsname struct {
 
 type Ustat_t struct {
        Tfree  int32
-       _      [4]byte
        Tinode uint64
        Fname  [6]int8
        Fpack  [6]int8
@@ -771,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
@@ -793,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
@@ -817,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 (
@@ -1165,7 +1189,6 @@ type HDGeometry struct {
        Heads     uint8
        Sectors   uint8
        Cylinders uint16
-       _         [4]byte
        Start     uint64
 }
 
@@ -1851,7 +1874,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1864,3 +1886,114 @@ type RTCPLLInfo struct {
        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                  = 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
+)
index 77875ba01b67b70afdcf47f491af94fbe17899ce..5ccc4b5414a03e1b48b7dbd0605114294a413ad5 100644 (file)
@@ -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
 )
 
@@ -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
@@ -251,9 +250,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -274,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]uint8
@@ -368,7 +383,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -404,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
@@ -436,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
@@ -479,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
@@ -504,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
@@ -620,7 +652,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [2]byte
        Filter *SockFilter
 }
 
@@ -741,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
@@ -787,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 (
@@ -1820,7 +1852,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1833,3 +1864,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
+)
index 5a9df694a6f769df7b9d5717bc81bc80c6944b19..be375d9bb2e5d95975ffd48adaaaa67cfae71916 100644 (file)
@@ -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
 )
 
@@ -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
@@ -251,9 +247,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -274,6 +276,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
@@ -322,7 +334,6 @@ type PacketMreq struct {
 type Msghdr struct {
        Name       *byte
        Namelen    uint32
-       _          [4]byte
        Iov        *Iovec
        Iovlen     uint64
        Control    *byte
@@ -370,7 +381,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -406,9 +416,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 +451,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 +495,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 +520,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
@@ -622,7 +650,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [6]byte
        Filter *SockFilter
 }
 
@@ -657,7 +684,6 @@ type Sysinfo_t struct {
        Freeswap  uint64
        Procs     uint16
        Pad       uint16
-       _         [4]byte
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
@@ -676,7 +702,6 @@ type Utsname struct {
 
 type Ustat_t struct {
        Tfree  int32
-       _      [4]byte
        Tinode uint64
        Fname  [6]int8
        Fpack  [6]int8
@@ -750,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
@@ -772,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
@@ -796,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 (
@@ -1144,7 +1168,6 @@ type HDGeometry struct {
        Heads     uint8
        Sectors   uint8
        Cylinders uint16
-       _         [4]byte
        Start     uint64
 }
 
@@ -1830,7 +1853,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1843,3 +1865,114 @@ type RTCPLLInfo struct {
        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                  = 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
+)
index dcb239de813da64813f9c44137f227e80e2f3170..195f7e1f85b354c61ac4102e0490d85eb99003b2 100644 (file)
@@ -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,9 +249,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -272,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
@@ -366,7 +382,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -402,9 +417,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 +452,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 +496,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 +521,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
@@ -618,7 +651,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [2]byte
        Filter *SockFilter
 }
 
@@ -745,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
@@ -791,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 (
@@ -1825,7 +1858,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1838,3 +1870,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
+)
index 9cf85f7218a3d797a3615ae81b24aae666d5c5c9..77acf56985d685f8757924be4fc5a2e9b4921bc5 100644 (file)
@@ -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
 )
 
@@ -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
@@ -251,9 +247,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -274,6 +276,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
@@ -322,7 +334,6 @@ type PacketMreq struct {
 type Msghdr struct {
        Name       *byte
        Namelen    uint32
-       _          [4]byte
        Iov        *Iovec
        Iovlen     uint64
        Control    *byte
@@ -370,7 +381,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -406,9 +416,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 +451,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 +495,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 +520,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
@@ -622,7 +650,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [6]byte
        Filter *SockFilter
 }
 
@@ -660,7 +687,6 @@ type Sysinfo_t struct {
        Freeswap  uint64
        Procs     uint16
        Pad       uint16
-       _         [4]byte
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
@@ -679,7 +705,6 @@ type Utsname struct {
 
 type Ustat_t struct {
        Tfree  int32
-       _      [4]byte
        Tinode uint64
        Fname  [6]int8
        Fpack  [6]int8
@@ -752,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
@@ -774,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
@@ -798,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 (
@@ -1146,7 +1170,6 @@ type HDGeometry struct {
        Heads     uint8
        Sectors   uint8
        Cylinders uint16
-       _         [4]byte
        Start     uint64
 }
 
@@ -1832,7 +1855,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1845,3 +1867,114 @@ type RTCPLLInfo struct {
        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
+)
index 6fd66e7510db53f75677683b00e1cfe883a8799e..2fb7498da65dc80f2d0f23217308be654e1cd86f 100644 (file)
@@ -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
 )
 
@@ -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
@@ -251,9 +247,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -274,6 +276,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
@@ -322,7 +334,6 @@ type PacketMreq struct {
 type Msghdr struct {
        Name       *byte
        Namelen    uint32
-       _          [4]byte
        Iov        *Iovec
        Iovlen     uint64
        Control    *byte
@@ -370,7 +381,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -406,9 +416,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 +451,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 +495,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 +520,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
@@ -622,7 +650,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [6]byte
        Filter *SockFilter
 }
 
@@ -660,7 +687,6 @@ type Sysinfo_t struct {
        Freeswap  uint64
        Procs     uint16
        Pad       uint16
-       _         [4]byte
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
@@ -679,7 +705,6 @@ type Utsname struct {
 
 type Ustat_t struct {
        Tfree  int32
-       _      [4]byte
        Tinode uint64
        Fname  [6]int8
        Fpack  [6]int8
@@ -752,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
@@ -774,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
@@ -798,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 (
@@ -1146,7 +1170,6 @@ type HDGeometry struct {
        Heads     uint8
        Sectors   uint8
        Cylinders uint16
-       _         [4]byte
        Start     uint64
 }
 
@@ -1832,7 +1855,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1845,3 +1867,114 @@ type RTCPLLInfo struct {
        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
+)
index faa5b3ef18077f1d3358191b8d84317628eb0109..41cb14863c8cdb6bb69538d6089996f180c92b30 100644 (file)
@@ -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,9 +249,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -272,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
@@ -366,7 +382,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -402,9 +417,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 +452,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 +496,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 +521,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
@@ -618,7 +651,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [2]byte
        Filter *SockFilter
 }
 
@@ -745,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
@@ -791,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 (
@@ -1825,7 +1858,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1838,3 +1870,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
+)
index ad4c452460c0c0e281e19ce1b7d67bedeb3fc47e..8e6b5fa68e8decd15c3a0695faac7400c5860a86 100644 (file)
@@ -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
 )
 
@@ -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
@@ -252,9 +248,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -275,6 +277,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
@@ -323,7 +335,6 @@ type PacketMreq struct {
 type Msghdr struct {
        Name       *byte
        Namelen    uint32
-       _          [4]byte
        Iov        *Iovec
        Iovlen     uint64
        Control    *byte
@@ -371,7 +382,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -407,9 +417,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 +452,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 +496,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 +521,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
@@ -623,7 +651,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [6]byte
        Filter *SockFilter
 }
 
@@ -667,7 +694,6 @@ type Sysinfo_t struct {
        Freeswap  uint64
        Procs     uint16
        Pad       uint16
-       _         [4]byte
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
@@ -686,7 +712,6 @@ type Utsname struct {
 
 type Ustat_t struct {
        Tfree  int32
-       _      [4]byte
        Tinode uint64
        Fname  [6]uint8
        Fpack  [6]uint8
@@ -760,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
@@ -782,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
@@ -806,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 (
@@ -1154,7 +1178,6 @@ type HDGeometry struct {
        Heads     uint8
        Sectors   uint8
        Cylinders uint16
-       _         [4]byte
        Start     uint64
 }
 
@@ -1840,7 +1863,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1853,3 +1875,114 @@ type RTCPLLInfo struct {
        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
+)
index 1fdb2f21626dfe42579ccb8b16c61f2b4257c1ec..019d2d6a9d94d0e93c7acb1a8832f2200bf71df4 100644 (file)
@@ -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
 )
 
@@ -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
@@ -252,9 +248,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -275,6 +277,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
@@ -323,7 +335,6 @@ type PacketMreq struct {
 type Msghdr struct {
        Name       *byte
        Namelen    uint32
-       _          [4]byte
        Iov        *Iovec
        Iovlen     uint64
        Control    *byte
@@ -371,7 +382,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -407,9 +417,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 +452,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 +496,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 +521,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
@@ -623,7 +651,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [6]byte
        Filter *SockFilter
 }
 
@@ -667,7 +694,6 @@ type Sysinfo_t struct {
        Freeswap  uint64
        Procs     uint16
        Pad       uint16
-       _         [4]byte
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
@@ -686,7 +712,6 @@ type Utsname struct {
 
 type Ustat_t struct {
        Tfree  int32
-       _      [4]byte
        Tinode uint64
        Fname  [6]uint8
        Fpack  [6]uint8
@@ -760,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
@@ -782,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
@@ -806,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 (
@@ -1154,7 +1178,6 @@ type HDGeometry struct {
        Heads     uint8
        Sectors   uint8
        Cylinders uint16
-       _         [4]byte
        Start     uint64
 }
 
@@ -1840,7 +1863,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1853,3 +1875,114 @@ type RTCPLLInfo struct {
        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/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 (file)
index 0000000..cf110ce
--- /dev/null
@@ -0,0 +1,2005 @@
+// 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
+       Offset    int64
+       Freq      int64
+       Maxerror  int64
+       Esterror  int64
+       Status    int32
+       Constant  int64
+       Precision int64
+       Tolerance int64
+       Time      Timeval
+       Tick      int64
+       Ppsfreq   int64
+       Jitter    int64
+       Shift     int32
+       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
+       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
+       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
+       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
+       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
+       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
+       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
+       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
+       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]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
+       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
+       Thrashing_count           uint64
+       Thrashing_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
+       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                  = 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
+)
index d32079d1aaa097c5c6e779e55715f74f34ef9c0d..abdc0863df2dd062a5aeb8a8fb2e1fb593d7e0fd 100644 (file)
@@ -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
 )
 
@@ -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
@@ -250,9 +246,15 @@ type RawSockaddrL2 struct {
        _           [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
 }
@@ -273,6 +275,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
@@ -321,7 +333,6 @@ type PacketMreq struct {
 type Msghdr struct {
        Name       *byte
        Namelen    uint32
-       _          [4]byte
        Iov        *Iovec
        Iovlen     uint64
        Control    *byte
@@ -369,7 +380,6 @@ type TCPInfo struct {
        Probes         uint8
        Backoff        uint8
        Options        uint8
-       _              [2]byte
        Rto            uint32
        Ato            uint32
        Snd_mss        uint32
@@ -405,9 +415,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 +450,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 +494,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 +519,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
@@ -621,7 +649,6 @@ type SockFilter struct {
 
 type SockFprog struct {
        Len    uint16
-       _      [6]byte
        Filter *SockFilter
 }
 
@@ -651,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
@@ -683,7 +707,6 @@ type Sysinfo_t struct {
        Freeswap  uint64
        Procs     uint16
        Pad       uint16
-       _         [4]byte
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
@@ -702,7 +725,6 @@ type Utsname struct {
 
 type Ustat_t struct {
        Tfree  int32
-       _      [4]byte
        Tinode uint64
        Fname  [6]int8
        Fpack  [6]int8
@@ -776,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
@@ -798,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
@@ -822,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 (
@@ -1170,7 +1191,6 @@ type HDGeometry struct {
        Heads     uint8
        Sectors   uint8
        Cylinders uint16
-       _         [4]byte
        Start     uint64
 }
 
@@ -1857,7 +1877,6 @@ type RTCTime struct {
 type RTCWkAlrm struct {
        Enabled uint8
        Pending uint8
-       _       [2]byte
        Time    RTCTime
 }
 
@@ -1870,3 +1889,114 @@ type RTCPLLInfo struct {
        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                  = 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
+)
index 8e7384b89ca77cd45518f05de619619da776149a..b0c9798d75af93d687ff8022010912bc858393ee 100644 (file)
@@ -1,15 +1,16 @@
+// 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
 
 const (
-       sizeofPtr      = 0x8
-       sizeofShort    = 0x2
-       sizeofInt      = 0x4
-       sizeofLong     = 0x8
-       sizeofLongLong = 0x8
+       SizeofPtr      = 0x8
+       SizeofShort    = 0x2
+       SizeofInt      = 0x4
+       SizeofLong     = 0x8
+       SizeofLongLong = 0x8
        PathMax        = 0x1000
 )
 
@@ -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,1214 @@ 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
+       Thrashing_count           uint64
+       Thrashing_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
+)
index 4b86fb2b332822ed3586c8a978451d5131db3c7b..2dae0c17a3c2064877332180a734cb42575a3e25 100644 (file)
@@ -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
+}
index 9048a509d0883c5271e5ef3b0e6d23765f417fe9..1f0e76c0ccc6e81207795bee9e8b3d43ac50be01 100644 (file)
@@ -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
+}
index 00525e7b029615b005f6d36a7cd37991303b48c7..53f2159c7d2b0fa7c6a14be15e28fb4fda8adc89 100644 (file)
@@ -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
+}
index d5a2d75da38349e7092bc093b949b75ec70ae75d..8b37d83992b6fdd495a4556d413e9283be818d64 100644 (file)
@@ -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
+}
index 5a9c8184859b536098bce7443549ea6fe7618454..6efea463559f8913967ff8a8ac1af81d2cacabd9 100644 (file)
@@ -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
+}
index e35b13b6fcf73452024bda2cbacd9b8d4ecd4f3e..510efc3eaac69f9ff4f45c6979fb684d99753b07 100644 (file)
@@ -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
+}
index 2248598d03f99f4ede7fbb6ca91601e3c1746f27..8531a190f26461b6b9d546f9607f6302c497acd5 100644 (file)
@@ -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
index 60eb4478e4093cb2765dae5d4c0d45d3d8e82752..feed8fabde676a685efdf2f97e266e38b7953a21 100644 (file)
@@ -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)
index 0e27464e8c4c10af08517d39c3dc46624a606ef6..539dda2413ec25891ef9d2708855d87f85065f98 100644 (file)
@@ -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/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 (file)
index ae66a7d..0000000
+++ /dev/null
@@ -1,83 +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:
-//
-//   $ GOVETTOOL=$(which vet-lite) go vet
-//
-// For a checker also capable of running standalone, use multichecker.
-package main
-
-import (
-       "flag"
-       "log"
-       "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/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/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,
-       bools.Analyzer,
-       buildtag.Analyzer,
-       cgocall.Analyzer,
-       composite.Analyzer,
-       copylock.Analyzer,
-       httpresponse.Analyzer,
-       loopclosure.Analyzer,
-       lostcancel.Analyzer,
-       nilfunc.Analyzer,
-       pkgfact.Analyzer,
-       printf.Analyzer,
-       // shadow.Analyzer, // experimental; not enabled by default
-       shift.Analyzer,
-       stdmethods.Analyzer,
-       structtag.Analyzer,
-       tests.Analyzer,
-       unreachable.Analyzer,
-       unsafeptr.Analyzer,
-       unusedresult.Analyzer,
-}
-
-func main() {
-       log.SetFlags(0)
-       log.SetPrefix("vet: ")
-
-       if err := analysis.Validate(analyzers); err != nil {
-               log.Fatal(err)
-       }
-
-       analyzers = analysisflags.Parse(analyzers, true)
-
-       args := flag.Args()
-       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)
-}
index 4223ab80fc1997842a0297103713046ba542737b..f925849ab508972b026d7c4f11e3ac660dc45136 100644 (file)
@@ -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
@@ -72,11 +68,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 +283,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 +306,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:
index d6c13f2685c8f81bfdb70d4a26e9aaf6b522659f..729ac3b41768dab8d13a68b634df46dd1f6543d9 100644 (file)
@@ -11,41 +11,41 @@ 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) 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 {
        // 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
 
-               // 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})
                }
 
                a.Flags.VisitAll(func(f *flag.Flag) {
@@ -56,12 +56,6 @@ 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()
-                       }
-                       analysisFlags = append(analysisFlags, analysisFlag{name, isBool, f.Usage})
                })
        }
 
@@ -69,20 +63,33 @@ 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 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.
        if *printflags {
-               data, err := json.MarshalIndent(analysisFlags, "", "\t")
-               if err != nil {
-                       log.Fatal(err)
-               }
-               os.Stdout.Write(data)
+               printFlags()
                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 {
@@ -115,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.
 //
@@ -195,7 +229,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 +255,89 @@ 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",
+}
+
+// ---- 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/internal/analysisflags/help.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/help.go
new file mode 100644 (file)
index 0000000..043b978
--- /dev/null
@@ -0,0 +1,89 @@
+package analysisflags
+
+import (
+       "flag"
+       "fmt"
+       "log"
+       "sort"
+       "strings"
+
+       "golang.org/x/tools/go/analysis"
+)
+
+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.
+`
+
+// 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) {
+       // No args: show summary of all analyzers.
+       if len(args) == 0 {
+               fmt.Println(strings.Replace(help, "PROGNAME", progname, -1))
+               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/analysisflags/patch.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/internal/analysisflags/patch.go
new file mode 100644 (file)
index 0000000..8f97410
--- /dev/null
@@ -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 }
index 11dfbf6bc8e30838d014e8346154de6341c10a84..dce1ef7bd5e6d0626cf441353db71329fc7712d8 100644 (file)
@@ -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
@@ -489,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)
                }
        }
 
@@ -513,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)
index 0e6f2695f3dc72151c415811acc6f95ab42c6195..833c9d7aae1c4eed309107871846ac43db5a7325 100644 (file)
@@ -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)
index 7eb24a4a91e61f4a0302507c36a7b713a892d549..993f1ce3c4b4ace9bd2d1da945bf8f5f8cda6593 100644 (file)
@@ -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
+}
index b7cfe8a95d365a287c8b04cafc8e62e887e96d40..9cca7781d004429f5c2610b47fc065c71220426e 100644 (file)
@@ -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
index fcf9f553a9f0b8d40159a438c6addc88ac916e19..b5161836a57a23ce79921360e636222c1f08f47f 100644 (file)
@@ -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
        })
 
@@ -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
@@ -173,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
 }
@@ -264,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
index 23f634fd98eb0b46a36ed5813aaffae8dfa8be73..c0265aafeee7ff132b6b37e366a088a97cd884e3 100644 (file)
@@ -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
@@ -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,
@@ -676,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},
@@ -685,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},
@@ -805,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.
index 701d08bea2bb12dbe73cd068702f1c493e4dd454..e8810464cd420255836ae2a26141806d0313336d 100644 (file)
@@ -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,
@@ -97,12 +100,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)
index eead289e4ccbadecdf3999d2da47da1028c7f676..83495112243a441efbe64533650603d251450b77 100644 (file)
@@ -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 := typeString(sign)
                actual = strings.TrimPrefix(actual, "func")
                actual = id.Name + actual
 
@@ -148,6 +139,10 @@ func canonicalMethod(pass *analysis.Pass, id *ast.Ident, t *ast.FuncType) {
        }
 }
 
+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 {
@@ -159,45 +154,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 +182,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 typeString(actual) == expect
 }
index 78133fe6f30a997470bda5172f1c54f3cbcb4644..2b67c376bab8b9703d1b62d9a75f1601c8ec6d34 100644 (file)
@@ -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/passes/unmarshal/unmarshal.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go
new file mode 100644 (file)
index 0000000..6cf4358
--- /dev/null
@@ -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
+}
index 116d622b362af1dafa89a14b0477ac4a494ee68f..308bfc69cb44d538733a91d35efcdbb2f24d08ae 100644 (file)
@@ -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/main.go b/src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/main.go
new file mode 100644 (file)
index 0000000..844e8f3
--- /dev/null
@@ -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,
+       )
+}
similarity index 71%
rename from src/cmd/vendor/golang.org/x/tools/go/analysis/internal/unitchecker/unitchecker.go
rename to src/cmd/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go
index b67c943b4e261ef394f12396da6baa266e002bb1..76dabc28b9043ba14d6c12538712ee286fdf85c4 100644 (file)
@@ -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:
 //
@@ -25,11 +25,11 @@ 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"
        "encoding/json"
+       "flag"
        "fmt"
        "go/ast"
        "go/build"
@@ -41,12 +41,14 @@ import (
        "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"
 )
 
@@ -54,11 +56,12 @@ 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
        GoFiles                   []string
-       OtherFiles                []string // TODO(adonovan): make go vet populate this (github.com/golang/go/issues/27665)
+       NonGoFiles                []string
        ImportMap                 map[string]string
        PackageFile               map[string]string
        Standard                  map[string]bool
@@ -68,25 +71,93 @@ type Config struct {
        SucceedOnTypecheckFailure bool
 }
 
-// Main reads the *.cfg file, runs the analysis,
+// 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(`invoking "go tool vet" directly is unsupported; use "go vet"`)
+       }
+       Run(args[0], analyzers)
+}
+
+// Run reads the *.cfg file, runs the analysis,
 // and calls os.Exit with an appropriate error code.
-func Main(configFile string, analyzers []*analysis.Analyzer) {
+// 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)
+       results, 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)
+       // 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)
@@ -110,7 +181,12 @@ func readConfig(filename string) (*Config, error) {
        return cfg, nil
 }
 
-func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]analysis.Diagnostic, error) {
+var importerForCompiler = func(_ *token.FileSet, compiler string, lookup importer.Lookup) types.Importer {
+       // broken legacy implementation (https://golang.org/issue/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
        for _, name := range cfg.GoFiles {
@@ -125,7 +201,7 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]an
                }
                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 {
@@ -250,7 +326,7 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]an
                                Analyzer:          a,
                                Fset:              fset,
                                Files:             files,
-                               OtherFiles:        cfg.OtherFiles,
+                               OtherFiles:        cfg.NonGoFiles,
                                Pkg:               pkg,
                                TypesInfo:         info,
                                ResultOf:          inputs,
@@ -283,14 +359,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()
@@ -298,7 +373,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)
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 (file)
index 0000000..683b7e9
--- /dev/null
@@ -0,0 +1,9 @@
+// +build go1.12
+
+package unitchecker
+
+import "go/importer"
+
+func init() {
+       importerForCompiler = importer.ForCompiler
+}
index 04ad6795d921eb9613c383b37e3784e7d04eb44c..3e4b195368b35dd5820b7fdeca5894a6620c7c12 100644 (file)
@@ -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 (executable)
index 0000000..8cf5ac1
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# update-xtools.sh: idempotently update the vendored
+# copy of the x/tools repository used by cmd/vet.
+
+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)
+
+# 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
+    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 cmd/vet ||
+  { echo "Failed to build cmd/vet"; exit 1; } >&2
index 23ff3225af9a7b74312090ecabed127e7da44460..ef7255acd194038d3c0341bccabd3257868827f8 100644 (file)
                        "revision": "fc6590592b44fedfff586c5d94647c090fbd6bac",
                        "revisionTime": "2018-05-24T22:59:00Z"
                },
+               {
+                       "path": "github.com/x/sys/unix",
+                       "revision": ""
+               },
                {
                        "path": "golang.org/x/arch/arm/armasm",
                        "revision": "5099b4b992f2813e39cfe2623c6f638718bd0fc6",
                },
                {
                        "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",
                        "revisionTime": "2018-05-24T11:38:20Z"
                },
                {
-                       "checksumSHA1": "VQyr/RTSmHpXD2wh988ZnWCVO6w=",
+                       "checksumSHA1": "VmY64lAjYXrfzg4lPNIXh9HqIg0=",
                        "path": "golang.org/x/sys/unix",
-                       "revision": "7138fd3d9dc8335c567ca206f4333fb75eb05d56",
-                       "revisionTime": "2018-06-27T13:57:12Z"
+                       "revision": "1775db3f06b568179d273425900dd09125831dd5",
+                       "revisionTime": "2019-01-06T17:38:07Z"
                },
                {
-                       "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=",
                        "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=",
                        "revisionTime": "2018-11-05T19:48:08Z"
                }
        ],
-       "rootPath": "cmd"
+       "rootPath": "/cmd"
 }
index 7e4a68101f045786501776336325b17d6b01a39f..2500c690bfd6ebf2ab9c20906f0c1ac8ae0aa292 100644 (file)
@@ -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,36 @@ 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 {
+               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 +270,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 +284,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 {
index 3dbb340cbd6d1910cee4be7b9f1a10ccb13c4855..f791a265701751e715ed97a2262b7819d8a06d58 100644 (file)
@@ -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
index 761f4ced4e46d5e9146a882a4568170a8031b548..c73516392f6bf1f67f1de3b75242901dcf6f7a89 100644 (file)
@@ -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
@@ -57,14 +51,18 @@ 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
 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
index 94f782aa2fd2a70179fdbb9eb92f00ac7e30c7ec..020241f615a50f41ddf1eef454dc4b9d7cfedc57 100644 (file)
@@ -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
index 5dc2766e10d3011935eb79487f7790d85629dd61..81a1f1831ea8f3f37a592da3e8a8a57ef3b0c52d 100644 (file)
@@ -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
index 72528c5145a3799daba6f86547ed649263a596fa..5a0af626f6aea4fca7984db7f52dd67a54ae84b1 100644 (file)
@@ -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
index bd53e9acdf853c4f7e72f356946bda5edaa1fca6..1451a86e28c62992b084141ff9745ba0a7f8f847 100644 (file)
@@ -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)
index 68bba518ac6739ce997e04a64157cdc0bbc7d7a4..c4b03e40936fe82b531c52663906f0627b6fd3a2 100644 (file)
@@ -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
index 5625e3c55d0b46e7c7519e4f2338f4d709c830d1..9661f57b23d9c20ce548f40ce6070d2ebb2aa059 100644 (file)
@@ -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
 
index cc0fcbab7f2fe9202fb6f716563931f383acf1b9..dde0092570234f68025c6476cfe5600f77f542aa 100644 (file)
@@ -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
index 39f8c0da31adbed881791e6004077f63e5dac739..730a753afc2e0d4a97eb51b4d4f0a840cd995109 100644 (file)
@@ -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
index 4b8424203821250f0a5125377f6dcc83c48a75d6..55cf44a5198bc6d74ad1322e02c51227d9a41f41 100644 (file)
@@ -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
index d066e5b76f8f021902c6903bdfb62dc8e3fe619f..45496ed3f6e0b2b9d75be9369912b7ee06e08965 100644 (file)
@@ -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
@@ -15,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)
index d910022ef655eadb2449762365b988a13ec87ce8..87b3b24d7f70d3c9fea16c13e970753c2f6c5c0d 100644 (file)
@@ -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
index 676e6baf71b79aa56436f7975c6d54aa5361e665..daa23e73a15fddc87e537bab47880299b4ee6c18 100644 (file)
@@ -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
diff --git a/src/cmd/vet/asmdecl.go b/src/cmd/vet/asmdecl.go
deleted file mode 100644 (file)
index ccf6269..0000000
+++ /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 (file)
index 223e80d..0000000
+++ /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 "<expr> = <expr>".
-// 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 (file)
index b425669..0000000
+++ /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 (file)
index 1cd477f..0000000
+++ /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 (file)
index ba3a361..0000000
+++ /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 (file)
index 76364ff..0000000
+++ /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 (file)
index 861e040..0000000
+++ /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 (file)
index ed88ca8..0000000
+++ /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 (file)
index 0facec5..0000000
+++ /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 (file)
index b1077ae..0000000
+++ /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
-       }
-}
index d9af0a88759a332344948c45ca46ddd83c99eef2..279d081be39c93ffc6c361f762c8eafebbf05b22 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2010 The Go Authors. All rights reserved.
+// 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.
 
@@ -9,211 +9,63 @@ 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":
+Vet is normally invoked through the go command.
+This command vets the package in the current directory:
 
        go vet
-vets the package in the current directory.
 
-       go vet package/path/name
-vets the package whose path is provided.
+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 2 for erroneous invocation of the tool, 1 if a
+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
+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.
+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/httpresponse.go b/src/cmd/vet/httpresponse.go
deleted file mode 100644 (file)
index 791d11d..0000000
+++ /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 (file)
index da1cc7e..0000000
+++ /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 (file)
index e4d5bfe..0000000
+++ /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 (file)
index 2400fed..0000000
+++ /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 (file)
index fdd65d3..0000000
+++ /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 (file)
index ee03420..0000000
+++ /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 ""
-}
index cf91e4d59679fe5b4eb20f4d3b15470be4f57dc0..4ec174b3cd1e06de48aeb36e40cf4aebfb6e178c 100644 (file)
-// 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.
-
 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
-)
-
-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{})
+       "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"
 )
 
-// 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
-}
-
 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
-       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
-       doPackage(vcfg.GoFiles, 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,
+               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 (file)
index 5783278..0000000
+++ /dev/null
@@ -1,179 +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 (
-       "fmt"
-       "go/ast"
-       "go/printer"
-       "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, n.Type)
-               }
-       case *ast.InterfaceType:
-               for _, field := range n.Methods.List {
-                       for _, id := range field.Names {
-                               canonicalMethod(f, id, field.Type.(*ast.FuncType))
-                       }
-               }
-       }
-}
-
-func canonicalMethod(f *File, id *ast.Ident, t *ast.FuncType) {
-       // 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)
-       }
-
-       // 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) + ")"
-               }
-
-               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 = 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, ", ")
-}
-
-// 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 {
-       for i, x := range expect {
-               if !strings.HasPrefix(x, prefix) {
-                       continue
-               }
-               if i >= len(actual) {
-                       return false
-               }
-               if !f.matchParamType(x, actual[i]) {
-                       return false
-               }
-       }
-       if prefix == "" && len(actual) > len(expect) {
-               return false
-       }
-       return true
-}
-
-// Does this one type match?
-func (f *File) matchParamType(expect string, actual ast.Expr) 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.
-       f.b.Reset()
-       printer.Fprint(&f.b, f.fset, actual)
-       return f.b.String() == expect
-}
diff --git a/src/cmd/vet/nilfunc.go b/src/cmd/vet/nilfunc.go
deleted file mode 100644 (file)
index bfe05e3..0000000
+++ /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 (file)
index 3a2eea0..0000000
+++ /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 (file)
index 53a4136..0000000
+++ /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 (file)
index 47a4883..0000000
+++ /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 (file)
index 1e48d32..0000000
+++ /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 (file)
index 32366ea..0000000
+++ /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 (file)
index 2237ddc..0000000
+++ /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 (file)
index cac6ed2..0000000
+++ /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 (file)
index c33c02a..0000000
+++ /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 (file)
index 83e5386..0000000
+++ /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 (file)
index 044b050..0000000
+++ /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 (file)
index c6176e9..0000000
+++ /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 (file)
index 4e85ab3..0000000
+++ /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 (file)
index d5ff546..0000000
+++ /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 (file)
index 550d92a..0000000
+++ /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 (file)
index 69730b4..0000000
+++ /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 (file)
index 80c44d2..0000000
+++ /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 (file)
index fbe10cf..0000000
+++ /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 (file)
index d0df7cf..0000000
+++ /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 (file)
index 4f27116..0000000
+++ /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/cgo4.go b/src/cmd/vet/testdata/cgo/cgo4.go
deleted file mode 100644 (file)
index 67b5450..0000000
+++ /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 (file)
index 3fe3eac..0000000
+++ /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 (file)
index e9902a2..0000000
+++ /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 (file)
index 280747a..0000000
+++ /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 (file)
index f127381..0000000
+++ /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 (file)
index d1a7ade..0000000
+++ /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 (file)
index 0efe0f8..0000000
+++ /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 (file)
index b75d55e..0000000
+++ /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 (file)
index 7302a64..0000000
+++ /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 (file)
index 445502b..0000000
+++ /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 (file)
index b7549c0..0000000
+++ /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 (file)
index 2ce7bc8..0000000
+++ /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 (file)
index cd3b4cb..0000000
+++ /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 (file)
index d10fde2..0000000
+++ /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 (file)
index 73cbaf8..0000000
+++ /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 (file)
index 0000000..72ff452
--- /dev/null
@@ -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 (file)
index 0000000..c3ba986
--- /dev/null
@@ -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"
similarity index 97%
rename from src/cmd/vet/testdata/assign.go
rename to src/cmd/vet/testdata/src/assign/assign.go
index 6140ad4db8cc0cd7e257556229dc74f69e27baee..112614e562c683bd6320ce223b8ffa36180d6dbb 100644 (file)
@@ -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 (file)
index 0000000..650d56b
--- /dev/null
@@ -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 (file)
index 0000000..20e01aa
--- /dev/null
@@ -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/src/cgo/cgo.go b/src/cmd/vet/testdata/src/cgo/cgo.go
new file mode 100644 (file)
index 0000000..292d7fd
--- /dev/null
@@ -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 (file)
index 0000000..63a2837
--- /dev/null
@@ -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 (file)
index 0000000..8079cf3
--- /dev/null
@@ -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 (file)
index 0000000..af83cdf
--- /dev/null
@@ -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 (file)
index 0000000..6141f6e
--- /dev/null
@@ -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 (file)
index 0000000..1bbb22d
--- /dev/null
@@ -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"
similarity index 57%
rename from src/cmd/vet/testdata/method.go
rename to src/cmd/vet/testdata/src/method/method.go
index 52b500df272803645f904ae22e9323117bdc83e6..51c3f65fcc728e9531ae0f8b5d62f6976bb607fa 100644 (file)
@@ -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"
-}
-
-type MethodTestInterface interface {
-       ReadByte() byte // ERROR "should have signature ReadByte"
+func (t *MethodTest) Scan(x fmt.ScanState, c byte) { // ERROR "should have signature Scan\(fmt\.ScanState, rune\) 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 (file)
index 0000000..c34d60e
--- /dev/null
@@ -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")
+       }
+}
similarity index 94%
rename from src/cmd/vet/testdata/print.go
rename to src/cmd/vet/testdata/src/print/print.go
index 994902d01dad7f9cbba8542f457ddc2025c8ab64..6bacd0fd747c8659875ceabb86668ff4841f0f3d 100644 (file)
@@ -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", &notPercentDV) // ERROR "Printf format %d has arg &notPercentDV of wrong type \*testdata.notPercentDStruct"
+       Printf("%d", notPercentDV)  // ERROR "Printf format %d has arg notPercentDV of wrong type print.notPercentDStruct"
+       Printf("%d", &notPercentDV) // ERROR "Printf format %d has arg &notPercentDV of wrong type \*print.notPercentDStruct"
        Printf("%p", &notPercentDV) // 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 (file)
index 0000000..4e21564
--- /dev/null
@@ -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 (file)
index 0000000..6b7a5ac
--- /dev/null
@@ -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 (file)
index 0000000..cbcc453
--- /dev/null
@@ -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"
+}
similarity index 85%
rename from src/cmd/vet/testdata/tagtest/file1.go
rename to src/cmd/vet/testdata/src/tagtest/file1.go
index 22a1509acc0bc6d92cf0d1757f6e3fc0b636d416..47fe3c80afe347edec1b8ed09c596997538b0e3a 100644 (file)
@@ -6,5 +6,8 @@
 
 package main
 
+import "fmt"
+
 func main() {
+       fmt.Printf("%s", 0)
 }
similarity index 80%
rename from src/cmd/vet/testdata/tagtest/file2.go
rename to src/cmd/vet/testdata/src/tagtest/file2.go
index ba7dd91bbd89c8e2936765f07d05bba3b8e7adef..1f45efcbf2f43eeb99bb15955eb14c81f5953312 100644 (file)
@@ -6,5 +6,8 @@
 
 package main
 
-func ignore() {
+import "fmt"
+
+func main() {
+       fmt.Printf("%s", 0)
 }
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 (file)
index 0000000..09bb98d
--- /dev/null
@@ -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 (file)
index 0000000..b387bbb
--- /dev/null
@@ -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 (file)
index 0000000..e9b866e
--- /dev/null
@@ -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 (file)
index 0000000..1e83e90
--- /dev/null
@@ -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 (file)
index 755d52b..0000000
+++ /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 <b b="0"><b>0</b></b> 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 (file)
index f5bbc39..0000000
+++ /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 (file)
index f541b4a..0000000
+++ /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 (file)
index ce85200..0000000
+++ /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 (file)
index d50f659..0000000
+++ /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 (file)
index 5b15708..0000000
+++ /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 (file)
index 8cb0e8e..0000000
+++ /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 (file)
index 3e4c25b..0000000
+++ /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 (file)
index cb2cc81..0000000
+++ /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 (file)
index 02fcd84..0000000
+++ /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)
-                       }
-               }
-       }
-}
index 6b2125924d7a8ae34074f0379fa9d88bf4e03adf..d106c5c29ce7c1c1405fcaceb66179746c44cddc 100644 (file)
@@ -15,7 +15,6 @@ import (
        "os/exec"
        "path/filepath"
        "regexp"
-       "runtime"
        "strconv"
        "strings"
        "sync"
@@ -60,111 +59,89 @@ func Build(t *testing.T) {
        built = true
 }
 
-func Vet(t *testing.T, files []string) {
-       flags := []string{
-               "-printfuncs=Warn:1,Warnf:1",
-               "-all",
-               "-shadow",
-       }
-       cmd := exec.Command(binary, append(flags, files...)...)
-       errchk(cmd, files, t)
-}
-
-// 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
-//     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"))
+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)
        }
-       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)
+       cmd.Env = append(os.Environ(), "GOPATH="+testdata)
+       return cmd
 }
 
-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) {
+func TestVet(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"))
+
+                       // Skip cgo test on platforms without cgo.
+                       if pkg == "cgo" && !cgoEnabled(t) {
+                               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 {
+                               t.Fatal(err)
+                       }
+                       asms, err := filepath.Glob(filepath.Join(dir, "*.s"))
                        if err != nil {
                                t.Fatal(err)
                        }
-                       Vet(t, gos)
+                       var files []string
+                       files = append(files, gos...)
+                       files = append(files, asms...)
+
+                       errchk(cmd, files, 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 {
@@ -185,44 +162,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.
index 685be70a3e38f7d4dba7b3a3a4d9808346d799a3..49921398e2ba9001a0bbb1ad83a78fe0dd27cc5e 100644 (file)
@@ -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
index 1ed0da8e6a653baff97b179f47e416906671ae3f..2e09da8613aa3ed2822bedc6cabbdf8b081161be 100644 (file)
@@ -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)
index 40bd0d335d3b204db9c0044f7d8dffe87ac7cdd6..53308ae92e33fdefbc77990618a17da84b249431 100644 (file)
@@ -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
index bae3f03e5d716976da6d2981a4786b131bc16b65..db139dacb0a564f6da7f76ae3716e352a336c909 100644 (file)
@@ -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
 
index 4fc2b5e5213af7000b5bddfbf868c6128e334432..c84657c5e36777fcdf435b56ecf34d958f1b686f 100644 (file)
@@ -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)
index 2219b858b3b9b11649593d10fe671bb3bf06ec6d..c5b55a04c3bc732b5a94979d203415d56e65deb2 100644 (file)
@@ -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<T-T1)           // X3 = X3-T1    T1   T2   T3   T4  (T1 = X3)
        p256SubInternal(T1,T0,T1,T0,T1H,T1L)
@@ -1827,7 +2307,7 @@ TEXT ·p256PointDoubleAsm(SB), NOSPLIT, $0
        VL   80(P1ptr), X0       // Z1L
        VLR  X0, Y0
        VLR  X1, Y1
-       CALL p256MulInternal<>(SB)
+       CALL p256SqrInternal<>(SB)
 
        // SUB(X<X1-T)            // T2 = X1-T1
        VL 0(P1ptr), X1H
@@ -1859,7 +2339,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)
 
        // 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<T)              // Y3 = half*Y3
        p256HalfInternal(Y3H,Y3L, T1,T0)
@@ -1883,7 +2363,7 @@ TEXT ·p256PointDoubleAsm(SB), NOSPLIT, $0
        VLR  T2H, X1
        VLR  T2L, Y0
        VLR  T2H, Y1
-       CALL p256MulInternal<>(SB)
+       CALL p256SqrInternal<>(SB)
 
        // ADD(T1<T3+T3)          // T1 = 2*T3
        p256AddInternal(T1H,T1L,T3H,T3L,T3H,T3L)
@@ -2064,7 +2544,7 @@ TEXT ·p256PointAddAsm(SB), NOSPLIT, $0
        VL   80(P1ptr), X0       // Z1L
        VLR  X0, Y0
        VLR  X1, Y1
-       CALL p256MulInternal<>(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<T-T2)           // X3 = X3-T2
        p256SubInternal(T1,T0,T1,T0,T2H,T2L)
index a36786e466d9f500d64f16be401a18408ce12556..ac53a85a5cb03e32b35d7523e2226536029a2503 100644 (file)
@@ -8,7 +8,14 @@ package elliptic
 
 import (
        "crypto/subtle"
+       "internal/cpu"
        "math/big"
+       "unsafe"
+)
+
+const (
+       offsetS390xHasVX  = unsafe.Offsetof(cpu.S390X.HasVX)
+       offsetS390xHasVE1 = unsafe.Offsetof(cpu.S390X.HasVE1)
 )
 
 type p256CurveFast struct {
@@ -26,14 +33,26 @@ var (
        p256PreFast *[37][64]p256Point
 )
 
-// hasVectorFacility reports whether the machine has the z/Architecture
-// vector facility installed and enabled.
-func hasVectorFacility() bool
+//go:noescape
+func p256MulInternalTrampolineSetup()
+
+//go:noescape
+func p256SqrInternalTrampolineSetup()
+
+//go:noescape
+func p256MulInternalVX()
+
+//go:noescape
+func p256MulInternalVMSL()
 
-var hasVX = hasVectorFacility()
+//go:noescape
+func p256SqrInternalVX()
+
+//go:noescape
+func p256SqrInternalVMSL()
 
 func initP256Arch() {
-       if hasVX {
+       if cpu.S390X.HasVX {
                p256 = p256CurveFast{p256Params}
                initTable()
                return
@@ -51,12 +70,15 @@ func (curve p256CurveFast) Params() *CurveParams {
 // Functions implemented in p256_asm_s390x.s
 // Montgomery multiplication modulo P256
 //
+//go:noescape
+func p256SqrAsm(res, in1 []byte)
+
 //go:noescape
 func p256MulAsm(res, in1, in2 []byte)
 
 // Montgomery square modulo P256
 func p256Sqr(res, in []byte) {
-       p256MulAsm(res, in, in)
+       p256SqrAsm(res, in)
 }
 
 // Montgomery multiplication by 1
index 1f70abbb68d0ab849c2f13d5c6890fdf666b3d77..d9f0bd24ea83893ec4e6eb5efb5c2c2d0703bee7 100644 (file)
@@ -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)
index 3e66db6d0d7f169aa27ad7ef1a306e00211770bf..011578404751aca16699dfe73949247798564723 100644 (file)
@@ -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
 }
 
index 64a62e4730587eeeb4c7307ead150aa9782c091d..34c7f541c5740ca95492bc87fabc05abdb71f462 100644 (file)
@@ -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())
index a9546bb0a50e53402f277e30ff27c9310be30ae1..dee290c65446d7fe299962e2ccfd7582bd504e05 100644 (file)
@@ -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
 }
 
index 6ce39de6866895234021f0b8904241e265e43e4a..b05845ff59cbaad275fe51439fea8590d7a4bc47 100644 (file)
@@ -12,6 +12,7 @@ import (
        "crypto/rand"
        "encoding"
        "fmt"
+       "hash"
        "io"
        "testing"
 )
@@ -159,6 +160,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)
 
index 6ac585f79507f647ccfe51cad7a031ac53027c94..8e4915a7d880dff4d4c29216c7a65a2c2aaff256 100644 (file)
@@ -101,7 +101,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
 }
 
index a188a64ad18792df250e8ceb4c60b4f6b376c089..03bd2a5627668fc1f288e72d9cbab54b90750047 100644 (file)
@@ -230,6 +230,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)
 
index 355d7bbe0731ff5f1a088a01a511652dec4e8876..394e001eee70f7c548028ef615f5bd6d7640efcf 100644 (file)
@@ -192,7 +192,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
 }
 
index 93c4591bd87d53552327386d75af454eb1326f72..2d172c066a9cd239a74069335d6ac9fed228ca71 100644 (file)
@@ -12,6 +12,7 @@ import (
        "crypto/rand"
        "encoding"
        "encoding/hex"
+       "fmt"
        "hash"
        "io"
        "testing"
@@ -835,6 +836,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)
 
index 9f5fee87e3fc4c370776bd8bcb23e8426e4e2a29..7c3cf05c462c4c474231a7c7b5869d43dba33c42 100644 (file)
@@ -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 }
 
index 859387ee1494936bd62de59f8ed006decf8b0634..6fe97185050d61213a0e8d9869fe9a99a16e075d 100644 (file)
@@ -134,16 +134,28 @@ 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
        }
 
-       switch priv := priv.Public().(type) {
+       switch pub := priv.Public().(type) {
        case *ecdsa.PublicKey:
-               switch priv.Curve {
+               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 pub.Curve {
                case elliptic.P256():
                        return []SignatureScheme{ECDSAWithP256AndSHA256}
                case elliptic.P384():
@@ -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,
@@ -164,3 +187,35 @@ func signatureSchemesForCertificate(cert *Certificate) []SignatureScheme {
                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)
+}
index f6d922c673f5e99b9bfc3cee8d71723544912116..cd74495aa6ae4b55d0407158abdbc66c498e725e 100644 (file)
@@ -106,8 +106,11 @@ func isBoringCertificate(c *x509.Certificate) bool {
 // supportedSignatureAlgorithms returns the supported signature algorithms.
 // It knows that the FIPS-allowed ones are all at the beginning of
 // defaultSupportedSignatureAlgorithms.
-func supportedSignatureAlgorithms() []SignatureScheme {
+func supportedSignatureAlgorithms(version uint16) []SignatureScheme {
        all := defaultSupportedSignatureAlgorithms
+       if version < VersionTLS13 {
+               all = defaultSupportedSignatureAlgorithmsTLS12
+       }
        if !needFIPS() {
                return all
        }
index 59df726d77ad2215f2dee15947990787d208333d..ab497cdb5d6fe9a08895862b260a5d5b53bdbd5b 100644 (file)
@@ -15,8 +15,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
index 8a9053a85754a57d614bff44cdfadf63e56fb6ac..515d9124c16239ad1d7a934664a64498a205160c 100644 (file)
@@ -17,6 +17,7 @@ import (
        "io"
        "math/big"
        "net"
+       "os"
        "strings"
        "sync"
        "time"
@@ -161,7 +162,7 @@ const (
 )
 
 // defaultSupportedSignatureAlgorithms 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 defaultSupportedSignatureAlgorithms = []SignatureScheme{
@@ -178,6 +179,9 @@ var defaultSupportedSignatureAlgorithms = []SignatureScheme{
        ECDSAWithSHA1,
 }
 
+// RSA-PSS is disabled in TLS 1.2 for Go 1.12. See Issue 30055.
+var defaultSupportedSignatureAlgorithmsTLS12 = defaultSupportedSignatureAlgorithms[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.
@@ -200,7 +204,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)
@@ -241,7 +245,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 {
@@ -292,7 +296,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
@@ -302,11 +306,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
 )
 
@@ -314,7 +320,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
@@ -520,8 +526,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
@@ -777,11 +786,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 {
@@ -881,14 +932,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
                }
@@ -927,11 +978,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.
index 76cef7174b9c9f1a755775c3c5f16f7bfcf3e0bf..57f61050e5ff2c6319e54aa1a490950d5329d41b 100644 (file)
@@ -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
index 1f9268206306c48d59890195e7eb8b8b682243fd..44acdbaf2dcfc94c76599dab604ce0e7471e6db1 100644 (file)
@@ -114,7 +114,13 @@ NextCipherSuite:
        }
 
        if hello.vers >= VersionTLS12 {
-               hello.supportedSignatureAlgorithms = supportedSignatureAlgorithms()
+               // The non-BoringCrypto behavior here is to use the full set of
+               // signature algorithms, even if TLS 1.3 is not being negotiated. It's
+               // debatable if this is correct or not, because on one hand it allows
+               // RSA-PSS as a client with TLS 1.2, but on the other hand we can't
+               // predict what the server will pick when we do advertise TLS 1.3, so we
+               // might end up with TLS 1.2 + RSA-PSS anyway. Anyway, it will go away soon.
+               hello.supportedSignatureAlgorithms = supportedSignatureAlgorithms(VersionTLS13)
        }
        if testingOnlyForceClientHelloSignatureAlgorithms != nil {
                hello.supportedSignatureAlgorithms = testingOnlyForceClientHelloSignatureAlgorithms
@@ -939,7 +945,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
index d7a4cc57d9603319424159c37317b70420c79581..2314501a3b77d47e84b93dfc8c36ea30b6afac9d 100644 (file)
@@ -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
@@ -135,9 +134,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 +167,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 +209,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
@@ -278,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{
@@ -319,26 +315,29 @@ 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)
        }
 
-       config := test.config
-       if config == nil {
-               config = testConfig
-       }
-       client := Client(clientConn, config)
-
        doneChan := make(chan bool)
+       defer func() {
+               clientConn.Close()
+               <-doneChan
+       }()
        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 +450,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 +471,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()
@@ -501,12 +496,25 @@ 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)
+       }
+}
+
+// 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) {
@@ -522,11 +530,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 +553,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 +563,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 +589,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 +601,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 +650,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 +664,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 +678,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 +691,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 +704,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 +716,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 +751,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 +772,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 +788,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 +798,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 +829,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,18 +847,42 @@ 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,
        }
 
        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 := defaultSupportedSignatureAlgorithmsTLS12
+       defer func() { defaultSupportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }()
+       defaultSupportedSignatureAlgorithmsTLS12 = 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",
-               command:       []string{"openssl", "s_server", "-state"},
+               args:          []string{"-state"},
                sendKeyUpdate: true,
        }
        runClientTestTLS13(t, test)
@@ -1148,8 +1176,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 +1234,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 +1257,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 +1271,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 +1285,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,
index 783047470aab49e5bdc0f9cd82502fdb50265c32..0ffa7d6edfc7d88f5b391457aea492c54fff2f00 100644 (file)
@@ -10,7 +10,6 @@ import (
        "crypto/hmac"
        "crypto/rsa"
        "errors"
-       "fmt"
        "hash"
        "sync/atomic"
        "time"
@@ -453,7 +452,7 @@ func (hs *clientHandshakeStateTLS13) readServerCertificate() error {
        }
 
        // See RFC 8446, Section 4.4.3.
-       if !isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms()) {
+       if !isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms(VersionTLS13)) {
                c.sendAlert(alertIllegalParameter)
                return errors.New("tls: invalid certificate signature algorithm")
        }
@@ -552,7 +551,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
        }
@@ -560,10 +559,10 @@ 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)
+               return unsupportedCertificateError(cert)
        }
        // Pick signature scheme in server preference order, as the client
        // preference order is not configurable.
@@ -573,14 +572,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)
index f86cc4b9b03996255ded4a5a8d47114ccee06277..c0e049b16f0ed272420c81a74bc8bd9cadb2054c 100644 (file)
@@ -6,7 +6,7 @@ package tls
 
 import (
        "fmt"
-       "golang_org/x/crypto/cryptobyte"
+       "internal/x/crypto/cryptobyte"
        "strings"
 )
 
index 1f08f6ac0e22435ce584c13a08486a8981626886..ec8dea43fece01e1165a1206a4f6dd8dd06cba8e 100644 (file)
@@ -151,10 +151,10 @@ func (*clientHelloMsg) Generate(rand *rand.Rand, size int) reflect.Value {
                }
        }
        if rand.Intn(10) > 5 {
-               m.supportedSignatureAlgorithms = supportedSignatureAlgorithms()
+               m.supportedSignatureAlgorithms = supportedSignatureAlgorithms(VersionTLS13)
        }
        if rand.Intn(10) > 5 {
-               m.supportedSignatureAlgorithmsCert = supportedSignatureAlgorithms()
+               m.supportedSignatureAlgorithmsCert = supportedSignatureAlgorithms(VersionTLS13)
        }
        for i := 0; i < rand.Intn(5); i++ {
                m.alpnProtocols = append(m.alpnProtocols, randomString(rand.Intn(20)+1, rand))
@@ -386,10 +386,10 @@ func (*certificateRequestMsgTLS13) Generate(rand *rand.Rand, size int) reflect.V
                m.scts = true
        }
        if rand.Intn(10) > 5 {
-               m.supportedSignatureAlgorithms = supportedSignatureAlgorithms()
+               m.supportedSignatureAlgorithms = supportedSignatureAlgorithms(VersionTLS13)
        }
        if rand.Intn(10) > 5 {
-               m.supportedSignatureAlgorithmsCert = supportedSignatureAlgorithms()
+               m.supportedSignatureAlgorithmsCert = supportedSignatureAlgorithms(VersionTLS13)
        }
        if rand.Intn(10) > 5 {
                m.certificateAuthorities = make([][]byte, 3)
index 909430facb03f5ab3bd0adccd10c57d4a8635a3c..f82d5392c16633d829f4d75b8e3b30fc76feea08 100644 (file)
@@ -463,7 +463,7 @@ func (hs *serverHandshakeState) doFullHandshake() error {
                }
                if c.vers >= VersionTLS12 {
                        certReq.hasSignatureAlgorithm = true
-                       certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms()
+                       certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms(c.vers)
                }
 
                // 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}, supportedSignatureAlgorithms(c.vers), c.vers)
                if err != nil {
                        c.sendAlert(alertIllegalParameter)
                        return err
index 0bd0ae0b2cd0963cbd7ad4e53f78e095157206f9..8fa83fec7569b50376c74043394ad9e0a3e5f6c1 100644 (file)
@@ -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()
        }
 }
@@ -1208,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 := defaultSupportedSignatureAlgorithmsTLS12
+       defer func() { defaultSupportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }()
+       defaultSupportedSignatureAlgorithmsTLS12 = 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}
@@ -1387,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 := defaultSupportedSignatureAlgorithmsTLS12
+       defer func() { defaultSupportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }()
+       defaultSupportedSignatureAlgorithmsTLS12 = 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) {
@@ -1694,3 +1757,58 @@ 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
+
+       // With RSA-PSS disabled and TLS 1.2, this should work.
+
+       testSupportedSignatureAlgorithmsTLS12 := defaultSupportedSignatureAlgorithmsTLS12
+       defer func() { defaultSupportedSignatureAlgorithmsTLS12 = testSupportedSignatureAlgorithmsTLS12 }()
+       defaultSupportedSignatureAlgorithmsTLS12 = savedSupportedSignatureAlgorithmsTLS12
+
+       serverConfig := testConfig.Clone()
+       serverConfig.Certificates = []Certificate{cert}
+       serverConfig.MaxVersion = VersionTLS12
+       testHandshake(t, testConfig, serverConfig)
+}
index 9097670010348ac8f9da2e828393daf627081d1f..99d335e1ee731e5549a2e6c97efc1b3f8f9a8e16 100644 (file)
@@ -10,7 +10,6 @@ import (
        "crypto/hmac"
        "crypto/rsa"
        "errors"
-       "fmt"
        "hash"
        "io"
        "sync/atomic"
@@ -373,10 +372,10 @@ 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)
+               return unsupportedCertificateError(certificate)
        }
        // Pick signature scheme in client preference order, as the server
        // preference order is not configurable.
@@ -387,6 +386,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")
        }
@@ -467,7 +468,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 {
@@ -598,7 +599,7 @@ func (hs *serverHandshakeStateTLS13) sendServerCertificate() error {
                certReq := new(certificateRequestMsgTLS13)
                certReq.ocspStapling = true
                certReq.scts = true
-               certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms()
+               certReq.supportedSignatureAlgorithms = supportedSignatureAlgorithms(VersionTLS13)
                if c.config.ClientCAs != nil {
                        certReq.certificateAuthorities = c.config.ClientCAs.Subjects()
                }
@@ -627,10 +628,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)
@@ -641,7 +639,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
@@ -801,7 +805,7 @@ func (hs *serverHandshakeStateTLS13) readClientCertificate() error {
                }
 
                // See RFC 8446, Section 4.4.3.
-               if !isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms()) {
+               if !isSupportedSignatureAlgorithm(certVerify.signatureAlgorithm, supportedSignatureAlgorithms(VersionTLS13)) {
                        c.sendAlert(alertIllegalParameter)
                        return errors.New("tls: invalid certificate signature algorithm")
                }
index 681ba83c064900ce2c1efdb59dd70c4666f353bc..91f5cde5c33f573f54f1316f33dc2dfd99dbd33e 100644 (file)
@@ -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, supportedSignatureAlgorithms(ka.version), ka.version)
        if err != nil {
                return nil, err
        }
index 310d92e2c5e3a51d46fd5edd18a49e344f6be6b2..2cfc226d7f6e9ee1c9bacddf3afd82199d8a366e 100644 (file)
@@ -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"
 )
index ebfe99c2cf8d383c92c18e499e60eee1206ec715..14ed93ca096abf08fc3d930c6639dc261fc0740a 100644 (file)
 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....|
 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|
index 1029adfff867bfc5b0375e0145fcda7587ce2757..c5b33c01fe54faffa091c3a11fca6a713e1962dd 100644 (file)
 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..............|
 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     | %....<b..(...s|
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 (file)
index 0000000..9d59cb1
--- /dev/null
@@ -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                                             |..|
index 183276206b1888025518f05fb3c5515313c27d7b..48c2868aa666ac5e75a6001c973721d4bd27ea37 100644 (file)
 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 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.....<D..#-j^|
-00000020  33 13 f6 48 9c 84 77 ed  58 2b 3d 20 8e de 12 d0  |3..H..w.X+= ....|
-00000030  66 4d 28 31 a0 d1 f9 82  ae 7d fa 1b 37 86 f7 ac  |fM(1.....}..7...|
-00000040  3d 16 69 30 7c 04 a7 a0  44 3b 37 0f c0 2f 00 00  |=.i0|...D;7../..|
+00000000  16 03 03 00 59 02 00 00  55 03 03 27 d5 26 b1 eb  |....Y...U..'.&..|
+00000010  43 b9 e2 34 e7 3a e2 5e  73 ee b6 d7 4b 0c 88 49  |C..4.:.^s...K..I|
+00000020  04 a8 0e fa f7 a1 79 39  e3 a6 29 20 75 68 40 36  |......y9..) uh@6|
+00000030  ee c2 11 37 2f ae 43 85  f1 d0 eb ee 3d 69 99 e2  |...7/.C.....=i..|
+00000040  3f f1 91 03 5d 00 af c5  f8 0d 4d dc c0 2f 00 00  |?...].....M../..|
 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..............|
 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 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                                             | .|
index da51f260c8ed109f83ad0d45d9dcbe6d471d0405..c35db9e681f363d79d59e3ca697afca9a6188f73 100644 (file)
 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<o....|
+00000060  13 54 2f ac 2b 0f 9d de  27 bc f6 90 e5 ef f3 fd  |.T/.+...'.......|
+00000070  f7 cd 07 f9                                       |....|
index 306d6c85daf90e639237ddcd7ecce4d087043cea..723a9e92d711ef910f63bd8c8c3b9b3a362ddb63 100644 (file)
 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 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../<N..|
+00000030  d3 8f 32 93 2c 7e 66 5d  a2 96 91 91 df ec a5 6f  |..2.,~f].......o|
+00000040  2e 4a 7b b4 1b 77 1e 16  76 66 c3 80 c8 d9 b0 eb  |.J{..w..vf......|
+00000050  17 03 03 00 17 8e d8 13  8e af f8 41 d2 63 19 3b  |...........A.c.;|
+00000060  e0 a8 0a 73 6c dd 76 31  b8 51 17 bc 17 03 03 00  |...sl.v1.Q......|
+00000070  13 1a ee 55 37 e1 4c d3  fc 81 4d 37 84 e6 88 52  |...U7.L...M7...R|
+00000080  65 b5 02 78                                       |e..x|
index f46efbf2872803074fcf3634ae7b6e2fae1e9a7e..77b0342e43beaf8eb5fc39b4877d5c7f4a239c9e 100644 (file)
 00000100  ac 5f bb 29 07 30 ff f6  84 af c4 cf c2 ed 90 99  |._.).0..........|
 00000110  5f 58 cb 3b 74                                    |_X.;t|
 >>> 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  |......%<m.......|
+000001b0  dd a5 9f 7c a8 33 59 20  62 fd 4e d6 98 4b ef af  |...|.3Y b.N..K..|
+000001c0  a6 fa 79 f5 26 90 fe 32  0a 6a e4 40 b9 e5 4d 1a  |..y.&..2.j.@..M.|
+000001d0  1f 02 49 4b 1b 6b 31 53  3d 0e 04 98 17 6e 1e 4a  |..IK.k1S=....n.J|
+000001e0  a3 8d ba 0e 8f 33 f6 23  41 5f f8 aa 1f 57 b1 7b  |.....3.#A_...W.{|
+000001f0  a2 fb c6 7f da b4 56 cf  d3 5e 78 de 3c 15 c5 6c  |......V..^x.<..l|
+00000200  62 ef 46 c4 a2 c0 fd a6  86 91 fb f2 98 57 cc 82  |b.F..........W..|
+00000210  7e e7 88 1b f4 65 eb df  2a 7c 7a 81 95 e8 3c 0d  |~....e..*|z...<.|
+00000220  c1 85 8f 55 49 c0 50 d0  c8 5f e7 32 7c 8c c2 ae  |...UI.P.._.2|...|
+00000230  8c af 3f 4c 4f 23 f6 80  0b c1 c3 1c a2 50 6b 37  |..?LO#.......Pk7|
+00000240  38 53 59 66 9c 5a d3 6d  39 59 99 14 79 d5 17 e3  |8SYf.Z.m9Y..y...|
+00000250  89 73 9e fe ed 43 2c 4a  2f 55 c7 c6 9e cf 82 64  |.s...C,J/U.....d|
+00000260  f5 5e 90 88 67 05 7a 00  b1 88 87 9c b2 51 61 1c  |.^..g.z......Qa.|
+00000270  c2 8a ea 9f b1 07 0c 17  ed b6 6e cc 4d 14 04 91  |..........n.M...|
+00000280  65 00 3b 8f ae d0 14 64  63 92 bd 3b 14 9c 1d 40  |e.;....dc..;...@|
+00000290  67 01 b1 38 26 86 4d e6  f3 20 ed f5 63 17 fc d0  |g..8&.M.. ..c...|
+000002a0  fb ad 5c 17 c8 d5 18 53  8b 89 70 13 2f 83 6a 3f  |..\....S..p./.j?|
+000002b0  4c 57 be 71 43 1d 9f bf  eb 30 7e de 7f 17 78 f1  |LW.qC....0~...x.|
+000002c0  af 69 13 9b f3 4a e6 69  4e 30 dc 99 af be 6f ee  |.i...J.iN0....o.|
+000002d0  1d d5 39 b4 19 29 ed 5c  58 bc 4a 08 7b 34 90 21  |..9..).\X.J.{4.!|
+000002e0  a5 ae 74 4c 17 95 79 8b  9c ee 47 99 32 f9 7d f2  |..tL..y...G.2.}.|
+000002f0  98 93 ec 12 52 7d 36 cc  a7 ca a2 cd fc ce 12 0e  |....R}6.........|
+00000300  32 e7 28 69 ce d4 a7 19  56 9f 90 1a d0 af f1 ee  |2.(i....V.......|
+00000310  77 a4 29 45 cb 2c ff 1a  90 9d 98 73 65 2a 82 77  |w.)E.,.....se*.w|
+00000320  17 03 03 00 99 76 fe 3b  d7 a3 d2 ec a0 28 bd ed  |.....v.;.....(..|
+00000330  64 41 ac 1c d0 60 79 29  26 f9 ad a1 2d 79 b6 f0  |dA...`y)&...-y..|
+00000340  cc de 8f c3 92 4a 1e 02  76 7a b4 86 d3 64 b3 a6  |.....J..vz...d..|
+00000350  2d bb d9 92 1e 12 1d e4  96 64 3c 41 7f 11 28 51  |-........d<A..(Q|
+00000360  69 83 64 45 fb a6 2c 34  97 e8 4b e8 48 92 b0 de  |i.dE..,4..K.H...|
+00000370  a0 37 8e fa d8 88 29 4c  8e e4 7e 1e d2 c1 b8 f2  |.7....)L..~.....|
+00000380  d3 5c 2f 09 9d e2 0b 4d  64 25 52 dc 77 d2 a4 fc  |.\/....Md%R.w...|
+00000390  c3 de 83 3c 04 19 f0 d9  d6 40 bb f1 8b c7 40 b3  |...<.....@....@.|
+000003a0  a9 62 99 4c 64 96 a4 67  a0 6b 7c 09 b3 10 97 e1  |.b.Ld..g.k|.....|
+000003b0  b5 83 9e 7e b4 97 bd b7  f9 70 48 2b aa f6 17 03  |...~.....pH+....|
+000003c0  03 00 35 a6 fc 3f d4 90  93 91 02 e8 0a a6 c1 6f  |..5..?.........o|
+000003d0  fa ee e2 6a 41 8d fd ac  53 ae 83 73 e1 d1 17 de  |...jA...S..s....|
+000003e0  36 5d db c6 06 98 f9 23  db d9 8a 35 c1 9b bc a5  |6].....#...5....|
+000003f0  f8 a8 8f 70 e2 c8 4e 22                           |...p..N"|
 >>> 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                                       |... |
index 8f606cd56ff4958fb01b646fbf8d41f99fe15668..98c3c52170c129a078e0bbc05da5f668e2792260 100644 (file)
 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..)<EN....t|
-00000280  fc d0 bc 99 24 f5 32 af  92 a9 65 4f 06 cb 96 1d  |....$.2...eO....|
-00000290  42 46 2c 8c 77 47 99 62  6b 04 2d df 3c 2e 2a 59  |BF,.wG.bk.-.<.*Y|
-000002a0  1b 58 e5 b9 64 5d e9 34  5a 76 40 2f 50 f3 04 0e  |.X..d].4Zv@/P...|
-000002b0  b3 98 e9 fe 8e dd 3a db  e7 ff fa 10 60 17 ab 18  |......:.....`...|
-000002c0  40 bd 5b 10 48 b8 ae 98  79 f4 6a 8d 71 85 25 f3  |@.[.H...y.j.q.%.|
-000002d0  74 de 84 fe a4 ed 24 67  c2 74 37 61 be 4e 06 74  |t.....$g.t7a.N.t|
-000002e0  86 b8 4d e7 6f 90 d3 20  6c 61 02 62 45 0d 57 70  |..M.o.. la.bE.Wp|
-000002f0  3e f1 37 c9 f6 8c 45 29  f7 56 eb e3 dd 5f 56 47  |>.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.<E.5.2.||
+00000070  87 14 3f ec ae 4d 4a 00  13 40 e6 81 9d 4f 78 14  |..?..MJ..@...Ox.|
+00000080  03 03 00 01 01 17 03 03  00 17 61 33 7b cd 54 2c  |..........a3{.T,|
+00000090  a6 a4 0d 2d b8 cf fe 0f  75 1d af cf f3 81 9a 7c  |...-....u......||
+000000a0  8c 17 03 03 02 6d 64 52  27 5a 66 dd c4 51 24 a3  |.....mdR'Zf..Q$.|
+000000b0  fb 72 7c 68 ed 79 1c 3d  4d ed a0 18 c9 9e c1 0c  |.r|h.y.=M.......|
+000000c0  3c 16 20 18 f5 ce 59 fd  bb fa fd 12 a5 de 4a 58  |<. ...Y.......JX|
+000000d0  d0 59 6c d3 9b 1f e9 f0  61 af aa 93 57 07 8d e0  |.Yl.....a...W...|
+000000e0  be d3 3c 9a 01 1e 70 50  b3 30 f5 e5 e2 0b ef b5  |..<...pP.0......|
+000000f0  a6 dc 6a 3c 17 1c 8a 73  db 44 38 11 59 be 87 54  |..j<...s.D8.Y..T|
+00000100  c5 43 4f da c0 93 16 c9  ef 38 22 b8 32 2b e8 22  |.CO......8".2+."|
+00000110  b7 c5 d3 94 70 5e b6 48  89 c0 2b cd 5b 59 f5 6c  |....p^.H..+.[Y.l|
+00000120  18 0e 65 6e 23 9e a4 b1  12 38 2b b1 5f 9c c9 4f  |..en#....8+._..O|
+00000130  7d 32 d9 50 97 dc 7a 26  e4 ee 00 f9 ed b8 1a 5e  |}2.P..z&.......^|
+00000140  8a fe d3 09 3d 67 68 c6  58 e1 f8 3e b3 e0 55 3c  |....=gh.X..>..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|
index 8b49c0fc82ab58d70d546f97d420fe1e91e0a6db..633397542c1059140ab0446b685550f040eca657 100644 (file)
 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.<V+)n|
-00000290  57 8f ad f0 a6 69 e7 1d  68 3e d6 fd 43 79 64 86  |W....i..h>..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...<dV.......7.|
+000002e0  88 07 0c 82 49 05 06 50  5d 54 15 33 0a b3 38 a6  |....I..P]T.3..8.|
+000002f0  b8 e1 20 37 42 d6 0e c1  80 f4 37 e2 d7 96 9a 86  |.. 7B.....7.....|
+00000300  d9 87 a0 34 3a a2 e1 15  5f 5d 4b 36 5f 1a e5 8c  |...4:..._]K6_...|
+00000310  45 d5 10 10 3d 01 01 49  e1 3f 97 16 8a b6 08 30  |E...=..I.?.....0|
+00000320  e2 80 14 21 a3 d4 90 50  ee f7 37 91 25 c9 8a b3  |...!...P..7.%...|
+00000330  ad 99 15 c1 31 8d 4d 83  4b d0 7a a6 af 9b ed 85  |....1.M.K.z.....|
+00000340  88 be 68 af f0 dc ad 09  ca 9e 56 31 11 ba 0f bd  |..h.......V1....|
+00000350  76 d5 58 c4 db ad bc dd  77 b5 17 03 03 00 99 d6  |v.X.....w.......|
+00000360  c8 48 f5 8f e5 40 94 0e  47 da a8 99 05 3c 80 7f  |.H...@..G....<..|
+00000370  9d 03 73 06 dc d1 c3 21  23 0a 16 ae 0a bd a7 5b  |..s....!#......[|
+00000380  c7 e1 15 44 bd 47 94 ef  c0 fb 1e 1b 47 0d b8 c4  |...D.G......G...|
+00000390  e7 34 de b2 7f 75 f4 9e  02 5d 2a 90 68 4e 78 1f  |.4...u...]*.hNx.|
+000003a0  2a 06 40 4c f4 cd c7 82  f2 16 db b4 a4 d3 18 1c  |*.@L............|
+000003b0  7d ae 8b bc 29 c9 31 d7  ff 32 07 33 c5 0b 79 01  |}...).1..2.3..y.|
+000003c0  c9 91 f7 b1 4b 4a fc f9  f7 17 44 88 93 ad e4 f6  |....KJ....D.....|
+000003d0  21 d5 3d d3 a6 17 1e ac  12 df 41 eb b9 87 b7 bb  |!.=.......A.....|
+000003e0  60 b2 7d 98 ed f1 0c 4f  1c 5f 4b 16 7e 02 ba d6  |`.}....O._K.~...|
+000003f0  2d 9c c7 9b 07 fb 46 6a  17 03 03 00 35 0e 95 be  |-.....Fj....5...|
+00000400  c4 e1 78 98 78 30 95 a9  65 5b e7 e6 a4 13 47 83  |..x.x0..e[....G.|
+00000410  41 9b 87 bc ab 12 0a 85  33 7c 03 ca 73 3d c2 0f  |A.......3|..s=..|
+00000420  75 89 b7 c2 7f b1 1b 57  23 85 0c 74 25 a9 2c 53  |u......W#..t%.,S|
+00000430  12 d5                                             |..|
 >>> 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<mF.$."|
+00000140  65 f5 42 52 c7 56 0c 14  e2 3d e4 5c 68 33 91 5e  |e.BR.V...=.\h3.^|
+00000150  a2 8e b4 fc d9 2b 8d 2f  b9 32 4f 86 b1 6f 58 b2  |.....+./.2O..oX.|
+00000160  ae 55 2d 75 a6 8c 2b f1  2b b6 2b 47 5f 9d b1 71  |.U-u..+.+.+G_..q|
+00000170  64 8d a3 c1 48 29 b5 ef  aa d3 10 05 05 9c 73 10  |d...H)........s.|
+00000180  76 b5 c2 3f 5d 91 3f e8  1e b0 f7 62 74 3f 59 ea  |v..?].?....bt?Y.|
+00000190  db c8 ac d1 f2 e6 9d bd  08 f3 bf 8a 2a 0c 5a 10  |............*.Z.|
+000001a0  c7 4b ee f3 1a 7d fa 69  4b 5e e5 43 79 07 ce c8  |.K...}.iK^.Cy...|
+000001b0  29 96 e3 4e e6 fb c6 2c  cd 2a 78 72 0a 4e c6 44  |)..N...,.*xr.N.D|
+000001c0  53 d7 8b 16 1b 98 4c 39  8f 8f 1a f5 00 0a e5 e8  |S.....L9........|
+000001d0  31 62 d0 fb e5 0e e6 c0  95 6e d6 7c 6e b0 9d 63  |1b.......n.|n..c|
+000001e0  f0 74 38 d5 08 9d d1 b6  62 95 59 bf 6e d2 75 5d  |.t8.....b.Y.n.u]|
+000001f0  7a dd f0 11 3c 6f 55 b7  19 91 fc 5b cd e0 8f c6  |z...<oU....[....|
+00000200  28 e4 38 45 1b e3 4d d6  39 96 b3 4a 00 e7 ea 78  |(.8E..M.9..J...x|
+00000210  f7 a1 a7 00 83 04 ba c3  9f f9 21 07 c4 9a fd ed  |..........!.....|
+00000220  e9 a0 2a 3b 11 92 80 4e  89 17 03 03 00 a4 fd af  |..*;...N........|
+00000230  e1 d4 b1 20 76 34 06 f3  cc 9b 11 3d bc f3 5b e5  |... v4.....=..[.|
+00000240  0f 5f 32 40 6d 16 68 92  12 32 3e cd df e3 9b da  |._2@m.h..2>.....|
+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.|
index a4823303e6ce3bce9881e0b3dd7514287c75c808..74163f0521f5aeee54a35c6013861cec013af5d4 100644 (file)
 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  |<r.......|j..1].|
+000002b0  ab 61 bf 8b 06 a5 54 06  ff a0 70 da 38 e0 58 3d  |.a....T...p.8.X=|
+000002c0  d1 79 2b d8 ea 93 b2 0f  11 02 24 46 7f 27 e1 22  |.y+.......$F.'."|
+000002d0  42 b2 39 86 c7 08 62 5f  d4 18 0b 8b e3 40 80 76  |B.9...b_.....@.v|
+000002e0  f0 ad 86 48 54 52 d8 7a  ff da 3a 3a 93 d5 46 b5  |...HTR.z..::..F.|
+000002f0  67 0d 17 b3 43 c2 e3 73  de 49 cf a4 35 b8 17 db  |g...C..s.I..5...|
+00000300  ea 2c 8d e8 ba 1f a6 b2  a6 91 26 19 a2 b8 95 17  |.,........&.....|
+00000310  03 03 00 a3 d2 c7 70 d0  6d ab a9 63 7e 35 b4 a4  |......p.m..c~5..|
+00000320  7c 32 ea c9 25 83 88 3d  1a e3 a5 5e b9 7e 60 99  ||2..%..=...^.~`.|
+00000330  23 5e 28 13 61 77 ad e7  74 34 4c c8 60 7a a0 07  |#^(.aw..t4L.`z..|
+00000340  c7 e8 6e cd a2 03 33 62  43 dc 24 e8 1e 43 07 c3  |..n...3bC.$..C..|
+00000350  95 89 26 e4 7c 86 43 26  08 08 bc 62 74 1a d7 50  |..&.|.C&...bt..P|
+00000360  8d 43 e6 2b fe 47 8e 35  4c 09 99 7d 02 cc a8 51  |.C.+.G.5L..}...Q|
+00000370  ae 87 79 5e e1 c9 88 f2  1a 40 74 4b 72 3b b0 07  |..y^.....@tKr;..|
+00000380  0b 4a c2 df b4 ad 7a 07  c2 18 fa 53 4d 3d e7 19  |.J....z....SM=..|
+00000390  54 62 eb d1 da 5e 9f 0d  3a a2 a1 72 a3 aa 77 2b  |Tb...^..:..r..w+|
+000003a0  21 59 aa cb a1 f3 4a b6  e5 b2 bb 81 3d 1c c1 9b  |!Y....J.....=...|
+000003b0  ef 1b e2 cd 73 67 18 17  03 03 00 35 29 3e 2e 10  |....sg.....5)>..|
+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.......<H|
-00000100  35 82 60 1f d1 74 44 ef  7d 1e 0a 9b 72 3d 67 e5  |5.`..tD.}...r=g.|
-00000110  42 e7 4d 88 49 8e f3 a4  57 4b d5 12 ff ce 1b 49  |B.M.I...WK.....I|
-00000120  6e 7f e0 52 f8 8d 70 70  1d f9 44 55 5b ec 97 ed  |n..R..pp..DU[...|
-00000130  d5 00 20 38 b7 07 ea 89  2f b8 e9 2f 50 e2 64 38  |.. 8..../../P.d8|
-00000140  cc 7c b8 97 d5 44 15 13  50 05 e4 83 d9 da c5 a4  |.|...D..P.......|
-00000150  d5 fe c1 b6 94 16 73 04  97 78 86 b5 84 b4 75 c8  |......s..x....u.|
-00000160  e2 cc 05 4b 66 c7 7f 26  54 82 49 2c 21 4f e2 3e  |...Kf..&T.I,!O.>|
-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-PSS-Disabled b/src/crypto/tls/testdata/Client-TLSv13-ClientCert-RSA-PSS-Disabled
new file mode 100644 (file)
index 0000000..98d718b
--- /dev/null
@@ -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<g.a=.2...|
+000001c0  a2 cc 96 f6 d1 2d 4f ba  67 ed 02 ae a9 08 13 74  |.....-O.g......t|
+000001d0  33 f6 b5 ad e3 e3 ee 0e  65 f6 89 db 80 d4 f5 23  |3.......e......#|
+000001e0  7b 5d 7a af 5f c6 43 b7  87 f6 90 25 5a f0 f6 76  |{]z._.C....%Z..v|
+000001f0  63 9c 93 d0 f3 94 9c 55  f7 e7 8f 2d cb 83 fb a1  |c......U...-....|
+00000200  b3 db 11 d7 f9 f7 4b 66  50 55 64 31 3f fc 97 df  |......KfPUd1?...|
+00000210  65 f9 e0 eb a2 5e 4d 9d  c7 35 fb 1c 22 79 b1 00  |e....^M..5.."y..|
+00000220  28 e9 54 28 a9 e6 97 e8  33 92 ac 8e f7 c0 82 ac  |(.T(....3.......|
+00000230  99 04 f0 f0 cc e7 4f 04  ad fe dc 9f 25 82 93 12  |......O.....%...|
+00000240  64 4a f6 34 da 41 8a f7  a9 3e fe 24 ae be 40 b7  |dJ.4.A...>.$..@.|
+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..,.)..<Z..os..|
+000002d0  84 bd d7 ad 01 dd 35 b7  1f 64 79 89 ab cb 21 d1  |......5..dy...!.|
+000002e0  20 c5 71 b7 78 fe 93 c0  41 33 d8 aa a2 ed a4 64  | .q.x...A3.....d|
+000002f0  fb 5b c1 6e 0d 1e f7 ca  f6 01 a1 9a fc 82 af 34  |.[.n...........4|
+00000300  e3 45 d8 5a b9 81 e7 e4  c2 26 a7 79 b7 f4 87 9f  |.E.Z.....&.y....|
+00000310  2e 16 ab 96 21 e2 5f 1f  c9 e0 30 3e 97 27 42 15  |....!._...0>.'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|
index 495f9ff124dc3ef8686fb43fe1efc83748e83fca..d2092baa8c63e51aeb54ba9e90610d87bae288a5 100644 (file)
 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<M...:?o3_c.}|
-000001f0  15 1b be 3a 80 a3 f7 e3  52 85 be 3e a8 cf ac ff  |...:....R..>....|
-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...<E.Y|
+00000360  d9 8f f1 59 08 00 2f 6f  67 78 30 b4 cc f9 bb 7c  |...Y../ogx0....||
+00000370  ef ab 74 f5 23 fb 3d d3  95 98 2a 39 31 8b a9 88  |..t.#.=...*91...|
+00000380  12 18 36 c7 aa 7c 5c bf  16 44 b5 69 ff e4 91 96  |..6..|\..D.i....|
+00000390  c8 f9 c0 3b d2 50 18 18  21 d1 6a 36 12 2d 8c 08  |...;.P..!.j6.-..|
+000003a0  40 64 c2 cd b0 ee 73 31  ac f3 18 9f c6 d0 23 b7  |@d....s1......#.|
+000003b0  c1 bf 99 a6 62 d6 b8 6c  0e 96 2a 99 fe aa 58 60  |....b..l..*...X`|
+000003c0  3c c7 60 d6 05 64 6b 68  62 62 38 13 1e fc a9 4f  |<.`..dkhbb8....O|
+000003d0  ad e9 99 4e 7f b0 70 7d  38 79 d9 c7 d5 39 84 a8  |...N..p}8y...9..|
+000003e0  4e 63 66 17 03 03 00 35  fd 5c 31 7d ad c3 bf a2  |Ncf....5.\1}....|
+000003f0  a9 d8 15 8f aa 72 e9 db  f4 4c e7 19 e0 ca 98 65  |.....r...L.....e|
+00000400  8f 0e ac d9 e9 12 c7 37  cf 6e 0e 68 64 6e cd 29  |.......7.n.hdn.)|
+00000410  94 05 63 79 9c c6 c7 17  5a 26 c1 6f 3b           |..cy....Z&.o;|
 >>> 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<n.y'|
-000000a0  d5 21 85 89 6c a3 89 dc  c8 6c ac cb 86 54 83 38  |.!..l....l...T.8|
-000000b0  7a 5b d2 d0 3e f2 62 88  2f 3f 1c b5 d5 60 d4 35  |z[..>.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...<!.f{.<.HI|
-000004f0  df 7d d9 c0 15 4f 3f 18  fc 31 7b 31 08 0b f8 25  |.}...O?..1{1...%|
-00000500  fc 0f fb 85 92 7a 3b 33  dd 09 6b 64 f4 e7 e8 9c  |.....z;3..kd....|
-00000510  f4 8c 73 9d 3b 44 c4 7b  f7 4c 5e 30 25 c2 b9 2e  |..s.;D.{.L^0%...|
-00000520  e2 07 2d 32 4f e0 67 d4  60 18 ea de a1 f9 51 e8  |..-2O.g.`.....Q.|
-00000530  b2 4e c7 c3 c9 51 c6 aa  e2 69 88 9b fe 94 8c 02  |.N...Q...i......|
-00000540  a1 a6 3a a9 b9 e3 32 bc  9f 5d 37 6e dd 99 68 37  |..:...2..]7n..h7|
-00000550  14 67 ae 22 20 28 be 0b  fe 86 65 84 ca f1 96 a3  |.g." (....e.....|
-00000560  d5 89 c2 ea 38 1b 8b 9b  94 e2 c1 88 bb 92 3c b0  |....8.........<.|
-00000570  82 d3 cb ab a0 13 23 58  e5 ab c8 f6 84 93 3c 6b  |......#X......<k|
-00000580  03 b3 85 eb 74 8e 9b 78  22 c0 82 21 72 08 71 fd  |....t..x"..!r.q.|
-00000590  9d 3e 62 e8 d8 50 99 7f  bb 8d 4e 95 7d 3a 64 07  |.>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<z.j.t..p;.p.K|
+00000180  d6 f7 92 8a 46 3d 46 f3  27 8b 74 6d c7 9f f4 64  |....F=F.'.tm...d|
+00000190  9b de b3 f7 1d 81 ab 8c  ca 97 fd e1 99 25 23 9f  |.............%#.|
+000001a0  54 15 fa a9 fb ab ba dd  a0 c1 b0 ad b9 4d b3 d6  |T............M..|
+000001b0  82 a1 85 06 d2 11 ff ce  03 e3 26 67 67 0e 59 17  |..........&gg.Y.|
+000001c0  ec f1 10 51 c6 26 6d ef  de e1 38 41 a0 2c 40 64  |...Q.&m...8A.,@d|
+000001d0  76 cf f7 2c 86 1f 26 4b  97 26 3c 10 cd dc 3f 3d  |v..,..&K.&<...?=|
+000001e0  27 92 50 ee d1 aa da 08  2f 01 c8 1c af 1d 39 02  |'.P...../.....9.|
+000001f0  c1 f1 17 19 64 35 70 81  9b f6 74 ec 50 42 95 ad  |....d5p...t.PB..|
+00000200  a0 72 52 67 cd 95 30 2f  c8 ad 47 11 fe 2e 60 20  |.rRg..0/..G...` |
+00000210  2c ea d5 eb 2c a2 82 6b  18 82 95 1e 17 03 03 00  |,...,..k........|
+00000220  99 7f 6a 21 64 26 3c 38  a6 39 72 58 a3 22 3d 69  |..j!d&<8.9rX."=i|
+00000230  89 1c 3d c6 79 4d 1a 92  44 4f ce 25 09 bb 8a c7  |..=.yM..DO.%....|
+00000240  ef 0c 61 85 1f 1a 0d 21  4b bd 8a 1f f9 ee 92 af  |..a....!K.......|
+00000250  78 7f 6f 3b 1b 26 09 fe  b7 fe c0 49 2a ac bf 13  |x.o;.&.....I*...|
+00000260  c3 73 b1 c4 69 bc 4c e6  b6 b5 cd 0c 69 18 57 b8  |.s..i.L.....i.W.|
+00000270  77 5a 21 8c 99 ad 09 14  26 93 fd 2e 60 03 ba 1e  |wZ!.....&...`...|
+00000280  d1 45 db c6 c9 ce c1 5c  06 67 66 68 b5 e8 43 2f  |.E.....\.gfh..C/|
+00000290  f8 ae 73 16 8a 90 75 f2  0d bc f2 6b d1 9d 99 f4  |..s...u....k....|
+000002a0  82 53 4a 54 4f 68 44 53  24 7f b3 b4 c1 4a 5d a0  |.SJTOhDS$....J].|
+000002b0  93 7a 40 12 c0 68 68 15  86 a9 17 03 03 00 35 8e  |.z@..hh.......5.|
+000002c0  86 f7 bc 9e 4e 4f 7c 69  fc 40 be 1e 71 05 42 99  |....NO|i.@..q.B.|
+000002d0  95 04 c0 a8 91 ce b8 e4  90 b9 4a 3a 3b d4 3c 27  |..........J:;.<'|
+000002e0  7b 37 27 80 17 bf 52 17  59 00 8c 67 f1 28 55 f3  |{7'...R.Y..g.(U.|
+000002f0  75 60 1e 25 17 03 03 00  17 0a 37 72 c3 59 07 9b  |u`.%......7r.Y..|
+00000300  5e 22 ec 33 fa 96 3e d2  c5 b7 87 7b 45 e1 52 24  |^".3..>....{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.-....|
index 55b8cc5263256db9e8023988e34d25c4e567bb09..96c8e8c1ee5455c39076554cea751196f7cc1b51 100644 (file)
 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.<D6.. ....|
+00000000  16 03 03 00 7a 02 00 00  76 03 03 05 cf 30 74 87  |....z...v....0t.|
+00000010  37 6e f2 12 86 19 bd ec  54 21 42 4c 2d 1a 71 4f  |7n......T!BL-.qO|
+00000020  fe de 90 2b a0 c4 73 d1  3e 57 40 20 00 00 00 00  |...+..s.>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......<r..|
+000002f0  c6 09 9b 19 9c 96 e9 41  7f 09 89 17 ff 48 db 94  |.......A.....H..|
+00000300  f6 17 55 ef b0 48 34 a2  b7 14 b9 e6 b6 74 21 e1  |..U..H4......t!.|
+00000310  48 e2 ed 17 27 b9 93 55  1f b7 84 3a 18 e1 19 16  |H...'..U...:....|
+00000320  4f 5d be d0 59 39 90 be  94 74 e0 ad 79 84 31 01  |O]..Y9...t..y.1.|
+00000330  ab bc f2 34 39 cd 34 e8  f5 a0 00 94 75 0a 3d 78  |...49.4.....u.=x|
+00000340  f7 a2 9b eb ac 0e 5d 1a  ba c1 be 4f 1c 60 65 0d  |......]....O.`e.|
+00000350  2c a2 9c 99 66 d8 31 a0  02 ce bd 27 99 9c e3 48  |,...f.1....'...H|
+00000360  0a 1f 8c 65 24 a9 b6 de  bf d2 e7 66 fe 43 d3 8d  |...e$......f.C..|
+00000370  ea 17 03 03 00 35 d1 19  b3 a5 0c 0e 63 4d 32 bf  |.....5......cM2.|
+00000380  49 85 97 14 ac 78 ab e7  cc 59 48 96 d2 3c 66 0f  |I....x...YH..<f.|
+00000390  5e a2 a9 30 2a 3e 97 44  ab c0 68 1a 53 f9 71 41  |^..0*>.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....&<i..;.J.|
-000000d0  e5 bf 9c 48 20 6b 9c 91  eb ff 14 af 44 93 35 17  |...H k......D.5.|
-000000e0  03 03 00 da 42 0b c1 73  60 66 cf c6 f1 25 bc d2  |....B..s`f...%..|
-000000f0  da 72 0b 8d aa 32 82 35  70 3a e2 fa 4c 30 fd d4  |.r...2.5p:..L0..|
-00000100  12 3c 29 a5 41 71 7e e9  3a 64 61 7d e6 c3 60 3f  |.<).Aq~.:da}..`?|
-00000110  d8 e3 db b4 f9 f6 59 02  96 e3 2a 2a d1 96 70 8e  |......Y...**..p.|
-00000120  98 ec a0 84 79 46 53 3c  b1 0b a5 d8 78 6b 82 06  |....yFS<....xk..|
-00000130  43 af 5a 5a 68 b6 4e 6d  30 eb 81 63 1a 2d 72 0a  |C.ZZh.Nm0..c.-r.|
-00000140  0e 2b 68 b4 20 12 77 ef  9b d6 c4 f0 4a 59 47 86  |.+h. .w.....JYG.|
-00000150  05 59 9e 68 25 54 8d 72  04 bf 50 cf 44 0a fc 0c  |.Y.h%T.r..P.D...|
-00000160  6a bf af 26 08 7d e6 c4  3b 69 a5 7f f0 11 0c 7f  |j..&.}..;i......|
-00000170  87 bf 84 02 7b af 2e 03  35 c4 d3 36 aa da 4a e7  |....{...5..6..J.|
-00000180  eb 77 23 bd 4d e6 df 08  2a 76 47 6b 7d 04 42 20  |.w#.M...*vGk}.B |
-00000190  be 82 51 d3 af df 98 c1  6e 5d 21 da a0 da 7c 5c  |..Q.....n]!...|\|
-000001a0  29 ee 62 bb a3 aa f8 76  09 77 f4 5c 56 94 75 27  |).b....v.w.\V.u'|
-000001b0  30 4a 60 18 e8 67 9f 7d  38 ec 34 6d 9c 0e        |0J`..g.}8.4m..|
->>> 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..|
index 2045af72f4a50e1d0f50fabfa2e6234479178180..a30a26249b7b851fc8718b4e227928f6e790a985 100644 (file)
 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..<Y.1|
-00000220  77 21 4c b3 7d 85 82 b6  7d a0 89 5f 08 39 d8 37  |w!L.}...}.._.9.7|
-00000230  67 b3 0b b9 eb dd d8 11  ab 8f 9e 7b bb c0 c4 60  |g..........{...`|
-00000240  0e 62 31 3b 80 4c fd c5  08 9b 32 b0 0d af b5 1b  |.b1;.L....2.....|
-00000250  23 9a 18 66 ad 75 85 62  fc da e5 2f 0c 9a 26 d4  |#..f.u.b.../..&.|
-00000260  47 26 58 cc 1d 0b 7a e3  f9 a9 52 ac 69 31 73 b6  |G&X...z...R.i1s.|
-00000270  31 61 99 6b 38 d7 0d 09  4f 95 72 fc b1 a5 0b 48  |1a.k8...O.r....H|
-00000280  f1 66 41 69 e9 4c 33 73  fd 55 32 93 a3 92 55 ee  |.fAi.L3s.U2...U.|
-00000290  0c aa ef ed 46 70 68 1b  4e 87 32 53 21 fd 5e da  |....Fph.N.2S!.^.|
-000002a0  0a 27 81 88 46 ba 10 08  f7 7d 43 e0 e5 41 22 8d  |.'..F....}C..A".|
-000002b0  dd 39 b3 ee 02 7d c7 27  63 7a d0 f1 78 5c cf 56  |.9...}.'cz..x\.V|
-000002c0  32 7d 29 2d 90 c7 bc cf  fb 44 79 dc c2 03 eb 03  |2})-.....Dy.....|
-000002d0  88 7a 57 fc cc 74 de 28  d3 5e 9f f1 1a 50 34 25  |.zW..t.(.^...P4%|
-000002e0  34 37 36 94 c6 61 d5 00  c7 da 4d d4 7b 22 9d dc  |476..a....M.{"..|
-000002f0  ea 4e ff c8 94 4b 4a a6  af a4 fa 81 01 92 cb 08  |.N...KJ.........|
-00000300  42 08 6e 7e cc 89 2f de  2e 4d 89 e3 58 48 0d 20  |B.n~../..M..XH. |
-00000310  8c 5c 0e 17 03 03 00 99  d0 d0 4f ec e9 40 14 8d  |.\........O..@..|
-00000320  12 aa c8 dd b9 64 62 02  6c 76 be 3d 97 77 65 36  |.....db.lv.=.we6|
-00000330  43 da 7f 60 90 d5 1e 69  bf bb c7 d8 e1 25 54 38  |C..`...i.....%T8|
-00000340  44 72 ee c2 fb 3d 07 bc  44 82 74 48 4a c9 c2 28  |Dr...=..D.tHJ..(|
-00000350  6e 95 67 85 49 24 99 e6  fb 72 60 84 3a 98 15 21  |n.g.I$...r`.:..!|
-00000360  ff fd bc 1b 2e 7d 43 db  dc 70 ea 1c 19 67 f6 55  |.....}C..p...g.U|
-00000370  52 c5 03 91 4d 0a cb 59  d4 76 b0 53 7b 99 2a a3  |R...M..Y.v.S{.*.|
-00000380  60 71 36 55 27 d7 16 bb  a4 dc e8 a9 e8 8f e8 a4  |`q6U'...........|
-00000390  f6 43 1f 73 d9 b9 65 a9  06 55 e6 0a 17 32 40 34  |.C.s..e..U...2@4|
-000003a0  d4 23 7d c1 d2 ae 5d 9e  c4 d9 35 22 2c c4 71 cd  |.#}...]...5",.q.|
-000003b0  e0 17 03 03 00 35 3f 7b  f8 cd 3b e4 7b 52 3a ed  |.....5?{..;.{R:.|
-000003c0  04 2e 80 d1 bc d7 3f 0b  2f 03 98 ee a6 9b 4b fe  |......?./.....K.|
-000003d0  ff 0c 3b 8d 81 b4 e2 50  d0 07 a4 9c f7 f8 8b 59  |..;....P.......Y|
-000003e0  fe 78 e0 21 d7 9b 50 99  df 01 a9                 |.x.!..P....|
+00000050  2e 00 2b 00 02 03 04 00  33 00 24 00 1d 00 20 20  |..+.....3.$...  |
+00000060  8c d2 dd d7 17 cc 15 f7  0b dc 75 48 d0 82 54 36  |..........uH..T6|
+00000070  b0 f6 ae fe 29 7b 0d af  9f 06 4e 58 8c 66 10 14  |....){....NX.f..|
+00000080  03 03 00 01 01 17 03 03  00 17 8c ef b2 76 05 ee  |.............v..|
+00000090  eb e8 55 a3 56 d6 4a b7  d7 10 8e f0 f9 7e 49 eb  |..U.V.J......~I.|
+000000a0  fd 17 03 03 02 6d c2 33  a8 17 70 1e 66 4c b8 32  |.....m.3..p.fL.2|
+000000b0  99 41 79 b8 85 98 c8 f7  f4 c6 25 41 9b 30 ea f5  |.Ay.......%A.0..|
+000000c0  24 6c ad 7c b6 c1 c7 a6  d5 2c 0b d8 78 e0 ec df  |$l.|.....,..x...|
+000000d0  bb 8d ea 0a ff ba c9 aa  ec 24 05 63 2a ff 13 37  |.........$.c*..7|
+000000e0  5e fe c1 7b 6e c0 dd e1  09 c1 87 33 fc 18 90 28  |^..{n......3...(|
+000000f0  5b b2 ba 7e 69 06 dc 8e  ac c4 ca 08 84 aa df 0c  |[..~i...........|
+00000100  2a a7 74 46 e7 c8 db 23  96 67 95 f4 79 9b 6e 3d  |*.tF...#.g..y.n=|
+00000110  94 fc 80 07 d9 e7 cf 0d  31 27 84 08 66 23 2d 05  |........1'..f#-.|
+00000120  64 2f 63 27 5c e2 1c 2e  f7 6f 99 4f 59 4c f4 3d  |d/c'\....o.OYL.=|
+00000130  cf a9 ff 32 f4 6a 7d b4  c4 11 01 9d f2 8a ce da  |...2.j}.........|
+00000140  21 51 b0 99 0c a8 a6 fa  09 b1 c4 cf a9 84 96 7d  |!Q.............}|
+00000150  aa 80 b4 b3 c7 ed 70 08  1b 50 b9 07 a5 2c a0 21  |......p..P...,.!|
+00000160  da 97 a7 5f 35 d4 55 24  8b 2d 14 85 0d 63 10 7f  |..._5.U$.-...c..|
+00000170  0b 22 03 a5 e3 26 e4 2b  ca c4 54 39 4d 52 41 8b  |."...&.+..T9MRA.|
+00000180  8e b0 60 2f 61 f5 7f d2  62 2c a3 f9 f2 46 08 76  |..`/a...b,...F.v|
+00000190  37 92 d0 bc 6c 0e 75 a2  f5 c1 f4 b3 7d f9 83 8e  |7...l.u.....}...|
+000001a0  bd 30 4f 04 77 98 b7 d0  e9 a0 19 4c 61 c1 58 09  |.0O.w......La.X.|
+000001b0  04 82 60 38 55 51 c1 94  46 40 a2 12 68 0a 83 7b  |..`8UQ..F@..h..{|
+000001c0  30 71 a3 08 83 f7 67 86  df 44 df ea 6d 56 65 25  |0q....g..D..mVe%|
+000001d0  16 55 5d cd 8a f4 03 10  86 1d 5a fd d8 2e 23 7e  |.U].......Z...#~|
+000001e0  34 77 b7 af 4b 2c 8a 36  ad 07 a5 5a 3b 39 c8 90  |4w..K,.6...Z;9..|
+000001f0  4b 77 60 81 2e ac 51 37  09 ac c0 e7 6b 18 a5 76  |Kw`...Q7....k..v|
+00000200  52 91 62 95 6d 1c 9d 8e  6c 03 f5 12 cd 80 7f 40  |R.b.m...l......@|
+00000210  4e f3 e6 7d d2 f1 3d 94  a7 16 ec fc 0c c9 72 b9  |N..}..=.......r.|
+00000220  ee 33 bb 76 d0 6d 27 3d  58 cd ed 34 60 f4 bb 23  |.3.v.m'=X..4`..#|
+00000230  49 a8 8d 94 7c 46 85 04  65 26 c2 5e 4f 22 f6 7d  |I...|F..e&.^O".}|
+00000240  46 ae 1b 63 eb 6b 43 c5  64 fa 9d 43 86 e5 29 8f  |F..c.kC.d..C..).|
+00000250  98 20 9e 21 b2 f3 32 c9  82 75 4d 97 5e cf dd cb  |. .!..2..uM.^...|
+00000260  1d 6b 6e fc 8f 61 86 a9  71 12 96 e3 18 42 d3 28  |.kn..a..q....B.(|
+00000270  f9 86 7e ab 90 9b f6 5c  c2 46 fb 93 e6 51 7d f5  |..~....\.F...Q}.|
+00000280  8a b2 e9 c6 e1 70 62 fa  08 e1 91 0b ee 89 12 01  |.....pb.........|
+00000290  ca dd 25 56 8f 2d 45 0d  a5 47 26 f0 a2 4d f5 4b  |..%V.-E..G&..M.K|
+000002a0  8b dd 6f ab 0f f1 5b 60  9c b0 dc 88 24 df 1c 5b  |..o...[`....$..[|
+000002b0  a9 90 66 44 e1 e1 6b 96  b5 3f e2 69 76 a7 84 d6  |..fD..k..?.iv...|
+000002c0  2b 68 b0 f5 8a ba e7 83  83 88 45 78 2d e0 a4 82  |+h........Ex-...|
+000002d0  74 53 4a cf 14 84 fa 49  78 ce 3b 9a 24 66 00 a9  |tSJ....Ix.;.$f..|
+000002e0  5b 0b 83 20 fb 20 a8 20  45 10 53 76 7d ee b2 d6  |[.. . . E.Sv}...|
+000002f0  af 33 f9 29 d0 f7 16 7e  d6 59 b0 4a 06 ac d4 7d  |.3.)...~.Y.J...}|
+00000300  84 1d 50 64 d0 f8 67 65  54 2f a3 2c 50 9e 93 43  |..Pd..geT/.,P..C|
+00000310  58 59 67 17 03 03 00 99  62 ac 15 76 89 cb 8d 67  |XYg.....b..v...g|
+00000320  25 75 a7 57 b6 65 8c 73  24 a6 71 ba c4 75 ad f8  |%u.W.e.s$.q..u..|
+00000330  2a a6 94 12 c2 8d ca 7e  1a 75 e4 21 da cb 1e 77  |*......~.u.!...w|
+00000340  69 d0 e1 4b 25 46 ce 99  1b e0 10 9d 12 d6 16 62  |i..K%F.........b|
+00000350  f9 42 3b b8 3a 7b 3a 11  1f d7 04 fe 88 0b 62 ba  |.B;.:{:.......b.|
+00000360  a9 d6 51 c4 f5 be d9 92  e6 d6 05 94 9b f9 76 0d  |..Q...........v.|
+00000370  ca da 55 45 e4 fe a9 f3  dc d5 08 db 50 7c 4a 7c  |..UE........P|J||
+00000380  f1 9c a7 5d e6 0d f9 cf  32 67 c0 66 a6 85 26 8b  |...]....2g.f..&.|
+00000390  57 f0 2c 5e b7 7e c1 cb  3d 6c 23 e2 18 3e c2 67  |W.,^.~..=l#..>.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  |..<eIZ.pK...*...|
-000001c0  74 ab fe bf a8 fb f8 45  c8 d6 92 f4 0c a3 d3 fb  |t......E........|
-000001d0  35 32 51 98 04 84 95 75  62 d9 8a 4d 0c b7        |52Q....ub..M..|
->>> 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|
index 8dac31adb6220e0c6e78768b08ddbff998c39f50..c06837e6da28eb03b1ad8ca5d7d736c26f487a4d 100644 (file)
 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.xG<n..|
-00000020  9e 51 c4 58 8c 32 6f b5  23 31 e7 20 00 00 00 00  |.Q.X.2o.#1. ....|
+00000000  16 03 03 00 9b 02 00 00  97 03 03 84 0c ed 20 38  |.............. 8|
+00000010  61 6f 28 24 e6 70 28 71  1d 3e 38 fc e2 94 da fa  |ao($.p(q.>8.....|
+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..[|
index 3d6c21bcee11cd8272c3452295b2dbb48d9b2aaa..a613b78da58f65b9500299e593e9a493fbcd5b5a 100644 (file)
 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..#<X>....'...|
+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  |<r..H..p........|
+00000130  81 40 69 36 29 44 75 0f  10 6c 8e a4 af 67 15 45  |.@i6)Du..l...g.E|
+00000140  42 bc 35 3f a5 c1 a7 c2  0a e0 7f bc f2 b6 a3 53  |B.5?...........S|
+00000150  b4 14 56 ed 45 5b e0 35  c6 93 3a f5 90 a7 4c 78  |..V.E[.5..:...Lx|
+00000160  01 3d 6a 16 41 52 31 e7  a9 8c 29 5e e5 e4 6a 3a  |.=j.AR1...)^..j:|
+00000170  95 59 a0 d9 67 b5 62 ed  13 98 82 b8 9b e1 f3 cf  |.Y..g.b.........|
+00000180  1f 39 0e 58 d4 19 a1 59  b3 c9 d9 dc 7a 2c 78 da  |.9.X...Y....z,x.|
+00000190  f2 54 58 91 36 59 24 dc  90 78 53 2f d7 e5 74 10  |.TX.6Y$..xS/..t.|
+000001a0  f3 ab f2 7e f8 8e 4d a9  15 b5 d8 65 85 0f e2 aa  |...~..M....e....|
+000001b0  40 ec b6 a6 3c d9 2e 11  17 72 6d 11 ab b5 65 8c  |@...<....rm...e.|
+000001c0  c1 62 8a 2e 0d b1 84 45  fa 23 b4 4e 39 9d 6b b7  |.b.....E.#.N9.k.|
+000001d0  91 3c 29 87 59 2c 95 40  29 4c af 7f 67 4c e4 fb  |.<).Y,.@)L..gL..|
+000001e0  9b 91 5f 96 bc 0b 4a b0  8b 52 d5 92 91 42 83 85  |.._...J..R...B..|
+000001f0  9a ec 81 56 ee 90 03 e7  d5 36 e9 ca e5 ed 07 4b  |...V.....6.....K|
+00000200  c8 ba c8 45 1b fc a8 95  b8 ff a0 9b 32 de 35 da  |...E........2.5.|
+00000210  af 6e 3a 0a 3a 94 6f 23  29 78 c1 21 07 7d 5e c2  |.n:.:.o#)x.!.}^.|
+00000220  9f 32 6d 78 75 58 c6 81  e2 6a ee d3 ea 69 8a 31  |.2mxuX...j...i.1|
+00000230  dc 86 9b ad b4 f6 29 0e  5f e3 aa e2 32 13 60 e5  |......)._...2.`.|
+00000240  b8 5a 45 7b bc ad f1 ae  42 18 4c dd 10 aa 60 88  |.ZE{....B.L...`.|
+00000250  b2 d5 e2 e6 cd 83 85 4d  ba c4 a4 94 52 bd 70 8e  |.......M....R.p.|
+00000260  85 4e ef 57 f9 9f ae f0  40 50 6b 5c 3a d2 cb 7b  |.N.W....@Pk\:..{|
+00000270  53 c7 01 60 7c 0b 53 39  bf a8 a2 f7 ef 6c 99 a5  |S..`|.S9.....l..|
+00000280  b5 23 3d d1 d5 a5 93 bc  40 41 10 29 4c a6 2d 91  |.#=.....@A.)L.-.|
+00000290  5a 43 2c 7b fb ef 70 73  5f f0 13 9a 5d f2 f3 41  |ZC,{..ps_...]..A|
+000002a0  7e 8b 09 f3 6f 5a c8 40  b7 18 b9 ff 4c 93 ee 8e  |~...oZ.@....L...|
+000002b0  f2 cb 6b 02 b8 d8 b7 d2  8d dd 2f 19 83 f7 7d bc  |..k......./...}.|
+000002c0  71 62 78 b4 43 29 62 76  a0 82 17 bc d8 d4 09 dd  |qbx.C)bv........|
+000002d0  8e 48 bf 4b dd 44 45 7a  1f 9c bd ae 0c 26 fc 71  |.H.K.DEz.....&.q|
+000002e0  dc c7 49 ee 13 46 c8 dd  f9 45 46 34 4c ac 02 33  |..I..F...EF4L..3|
+000002f0  64 89 02 d7 93 dd 03 3e  3a 12 d7 c1 8e 18 55 33  |d......>:.....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...<mx.,|
-000001b0  04 15 9e 36 7d f5 c1 5c  d6 4c 16 9e a4 93 53 12  |...6}..\.L....S.|
-000001c0  08 c0 b9 c0 3c 2f b2 52  f1 5a 2f a4 8f 6c 55 57  |....</.R.Z/..lUW|
-000001d0  5b 0e d7 ef c4 a1 ee 90  99 a0 77 63 71 49 17 03  |[.........wcqI..|
-000001e0  03 00 16 cc 75 7c b6 21  9d ac 22 06 3a 15 90 e8  |....u|.!..".:...|
-000001f0  15 43 08 c7 02 aa 40 cb  d5                       |.C....@..|
+00000000  17 03 03 00 16 54 f1 cd  5a 87 da 6a e7 a6 e5 00  |.....T..Z..j....|
+00000010  60 f8 cd 6b af db 1b 85  3b 40 23                 |`..k....;@#|
 >>> 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.*....|
index 826fd7aea8ad80d311651a47cc87723e0f77f150..20cafb45b61cc02ced9bf291634ac4a1879701c0 100644 (file)
 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.!...<E...J|
-00000230  8c 19 18 ca 17 18 e9 4f  3f fb ec d8 c5 56 41 50  |.......O?....VAP|
-00000240  f9 d6 61 be 19 52 f5 a2  3d b4 27 6a a6 a2 1f 41  |..a..R..=.'j...A|
-00000250  57 e5 a5 e7 76 4e 9e ec  63 8a 45 89 04 3a 33 15  |W...vN..c.E..:3.|
-00000260  18 eb f6 71 fb 2d bc ac  c7 4f cd ed 03 e1 c9 4e  |...q.-...O.....N|
-00000270  27 0c 66 d2 c9 0d fd d7  a2 87 b5 67 29 1c 17 37  |'.f........g)..7|
-00000280  15 09 d8 e8 1b 8e f0 81  20 00 7e 7c 4b 7e 12 88  |........ .~|K~..|
-00000290  02 9c 82 81 22 95 b0 0a  58 e8 b2 85 cd f9 07 53  |...."...X......S|
-000002a0  f9 78 36 fb 8f 93 80 92  14 1d b3 07 9f 36 4f f7  |.x6..........6O.|
-000002b0  44 d6 df 7c f5 19 a6 49  aa 20 29 6e e5 df c5 07  |D..|...I. )n....|
-000002c0  30 76 6c fc f0 1e 2f d6  93 ec 55 8c 08 ce 7b e2  |0vl.../...U...{.|
-000002d0  29 f1 21 c8 eb 32 42 7b  05 21 8b 01 77 25 7f e4  |).!..2B{.!..w%..|
-000002e0  e9 52 76 87 91 2b 47 52  4c 91 40 cc 4f 81 29 6f  |.Rv..+GRL.@.O.)o|
-000002f0  57 28 6a 84 b8 6f a8 31  ef 5c f5 bd ef 96 2e e4  |W(j..o.1.\......|
-00000300  55 e2 2a 07 4d be 49 a2  89 00 41 38 a4 fa 7f 90  |U.*.M.I...A8....|
-00000310  a4 93 63 11 cf f3 36 50  dc 7a 1c f5 7a a0 1e a8  |..c...6P.z..z...|
-00000320  60 ac 41 33 79 e1 65 d2  0e 51 13 65 49 4d 52 78  |`.A3y.e..Q.eIMRx|
-00000330  0a c5 6a e2 17 03 03 00  99 80 e9 ac 5c c7 cb d1  |..j.........\...|
-00000340  47 bf 49 15 11 b6 8f 04  33 ae 0a 37 cd 3e 8a 11  |G.I.....3..7.>..|
-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|
index 3dea0ac4cb3642a9bee43dd46478340ec216aa98..7de7d279b2b6e7ae45f430e37ab3d3e7164b6ae6 100644 (file)
 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  |.<r...a.#o.:.<.V|
-00000210  70 74 62 67 be 0a 9e fc  f0 85 51 07 70 30 36 58  |ptbg......Q.p06X|
-00000220  5f d1 72 71 e3 1e cc e5  66 08 a8 05 c3 c9 40 f2  |_.rq....f.....@.|
-00000230  31 8a f2 bb e5 05 06 37  93 38 eb ce b8 2a f8 e6  |1......7.8...*..|
-00000240  ff fe f6 21 d1 20 96 81  29 5a bc d5 94 12 ca ed  |...!. ..)Z......|
-00000250  be 80 d4 d2 0b 39 78 af  a7 84 21 bd 4f b1 63 b3  |.....9x...!.O.c.|
-00000260  24 26 75 b9 69 0c f3 37  e5 c9 d6 1e fd 75 00 87  |$&u.i..7.....u..|
-00000270  84 97 4f 21 bc 74 3d 14  c2 36 0d 80 08 59 2e c2  |..O!.t=..6...Y..|
-00000280  e7 62 01 5a 87 48 e9 a9  a5 d2 c6 fa 50 93 bf 3e  |.b.Z.H......P..>|
-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                                       |....|
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 (file)
index 0000000..cb626a1
--- /dev/null
@@ -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.<n.P.|
+000002d0  b5 24 9c d8 af f7 80 8a  51 43 ec b3 59 18 bd ea  |.$......QC..Y...|
+000002e0  8a be af 11 c8 ac 60 88  e3 67 a2 ae c2 95 16 47  |......`..g.....G|
+000002f0  2b e2 ea 42 0a 0a 3f 2b  8b c8 ec 9d e7 b2 a6 ee  |+..B..?+........|
+00000300  f4 9b ba 28 47 e2 30 ae  05 89 09 65 3d b6 54 8a  |...(G.0....e=.T.|
+00000310  4a df d4 fa a5 4c 30 38  53 f2 14 03 03 00 01 01  |J....L08S.......|
+00000320  16 03 03 00 40 97 50 23  88 56 0d d4 1b ba 6f 3e  |....@.P#.V....o>|
+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 (file)
index 0000000..86d5415
--- /dev/null
@@ -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 (file)
index 0000000..302e64e
--- /dev/null
@@ -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.<l..ZL..8.,|
+00000030  c0 30 00 9f cc a9 cc a8  cc aa c0 2b c0 2f 00 9e  |.0.........+./..|
+00000040  c0 24 c0 28 00 6b c0 23  c0 27 00 67 c0 0a c0 14  |.$.(.k.#.'.g....|
+00000050  00 39 c0 09 c0 13 00 33  00 9d 00 9c 00 3d 00 3c  |.9.....3.....=.<|
+00000060  00 35 00 2f 00 ff 01 00  00 66 00 00 00 0e 00 0c  |.5./.....f......|
+00000070  00 00 09 31 32 37 2e 30  2e 30 2e 31 00 0b 00 04  |...127.0.0.1....|
+00000080  03 00 01 02 00 0a 00 0c  00 0a 00 1d 00 17 00 1e  |................|
+00000090  00 19 00 18 00 16 00 00  00 17 00 00 00 0d 00 30  |...............0|
+000000a0  00 2e 04 03 05 03 06 03  08 07 08 08 08 09 08 0a  |................|
+000000b0  08 0b 08 04 08 05 08 06  04 01 05 01 06 01 03 03  |................|
+000000c0  02 03 03 01 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 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 (file)
index 0000000..9e9570f
--- /dev/null
@@ -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 (file)
index 0000000..89361f1
--- /dev/null
@@ -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  |.<AQ.N..t..Q...,|
+00000110  8e 36 6e e1 c9 bb 0f d2  fd 00 97 56 de 66 a9 19  |.6n........V.f..|
+00000120  c7 2f 18 e5 67 b4 34 73  9e b2 6f 68 26 8d 2f da  |./..g.4s..oh&./.|
+00000130  92 bd 52 13 32 3c 49 80  8c c7 3c 11 9d 9f 05 c0  |..R.2<I...<.....|
+00000140  aa 5d 63 33 8e 07 60 20  6a 01 1f 5a 16 45 4d ba  |.]c3..` j..Z.EM.|
+00000150  b0 2a 5c 26 b1 ea 26 72  59 c5 b0 59 8a 1a cb 9a  |.*\&..&rY..Y....|
+00000160  6a 54 55 06 75 37 a0 c9  04 4e 2f 61 de ef b5 df  |jTU.u7...N/a....|
+00000170  68 ae 42 03 29 91 e3 1d  a0 6b 18 4d 17 23 3d 61  |h.B.)....k.M.#=a|
+00000180  87 72 06 9f 45 98 0d 1e  f7 f1 f5 f3 f7 04 a5 98  |.r..E...........|
+00000190  29 c2 2e 77 d9 2c 95 df  5d 3d 20 41 36 26 1b 46  |)..w.,..]= A6&.F|
+000001a0  ea 54 9e a3 96 05 ba f7  33 01 85 b0 d1 9f 78 3c  |.T......3.....x<|
+000001b0  0f 73 0d 04 52 7f 02 f4  cb 79 f1 e2 d1 63 60 d6  |.s..R....y...c`.|
+000001c0  e1 34 05 23 79 c3 37 eb  d0 5b ea bc f4 f9 bb 7a  |.4.#y.7..[.....z|
+000001d0  85 9e 42 50 3c c8 f8 e6  f4 93 71 c2 6a 46 b9 26  |..BP<.....q.jF.&|
+000001e0  8c 17 b4 c9 65 00 fb 9a  d6 54 ab e6 71 c1 1b 5a  |....e....T..q..Z|
+000001f0  51 a2 6f df 0b 52 29 8c  c3 ec 8e bf 31 36 93 7e  |Q.o..R).....16.~|
+00000200  59 cc ca 49 71 dc ce 84  40 7d 43 81 5c 96 ed ca  |Y..Iq...@}C.\...|
+00000210  d1 e6 15 40 cf 19 f4 ed  61 28 9a e3 6b e7 1c 9b  |...@....a(..k...|
+00000220  c1 71 d0 46 ef 79 3b d8  35 e3 7b 47 3f a2 78 76  |.q.F.y;.5.{G?.xv|
+00000230  17 58 13 67 5f 4e f0 ed  2e e9 84 e1 92 0c a6 36  |.X.g_N.........6|
+00000240  5c 5b de 8e 5c 04 ed d4  a4 75 10 fd 85 9c e5 8e  |\[..\....u......|
+00000250  ca 02 14 fb 91 8b 85 14  79 e5 97 1f 63 46 48 90  |........y...cFH.|
+00000260  26 c7 2f a2 c0 18 71 d9  2e e3 81 78 7b 74 67 e0  |&./...q....x{tg.|
+00000270  e1 ef 48 af 41 96 9f 1a  44 d8 6c 94 49 3e 9b 47  |..H.A...D.l.I>.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 (file)
index 0000000..c13db8d
--- /dev/null
@@ -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.<Y..\..-|
+00000350  4b 55 4c 27 b1 6c bf 99  c3 36 1d 73 7a 8b fd bc  |KUL'.l...6.sz...|
+00000360  93 77 27 f5 9e cd 10 61  bc 8d b5 bf 7b bb 69 00  |.w'....a....{.i.|
+00000370  f9 f0 d3 22 dd 4e 7d 12  5a 61 49 1d d4 29 14 43  |...".N}.ZaI..).C|
+00000380  e5 62 ab d8 c6 78 75 80  4b 7a 6b 3f af 4b 92 2a  |.b...xu.Kzk?.K.*|
+00000390  23 29 da 85 c0 d7 35 03  9d ed 9c f7 83 39 cf cb  |#)....5......9..|
+000003a0  0f 85 5e 9f 29 61 d8 a2  d0 cb 14 2d 71 50 6f d5  |..^.)a.....-qPo.|
+000003b0  c2 17 03 03 00 45 be 9b  ee 5d e1 08 8a c2 d6 67  |.....E...].....g|
+000003c0  df 3b 84 50 28 30 69 bd  11 89 6a ab 02 ad d7 79  |.;.P(0i...j....y|
+000003d0  8b 2c 0a a9 9c ce e5 30  49 2d 59 82 e8 ee d3 03  |.,.....0I-Y.....|
+000003e0  77 d3 fc 22 dd 81 be e6  f4 22 36 8d 8e b1 7c 4a  |w.."....."6...|J|
+000003f0  b9 9c 6a ea 3f f0 aa ac  ec b6 c7 17 03 03 00 a3  |..j.?...........|
+00000400  69 e0 19 38 57 54 62 6c  28 d9 54 94 79 6e 7b 48  |i..8WTbl(.T.yn{H|
+00000410  25 55 7f 5f bb cc 91 07  30 47 55 9b f3 6e b9 ba  |%U._....0GU..n..|
+00000420  50 65 9b e9 81 5d 53 20  cd 27 5d ee 92 93 01 8f  |Pe...]S .'].....|
+00000430  5a d6 02 b9 26 1b 45 c3  40 26 6b 81 c3 ba 1e 3c  |Z...&.E.@&k....<|
+00000440  e6 03 93 b0 18 fe 2d be  07 97 b1 a1 a7 55 8f d8  |......-......U..|
+00000450  96 7a 58 ad 7d c1 72 71  d9 25 07 56 22 9a 7a f9  |.zX.}.rq.%.V".z.|
+00000460  4a 1b 82 30 e9 fb b0 26  81 45 d2 45 5b 1c 7d 97  |J..0...&.E.E[.}.|
+00000470  89 6d 17 69 81 27 a6 4c  be d0 78 1d b5 6c 3f 94  |.m.i.'.L..x..l?.|
+00000480  ef e4 6b ec 02 63 8b bf  f9 00 8a 8a 46 43 5d e0  |..k..c......FC].|
+00000490  52 38 8c d5 76 d7 79 42  a3 6b 35 e2 45 f3 0f b5  |R8..v.yB.k5.E...|
+000004a0  9f 22 f9                                          |.".|
+>>> 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|
index 7f804ee5715a2d27c1113fcdb13d61d0c7a51db8..9560176259e21929c4866315ea19d671c99dfff4 100644 (file)
@@ -12,7 +12,7 @@ import (
        "crypto/sha256"
        "crypto/subtle"
        "errors"
-       "golang_org/x/crypto/cryptobyte"
+       "internal/x/crypto/cryptobyte"
        "io"
 )
 
index e23068ce4357327e433878bccc45cce99a00422a..61f4eaf1aef597643d8f57605bdb0867ea4b1449 100644 (file)
@@ -18,10 +18,22 @@ import (
        "os"
        "reflect"
        "strings"
+       "sync"
        "testing"
        "time"
 )
 
+var savedSupportedSignatureAlgorithmsTLS12 = defaultSupportedSignatureAlgorithmsTLS12
+
+func init() {
+       // 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
+       defaultSupportedSignatureAlgorithmsTLS12 = defaultSupportedSignatureAlgorithms
+}
+
 var rsaCertPEM = `-----BEGIN CERTIFICATE-----
 MIIB0zCCAX2gAwIBAgIJAI/M7BYjwB+uMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
 BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
@@ -1076,14 +1088,65 @@ 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) {
+       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)
        }
 }
index 7cc1dd4eb6f017aad35d9dbd0981e99883be4ac3..3e1e5fb8cd1c1ff405539fcbfe6ca41e2629f560 100644 (file)
@@ -65,32 +65,21 @@ 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
 
+       var candidates []int
        if len(cert.AuthorityKeyId) > 0 {
                candidates = s.bySubjectKeyId[string(cert.AuthorityKeyId)]
        }
        if len(candidates) == 0 {
                candidates = s.byName[string(cert.RawIssuer)]
        }
-
-       for _, c := range candidates {
-               if err = cert.CheckSignatureFrom(s.certs[c]); err == nil {
-                       parents = append(parents, c)
-               } else {
-                       errCert = s.certs[c]
-               }
-       }
-
-       return
+       return candidates
 }
 
 func (s *CertPool) contains(cert *Certificate) bool {
index 59c3b15c8349bf9411ea6b5ea840f622a67ab5e1..0f595780874665ba4a53afae9343eca2c4c36a72 100644 (file)
@@ -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 {
index a02ac3cfe8364fce00c0524fb1a0b36ebeef06ce..e6332072d62a50d89398bd4d3677fb9f02efc4aa 100644 (file)
@@ -16,7 +16,135 @@ package x509
 #include <CoreFoundation/CoreFoundation.h>
 #include <Security/Security.h>
 
-// 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, (int)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")
        }
 
index ae69a2faddd847cb1a9c2851e4581e4b60c0f824..9b8a1cca7dea609908a53efb82f145636b5f0a9f 100644 (file)
@@ -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
@@ -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
@@ -57,22 +57,21 @@ func execSecurityRoots() (*CertPool, error) {
        if err != nil {
                return nil, err
        }
-       if debugExecDarwinRoots {
-               println(fmt.Sprintf("crypto/x509: %d certs have a trust policy", len(hasPolicy)))
+       if debugDarwinRoots {
+               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"}
 
-       home := os.UserHomeDir()
-       if home == "" {
-               if debugExecDarwinRoots {
-                       println("crypto/x509: can't get user home directory")
+       // 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 {
+                       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 debugExecDarwinRoots {
-               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 debugExecDarwinRoots {
+       if debugDarwinRoots {
                cmd.Stderr = &stderr
        }
        if err := cmd.Run(); err != nil {
-               if debugExecDarwinRoots {
-                       println(fmt.Sprintf("crypto/x509: verify-cert rejected %s: %q", cert.Subject, bytes.TrimSpace(stderr.Bytes())))
+               if debugDarwinRoots {
+                       fmt.Printf("crypto/x509: verify-cert rejected %s: %q\n", cert.Subject, bytes.TrimSpace(stderr.Bytes()))
                }
                return false
        }
-       if debugExecDarwinRoots {
-               println(fmt.Sprintf("crypto/x509: verify-cert approved %s", cert.Subject))
+       if debugDarwinRoots {
+               fmt.Printf("crypto/x509: verify-cert approved %s\n", cert.Subject)
        }
        return true
 }
@@ -217,8 +242,8 @@ 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 {
-                               println(fmt.Sprintf("crypto/x509: exec %q: %v, %s", cmd.Args, err, stderr.Bytes()))
+                       if debugDarwinRoots {
+                               fmt.Printf("crypto/x509: exec %q: %v, %s\n", cmd.Args, err, stderr.Bytes())
                        }
                        return nil
                }
index 68300c7955714e1e768cd734cc4e9d8ba02ff7df..1165a97e205b95ebe9616b4f62390bdd5608e321 100644 (file)
@@ -5,6 +5,10 @@
 package x509
 
 import (
+       "crypto/rsa"
+       "os"
+       "os/exec"
+       "path/filepath"
        "runtime"
        "testing"
        "time"
@@ -16,11 +20,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 +35,97 @@ 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 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 {
+                               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
+               }
+
+               // 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
+               }
 
-       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()
        }
 }
index 6d3e2b3f66a0a738267acf16222c9af582bec422..431bf024b23ca9ca1ffc98701db5fbfc74ae1e95 100644 (file)
@@ -775,7 +775,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
                }
        }
@@ -812,65 +812,81 @@ 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}
        }
 
        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 {
index 0e24d3b5da3af3218f8d63992811ef674eba1ba8..86fe76a57d7f83e8bf65fa42566bbf9ec8b479d0 100644 (file)
@@ -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"
@@ -381,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 {
@@ -1674,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
@@ -1889,3 +2010,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))
+}
index b0d366c2458b6e2104362970a139f6350ecd3998..58098adc2d5a2c53b0ea5757cd86047481185e7f 100644 (file)
@@ -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"
@@ -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 {
@@ -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 {
diff --git a/src/database/sql/example_cli_test.go b/src/database/sql/example_cli_test.go
new file mode 100644 (file)
index 0000000..8c61d75
--- /dev/null
@@ -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 (file)
index 0000000..768307c
--- /dev/null
@@ -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
+       }
+}
index da938b071a121df8771cb2dddc9e8c706b12dbda..6f9bd91276edfcf519194f9396163e13a2816d76 100644 (file)
@@ -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)
 }
index 71800aae83edb456d21eb8364867e83fb4c184f7..38a173adba852302c12b54f84cdd3a264b7e67b7 100644 (file)
@@ -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
@@ -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
index 4e6e1429d93b97beca5c277e08fa1ccd999aff86..b862b49d62788be0cd79ca176ef257ab908be2be 100644 (file)
@@ -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
index a995209934ffbbe4b171d8eec168d4f2b0fba67c..a84b7f6def1d9cdb14551c989bbca01e619cfe31 100644 (file)
@@ -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"
index 4f0510200fecb9d73de7f190c3e79cca08871480..9613af3a3c3c00aeedc54023c4a4d63df6aab9f3 100644 (file)
@@ -602,15 +602,13 @@ 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")
+       // ws2_32.dll import table is located in ".rdata" section,
+       // so it is good enough to test issue #16103.
+       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", "atmfd.dll", err)
+               t.Fatalf("unable to locate required file %q in search path: %s", filename, err)
        }
 
        f, err := Open(path)
index f4f740ef4227cd5b6b2f9e8b10fe0882239f45cf..b52aabe54b532df5d233a7f7151514a0f94a7a3f 100644 (file)
@@ -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
index 40ec81b6e69360945661fe52a13a04cb7ffd6455..53e2cace1667457a2ff11f1f5c6a1b3d66830d99 100644 (file)
@@ -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
index f10124e67d13c8f1348efb3d6b55008f59636ef4..dea63f1850fef444dc8a6a3490c6d3983c97afba 100644 (file)
@@ -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
diff --git a/src/encoding/json/example_text_marshaling_test.go b/src/encoding/json/example_text_marshaling_test.go
new file mode 100644 (file)
index 0000000..04c7813
--- /dev/null
@@ -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
+}
index a1b5afac0866d781e250714171b3ae942085bde6..204611bda02d7ac223891d503e934febaa246416 100644 (file)
@@ -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) {
diff --git a/src/encoding/xml/example_marshaling_test.go b/src/encoding/xml/example_marshaling_test.go
new file mode 100644 (file)
index 0000000..9f9e801
--- /dev/null
@@ -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 := `
+       <animals>
+               <animal>gopher</animal>
+               <animal>armadillo</animal>
+               <animal>zebra</animal>
+               <animal>unknown</animal>
+               <animal>gopher</animal>
+               <animal>bee</animal>
+               <animal>gopher</animal>
+               <animal>zebra</animal>
+       </animals>`
+       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 (file)
index 0000000..2549cb1
--- /dev/null
@@ -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 := `
+       <sizes>
+               <size>small</size>
+               <size>regular</size>
+               <size>large</size>
+               <size>unrecognized</size>
+               <size>small</size>
+               <size>normal</size>
+               <size>small</size>
+               <size>large</size>
+       </sizes>`
+       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
+}
index d393d0610bf60fa22c2c88e9aba2a97472fe1163..add5ece78211f101c63e29514fbdd9d3e360326f 100644 (file)
@@ -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
index 36c7ba63111082ba3e1e0297757c783ec4f74121..12102bc804e4e0334d4b65603a32f3d63fbabfce 100644 (file)
@@ -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.
index 2eef9d6ab9ae2fc945d35719278bdf194f1183b3..c312c62a582157b342552196104d358218f2a536 100644 (file)
@@ -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()
 }
index c2851759769b1ca948e334c04c47998eaed4c7fd..56ce47f83639aed139434478bdc3b1b1958d3a0a 100644 (file)
@@ -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"]
index e97372225c9a886f269a19e29516ea3ae3231830..068c2620a8a20955f053fad109261ab4e197533a 100644 (file)
@@ -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, "     <nil>"},
        {"%-10v", nil, "<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)
                }
        })
 }
@@ -1663,18 +1683,18 @@ var panictests = []struct {
 }{
        // String
        {"%s", (*PanicS)(nil), "<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>"}, // 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>"}, // 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) {
index 91103f2c07f1804af09fc0cac9fb4282c6c762dd..d6da8aed1e3aad72b5c76f381c00333a0cb4f2a6 100644 (file)
@@ -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 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
index 22dc52ccdcdd3f4f1de7dcfe4acbdbfe8ee7da30..42fcd8b979b01e5f1cce657085621c7546636da7 100644 (file)
@@ -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':
@@ -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 "<nil>". 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
                        }
index 91fe4cfc744a429d5504fb7a4f327e0d4f427252..0fa67201f88dc84e1a3230b563688ec5493cf598 100644 (file)
@@ -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
 
@@ -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.
index 091443f646f2fdfc1fbce5dbf51136b16676413a..db8b12eabf83c32952adc1cef8980f2b7241f2d7 100644 (file)
@@ -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)
        }
index e183ee6767ef55e096e37d8e59ea29a1cda6d749..14616d8ae24bfe0982567c8e35efc9d1cea809f6 100644 (file)
@@ -61,8 +61,8 @@ var pkgDeps = map[string][]string{
 
        // L1 adds simple functions and strings processing,
        // but not Unicode tables.
-       "math":          {"internal/cpu", "unsafe"},
-       "math/bits":     {},
+       "math":          {"internal/cpu", "unsafe", "math/bits"},
+       "math/bits":     {"unsafe"},
        "math/cmplx":    {"math"},
        "math/rand":     {"L0", "math"},
        "strconv":       {"L0", "unicode/utf8", "math", "math/bits"},
@@ -237,7 +237,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"},
 
@@ -279,9 +279,8 @@ 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"},
+       "internal/xcoff":                 {"L4", "OS", "debug/dwarf"},
        "math/big":                       {"L4"},
        "mime":                           {"L4", "OS", "syscall", "internal/syscall/windows/registry"},
        "mime/quotedprintable":           {"L4"},
@@ -329,7 +328,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.
@@ -366,9 +365,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.
@@ -396,13 +395,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"},
 
@@ -418,12 +417,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",
@@ -441,9 +440,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"},
+       "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"},
@@ -494,7 +493,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
                }
 
index 682315cbd6a43b97ece36e9838cf3156fba094ff..8e3858feea926de6093fb155f5cf32174724f5fa 100644 (file)
 //     - "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:
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 (file)
index 0000000..4405d54
--- /dev/null
@@ -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 (file)
index 0000000..142fb42
--- /dev/null
@@ -0,0 +1 @@
+package d
index d9268b87fb885b3c00e027b314a2306732c792e7..0ec42643fdf82fa5f3c5fba537602b70dfc83fae 100644 (file)
@@ -7,6 +7,7 @@
 package doc
 
 import (
+       "bytes"
        "io"
        "strings"
        "text/template" // for HTMLEscape
@@ -14,32 +15,38 @@ import (
        "unicode/utf8"
 )
 
+const (
+       ldquo = "&ldquo;"
+       rdquo = "&rdquo;"
+       ulquo = "“"
+       urquo = "”"
+)
+
 var (
-       ldquo = []byte("&ldquo;")
-       rdquo = []byte("&rdquo;")
+       htmlQuoteReplacer    = strings.NewReplacer(ulquo, ldquo, urquo, rdquo)
+       unicodeQuoteReplacer = strings.NewReplacer("``", ulquo, "''", urquo)
 )
 
 // Escape comment text for HTML. If nice is set,
 // also turn `` into &ldquo; and '' into &rdquo;.
 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 &amp;
+               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 (
@@ -47,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.
@@ -79,29 +86,6 @@ var (
        html_endh   = []byte("</h3>\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
@@ -121,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
@@ -248,7 +246,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 +427,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 +445,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))
                                }
                        }
index 0523ab899ee345e00d5cab7f5fef8cca7277f612..e0adeb2f5cf107d50c4d291cc998377d3db6672d 100644 (file)
@@ -7,6 +7,7 @@ package doc
 import (
        "bytes"
        "reflect"
+       "strings"
        "testing"
 )
 
@@ -150,6 +151,7 @@ func TestToText(t *testing.T) {
 var emphasizeTests = []struct {
        in, out string
 }{
+       {"", ""},
        {"http://[::1]:8080/foo.txt", `<a href="http://[::1]:8080/foo.txt">http://[::1]:8080/foo.txt</a>`},
        {"before (https://www.google.com) after", `before (<a href="https://www.google.com">https://www.google.com</a>) after`},
        {"before https://www.google.com:30/x/y/z:b::c. After", `before <a href="https://www.google.com:30/x/y/z:b::c">https://www.google.com:30/x/y/z:b::c</a>. After`},
@@ -168,7 +170,13 @@ var emphasizeTests = []struct {
        {"Hello http://example.com/%2f/ /world.", `Hello <a href="http://example.com/%2f/">http://example.com/%2f/</a> /world.`},
        {"Lorem http: ipsum //host/path", "Lorem http: ipsum //host/path"},
        {"javascript://is/not/linked", "javascript://is/not/linked"},
+       {"http://foo", `<a href="http://foo">http://foo</a>`},
+       {"art by [[https://www.example.com/person/][Person Name]]", `art by [[<a href="https://www.example.com/person/">https://www.example.com/person/</a>][Person Name]]`},
+       {"please visit (http://golang.org/)", `please visit (<a href="http://golang.org/">http://golang.org/</a>)`},
+       {"please visit http://golang.org/hello())", `please visit <a href="http://golang.org/hello()">http://golang.org/hello()</a>)`},
        {"http://git.qemu.org/?p=qemu.git;a=blob;f=qapi-schema.json;hb=HEAD", `<a href="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</a>`},
+       {"https://foo.bar/bal/x(])", `<a href="https://foo.bar/bal/x(">https://foo.bar/bal/x(</a>])`}, // inner ] causes (]) to be cut off from URL
+       {"foo [ http://bar(])", `foo [ <a href="http://bar(">http://bar(</a>])`},                      // outer [ causes ]) to be cut off from URL
 }
 
 func TestEmphasize(t *testing.T) {
@@ -182,32 +190,18 @@ 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 {
+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)
                }
        }
index cf3547810ad1bebd7863ffbff3a4814c1c047455..81956f2fdbfe0158f8a20687da4e37dcbfa027a5 100644 (file)
@@ -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
@@ -421,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 {
index 0d2bf72e319b6e5ecbeb4b250b60b9abdf7f4a4b..74fd10626d2771cb26b2216e1e7cf09204d21fdb 100644 (file)
@@ -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 "<nil>"
index 4950e7c6c38659aadc1738d10dd7f0c44ef0c740..6db5c21c4a222cf8585aa9d21b81d0a576ba3a99 100644 (file)
@@ -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)
+                       }
+               }
+       }
 }
 
 // ----------------------------------------------------------------------------
index c90080b7cc1752c8d8b344e560e1601cc197c9b0..3fa1616cd147b19af5d87884dcd22a140c73846c 100644 (file)
@@ -72,6 +72,7 @@ func Synopsis(s string) string {
                        return ""
                }
        }
+       s = convertQuotes(s)
        return s
 }
 
index 59b253cb8dcea1185635b383b7dc8f7a33a03f55..3f443dc75788347cc87623c5fdf4600dd16f6d9d 100644 (file)
@@ -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) {
index 76c285556028c4caef424b07b128b3d54b66ba96..6b59774fb9350365aa52d5e14e9d4ca3ae3caa5b 100644 (file)
@@ -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{}
 
index b0a327ffd6416ce8e18b63d1c9173839b2f514d0..4b9b9f6477080fdd2fd3072510f728b52e81e278 100644 (file)
@@ -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
 
index 76c285556028c4caef424b07b128b3d54b66ba96..6b59774fb9350365aa52d5e14e9d4ca3ae3caa5b 100644 (file)
@@ -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{}
 
index 500d49511b5c5abf77a1d2095b7c528c77df314b..51c7ac12681894bf5f4aa1051497f8b1203e7226 100644 (file)
@@ -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
+}
diff --git a/src/go/format/benchmark_test.go b/src/go/format/benchmark_test.go
new file mode 100644 (file)
index 0000000..7bd45c0
--- /dev/null
@@ -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
index f0a1ca2b76a18bc05cce274934791e744286126c..c809c9ab8678c3ffd15435ae9957a973d7c5b5ed 100644 (file)
@@ -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
index 56e83136fb1a0b09b4c6af27d69eeccf598d9252..ff6e12c0da5233a5d340058e353a3768273a8722 100644 (file)
@@ -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)
index ebd08b8f35957a04bd87b10b398edbb576d06ac9..443aa26a0cdf57982c8b9f57d1fae495e9643f58 100644 (file)
@@ -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.
index da4931ef1e72244fe14f49087e3ed808106edfcf..b332babc7b685cfd35c474b5db7f34dc3dc14357 100644 (file)
@@ -6,10 +6,14 @@ package gccgoimporter
 
 import (
        "go/types"
-       "runtime"
        "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",
@@ -56,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",
@@ -68,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",
@@ -81,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",
@@ -100,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",
@@ -144,14 +148,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 +180,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)
        }
index 159cc50719f507a6ae407d979613fc48e51384b9..6856611026f3244756d6a824056616231ae6e120 100644 (file)
@@ -6,9 +6,11 @@
 package gccgoimporter // import "go/internal/gccgoimporter"
 
 import (
+       "bytes"
        "debug/elf"
        "fmt"
        "go/types"
+       "internal/xcoff"
        "io"
        "os"
        "path/filepath"
@@ -62,8 +64,10 @@ func findExportFile(searchpaths []string, pkgpath string) (string, error) {
 const (
        gccgov1Magic    = "v1;\n"
        gccgov2Magic    = "v2;\n"
+       gccgov3Magic    = "v3;\n"
        goimporterMagic = "\n$$ "
        archiveMagic    = "!<ar"
+       aixbigafMagic   = "<big"
 )
 
 // Opens the export data file at the given path. If this is an ELF file,
@@ -88,33 +92,44 @@ func openExportFile(fpath string) (reader io.ReadSeeker, closer io.Closer, err e
                return
        }
 
-       var elfreader io.ReaderAt
+       var objreader io.ReaderAt
        switch string(magic[:]) {
-       case gccgov1Magic, gccgov2Magic, goimporterMagic:
+       case gccgov1Magic, gccgov2Magic, gccgov3Magic, goimporterMagic:
                // Raw export data.
                reader = f
                return
 
-       case archiveMagic:
+       case archiveMagic, aixbigafMagic:
                reader, err = arExportData(f)
                return
 
        default:
-               elfreader = f
+               objreader = f
        }
 
-       ef, err := elf.NewFile(elfreader)
-       if err != nil {
+       ef, err := elf.NewFile(objreader)
+       if err == nil {
+               sec := ef.Section(".go_export")
+               if sec == nil {
+                       err = fmt.Errorf("%s: .go_export section not found", fpath)
+                       return
+               }
+               reader = sec.Open()
                return
        }
 
-       sec := ef.Section(".go_export")
-       if sec == nil {
-               err = fmt.Errorf("%s: .go_export section not found", fpath)
+       xf, err := xcoff.NewFile(objreader)
+       if err == nil {
+               sdat := xf.CSect(".go_export")
+               if sdat == nil {
+                       err = fmt.Errorf("%s: .go_export section not found", fpath)
+                       return
+               }
+               reader = bytes.NewReader(sdat)
                return
        }
 
-       reader = sec.Open()
+       err = fmt.Errorf("%s: unrecognized file format", fpath)
        return
 }
 
@@ -195,7 +210,7 @@ func GetImporter(searchpaths []string, initmap map[*types.Package]InitData) Impo
                }
 
                switch magics {
-               case gccgov1Magic, gccgov2Magic:
+               case gccgov1Magic, gccgov2Magic, gccgov3Magic:
                        var p parser
                        p.init(fpath, reader, imports)
                        pkg = p.parsePackage()
index 15494fd6b38f617eb0798679fef73c7359ec0485..7a21c5f2f484654f08c7eb72ed71d2b9eaca7862 100644 (file)
@@ -11,7 +11,8 @@ import (
        "os"
        "os/exec"
        "path/filepath"
-       "runtime"
+       "regexp"
+       "strconv"
        "testing"
 )
 
@@ -53,9 +54,6 @@ func runImporterTest(t *testing.T, imp Importer, initmap map[*types.Package]Init
                // Check that the package's own init function has the package's priority
                for _, pkginit := range initdata.Inits {
                        if pkginit.InitFunc == test.wantinits[0] {
-                               if initdata.Priority != pkginit.Priority {
-                                       t.Errorf("%s: got self priority %d; want %d", test.pkgpath, pkginit.Priority, initdata.Priority)
-                               }
                                found = true
                                break
                        }
@@ -65,27 +63,11 @@ func runImporterTest(t *testing.T, imp Importer, initmap map[*types.Package]Init
                        t.Errorf("%s: could not find expected function %q", test.pkgpath, test.wantinits[0])
                }
 
-               // Each init function in the list other than the first one is a
-               // dependency of the function immediately before it. Check that
-               // the init functions appear in descending priority order.
-               priority := initdata.Priority
-               for _, wantdepinit := range test.wantinits[1:] {
-                       found = false
-                       for _, pkginit := range initdata.Inits {
-                               if pkginit.InitFunc == wantdepinit {
-                                       if priority <= pkginit.Priority {
-                                               t.Errorf("%s: got dep priority %d; want less than %d", test.pkgpath, pkginit.Priority, priority)
-                                       }
-                                       found = true
-                                       priority = pkginit.Priority
-                                       break
-                               }
-                       }
-
-                       if !found {
-                               t.Errorf("%s: could not find expected function %q", test.pkgpath, wantdepinit)
-                       }
-               }
+               // FIXME: the original version of this test was written against
+               // the v1 export data scheme for capturing init functions, so it
+               // verified the priority values. We moved away from the priority
+               // scheme some time ago; it is not clear how much work it would be
+               // to validate the new init export data.
        }
 }
 
@@ -100,17 +82,19 @@ var importerTests = [...]importerTest{
        {pkgpath: "time", name: "Nanosecond", want: "const Nanosecond Duration", wantval: "1"},
        {pkgpath: "unicode", name: "IsUpper", want: "func IsUpper(r rune) bool"},
        {pkgpath: "unicode", name: "MaxRune", want: "const MaxRune untyped rune", wantval: "1114111"},
-       {pkgpath: "imports", wantinits: []string{"imports..import", "fmt..import", "math..import"}},
+       {pkgpath: "imports", wantinits: []string{"imports..import", "fmt..import"}},
        {pkgpath: "importsar", name: "Hello", want: "var Hello string"},
        {pkgpath: "aliases", name: "A14", want: "type A14 = func(int, T0) chan T2"},
        {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}"},
+       {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) {
-       testenv.MustHaveGoBuild(t)
-
+       testenv.MustHaveExec(t) // this is to skip nacl, js
        initmap := make(map[*types.Package]InitData)
        imp := GetImporter([]string{"testdata"}, initmap)
 
@@ -119,15 +103,46 @@ func TestGoxImporter(t *testing.T) {
        }
 }
 
-func TestObjImporter(t *testing.T) {
-       testenv.MustHaveGoBuild(t)
+// gccgoPath returns a path to gccgo if it is present (either in
+// path or specified via GCCGO environment variable), or an
+// empty string if no gccgo is available.
+func gccgoPath() string {
+       gccgoname := os.Getenv("GCCGO")
+       if gccgoname == "" {
+               gccgoname = "gccgo"
+       }
+       if gpath, gerr := exec.LookPath(gccgoname); gerr == nil {
+               return gpath
+       }
+       return ""
+}
 
-       // This test relies on gccgo being around, which it most likely will be if we
-       // were compiled with gccgo.
-       if runtime.Compiler != "gccgo" {
+func TestObjImporter(t *testing.T) {
+       // This test relies on gccgo being around.
+       gpath := gccgoPath()
+       if gpath == "" {
                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)
@@ -143,11 +158,22 @@ 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" || test.pkgpath == "issue29198" {
+                       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
+               }
                ofile := filepath.Join(tmpdir, test.pkgpath+".o")
                afile := filepath.Join(artmpdir, "lib"+test.pkgpath+".a")
 
-               cmd := exec.Command("gccgo", "-fgo-pkgpath="+test.pkgpath, "-c", "-o", ofile, gofile)
+               cmd := exec.Command(gpath, "-fgo-pkgpath="+test.pkgpath, "-c", "-o", ofile, gofile)
                out, err := cmd.CombinedOutput()
                if err != nil {
                        t.Logf("%s", out)
index 9a94c3369e9432839cce3886453f12155c5a7621..d0081ad3b806c81cb4f4de3005530ab87ecb69b8 100644 (file)
@@ -15,10 +15,11 @@ import (
        "strconv"
        "strings"
        "text/scanner"
+       "unicode/utf8"
 )
 
 type parser struct {
-       scanner  scanner.Scanner
+       scanner  *scanner.Scanner
        version  string                    // format version
        tok      rune                      // current token
        lit      string                    // literal string; only valid for Ident, Int, String tokens
@@ -27,18 +28,45 @@ type parser struct {
        pkg      *types.Package            // reference to imported package
        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 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
+//   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)
+       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.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()
-       p.imports = imports
-       p.typeList = make([]types.Type, 1 /* type numbers start at 1 */, 16)
 }
 
 type importError struct {
@@ -71,6 +99,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 +131,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<<uint(ch)) == 0; ch = p.scanner.Peek() {
+       for ch := p.scanner.Peek(); ch != '\n' && ch != ';' && ch != scanner.EOF && p.scanner.Whitespace&(1<<uint(ch)) == 0; ch = p.scanner.Peek() {
                buf.WriteRune(ch)
                p.scanner.Next()
        }
@@ -268,6 +303,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()
@@ -387,17 +431,42 @@ var reserved = new(struct{ types.Type })
 
 // reserve reserves the type map entry n for future use.
 func (p *parser) reserve(n int) {
-       if n != len(p.typeList) {
-               p.errorf("invalid type number %d (out of sync)", n)
+       // Notes:
+       // - for pre-V3 export data, the type numbers we see are
+       //   guaranteed to be in increasing order, so we append a
+       //   reserved entry onto the list.
+       // - for V3+ export data, type numbers can appear in
+       //   any order, however the 'types' section tells us the
+       //   total number of types, hence typeList is pre-allocated.
+       if len(p.typeData) == 0 {
+               if n != len(p.typeList) {
+                       p.errorf("invalid type number %d (out of sync)", n)
+               }
+               p.typeList = append(p.typeList, reserved)
+       } else {
+               if p.typeList[n] != nil {
+                       p.errorf("previously visited type number %d", n)
+               }
+               p.typeList[n] = reserved
        }
-       p.typeList = append(p.typeList, reserved)
 }
 
 // update sets the type map entries for the given type numbers nlist to t.
 func (p *parser) update(t types.Type, nlist []int) {
+       if len(nlist) != 0 {
+               if t == reserved {
+                       p.errorf("internal error: update(%v) invoked on reserved", nlist)
+               }
+               if t == nil {
+                       p.errorf("internal error: update(%v) invoked on nil", nlist)
+               }
+       }
        for _, n := range nlist {
+               if p.typeList[n] == t {
+                       continue
+               }
                if p.typeList[n] != reserved {
-                       p.errorf("typeMap[%d] not reserved", n)
+                       p.errorf("internal error: update(%v): %d not reserved", nlist, n)
                }
                p.typeList[n] = t
        }
@@ -405,7 +474,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()
@@ -456,22 +525,39 @@ func (p *parser) parseNamedType(nlist []int) types.Type {
 
        underlying := p.parseType(pkg)
        if nt.Underlying() == nil {
-               nt.SetUnderlying(underlying.Underlying())
-       }
-
-       // collect associated methods
-       for p.tok == scanner.Ident {
-               p.expectKeyword("func")
-               p.expect('(')
-               receiver, _ := p.parseParam(pkg)
-               p.expect(')')
-               name := p.parseName()
-               params, isVariadic := p.parseParamList(pkg)
-               results := p.parseResultList(pkg)
-               p.expect(';')
+               if underlying.Underlying() == nil {
+                       fix := fixupRecord{toUpdate: nt, target: underlying}
+                       p.fixups = append(p.fixups, fix)
+               } else {
+                       nt.SetUnderlying(underlying.Underlying())
+               }
+       }
 
-               sig := types.NewSignature(receiver, params, results, isVariadic)
-               nt.AddMethod(types.NewFunc(token.NoPos, pkg, name, sig))
+       if p.tok == '\n' {
+               p.next()
+               // 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(')')
+                       name := p.parseName()
+                       params, isVariadic := p.parseParamList(pkg)
+                       results := p.parseResultList(pkg)
+                       p.skipInlineBody()
+                       p.expectEOL()
+
+                       sig := types.NewSignature(receiver, params, results, isVariadic)
+                       nt.AddMethod(types.NewFunc(token.NoPos, pkg, name, sig))
+               }
        }
 
        return nt
@@ -612,7 +698,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)
@@ -635,7 +725,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, '$') {
@@ -644,7 +734,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) ";" } "}" .
@@ -782,17 +874,25 @@ 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 {
        case scanner.Int:
                n1 := p.parseInt()
                if p.tok == '>' {
+                       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 +908,124 @@ 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
 }
 
+// InlineBody = "<inl:NN>" .{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()
+       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
+       }
+
+       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.
+
+       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 +1041,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 +1060,7 @@ func (p *parser) maybeCreatePackage() {
        }
 }
 
-// InitDataDirective = ( "v1" | "v2" ) ";" |
+// InitDataDirective = ( "v1" | "v2" | "v3" ) ";" |
 //                     "priority" int ";" |
 //                     "init" { PackageInit } ";" |
 //                     "checksum" unquotedString ";" .
@@ -859,31 +1071,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 +1106,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 +1118,7 @@ func (p *parser) parseInitDataDirective() {
 //             "pkgpath" unquotedString ";" |
 //             "prefix" unquotedString ";" |
 //             "import" unquotedString unquotedString string ";" |
+//             "indirectimport" unquotedString unquotedstring ";" |
 //             "func" Func ";" |
 //             "type" Type ";" |
 //             "var" Var ";" |
@@ -916,29 +1130,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 +1160,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 +1180,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)
@@ -983,6 +1209,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()
index 4a103dc462af8e830b971bff75caa4b0d8359a7c..00128b44d2687e9369843e45685b02c0031a7a12 100644 (file)
@@ -19,7 +19,7 @@ var typeParserTests = []struct {
        {id: "foo", typ: "<type 1 *<type -19>>", want: "*error"},
        {id: "foo", typ: "<type 1 *any>", want: "unsafe.Pointer"},
        {id: "foo", typ: "<type 1 \"Bar\" <type 2 *<type 1>>>", want: "foo.Bar", underlying: "*foo.Bar"},
-       {id: "foo", typ: "<type 1 \"bar.Foo\" \"bar\" <type -1> func (? <type 1>) M (); >", want: "bar.Foo", underlying: "int8", methods: "func (bar.Foo).M()"},
+       {id: "foo", typ: "<type 1 \"bar.Foo\" \"bar\" <type -1>\nfunc (? <type 1>) M ();\n>", want: "bar.Foo", underlying: "int8", methods: "func (bar.Foo).M()"},
        {id: "foo", typ: "<type 1 \".bar.foo\" \"bar\" <type -1>>", want: "bar.foo", underlying: "int8"},
        {id: "foo", typ: "<type 1 []<type -1>>", want: "[]int8"},
        {id: "foo", typ: "<type 1 [42]<type -1>>", 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()
diff --git a/src/go/internal/gccgoimporter/testdata/issue29198.go b/src/go/internal/gccgoimporter/testdata/issue29198.go
new file mode 100644 (file)
index 0000000..75c2162
--- /dev/null
@@ -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 (file)
index 0000000..905c866
--- /dev/null
@@ -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 <type 1 "A" <type 2 struct { .issue29198.x <type -11>; }>
+ func (a <esc:0x1> <type 3 *<type 1>>) AMethod (y <type -11>) <type 4 *<type 5 "Server" <type 6 struct { FooServer <type 7 *<type 8 "FooServer" <type 5>
+ func (f <esc:0x1> <type 9 *<type 8>>) WriteEvents (ctx <esc:0x1> <type 10 "context.Context" <type 11 interface { Deadline () (deadline <type 12 "time.Time" "time" <type 13 struct { .time.wall <type -8>; .time.ext <type -4>; .time.loc <type 14 *<type 15 "time.Location" <type 16 struct { .time.name <type -16>; .time.zone <type 17 [] <type 18 ".time.zone" <type 19 struct { .time.name <type -16>; .time.offset <type -11>; .time.isDST <type -15>; }>>>; .time.tx <type 20 [] <type 21 ".time.zoneTrans" <type 22 struct { .time.when <type -4>; .time.index <type -5>; .time.isstd <type -15>; .time.isutc <type -15>; }>>>; .time.cacheStart <type -4>; .time.cacheEnd <type -4>; .time.cacheZone <type 23 *<type 18>>; }>
+ func (l <esc:0x22> <type 24 *<type 15>>) String () <type -16>;
+ func (l <esc:0x1> <type 24>) .time.lookupFirstZone () <type -11>;
+ func (l <esc:0x12> <type 24>) .time.get () <type 24>;
+ func (l <esc:0x32> <type 24>) .time.lookup (sec <type -4>) (name <type -16>, offset <type -11>, isDST <type -15>, start <type -4>, end <type -4>);
+ func (l <esc:0x1> <type 24>) .time.lookupName (name <esc:0x1> <type -16>, unix <type -4>) (offset <type -11>, ok <type -15>);
+ func (l <esc:0x1> <type 24>) .time.firstZoneUsed () <type -15>;
+>>; }>
+ func (t <esc:0x12> <type 12>) In (loc <type 14>) <type 12>;
+ func (t <esc:0x1> <type 12>) .time.date (full <type -15>) (year <type -11>, month <type 25 "time.Month" <type -11>
+ func (m <type 25>) String () <type -16>;
+>, day <type -11>, yday <type -11>);
+ func (t <esc:0x1> <type 12>) Sub (u <esc:0x1> <type 12>) <type 26 "time.Duration" <type -4>
+ func (d <type 26>) Truncate (m <type 26>) <type 26>;
+ func (d <type 26>) String () <type -16>;
+ func (d <type 26>) Round (m <type 26>) <type 26>;
+ func (d <type 26>) Seconds () <type -10>;
+ func (d <type 26>) Nanoseconds () <type -4>;
+ func (d <type 26>) Minutes () <type -10>;
+ func (d <type 26>) Hours () <type -10>;
+>;
+ func (t <esc:0x12> <type 12>) Add (d <type 26>) <type 12>;
+ func (t <esc:0x12> <type 12>) UTC () <type 12>;
+ func (t <type 12>) AddDate (years <type -11>, months <type -11>, days <type -11>) <type 12>;
+ func (t <esc:0x1> <type 12>) MarshalBinary () (? <type 27 [] <type -20>>, ? <type -19>);
+ func (t <esc:0x1> <type 12>) Nanosecond () <type -11>;
+ func (t <esc:0x12> <type 12>) Round (d <type 26>) <type 12>;
+ func (t <esc:0x1> <type 12>) Minute () <type -11>;
+ func (t <esc:0x1> <type 12>) Clock () (hour <type -11>, min <type -11>, sec <type -11>);
+ func (t <esc:0x1> <type 12>) ISOWeek () (year <type -11>, week <type -11>);
+ func (t <esc:0x1> <type 12>) Day () <type -11>;
+ func (t <esc:0x1> <type 28 *<type 12>>) .time.mono () <type -4>;
+ func (t <esc:0x1> <type 12>) UnixNano () <type -4>;
+ func (t <esc:0x1> <type 28>) .time.sec () <type -4>;
+ func (t <esc:0x1> <type 12>) Second () <type -11>;
+ func (t <esc:0x1> <type 12>) Before (u <esc:0x1> <type 12>) <type -15>;
+ func (t <esc:0x1> <type 28>) UnmarshalBinary (data <esc:0x1> <type 29 [] <type -20>>) <type -19>;
+ func (t <esc:0x1> <type 12>) Month () <type 25>;
+ func (t <esc:0x1> <type 12>) YearDay () <type -11>;
+ func (t <esc:0x12> <type 12>) Location () <type 14>;
+ func (t <esc:0x32> <type 12>) Zone () (name <type -16>, offset <type -11>);
+ func (t <esc:0x12> <type 12>) Local () <type 12>;
+ func (t <esc:0x1> <type 28>) .time.setLoc (loc <type 14>);
+ func (t <esc:0x12> <type 12>) Truncate (d <type 26>) <type 12>;
+ func (t <esc:0x1> <type 12>) MarshalJSON () (? <type 30 [] <type -20>>, ? <type -19>);
+ func (t <esc:0x1> <type 12>) AppendFormat (b <esc:0x12> <type 31 [] <type -20>>, layout <esc:0x1> <type -16>) <type 32 [] <type -20>>;
+ func (t <esc:0x1> <type 28>) GobDecode (data <esc:0x1> <type 33 [] <type -20>>) <type -19>;
+ func (t <esc:0x1> <type 28>) UnmarshalJSON (data <esc:0x1> <type 34 [] <type -20>>) <type -19>;
+ func (t <esc:0x1> <type 12>) MarshalText () (? <type 35 [] <type -20>>, ? <type -19>);
+ func (t <esc:0x1> <type 12>) GobEncode () (? <type 36 [] <type -20>>, ? <type -19>);
+ func (t <esc:0x1> <type 28>) .time.stripMono ();
+ func (t <esc:0x1> <type 12>) After (u <esc:0x1> <type 12>) <type -15>;
+ func (t <esc:0x1> <type 12>) Hour () <type -11>;
+ func (t <esc:0x1> <type 28>) UnmarshalText (data <esc:0x1> <type 37 [] <type -20>>) <type -19>;
+ func (t <esc:0x1> <type 12>) Equal (u <esc:0x1> <type 12>) <type -15>;
+ func (t <esc:0x1> <type 28>) .time.setMono (m <type -4>);
+ func (t <esc:0x1> <type 12>) Year () <type -11>;
+ func (t <esc:0x1> <type 12>) IsZero () <type -15>;
+ func (t <esc:0x1> <type 28>) .time.addSec (d <type -4>);
+ func (t <esc:0x1> <type 12>) Weekday () <type 38 "time.Weekday" <type -11>
+ func (d <type 38>) String () <type -16>;
+>;
+ func (t <esc:0x1> <type 12>) String () <type -16>;
+ func (t <esc:0x1> <type 28>) .time.nsec () <type -3>;
+ func (t <esc:0x1> <type 12>) Format (layout <esc:0x1> <type -16>) <type -16>;
+ func (t <esc:0x1> <type 28>) .time.unixSec () <type -4>;
+ func (t <esc:0x1> <type 12>) Unix () <type -4>;
+ func (t <esc:0x1> <type 12>) .time.abs () <type -8>;
+ func (t <esc:0x32> <type 12>) .time.locabs () (name <type -16>, offset <type -11>, abs <type -8>);
+ func (t <esc:0x1> <type 12>) Date () (year <type -11>, month <type 25>, day <type -11>);
+>, ok <type -15>); Done () <type 39 chan <- <type 40 struct { }>>; Err () <type -19>; Value (key <type 41 interface { }>) <type 42 interface { }>; }>>, x <type -11>) <type -19>;
+>>; .issue29198.user <type -16>; .issue29198.ctx <type 10>; }>>>;
+>;
+type <type 8>;
+func New (sctx <type 10>, u <type -16>) (? <type 43 *<type 5>>, ? <type -19>);
+type <type 5>;
+checksum 86C8D76B2582F55A8BD2CA9E00060358EC1CE214;
diff --git a/src/go/internal/gccgoimporter/testdata/nointerface.go b/src/go/internal/gccgoimporter/testdata/nointerface.go
new file mode 100644 (file)
index 0000000..6a545f2
--- /dev/null
@@ -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 (file)
index 0000000..7b73d17
--- /dev/null
@@ -0,0 +1,8 @@
+v3;
+package nointerface
+pkgpath nointerface
+types 3 2 133 17
+type 1 "I" <type -11>
+ func /*nointerface*/ (p <esc:0x1> <type 2>) Get () <type -11>
+ func (p <esc:0x1> <type 2>) Set (v <type -11>)
+type 2 *<type 1>
diff --git a/src/go/internal/gccgoimporter/testdata/v1reflect.gox b/src/go/internal/gccgoimporter/testdata/v1reflect.gox
new file mode 100644 (file)
index 0000000..ea46841
Binary files /dev/null and b/src/go/internal/gccgoimporter/testdata/v1reflect.gox differ
index d117f6fe4d3f4b91ddbd6a59c2083636b24acce0..3aed6de6ae0b33624cc2c1a528059171e0bdb031 100644 (file)
@@ -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.
index 222b36c883688e8cacfb0d0b8d1d36f6913ee919..3b7636806e7e5a8ad8f06ee83b9d24000abf2796 100644 (file)
@@ -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)
        }
index b9caa90fc5888f3e342cadacb4e64378bc1697f2..b84672610c6f8be8875062192fcb11b8d64c505e 100644 (file)
@@ -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) {
index a307d8395e9d94400a367519049b1843a1cc9e7e..0f2029cadaa7d136def1a4407ba9c73e5a082586 100644 (file)
@@ -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)
@@ -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 {
index 27d46df6b186bcc6e313ea980573b20fc35d5f5a..91eca585c09563cfc4657c81a4081d7ae1e9798a 100644 (file)
@@ -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)
+       }
+}
index 52f1ac31ce1db19090ab61edc9ffc977aa38b054..1abc1d8a5e47d68237b3dddcb8f6302cd9b98388 100644 (file)
@@ -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) {
@@ -374,11 +375,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 +395,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
                }
 
index 91df94dcbc0dba96894c4e942a13828fe23deb50..b48d09de22a070b3f9e638139653b2915fc486b6 100644 (file)
@@ -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
 
index 4c8d8537ee6a6e2989d6716e45117077814f203a..68c96c037eacf6f3cf22344df9e2dbef3221746d 100644 (file)
@@ -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 ""
 }
index cde373f3556c775d443d82c42a2fe8c0af32f339..19dd702c451929a36681d7577f806f1a139a2240 100644 (file)
@@ -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),
        }
 
index 57dc1bccdcc5877d3403e0dc640c17c70fbd3155..e0ef83adcc507ddc56b1c1aa01569ceb264fb79a 100644 (file)
@@ -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
index cf489b1c9a48edd28eca58247aaa9841d254e985..c9f54139206147b75ecae033282e3c03db20150b 100644 (file)
@@ -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)
+       }
+}
index 8260f58519d012c5cafde1c4181adbdae73141ea..d02030110935ec4f79fd50f2451c1c8b50f518f1 100644 (file)
@@ -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\) */ ()
+}
index 7662315d43cf8fc4dee0f6600f0f2b17e110f98c..0fce177cb33798685006bc165387e43bd40ec680 100644 (file)
@@ -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)<<prime128Shift
-               s0h := (s[0]>>32)*prime128Lower + (s[1]>>32)<<prime128Shift
-               // Carries
-               s1h += s1l >> 32
-               s0l += s1h >> 32
-               s0h += s0l >> 32
+               // Compute the multiplication
+               s0, s1 := bits.Mul64(prime128Lower, s[1])
+               s0 += s[1]<<prime128Shift + prime128Lower*s[0]
                // Update the values
-               s[1] = (s1l & 0xffffffff) + (s1h << 32)
-               s[0] = (s0l & 0xffffffff) + (s0h << 32)
+               s[1] = s1
+               s[0] = s0
                s[1] ^= uint64(c)
        }
        return len(data), nil
@@ -157,18 +152,12 @@ func (s *sum128) Write(data []byte) (int, error) {
 func (s *sum128a) Write(data []byte) (int, error) {
        for _, c := range data {
                s[1] ^= uint64(c)
-               // 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)<<prime128Shift
-               s0h := (s[0]>>32)*prime128Lower + (s[1]>>32)<<prime128Shift
-               // Carries
-               s1h += s1l >> 32
-               s0l += s1h >> 32
-               s0h += s0l >> 32
+               // Compute the multiplication
+               s0, s1 := bits.Mul64(prime128Lower, s[1])
+               s0 += s[1]<<prime128Shift + prime128Lower*s[0]
                // Update the values
-               s[1] = (s1l & 0xffffffff) + (s1h << 32)
-               s[0] = (s0l & 0xffffffff) + (s0h << 32)
+               s[1] = s1
+               s[0] = s0
        }
        return len(data), nil
 }
index 98e821b73c8f2f8319694eb5041c08cb80814db6..872f6786b3555a634ea4542a4aaf901a8ef0845e 100644 (file)
@@ -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",
index 12a850d6e3bfe6df8dd3b1887fd3b42785077bf1..05fa105be02c705bb4d655209c8155412e6ef264 100644 (file)
@@ -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 {
index e210a6db9ec0bda6f113fb697dacf3771e829207..eb74a9fa82a59793995cceb5c81d1805658aa361 100644 (file)
@@ -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
 
@@ -125,18 +126,20 @@ type s390x struct {
        HasSHA256       bool // K{I,L}MD-SHA-256 functions
        HasSHA512       bool // K{I,L}MD-SHA-512 functions
        HasVX           bool // vector facility. Note: the runtime sets this when it processes auxv records.
+       HasVE1          bool // vector-enhancement 1
        _               CacheLinePad
 }
 
 // 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 +149,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 +170,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 +187,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 +207,7 @@ field:
                        }
                }
 
-               print("GODEBUGCPU: unknown cpu feature \"", key, "\"\n")
+               print("GODEBUG: unknown cpu feature \"", key, "\"\n")
        }
 
        for _, o := range options {
@@ -210,12 +216,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
                }
 
index eab77e6ee544177559de4c5e38794096b1b6d9d8..4d63ef60d101f02d6fbd33d97747d944020064bf 100644 (file)
@@ -71,6 +71,9 @@ const (
        msa5 facility = 57  // message-security-assist extension 5
        msa8 facility = 146 // message-security-assist extension 8
 
+       // vector facilities
+       ve1 facility = 135 // vector-enhancements 1
+
        // Note: vx and highgprs are excluded because they require
        // kernel support and so must be fetched from HWCAP.
 )
@@ -115,6 +118,7 @@ func doinit() {
                {Name: "dfp", Feature: &S390X.HasDFP},
                {Name: "etf3eh", Feature: &S390X.HasETF3Enhanced},
                {Name: "vx", Feature: &S390X.HasVX},
+               {Name: "ve1", Feature: &S390X.HasVE1},
        }
 
        aes := []function{aes128, aes192, aes256}
@@ -150,4 +154,7 @@ func doinit() {
                S390X.HasSHA512 = kimd.Has(sha512) && klmd.Has(sha512)
                S390X.HasGHASH = kimd.Has(ghash) // KLMD-GHASH does not exist
        }
+       if S390X.HasVX {
+               S390X.HasVE1 = facilities.Has(ve1)
+       }
 }
index b01e212ce8b5c9e4067d199222eec1160ec7c9bc..e09bd2d8b99f705d404d70567bb470dd88cef953 100644 (file)
@@ -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 {
index a79be41811f462600fc8ee0ec8903b881fb7b1f9..9e93d1af5d72c6776bb980f19f0aac927a00043f 100644 (file)
@@ -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
index b9da9a53014f4075aee01077fcd60c2561572c17..9d846d8c49ac145c004f35baf191fc161c015c43 100644 (file)
@@ -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.
index 098e77d893f4b82ab50dc774ddcae2437431e1a5..3530e59a15f88d1452c73bba2729d8a91e44cd1f 100644 (file)
@@ -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/internal/poll/fd_opendir_ios.go b/src/internal/poll/fd_opendir_ios.go
new file mode 100644 (file)
index 0000000..e646bd9
--- /dev/null
@@ -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)
similarity index 99%
rename from src/internal/traceparser/gc.go
rename to src/internal/trace/gc.go
index a5b29112b35dcd90c800a3ee74fc2135449a0460..cc19fdf8912d298a0ba8d0b8e8322d74956b5bc4 100644 (file)
@@ -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
similarity index 89%
rename from src/internal/traceparser/gc_test.go
rename to src/internal/trace/gc_test.go
index 0b07f735f826e43f8ff1feec149e4c214bc365be..da1cb90f5cdf3a35ec6d6bfabbec972d84f735f4 100644 (file)
@@ -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++ {
similarity index 99%
rename from src/internal/traceparser/mud.go
rename to src/internal/trace/mud.go
index 8eed89ff3631965da7ab261eae700ee2174df09e..88263060a0b1dadcb71456801185a1c5a0ca356e 100644 (file)
@@ -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"
similarity index 99%
rename from src/internal/traceparser/mud_test.go
rename to src/internal/trace/mud_test.go
index 6e048fcf19c659d38b3572d89e813f2d2c766204..b3d74dcf342e5b5e62500e14013107f2ee19fd43 100644 (file)
@@ -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 (file)
index 70fbd04..0000000
+++ /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 (file)
index 00451f3..0000000
+++ /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 (file)
index 4671eda..0000000
+++ /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 (executable)
index 32d5a92..0000000
+++ /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. (<unchanged>, 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 (executable)
index 7a73571..0000000
+++ /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 (file)
index 736cbf5..0000000
+++ /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 (file)
index 666ee94..0000000
+++ /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 (file)
index 5fe22f4..0000000
+++ /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 (file)
index 68cc69e..0000000
+++ /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 (file)
index e36a951..0000000
+++ /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 (file)
index 91748c5..0000000
+++ /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 "<nil>"
-       }
-       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 (file)
index 6e9e23e..0000000
Binary files a/src/internal/traceparser/testdata/06dfecf6e5dfb78e954e7892120b56bfca50af65-6.bad and /dev/null differ
diff --git a/src/internal/traceparser/testdata/0e6dd1787a6339366dac733a2f957a05d7aa3ac7-3.bad b/src/internal/traceparser/testdata/0e6dd1787a6339366dac733a2f957a05d7aa3ac7-3.bad
deleted file mode 100644 (file)
index 7b723f8..0000000
Binary files a/src/internal/traceparser/testdata/0e6dd1787a6339366dac733a2f957a05d7aa3ac7-3.bad and /dev/null differ
diff --git a/src/internal/traceparser/testdata/16970d24ef6753d71953e20d10638705bdccc3ba-2.weird b/src/internal/traceparser/testdata/16970d24ef6753d71953e20d10638705bdccc3ba-2.weird
deleted file mode 100644 (file)
index 6b4b06c..0000000
Binary files a/src/internal/traceparser/testdata/16970d24ef6753d71953e20d10638705bdccc3ba-2.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/26492441b33e1bb93669f79cf3584755cc3ef7e8-2.weird b/src/internal/traceparser/testdata/26492441b33e1bb93669f79cf3584755cc3ef7e8-2.weird
deleted file mode 100644 (file)
index 565a8b2..0000000
Binary files a/src/internal/traceparser/testdata/26492441b33e1bb93669f79cf3584755cc3ef7e8-2.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/2ccf452e473ded814ea880c602488637fc27e549.good b/src/internal/traceparser/testdata/2ccf452e473ded814ea880c602488637fc27e549.good
deleted file mode 100644 (file)
index 9d101f8..0000000
Binary files a/src/internal/traceparser/testdata/2ccf452e473ded814ea880c602488637fc27e549.good and /dev/null differ
diff --git a/src/internal/traceparser/testdata/34f92cd2ae08f558c494b2ef79e80b574c9f096c-8.weird b/src/internal/traceparser/testdata/34f92cd2ae08f558c494b2ef79e80b574c9f096c-8.weird
deleted file mode 100644 (file)
index d6e9cd6..0000000
Binary files a/src/internal/traceparser/testdata/34f92cd2ae08f558c494b2ef79e80b574c9f096c-8.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/4557f81f6aae617eeec8dd920997ea27b3dda12b.weird b/src/internal/traceparser/testdata/4557f81f6aae617eeec8dd920997ea27b3dda12b.weird
deleted file mode 100644 (file)
index ae93a0e..0000000
Binary files a/src/internal/traceparser/testdata/4557f81f6aae617eeec8dd920997ea27b3dda12b.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/495712b6e35ad7566869c887aa823fcbf69c0b80-1.weird b/src/internal/traceparser/testdata/495712b6e35ad7566869c887aa823fcbf69c0b80-1.weird
deleted file mode 100644 (file)
index 072bc93..0000000
Binary files a/src/internal/traceparser/testdata/495712b6e35ad7566869c887aa823fcbf69c0b80-1.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/63cd688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad b/src/internal/traceparser/testdata/63cd688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad
deleted file mode 100644 (file)
index 5506aa0..0000000
Binary files a/src/internal/traceparser/testdata/63cd688ddff425bbbc220fbb7bd4fa11616a8b64-1.bad and /dev/null differ
diff --git a/src/internal/traceparser/testdata/63df44bfc9d27851fb054ce03002e7e25f307e2f-5.weird b/src/internal/traceparser/testdata/63df44bfc9d27851fb054ce03002e7e25f307e2f-5.weird
deleted file mode 100644 (file)
index 74ea28c..0000000
Binary files a/src/internal/traceparser/testdata/63df44bfc9d27851fb054ce03002e7e25f307e2f-5.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/6aa1a69b265c3092972a2a81e77fbcaa87061735-4.bad b/src/internal/traceparser/testdata/6aa1a69b265c3092972a2a81e77fbcaa87061735-4.bad
deleted file mode 100644 (file)
index af03079..0000000
Binary files a/src/internal/traceparser/testdata/6aa1a69b265c3092972a2a81e77fbcaa87061735-4.bad and /dev/null differ
diff --git a/src/internal/traceparser/testdata/7b82e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad b/src/internal/traceparser/testdata/7b82e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad
deleted file mode 100644 (file)
index 5353946..0000000
Binary files a/src/internal/traceparser/testdata/7b82e808a6a3471352a4197d44fedbe3f5fb6f77-1.bad and /dev/null differ
diff --git a/src/internal/traceparser/testdata/94347dc6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird b/src/internal/traceparser/testdata/94347dc6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird
deleted file mode 100644 (file)
index 3141a88..0000000
Binary files a/src/internal/traceparser/testdata/94347dc6ca9c22daec04c5f2530b16ea60bb0ba2-7.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/9fa93c88557e64b0714b8849aacf713d17ff928e-2.weird b/src/internal/traceparser/testdata/9fa93c88557e64b0714b8849aacf713d17ff928e-2.weird
deleted file mode 100644 (file)
index c33f6ca..0000000
Binary files a/src/internal/traceparser/testdata/9fa93c88557e64b0714b8849aacf713d17ff928e-2.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/abf7185aaf1cb69fb5fae50ba8546a7cdefade57-2.weird b/src/internal/traceparser/testdata/abf7185aaf1cb69fb5fae50ba8546a7cdefade57-2.weird
deleted file mode 100644 (file)
index 2580a59..0000000
Binary files a/src/internal/traceparser/testdata/abf7185aaf1cb69fb5fae50ba8546a7cdefade57-2.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/d28fcef078c7dc722867d781b1fd7f37ca965372-7.weird b/src/internal/traceparser/testdata/d28fcef078c7dc722867d781b1fd7f37ca965372-7.weird
deleted file mode 100644 (file)
index 7d724ca..0000000
Binary files a/src/internal/traceparser/testdata/d28fcef078c7dc722867d781b1fd7f37ca965372-7.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/d70f178a3813df03f2aed0d47f6d9bc844b8cb57-4.weird b/src/internal/traceparser/testdata/d70f178a3813df03f2aed0d47f6d9bc844b8cb57-4.weird
deleted file mode 100644 (file)
index 9976163..0000000
Binary files a/src/internal/traceparser/testdata/d70f178a3813df03f2aed0d47f6d9bc844b8cb57-4.weird and /dev/null differ
diff --git a/src/internal/traceparser/testdata/e68c3126700dda2c2ac3b8743e9f319cb313042a-1.weird b/src/internal/traceparser/testdata/e68c3126700dda2c2ac3b8743e9f319cb313042a-1.weird
deleted file mode 100644 (file)
index 49ac545..0000000
Binary files a/src/internal/traceparser/testdata/e68c3126700dda2c2ac3b8743e9f319cb313042a-1.weird and /dev/null differ
diff --git a/src/internal/traceparser/tr.go b/src/internal/traceparser/tr.go
deleted file mode 100644 (file)
index 770f280..0000000
+++ /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, "<buf>")
-       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 (file)
index 498bed7..0000000
+++ /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
-}
similarity index 97%
rename from src/vendor/golang_org/x/crypto/chacha20poly1305/chacha20poly1305.go
rename to src/internal/x/crypto/chacha20poly1305/chacha20poly1305.go
index e28f49d12fcbecef1794d64b5dca282d11a704b2..80789a12122932914608fa458c798af91a3c0dab 100644 (file)
@@ -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"
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 56e4f0e782a747cf9c34fcd8db5215bdb9514a31..a77ab35f676d27a7d3611761f3cb91fb285dbc1c 100644 (file)
@@ -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 {
similarity index 99%
rename from src/vendor/golang_org/x/crypto/cryptobyte/asn1.go
rename to src/internal/x/crypto/cryptobyte/asn1.go
index 08314b47d1c56cb6956dd8a1fc478b893933a745..2d40680ddd3b7f0e3f0885275fb4afee898dbfab 100644 (file)
@@ -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.
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 cda8e3edfd5ea4322c93d3b92c06ab771b82bef4..90ef6a241de2f5b95521975032b35450eb187ca7 100644 (file)
@@ -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).
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 f7762880ca84b8338abc50a2dccf3518ec03c1a2..ca28e3bcfb2565b3c67461265964fe809e88853e 100644 (file)
@@ -12,7 +12,7 @@ import (
        "testing"
        "time"
 
-       "golang_org/x/crypto/cryptobyte/asn1"
+       "internal/x/crypto/cryptobyte/asn1"
 )
 
 type readASN1Test struct {
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 056c23014a14f30ff53e6dab573c5da5c786c4c0..5b50025318f5bb3ffe9eba2c02981fbe82fe6d75 100644 (file)
@@ -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() {
similarity index 98%
rename from src/vendor/golang_org/x/crypto/cryptobyte/string.go
rename to src/internal/x/crypto/cryptobyte/string.go
index 39bf98aeead8160094c007d8edb4066b5720283c..bd2ed2e207c6e0c9f898063ba5351aa2ae2c26f4 100644 (file)
@@ -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.
similarity index 94%
rename from src/vendor/golang_org/x/crypto/curve25519/doc.go
rename to src/internal/x/crypto/curve25519/doc.go
index da9b10d9c1ffd204d7d4ccd683b196c6b5fb5e67..076a8d4f10aa3bed478fdb29a2ae2b098531c77d 100644 (file)
@@ -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}
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 1fd140a324dc7aafdbee304e10a7f5c053777eca..3b68a408103b97f89d6041dcbf14f39c3d3ab7f7 100644 (file)
@@ -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
similarity index 98%
rename from src/vendor/golang_org/x/crypto/hkdf/hkdf.go
rename to src/internal/x/crypto/hkdf/hkdf.go
index dda3f143bec506c81852b3f9e19dd7ffbf4c92cf..c9077658e64b785f3110d27284c520a2ec4caaae 100644 (file)
@@ -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"
similarity index 95%
rename from src/vendor/golang_org/x/crypto/poly1305/poly1305.go
rename to src/internal/x/crypto/poly1305/poly1305.go
index f562fa5712ba09a1bed13121c08a98b502ab328f..6d6be9a6406a2e6dbeaf38f7fa771c7298f6dfab 100644 (file)
@@ -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/internal/x/fiximports.bash b/src/internal/x/fiximports.bash
new file mode 100755 (executable)
index 0000000..ec72643
--- /dev/null
@@ -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')
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 a1bb5b7b1b88e6bd9a1ed073f233a3e02f139255..8453c230483cb45120391464aec9cf5ce92c0e5b 100644 (file)
@@ -9,7 +9,7 @@ import (
        "net"
        "strings"
 
-       "golang_org/x/net/dns/dnsmessage"
+       "internal/x/net/dns/dnsmessage"
 )
 
 func mustNewName(name string) dnsmessage.Name {
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 9337435174e677336726aa5f81160bd2ef4fb7fb..7f3cdd8bd255c100d73e7601f1a01834059a162c 100644 (file)
@@ -9,7 +9,7 @@ import (
        "strings"
        "unicode/utf8"
 
-       "golang_org/x/net/idna"
+       "internal/x/net/idna"
 )
 
 var isTokenTable = [127]bool{
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 0409f4340c373a6594341f50e83d03b767c2644d..d3947841392e6cc06c1ccc089312fb2f0b10719e 100644 (file)
@@ -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
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 8791f64bcdc2ce5462b914796e91ea9fdde608b6..cf0589dba97eca4d1e04d0a069d7d51b2bbc8320 100644 (file)
@@ -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.
similarity index 97%
rename from src/vendor/golang_org/x/net/http2/hpack/hpack.go
rename to src/internal/x/net/http2/hpack/hpack.go
index 166788ceec5e84f0c1dd5245f9bb042e40d88dad..85f18a2b0a8616295fdb1e69c9df352bf944e436 100644 (file)
@@ -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")}
        }
 
similarity index 98%
rename from src/vendor/golang_org/x/net/http2/hpack/hpack_test.go
rename to src/internal/x/net/http2/hpack/hpack_test.go
index 3f2227442a985319e1f7eeceb9ba4fe7687da148..a361a2a7c2ece1b537d0018002e8e32685b133be 100644 (file)
@@ -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")
        }
similarity index 99%
rename from src/vendor/golang_org/x/net/idna/idna.go
rename to src/internal/x/net/idna/idna.go
index 9fd0334cd9df0b7c14798f1c07382a2a151d1ae3..7f2471e70e7aad0d2f21e3dad6fa6da1d035260c 100644 (file)
 // 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
similarity index 99%
rename from src/vendor/golang_org/x/net/idna/tables.go
rename to src/internal/x/net/idna/tables.go
index a470c5a3e2588d9416a352c52ed04237543e915e..41cf9c13d2a5b3b2869fff6ee4e9be2319036833 100644 (file)
@@ -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
 
similarity index 97%
rename from src/vendor/golang_org/x/net/idna/trieval.go
rename to src/internal/x/net/idna/trieval.go
index 5f4e5f2e7457e323aaedd8508709755d149ebd81..bf57260034946e6f2dbd1796e3ec48f8d624f283 100644 (file)
@@ -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
 
similarity index 91%
rename from src/vendor/golang_org/x/net/internal/nettest/helper_nobsd.go
rename to src/internal/x/net/internal/nettest/helper_nobsd.go
index bc7da5e0d574a96a8d5fc7f7dd7f836f1a817ef2..1611a907f00bb89d4fd1ae33f17241162d6dd385 100644 (file)
@@ -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
 
similarity index 88%
rename from src/vendor/golang_org/x/net/internal/nettest/helper_posix.go
rename to src/internal/x/net/internal/nettest/helper_posix.go
index 963ed99655babede13a89b54134a1d1810a3a85f..efc67a8eba97566b7a057b1e15b1160c989734d7 100644 (file)
@@ -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
 
similarity index 95%
rename from src/vendor/golang_org/x/net/internal/nettest/helper_stub.go
rename to src/internal/x/net/internal/nettest/helper_stub.go
index d729156de67fdf4cc7d25c311bee620e8ddb6a68..d89cf2996290318b0c1b3d70dbb060a75eb5b1b5 100644 (file)
@@ -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
 
similarity index 89%
rename from src/vendor/golang_org/x/net/internal/nettest/helper_unix.go
rename to src/internal/x/net/internal/nettest/helper_unix.go
index ed13e448b7b4c3ec9214be744a2ea79bb33d2909..b6839dcd8fd72f38ebf4d5e94f0123305eb79e93 100644 (file)
@@ -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
 
similarity index 96%
rename from src/vendor/golang_org/x/net/internal/nettest/stack.go
rename to src/internal/x/net/internal/nettest/stack.go
index 46d2fccab588c032e471f65c0ffef3bad8901837..1a545e21ab0198f434e7f9b8862af76d4ea2d9d4 100644 (file)
@@ -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"
@@ -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.
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 ae8426a05c29a642bb330d045fe0e37b31ea13f9..e14df0e6fbb77d17dfc20b28a925109b320c6b03 100644 (file)
@@ -12,7 +12,7 @@ import (
        "runtime"
        "testing"
 
-       "golang_org/x/net/internal/nettest"
+       "internal/x/net/internal/nettest"
 )
 
 func TestTestConn(t *testing.T) {
similarity index 90%
rename from src/internal/syscall/unix/empty.s
rename to src/internal/x/net/route/empty.s
index 717189c6585128458f33454e3030f7a9dda5c7d1..bff0231c7d57ead9541e1c8a9e9bc783da3d1daa 100644 (file)
@@ -2,4 +2,6 @@
 // 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.
similarity index 93%
rename from src/vendor/golang_org/x/net/route/syscall.go
rename to src/internal/x/net/route/syscall.go
index 5f69ea63d91e1c05907df70de320d54a1cb67493..72431b0341061445ff53a9140739153db25ef4dd 100644 (file)
@@ -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/internal/x/net/route/syscall_go1_11_darwin.go b/src/internal/x/net/route/syscall_go1_11_darwin.go
new file mode 100644 (file)
index 0000000..7228e44
--- /dev/null
@@ -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/internal/x/net/route/syscall_go1_12_darwin.go b/src/internal/x/net/route/syscall_go1_12_darwin.go
new file mode 100644 (file)
index 0000000..7922a68
--- /dev/null
@@ -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
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 c3ca2bc6fede0e5904a7fbc1bd46244cd6dcdca5..87e656a37d0122b0d30f456b1b3af98a2663efeb 100644 (file)
@@ -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
similarity index 85%
rename from src/vendor/golang_org/x/text/secure/doc.go
rename to src/internal/x/text/secure/doc.go
index 5eb60b94bf275278ca8566e450529ad9a5479a88..6151b79d6e3e3b074d85bcef85adfffb4e9cd621 100644 (file)
@@ -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
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 1323d9bec033dc514d076a9440c7fcc570507eb4..8d2fbb21711e7257b38a354f13342a2ccfd78c96 100644 (file)
@@ -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() {
similarity index 99%
rename from src/vendor/golang_org/x/text/transform/transform.go
rename to src/internal/x/text/transform/transform.go
index 9ddfa80cf3e69f0c7d939c3064a79b7c871e1b1f..7b6b55e0194f21b8f9efe5129901ca08dbfbaf85 100644 (file)
@@ -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"
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 e691ae86942b1829db352e0e884a298467d0613f..4542171736ee152d617751b7ae100a1eddacb23f 100644 (file)
@@ -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
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 e1739598d43e19bbf51b9e9e121fc786c85c252b..56c5c4a1219ab32a640bc1849dd62b33c7128ad9 100644 (file)
@@ -8,7 +8,7 @@ import (
        "fmt"
        "log"
 
-       "golang_org/x/text/bidi"
+       "internal/x/text/bidi"
 )
 
 func foo() {
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 fb2229efa875c6e98fc2e0c1fefc6438b4a46e15..c9c45c625f5599eae530dec6715af929d9f0a4b4 100644 (file)
@@ -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
 
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 c3f0e21f3e8791311a5a44d2a2d8a12bc5371584..e59d249c7507fd75c8945f891c2f8bcd67acf294 100644 (file)
@@ -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
 
similarity index 84%
rename from src/vendor/golang_org/x/text/unicode/doc.go
rename to src/internal/x/text/unicode/doc.go
index 55a6775d59a38b29a4bb66f876e2e4e3306c2ed4..4f7e9f5a4336edf8dc1759edbfbd199e017b2036 100644 (file)
@@ -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
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 aed6c16fbb23d5539aec27620b9e28313b54a312..fb0e52410b8a32514819e6de4644bda6e54618bb 100644 (file)
@@ -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
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 72e72c9d34a57ce3d091a857565811c30b1bea93..a9904400df43d5b9e231cb1b61c48a2b5388622e 100644 (file)
@@ -9,7 +9,7 @@ package norm_test
 import (
        "fmt"
 
-       "golang_org/x/text/unicode/norm"
+       "internal/x/text/unicode/norm"
 )
 
 func ExampleForm_NextBoundary() {
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 4de4ed6ed0f9dd79a7d4e2bdcc182788dc66ca76..791c39b1c48e8f575bf2bcfded425d854c33f1ca 100644 (file)
@@ -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.
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 d6466836cefe62e51b367484ef404c2d8752c3c4..2dd61adf63c032b3b0b1f43868ef2dd2c41f2c7d 100644 (file)
@@ -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
 
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 73869a5a1cddb1f75a1dcc96bc15b803bd902596..7837cb96a414a4cb17480e7fc17c0da0ab17a0b0 100644 (file)
@@ -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/internal/xcoff/ar.go b/src/internal/xcoff/ar.go
new file mode 100644 (file)
index 0000000..0fb410f
--- /dev/null
@@ -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    = "<aiaff>\n"
+       AIAMAGBIG = "<bigaf>\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 (file)
index 0000000..03c2fd1
--- /dev/null
@@ -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 (file)
index 0000000..851ccc5
--- /dev/null
@@ -0,0 +1,2 @@
+<bigaf>
+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 (file)
index 0000000..a8d4979
Binary files /dev/null and b/src/internal/xcoff/testdata/bigar-ppc64 differ
diff --git a/src/internal/xcoff/testdata/printbye.c b/src/internal/xcoff/testdata/printbye.c
new file mode 100644 (file)
index 0000000..9045079
--- /dev/null
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+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 (file)
index 0000000..182aa09
--- /dev/null
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void printhello(){
+       printf("Helloworld\n");
+}
index 78882d98341f6eede9a9d68200cfe41eceeaf5cf..13497eb039d89e06e8724e676a05f467819cba04 100755 (executable)
@@ -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
index 9ca7afb5aa97900c20dd6483567f05fe8932d1ac..69275e22568a2ef1bddd4bcdbd989e91f4a4b03a 100644 (file)
@@ -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.
index a97dfc8a0105fc4a21184f0156995cfca2d1283f..5f888c19fd7bdb6dc0a55cdd6b00dc1ae034fa36 100755 (executable)
@@ -48,6 +48,7 @@ if(~ $1 -v) {
 }
 
 GOFLAGS=()
+GO111MODULE=()
 GOROOT = `{cd .. && pwd}
 if(! ~ $#GOROOT_BOOTSTRAP 1)
        GOROOT_BOOTSTRAP = $home/go1.4
index 6a6d8bf6d0a086aaa1eb15930b525383f88ca3a3..ed42941780973a27b2f747757809c02fcada849f 100644 (file)
@@ -175,6 +175,7 @@ var cosLarge = []float64{
        -2.51772931436786954751e-01,
        -7.3924135157173099849e-01,
 }
+
 var cosh = []float64{
        7.2668796942212842775517446e+01,
        1.1479413465659254502011135e+03,
@@ -1527,6 +1528,7 @@ var vflog1pSC = []float64{
        0,
        Inf(1),
        NaN(),
+       4503599627370496.5, // Issue #29488
 }
 var log1pSC = []float64{
        NaN(),
@@ -1536,6 +1538,7 @@ var log1pSC = []float64{
        0,
        Inf(1),
        NaN(),
+       36.04365338911715, // Issue #29488
 }
 
 var vfmodfSC = []float64{
@@ -3026,6 +3029,41 @@ 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 math constants are accepted by compiler
 // and have right value (assumes strconv.ParseFloat works).
 // https://golang.org/issue/201
index 5f5cf5c3e4f5257feacd91d76c05ae793e3bda81..1e4a3b09cf77166ad69260d585e4c492c99a490a 100644 (file)
@@ -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
index 4c2c152f65e56a2444324f8625063c916de22dcf..d9a5f1ec968384016189882a7eea612e94eec051 100644 (file)
@@ -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
index 157d8d006d4f5bf32f5ec8eeaae10e6502a5abb1..5656280e84dabcfb0b7f4754c91ed8fc236692c7 100644 (file)
@@ -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 {
index 58cf52d2a74582d427267ccadeb6288d453e1848..b06c363348449d145b04a4c7182ba76a3046f6dc 100644 (file)
@@ -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.
@@ -63,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
        }
@@ -452,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))
@@ -466,9 +467,11 @@ 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)
+       }
        z := uint64(hi)<<32 | uint64(lo)
        quo, rem = uint32(z/uint64(y)), uint32(z%uint64(y))
        return
@@ -477,15 +480,17 @@ 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
                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 +527,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
index 0bd52bee773b00e10ef24e66035cd81bcc5de2dd..1ec5107ae1294191d32cf68d2b15ca9d0ee18035 100644 (file)
@@ -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++ {
index 368308e1e5d3fc6761f66e00e180289638a94d50..53d9205b9d1693d745e12695cb3d05fe576aef32 100644 (file)
@@ -9,3 +9,6 @@ var ExpGo = exp
 var Exp2Go = exp2
 var HypotGo = hypot
 var SqrtGo = sqrt
+var TrigReduce = trigReduce
+
+const ReduceThreshold = reduceThreshold
diff --git a/src/math/huge_test.go b/src/math/huge_test.go
new file mode 100644 (file)
index 0000000..0b45dbf
--- /dev/null
@@ -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)
+               }
+       }
+}
index b128a1620c880eb524fab7a603b9b82db7b8fb06..c4ec61b2259ebdf431d59c9b4911a1fce69554c1 100644 (file)
@@ -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)
index 929cac34ecaa6f2912b4cbf231075d051fa181ca..cc8b1366ad37b2810f2c1f8d4ed35326c10e4253 100644 (file)
@@ -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])
index 45d12e00c824c4560f380b6ae08fb8a35cf7fc90..cf7679d1889cbfaf753b9f51f5c73c4005d57de6 100644 (file)
@@ -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)
index 3ae193a3b253cbc42e474b95dae97b4d9d38cfc5..c002db6b3cd169bd5fc36c4b61399a2605099629 100644 (file)
@@ -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 (file)
index 38bb050..0000000
+++ /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 (file)
index f700a4f..0000000
+++ /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
index aa2fb37e81b95c35d650cde682509cef80f8314b..0d5394cf264d3531a205a44c00cd695a704ed1c0 100644 (file)
@@ -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 {
index cb65a3f703d4b6d9e6b983c600c64fd1ccce6fb4..4e44c2692d2d8bb8fdb634a1de54f224c5a59ae8 100644 (file)
@@ -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 (file)
index 0000000..6f8eaba
--- /dev/null
@@ -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 and the leading one bit give 1217 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,
+}
index 5ae67420f4dc029dfb0bc816378520ef42a09d2d..e59f50ca62e5cc4ecdcc334b319093c5ef6a905d 100644 (file)
@@ -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)) }
index 3d480a9d7e7c409524bafaba2f618379a5c3e740..05390773a8afa98272c7e2ca55d582248deb08ce 100644 (file)
@@ -56,7 +56,8 @@ func FormatMediaType(t string, param map[string]string) string {
 
                b.WriteByte('"')
                offset := 0
-               for index, character := range value {
+               for index := 0; index < len(value); index++ {
+                       character := value[index]
                        if character == '"' || character == '\\' {
                                b.WriteString(value[offset:index])
                                offset = index
index 35b311a4a58b1d9cd099de8885b357f4e8d1ac88..945a8189e171c944ed58997368d396adc0bf98bb 100644 (file)
@@ -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"`},
index 3dd0c8fb1368a48e31228c348c977e98437d9620..d1ff151a7d1d6441bf8a9209bdd0529a6d29066d 100644 (file)
@@ -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 {
index 8b1bcd68d870ad01425e16b61dd442f8677d73e9..b89b093fff6ff32e42f6485014664a7d593e9e69 100644 (file)
@@ -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) {
index 76dcdc164cabd0f98813c386b1a71a0f704f6ba7..1dd8690739ef64a79c31d5bf58557c1e3c764800 100644 (file)
@@ -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
 }
index 983338885dac52df8c0fbc93f804e67bf6e57f3e..3a2c59a2d1d6be90dba1db1eaa15f7080860097e 100644 (file)
@@ -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)
                }
        }
 }
index 2c47bc413013f87a05b1a47209f448fb0bbaf13c..4fdf60ff4e35a183c4d3ea3828339bd8cf971cc3 100644 (file)
@@ -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
index 73630faa498c6c049e5d1bab014b1f916907a815..86ce92dc437844d6c98e627fb948ebb94b2e1b8b 100644 (file)
@@ -23,7 +23,7 @@ import (
        "sync"
        "time"
 
-       "golang_org/x/net/dns/dnsmessage"
+       "internal/x/net/dns/dnsmessage"
 )
 
 var (
index 7dccb6b8ec5d8af4be000150f9a70c541009bd24..be04a44c14beaf9c28e7d1d75dfa024bda05a8cb 100644 (file)
@@ -20,7 +20,7 @@ import (
        "testing"
        "time"
 
-       "golang_org/x/net/dns/dnsmessage"
+       "internal/x/net/dns/dnsmessage"
 )
 
 var goResolver = Resolver{PreferGo: true}
index 5a1156378b569b98e571e819efb1d1c7accc7e00..ea71803e22a70397c43e91af037c31dcaed7a081 100644 (file)
@@ -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) {}
 )
index ea6c0719119b1ffebff4bc406a9e0d10918f18e3..921f86bd92dc742e18891837544787a034e11bb3 100644 (file)
@@ -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.
index 289c3c37b1989bb460266b5a70a2c8e5d36b20f0..63f62214db825d787b9a10bacb940ff31b0ced4b 100644 (file)
@@ -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.
@@ -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 {
index 716e8ecac70a90c3596240e59b2211f388db70a4..b6965c239e95ecbdcf000d0f53dd7744a55546fa 100644 (file)
@@ -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() }
index 255d215f3cfe07baf174040e468d6270751f6c03..762e88b05ff30cf81b395a9b0a2bbc4a7dbf6bc0 100644 (file)
@@ -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())
        }
 }
 
index 12cf65f109c13c70fca4f88c7736d4fef30828ff..f714cbb9a138d78ba68dd451a595556a6fcb2787 100644 (file)
@@ -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
@@ -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
@@ -5370,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
@@ -5670,7 +5451,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 +5617,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 +5645,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 +6207,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 +6220,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 +6519,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 +6552,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 +6666,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 +6700,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 +6876,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 +6914,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 +6968,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 +7019,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 +7144,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 +7196,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 +7366,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 +7436,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 +7474,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 +7544,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 +7666,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 +7902,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 +8325,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 +8702,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 +8937,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 +9211,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 +9341,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)
index 611ee047050c76062ff61769199c193c01893ccf..b699e7ef8ffb13515d87665d1ea19ac875c9bdbd 100644 (file)
@@ -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)
 }
@@ -52,9 +55,16 @@ 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.
+// CanonicalHeaderKey.
 func (h Header) Del(key string) {
        textproto.MIMEHeader(h).Del(key)
 }
index 30d1a52b63190a3b402ea5a3bccde4062166dd5c..e5d59e14120baa18eeea51f2c8ea76072124aa26 100644 (file)
@@ -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
@@ -59,6 +59,17 @@ func isASCII(s string) bool {
        return true
 }
 
+// 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 {
        newLen := 0
        for i := 0; i < len(s); i++ {
index 67f90b837698a95e13d7b36cda71247b4abdd052..f2c3c0757bacf4f3bb99a91e54fd81faa5a5eb2e 100644 (file)
@@ -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
index ebafc9999c6030a26163f7cb9a3567a3a9fa0934..b4e2e9266e685db3a3e48b1cabce041e60812b37 100644 (file)
@@ -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 {}
        }
index f82d820a43007d614feec03398f06d25c49b9f9a..4e10bf399711b5f54e9cb985f0049738db46a97b 100644 (file)
@@ -8,6 +8,7 @@ package httputil
 
 import (
        "context"
+       "fmt"
        "io"
        "log"
        "net"
@@ -16,6 +17,8 @@ import (
        "strings"
        "sync"
        "time"
+
+       "internal/x/net/http/httpguts"
 )
 
 // ReverseProxy is an HTTP Handler that takes an incoming request and
@@ -42,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
 
@@ -168,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 {
@@ -199,6 +216,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 +239,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,18 +262,23 @@ 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 {
+               if !p.modifyResponse(rw, res, outreq) {
+                       return
+               }
+               p.handleUpgradeResponse(rw, outreq, res)
+               return
+       }
+
        removeConnectionHeaders(res.Header)
 
        for _, h := range hopHeaders {
                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)
@@ -265,14 +295,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()
@@ -287,6 +310,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
@@ -463,3 +495,70 @@ 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
+       }
+
+       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))
+               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
+}
index ddae11b168ce7da8eb20f704c02fd26b0eaf07e5..5edefa08e55a3c1a17bda4d4957b12dbc4bfeb91 100644 (file)
@@ -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,139 @@ 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
+       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")
+               rproxy.ServeHTTP(rw, req)
+       })
+
+       frontendProxy := httptest.NewServer(handler)
+       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)
+       }
+
+       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)
+       }
+       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()
+
+       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() {
+               t.Fatalf("Scan: %v", bs.Err())
+       }
+       got = bs.Text()
+       want = `backend got "Hello"`
+       if got != want {
+               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)
+       }
+
+}
+
+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)
+               }
+       }
+}
index 0bcdeae0df1f582cc57a7c0c5bbbe18346e8e616..dcad2b6fab366dd631a656a9957f0cc29c947474 100644 (file)
@@ -26,7 +26,7 @@ import (
        "strings"
        "sync"
 
-       "golang_org/x/net/idna"
+       "internal/x/net/idna"
 )
 
 const (
@@ -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 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
+       // 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
@@ -579,7 +584,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 != "" {
@@ -1330,6 +1335,9 @@ func (r *Request) wantsHttp10KeepAlive() bool {
 }
 
 func (r *Request) wantsClose() bool {
+       if r.Close {
+               return true
+       }
        return hasToken(r.Header.get("Connection"), "close")
 }
 
@@ -1345,6 +1353,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
 }
index 246fb4e65d85217f2331c4ef052964e915501f7f..b110b57b1ab922ec213c10311891c1a2eb6dd9ad 100644 (file)
@@ -544,6 +544,49 @@ 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",
+       },
+
+       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) {
index b3ca56c4190dbe744d2fee7a15c612fc256ba651..f906ce829b4aaffb4c2cfdb936674f308b5f4fad 100644 (file)
@@ -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"
index 79598164452e8c92fcff446591be254a0ac47194..1e38b908d387e7e6b5d26d6e9724f6c6feac2496 100644 (file)
@@ -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.
index a7e79c2d913762f522655a17ded1713eeaab0cac..aa9c3f5d2ebd50c61e5c44cc424667456260283c 100644 (file)
@@ -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.
@@ -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())
        }
 
@@ -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)
index dd72d67be911de7d8298bf6f4cbf1adbdb854317..086f3d1a71ed56bcd93e5a66fb62a26429968f4d 100644 (file)
@@ -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",
index 3eb9f0da91298357531b270e5170c980d1ecf62d..e8a93e9137eb8a97d3840d018296462a3dee6d54 100644 (file)
@@ -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
index c459092cb89872d787794dfbcc54c8ecfb8c5074..a8c5efe6aaff2918498b0aa2f43d9c5adb91bd64 100644 (file)
@@ -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
@@ -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
@@ -125,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)
 
@@ -133,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
@@ -1714,7 +1723,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
@@ -2107,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:
@@ -2126,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")
        }
 
@@ -2407,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 {
index 3f9750392c61d0680fcae6a4b879a8e2de976796..6e075847ddeeadd2802c46b29e182637be4ed4df 100644 (file)
@@ -41,6 +41,8 @@ import (
        "sync/atomic"
        "testing"
        "time"
+
+       "internal/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)
@@ -4952,3 +5006,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)
+                       }
+               })
+       }
+}
index f68df98aa27669d0bcbd7d6babc002434b751632..58248560a25c5f4a491b6768fe0959304e6b6081 100644 (file)
@@ -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")
@@ -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()
index 35b1c2681592ae88a18f09a67e3a4ed3afb54f91..77372964b104ca5342efd99afcdcaa5a14f75673 100644 (file)
@@ -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
index 0b84ca37d4a44787c94f1067e8fb9dd05a994f0c..818fafe9708a52251d145336e0cf82013c862731 100644 (file)
@@ -9,7 +9,7 @@ package net
 import (
        "syscall"
 
-       "golang_org/x/net/route"
+       "internal/x/net/route"
 )
 
 func interfaceMessages(ifindex int) ([]route.Message, error) {
index 2ec8e1cc6ef70f10d3ff92d6218c3f4e0731ca09..6a6b3a58187dc1d1386403e3e92afa9e78ced17f 100644 (file)
@@ -7,7 +7,7 @@ package net
 import (
        "syscall"
 
-       "golang_org/x/net/route"
+       "internal/x/net/route"
 )
 
 func interfaceMessages(ifindex int) ([]route.Message, error) {
index 8a7d6f67c039d4480fdbbefb4e17c9cb13912464..8eee2aa03159a9c6f3b8841f42181c5c7330d696 100644 (file)
@@ -7,7 +7,7 @@ package net
 import (
        "syscall"
 
-       "golang_org/x/net/route"
+       "internal/x/net/route"
 )
 
 func interfaceMessages(ifindex int) ([]route.Message, error) {
index dc8ffbfcb8a6430d78edcb1371609805bc007a0f..868d4174ed38d99bb2ed82116397cff3ccc98cdd 100644 (file)
@@ -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
index cb810dea267bd15d6e95c9b355270281af6f7c07..e10889331e4f5ef5c0bd189cad5eec3ab14e65d1 100644 (file)
@@ -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) {
index aeeda8f7d0eb74f7bbf8f57c6bd9e91522821003..85bcb2b8960b20a207507fac7ed64cfd3db5fef6 100644 (file)
@@ -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)
 
@@ -237,11 +240,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)
+               }
        }
 }
 
@@ -618,6 +626,9 @@ func TestLookupDotsWithLocalSource(t *testing.T) {
 }
 
 func TestLookupDotsWithRemoteSource(t *testing.T) {
+       if runtime.GOOS == "darwin" {
+               testenv.SkipFlaky(t, 27992)
+       }
        mustHaveExternalNetwork(t)
 
        if !supportsIPv4() || !*testIPv4 {
@@ -925,8 +936,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)
@@ -1034,3 +1045,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)
+       }
+}
index bef9dcfe14634b43aeb6d76e98e7fa6bfe299dfb..6543f121a738f2ca096bbcfcab624f12aa0ce764 100644 (file)
@@ -12,7 +12,7 @@ import (
        "sync"
        "syscall"
 
-       "golang_org/x/net/dns/dnsmessage"
+       "internal/x/net/dns/dnsmessage"
 )
 
 var onceReadProtocols sync.Once
index 692f269e0c29b87af044b62afad6e285d1cf93d8..2b5845bb1580f3f5f4fdef7d24ef45dc4c8bba5f 100644 (file)
@@ -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
        }
index 84a71b756bc044eefcd48c6e130fc9bf9e34b342..53ddc16313d97446e1ccfebc19589a6da8ef3f46 100644 (file)
@@ -10,7 +10,7 @@ import (
        "testing"
        "time"
 
-       "golang_org/x/net/nettest"
+       "internal/x/net/nettest"
 )
 
 func TestPipe(t *testing.T) {
index c537ea68b2b410cadf094a747d27ad719654b7e4..297e625d24b1d86623316abb51c32e5fc313f6d3 100644 (file)
@@ -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
index f133744a6654547dfc8b4994a5fb048fc581da91..911e6139c57e3f2529f61cd500299556b53749f5 100644 (file)
@@ -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()
+}
index 9b3ba4ee624a3cf8d5ce1749466ce029ccf789a9..43df3bfd15eff08ba1a39b2f62febc7917191462 100644 (file)
@@ -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
index 6fb207fc92771717a7303bedc0bb87ca36d69e8e..b49c4d5c7c72087156bba82a0038e55d8c8e3ad8 100644 (file)
@@ -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
index 7c7d0c89938c96acf10907f936240ce341eb8395..9599fa1d3e88660ff3ba58943c0924c3b149da2b 100644 (file)
@@ -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
index 1f06397ffa38a7e59f7d6e7ede5504736fd09f0f..397b6649cda29fa7b8a960b25af884822a05ad13 100644 (file)
@@ -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")
@@ -353,21 +355,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)
                }
        }
 }
index 3ae62f6a8b84afadb7a296f66f364634675fca56..ae912a46ddb8cca92acbfa878e74c749c4e87da7 100644 (file)
@@ -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 {
index 702f9124bfe8da1f259e0d947bf6d401525f716b..64274a0a364d0c2ae3ec60bc41c1c9d3c8f3a390 100644 (file)
@@ -513,6 +513,10 @@ func parse(rawurl string, viaRequest bool) (*URL, error) {
        var rest string
        var err error
 
+       if stringContainsCTLByte(rawurl) {
+               return nil, errors.New("net/url: invalid control character in URL")
+       }
+
        if rawurl == "" && viaRequest {
                return nil, errors.New("empty url")
        }
@@ -755,6 +759,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:
@@ -1133,3 +1138,14 @@ func validUserinfo(s string) bool {
        }
        return true
 }
+
+// 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
+}
index 7c4ada245a7a3d9f34501711f367378c66c9e2e2..c5fc90d5156fd9f0a73b1dc3066abf9355ffddb6 100644 (file)
@@ -1738,12 +1738,33 @@ 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)
+               }
+       }
+
+       // 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 {
        unescaped string
        query     string
diff --git a/src/os/dir_ios.go b/src/os/dir_ios.go
new file mode 100644 (file)
index 0000000..8c14d89
--- /dev/null
@@ -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)
index 7a3ef47ce21fa42b4fd4635caf5c67e5c3895e9f..bd99ef48138412d894f77aed29eed7eedb59ed91 100644 (file)
@@ -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.
index 5c96ebb417dcd258e842fed36fa113e1318c821e..8b6566e1496edceb36bfcca6269cd0e999e33fe5 100644 (file)
@@ -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")
index 1e60365dba4de633ff4f418af34a9297f968c4c4..4c8261295c009dfad86065ce2fe6a6b8307422f5 100644 (file)
@@ -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
index d9c5c57c17354cc5cfd37f543732998725098fc1..fdead63bfc4cc5f52b20411716e754a24e719925 100644 (file)
@@ -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.
@@ -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.
@@ -471,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)
+}
index 2c74403434317ca953bc8ced3cc5235db9422ea7..3fa12e681667c92d451cfde146987fd894f75871 100644 (file)
@@ -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
+}
index 0ca34b070da8d04c5853cdf965b11a132aee932b..2615df9d5b7cc36976ae4590863d9ddbcd430964 100644 (file)
@@ -9,6 +9,7 @@ package os
 import (
        "internal/poll"
        "internal/syscall/unix"
+       "io"
        "runtime"
        "syscall"
 )
@@ -116,23 +117,39 @@ 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 {
+               switch runtime.GOOS {
+               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:
+                       // 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
+                       }
                }
        }
 
@@ -155,13 +172,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.
@@ -176,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 {
@@ -230,6 +241,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 +372,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
+}
index 7ed4fe2f389d99f6058465a200872b35af3aeffb..85f248774c77e3f210d0c18eddf6089c335fd094 100644 (file)
@@ -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]))
index d838272215594158caac2b2f1b34452521b8075a..9c4d5dada9a106b9c20c593bd157a88b804e6371 100644 (file)
@@ -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 {
index 0317f7257ec516bfcd16d5dc75416cb83385f909..2aa930ea80dd0d966da82f5e2877602b8e571013 100644 (file)
@@ -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 {
index c5553694880eefb4a1d2a7612fb0bbf190de4d0f..285e1eb35e9d1606b90b2a1aaee75266a75e130c 100644 (file)
@@ -5,6 +5,7 @@
 package os_test
 
 import (
+       "errors"
        "fmt"
        "internal/poll"
        "internal/syscall/windows"
@@ -25,6 +26,9 @@ import (
        "unsafe"
 )
 
+// For TestRawConnReadWrite.
+type syscallDescriptor = syscall.Handle
+
 func TestSameWindowsFile(t *testing.T) {
        temp, err := ioutil.TempDir("", "TestSameWindowsFile")
        if err != nil {
@@ -1003,3 +1007,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)
+       }
+}
index e31f64c750ef2d35b31a7901401951fa6677744c..104b7ceaf7dad37e58d852b954036ed9a790ba11 100644 (file)
@@ -57,3 +57,22 @@ 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 == "." {
+               return true
+       }
+       if len(path) >= 2 && path[len(path)-1] == '.' && IsPathSeparator(path[len(path)-2]) {
+               return true
+       }
+       return false
+}
index 59d31e5837c9d107566c085893db2442513f6694..779b2bdf85b3b2d34b1232cad45f0425e6cea90d 100644 (file)
@@ -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
diff --git a/src/os/rawconn.go b/src/os/rawconn.go
new file mode 100644 (file)
index 0000000..9e11cda
--- /dev/null
@@ -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 (file)
index 0000000..820150d
--- /dev/null
@@ -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")
+       }
+}
index eb220bd103f0c1fe4ba93eabac9d5f7bcfdb83de..7f2d5922ae03c3f5ab387c4af2dbb39986f047ff 100644 (file)
@@ -9,13 +9,27 @@ package os
 import (
        "internal/syscall/unix"
        "io"
+       "runtime"
        "syscall"
 )
 
-func RemoveAll(path string) error {
-       // Not allowed in unix
-       if path == "" || endsWithDot(path) {
-               return syscall.EINVAL
+func removeAll(path string) error {
+       if path == "" {
+               // fail silently to retain compatibility with previous behavior
+               // of RemoveAll. See issue 28830.
+               return nil
+       }
+
+       // The rmdir system call does not permit removing ".",
+       // so we don't permit it either.
+       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) {
+               return nil
        }
 
        // RemoveAll recurses by deleting the path base from
@@ -43,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
        }
 
@@ -55,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
@@ -74,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) {
@@ -103,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
@@ -115,25 +134,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
+               }
 
-       return NewFile(uintptr(fd), path), nil
-}
+               // See comment in openFileNolog.
+               if runtime.GOOS == "darwin" && e == syscall.EINTR {
+                       continue
+               }
 
-func endsWithDot(path string) bool {
-       if path == "." || path == ".." {
-               return true
+               return nil, &PathError{"openat", name, e}
        }
-       if len(path) >= 2 && path[len(path)-2:] == "/." {
-               return true
-       }
-       if len(path) >= 3 && path[len(path)-3:] == "/.." {
-               return true
+
+       if !supportsCloseOnExec {
+               syscall.CloseOnExec(r)
        }
 
-       return false
+       return newFile(uintptr(r), name, kindOpenFile), nil
 }
index d1dd43ff6ac44d41cbf7776d3102d8c5520baad3..5a7dc263f08f29995bd3295ca56818b3869bf99f 100644 (file)
@@ -11,11 +11,20 @@ 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.
+               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) {
index 5eec8cd1547310ec2549e65c5f7870a39510bd6e..9dab0d4bb1079a8881e4a7d1437d822aed2696d2 100644 (file)
@@ -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")
@@ -211,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)
@@ -238,13 +235,140 @@ 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)
+               }
+       }
+}
+
+// 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")
+       }
+}
+
+// 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)
+                       }
+               }
+       }
+}
index ecb05fd16c3e7e15508e43d170131c31fe7cd611..6ea59f4697f622a4cf0c2a1802fd450a103d4d93 100644 (file)
@@ -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
index d36afa9ffd5e74c5116e6d638be6bc3536e24a01..bab4ffa7984cf961a816fac9f46ad97860e429b1 100644 (file)
@@ -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)
 }
index 8636dc7f05d9e1d4c38053977133b15fe38cc8d6..5e33292bec68197771b515c695eafec4386630cb 100644 (file)
@@ -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{
index d070604600131b63b5b713639d5ca80ebacfd81c..469abf764016bbbe2f0ac5671777dcf195048294 100644 (file)
@@ -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.
index 891f242dacd140e00ef939c7719285cfbbdddf69..45bf649015fd77e3d72ed99153d8c0ee7497a8ce 100644 (file)
@@ -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
index 5a62b27f191f22c98634c30fd0d09919dc65fa44..946c085a500422ceab0ffc2a9f224d59bbe7ef5d 100644 (file)
@@ -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,
index 3434ea2e6e77ca7909d848b94fbad68def18f2ff..9c4c7ebedc3b4187285adcc1a0e95cc0c152739b 100644 (file)
@@ -15,6 +15,7 @@ import (
        "runtime"
        "sort"
        "strings"
+       "syscall"
        "testing"
 )
 
@@ -1371,3 +1372,44 @@ func TestWalkSymlink(t *testing.T) {
        testenv.MustHaveSymlink(t)
        testWalkSymlink(t, os.Symlink)
 }
+
+func TestIssue29372(t *testing.T) {
+       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)
+       }
+
+       pathSeparator := string(filepath.Separator)
+       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 {
+               _, err = filepath.EvalSymlinks(test)
+               if err != syscall.ENOTDIR {
+                       t.Fatalf("test#%d: want %q, got %q", i, syscall.ENOTDIR, err)
+               }
+       }
+}
index 63eab18116cf5d44213cec00a8471c45309ce1d6..d1735d39bd8ccfb69a4b5bd706a99abbca7db8b4 100644 (file)
@@ -536,17 +536,42 @@ 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)
+       }
+
+       // 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 {
+               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)
        }
 }
index 98a92357bedb2b5d306128d9695b0eda5457c6b3..4b41039e25f7592f6a142e2dc372078f05b980a9 100644 (file)
@@ -12,6 +12,8 @@ import (
 
 func walkSymlinks(path string) (string, error) {
        volLen := volumeNameLen(path)
+       pathSeparator := string(os.PathSeparator)
+
        if volLen < len(path) && os.IsPathSeparator(path[volLen]) {
                volLen++
        }
@@ -50,7 +52,7 @@ func walkSymlinks(path string) (string, error) {
                        }
                        if r < volLen {
                                if len(dest) > volLen {
-                                       dest += string(os.PathSeparator)
+                                       dest += pathSeparator
                                }
                                dest += ".."
                        } else {
@@ -62,7 +64,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 +78,7 @@ func walkSymlinks(path string) (string, error) {
 
                if fi.Mode()&os.ModeSymlink == 0 {
                        if !fi.Mode().IsDir() && end < len(path) {
-                               return "", os.ErrNotExist
+                               return "", slashAfterFilePathError
                        }
                        continue
                }
index d20e63a987e9ad7a9986c5ecc05b4db5f92beb74..b57e7f2277e3e9915f90022439cdfe64e38c2fb1 100644 (file)
@@ -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)
 }
index 78cde4aa09074552d28c31bce8c95926c68643d2..531dc26fc0e4f2366026acc66ab1479d226b314e 100644 (file)
@@ -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)
@@ -171,8 +171,16 @@ 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 {
diff --git a/src/plugin/plugin_test.go b/src/plugin/plugin_test.go
new file mode 100644 (file)
index 0000000..b334c5c
--- /dev/null
@@ -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.
+
+// +build !nacl
+// +build !linux linux,!arm64
+
+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.
+}
index d673f503a9a732eb28e570d978a1910df675d678..e83c175df3b4c0056aeff190986786aa4dbad410 100755 (executable)
@@ -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
        ;;
index 4b215f120c963b04c265d95e645f8298e6f23cc0..10b52456f34eecaaba881a01b72f6db26c735ddd 100644 (file)
@@ -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
index 5bbab79fc0775d0ce2fad62a877c2473e118a884..5ce80c61dcfdf6de39082c2edd0f63019631293f 100644 (file)
@@ -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.
@@ -593,6 +590,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]
@@ -1858,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))
@@ -1866,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)
@@ -2121,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
index 8906febb9bf1a41ca56e7a0717ab662e80442f7f..372b7a6dc80082631fb99e4a42e68a446da3ad44 100644 (file)
@@ -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
                }
@@ -1031,7 +1032,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
                }
index d65464665f77986ea2c946c6de6246e3a5a4badf..3008c56b6bea94799e0c5c5a4043f338ee8ae832 100644 (file)
@@ -25,12 +25,26 @@ 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 <nil>
+       // false <nil>
+       // false error parsing regexp: missing closing ): `a(b`
+}
+
 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 <nil>
@@ -39,13 +53,53 @@ 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.?`)
+       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.?")
+       re := regexp.MustCompile(`foo.?`)
        fmt.Printf("%q\n", re.FindString("seafood fool"))
        fmt.Printf("%q\n", re.FindString("meat"))
        // Output:
@@ -54,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:
@@ -63,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:
@@ -72,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))
@@ -85,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))
@@ -98,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-
@@ -116,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"))
@@ -127,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}"))
@@ -138,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"))
@@ -151,7 +205,7 @@ func ExampleRegexp_ReplaceAllString() {
 }
 
 func ExampleRegexp_SubexpNames() {
-       re := regexp.MustCompile("(?P<first>[a-zA-Z]+) (?P<last>[a-zA-Z]+)")
+       re := regexp.MustCompile(`(?P<first>[a-zA-Z]+) (?P<last>[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])
@@ -165,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))
index c14f4a206d3f3d968cfae4ca9bfd8d5810ed457b..1c6c4244349f55fe653a17175573f4615f9a03ae 100755 (executable)
@@ -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
index 0e0c413617c7653bdad4e8333cf253705a89d575..123edcc35dd7d636bfb14d2ce38f99a0483f3b0c 100644 (file)
@@ -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
 
index 49d6fd9a4df1e6fa28c51fe08f8268a4362cafb1..c346f5cf5c6a27ec672aa7b65220cff4e2070423 100755 (executable)
@@ -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 $*
index 72ba61970bd67134bb77c84bbf54a91f3b2ed105..993edc67d886bb1d8181a85fac4a0df4e56ca9c8 100644 (file)
@@ -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
index 8e931fd7658c6cbc0c6d2754311fe06dc334a6ab..887dbebdeb074a5c4dfcc1b81e6ac427d2571300 100644 (file)
@@ -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
index 2248cec13252038e4d923596c1f3ec84685449fa..bbeb3df0c85f5737b47ead40d519ac6236b9bf7e 100644 (file)
@@ -18,7 +18,7 @@ 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
+       MOVD    RSP, R7
        MOVD    $(-64*1024)(R7), R0
        MOVD    R0, g_stackguard0(g)
        MOVD    R0, g_stackguard1(g)
@@ -44,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
index fb0003c9b2f92833bfefaeebc1c9fdd024bc2eca..0a89b57cd81baecf1f960c01896e466dbdffceed 100644 (file)
@@ -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
index b6f51b3e4dd66f70c995f4edfa23b92b8f54bd4d..248d59fd6957430b06d12fdf962396c926e44f29 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <errno.h>
 
 #include "libcgo.h"
 
diff --git a/src/runtime/cgo/gcc_openbsd_arm.c b/src/runtime/cgo/gcc_openbsd_arm.c
new file mode 100644 (file)
index 0000000..9a5757f
--- /dev/null
@@ -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 <sys/types.h>
+#include <pthread.h>
+#include <signal.h>
+#include <string.h>
+#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;
+}
index f2ff710f60cdf826ef619d9570bdc745d0d2ea67..9184b91393ff59459c3069d2029404bbb6dd99d6 100644 (file)
@@ -7,6 +7,7 @@
 #include <process.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <errno.h>
 #include "libcgo.h"
 
 static void threadentry(void*);
index 511ab44fa9822fe59c1fb18afeb01f00f3ff65a7..7192a2463154387fced551009329b031b550024e 100644 (file)
@@ -7,6 +7,7 @@
 #include <process.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <errno.h>
 #include "libcgo.h"
 
 static void threadentry(void*);
index ca31408b50726f0b2859b6627e0f474a96418d71..85b6c8289ab4e612d30f2c72e367a73802b26e42 100644 (file)
@@ -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 {
index ac57e0344eea60a5d3de99118d11b8e09ac12300..7f3c4aa803079cddaa4f8c0776e86373433cae0a 100644 (file)
@@ -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)
index b65523766af5f79d10022ccc4de7d757d16a8ef8..1565afb93a5573d37bb4b7d3456514a7519d9dbd 100644 (file)
@@ -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
+)
index 6da8341e8419877fb188b184518606e50bfa88c8..c1dd757797dead6863dd174baae6367dec8a2408 100644 (file)
@@ -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/debug/mod.go b/src/runtime/debug/mod.go
new file mode 100644 (file)
index 0000000..2c5aa27
--- /dev/null
@@ -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
+}
index 37dcafd145ea68df01634abb9a75a06aba698e8b..f77a373d1332fad2d66e740910908d9a42e006c3 100644 (file)
@@ -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
index 1eea9ad45aeac833444f341a0045262758feae32..59f9410e1d63fe6c1a9563f148610449be04d207 100644 (file)
@@ -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 {
@@ -130,8 +134,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 +148,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 +163,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
 }
index 38b30b70e3409b094aa4e02cce2f80206bf48f3b..8c0d6d8b98fdcc373bae98699e44078ca0232538 100644 (file)
@@ -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")
index 37508c09becdcde9ac00167b70155366279e22c5..42a446d3cdfc7a3e0d7f042d161bedf8d537fd2f 100644 (file)
@@ -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")
index 1140f61651f381a746e4b51dc46170ea06f31adc..049f5b613a74d35c5fb466ef250aa5a3d7a9874b 100644 (file)
@@ -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")
index 74f8855de6554db59ebdf02b8d6a36af6b3b5c05..e97dd52f209d9f0e46a16b0f9851c4df7629c643 100644 (file)
@@ -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
index 56dd95e4697d745defb52946e4b9c62a4532750c..9eaf92dc7cbb4c940fa9dc3fd2e06b8405fb57e9 100644 (file)
@@ -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.start(); i.valid(); i = i.next() {
+                       slow.HeapReleased += uint64(i.span().released())
+               }
 
                getg().m.mallocing--
        })
@@ -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<<h.B; x++ {
+               b0 := (*bmap)(add(h.buckets, uintptr(x)*uintptr(t.bucketsize)))
+               n := 0
+               for b := b0; b != nil; b = b.overflow(t) {
+                       for i := 0; i < bucketCnt; i++ {
+                               if b.tophash[i] != emptyRest {
+                                       n++
+                               }
+                       }
+               }
+               k := 0
+               for b := b0; b != nil; b = b.overflow(t) {
+                       for i := 0; i < bucketCnt; i++ {
+                               if k < n && b.tophash[i] == emptyRest {
+                                       panic("early emptyRest")
+                               }
+                               if k >= 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++
+                       }
+               }
+       }
+}
index 997e1cb278d72522901a8432af4de39a05bc256f..af858a331f63cbd8a41a82191d82f9f53d919f8b 100644 (file)
@@ -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.
@@ -166,27 +171,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 {
-               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 {
+       rpc := make([]uintptr, 1)
+       n := callers(skip+1, rpc[:])
+       if n < 1 {
                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
index c36d5835f64b3838cc5443fefc93312dab3190c4..6ba4a7d3f24ccfb9c9da6b18a583c9006722fe8f 100644 (file)
@@ -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.
 
index 7b8ebc4f3c00ff48fa453496073d6d4c841a73dc..fe25a7f84be38f4520773b4df598d6a952460ce9 100644 (file)
@@ -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
                                }
                        }
index 53280232682b8828f67ba15eed30ceb5bb7d1731..10b0173f601d5d803fca01c842185fbd3badc014 100644 (file)
@@ -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
index 4ce7d2a0988273bca1eebe2010f545696de6dafb..ea3455a8c4c93243c0281001aeff29328613111a 100644 (file)
@@ -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<<aixCntBits-1))
+       }
        return uint64(uintptr(unsafe.Pointer(node)))<<(64-addrBits) | uint64(cnt&(1<<cntBits-1))
 }
 
@@ -40,5 +51,8 @@ func lfstackUnpack(val uint64) *lfnode {
                // val before unpacking.
                return (*lfnode)(unsafe.Pointer(uintptr(int64(val) >> 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)))
 }
index 98aed8796b5ee156cbebc860255915f8e0c153fe..f58c915b630a9c8ee0169c6129e4f1f831dbafdb 100644 (file)
@@ -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)
@@ -127,24 +127,24 @@ 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)
                }
        }
 }
 
-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
 }
index 12fa744052acc016b438cba315b3261a1b005f10..8c617bb42b4869580a0db3f4a260c12ce266924a 100644 (file)
@@ -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<<heapAddrBits bytes. On
@@ -223,6 +226,7 @@ const (
        //       Platform  Addr bits  Arena size  L1 entries   L2 entries
        // --------------  ---------  ----------  ----------  -----------
        //       */64-bit         48        64MB           1    4M (32MB)
+       //     aix/64-bit         60       256MB        4096    4M (32MB)
        // windows/64-bit         48         4MB          64    1M  (8MB)
        //       */32-bit         32         4MB           1  1024  (4KB)
        //     */mips(le)         31         4MB           1   512  (2KB)
@@ -244,7 +248,7 @@ const (
        // logHeapArenaBytes is log_2 of heapArenaBytes. For clarity,
        // prefer using heapArenaBytes where possible (we need the
        // constant to compute some other constants).
-       logHeapArenaBytes = (6+20)*(_64bit*(1-sys.GoosWindows)) + (2+20)*(_64bit*sys.GoosWindows) + (2+20)*(1-_64bit)
+       logHeapArenaBytes = (6+20)*(_64bit*(1-sys.GoosWindows)*(1-sys.GoosAix)) + (2+20)*(_64bit*sys.GoosWindows) + (2+20)*(1-_64bit) + (8+20)*sys.GoosAix
 
        // heapArenaBitmapBytes is the size of each heap arena's bitmap.
        heapArenaBitmapBytes = heapArenaBytes / (sys.PtrSize * 8 / 2)
@@ -264,7 +268,10 @@ const (
        // We use the L1 map on 64-bit Windows because the arena size
        // is small, but the address space is still 48 bits, and
        // there's a high cost to having a large L2.
-       arenaL1Bits = 6 * (_64bit * sys.GoosWindows)
+       //
+       // We use the L1 map on aix/ppc64 to keep the same L2 value
+       // as on Linux.
+       arenaL1Bits = 6*(_64bit*sys.GoosWindows) + 12*sys.GoosAix
 
        // arenaL2Bits is the number of bits of the arena number
        // covered by the second level arena index.
@@ -418,6 +425,8 @@ func mallocinit() {
                // allocation at 0x40 << 32 because when using 4k pages with 3-level
                // translation buffers, the user address space is limited to 39 bits
                // On darwin/arm64, the address space is even smaller.
+               // On AIX, mmaps starts at 0x0A00000000000000 for 64-bit.
+               // processes.
                for i := 0x7f; i >= 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)
@@ -641,6 +657,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
@@ -975,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()
@@ -1130,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.
@@ -1150,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
        )
 
@@ -1181,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
@@ -1205,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.
index f25bfa48aff029b638e41683bf8be9fb1b0517bd..a2d5864d3d4729cdbd108d3f3a73619e6da442a3 100644 (file)
@@ -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
index 617e88faa45a32b329e3b93138e95815a2e718bd..9c25b63348f5b6289b0caa2f74f153c4ea0e193e 100644 (file)
@@ -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 {
@@ -711,6 +720,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) {
@@ -723,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)
@@ -744,7 +754,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
                }
@@ -865,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))
@@ -877,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))
@@ -898,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
@@ -1128,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
@@ -1136,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
@@ -1171,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)
@@ -1242,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 {
index 063a5cbe3a6e01e146b34e4fcaf8beeb7388dde1..20f55e17c6eac3dba877a0244d3cfdf57f5e9e46 100644 (file)
@@ -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
                }
index 8270cf7b7d5b095bb299b96ec2cee52921e9eec7..e00a7569f944f9be8ba871018feac3bb5976b7e5 100644 (file)
@@ -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
                }
index 8f505f90a609cb6cf147239720e6e562ba772c01..2eac2b5bb584eccdcd61238413f35730052bc03b 100644 (file)
@@ -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
                }
index 93b20668fa7038010571500314c3ca4cb1adb91b..ee9468dd0e699cd9e0b006c0034173d832227655 100644 (file)
@@ -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)
+}
index 67d99900a2fbd044ec6385466410354d6c7e5868..2f00add83e43dab125c51d1397d3ee18967d0d4e 100644 (file)
@@ -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
index 13065b61d48e87bd972d47b03c8ff43c63f73e8f..84238d7279fb5d40355fbb182649a02adc8dbc8e 100644 (file)
@@ -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 && 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
+               // 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
        }
index 845f72ded2c1634f3a6eb4b1779a8569a5541ee2..1e45ed6301568f5a0b3d5a7b7c6d69d121557911 100644 (file)
@@ -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.
index 690f55eb5c83a42b42ce0ea83d189660060219ac..fc52ec59a05e0f082d207649901dc48e6793b7ed 100644 (file)
@@ -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
        }
 
index f4646db67aac5f99c4a8deed69caeb3ca0d5372f..4d4cdc14ca810660fe7fe740568ad3057de081d0 100644 (file)
@@ -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 = false
+
+// 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
@@ -1404,10 +1417,25 @@ 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.
                        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]))
+                               b.debugGen = gcWorkPauseGen
+                       }
                        // Flush the gcWork, since this may create global work
                        // and set the flushedWork flag.
                        //
@@ -1418,11 +1446,29 @@ 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
+                               // 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)
        })
 
        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,6 +1477,13 @@ top:
                goto top
        }
 
+       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
        // there are no grey objects and no more objects can be
@@ -1447,6 +1500,60 @@ 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=<nil>")
+                               } else {
+                                       print(" wbuf1.n=", gcw.wbuf1.nobj)
+                               }
+                               if gcw.wbuf2 == nil {
+                                       print(" wbuf2=<nil>")
+                               } else {
+                                       print(" wbuf2.n=", gcw.wbuf2.nobj)
+                               }
+                               print("\n")
+                               if gcw.pauseGen == gcw.putGen {
+                                       println("runtime: checkPut already failed at this generation")
+                               }
+                               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
        // this before waking blocked assists.
        atomic.Store(&gcBlackenEnabled, 0)
@@ -1924,7 +2031,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)
@@ -1934,6 +2041,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=<nil>")
+                       } else {
+                               print(" wbuf1.n=", gcw.wbuf1.nobj)
+                       }
+                       if gcw.wbuf2 == nil {
+                               print(" wbuf2=<nil>")
+                       } 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
@@ -1943,6 +2063,8 @@ func gcMark(start_time int64) {
                gcw.dispose()
        }
 
+       throwOnGCWork = false
+
        cachestats()
 
        // Update the marked heap stat.
@@ -1974,6 +2096,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 {
@@ -2023,6 +2148,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)
 }
index ab665615be5668802f45317683e9224a3086d9d2..7b01a117808fc4101b4d8d7420c5f9ef76a4de98 100644 (file)
@@ -153,6 +153,68 @@ func checkTreapNode(t *treapNode) {
        }
 }
 
+// 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 start or end on an mTreap.
+type treapIter struct {
+       t *treapNode
+}
+
+// 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 {
+       i.t = i.t.succ()
+       return i
+}
+
+// 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 treapIter{}
+       }
+       for t.left != nil {
+               t = t.left
+       }
+       return treapIter{t: t}
+}
+
+// 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 treapIter{}
+       }
+       for t.right != nil {
+               t = t.right
+       }
+       return treapIter{t: t}
+}
+
 // insert adds span to the large span treap.
 func (root *mTreap) insert(span *mspan) {
        npages := span.npages
@@ -164,10 +226,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")
@@ -233,14 +295,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 {
@@ -251,9 +312,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
@@ -271,15 +330,23 @@ 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
                }
        }
        root.removeNode(t)
 }
 
+// erase removes the element referred to by the current position of the
+// 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)
+}
+
 // 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) {
index 28260ab7060bb875f8a19d4161255a55c1ffe7d5..86416caab5288c80cb830fb0e361e7377771132c 100644 (file)
@@ -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
@@ -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() {
index 6733aa9b4a8aa17e155dd9a94b32475d900bd2e4..edb9fcac09026bfb14ab42322eacbd16b7c88f7c 100644 (file)
@@ -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.
index f2f20fcdac62608718bfdd2c8ff7fb2655bc77b3..f2c16d7d8c4dfcceee90d5b59fc1b9c6f075fb4d 100644 (file)
@@ -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")
@@ -86,6 +93,17 @@ 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
+
+       // 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
 }
 
 // Most of the methods of gcWork are go:nowritebarrierrec because the
@@ -104,10 +122,60 @@ func (w *gcWork) init() {
        w.wbuf2 = wbuf2
 }
 
+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))
+                       }
+                       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")
+               }
+       }
+}
+
 // 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) {
+       w.checkPut(obj, nil)
+
        flushed := false
        wbuf := w.wbuf1
        if wbuf == nil {
@@ -142,6 +210,8 @@ 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(obj, nil)
+
        wbuf := w.wbuf1
        if wbuf == nil {
                return false
@@ -163,6 +233,8 @@ func (w *gcWork) putBatch(obj []uintptr) {
                return
        }
 
+       w.checkPut(0, obj)
+
        flushed := false
        wbuf := w.wbuf1
        if wbuf == nil {
@@ -284,10 +356,12 @@ func (w *gcWork) balance() {
                return
        }
        if wbuf := w.wbuf2; wbuf.nobj != 0 {
+               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(0, wbuf.obj[:wbuf.nobj])
                w.wbuf1 = handoff(wbuf)
                w.flushedWork = true // handoff did putfull
        } else {
index 97a0448ad32d6f7935be1260b322f732012848ce..47e3a333911411b8c3d060bd6a89a6a833e3d1db 100644 (file)
@@ -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.
@@ -89,6 +88,33 @@ 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
+
+       // 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
@@ -133,6 +159,20 @@ type mheap struct {
        // (the actual arenas). This is only used on 32-bit.
        arena linearAlloc
 
+       // 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
+
+       // 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.
@@ -184,6 +224,29 @@ 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
+
+       // 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
@@ -364,6 +427,115 @@ 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.
+
+       // merge is a helper which merges other into s, deletes references to other
+       // in heap metadata, and then discards it. other must be adjacent to s.
+       merge := func(other *mspan) {
+               // 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)
+               }
+
+               // If before or s are scavenged, then we need to scavenge the final coalesced span.
+               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 other.scavenged {
+                       h.scav.removeSpan(other)
+               } else {
+                       h.free.removeSpan(other)
+               }
+               other.state = mSpanDead
+               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 {
+               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 {
+               if s.scavenged == after.scavenged {
+                       merge(after)
+               } else {
+                       realign(s, after, 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
@@ -591,6 +763,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)
@@ -610,67 +792,164 @@ 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))
        }
 }
 
-// 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<<j) != 0 {
+                                       s := ha.spans[arenaPage+uint(i)*8+j]
+                                       if atomic.Load(&s.sweepgen) == sg-2 && atomic.Cas(&s.sweepgen, sg-2, sg-1) {
+                                               npages := s.npages
+                                               unlock(&h.lock)
+                                               if s.sweep(false) {
+                                                       nFreed += npages
+                                               }
+                                               lock(&h.lock)
+                                               // Reload inUse. It's possible nearby
+                                               // spans were freed when we dropped the
+                                               // lock and we don't want to get stale
+                                               // pointers from the spans array.
+                                               inUseUnmarked = inUse[i] &^ marked[i]
+                                       }
+                               }
+                       }
                }
+
+               // Advance.
+               pageIdx += uintptr(len(inUse) * 8)
+               n -= uintptr(len(inUse) * 8)
        }
-       lock(&h.lock)
+       if trace.enabled {
+               // Account for pages scanned but not reclaimed.
+               traceGCSweepSpan((n0 - nFreed) * pageSize)
+       }
+       return nFreed
 }
 
 // alloc_m is the internal implementation of mheap.alloc.
@@ -681,27 +960,14 @@ func (h *mheap) reclaim(npage uintptr) {
 //go:systemstack
 func (h *mheap) alloc_m(npage uintptr, spanclass spanClass, large bool) *mspan {
        _g_ := getg()
-       lock(&h.lock)
 
        // To prevent excessive heap growth, before allocating n pages
        // we need to sweep and reclaim at least n pages.
        if h.sweepdone == 0 {
-               // TODO(austin): This tends to sweep a large number of
-               // spans in order to find a few completely free spans
-               // (for example, in the garbage benchmark, this sweeps
-               // ~30x the number of pages it's trying to allocate).
-               // If GC kept a bit for whether there were any marks
-               // in a span, we could release these free spans
-               // at the end of GC and eliminate this entirely.
-               if trace.enabled {
-                       traceGCSweepStart()
-               }
                h.reclaim(npage)
-               if trace.enabled {
-                       traceGCSweepDone()
-               }
        }
 
+       lock(&h.lock)
        // transfer stats from cache to global
        memstats.heap_scan += uint64(_g_.m.mcache.local_scan)
        _g_.m.mcache.local_scan = 0
@@ -732,6 +998,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 {
@@ -739,8 +1009,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.
@@ -847,19 +1115,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
        }
@@ -867,23 +1150,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
@@ -919,6 +1198,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
 
@@ -1030,6 +1319,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")
        }
@@ -1041,9 +1334,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.
@@ -1052,62 +1342,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 {
@@ -1121,21 +1357,19 @@ 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 {
+       // Use up scavenge credit if there's any available.
+       if nbytes > h.scavengeCredit {
+               nbytes -= h.scavengeCredit
+               h.scavengeCredit = 0
+       } else {
+               h.scavengeCredit -= nbytes
                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.end(); 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
@@ -1149,46 +1383,44 @@ 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
+               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
        }
+       // 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
 // 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.start(); t.valid(); {
+               s := t.span()
+               n := t.next()
                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)
+                               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
                        }
                }
-               // Move t forward to its successor to iterate over the whole
-               // treap.
-               t = next
+               t = n
        }
        return released
 }
index 587ebf476d388690b8062046a3c14c607aef0e66..305c84a7c1169b3cf70fd3a00d1bdf3eff3a5c4d 100644 (file)
@@ -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)
index c91cea254e9dacefeb1bb194941c899c0400c251..f444452bab502abe00a0a9d1adaa8dfd441161a7 100644 (file)
@@ -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 {
+       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]))
@@ -197,10 +204,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
@@ -217,14 +246,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 +306,6 @@ func wbBufFlush1(_p_ *p) {
 
        // Enqueue the greyed objects.
        gcw.putBatch(ptrs[:pos])
+
+       _p_.wbBuf.reset()
 }
index c478d4b0d89b257d0cf833849256b53f8df57f5b..d0349191c6d307b00758e5bb89a89f8d63d8e389 100644 (file)
@@ -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
 }
 
index 03dd95bf175d20c48d18b1948b08e38b412da822..2e1ec58a0d9be1b4ebf848128ca3b3eb0e3afea6 100644 (file)
@@ -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)
@@ -872,24 +879,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(), r.lr(), gp, mp)
 }
 
 func profileloop1(param uintptr) uint32 {
index 3115f7241dbeb3904f42df7c15e3bea60d5450f4..10aff75e31191bc5b04051978d9308b28a0f9c77 100644 (file)
@@ -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() {
index 5b989d28e98af75b39b8033122b5d49a30333c1d..bb83be4715d3a450b6f289aee9f2e5dfefb13532 100644 (file)
@@ -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
@@ -720,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
@@ -743,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 {
index 1baa096a49c80ae782340c55a940ec0cf26c8b64..9cad866df8c7f90560706c59fa3540182077af65 100644 (file)
@@ -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 {
index a1089c8fdf90d50467e1ba3e6f884e8b8cbfca21..7c6043ffdb2e830cbe39b38586d1f3a123c01ac1 100644 (file)
@@ -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.
@@ -321,6 +325,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
        }
@@ -1002,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)
+       }
+}
index bd5c8f7afcb8526bcd2d2c49b108a7d2adb3dcdc..7864dd79ad0c64e68960d79c0f623b37f2e102c2 100644 (file)
@@ -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 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])
index 7b2e4f40ffe06c4797163df895310d799d8e8a9e..e605eb34cb90a52a60849e55eb445b7d2fa895c0 100644 (file)
@@ -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
        }
index 837fa93bfac0c1ecb690edea2c779d14256b9629..6e56b4b1d1b6fee4817e54c6a26eec1242f8726d 100644 (file)
@@ -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 {
@@ -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:
@@ -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()
@@ -3300,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(bv.n)*sys.PtrSize, 0, bv.bytedata)
+                       }
                }
        }
 
@@ -3742,6 +3747,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)
        }
@@ -4592,7 +4600,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 {
index ad325987ac4d12f585cb7a567b031e015a42fabc..1715324aa09d296c341fb1a983399352f455a6f1 100644 (file)
@@ -891,11 +891,22 @@ 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)
        }
 }
index 08d53a10d2ba53471ce2daf43b69931b4cb33840..adb2198c55470b82649a76a929d365335506f71a 100644 (file)
@@ -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 {
index 1c66c636956a82b0f62da1c71a5bcc79145eebd4..be53b4c37c9a2d9dd86b4cf29e25a32e3013becc 100644 (file)
@@ -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.
index 95e965411b76da911ef598326211fc5a8ef6fb8c..d298e805cfaec3c0a18ea8d5cc5e975fd7a449d2 100644 (file)
@@ -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 (file)
index 0000000..65bc1ec
Binary files /dev/null and b/src/runtime/race/race_linux_arm64.syso differ
diff --git a/src/runtime/race_arm64.s b/src/runtime/race_arm64.s
new file mode 100644 (file)
index 0000000..48b119f
--- /dev/null
@@ -0,0 +1,471 @@
+// 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 race
+
+#include "go_asm.h"
+#include "funcdata.h"
+#include "textflag.h"
+#include "tls_arm64.h"
+
+// The following thunks allow calling the gcc-compiled race runtime directly
+// from Go code without going all the way through cgo.
+// First, it's much faster (up to 50% speedup for real Go programs).
+// Second, it eliminates race-related special cases from cgocall and scheduler.
+// Third, in long-term it will allow to remove cyclic runtime/race dependency on cmd/go.
+
+// A brief recap of the arm64 calling convention.
+// Arguments are passed in R0...R7, the rest is on stack.
+// Callee-saved registers are: R19...R28.
+// Temporary registers are: R9...R15
+// SP must be 16-byte aligned.
+
+// When calling racecalladdr, R9 is the call target address.
+
+// The race ctx, ThreadState *thr below, is passed in R0 and loaded in racecalladdr.
+
+#define load_g \
+       MRS_TPIDR_R0 \
+       MOVD    runtime·tls_g(SB), R11 \
+       ADD     R11, R0 \
+       MOVD    0(R0), g
+
+// func runtime·raceread(addr uintptr)
+// Called from instrumented code.
+TEXT   runtime·raceread(SB), NOSPLIT, $0-8
+       MOVD    addr+0(FP), R1
+       MOVD    LR, R2
+       // void __tsan_read(ThreadState *thr, void *addr, void *pc);
+       MOVD    $__tsan_read(SB), R9
+       JMP     racecalladdr<>(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
+       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
+       MOVW    ret+16(FP), R1
+       ADD     R0, R1, R0
+       MOVW    R0, ret+16(FP)
+       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
+       MOVD    ret+16(FP), R1
+       ADD     R0, R1, R0
+       MOVD    R0, ret+16(FP)
+       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.
+// 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
index 8b92fcbdb72c7b599d30a8a2f9413c43be6f3dbe..50adbe22256da7ba81b48ea160fa353bc51902f6 100644 (file)
@@ -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
index f81451543830d5d7818e36c0b736ec99048d7a11..1265b158532f8f02fb9a1c336abc7aa169595580 100644 (file)
@@ -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)
index 510c08c286ca02d02f67c8a78e29f9d15b889a10..48960b7f6133f5d5ed4d12ba0b0b5d3279a35f12 100644 (file)
@@ -353,7 +353,8 @@ class IfacePrinter:
                        return "<bad dynamic type>"
 
                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()
@@ -528,11 +529,17 @@ class GoroutineCmd(gdb.Command):
                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()
index 2c1653172e8f9254af21931f334bcee6c017b6d7..a988d1d702d950b3d92227199b167ffb028156b2 100644 (file)
@@ -26,18 +26,20 @@ 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":
+               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")
index 8b8f4dcb1e98066269c4ce0dff642a3c45bf6b82..c5667e73adc4d739bb2a3db684409ccd37da05f1 100644 (file)
@@ -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},
index 66dd1b19c13b3d2e174d5f7769cf8d1af91976e6..df9cbaef203e770510a8d1e0d829219f7b7c7504 100644 (file)
@@ -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
@@ -858,12 +869,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
 )
index 2729c2ecf98a225e86fbf5d5de010833d25fd569..85be1bc64da0f0369983eca56566255b9fe59b4a 100644 (file)
@@ -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 {
index 97bb13b4f3e1ffc95440759adc832edd132995cb..f796550e60c0da003b329da4b7f96b22d35177d6 100644 (file)
@@ -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
 }
index 12a938c8c930707ce16d534406703798a7e88794..15f1799801921d2bb83f628b360beffaff5b66fa 100644 (file)
@@ -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
index e8a64da657961b9d8ee89ccf7c85aad07dbb8720..3fc1ec5886d8c12e67e82acb6bbb0d0508ff7f98 100644 (file)
@@ -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
        }
@@ -117,10 +132,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
 }
 
index 65aa7dbd5993d5e7f5241ca80e57e2d8f11c6f6a..85902a6b68eea8ac85b90e3efba651e27bbd474f 100644 (file)
@@ -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 {
index bb4fd2cc832c6ba2412edf1e46d54d4edb64b1bb..d4698e805c7c2bb06b0261346f29c3cd92abe956 100644 (file)
@@ -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)
 
@@ -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
index edda45c669f67e71493e69330b04788e79a7cafe..17e342ef699a017c2849d6b8b50a1b36222ff591 100644 (file)
@@ -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,86 @@ 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:]
+                       continue
                }
-               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
+               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--
                }
-       }
-
-       frame = se.pcExpander.next()
-       if elideWrapper && frame.File == "<autogenerated>" {
-               // 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
-               }
-               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,
+               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 +235,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
@@ -606,9 +466,32 @@ 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 {
+               // 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)
+                       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.
@@ -616,12 +499,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
@@ -629,6 +522,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)
@@ -862,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 {
@@ -943,8 +851,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)
 }
index f126be83e52d7219df9b5468072f65ce09bf3aff..2f17091327dae730960b52a0d55dda1d62b56b66 100644 (file)
@@ -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()
index a14b3db494eb33d1fe39b6d134e7c36ba7ec677b..1bc1a63c285fbfeacd799b6a893d4bd6a2cab929 100644 (file)
@@ -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 {
index 07b0bb54af9d5969f8ce6292a668660e6cafd5e9..8c128811b9f5d8ff9d9cf54c9359aad472997ce7 100644 (file)
@@ -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()
index 9d100057a89f6c7633a87bc539c3fb8000827dcb..f99cb00ab8cf09740aecadce96e26e7305f8c316 100644 (file)
@@ -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 {
index f0450670668988feb2bfbae9caa528ae05a3243c..54c7afbf34395372230f9b5ac7c3a4f7217d55a3 100644 (file)
@@ -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 {
index 10d853435901548c0c7e1fa57c48faebc9ad01f5..29951d8ad7247fad8064038232ac34346cc31600 100644 (file)
@@ -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 {
index bf01099830799c0a8fe8989a51c95d1e3dfd9571..6835f434de4fca616f107923c47ccbf7710b3bfc 100644 (file)
@@ -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
index 52d3638bc18c1f5e7e2e1c0021584691dab5ca99..94ac5d599d2fd01dc905b9d4ddff75d5d447383a 100644 (file)
@@ -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
index 3ca844a4c73c5e68665d7630ffd58160e3ba816e..6e28656340d79464b9d1fd8f4922b558f47a7906 100644 (file)
@@ -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
 
index 60a85b8ffb8883d99a956b698f37c68de5bc6d7d..60be74b95cf021e5b74ba7313bcba411affd3101 100644 (file)
@@ -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
index 376e22d59a7f8339d2587ed9863382010404f96f..7f2bcbe9d95bb4625b52cc69c710fe82a188ac0c 100644 (file)
@@ -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
index 0882e9cb73b6d28e570976d09f3bd30ccefd9992..3ad651297677481ca15b296ac48c7ce24e5e94f3 100644 (file)
@@ -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) {
diff --git a/src/runtime/testdata/testprog/gettid.go b/src/runtime/testdata/testprog/gettid.go
deleted file mode 100644 (file)
index 1b3e29a..0000000
+++ /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
-}
index 88c0d12e4c11b4dd09fbc251584db965aaab5732..fd3123e64743fbd8a13e1bb65e872634769ea493 100644 (file)
@@ -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,100 @@ 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 {
+                       if err == errNotPermitted {
+                               println("unshare not permitted")
+                               os.Exit(0)
+                       }
+                       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")
+}
index a22fee61d78255d5c237ec7747be5fe5ae23f183..7b134bc0784031ddcd0156e3135fb43ddd574f2a 100644 (file)
@@ -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()
similarity index 55%
rename from src/cmd/vet/testdata/cgo/cgo3.go
rename to src/runtime/testdata/testprog/syscalls.go
index 0b1518e1f930a572b5497da80346805b6ceab7f3..098d5cadf8a48e8eb5de9a7e8a778e19a4eef12a 100644 (file)
@@ -2,12 +2,10 @@
 // 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 main
 
-package testdata
+import (
+       "errors"
+)
 
-import "C"
-
-func F() {
-}
+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 (file)
index 0000000..b8ac087
--- /dev/null
@@ -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)
+}
similarity index 68%
rename from src/runtime/testdata/testprog/gettid_none.go
rename to src/runtime/testdata/testprog/syscalls_none.go
index 036db87e10ea6d36a8e419ff1d6f22fe6058d98d..7f8ded3994f18efa788fbd39b4ef913c1edbd564 100644 (file)
@@ -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
+}
index 4460b9304e5cf750fb213ac63f293350498f9c78..00f2c42e93caeca9e8f305ec9dae7c07bdc32d00 100644 (file)
@@ -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;
 }
 
index 3da82961b9b74a21d5fe6da480e55d38a91180bf..37a2a1ab6590af9ff69e91fea48b16823db675b5 100644 (file)
@@ -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);
 }
 
index 929e9b36a909b4687d9c553403cce0b4eb9350f8..d1bb52cc004ace189fab6ee84fa16982d320905f 100644 (file)
@@ -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
index e2c945d183a24688ff4594fe4e7c2bcc8413c74f..400c16a1775820cdba79b316b917449c7c0d8642 100644 (file)
@@ -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
 
index d5a7d003fe2fc58a26dff8a653c195134c231a8f..82cb232dba95e515cb40243f819a4bad0fadd28f 100644 (file)
@@ -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 {
index 9d2f7f037c829ea030ffc5079c4fbd0a96605f55..a536fb2a7166ccf41e6cd19ddb322bee29cd7c6d 100644 (file)
@@ -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
@@ -179,6 +178,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 +344,46 @@ 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
-                               }
+                       pc := frame.pc
+                       // backup to CALL instruction to read inlining info (same logic as below)
+                       tracepc := 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] = 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.
+                       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] = pc
+                               n++
+                       }
+                       lastFuncID = f.funcID
+                       n-- // offset n++ below
                }
 
                if printing {
@@ -395,32 +393,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(name)
-                       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 = 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"
                                }
@@ -447,11 +452,10 @@ func gentraceback(pc0, sp0, lr0 uintptr, gp *g, skip int, pcbuf *uintptr, max in
                                print("\n")
                                nprint++
                        }
-                       elideWrapper = nextElideWrapper
+                       lastFuncID = f.funcID
                }
                n++
 
-       skipped:
                if f.funcID == funcID_cgocallback_gofunc && len(cgoCtxt) > 0 {
                        ctxt := cgoCtxt[len(cgoCtxt)-1]
                        cgoCtxt = cgoCtxt[:len(cgoCtxt)-1]
@@ -673,7 +677,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)
        }
 }
@@ -760,11 +764,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 {
@@ -772,7 +775,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)
        }
 }
@@ -781,27 +784,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 = 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"
        }
@@ -811,7 +803,6 @@ func printAncestorTracebackFuncInfo(f funcInfo, pc uintptr) bool {
                print(" +", hex(pc-f.entry))
        }
        print("\n")
-       return elideWrapperCalling(name)
 }
 
 func callers(skip int, pcbuf []uintptr) int {
@@ -829,15 +820,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.
@@ -848,11 +843,8 @@ func showfuncinfo(f funcInfo, firstFrame, elideWrapper bool) bool {
                return false
        }
 
-       if elideWrapper {
-               file, _ := funcline(f, f.entry)
-               if file == "<autogenerated>" {
-                       return false
-               }
+       if funcID == funcID_wrapper && elideWrapperCalling(childID) {
+               return false
        }
 
        name := funcname(f)
@@ -876,12 +868,12 @@ 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
-// function "name" should be elided from stack traces.
-func elideWrapperCalling(name string) bool {
+// elideWrapperCalling reports whether a wrapper function that called
+// 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{
index 88a44a37ed3da17bfe4935cb69ca5b449354f0e2..f7f99924eaf759bf63cacd087eb16b0e508f317f 100644 (file)
@@ -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 {
index 9827874beabcfb34450ec0b7b0a75aec15374048..71ba4ce4161b665c6af4574fc7a4fdc1d5588936 100644 (file)
@@ -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 {
index 7282b26ec4b6f7b6d1929101982462c65e61f0b5..dd5bb3762e364bff87a8baf4d809c63f5795a4dc 100644 (file)
@@ -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
index bbfdb7dc3934e8719234f978999d09ca4e75edd9..ff33d555e49830d343cfb51d9747f94a935c501d 100644 (file)
@@ -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"
 
index cba898426afe760c5bc09e2496a0463b3ffa0131..8db725f96ae5c0914c69484dd817d00883cda0cf 100644 (file)
@@ -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.
index 4aaf57830cf71c80e70faa77e68a7027c1ba7a16..45e4192c82e16f439dd709bd02a1a9481a259040 100644 (file)
@@ -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)
 }
index 103ef51f29edb758fa4e1ac88086be67779a3ab4..e31054a4e0b31355e51ed3d2f904d785bc688503 100644 (file)
@@ -199,12 +199,18 @@ 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
 }
 
+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 "))
diff --git a/src/syscall/asm_aix_ppc64.s b/src/syscall/asm_aix_ppc64.s
new file mode 100644 (file)
index 0000000..7eb9ffb
--- /dev/null
@@ -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)
index e5b8357af70a185b3da8004994cf5ccb84062231..e5f5eb3f8aa1dc612cb520645ad9b1ffea1959ed 100644 (file)
@@ -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
 
index 816334226fd8fea465424fd28c031380118f0146..c57cd34f8225be540cd7119d2337ff5b9890256d 100644 (file)
@@ -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.
index 7ae3177fdc087859dc4834fe064a02095885e9a1..6c761f85c441882e0b5d2adc4c947c834fe209d8 100644 (file)
@@ -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)
index 9745236dcb8a6d632f01140ddbb7522a33c29fe3..c9eab43b6bc2f168bfdc80de24d329a1f81d5a36 100644 (file)
@@ -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)
-}
index 58d8216f2112898653f032d819a784e21a7b1fa2..fcc5f038b823c10d481a3e835976b2d8bbedc859 100644 (file)
@@ -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 (file)
index 7f65409..0000000
+++ /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 (file)
index 0000000..6b7f39b
--- /dev/null
@@ -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)
+}
index 19cdedc309ad6e63204df2b4d5e3975af4bb83b0..0893db022d356255ea86f5fc1b11e02e77ed6b92 100644 (file)
@@ -107,13 +107,15 @@ 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                 |
 //  | 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
index b4d2e66faf76e25dd98d1d078f28879842bff412..c14d2cc24c90b8c5d08fe29db33218bc5e00975c 100644 (file)
@@ -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)
index 19c4d591e60e71dddc4dcda681bd6d727dc3017e..61f45f57905b6ce5a79670cb7238a9e0dd53662c 100755 (executable)
@@ -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=
index e75ba1502a94aadd8d461e9fe077efa3b56e500d..d5f5c8d6d62b2ff5908f2a367b9683980c6998c6 100644 (file)
@@ -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
index 272d3afc38745108d91ece0f13e2067da9068aac..531fa80d8f1af1c6f685114bb01761bbdd552c60 100644 (file)
@@ -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.
index 5020033bad58aff6654a4a37fb8761154c4526a4..954148012fac1c6645a114379ea678c773e42479 100644 (file)
@@ -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)
 }
 
index 28cf05e0f778bab10db72abd65ff349271cc94be..80e42b0aec8cb2b3967f28eece8b98c74ec82c7a 100644 (file)
@@ -267,12 +267,9 @@ 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)
-//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)
@@ -291,7 +288,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 +320,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 +340,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
index 56f65e4af4fef6d8422bd30f1bd7b5f748866375..045ebc726b813c667ea98fdc9f6fc96531d79989 100644 (file)
@@ -14,7 +14,14 @@ 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
+//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
+//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)
index 8d7c23bb28bf0394cbb3d234557efd16c9c512f3..7b6493bf9fe585dc459e305da446b36d435dc10f 100644 (file)
@@ -14,7 +14,14 @@ 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
+//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
+//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)
index b81464ae3cdc65dca3f45c128d61fda7d9c12385..cb7489ed7beed423127c5b821547ec08d7388050 100644 (file)
@@ -14,7 +14,19 @@ 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)
@@ -52,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
index 47298844ad2a7306a6ffce8caab8502c9e106915..57902d45c635831e5eb23989ce0b593953aa8aea 100644 (file)
@@ -14,7 +14,19 @@ 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)
@@ -52,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
index adeb9c285274626e357aa4d887d92de472cc59bd..87a27b1ff74c21da15366b7151f75b280ca15ce6 100644 (file)
@@ -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),
        }
 }
 
index 6822eec8359cabdaefc26c96dbf1f8b8ad3c856d..2e1a9ec9f1fef01cdd7019844986a1f153577a66 100644 (file)
@@ -74,6 +74,7 @@ const (
        SIGKILL
        SIGTRAP
        SIGQUIT
+       SIGTERM
 )
 
 func (s Signal) Signal() {}
index 6ae6e86a50a01c731f0c83575a28d866b57a894f..758ff7b129dd26bf5c881c9978b3797466322bea 100644 (file)
@@ -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 {
@@ -707,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)
@@ -981,25 +932,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 +1485,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 +1819,53 @@ 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 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) {
@@ -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"
index bfb3037a6a14da18e6a5046cb9d3b61c8813e649..a688192501b329c08baea791f733bb9e53ad3acb 100644 (file)
@@ -91,16 +91,10 @@ 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
        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
@@ -137,8 +131,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 +195,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 +231,19 @@ 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___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
+       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)
index 6d8442dc836ba2618f6e5c2926f5fc6893afdf62..afc3d72d8d7cd102951e3c242463780e04227fa3 100644 (file)
@@ -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 {
@@ -707,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)
@@ -981,25 +932,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 +1485,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 +1819,53 @@ 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 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) {
@@ -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"
index 6253d2801bc4c389d57f6beb4f6f6584e0c95d09..21ab38e3eedded368e81363deb7a3b506ec89d64 100644 (file)
@@ -91,16 +91,10 @@ 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
        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
@@ -137,8 +131,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 +195,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 +231,19 @@ 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___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
+       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)
index be695abff39f41d496e8387d214e3632a1e57546..80ef9e514fbb18a792b5bdcca9b940fbcbdf7c80 100644 (file)
@@ -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 {
@@ -707,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)
@@ -981,25 +932,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 +1485,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 +1819,46 @@ 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 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 {
+               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 +1873,91 @@ 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 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)
+       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"
index 8fe7d12e561c75800db30883da3c53f4f692e408..f9978d755d49e4f610aa6272ee3ddd11b29c4ae7 100644 (file)
@@ -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
@@ -91,16 +93,10 @@ 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
        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
@@ -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,21 @@ 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_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
+       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_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
+       JMP     libc_statfs(SB)
+TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
+       JMP     libc_fstatat(SB)
index 726f63d17050cb13b84f5889ab2f46c7625fe3c8..a917176a31e1859723a8bc1c123ebf98f16c8484 100644 (file)
@@ -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 {
@@ -707,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)
@@ -981,25 +932,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 +1485,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 +1819,46 @@ 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 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 {
+               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 +1873,91 @@ 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 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)
+       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"
index 98d0bdc3a8fbe1269bd54d840ef61014074370b0..7ef24e534d0665cf2e59580f07989f4c7c5fb525 100644 (file)
@@ -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
@@ -91,16 +93,10 @@ 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
        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
@@ -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,21 @@ 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_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
+       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_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
+       JMP     libc_statfs(SB)
+TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
+       JMP     libc_fstatat(SB)
index 3ca31f287272d44464a0d02e264289e099786133..27d82dea1028ba8d270438571c26514ae118cd10 100644 (file)
@@ -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 {
index 797a3bab088d6a3a4c1a21911331b9f5782aa53e..8abfbb45d692ac12a0b6dd66288abaa1c1fb754e 100644 (file)
@@ -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 {
index 9be8752e18bae6f05c3e0da6eb7448382145328f..ff552a6a63f9da4f4836a5646e7bd5417967a01c 100644 (file)
@@ -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 {
index e75043f2c67ceb2e6ae496eb0dc963ee847d66cd..acadf4b48ca1ea19f5d36b4f9fcd6c70af81e818 100644 (file)
@@ -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 {
index 90f86dc373ad23e8b70f127c04676b43703761ae..8dd8cbc17e267212925c1c3d875dc6a11cc80acd 100644 (file)
@@ -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 {
index 8c989714a1c4369680838b28b3103c9990a3c726..5a6d51be592f99dfad5cae94fe445715b375597f 100644 (file)
@@ -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++ {
index 0bc222c0bb33873529b65979d3c1a0b4e7ed4813..3068630e8a97685c686ca988913d58d9693ec308 100644 (file)
 // 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
 // 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,
@@ -606,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")
        }
 }
 
index 54c76f09e146701d101d94b0cd2905af78d162f6..7dffbfad5e47d6bba9b3fbf447fb8b58d283d181 100644 (file)
@@ -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 {
index b495217c0686fdab7c466c26ca7063e0133ffba2..d8d4070d5b51a1661344c11cf0e0fa0df39c920d 100644 (file)
@@ -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)
 
index b11b77c63441841a3bf6bb8c7c6abf36848190a2..a1f15869ea8d365f4df15f58c5fef24794c846e8 100644 (file)
@@ -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++
index dd2f70b6519580a4f9be4bcbd654f00ca87e810f..ce85b128ca4dc866515d2303e858b13d60c2371f 100644 (file)
@@ -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
index e16c4aeacbe6fee00c59f2f29f9a456b19f4ff7c..272761d9363a4256c0254f247177234ee94ad6a7 100644 (file)
@@ -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
index 93862003fdbe27f2effaf0c967a6705efb06ae69..5357eec50fd65f4937ae9cab9f61b6bb018dc62c 100644 (file)
@@ -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
 
index 8fa3b7e11cdf6f83cd8730dd99b42596cdbae534..fb1fb8518efc701b5e5a441aeabd1b255bee9469 100644 (file)
@@ -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
 
index 9675e38bdb1a76922fcd83ffa4b15edbe64a7b9a..8dce9247cd45ef710ef728c1d85d1e2d7c28e9e4 100644 (file)
@@ -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 {
index 2cc294897acac7892e6f3acb4e9ec1bce8ef4590..e5671774edfffc31e243b6cb4bc27a5e93cff51b 100644 (file)
@@ -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)
index 32039c16ae3f6b3fd62d48c42ec80c84e43f2aa6..aa82d43f4981e691902ce9ef1c8e3776f700eda8 100644 (file)
@@ -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
+}
index 977cbe6eb13179b010ec4359c460f20ce4fdddf3..44ab2c02b757837fc6accd93b8ea8537a40dc02f 100644 (file)
@@ -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"
@@ -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)
+}
diff --git a/test/codegen/zerosize.go b/test/codegen/zerosize.go
new file mode 100644 (file)
index 0000000..cd0c83b
--- /dev/null
@@ -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) {
+}
index 03283a37f8470ac283061ee98459641c7c8ee979..e26ecd5275032d2b0ed8793f73d3c0d23cdce8b5 100644 (file)
@@ -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"
+}
index 7305c6063ccdc8193e9f7a9d525c445f1369019e..2af8800171ed4f7991006c6fbc999644ee178813 100644 (file)
@@ -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
 
index 1b65ffc1f0eec68f2fdafe403bd64b4054368e15..e07a4b22ce25dadca544ff7e8f2443e261a7d735 100644 (file)
@@ -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"
index f67c3bb66d7ee4f01684191086388f1cb2d26865..0bc33e92ce297f457ee8e72bd367762f0d39832b 100644 (file)
@@ -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
diff --git a/test/fixedbugs/issue23311.dir/main.go b/test/fixedbugs/issue23311.dir/main.go
new file mode 100644 (file)
index 0000000..fa4cf76
--- /dev/null
@@ -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.
+
+package main
+
+import _ "unsafe" // for linkname
+
+//go:linkname f runtime.GC
+func f()
+
+func main() {
+       f()
+}
similarity index 70%
rename from src/runtime/testdata/testprog/empty.s
rename to test/fixedbugs/issue23311.go
index c5aa6f8a54661f840d41ffb1602a101a42009e82..128cf9d06ad6ed5c0d03c3889cf3ea483ad289af 100644 (file)
@@ -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 runtime.
+package ignored
diff --git a/test/fixedbugs/issue23734.go b/test/fixedbugs/issue23734.go
new file mode 100644 (file)
index 0000000..dd5869b
--- /dev/null
@@ -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()
+}
diff --git a/test/fixedbugs/issue23780.go b/test/fixedbugs/issue23780.go
new file mode 100644 (file)
index 0000000..71fc2d9
--- /dev/null
@@ -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
diff --git a/test/fixedbugs/issue23781.go b/test/fixedbugs/issue23781.go
new file mode 100644 (file)
index 0000000..5c03cf7
--- /dev/null
@@ -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
diff --git a/test/fixedbugs/issue24488.go b/test/fixedbugs/issue24488.go
new file mode 100644 (file)
index 0000000..b3deab4
--- /dev/null
@@ -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()
+}
diff --git a/test/fixedbugs/issue24760.go b/test/fixedbugs/issue24760.go
new file mode 100644 (file)
index 0000000..cd6f124
--- /dev/null
@@ -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
diff --git a/test/fixedbugs/issue27201.go b/test/fixedbugs/issue27201.go
new file mode 100644 (file)
index 0000000..0c9611f
--- /dev/null
@@ -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")
+       }
+}
diff --git a/test/fixedbugs/issue27695c.go b/test/fixedbugs/issue27695c.go
new file mode 100644 (file)
index 0000000..948191c
--- /dev/null
@@ -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)
+}
diff --git a/test/fixedbugs/issue28078.go b/test/fixedbugs/issue28078.go
new file mode 100644 (file)
index 0000000..2e4c4b5
--- /dev/null
@@ -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 (file)
index 0000000..b0631bb
--- /dev/null
@@ -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 (file)
index 0000000..47cc16d
--- /dev/null
@@ -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<<uintptr(unsafe.Pointer(nil)), 0)
+}
diff --git a/test/fixedbugs/issue28079c.go b/test/fixedbugs/issue28079c.go
new file mode 100644 (file)
index 0000000..bea1898
--- /dev/null
@@ -0,0 +1,15 @@
+// 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 shifts.
+
+package p
+
+import "unsafe"
+
+func f() {
+       _ = complex(1<<uintptr(unsafe.Pointer(nil)), 0) // ERROR "invalid operation: .*shift of type float64.*"
+}
diff --git a/test/fixedbugs/issue28445.go b/test/fixedbugs/issue28445.go
new file mode 100644 (file)
index 0000000..5726140
--- /dev/null
@@ -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()
+       }
+}
diff --git a/test/fixedbugs/issue28450.go b/test/fixedbugs/issue28450.go
new file mode 100644 (file)
index 0000000..1a1183b
--- /dev/null
@@ -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"
+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"
+       valid(...int)
+}
diff --git a/test/fixedbugs/issue28688.go b/test/fixedbugs/issue28688.go
new file mode 100644 (file)
index 0000000..0d2000e
--- /dev/null
@@ -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")
+       }
+}
diff --git a/test/fixedbugs/issue28797.go b/test/fixedbugs/issue28797.go
new file mode 100644 (file)
index 0000000..480c105
--- /dev/null
@@ -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/fixedbugs/issue29013a.go b/test/fixedbugs/issue29013a.go
new file mode 100644 (file)
index 0000000..efc50df
--- /dev/null
@@ -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 (file)
index 0000000..b8502da
--- /dev/null
@@ -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/fixedbugs/issue29190.go b/test/fixedbugs/issue29190.go
new file mode 100644 (file)
index 0000000..c0c4bb1
--- /dev/null
@@ -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/fixedbugs/issue29215.go b/test/fixedbugs/issue29215.go
new file mode 100644 (file)
index 0000000..df703aa
--- /dev/null
@@ -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"
+}
diff --git a/test/fixedbugs/issue29220.go b/test/fixedbugs/issue29220.go
new file mode 100644 (file)
index 0000000..bbfe930
--- /dev/null
@@ -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]))
+}
diff --git a/test/fixedbugs/issue29264.go b/test/fixedbugs/issue29264.go
new file mode 100644 (file)
index 0000000..3781559
--- /dev/null
@@ -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)
+       }
+}
diff --git a/test/fixedbugs/issue29304.go b/test/fixedbugs/issue29304.go
new file mode 100644 (file)
index 0000000..47bc99f
--- /dev/null
@@ -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")
+       }
+}
diff --git a/test/fixedbugs/issue29329.go b/test/fixedbugs/issue29329.go
new file mode 100644 (file)
index 0000000..7818bca
--- /dev/null
@@ -0,0 +1,107 @@
+// +build cgo
+// 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()
+}
diff --git a/test/fixedbugs/issue29350.go b/test/fixedbugs/issue29350.go
new file mode 100644 (file)
index 0000000..9d59f6f
--- /dev/null
@@ -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'
diff --git a/test/fixedbugs/issue29362.go b/test/fixedbugs/issue29362.go
new file mode 100644 (file)
index 0000000..a8bd607
--- /dev/null
@@ -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)
+       }
+}
diff --git a/test/fixedbugs/issue29362b.go b/test/fixedbugs/issue29362b.go
new file mode 100644 (file)
index 0000000..d1e3b47
--- /dev/null
@@ -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)
+       }
+}
diff --git a/test/fixedbugs/issue29389.go b/test/fixedbugs/issue29389.go
new file mode 100644 (file)
index 0000000..43859fd
--- /dev/null
@@ -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
+}
diff --git a/test/fixedbugs/issue29402.go b/test/fixedbugs/issue29402.go
new file mode 100644 (file)
index 0000000..8a1f959
--- /dev/null
@@ -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")
+       }
+}
diff --git a/test/fixedbugs/issue29562.go b/test/fixedbugs/issue29562.go
new file mode 100644 (file)
index 0000000..cbcd77d
--- /dev/null
@@ -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 == "") {
+       }
+}
diff --git a/test/fixedbugs/issue29610.dir/a.go b/test/fixedbugs/issue29610.dir/a.go
new file mode 100644 (file)
index 0000000..ccbe451
--- /dev/null
@@ -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 (file)
index 0000000..c2016de
--- /dev/null
@@ -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 (file)
index 0000000..29437bf
--- /dev/null
@@ -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 (file)
index 0000000..8d49ba6
--- /dev/null
@@ -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
diff --git a/test/fixedbugs/issue29735.go b/test/fixedbugs/issue29735.go
new file mode 100644 (file)
index 0000000..7a0381d
--- /dev/null
@@ -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
diff --git a/test/fixedbugs/issue29870.go b/test/fixedbugs/issue29870.go
new file mode 100644 (file)
index 0000000..b79860c
--- /dev/null
@@ -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 (file)
index 0000000..1bac566
--- /dev/null
@@ -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"
+}
diff --git a/test/fixedbugs/issue29919.dir/a.go b/test/fixedbugs/issue29919.dir/a.go
new file mode 100644 (file)
index 0000000..cfccc4a
--- /dev/null
@@ -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 (file)
index 0000000..3e99ca8
--- /dev/null
@@ -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 (file)
index 0000000..6d97592
--- /dev/null
@@ -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
diff --git a/test/fixedbugs/issue29943.go b/test/fixedbugs/issue29943.go
new file mode 100644 (file)
index 0000000..ff47de5
--- /dev/null
@@ -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)
+               }
+       }
+}
diff --git a/test/fixedbugs/issue30041.go b/test/fixedbugs/issue30041.go
new file mode 100644 (file)
index 0000000..7d8a169
--- /dev/null
@@ -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) {}
diff --git a/test/fixedbugs/issue30061.go b/test/fixedbugs/issue30061.go
new file mode 100644 (file)
index 0000000..5092b01
--- /dev/null
@@ -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)))
+}
index 6bf315fcc2f0603835911f4739969d751ec92655..6304ce073aa9e558dbc884b2d71a382e600f2ebd 100644 (file)
@@ -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)) })
index 5e16c78b4d9b3cfe9a7cba2e64d0294704b55b2c..f13258854e5c45e72de8bf1447271e576545e662 100644 (file)
@@ -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)
index 08fef0f1286915f02a19bc367b52d34aa3d45470..ce8d09a2769e22fe9f7edb4d2d76ab610f1113d8 100644 (file)
@@ -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")
 }
index 79039a6bb532ebe16f7052b2ddbedc5d5e8bed54..daff145a9229fec989afeb146ca1bbf69d37df9b 100644 (file)
@@ -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},
index 6df6861951281b3cf91c21610bb0f6f881f5ff6b..ee7d6470728cb916c34f3c4e2f73cfa9a1edb31c 100644 (file)
@@ -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,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.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"},
 }
 
index b4bf797497f0c0949fba7544bc334ae6c0ad10b1..81f2524e95598c87fa9c979311fabb2a4470f9ab 100644 (file)
@@ -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
index 8d674a709821247867af5c381364a23623cf44d9..90f57c54b6c9cb844d021acffa01e3904f28a4d6 100644 (file)
@@ -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"
index 6aa718e027cda71991c76b338128487c3373b6d4..e0f2ed9767659864be3a37d57701652dcbb5cb6e 100644 (file)
@@ -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 (file)
index df29cdc..0000000
+++ /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 (file)
index 0000000..2c48c0b
--- /dev/null
@@ -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 (file)
index 0000000..1427807
--- /dev/null
@@ -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 "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"
+}
diff --git a/test/nilptr5_wasm.go b/test/nilptr5_wasm.go
new file mode 100644 (file)
index 0000000..6ef8a02
--- /dev/null
@@ -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 (file)
index 0000000..ea5fcc3
--- /dev/null
@@ -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
+       }
+}
index d48c2a0cc974fab8d0a19a4b52c0b346354105fd..5ace8d6793f21bdb87252f7425143fd31f9b454c 100644 (file)
@@ -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
+       }
+}
index 79256893b3604249509c72adf5e68ecb7b301158..eb0fb2a15e813fd7eb2e661b33eadc5bca279c70 100644 (file)
@@ -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$"
        }
 }
 
@@ -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$"
@@ -530,7 +544,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$"
        }
 }
 
@@ -579,18 +593,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 +638,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 +700,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")
                }
        }
index b6421d5e419c435c52757a1c4767b2422cee0838..ad38d420c9bbc8ff5abb724a7a3c56e89b2a7981 100644 (file)
@@ -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 {
@@ -629,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...)
@@ -796,25 +810,37 @@ 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()))
                        }
 
                }
+               if len(asms) > 0 {
+                       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
+                       }
+                       cmd := []string{goTool(), "tool", "asm", "-gensymabis", "-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")
-               }
-               for _, file := range gos {
-                       cmd = append(cmd, filepath.Join(longdir, file.Name()))
+                       cmd = append(cmd, "-asmhdr", "go_asm.h", "-symabis", "symabis")
                }
+               cmd = append(cmd, gos...)
                _, err := runcmd(cmd...)
                if err != nil {
                        t.err = err
@@ -823,9 +849,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
@@ -1189,7 +1213,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)
index c4d0edf87136ac9fa2b044ed9c3ab9de87d3af0b..df4d50d36769ce0f9649f7f3855b156f39eeaaf5 100644 (file)
@@ -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
 
index 55ba81e764e08cdb4dbbf859d55019090dbf4915..8d262dd203783131d6389e023d03fc881c62dd30 100644 (file)
@@ -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
+}